@marimo-team/frontend 0.20.3-dev96 → 0.20.3-dev97

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 (67) hide show
  1. package/dist/assets/{CellStatus-CofFdpAe.js → CellStatus-BNvq_G7v.js} +1 -1
  2. package/dist/assets/{JsonOutput-DKjq8WkX.js → JsonOutput-COYZxr-s.js} +4 -4
  3. package/dist/assets/{MarimoErrorOutput-DDEWmSYt.js → MarimoErrorOutput-CkWg573B.js} +1 -1
  4. package/dist/assets/{RenderHTML-BKdgJWBR.js → RenderHTML-D0riQ7d5.js} +1 -1
  5. package/dist/assets/{add-cell-with-ai--93MrwWW.js → add-cell-with-ai-D7RcfIFT.js} +7 -7
  6. package/dist/assets/{add-connection-dialog-DwmwDRdR.js → add-connection-dialog-a1w-tlmr.js} +1 -1
  7. package/dist/assets/agent-panel-CFECcwTK.js +287 -0
  8. package/dist/assets/{ai-model-dropdown-DQy6lXPg.js → ai-model-dropdown-CS9BLOLl.js} +3 -3
  9. package/dist/assets/{app-config-button-C_j4LbLr.js → app-config-button-Cp9XkpLD.js} +1 -1
  10. package/dist/assets/{azure-BOn6W9-m.js → azure-D5yXrO2H.js} +1 -1
  11. package/dist/assets/{cell-editor-B9yTITVj.js → cell-editor-DRiVkblX.js} +9 -9
  12. package/dist/assets/{cell-link-CZP6Kzmf.js → cell-link-B5vG68jv.js} +1 -1
  13. package/dist/assets/{cells-CigkzIKH.js → cells-BusUaZSh.js} +39 -39
  14. package/dist/assets/{chat-display-C1J9G6Cr.js → chat-display-BrI8TsyH.js} +1 -1
  15. package/dist/assets/{chat-panel-CFDW5ZSi.js → chat-panel-BvHZJKww.js} +1 -1
  16. package/dist/assets/{column-preview-BHAQ5EN7.js → column-preview-CMuWC26D.js} +1 -1
  17. package/dist/assets/{command-C8WcXqB5.js → command-B5q5uni4.js} +1 -1
  18. package/dist/assets/{command-palette-DzEDXP8h.js → command-palette-DH_Lzfkd.js} +1 -1
  19. package/dist/assets/{common-BsEiWPTg.js → common-DQqSG88k.js} +1 -1
  20. package/dist/assets/{components-Bis36Fco.js → components-Cx6Hou1_.js} +1 -1
  21. package/dist/assets/{components-C_r2KU__.js → components-DlLxmdlj.js} +1 -1
  22. package/dist/assets/{context-aware-panel-CdVqO_AM.js → context-aware-panel-BGlzp-FM.js} +2 -2
  23. package/dist/assets/{datasource-B3MFUEL6.js → datasource-DpXRY8fO.js} +2 -2
  24. package/dist/assets/{dependency-graph-panel-D4bT9In2.js → dependency-graph-panel-RR4NgUZ9.js} +1 -1
  25. package/dist/assets/{documentation-panel-BMnKc5yI.js → documentation-panel-Cnv1jm5X.js} +1 -1
  26. package/dist/assets/{download-C35SWaj3.js → download-BUXzyjEd.js} +4 -4
  27. package/dist/assets/{edit-page-BeR5IEJ-.js → edit-page-D9uU9771.js} +7 -7
  28. package/dist/assets/{error-panel-jpJowHuz.js → error-panel-CVb1eCf6.js} +1 -1
  29. package/dist/assets/{file-explorer-panel-BHVDv16o.js → file-explorer-panel-UXRdRpc0.js} +1 -1
  30. package/dist/assets/{floating-outline-BxQvjarL.js → floating-outline-CmXM2v38.js} +1 -1
  31. package/dist/assets/{focus-Bci_MkMH.js → focus-ByrD76nS.js} +1 -1
  32. package/dist/assets/{form-DmsYuKMH.js → form-DOjZnkdK.js} +1 -1
  33. package/dist/assets/{globals-BIlQtd9Z.js → globals-B_lwS1Rg.js} +1 -1
  34. package/dist/assets/{home-page-Dw1bl_Le.js → home-page-DkSd1V6c.js} +2 -2
  35. package/dist/assets/{html-to-image-DkwDXZ7Q.js → html-to-image-DjFNZcCI.js} +1 -1
  36. package/dist/assets/{index-D0SHqLyU.js → index-CywCwPVu.js} +10 -10
  37. package/dist/assets/{kiosk-mode-BXfU4SPi.js → kiosk-mode-CTnBBAQi.js} +1 -1
  38. package/dist/assets/{layout-Cn07VnUl.js → layout-CMmACzb7.js} +3 -3
  39. package/dist/assets/{logs-panel-CNI5XQZv.js → logs-panel-H4W0OnaU.js} +1 -1
  40. package/dist/assets/{markdown-renderer-DHgbXKHX.js → markdown-renderer-B4k8WEFz.js} +1 -1
  41. package/dist/assets/{name-cell-input-BVNjrC55.js → name-cell-input-BUcQnShp.js} +1 -1
  42. package/dist/assets/{outline-panel-DDzSswIl.js → outline-panel-By3ZqBZ9.js} +1 -1
  43. package/dist/assets/{packages-panel-oV7XPDLu.js → packages-panel-Cu_ODGWE.js} +1 -1
  44. package/dist/assets/{panels-OYOPaJTw.js → panels-o_H3ZmT-.js} +1 -1
  45. package/dist/assets/{process-output-B27UYd5L.js → process-output-C6uLELXv.js} +1 -1
  46. package/dist/assets/{readonly-python-code-CyraFlMm.js → readonly-python-code-vSIWAIcL.js} +1 -1
  47. package/dist/assets/{run-page-DDaD2g7X.js → run-page-DhyDG7Rk.js} +1 -1
  48. package/dist/assets/{scratchpad-panel-Bj7X2Na5.js → scratchpad-panel-4t4-HW40.js} +1 -1
  49. package/dist/assets/{session-panel-BCymMoxC.js → session-panel-DIXH9TH9.js} +1 -1
  50. package/dist/assets/{snippets-panel-CSczB-sT.js → snippets-panel-CODg30J-.js} +1 -1
  51. package/dist/assets/{state-LFRjhpk7.js → state-BqcLH_kp.js} +1 -1
  52. package/dist/assets/{switch-Cp5eQmZx.js → switch-E6p3DgBh.js} +1 -1
  53. package/dist/assets/{tracing-DVa-Q9aK.js → tracing-Dl2nQ80-.js} +1 -1
  54. package/dist/assets/{tracing-panel-DFqVXy46.js → tracing-panel-DhGOBk1Q.js} +2 -2
  55. package/dist/assets/{types-B737EDbu.js → types-Cg2HXEUi.js} +1 -1
  56. package/dist/assets/{useAddCell-CZ1y3fpl.js → useAddCell-CsMGD6qQ.js} +1 -1
  57. package/dist/assets/{useCellActionButton-CGxzkJch.js → useCellActionButton-pIt4Gh5R.js} +1 -1
  58. package/dist/assets/{useDeleteCell-Dok0-XOi.js → useDeleteCell-DFKNGNeg.js} +1 -1
  59. package/dist/assets/{useDependencyPanelTab-CYOtvc7A.js → useDependencyPanelTab-vEb9Zdsr.js} +1 -1
  60. package/dist/assets/{useNotebookActions-C8fdJ-I2.js → useNotebookActions-B9ocYS2_.js} +1 -1
  61. package/dist/assets/{useSplitCell-CEPcLfYT.js → useSplitCell-B4bOrJRI.js} +1 -1
  62. package/dist/index.html +29 -29
  63. package/package.json +1 -1
  64. package/src/components/chat/acp/agent-panel.tsx +29 -8
  65. package/src/core/saving/file-state.ts +7 -0
  66. package/src/mount.tsx +6 -1
  67. package/dist/assets/agent-panel-C8ZeX_CD.js +0 -287
@@ -1,21 +1,21 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./esm-C9WujutX.js","./chunk-LvLJmgfZ.js","./dist-CdZb2Grj.js","./dist-CEQIJ2pn.js","./dist-D89dID68.js","./dist-DUY6xZX8.js","./dist-OAWl1fS6.js","./dist-BDJDjQTP.js","./dist-CRVvx8nD.js","./dist-BjtLy-VA.js","./dist-BkKLXyVM.js","./dist-DDs9pMUo.js","./dist-CtKltiBh.js","./dist-Dq_iQ08e.js","./dist-odxAaH5Z.js","./dist-BRjtiDLy.js","./dist-CPbQEKNx.js","./dist-DwtQnQ8D.js","./dist-Dz7aLgyk.js","./dist-B0_AowCW.js","./dist-C0GaLmeM.js","./dist-C9Tymsam.js","./dist-Bw5sFnNi.js","./dist-BA8siKK6.js","./dist-D1GHSZQ_.js","./dist-DArucAWW.js","./dist-CqnPIH_S.js","./dist-DfBASypd.js","./dist-BveopvhJ.js","./dist-DoVqkx6-.js","./dist-gm5AeuIM.js","./dist-51xFOPFs.js","./dist-DZhm7iRc.js","./dist-DpVoU5lF.js","./dist-DiZV-TgQ.js","./dist-6ygzAjca.js","./dist-x2aGlNO5.js","./dist-0qXxt1VF.js","./dist-BmupR6hJ.js","./dist-BYbeMVLN.js","./dist-DUYSgv8L.js","./dist-DnkvqAMq.js","./apl-3xKEEmjQ.js","./apl-_OaVDIdj.js","./asciiarmor-BCugLX69.js","./asciiarmor-C9F03XGV.js","./asn1-B8ndG_Ze.js","./asn1-BnyFT2xh.js","./brainfuck-h1OIoSEo.js","./brainfuck-BDCj_8tQ.js","./cobol-C5qkyUSJ.js","./cobol-CrncQb9J.js","./clike-DPuzjNcL.js","./clike-CoedqJfF.js","./clojure-yGQavt_D.js","./clojure-BEClvbJJ.js","./css-COQFxLQn.js","./css-BpYxrU6m.js","./cmake-yLKyOybp.js","./cmake-CCoJFsI7.js","./coffeescript-CtR3eWCa.js","./coffeescript-DwVkfncu.js","./commonlisp-D-heOGa1.js","./commonlisp-CJ40YQuw.js","./cypher-whf3KLcn.js","./cypher-DtBx1FxP.js","./python-jVWqyNLt.js","./python-D9pCSume.js","./crystal-PRx3aORZ.js","./crystal-YUhScjFU.js","./d-Rxavm_nZ.js","./d-Dah-rTjO.js","./diff-BuBMfzxS.js","./diff-CbRoYxJw.js","./dockerfile-DGts-2Fo.js","./simple-mode-C0eLpHUg.js","./dtd-Byyl3ADK.js","./dtd-DnxzgohM.js","./dylan-zE-fWZ95.js","./dylan-DV-GV0Um.js","./ecl-oGqPqdsN.js","./ecl-D5jDMU68.js","./eiffel-C_tzASKk.js","./eiffel-DKJu2v1N.js","./elm-DowGsQrq.js","./elm-jc1dahX5.js","./erlang-DXj5Mety.js","./erlang-xV-AfkqS.js","./factor-BBRGvEpt.js","./factor-CkLnJXKV.js","./forth-ir5Q2myN.js","./forth-C9zvylLL.js","./fortran-Ckvuc18T.js","./fortran-CyOyVtLP.js","./mllike-Cdk-SxrR.js","./mllike-D58Jm9uo.js","./gas-IcbZgopn.js","./gas-B3PseLpk.js","./gherkin-BUQFbyhq.js","./gherkin-BJegP8jG.js","./groovy-CPRpPrR6.js","./groovy-B7OnG3ZU.js","./haskell-BZ64_L1W.js","./haskell-BtINGz8b.js","./haxe-u0gVVSGf.js","./haxe-DG3vLZ0S.js","./idl-D6vrTcdT.js","./idl-ARaXQ5Lo.js","./javascript-DtGa6W6u.js","./javascript-DbuC-gIm.js","./julia-ChDcWdzF.js","./julia-C2ly3uah.js","./livescript-D3x57DP6.js","./livescript-BHGtnzZk.js","./lua-CfeyF-5c.js","./lua-0hHWC4O5.js","./mirc-B8ay9N_G.js","./mirc-Cc0cHJWO.js","./mathematica-CAUFFTVp.js","./mathematica-BeUaygJp.js","./modelica-cErGJ40J.js","./modelica-CVUPArJj.js","./mumps-CPuZtknR.js","./mumps-CSXER37P.js","./mbox-Duq1SQ_k.js","./mbox-CR4_Euk_.js","./nsis-ggFWkoqT.js","./nsis-DLIsIma3.js","./ntriples-eQBrW6tI.js","./ntriples-BH96LyUh.js","./octave-CcpumlkH.js","./octave-MtIOg8Xr.js","./oz-D3u6XBI4.js","./oz-CQSW4u2r.js","./pascal-COvFIqNx.js","./pascal-kJIfJeBL.js","./perl-BSxTN_bc.js","./perl-DDhi21z2.js","./pig-B5SEJPfW.js","./pig-BdUzMo_O.js","./powershell-T0AiDBtK.js","./powershell-D_qEipPM.js","./properties-CEyxcWzr.js","./properties-CS6vA6nt.js","./protobuf-BgP8VdyX.js","./protobuf-COtqlKri.js","./pug-D1MIs29p.js","./pug-qZYhFFj7.js","./puppet-DQ0s94I4.js","./puppet-Ctozq3R1.js","./q-Ddp_9iFq.js","./q-CKhLXEtL.js","./r-WnM9HAaQ.js","./r-BvAfMHMS.js","./rpm-Cpb0cYbF.js","./rpm-CUTjLkz_.js","./ruby-npoQJqOj.js","./ruby-jDDZwg5-.js","./sas-D5R_hCoQ.js","./sas-mA9119dU.js","./scheme-oK64G5wG.js","./scheme-Bw6sYvQh.js","./shell-D-C8eGy_.js","./shell-BSG_6EVv.js","./sieve-DPRpRdV2.js","./sieve-BvqlFANQ.js","./smalltalk-bsl5ZJOd.js","./smalltalk-CarfjYvX.js","./sparql-CJUH6gR2.js","./sparql-DpdbGHkw.js","./stylus-Dz-M3k6z.js","./stylus-DwqF5JX3.js","./swift-BZHzeogd.js","./swift-XQW_3Dnq.js","./stex-pjf-hOob.js","./stex-FMMSUPAS.js","./verilog-DO_FdUQ9.js","./verilog-uIU1FX2_.js","./tcl-CjjnKQKi.js","./tcl-DSytfKxX.js","./textile-C6DxVHfN.js","./textile-C0sJ895O.js","./toml-DTuUvOIE.js","./toml-Bduwr9FD.js","./troff-yA83BgDZ.js","./troff-DhuvYLXE.js","./ttcn-F0FnYTMB.js","./ttcn-C2K9hXYD.js","./ttcn-cfg-CSr0YVH7.js","./ttcn-cfg-DWjJYHn-.js","./turtle-DaAbI02L.js","./turtle-q-WiynB8.js","./webidl-DUTo0zWa.js","./webidl-Fd2zBPO0.js","./vb-BYziWQVS.js","./vb-BzUPMIAg.js","./vbscript-CP_qFLQN.js","./vbscript-CUBxk5hi.js","./velocity-etCBW8YB.js","./velocity-CFrdKnJ-.js","./vhdl-CtT4O7WT.js","./vhdl-Ca2_GOin.js","./xquery-B0wH9AmB.js","./xquery-S8ffVcwS.js","./yacas-UtDKR_RQ.js","./yacas-BFgZPXn6.js","./z80-gTLyuPxz.js","./z80-P5o2E6_C.js","./mscgen-jRCec7TG.js","./mscgen-B_Av7U7x.js","./dist-CwLG6Za2.js","./dist-CD1ARvPf.js","./dist-CTarqYcj.js","./node-sql-parser-TdBo37ty.js"])))=>i.map(i=>d[i]);
2
- var V6=Object.defineProperty;var H6=(ua,br,Za)=>br in ua?V6(ua,br,{enumerable:!0,configurable:!0,writable:!0,value:Za}):ua[br]=Za;var ve=(ua,br,Za)=>H6(ua,typeof br!="symbol"?br+"":br,Za);import{a as $6,n as k2,o as W6,r as U6,s as gh,t as tt}from"./chunk-LvLJmgfZ.js";import{c as S2,d as K6,i as Fe,l as C2,n as xu,p as Ce,r as Q6,s as G6,u as mn}from"./useEvent-WUlsM6MC.js";import{t as ku}from"./react-Bj1aDYRI.js";import{t as J6}from"./react-dom-CSu739Rf.js";import{B as X6,N as Y6,P as E2,R as T2,T as L2,k as Z6,w as e5}from"./zod-H_cgTO0M.js";import{t as Zn}from"./compiler-runtime-B3qBwwSJ.js";import{f as t5}from"./_Uint8Array-BGESiCQL.js";import{n as n5}from"./toString-DlRqgfqz.js";import{t as r5}from"./toInteger-Cl1doThW.js";import{d as a5,t as i5}from"./isArrayLikeObject-BkJc8lDE.js";import{f as o5}from"./_baseIsEqual-BU8KB_Ip.js";import{n as Xo}from"./assertNever-Dw9aFN4h.js";import{a as yh,i as s5,o as l5,r as c5,s as u5,t as d5}from"./useLifecycle-BDXC6oVR.js";import{t as f5}from"./_baseProperty-DuoFhI7N.js";import{t as O2}from"./debounce-D8CkpJG7.js";import{c as Ar,l as A2,m as be,r as I2,u as p5}from"./useEventListener-CjXriKgk.js";import{t as rn}from"./invariant-awXiPaF0.js";import{f as R2,o as h5,t as M2}from"./utils-CORJ8yYa.js";import{S as vh,r as m5,y as g5}from"./config-D9X9QKiL.js";import{t as y5}from"./jsx-runtime-CP2fAiZX.js";import{t as P2}from"./button-BmOH9agK.js";import{t as Su}from"./cn-d_A4rA-x.js";import{A as v5,At as bh,Bt as $t,C as b5,D as w5,Et as N2,Ft as _5,Gt as x5,H as D2,Ht as ml,I as j2,J as Cu,Jt as aa,Kt as z2,Ot as Yo,S as k5,St as Ka,T as q2,U as S5,Ut as B2,Vt as C5,W as E5,Wt as Eu,Xt as Bi,Yt as Zo,Zt as es,_t as T5,at as Et,b as F2,ct as ts,f as V2,it as L5,jt as O5,k as A5,l as te,mt as I5,nt as H2,ot as R5,p as M5,rt as ia,u as $2,ut as P5,xt as wh,z as W2,zt as Tu}from"./dist-DUY6xZX8.js";import{A as N5,E as D5,S as j5,T as z5,_ as q5,b as B5,d as U2,f as F5,h as V5,m as H5,n as $5,o as _h,p as W5,s as U5,t as K5,u as Q5,v as G5,w as J5,x as X5}from"./dist-CU-Ty5ht.js";import{a as K2,i as Y5,n as vr,o as Q2,p as xh,s as gl}from"./once-DRC4SgqY.js";import{t as Z5}from"./capabilities-CeYo4YI0.js";import{t as eT}from"./cjs-CVt8hZ5L.js";import{t as yl}from"./createReducer-BcTiTw8T.js";import{d as G2,l as J2,n as tT,o as kh,p as nT,r as Lu}from"./dist-D89dID68.js";import{t as X2}from"./main-Cmx6WhDY.js";import{n as Y2,t as rT}from"./useNonce-BY4jV7Yb.js";import{r as aT,t as oa}from"./requests-DZy_SQ_v.js";import{a as iT,c as oT,d as sT,f as Z2,i as lT,l as cT,n as uT,o as Sh,r as dT,s as Ch,t as fT,u as pT}from"./dist-CEQIJ2pn.js";import{t as lt}from"./createLucideIcon-BvP5LBIs.js";import{t as hT}from"./check-BnZGcuDh.js";import{t as mT,u as gT}from"./toDate-DDAiY7kz.js";import{t as Eh}from"./database-zap-B3efE3T2.js";import{n as yT,t as Ou}from"./DeferredRequestRegistry-CMZsNx4R.js";import{t as Bn}from"./badge-CNBv2dAU.js";import{t as re}from"./preload-helper-TXkS1QI3.js";import{a as ew,s as vT}from"./dist-DfBASypd.js";import{a as bT,i as Th,n as wT,r as tw,t as _T}from"./dist-51xFOPFs.js";import{n as xT}from"./stex-FMMSUPAS.js";import{t as vl}from"./use-toast-BhMe50aT.js";import{n as Lh}from"./paths-bMgYkaP2.js";import{n as kT}from"./useTheme-CwdqVOYu.js";import{E as ST,S as CT,_ as Oh,w as nw,x as ET}from"./Combination-tjZP3FH6.js";import{a as TT,c as LT,i as Ah,m as OT,n as AT,o as rw,r as IT,s as RT,t as MT}from"./select-DygbgNTD.js";import{l as PT}from"./dist-CIU0Lack.js";import{i as NT,t as Ih}from"./tooltip-DOQlecCr.js";import{t as Rh}from"./purify.es-CPplrWRQ.js";let Mh,Ph,bl,Nh,aw,iw,Fi,ow,Dh,Au,Vi,sw,lw,cw,wl,uw,Iu,dw,Ru,jh,fw,zh,pw,qh,Mu,_l,Bh,hw,Fh,Vh,xl,Hh,mw,ns,Pu,gw,Qa,$h,Wh,er,Nu,yw,Fn,Du,Uh,vw,ju,Kh,kl,Sl,Ir,tr,zu,qu,Bu,bw,Ga,sa,ww,_w,xw,Qh,Gh,kw,Jh,Sw,Cw,Ew,Cl,Tw,Xh,Yh,Zh,Ja,Lw,Ow,El,Fu,Aw,Iw,em,Rw,Mw,Pw,tm,Vu,Nw,Dw,nm,rm,jw,Tl,zw,qw,Bw,Hu,am,Fw,$u,Ll,Vw,im,om,sm,lm,cm,Hi,um,dm,Hw,fm,pm,hm,$w,En,Wu,$i,nr,Uu,Ww,la,rs,mm,Ye,Ku,gm,Uw,Kw,Qw,Gw,Jw,ym,vm,Xw,Qu,Gu,bm,Yw,Zw,wm,_m,e_,Ju,t_,n_,xm,km,r_,a_,Xu,Yu,i_,Wi,Xa,o_,s_,Ol,Zu,as,l_,ed,Sm,c_,u_,ct,d_,f_,td,ca,nd,p_,Al,Cm,Em,h_,m_,Tm,g_,Lm,y_,rd,v_,b_,ad,w_,__,is,Il,Om,x_,k_,S_,id,Am,C_,E_,Im,Ya,od,T_,sd,L_,Rm,Mm,O_,gn,A_,Pm,Nm,I_,Dm,R_,Ui,ld,jm,Rl,zm,qm,M_,P_,os,Bm,N_,Ki,D_,j_,z_,q_,Fm,B_,F_,V_,cd,rr,H_,Vn,ud,$_,W_,U_,K_,Q_,G_,DT=(async()=>{var cr,ff,li;let ua,br,Za,Hm;ua=tt((e=>{function n(ie,ee){var U=ie.length;ie.push(ee);e:for(;0<U;){var Ae=U-1>>>1,Ve=ie[Ae];if(0<s(Ve,ee))ie[Ae]=ee,ie[U]=Ve,U=Ae;else break e}}function a(ie){return ie.length===0?null:ie[0]}function o(ie){if(ie.length===0)return null;var ee=ie[0],U=ie.pop();if(U!==ee){ie[0]=U;e:for(var Ae=0,Ve=ie.length,nt=Ve>>>1;Ae<nt;){var He=2*(Ae+1)-1,ze=ie[He],Le=He+1,Re=ie[Le];if(0>s(ze,U))Le<Ve&&0>s(Re,ze)?(ie[Ae]=Re,ie[Le]=U,Ae=Le):(ie[Ae]=ze,ie[He]=U,Ae=He);else if(Le<Ve&&0>s(Re,U))ie[Ae]=Re,ie[Le]=U,Ae=Le;else break e}}return ee}function s(ie,ee){var U=ie.sortIndex-ee.sortIndex;return U===0?ie.id-ee.id:U}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var h=Date,p=h.now();e.unstable_now=function(){return h.now()-p}}var g=[],b=[],_=1,S=null,C=3,E=!1,O=!1,M=!1,V=!1,H=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function ne(ie){for(var ee=a(b);ee!==null;){if(ee.callback===null)o(b);else if(ee.startTime<=ie)o(b),ee.sortIndex=ee.expirationTime,n(g,ee);else break;ee=a(b)}}function fe(ie){if(M=!1,ne(ie),!O)if(a(g)!==null)O=!0,R||(R=!0,ye());else{var ee=a(b);ee!==null&&pe(fe,ee.startTime-ie)}}var R=!1,j=-1,F=5,se=-1;function ce(){return V?!0:!(e.unstable_now()-se<F)}function he(){if(V=!1,R){var ie=e.unstable_now();se=ie;var ee=!0;try{e:{O=!1,M&&(M=!1,$(j),j=-1),E=!0;var U=C;try{t:{for(ne(ie),S=a(g);S!==null&&!(S.expirationTime>ie&&ce());){var Ae=S.callback;if(typeof Ae=="function"){S.callback=null,C=S.priorityLevel;var Ve=Ae(S.expirationTime<=ie);if(ie=e.unstable_now(),typeof Ve=="function"){S.callback=Ve,ne(ie),ee=!0;break t}S===a(g)&&o(g),ne(ie)}else o(g);S=a(g)}if(S!==null)ee=!0;else{var nt=a(b);nt!==null&&pe(fe,nt.startTime-ie),ee=!1}}break e}finally{S=null,C=U,E=!1}ee=void 0}}finally{ee?ye():R=!1}}}var ye;if(typeof N=="function")ye=function(){N(he)};else if(typeof MessageChannel<"u"){var xe=new MessageChannel,Qe=xe.port2;xe.port1.onmessage=he,ye=function(){Qe.postMessage(null)}}else ye=function(){H(he,0)};function pe(ie,ee){j=H(function(){ie(e.unstable_now())},ee)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(ie){ie.callback=null},e.unstable_forceFrameRate=function(ie){0>ie||125<ie?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<ie?Math.floor(1e3/ie):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(ie){switch(C){case 1:case 2:case 3:var ee=3;break;default:ee=C}var U=C;C=ee;try{return ie()}finally{C=U}},e.unstable_requestPaint=function(){V=!0},e.unstable_runWithPriority=function(ie,ee){switch(ie){case 1:case 2:case 3:case 4:case 5:break;default:ie=3}var U=C;C=ie;try{return ee()}finally{C=U}},e.unstable_scheduleCallback=function(ie,ee,U){var Ae=e.unstable_now();switch(typeof U=="object"&&U?(U=U.delay,U=typeof U=="number"&&0<U?Ae+U:Ae):U=Ae,ie){case 1:var Ve=-1;break;case 2:Ve=250;break;case 5:Ve=1073741823;break;case 4:Ve=1e4;break;default:Ve=5e3}return Ve=U+Ve,ie={id:_++,callback:ee,priorityLevel:ie,startTime:U,expirationTime:Ve,sortIndex:-1},U>Ae?(ie.sortIndex=U,n(b,ie),a(g)===null&&ie===a(b)&&(M?($(j),j=-1):M=!0,pe(fe,U-Ae))):(ie.sortIndex=Ve,n(g,ie),O||E||(O=!0,R||(R=!0,ye()))),ie},e.unstable_shouldYield=ce,e.unstable_wrapCallback=function(ie){var ee=C;return function(){var U=C;C=ee;try{return ie.apply(this,arguments)}finally{C=U}}}})),br=tt(((e,n)=>{n.exports=ua()})),Za=tt((e=>{var n=br(),a=ku(),o=J6();function s(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function h(t){var r=t,i=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,r.flags&4098&&(i=r.return),t=r.return;while(t)}return r.tag===3?i:null}function p(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function g(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function b(t){if(h(t)!==t)throw Error(s(188))}function _(t){var r=t.alternate;if(!r){if(r=h(t),r===null)throw Error(s(188));return r===t?t:null}for(var i=t,l=r;;){var d=i.return;if(d===null)break;var m=d.alternate;if(m===null){if(l=d.return,l!==null){i=l;continue}break}if(d.child===m.child){for(m=d.child;m;){if(m===i)return b(d),t;if(m===l)return b(d),r;m=m.sibling}throw Error(s(188))}if(i.return!==l.return)i=d,l=m;else{for(var k=!1,L=d.child;L;){if(L===i){k=!0,i=d,l=m;break}if(L===l){k=!0,l=d,i=m;break}L=L.sibling}if(!k){for(L=m.child;L;){if(L===i){k=!0,i=m,l=d;break}if(L===l){k=!0,l=m,i=d;break}L=L.sibling}if(!k)throw Error(s(189))}}if(i.alternate!==l)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?t:r}function S(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=S(t),r!==null)return r;t=t.sibling}return null}var C=Object.assign,E=Symbol.for("react.element"),O=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),ne=Symbol.for("react.context"),fe=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),se=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),he=Symbol.for("react.memo_cache_sentinel"),ye=Symbol.iterator;function xe(t){return typeof t!="object"||!t?null:(t=ye&&t[ye]||t["@@iterator"],typeof t=="function"?t:null)}var Qe=Symbol.for("react.client.reference");function pe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Qe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case V:return"Fragment";case $:return"Profiler";case H:return"StrictMode";case R:return"Suspense";case j:return"SuspenseList";case ce:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case M:return"Portal";case ne:return t.displayName||"Context";case N:return(t._context.displayName||"Context")+".Consumer";case fe:var r=t.render;return t=t.displayName,t||(t=(t=r.displayName||r.name||"",t===""?"ForwardRef":"ForwardRef("+t+")")),t;case F:return r=t.displayName||null,r===null?pe(t.type)||"Memo":r;case se:r=t._payload,t=t._init;try{return pe(t(r))}catch{}}return null}var ie=Array.isArray,ee=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ae={pending:!1,data:null,method:null,action:null},Ve=[],nt=-1;function He(t){return{current:t}}function ze(t){0>nt||(t.current=Ve[nt],Ve[nt]=null,nt--)}function Le(t,r){nt++,Ve[nt]=t.current,t.current=r}var Re=He(null),Tt=He(null),Mt=He(null),ya=He(null);function co(t,r){switch(Le(Mt,r),Le(Tt,t),Le(Re,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?Gb(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=Gb(r),t=Jb(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ze(Re),Le(Re,t)}function An(){ze(Re),ze(Tt),ze(Mt)}function Pr(t){t.memoizedState!==null&&Le(ya,t);var r=Re.current,i=Jb(r,t.type);r!==i&&(Le(Tt,t),Le(Re,i))}function ci(t){Tt.current===t&&(ze(Re),ze(Tt)),ya.current===t&&(ze(ya),dl._currentValue=Ae)}var uo,bs;function ht(t){if(uo===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);uo=r&&r[1]||"",bs=-1<i.stack.indexOf(`
2
+ var H6=Object.defineProperty;var $6=(ua,br,Za)=>br in ua?H6(ua,br,{enumerable:!0,configurable:!0,writable:!0,value:Za}):ua[br]=Za;var ve=(ua,br,Za)=>$6(ua,typeof br!="symbol"?br+"":br,Za);import{a as W6,n as k2,o as U6,r as K6,s as gh,t as tt}from"./chunk-LvLJmgfZ.js";import{c as S2,d as Q6,i as Fe,l as C2,n as xu,p as Ce,r as G6,s as J6,u as mn}from"./useEvent-WUlsM6MC.js";import{t as ku}from"./react-Bj1aDYRI.js";import{t as X6}from"./react-dom-CSu739Rf.js";import{B as Y6,N as Z6,P as E2,R as T2,T as L2,k as e5,w as t5}from"./zod-H_cgTO0M.js";import{t as Zn}from"./compiler-runtime-B3qBwwSJ.js";import{f as n5}from"./_Uint8Array-BGESiCQL.js";import{n as r5}from"./toString-DlRqgfqz.js";import{t as a5}from"./toInteger-Cl1doThW.js";import{d as i5,t as o5}from"./isArrayLikeObject-BkJc8lDE.js";import{f as s5}from"./_baseIsEqual-BU8KB_Ip.js";import{n as Xo}from"./assertNever-Dw9aFN4h.js";import{a as yh,i as l5,o as c5,r as u5,s as d5,t as f5}from"./useLifecycle-BDXC6oVR.js";import{t as p5}from"./_baseProperty-DuoFhI7N.js";import{t as O2}from"./debounce-D8CkpJG7.js";import{c as Ar,l as A2,m as be,r as I2,u as h5}from"./useEventListener-CjXriKgk.js";import{t as rn}from"./invariant-awXiPaF0.js";import{f as R2,o as m5,t as M2}from"./utils-CORJ8yYa.js";import{S as vh,r as g5,y as y5}from"./config-D9X9QKiL.js";import{t as v5}from"./jsx-runtime-CP2fAiZX.js";import{t as P2}from"./button-BmOH9agK.js";import{t as Su}from"./cn-d_A4rA-x.js";import{A as b5,At as bh,Bt as $t,C as w5,D as _5,Et as N2,Ft as x5,Gt as k5,H as D2,Ht as ml,I as j2,J as Cu,Jt as aa,Kt as z2,Ot as Yo,S as S5,St as Ka,T as q2,U as C5,Ut as B2,Vt as E5,W as T5,Wt as Eu,Xt as Bi,Yt as Zo,Zt as es,_t as L5,at as Et,b as F2,ct as ts,f as V2,it as O5,jt as A5,k as I5,l as te,mt as R5,nt as H2,ot as M5,p as P5,rt as ia,u as $2,ut as N5,xt as wh,z as W2,zt as Tu}from"./dist-DUY6xZX8.js";import{A as D5,E as j5,S as z5,T as q5,_ as B5,b as F5,d as U2,f as V5,h as H5,m as $5,n as W5,o as _h,p as U5,s as K5,t as Q5,u as G5,v as J5,w as X5,x as Y5}from"./dist-CU-Ty5ht.js";import{a as K2,i as Z5,n as vr,o as Q2,p as xh,s as gl}from"./once-DRC4SgqY.js";import{t as eT}from"./capabilities-CeYo4YI0.js";import{t as tT}from"./cjs-CVt8hZ5L.js";import{t as yl}from"./createReducer-BcTiTw8T.js";import{d as G2,l as J2,n as nT,o as kh,p as rT,r as Lu}from"./dist-D89dID68.js";import{t as X2}from"./main-Cmx6WhDY.js";import{n as Y2,t as aT}from"./useNonce-BY4jV7Yb.js";import{r as iT,t as oa}from"./requests-DZy_SQ_v.js";import{a as oT,c as sT,d as lT,f as Z2,i as cT,l as uT,n as dT,o as Sh,r as fT,s as Ch,t as pT,u as hT}from"./dist-CEQIJ2pn.js";import{t as lt}from"./createLucideIcon-BvP5LBIs.js";import{t as mT}from"./check-BnZGcuDh.js";import{t as gT,u as yT}from"./toDate-DDAiY7kz.js";import{t as Eh}from"./database-zap-B3efE3T2.js";import{n as vT,t as Ou}from"./DeferredRequestRegistry-CMZsNx4R.js";import{t as Bn}from"./badge-CNBv2dAU.js";import{t as re}from"./preload-helper-TXkS1QI3.js";import{a as ew,s as bT}from"./dist-DfBASypd.js";import{a as wT,i as Th,n as _T,r as tw,t as xT}from"./dist-51xFOPFs.js";import{n as kT}from"./stex-FMMSUPAS.js";import{t as vl}from"./use-toast-BhMe50aT.js";import{n as Lh}from"./paths-bMgYkaP2.js";import{n as ST}from"./useTheme-CwdqVOYu.js";import{E as CT,S as ET,_ as Oh,w as nw,x as TT}from"./Combination-tjZP3FH6.js";import{a as LT,c as OT,i as Ah,m as AT,n as IT,o as rw,r as RT,s as MT,t as PT}from"./select-DygbgNTD.js";import{l as NT}from"./dist-CIU0Lack.js";import{i as DT,t as Ih}from"./tooltip-DOQlecCr.js";import{t as Rh}from"./purify.es-CPplrWRQ.js";let Mh,Ph,bl,Nh,aw,iw,Fi,ow,Dh,Au,Vi,sw,lw,jh,wl,cw,Iu,uw,zh,qh,dw,Bh,fw,Ru,Mu,_l,Fh,pw,Vh,Hh,xl,$h,hw,ns,Pu,mw,Qa,Wh,Uh,er,Nu,gw,Fn,Du,Kh,yw,ju,Qh,kl,Sl,Ir,tr,zu,qu,Bu,vw,Ga,sa,bw,ww,_w,Gh,Jh,xw,Fu,Xh,kw,Sw,Cw,Cl,Ew,Yh,Zh,em,Ja,Tw,Lw,El,Vu,Ow,Aw,Iw,Rw,Mw,Pw,tm,Nw,Dw,jw,nm,rm,zw,Tl,qw,Bw,Fw,Hu,am,Vw,$u,Ll,Hw,im,om,sm,lm,cm,Hi,um,dm,$w,fm,pm,hm,Ww,Uw,Wu,$i,nr,Uu,Kw,la,rs,mm,Ye,Vn,gm,Qw,Gw,Jw,gn,Xw,ym,vm,Yw,Ol,Ku,bm,Zw,e_,wm,_m,t_,Qu,Gu,n_,xm,km,r_,Xa,Ju,Xu,a_,Wi,Sm,i_,o_,Al,Yu,as,s_,Zu,Cm,l_,c_,ct,u_,d_,ed,ca,td,f_,p_,Em,Tm,h_,m_,g_,y_,Lm,v_,nd,b_,w_,rd,__,x_,k_,Il,Om,S_,C_,E_,ad,Am,T_,L_,Im,Ya,id,O_,od,A_,Rm,Mm,I_,is,R_,Pm,Nm,M_,Dm,P_,Ui,sd,jm,Rl,zm,qm,N_,D_,En,Bm,j_,Ki,z_,q_,B_,F_,Fm,V_,ld,H_,cd,rr,$_,os,ud,W_,U_,K_,Q_,G_,J_,jT=(async()=>{var cr,ff,li;let ua,br,Za,Hm;ua=tt((e=>{function n(ie,ee){var U=ie.length;ie.push(ee);e:for(;0<U;){var Ae=U-1>>>1,Ve=ie[Ae];if(0<s(Ve,ee))ie[Ae]=ee,ie[U]=Ve,U=Ae;else break e}}function a(ie){return ie.length===0?null:ie[0]}function o(ie){if(ie.length===0)return null;var ee=ie[0],U=ie.pop();if(U!==ee){ie[0]=U;e:for(var Ae=0,Ve=ie.length,nt=Ve>>>1;Ae<nt;){var He=2*(Ae+1)-1,ze=ie[He],Le=He+1,Re=ie[Le];if(0>s(ze,U))Le<Ve&&0>s(Re,ze)?(ie[Ae]=Re,ie[Le]=U,Ae=Le):(ie[Ae]=ze,ie[He]=U,Ae=He);else if(Le<Ve&&0>s(Re,U))ie[Ae]=Re,ie[Le]=U,Ae=Le;else break e}}return ee}function s(ie,ee){var U=ie.sortIndex-ee.sortIndex;return U===0?ie.id-ee.id:U}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var h=Date,p=h.now();e.unstable_now=function(){return h.now()-p}}var g=[],b=[],_=1,S=null,C=3,E=!1,O=!1,M=!1,V=!1,H=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function ne(ie){for(var ee=a(b);ee!==null;){if(ee.callback===null)o(b);else if(ee.startTime<=ie)o(b),ee.sortIndex=ee.expirationTime,n(g,ee);else break;ee=a(b)}}function fe(ie){if(M=!1,ne(ie),!O)if(a(g)!==null)O=!0,R||(R=!0,ye());else{var ee=a(b);ee!==null&&pe(fe,ee.startTime-ie)}}var R=!1,j=-1,F=5,se=-1;function ce(){return V?!0:!(e.unstable_now()-se<F)}function he(){if(V=!1,R){var ie=e.unstable_now();se=ie;var ee=!0;try{e:{O=!1,M&&(M=!1,$(j),j=-1),E=!0;var U=C;try{t:{for(ne(ie),S=a(g);S!==null&&!(S.expirationTime>ie&&ce());){var Ae=S.callback;if(typeof Ae=="function"){S.callback=null,C=S.priorityLevel;var Ve=Ae(S.expirationTime<=ie);if(ie=e.unstable_now(),typeof Ve=="function"){S.callback=Ve,ne(ie),ee=!0;break t}S===a(g)&&o(g),ne(ie)}else o(g);S=a(g)}if(S!==null)ee=!0;else{var nt=a(b);nt!==null&&pe(fe,nt.startTime-ie),ee=!1}}break e}finally{S=null,C=U,E=!1}ee=void 0}}finally{ee?ye():R=!1}}}var ye;if(typeof N=="function")ye=function(){N(he)};else if(typeof MessageChannel<"u"){var xe=new MessageChannel,Qe=xe.port2;xe.port1.onmessage=he,ye=function(){Qe.postMessage(null)}}else ye=function(){H(he,0)};function pe(ie,ee){j=H(function(){ie(e.unstable_now())},ee)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(ie){ie.callback=null},e.unstable_forceFrameRate=function(ie){0>ie||125<ie?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<ie?Math.floor(1e3/ie):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(ie){switch(C){case 1:case 2:case 3:var ee=3;break;default:ee=C}var U=C;C=ee;try{return ie()}finally{C=U}},e.unstable_requestPaint=function(){V=!0},e.unstable_runWithPriority=function(ie,ee){switch(ie){case 1:case 2:case 3:case 4:case 5:break;default:ie=3}var U=C;C=ie;try{return ee()}finally{C=U}},e.unstable_scheduleCallback=function(ie,ee,U){var Ae=e.unstable_now();switch(typeof U=="object"&&U?(U=U.delay,U=typeof U=="number"&&0<U?Ae+U:Ae):U=Ae,ie){case 1:var Ve=-1;break;case 2:Ve=250;break;case 5:Ve=1073741823;break;case 4:Ve=1e4;break;default:Ve=5e3}return Ve=U+Ve,ie={id:_++,callback:ee,priorityLevel:ie,startTime:U,expirationTime:Ve,sortIndex:-1},U>Ae?(ie.sortIndex=U,n(b,ie),a(g)===null&&ie===a(b)&&(M?($(j),j=-1):M=!0,pe(fe,U-Ae))):(ie.sortIndex=Ve,n(g,ie),O||E||(O=!0,R||(R=!0,ye()))),ie},e.unstable_shouldYield=ce,e.unstable_wrapCallback=function(ie){var ee=C;return function(){var U=C;C=ee;try{return ie.apply(this,arguments)}finally{C=U}}}})),br=tt(((e,n)=>{n.exports=ua()})),Za=tt((e=>{var n=br(),a=ku(),o=X6();function s(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function h(t){var r=t,i=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,r.flags&4098&&(i=r.return),t=r.return;while(t)}return r.tag===3?i:null}function p(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function g(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function b(t){if(h(t)!==t)throw Error(s(188))}function _(t){var r=t.alternate;if(!r){if(r=h(t),r===null)throw Error(s(188));return r===t?t:null}for(var i=t,l=r;;){var d=i.return;if(d===null)break;var m=d.alternate;if(m===null){if(l=d.return,l!==null){i=l;continue}break}if(d.child===m.child){for(m=d.child;m;){if(m===i)return b(d),t;if(m===l)return b(d),r;m=m.sibling}throw Error(s(188))}if(i.return!==l.return)i=d,l=m;else{for(var k=!1,L=d.child;L;){if(L===i){k=!0,i=d,l=m;break}if(L===l){k=!0,l=d,i=m;break}L=L.sibling}if(!k){for(L=m.child;L;){if(L===i){k=!0,i=m,l=d;break}if(L===l){k=!0,l=m,i=d;break}L=L.sibling}if(!k)throw Error(s(189))}}if(i.alternate!==l)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?t:r}function S(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=S(t),r!==null)return r;t=t.sibling}return null}var C=Object.assign,E=Symbol.for("react.element"),O=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),ne=Symbol.for("react.context"),fe=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),se=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),he=Symbol.for("react.memo_cache_sentinel"),ye=Symbol.iterator;function xe(t){return typeof t!="object"||!t?null:(t=ye&&t[ye]||t["@@iterator"],typeof t=="function"?t:null)}var Qe=Symbol.for("react.client.reference");function pe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Qe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case V:return"Fragment";case $:return"Profiler";case H:return"StrictMode";case R:return"Suspense";case j:return"SuspenseList";case ce:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case M:return"Portal";case ne:return t.displayName||"Context";case N:return(t._context.displayName||"Context")+".Consumer";case fe:var r=t.render;return t=t.displayName,t||(t=(t=r.displayName||r.name||"",t===""?"ForwardRef":"ForwardRef("+t+")")),t;case F:return r=t.displayName||null,r===null?pe(t.type)||"Memo":r;case se:r=t._payload,t=t._init;try{return pe(t(r))}catch{}}return null}var ie=Array.isArray,ee=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ae={pending:!1,data:null,method:null,action:null},Ve=[],nt=-1;function He(t){return{current:t}}function ze(t){0>nt||(t.current=Ve[nt],Ve[nt]=null,nt--)}function Le(t,r){nt++,Ve[nt]=t.current,t.current=r}var Re=He(null),Tt=He(null),Mt=He(null),ya=He(null);function co(t,r){switch(Le(Mt,r),Le(Tt,t),Le(Re,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?Gb(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=Gb(r),t=Jb(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ze(Re),Le(Re,t)}function An(){ze(Re),ze(Tt),ze(Mt)}function Pr(t){t.memoizedState!==null&&Le(ya,t);var r=Re.current,i=Jb(r,t.type);r!==i&&(Le(Tt,t),Le(Re,i))}function ci(t){Tt.current===t&&(ze(Re),ze(Tt)),ya.current===t&&(ze(ya),dl._currentValue=Ae)}var uo,bs;function ht(t){if(uo===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);uo=r&&r[1]||"",bs=-1<i.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+uo+t+bs}var ws=!1;function vn(t,r){if(!t||ws)return"";ws=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(ae){var Y=ae}Reflect.construct(t,[],ue)}else{try{ue.call()}catch(ae){Y=ae}t.call(ue.prototype)}}else{try{throw Error()}catch(ae){Y=ae}(ue=t())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(ae){if(ae&&Y&&typeof ae.stack=="string")return[ae.stack,Y.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=l.DetermineComponentFrameRoot(),k=m[0],L=m[1];if(k&&L){var q=k.split(`
5
5
  `),J=L.split(`
6
6
  `);for(d=l=0;l<q.length&&!q[l].includes("DetermineComponentFrameRoot");)l++;for(;d<J.length&&!J[d].includes("DetermineComponentFrameRoot");)d++;if(l===q.length||d===J.length)for(l=q.length-1,d=J.length-1;1<=l&&0<=d&&q[l]!==J[d];)d--;for(;1<=l&&0<=d;l--,d--)if(q[l]!==J[d]){if(l!==1||d!==1)do if(l--,d--,0>d||q[l]!==J[d]){var oe=`
7
7
  `+q[l].replace(" at new "," at ");return t.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",t.displayName)),oe}while(1<=l&&0<=d);break}}}finally{ws=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?ht(i):""}function pf(t,r){switch(t.tag){case 26:case 27:case 5:return ht(t.type);case 16:return ht("Lazy");case 13:return t.child!==r&&r!==null?ht("Suspense Fallback"):ht("Suspense");case 19:return ht("SuspenseList");case 0:case 15:return vn(t.type,!1);case 11:return vn(t.type.render,!1);case 1:return vn(t.type,!0);case 31:return ht("Activity");default:return""}}function tc(t){try{var r="",i=null;do r+=pf(t,i),i=t,t=t.return;while(t);return r}catch(l){return`
8
8
  Error generating stack: `+l.message+`
9
- `+l.stack}}var fo=Object.prototype.hasOwnProperty,ur=n.unstable_scheduleCallback,bn=n.unstable_cancelCallback,hf=n.unstable_shouldYield,nc=n.unstable_requestPaint,Jt=n.unstable_now,mf=n.unstable_getCurrentPriorityLevel,Nr=n.unstable_ImmediatePriority,rc=n.unstable_UserBlockingPriority,Pt=n.unstable_NormalPriority,po=n.unstable_LowPriority,kt=n.unstable_IdlePriority,gf=n.log,yf=n.unstable_setDisableYieldValue,ui=null,on=null;function Ue(t){if(typeof gf=="function"&&yf(t),on&&typeof on.setStrictMode=="function")try{on.setStrictMode(ui,t)}catch{}}var mt=Math.clz32?Math.clz32:kr,wt=Math.log,Xt=Math.LN2;function kr(t){return t>>>=0,t===0?32:31-(wt(t)/Xt|0)|0}var di=256,Lt=262144,va=4194304;function Dr(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ho(t,r,i){var l=t.pendingLanes;if(l===0)return 0;var d=0,m=t.suspendedLanes,k=t.pingedLanes;t=t.warmLanes;var L=l&134217727;return L===0?(L=l&~m,L===0?k===0?i||(i=l&~t,i!==0&&(d=Dr(i))):d=Dr(k):d=Dr(L)):(l=L&~m,l===0?(k&=L,k===0?i||(i=L&~t,i!==0&&(d=Dr(i))):d=Dr(k)):d=Dr(l)),d===0?0:r!==0&&r!==d&&(r&m)===0&&(m=d&-d,i=r&-r,m>=i||m===32&&i&4194048)?r:d}function ba(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function ac(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ic(){var t=va;return va<<=1,!(va&62914560)&&(va=4194304),t}function _s(t){for(var r=[],i=0;31>i;i++)r.push(t);return r}function fi(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function vf(t,r,i,l,d,m){var k=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var L=t.entanglements,q=t.expirationTimes,J=t.hiddenUpdates;for(i=k&~i;0<i;){var oe=31-mt(i),ue=1<<oe;L[oe]=0,q[oe]=-1;var Y=J[oe];if(Y!==null)for(J[oe]=null,oe=0;oe<Y.length;oe++){var ae=Y[oe];ae!==null&&(ae.lane&=-536870913)}i&=~ue}l!==0&&jr(t,l,0),m!==0&&d===0&&t.tag!==0&&(t.suspendedLanes|=m&~(k&~r))}function jr(t,r,i){t.pendingLanes|=r,t.suspendedLanes&=~r;var l=31-mt(r);t.entangledLanes|=r,t.entanglements[l]=t.entanglements[l]|1073741824|i&261930}function mo(t,r){var i=t.entangledLanes|=r;for(t=t.entanglements;i;){var l=31-mt(i),d=1<<l;d&r|t[l]&r&&(t[l]|=r),i&=~d}}function oc(t,r){var i=r&-r;return i=i&42?1:In(i),(i&(t.suspendedLanes|r))===0?i:0}function In(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function xs(t){return t&=-t,2<t?8<t?t&134217727?32:268435456:8:2}function sc(){var t=U.p;return t===0?(t=window.event,t===void 0?32:y2(t.type)):t}function Rn(t,r){var i=U.p;try{return U.p=t,r()}finally{U.p=i}}var Hn=Math.random().toString(36).slice(2),Ft="__reactFiber$"+Hn,Yt="__reactProps$"+Hn,wa="__reactContainer$"+Hn,ks="__reactEvents$"+Hn,lc="__reactListeners$"+Hn,bf="__reactHandles$"+Hn,Ss="__reactResources$"+Hn,pi="__reactMarker$"+Hn;function go(t){delete t[Ft],delete t[Yt],delete t[ks],delete t[lc],delete t[bf]}function Sr(t){var r=t[Ft];if(r)return r;for(var i=t.parentNode;i;){if(r=i[wa]||i[Ft]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(t=r2(t);t!==null;){if(i=t[Ft])return i;t=r2(t)}return r}t=i,i=t.parentNode}return null}function _a(t){if(t=t[Ft]||t[wa]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function dn(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function xa(t){var r=t[Ss];return r||(r=t[Ss]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Ot(t){t[pi]=!0}var Cs=new Set,cc={};function Cr(t,r){ka(t,r),ka(t+"Capture",r)}function ka(t,r){for(cc[t]=r,t=0;t<r.length;t++)Cs.add(r[t])}var wf=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),wn={},uc={};function _f(t){return fo.call(uc,t)?!0:fo.call(wn,t)?!1:wf.test(t)?uc[t]=!0:(wn[t]=!0,!1)}function hi(t,r,i){if(_f(r))if(i===null)t.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+i)}}function mi(t,r,i){if(i===null)t.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+i)}}function dr(t,r,i,l){if(l===null)t.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttributeNS(r,i,""+l)}}function fn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function dc(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function fc(t,r,i){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&l!==void 0&&typeof l.get=="function"&&typeof l.set=="function"){var d=l.get,m=l.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return d.call(this)},set:function(k){i=""+k,m.call(this,k)}}),Object.defineProperty(t,r,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(k){i=""+k},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Es(t){if(!t._valueTracker){var r=dc(t)?"checked":"value";t._valueTracker=fc(t,r,""+t[r])}}function Ts(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var i=r.getValue(),l="";return t&&(l=dc(t)?t.checked?"true":"false":t.value),t=l,t===i?!1:(r.setValue(t),!0)}function sn(t){if(t||(t=typeof document<"u"?document:void 0),t===void 0)return null;try{return t.activeElement||t.body}catch{return t.body}}var Ge=/[\n"\\]/g;function Mn(t){return t.replace(Ge,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Sa(t,r,i,l,d,m,k,L){t.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?t.type=k:t.removeAttribute("type"),r==null?k!=="submit"&&k!=="reset"||t.removeAttribute("value"):k==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+fn(r)):t.value!==""+fn(r)&&(t.value=""+fn(r)),r==null?i==null?l!=null&&t.removeAttribute("value"):zr(t,k,fn(i)):zr(t,k,fn(r)),d==null&&m!=null&&(t.defaultChecked=!!m),d!=null&&(t.checked=d&&typeof d!="function"&&typeof d!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?t.name=""+fn(L):t.removeAttribute("name")}function pc(t,r,i,l,d,m,k,L){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),r!=null||i!=null){if(!(m!=="submit"&&m!=="reset"||r!=null)){Es(t);return}i=i==null?"":""+fn(i),r=r==null?i:""+fn(r),L||r===t.value||(t.value=r),t.defaultValue=r}l??(l=d),l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=L?t.checked:!!l,t.defaultChecked=!!l,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(t.name=k),Es(t)}function zr(t,r,i){r==="number"&&sn(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function Ca(t,r,i,l){if(t=t.options,r){r={};for(var d=0;d<i.length;d++)r["$"+i[d]]=!0;for(i=0;i<t.length;i++)d=r.hasOwnProperty("$"+t[i].value),t[i].selected!==d&&(t[i].selected=d),d&&l&&(t[i].defaultSelected=!0)}else{for(i=""+fn(i),r=null,d=0;d<t.length;d++){if(t[d].value===i){t[d].selected=!0,l&&(t[d].defaultSelected=!0);return}r!==null||t[d].disabled||(r=t[d])}r!==null&&(r.selected=!0)}}function Ea(t,r,i){if(r!=null&&(r=""+fn(r),r!==t.value&&(t.value=r),i==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=i==null?"":""+fn(i)}function yo(t,r,i,l){if(r==null){if(l!=null){if(i!=null)throw Error(s(92));if(ie(l)){if(1<l.length)throw Error(s(93));l=l[0]}i=l}i??(i=""),r=i}i=fn(r),t.defaultValue=i,l=t.textContent,l===i&&l!==""&&l!==null&&(t.value=l),Es(t)}function qr(t,r){if(r){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=r;return}}t.textContent=r}var xf=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Br(t,r,i){var l=r.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":l?t.setProperty(r,i):typeof i!="number"||i===0||xf.has(r)?r==="float"?t.cssFloat=i:t[r]=(""+i).trim():t[r]=i+"px"}function hc(t,r,i){if(r!=null&&typeof r!="object")throw Error(s(62));if(t=t.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var d in r)l=r[d],r.hasOwnProperty(d)&&i[d]!==l&&Br(t,d,l)}else for(var m in r)r.hasOwnProperty(m)&&Br(t,m,r[m])}function gi(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var vo=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),mc=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function bo(t){return mc.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function $n(){}var Kt=null;function Ls(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var pn=null,Er=null;function gc(t){var r=_a(t);if(r&&(t=r.stateNode)){var i=t[Yt]||null;e:switch(t=r.stateNode,r.type){case"input":if(Sa(t,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),r=i.name,i.type==="radio"&&r!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Mn(""+r)+'"][type="radio"]'),r=0;r<i.length;r++){var l=i[r];if(l!==t&&l.form===t.form){var d=l[Yt]||null;if(!d)throw Error(s(90));Sa(l,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(r=0;r<i.length;r++)l=i[r],l.form===t.form&&Ts(l)}break e;case"textarea":Ea(t,i.value,i.defaultValue);break e;case"select":r=i.value,r!=null&&Ca(t,!!i.multiple,r,!1)}}}var Os=!1;function yc(t,r,i){if(Os)return t(r,i);Os=!0;try{return t(r)}finally{if(Os=!1,(pn!==null||Er!==null)&&(tu(),pn&&(r=pn,t=Er,Er=pn=null,gc(r),t)))for(r=0;r<t.length;r++)gc(t[r])}}function yi(t,r){var i=t.stateNode;if(i===null)return null;var l=i[Yt]||null;if(l===null)return null;i=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(s(231,r,typeof i));return i}var fr=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0),As=!1;if(fr)try{var vi={};Object.defineProperty(vi,"passive",{get:function(){As=!0}}),window.addEventListener("test",vi,vi),window.removeEventListener("test",vi,vi)}catch{As=!1}var pr=null,wo=null,bi=null;function Is(){if(bi)return bi;var t,r=wo,i=r.length,l,d="value"in pr?pr.value:pr.textContent,m=d.length;for(t=0;t<i&&r[t]===d[t];t++);var k=i-t;for(l=1;l<=k&&r[i-l]===d[m-l];l++);return bi=d.slice(t,1<l?1-l:void 0)}function wi(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function _i(){return!0}function Rs(){return!1}function Qt(t){function r(i,l,d,m,k){for(var L in this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=m,this.target=k,this.currentTarget=null,t)t.hasOwnProperty(L)&&(i=t[L],this[L]=i?i(m):m[L]);return this.isDefaultPrevented=(m.defaultPrevented==null?m.returnValue===!1:m.defaultPrevented)?_i:Rs,this.isPropagationStopped=Rs,this}return C(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=_i)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=_i)},persist:function(){},isPersistent:_i}),r}var Fr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},u=Qt(Fr),f=C({},Fr,{view:0,detail:0}),y=Qt(f),v,w,x,T=C({},f,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Oe,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==x&&(x&&t.type==="mousemove"?(v=t.screenX-x.screenX,w=t.screenY-x.screenY):w=v=0,x=t),v)},movementY:function(t){return"movementY"in t?t.movementY:w}}),A=Qt(T),I=Qt(C({},T,{dataTransfer:0})),D=Qt(C({},f,{relatedTarget:0})),P=Qt(C({},Fr,{animationName:0,elapsedTime:0,pseudoElement:0})),Z=Qt(C({},Fr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}})),X=Qt(C({},Fr,{data:0})),K={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Q={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ge={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function me(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=ge[t])?!!r[t]:!1}function Oe(){return me}var we=Qt(C({},f,{key:function(t){if(t.key){var r=K[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=wi(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Q[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Oe,charCode:function(t){return t.type==="keypress"?wi(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?wi(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}})),Ee=Qt(C({},T,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Je=Qt(C({},f,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Oe})),De=Qt(C({},Fr,{propertyName:0,elapsedTime:0,pseudoElement:0})),ut=Qt(C({},T,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0})),yt=Qt(C({},Fr,{newState:0,oldState:0})),Me=[9,13,27,32],Ie=fr&&"CompositionEvent"in window,_t=null;fr&&"documentMode"in document&&(_t=document.documentMode);var Nt=fr&&"TextEvent"in window&&!_t,Vt=fr&&(!Ie||_t&&8<_t&&11>=_t),xi=" ",vc=!1;function bc(t,r){switch(t){case"keyup":return Me.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _o(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var xo=!1;function l4(t,r){switch(t){case"compositionend":return _o(r);case"keypress":return r.which===32?(vc=!0,xi):null;case"textInput":return t=r.data,t===xi&&vc?null:t;default:return null}}function c4(t,r){if(xo)return t==="compositionend"||!Ie&&bc(t,r)?(t=Is(),bi=wo=pr=null,xo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Vt&&r.locale!=="ko"?null:r.data;default:return null}}var u4={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ly(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!u4[t.type]:r==="textarea"}function cy(t,r,i,l){pn?Er?Er.push(l):Er=[l]:pn=l,r=lu(r,"onChange"),0<r.length&&(i=new u("onChange","change",null,i,l),t.push({event:i,listeners:r}))}var Ms=null,Ps=null;function d4(t){Vb(t,0)}function wc(t){if(Ts(dn(t)))return t}function uy(t,r){if(t==="change")return r}var dy=!1;if(fr){var kf;if(fr){var Sf="oninput"in document;if(!Sf){var fy=document.createElement("div");fy.setAttribute("oninput","return;"),Sf=typeof fy.oninput=="function"}kf=Sf}else kf=!1;dy=kf&&(!document.documentMode||9<document.documentMode)}function py(){Ms&&(Ms.detachEvent("onpropertychange",hy),Ps=Ms=null)}function hy(t){if(t.propertyName==="value"&&wc(Ps)){var r=[];cy(r,Ps,t,Ls(t)),yc(d4,r)}}function f4(t,r,i){t==="focusin"?(py(),Ms=r,Ps=i,Ms.attachEvent("onpropertychange",hy)):t==="focusout"&&py()}function p4(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return wc(Ps)}function h4(t,r){if(t==="click")return wc(r)}function m4(t,r){if(t==="input"||t==="change")return wc(r)}function g4(t,r){return t===r&&(t!==0||1/t==1/r)||t!==t&&r!==r}var Pn=typeof Object.is=="function"?Object.is:g4;function Ns(t,r){if(Pn(t,r))return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var i=Object.keys(t),l=Object.keys(r);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var d=i[l];if(!fo.call(r,d)||!Pn(t[d],r[d]))return!1}return!0}function my(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function gy(t,r){var i=my(t);t=0;for(var l;i;){if(i.nodeType===3){if(l=t+i.textContent.length,t<=r&&l>=r)return{node:i,offset:r-t};t=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=my(i)}}function yy(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?yy(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function vy(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=sn(t.document);r instanceof t.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)t=r.contentWindow;else break;r=sn(t.document)}return r}function Cf(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var y4=fr&&"documentMode"in document&&11>=document.documentMode,ko=null,Ef=null,Ds=null,Tf=!1;function by(t,r,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Tf||ko==null||ko!==sn(l)||(l=ko,"selectionStart"in l&&Cf(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ds&&Ns(Ds,l)||(Ds=l,l=lu(Ef,"onSelect"),0<l.length&&(r=new u("onSelect","select",null,r,i),t.push({event:r,listeners:l}),r.target=ko)))}function ki(t,r){var i={};return i[t.toLowerCase()]=r.toLowerCase(),i["Webkit"+t]="webkit"+r,i["Moz"+t]="moz"+r,i}var So={animationend:ki("Animation","AnimationEnd"),animationiteration:ki("Animation","AnimationIteration"),animationstart:ki("Animation","AnimationStart"),transitionrun:ki("Transition","TransitionRun"),transitionstart:ki("Transition","TransitionStart"),transitioncancel:ki("Transition","TransitionCancel"),transitionend:ki("Transition","TransitionEnd")},Lf={},wy={};fr&&(wy=document.createElement("div").style,"AnimationEvent"in window||(delete So.animationend.animation,delete So.animationiteration.animation,delete So.animationstart.animation),"TransitionEvent"in window||delete So.transitionend.transition);function Si(t){if(Lf[t])return Lf[t];if(!So[t])return t;var r=So[t],i;for(i in r)if(r.hasOwnProperty(i)&&i in wy)return Lf[t]=r[i];return t}var _y=Si("animationend"),xy=Si("animationiteration"),ky=Si("animationstart"),v4=Si("transitionrun"),b4=Si("transitionstart"),w4=Si("transitioncancel"),Sy=Si("transitionend"),Cy=new Map,Of="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Of.push("scrollEnd");function hr(t,r){Cy.set(t,r),Cr(r,[t])}var _c=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Wn=[],Co=0,Af=0;function xc(){for(var t=Co,r=Af=Co=0;r<t;){var i=Wn[r];Wn[r++]=null;var l=Wn[r];Wn[r++]=null;var d=Wn[r];Wn[r++]=null;var m=Wn[r];if(Wn[r++]=null,l!==null&&d!==null){var k=l.pending;k===null?d.next=d:(d.next=k.next,k.next=d),l.pending=d}m!==0&&Ey(i,d,m)}}function kc(t,r,i,l){Wn[Co++]=t,Wn[Co++]=r,Wn[Co++]=i,Wn[Co++]=l,Af|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function If(t,r,i,l){return kc(t,r,i,l),Sc(t)}function Ci(t,r){return kc(t,null,null,r),Sc(t)}function Ey(t,r,i){t.lanes|=i;var l=t.alternate;l!==null&&(l.lanes|=i);for(var d=!1,m=t.return;m!==null;)m.childLanes|=i,l=m.alternate,l!==null&&(l.childLanes|=i),m.tag===22&&(t=m.stateNode,t===null||t._visibility&1||(d=!0)),t=m,m=m.return;return t.tag===3?(m=t.stateNode,d&&r!==null&&(d=31-mt(i),t=m.hiddenUpdates,l=t[d],l===null?t[d]=[r]:l.push(r),r.lane=i|536870912),m):null}function Sc(t){if(50<al)throw al=0,Bp=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Eo={};function _4(t,r,i,l){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nn(t,r,i,l){return new _4(t,r,i,l)}function Rf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Vr(t,r){var i=t.alternate;return i===null?(i=Nn(t.tag,r,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=r,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&65011712,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,r=t.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i.refCleanup=t.refCleanup,i}function Ty(t,r){t.flags&=65011714;var i=t.alternate;return i===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,t.type=i.type,r=i.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function Cc(t,r,i,l,d,m){var k=0;if(l=t,typeof t=="function")Rf(t)&&(k=1);else if(typeof t=="string")k=T6(t,i,Re.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ce:return t=Nn(31,i,r,d),t.elementType=ce,t.lanes=m,t;case V:return Ei(i.children,d,m,r);case H:k=8,d|=24;break;case $:return t=Nn(12,i,r,d|2),t.elementType=$,t.lanes=m,t;case R:return t=Nn(13,i,r,d),t.elementType=R,t.lanes=m,t;case j:return t=Nn(19,i,r,d),t.elementType=j,t.lanes=m,t;default:if(typeof t=="object"&&t)switch(t.$$typeof){case ne:k=10;break e;case N:k=9;break e;case fe:k=11;break e;case F:k=14;break e;case se:k=16,l=null;break e}k=29,i=Error(s(130,t===null?"null":typeof t,"")),l=null}return r=Nn(k,i,r,d),r.elementType=t,r.type=l,r.lanes=m,r}function Ei(t,r,i,l){return t=Nn(7,t,l,r),t.lanes=i,t}function Mf(t,r,i){return t=Nn(6,t,null,r),t.lanes=i,t}function Ly(t){var r=Nn(18,null,null,0);return r.stateNode=t,r}function Pf(t,r,i){return r=Nn(4,t.children===null?[]:t.children,t.key,r),r.lanes=i,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var Oy=new WeakMap;function Un(t,r){if(typeof t=="object"&&t){var i=Oy.get(t);return i===void 0?(r={value:t,source:r,stack:tc(r)},Oy.set(t,r),r):i}return{value:t,source:r,stack:tc(r)}}var To=[],Lo=0,Ec=null,js=0,Kn=[],Qn=0,Ta=null,Tr=1,Lr="";function Hr(t,r){To[Lo++]=js,To[Lo++]=Ec,Ec=t,js=r}function Ay(t,r,i){Kn[Qn++]=Tr,Kn[Qn++]=Lr,Kn[Qn++]=Ta,Ta=t;var l=Tr;t=Lr;var d=32-mt(l)-1;l&=~(1<<d),i+=1;var m=32-mt(r)+d;if(30<m){var k=d-d%5;m=(l&(1<<k)-1).toString(32),l>>=k,d-=k,Tr=1<<32-mt(r)+d|i<<d|l,Lr=m+t}else Tr=1<<m|i<<d|l,Lr=t}function Nf(t){t.return!==null&&(Hr(t,1),Ay(t,1,0))}function Df(t){for(;t===Ec;)Ec=To[--Lo],To[Lo]=null,js=To[--Lo],To[Lo]=null;for(;t===Ta;)Ta=Kn[--Qn],Kn[Qn]=null,Lr=Kn[--Qn],Kn[Qn]=null,Tr=Kn[--Qn],Kn[Qn]=null}function Iy(t,r){Kn[Qn++]=Tr,Kn[Qn++]=Lr,Kn[Qn++]=Ta,Tr=r.id,Lr=r.overflow,Ta=t}var Zt=null,vt=null,Ke=!1,La=null,Gn=!1,jf=Error(s(519));function Oa(t){throw zs(Un(Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML","")),t)),jf}function Ry(t){var r=t.stateNode,i=t.type,l=t.memoizedProps;switch(r[Ft]=t,r[Yt]=l,i){case"dialog":Be("cancel",r),Be("close",r);break;case"iframe":case"object":case"embed":Be("load",r);break;case"video":case"audio":for(i=0;i<ol.length;i++)Be(ol[i],r);break;case"source":Be("error",r);break;case"img":case"image":case"link":Be("error",r),Be("load",r);break;case"details":Be("toggle",r);break;case"input":Be("invalid",r),pc(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Be("invalid",r);break;case"textarea":Be("invalid",r),yo(r,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||r.textContent===""+i||l.suppressHydrationWarning===!0||Kb(r.textContent,i)?(l.popover!=null&&(Be("beforetoggle",r),Be("toggle",r)),l.onScroll!=null&&Be("scroll",r),l.onScrollEnd!=null&&Be("scrollend",r),l.onClick!=null&&(r.onclick=$n),r=!0):r=!1,r||Oa(t,!0)}function My(t){for(Zt=t.return;Zt;)switch(Zt.tag){case 5:case 31:case 13:Gn=!1;return;case 27:case 3:Gn=!0;return;default:Zt=Zt.return}}function Oo(t){if(t!==Zt)return!1;if(!Ke)return My(t),Ke=!0,!1;var r=t.tag,i;if((i=r!==3&&r!==27)&&((i=r===5)&&(i=t.type,i=!(i!=="form"&&i!=="button")||eh(t.type,t.memoizedProps)),i=!i),i&&vt&&Oa(t),My(t),r===13){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));vt=n2(t)}else if(r===31){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));vt=n2(t)}else r===27?(r=vt,Fa(t.type)?(t=ih,ih=null,vt=t):vt=r):vt=Zt?Xn(t.stateNode.nextSibling):null;return!0}function Ti(){vt=Zt=null,Ke=!1}function zf(){var t=La;return t!==null&&(Sn===null?Sn=t:Sn.push.apply(Sn,t),La=null),t}function zs(t){La===null?La=[t]:La.push(t)}var qf=He(null),Li=null,$r=null;function Aa(t,r,i){Le(qf,r._currentValue),r._currentValue=i}function Wr(t){t._currentValue=qf.current,ze(qf)}function Bf(t,r,i){for(;t!==null;){var l=t.alternate;if((t.childLanes&r)===r?l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r):(t.childLanes|=r,l!==null&&(l.childLanes|=r)),t===i)break;t=t.return}}function Ff(t,r,i,l){var d=t.child;for(d!==null&&(d.return=t);d!==null;){var m=d.dependencies;if(m!==null){var k=d.child;m=m.firstContext;e:for(;m!==null;){var L=m;m=d;for(var q=0;q<r.length;q++)if(L.context===r[q]){m.lanes|=i,L=m.alternate,L!==null&&(L.lanes|=i),Bf(m.return,i,t),l||(k=null);break e}m=L.next}}else if(d.tag===18){if(k=d.return,k===null)throw Error(s(341));k.lanes|=i,m=k.alternate,m!==null&&(m.lanes|=i),Bf(k,i,t),k=null}else k=d.child;if(k!==null)k.return=d;else for(k=d;k!==null;){if(k===t){k=null;break}if(d=k.sibling,d!==null){d.return=k.return,k=d;break}k=k.return}d=k}}function Ao(t,r,i,l){t=null;for(var d=r,m=!1;d!==null;){if(!m){if(d.flags&524288)m=!0;else if(d.flags&262144)break}if(d.tag===10){var k=d.alternate;if(k===null)throw Error(s(387));if(k=k.memoizedProps,k!==null){var L=d.type;Pn(d.pendingProps.value,k.value)||(t===null?t=[L]:t.push(L))}}else if(d===ya.current){if(k=d.alternate,k===null)throw Error(s(387));k.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(t===null?t=[dl]:t.push(dl))}d=d.return}t!==null&&Ff(r,t,i,l),r.flags|=262144}function Tc(t){for(t=t.firstContext;t!==null;){if(!Pn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Oi(t){Li=t,$r=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function en(t){return Py(Li,t)}function Lc(t,r){return Li===null&&Oi(t),Py(t,r)}function Py(t,r){var i=r._currentValue;if(r={context:r,memoizedValue:i,next:null},$r===null){if(t===null)throw Error(s(308));$r=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else $r=$r.next=r;return i}var x4=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(i,l){t.push(l)}};this.abort=function(){r.aborted=!0,t.forEach(function(i){return i()})}},k4=n.unstable_scheduleCallback,S4=n.unstable_NormalPriority,Dt={$$typeof:ne,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vf(){return{controller:new x4,data:new Map,refCount:0}}function qs(t){t.refCount--,t.refCount===0&&k4(S4,function(){t.controller.abort()})}var Bs=null,Hf=0,Io=0,Ro=null;function C4(t,r){if(Bs===null){var i=Bs=[];Hf=0,Io=Up(),Ro={status:"pending",value:void 0,then:function(l){i.push(l)}}}return Hf++,r.then(Ny,Ny),r}function Ny(){if(--Hf===0&&Bs!==null){Ro!==null&&(Ro.status="fulfilled");var t=Bs;Bs=null,Io=0,Ro=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function E4(t,r){var i=[],l={status:"pending",value:null,reason:null,then:function(d){i.push(d)}};return t.then(function(){l.status="fulfilled",l.value=r;for(var d=0;d<i.length;d++)(0,i[d])(r)},function(d){for(l.status="rejected",l.reason=d,d=0;d<i.length;d++)(0,i[d])(void 0)}),l}var Dy=ee.S;ee.S=function(t,r){gb=Jt(),typeof r=="object"&&r&&typeof r.then=="function"&&C4(t,r),Dy!==null&&Dy(t,r)};var Ai=He(null);function $f(){var t=Ai.current;return t===null?dt.pooledCache:t}function Oc(t,r){r===null?Le(Ai,Ai.current):Le(Ai,r.pool)}function jy(){var t=$f();return t===null?null:{parent:Dt._currentValue,pool:t}}var Mo=Error(s(460)),Wf=Error(s(474)),Ac=Error(s(542)),Ic={then:function(){}};function zy(t){return t=t.status,t==="fulfilled"||t==="rejected"}function qy(t,r,i){switch(i=t[i],i===void 0?t.push(r):i!==r&&(r.then($n,$n),r=i),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Fy(t),t;default:if(typeof r.status=="string")r.then($n,$n);else{if(t=dt,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(l){if(r.status==="pending"){var d=r;d.status="fulfilled",d.value=l}},function(l){if(r.status==="pending"){var d=r;d.status="rejected",d.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Fy(t),t}throw Ri=r,Mo}}function Ii(t){try{var r=t._init;return r(t._payload)}catch(i){throw typeof i=="object"&&i&&typeof i.then=="function"?(Ri=i,Mo):i}}var Ri=null;function By(){if(Ri===null)throw Error(s(459));var t=Ri;return Ri=null,t}function Fy(t){if(t===Mo||t===Ac)throw Error(s(483))}var Po=null,Fs=0;function Rc(t){var r=Fs;return Fs+=1,Po===null&&(Po=[]),qy(Po,t,r)}function Vs(t,r){r=r.props.ref,t.ref=r===void 0?null:r}function Mc(t,r){throw r.$$typeof===E?Error(s(525)):(t=Object.prototype.toString.call(r),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Vy(t){function r(W,B){if(t){var G=W.deletions;G===null?(W.deletions=[B],W.flags|=16):G.push(B)}}function i(W,B){if(!t)return null;for(;B!==null;)r(W,B),B=B.sibling;return null}function l(W){for(var B=new Map;W!==null;)W.key===null?B.set(W.index,W):B.set(W.key,W),W=W.sibling;return B}function d(W,B){return W=Vr(W,B),W.index=0,W.sibling=null,W}function m(W,B,G){return W.index=G,t?(G=W.alternate,G===null?(W.flags|=67108866,B):(G=G.index,G<B?(W.flags|=67108866,B):G)):(W.flags|=1048576,B)}function k(W){return t&&W.alternate===null&&(W.flags|=67108866),W}function L(W,B,G,le){return B===null||B.tag!==6?(B=Mf(G,W.mode,le),B.return=W,B):(B=d(B,G),B.return=W,B)}function q(W,B,G,le){var Se=G.type;return Se===V?oe(W,B,G.props.children,le,G.key):B!==null&&(B.elementType===Se||typeof Se=="object"&&Se&&Se.$$typeof===se&&Ii(Se)===B.type)?(B=d(B,G.props),Vs(B,G),B.return=W,B):(B=Cc(G.type,G.key,G.props,null,W.mode,le),Vs(B,G),B.return=W,B)}function J(W,B,G,le){return B===null||B.tag!==4||B.stateNode.containerInfo!==G.containerInfo||B.stateNode.implementation!==G.implementation?(B=Pf(G,W.mode,le),B.return=W,B):(B=d(B,G.children||[]),B.return=W,B)}function oe(W,B,G,le,Se){return B===null||B.tag!==7?(B=Ei(G,W.mode,le,Se),B.return=W,B):(B=d(B,G),B.return=W,B)}function ue(W,B,G){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Mf(""+B,W.mode,G),B.return=W,B;if(typeof B=="object"&&B){switch(B.$$typeof){case O:return G=Cc(B.type,B.key,B.props,null,W.mode,G),Vs(G,B),G.return=W,G;case M:return B=Pf(B,W.mode,G),B.return=W,B;case se:return B=Ii(B),ue(W,B,G)}if(ie(B)||xe(B))return B=Ei(B,W.mode,G,null),B.return=W,B;if(typeof B.then=="function")return ue(W,Rc(B),G);if(B.$$typeof===ne)return ue(W,Lc(W,B),G);Mc(W,B)}return null}function Y(W,B,G,le){var Se=B===null?null:B.key;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return Se===null?L(W,B,""+G,le):null;if(typeof G=="object"&&G){switch(G.$$typeof){case O:return G.key===Se?q(W,B,G,le):null;case M:return G.key===Se?J(W,B,G,le):null;case se:return G=Ii(G),Y(W,B,G,le)}if(ie(G)||xe(G))return Se===null?oe(W,B,G,le,null):null;if(typeof G.then=="function")return Y(W,B,Rc(G),le);if(G.$$typeof===ne)return Y(W,B,Lc(W,G),le);Mc(W,G)}return null}function ae(W,B,G,le,Se){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return W=W.get(G)||null,L(B,W,""+le,Se);if(typeof le=="object"&&le){switch(le.$$typeof){case O:return W=W.get(le.key===null?G:le.key)||null,q(B,W,le,Se);case M:return W=W.get(le.key===null?G:le.key)||null,J(B,W,le,Se);case se:return le=Ii(le),ae(W,B,G,le,Se)}if(ie(le)||xe(le))return W=W.get(G)||null,oe(B,W,le,Se,null);if(typeof le.then=="function")return ae(W,B,G,Rc(le),Se);if(le.$$typeof===ne)return ae(W,B,G,Lc(B,le),Se);Mc(B,le)}return null}function _e(W,B,G,le){for(var Se=null,et=null,ke=B,Ne=B=0,We=null;ke!==null&&Ne<G.length;Ne++){ke.index>Ne?(We=ke,ke=null):We=ke.sibling;var Xe=Y(W,ke,G[Ne],le);if(Xe===null){ke===null&&(ke=We);break}t&&ke&&Xe.alternate===null&&r(W,ke),B=m(Xe,B,Ne),et===null?Se=Xe:et.sibling=Xe,et=Xe,ke=We}if(Ne===G.length)return i(W,ke),Ke&&Hr(W,Ne),Se;if(ke===null){for(;Ne<G.length;Ne++)ke=ue(W,G[Ne],le),ke!==null&&(B=m(ke,B,Ne),et===null?Se=ke:et.sibling=ke,et=ke);return Ke&&Hr(W,Ne),Se}for(ke=l(ke);Ne<G.length;Ne++)We=ae(ke,W,Ne,G[Ne],le),We!==null&&(t&&We.alternate!==null&&ke.delete(We.key===null?Ne:We.key),B=m(We,B,Ne),et===null?Se=We:et.sibling=We,et=We);return t&&ke.forEach(function(Ua){return r(W,Ua)}),Ke&&Hr(W,Ne),Se}function Te(W,B,G,le){if(G==null)throw Error(s(151));for(var Se=null,et=null,ke=B,Ne=B=0,We=null,Xe=G.next();ke!==null&&!Xe.done;Ne++,Xe=G.next()){ke.index>Ne?(We=ke,ke=null):We=ke.sibling;var Ua=Y(W,ke,Xe.value,le);if(Ua===null){ke===null&&(ke=We);break}t&&ke&&Ua.alternate===null&&r(W,ke),B=m(Ua,B,Ne),et===null?Se=Ua:et.sibling=Ua,et=Ua,ke=We}if(Xe.done)return i(W,ke),Ke&&Hr(W,Ne),Se;if(ke===null){for(;!Xe.done;Ne++,Xe=G.next())Xe=ue(W,Xe.value,le),Xe!==null&&(B=m(Xe,B,Ne),et===null?Se=Xe:et.sibling=Xe,et=Xe);return Ke&&Hr(W,Ne),Se}for(ke=l(ke);!Xe.done;Ne++,Xe=G.next())Xe=ae(ke,W,Ne,Xe.value,le),Xe!==null&&(t&&Xe.alternate!==null&&ke.delete(Xe.key===null?Ne:Xe.key),B=m(Xe,B,Ne),et===null?Se=Xe:et.sibling=Xe,et=Xe);return t&&ke.forEach(function(F6){return r(W,F6)}),Ke&&Hr(W,Ne),Se}function st(W,B,G,le){if(typeof G=="object"&&G&&G.type===V&&G.key===null&&(G=G.props.children),typeof G=="object"&&G){switch(G.$$typeof){case O:e:{for(var Se=G.key;B!==null;){if(B.key===Se){if(Se=G.type,Se===V){if(B.tag===7){i(W,B.sibling),le=d(B,G.props.children),le.return=W,W=le;break e}}else if(B.elementType===Se||typeof Se=="object"&&Se&&Se.$$typeof===se&&Ii(Se)===B.type){i(W,B.sibling),le=d(B,G.props),Vs(le,G),le.return=W,W=le;break e}i(W,B);break}else r(W,B);B=B.sibling}G.type===V?(le=Ei(G.props.children,W.mode,le,G.key),le.return=W,W=le):(le=Cc(G.type,G.key,G.props,null,W.mode,le),Vs(le,G),le.return=W,W=le)}return k(W);case M:e:{for(Se=G.key;B!==null;){if(B.key===Se)if(B.tag===4&&B.stateNode.containerInfo===G.containerInfo&&B.stateNode.implementation===G.implementation){i(W,B.sibling),le=d(B,G.children||[]),le.return=W,W=le;break e}else{i(W,B);break}else r(W,B);B=B.sibling}le=Pf(G,W.mode,le),le.return=W,W=le}return k(W);case se:return G=Ii(G),st(W,B,G,le)}if(ie(G))return _e(W,B,G,le);if(xe(G)){if(Se=xe(G),typeof Se!="function")throw Error(s(150));return G=Se.call(G),Te(W,B,G,le)}if(typeof G.then=="function")return st(W,B,Rc(G),le);if(G.$$typeof===ne)return st(W,B,Lc(W,G),le);Mc(W,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,B!==null&&B.tag===6?(i(W,B.sibling),le=d(B,G),le.return=W,W=le):(i(W,B),le=Mf(G,W.mode,le),le.return=W,W=le),k(W)):i(W,B)}return function(W,B,G,le){try{Fs=0;var Se=st(W,B,G,le);return Po=null,Se}catch(ke){if(ke===Mo||ke===Ac)throw ke;var et=Nn(29,ke,null,W.mode);return et.lanes=le,et.return=W,et}}}var Mi=Vy(!0),Hy=Vy(!1),Ia=!1;function Uf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kf(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Pi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ni(t,r,i){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,Ze&2){var d=l.pending;return d===null?r.next=r:(r.next=d.next,d.next=r),l.pending=r,r=Sc(t),Ey(t,null,i),r}return kc(t,l,r,i),Sc(t)}function Hs(t,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,i&4194048)){var l=r.lanes;l&=t.pendingLanes,i|=l,r.lanes=i,mo(t,i)}}function Qf(t,r){var i=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var d=null,m=null;if(i=i.firstBaseUpdate,i!==null){do{var k={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};m===null?d=m=k:m=m.next=k,i=i.next}while(i!==null);m===null?d=m=r:m=m.next=r}else d=m=r;i={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:l.shared,callbacks:l.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=r:t.next=r,i.lastBaseUpdate=r}var Gf=!1;function $s(){if(Gf){var t=Ro;if(t!==null)throw t}}function Ws(t,r,i,l){Gf=!1;var d=t.updateQueue;Ia=!1;var m=d.firstBaseUpdate,k=d.lastBaseUpdate,L=d.shared.pending;if(L!==null){d.shared.pending=null;var q=L,J=q.next;q.next=null,k===null?m=J:k.next=J,k=q;var oe=t.alternate;oe!==null&&(oe=oe.updateQueue,L=oe.lastBaseUpdate,L!==k&&(L===null?oe.firstBaseUpdate=J:L.next=J,oe.lastBaseUpdate=q))}if(m!==null){var ue=d.baseState;k=0,oe=J=q=null,L=m;do{var Y=L.lane&-536870913,ae=Y!==L.lane;if(ae?($e&Y)===Y:(l&Y)===Y){Y!==0&&Y===Io&&(Gf=!0),oe!==null&&(oe=oe.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var _e=t,Te=L;Y=r;var st=i;switch(Te.tag){case 1:if(_e=Te.payload,typeof _e=="function"){ue=_e.call(st,ue,Y);break e}ue=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=Te.payload,Y=typeof _e=="function"?_e.call(st,ue,Y):_e,Y==null)break e;ue=C({},ue,Y);break e;case 2:Ia=!0}}Y=L.callback,Y!==null&&(t.flags|=64,ae&&(t.flags|=8192),ae=d.callbacks,ae===null?d.callbacks=[Y]:ae.push(Y))}else ae={lane:Y,tag:L.tag,payload:L.payload,callback:L.callback,next:null},oe===null?(J=oe=ae,q=ue):oe=oe.next=ae,k|=Y;if(L=L.next,L===null){if(L=d.shared.pending,L===null)break;ae=L,L=ae.next,ae.next=null,d.lastBaseUpdate=ae,d.shared.pending=null}}while(!0);oe===null&&(q=ue),d.baseState=q,d.firstBaseUpdate=J,d.lastBaseUpdate=oe,m===null&&(d.shared.lanes=0),Da|=k,t.lanes=k,t.memoizedState=ue}}function $y(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function Wy(t,r){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;t<i.length;t++)$y(i[t],r)}var No=He(null),Pc=He(0);function Uy(t,r){t=ea,Le(Pc,t),Le(No,r),ea=t|r.baseLanes}function Jf(){Le(Pc,ea),Le(No,No.current)}function Xf(){ea=Pc.current,ze(No),ze(Pc)}var Dn=He(null),mr=null;function Ra(t){var r=t.alternate;Le(At,At.current&1),Le(Dn,t),mr===null&&(r===null||No.current!==null||r.memoizedState!==null)&&(mr=t)}function Yf(t){Le(At,At.current),Le(Dn,t),mr===null&&(mr=t)}function Ky(t){t.tag===22?(Le(At,At.current),Le(Dn,t),mr===null&&(mr=t)):Ma(t)}function Ma(){Le(At,At.current),Le(Dn,Dn.current)}function jn(t){ze(Dn),mr===t&&(mr=null),ze(At)}var At=He(0);function Nc(t){for(var r=t;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||rh(i)||ah(i)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if(r.flags&128)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Ur=0,Pe=null,it=null,jt=null,Dc=!1,Do=!1,Di=!1,jc=0,Us=0,jo=null,T4=0;function St(){throw Error(s(321))}function Zf(t,r){if(r===null)return!1;for(var i=0;i<r.length&&i<t.length;i++)if(!Pn(t[i],r[i]))return!1;return!0}function ep(t,r,i,l,d,m){return Ur=m,Pe=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,ee.H=t===null||t.memoizedState===null?Av:mp,Di=!1,m=i(l,d),Di=!1,Do&&(m=Gy(r,i,l,d)),Qy(t),m}function Qy(t){ee.H=Gs;var r=it!==null&&it.next!==null;if(Ur=0,jt=it=Pe=null,Dc=!1,Us=0,jo=null,r)throw Error(s(300));t===null||zt||(t=t.dependencies,t!==null&&Tc(t)&&(zt=!0))}function Gy(t,r,i,l){Pe=t;var d=0;do{if(Do&&(jo=null),Us=0,Do=!1,25<=d)throw Error(s(301));if(d+=1,jt=it=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}ee.H=Iv,m=r(i,l)}while(Do);return m}function L4(){var t=ee.H,r=t.useState()[0];return r=typeof r.then=="function"?Ks(r):r,t=t.useState()[0],(it===null?null:it.memoizedState)!==t&&(Pe.flags|=1024),r}function tp(){var t=jc!==0;return jc=0,t}function np(t,r,i){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~i}function rp(t){if(Dc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Dc=!1}Ur=0,jt=it=Pe=null,Do=!1,Us=jc=0,jo=null}function hn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?Pe.memoizedState=jt=t:jt=jt.next=t,jt}function It(){if(it===null){var t=Pe.alternate;t=t===null?null:t.memoizedState}else t=it.next;var r=jt===null?Pe.memoizedState:jt.next;if(r!==null)jt=r,it=t;else{if(t===null)throw Pe.alternate===null?Error(s(467)):Error(s(310));it=t,t={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},jt===null?Pe.memoizedState=jt=t:jt=jt.next=t}return jt}function zc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ks(t){var r=Us;return Us+=1,jo===null&&(jo=[]),t=qy(jo,t,r),r=Pe,(jt===null?r.memoizedState:jt.next)===null&&(r=r.alternate,ee.H=r===null||r.memoizedState===null?Av:mp),t}function qc(t){if(typeof t=="object"&&t){if(typeof t.then=="function")return Ks(t);if(t.$$typeof===ne)return en(t)}throw Error(s(438,String(t)))}function ap(t){var r=null,i=Pe.updateQueue;if(i!==null&&(r=i.memoCache),r==null){var l=Pe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(d){return d.slice()}),index:0})))}if(r??(r={data:[],index:0}),i===null&&(i=zc(),Pe.updateQueue=i),i.memoCache=r,i=r.data[r.index],i===void 0)for(i=r.data[r.index]=Array(t),l=0;l<t;l++)i[l]=he;return r.index++,i}function Kr(t,r){return typeof r=="function"?r(t):r}function Bc(t){return ip(It(),it,t)}function ip(t,r,i){var l=t.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=i;var d=t.baseQueue,m=l.pending;if(m!==null){if(d!==null){var k=d.next;d.next=m.next,m.next=k}r.baseQueue=d=m,l.pending=null}if(m=t.baseState,d===null)t.memoizedState=m;else{r=d.next;var L=k=null,q=null,J=r,oe=!1;do{var ue=J.lane&-536870913;if(ue===J.lane?(Ur&ue)===ue:($e&ue)===ue){var Y=J.revertLane;if(Y===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),ue===Io&&(oe=!0);else if((Ur&Y)===Y){J=J.next,Y===Io&&(oe=!0);continue}else ue={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},q===null?(L=q=ue,k=m):q=q.next=ue,Pe.lanes|=Y,Da|=Y;ue=J.action,Di&&i(m,ue),m=J.hasEagerState?J.eagerState:i(m,ue)}else Y={lane:ue,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},q===null?(L=q=Y,k=m):q=q.next=Y,Pe.lanes|=ue,Da|=ue;J=J.next}while(J!==null&&J!==r);if(q===null?k=m:q.next=L,!Pn(m,t.memoizedState)&&(zt=!0,oe&&(i=Ro,i!==null)))throw i;t.memoizedState=m,t.baseState=k,t.baseQueue=q,l.lastRenderedState=m}return d===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function op(t){var r=It(),i=r.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=t;var l=i.dispatch,d=i.pending,m=r.memoizedState;if(d!==null){i.pending=null;var k=d=d.next;do m=t(m,k.action),k=k.next;while(k!==d);Pn(m,r.memoizedState)||(zt=!0),r.memoizedState=m,r.baseQueue===null&&(r.baseState=m),i.lastRenderedState=m}return[m,l]}function Jy(t,r,i){var l=Pe,d=It(),m=Ke;if(m){if(i===void 0)throw Error(s(407));i=i()}else i=r();var k=!Pn((it||d).memoizedState,i);if(k&&(d.memoizedState=i,zt=!0),d=d.queue,cp(Zy.bind(null,l,d,t),[t]),d.getSnapshot!==r||k||jt!==null&&jt.memoizedState.tag&1){if(l.flags|=2048,zo(9,{destroy:void 0},Yy.bind(null,l,d,i,r),null),dt===null)throw Error(s(349));m||Ur&127||Xy(l,r,i)}return i}function Xy(t,r,i){t.flags|=16384,t={getSnapshot:r,value:i},r=Pe.updateQueue,r===null?(r=zc(),Pe.updateQueue=r,r.stores=[t]):(i=r.stores,i===null?r.stores=[t]:i.push(t))}function Yy(t,r,i,l){r.value=i,r.getSnapshot=l,ev(r)&&tv(t)}function Zy(t,r,i){return i(function(){ev(r)&&tv(t)})}function ev(t){var r=t.getSnapshot;t=t.value;try{var i=r();return!Pn(t,i)}catch{return!0}}function tv(t){var r=Ci(t,2);r!==null&&Cn(r,t,2)}function sp(t){var r=hn();if(typeof t=="function"){var i=t;if(t=i(),Di){Ue(!0);try{i()}finally{Ue(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kr,lastRenderedState:t},r}function nv(t,r,i,l){return t.baseState=i,ip(t,it,typeof l=="function"?l:Kr)}function O4(t,r,i,l,d){if(Hc(t))throw Error(s(485));if(t=r.action,t!==null){var m={payload:d,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){m.listeners.push(k)}};ee.T===null?m.isTransition=!1:i(!0),l(m),i=r.pending,i===null?(m.next=r.pending=m,rv(r,m)):(m.next=i.next,r.pending=i.next=m)}}function rv(t,r){var i=r.action,l=r.payload,d=t.state;if(r.isTransition){var m=ee.T,k={};ee.T=k;try{var L=i(d,l),q=ee.S;q!==null&&q(k,L),av(t,r,L)}catch(J){lp(t,r,J)}finally{m!==null&&k.types!==null&&(m.types=k.types),ee.T=m}}else try{m=i(d,l),av(t,r,m)}catch(J){lp(t,r,J)}}function av(t,r,i){typeof i=="object"&&i&&typeof i.then=="function"?i.then(function(l){iv(t,r,l)},function(l){return lp(t,r,l)}):iv(t,r,i)}function iv(t,r,i){r.status="fulfilled",r.value=i,ov(r),t.state=i,r=t.pending,r!==null&&(i=r.next,i===r?t.pending=null:(i=i.next,r.next=i,rv(t,i)))}function lp(t,r,i){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=i,ov(r),r=r.next;while(r!==l)}t.action=null}function ov(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function sv(t,r){return r}function lv(t,r){if(Ke){var i=dt.formState;if(i!==null){e:{var l=Pe;if(Ke){if(vt){t:{for(var d=vt,m=Gn;d.nodeType!==8;){if(!m){d=null;break t}if(d=Xn(d.nextSibling),d===null){d=null;break t}}m=d.data,d=m==="F!"||m==="F"?d:null}if(d){vt=Xn(d.nextSibling),l=d.data==="F!";break e}}Oa(l)}l=!1}l&&(r=i[0])}}return i=hn(),i.memoizedState=i.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sv,lastRenderedState:r},i.queue=l,i=Tv.bind(null,Pe,l),l.dispatch=i,l=sp(!1),m=hp.bind(null,Pe,!1,l.queue),l=hn(),d={state:r,dispatch:null,action:t,pending:null},l.queue=d,i=O4.bind(null,Pe,d,m,i),d.dispatch=i,l.memoizedState=t,[r,i,!1]}function cv(t){return uv(It(),it,t)}function uv(t,r,i){if(r=ip(t,r,sv)[0],t=Bc(Kr)[0],typeof r=="object"&&r&&typeof r.then=="function")try{var l=Ks(r)}catch(k){throw k===Mo?Ac:k}else l=r;r=It();var d=r.queue,m=d.dispatch;return i!==r.memoizedState&&(Pe.flags|=2048,zo(9,{destroy:void 0},A4.bind(null,d,i),null)),[l,m,t]}function A4(t,r){t.action=r}function dv(t){var r=It(),i=it;if(i!==null)return uv(r,i,t);It(),r=r.memoizedState,i=It();var l=i.queue.dispatch;return i.memoizedState=t,[r,l,!1]}function zo(t,r,i,l){return t={tag:t,create:i,deps:l,inst:r,next:null},r=Pe.updateQueue,r===null&&(r=zc(),Pe.updateQueue=r),i=r.lastEffect,i===null?r.lastEffect=t.next=t:(l=i.next,i.next=t,t.next=l,r.lastEffect=t),t}function fv(){return It().memoizedState}function Fc(t,r,i,l){var d=hn();Pe.flags|=t,d.memoizedState=zo(1|r,{destroy:void 0},i,l===void 0?null:l)}function Vc(t,r,i,l){var d=It();l=l===void 0?null:l;var m=d.memoizedState.inst;it!==null&&l!==null&&Zf(l,it.memoizedState.deps)?d.memoizedState=zo(r,m,i,l):(Pe.flags|=t,d.memoizedState=zo(1|r,m,i,l))}function pv(t,r){Fc(8390656,8,t,r)}function cp(t,r){Vc(2048,8,t,r)}function I4(t){Pe.flags|=4;var r=Pe.updateQueue;if(r===null)r=zc(),Pe.updateQueue=r,r.events=[t];else{var i=r.events;i===null?r.events=[t]:i.push(t)}}function hv(t){var r=It().memoizedState;return I4({ref:r,nextImpl:t}),function(){if(Ze&2)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function mv(t,r){return Vc(4,2,t,r)}function gv(t,r){return Vc(4,4,t,r)}function yv(t,r){if(typeof r=="function"){t=t();var i=r(t);return function(){typeof i=="function"?i():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function vv(t,r,i){i=i==null?null:i.concat([t]),Vc(4,4,yv.bind(null,r,t),i)}function up(){}function bv(t,r){var i=It();r=r===void 0?null:r;var l=i.memoizedState;return r!==null&&Zf(r,l[1])?l[0]:(i.memoizedState=[t,r],t)}function wv(t,r){var i=It();r=r===void 0?null:r;var l=i.memoizedState;if(r!==null&&Zf(r,l[1]))return l[0];if(l=t(),Di){Ue(!0);try{t()}finally{Ue(!1)}}return i.memoizedState=[l,r],l}function dp(t,r,i){return i===void 0||Ur&1073741824&&!($e&261930)?t.memoizedState=r:(t.memoizedState=i,t=vb(),Pe.lanes|=t,Da|=t,i)}function _v(t,r,i,l){return Pn(i,r)?i:No.current===null?!(Ur&42)||Ur&1073741824&&!($e&261930)?(zt=!0,t.memoizedState=i):(t=vb(),Pe.lanes|=t,Da|=t,r):(t=dp(t,i,l),Pn(t,r)||(zt=!0),t)}function xv(t,r,i,l,d){var m=U.p;U.p=m!==0&&8>m?m:8;var k=ee.T,L={};ee.T=L,hp(t,!1,r,i);try{var q=d(),J=ee.S;J!==null&&J(L,q),typeof q=="object"&&q&&typeof q.then=="function"?Qs(t,r,E4(q,l),Jn(t)):Qs(t,r,l,Jn(t))}catch(oe){Qs(t,r,{then:function(){},status:"rejected",reason:oe},Jn())}finally{U.p=m,k!==null&&L.types!==null&&(k.types=L.types),ee.T=k}}function R4(){}function fp(t,r,i,l){if(t.tag!==5)throw Error(s(476));var d=kv(t).queue;xv(t,d,r,Ae,i===null?R4:function(){return Sv(t),i(l)})}function kv(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Ae,baseState:Ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kr,lastRenderedState:Ae},next:null};var i={};return r.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kr,lastRenderedState:i},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function Sv(t){var r=kv(t);r.next===null&&(r=t.alternate.memoizedState),Qs(t,r.next.queue,{},Jn())}function pp(){return en(dl)}function Cv(){return It().memoizedState}function Ev(){return It().memoizedState}function M4(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var i=Jn();t=Pi(i);var l=Ni(r,t,i);l!==null&&(Cn(l,r,i),Hs(l,r,i)),r={cache:Vf()},t.payload=r;return}r=r.return}}function P4(t,r,i){var l=Jn();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Hc(t)?Lv(r,i):(i=If(t,r,i,l),i!==null&&(Cn(i,t,l),Ov(i,r,l)))}function Tv(t,r,i){Qs(t,r,i,Jn())}function Qs(t,r,i,l){var d={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Hc(t))Lv(r,d);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=r.lastRenderedReducer,m!==null))try{var k=r.lastRenderedState,L=m(k,i);if(d.hasEagerState=!0,d.eagerState=L,Pn(L,k))return kc(t,r,d,0),dt===null&&xc(),!1}catch{}if(i=If(t,r,d,l),i!==null)return Cn(i,t,l),Ov(i,r,l),!0}return!1}function hp(t,r,i,l){if(l={lane:2,revertLane:Up(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Hc(t)){if(r)throw Error(s(479))}else r=If(t,i,l,2),r!==null&&Cn(r,t,2)}function Hc(t){var r=t.alternate;return t===Pe||r!==null&&r===Pe}function Lv(t,r){Do=Dc=!0;var i=t.pending;i===null?r.next=r:(r.next=i.next,i.next=r),t.pending=r}function Ov(t,r,i){if(i&4194048){var l=r.lanes;l&=t.pendingLanes,i|=l,r.lanes=i,mo(t,i)}}var Gs={readContext:en,use:qc,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useLayoutEffect:St,useInsertionEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useSyncExternalStore:St,useId:St,useHostTransitionStatus:St,useFormState:St,useActionState:St,useOptimistic:St,useMemoCache:St,useCacheRefresh:St};Gs.useEffectEvent=St;var Av={readContext:en,use:qc,useCallback:function(t,r){return hn().memoizedState=[t,r===void 0?null:r],t},useContext:en,useEffect:pv,useImperativeHandle:function(t,r,i){i=i==null?null:i.concat([t]),Fc(4194308,4,yv.bind(null,r,t),i)},useLayoutEffect:function(t,r){return Fc(4194308,4,t,r)},useInsertionEffect:function(t,r){Fc(4,2,t,r)},useMemo:function(t,r){var i=hn();r=r===void 0?null:r;var l=t();if(Di){Ue(!0);try{t()}finally{Ue(!1)}}return i.memoizedState=[l,r],l},useReducer:function(t,r,i){var l=hn();if(i!==void 0){var d=i(r);if(Di){Ue(!0);try{i(r)}finally{Ue(!1)}}}else d=r;return l.memoizedState=l.baseState=d,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:d},l.queue=t,t=t.dispatch=P4.bind(null,Pe,t),[l.memoizedState,t]},useRef:function(t){var r=hn();return t={current:t},r.memoizedState=t},useState:function(t){t=sp(t);var r=t.queue,i=Tv.bind(null,Pe,r);return r.dispatch=i,[t.memoizedState,i]},useDebugValue:up,useDeferredValue:function(t,r){return dp(hn(),t,r)},useTransition:function(){var t=sp(!1);return t=xv.bind(null,Pe,t.queue,!0,!1),hn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,i){var l=Pe,d=hn();if(Ke){if(i===void 0)throw Error(s(407));i=i()}else{if(i=r(),dt===null)throw Error(s(349));$e&127||Xy(l,r,i)}d.memoizedState=i;var m={value:i,getSnapshot:r};return d.queue=m,pv(Zy.bind(null,l,m,t),[t]),l.flags|=2048,zo(9,{destroy:void 0},Yy.bind(null,l,m,i,r),null),i},useId:function(){var t=hn(),r=dt.identifierPrefix;if(Ke){var i=Lr,l=Tr;i=(l&~(1<<32-mt(l)-1)).toString(32)+i,r="_"+r+"R_"+i,i=jc++,0<i&&(r+="H"+i.toString(32)),r+="_"}else i=T4++,r="_"+r+"r_"+i.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:pp,useFormState:lv,useActionState:lv,useOptimistic:function(t){var r=hn();r.memoizedState=r.baseState=t;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=i,r=hp.bind(null,Pe,!0,i),i.dispatch=r,[t,r]},useMemoCache:ap,useCacheRefresh:function(){return hn().memoizedState=M4.bind(null,Pe)},useEffectEvent:function(t){var r=hn(),i={impl:t};return r.memoizedState=i,function(){if(Ze&2)throw Error(s(440));return i.impl.apply(void 0,arguments)}}},mp={readContext:en,use:qc,useCallback:bv,useContext:en,useEffect:cp,useImperativeHandle:vv,useInsertionEffect:mv,useLayoutEffect:gv,useMemo:wv,useReducer:Bc,useRef:fv,useState:function(){return Bc(Kr)},useDebugValue:up,useDeferredValue:function(t,r){return _v(It(),it.memoizedState,t,r)},useTransition:function(){var t=Bc(Kr)[0],r=It().memoizedState;return[typeof t=="boolean"?t:Ks(t),r]},useSyncExternalStore:Jy,useId:Cv,useHostTransitionStatus:pp,useFormState:cv,useActionState:cv,useOptimistic:function(t,r){return nv(It(),it,t,r)},useMemoCache:ap,useCacheRefresh:Ev};mp.useEffectEvent=hv;var Iv={readContext:en,use:qc,useCallback:bv,useContext:en,useEffect:cp,useImperativeHandle:vv,useInsertionEffect:mv,useLayoutEffect:gv,useMemo:wv,useReducer:op,useRef:fv,useState:function(){return op(Kr)},useDebugValue:up,useDeferredValue:function(t,r){var i=It();return it===null?dp(i,t,r):_v(i,it.memoizedState,t,r)},useTransition:function(){var t=op(Kr)[0],r=It().memoizedState;return[typeof t=="boolean"?t:Ks(t),r]},useSyncExternalStore:Jy,useId:Cv,useHostTransitionStatus:pp,useFormState:dv,useActionState:dv,useOptimistic:function(t,r){var i=It();return it===null?(i.baseState=t,[t,i.queue.dispatch]):nv(i,it,t,r)},useMemoCache:ap,useCacheRefresh:Ev};Iv.useEffectEvent=hv;function gp(t,r,i,l){r=t.memoizedState,i=i(l,r),i=i==null?r:C({},r,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var yp={enqueueSetState:function(t,r,i){t=t._reactInternals;var l=Jn(),d=Pi(l);d.payload=r,i!=null&&(d.callback=i),r=Ni(t,d,l),r!==null&&(Cn(r,t,l),Hs(r,t,l))},enqueueReplaceState:function(t,r,i){t=t._reactInternals;var l=Jn(),d=Pi(l);d.tag=1,d.payload=r,i!=null&&(d.callback=i),r=Ni(t,d,l),r!==null&&(Cn(r,t,l),Hs(r,t,l))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var i=Jn(),l=Pi(i);l.tag=2,r!=null&&(l.callback=r),r=Ni(t,l,i),r!==null&&(Cn(r,t,i),Hs(r,t,i))}};function Rv(t,r,i,l,d,m,k){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,m,k):r.prototype&&r.prototype.isPureReactComponent?!Ns(i,l)||!Ns(d,m):!0}function Mv(t,r,i,l){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,l),r.state!==t&&yp.enqueueReplaceState(r,r.state,null)}function ji(t,r){var i=r;if("ref"in r)for(var l in i={},r)l!=="ref"&&(i[l]=r[l]);if(t=t.defaultProps)for(var d in i===r&&(i=C({},i)),t)i[d]===void 0&&(i[d]=t[d]);return i}function N4(t){_c(t)}function D4(t){console.error(t)}function j4(t){_c(t)}function $c(t,r){try{var i=t.onUncaughtError;i(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function Pv(t,r,i){try{var l=t.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function vp(t,r,i){return i=Pi(i),i.tag=3,i.payload={element:null},i.callback=function(){$c(t,r)},i}function Nv(t){return t=Pi(t),t.tag=3,t}function Dv(t,r,i,l){var d=i.type.getDerivedStateFromError;if(typeof d=="function"){var m=l.value;t.payload=function(){return d(m)},t.callback=function(){Pv(r,i,l)}}var k=i.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(t.callback=function(){Pv(r,i,l),typeof d!="function"&&(ja===null?ja=new Set([this]):ja.add(this));var L=l.stack;this.componentDidCatch(l.value,{componentStack:L===null?"":L})})}function z4(t,r,i,l,d){if(i.flags|=32768,typeof l=="object"&&l&&typeof l.then=="function"){if(r=i.alternate,r!==null&&Ao(r,i,d,!0),i=Dn.current,i!==null){switch(i.tag){case 31:case 13:return mr===null?nu():i.alternate===null&&Ct===0&&(Ct=3),i.flags&=-257,i.flags|=65536,i.lanes=d,l===Ic?i.flags|=16384:(r=i.updateQueue,r===null?i.updateQueue=new Set([l]):r.add(l),Hp(t,l,d)),!1;case 22:return i.flags|=65536,l===Ic?i.flags|=16384:(r=i.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=r):(i=r.retryQueue,i===null?r.retryQueue=new Set([l]):i.add(l)),Hp(t,l,d)),!1}throw Error(s(435,i.tag))}return Hp(t,l,d),nu(),!1}if(Ke)return r=Dn.current,r===null?(l!==jf&&(r=Error(s(423),{cause:l}),zs(Un(r,i))),t=t.current.alternate,t.flags|=65536,d&=-d,t.lanes|=d,l=Un(l,i),d=vp(t.stateNode,l,d),Qf(t,d),Ct!==4&&(Ct=2)):(!(r.flags&65536)&&(r.flags|=256),r.flags|=65536,r.lanes=d,l!==jf&&(t=Error(s(422),{cause:l}),zs(Un(t,i)))),!1;var m=Error(s(520),{cause:l});if(m=Un(m,i),rl===null?rl=[m]:rl.push(m),Ct!==4&&(Ct=2),r===null)return!0;l=Un(l,i),i=r;do{switch(i.tag){case 3:return i.flags|=65536,t=d&-d,i.lanes|=t,t=vp(i.stateNode,l,t),Qf(i,t),!1;case 1:if(r=i.type,m=i.stateNode,!(i.flags&128)&&(typeof r.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(ja===null||!ja.has(m))))return i.flags|=65536,d&=-d,i.lanes|=d,d=Nv(d),Dv(d,t,i,l),Qf(i,d),!1}i=i.return}while(i!==null);return!1}var bp=Error(s(461)),zt=!1;function tn(t,r,i,l){r.child=t===null?Hy(r,null,i,l):Mi(r,t.child,i,l)}function jv(t,r,i,l,d){i=i.render;var m=r.ref;if("ref"in l){var k={};for(var L in l)L!=="ref"&&(k[L]=l[L])}else k=l;return Oi(r),l=ep(t,r,i,k,m,d),L=tp(),t!==null&&!zt?(np(t,r,d),Qr(t,r,d)):(Ke&&L&&Nf(r),r.flags|=1,tn(t,r,l,d),r.child)}function zv(t,r,i,l,d){if(t===null){var m=i.type;return typeof m=="function"&&!Rf(m)&&m.defaultProps===void 0&&i.compare===null?(r.tag=15,r.type=m,qv(t,r,m,l,d)):(t=Cc(i.type,null,l,r,r.mode,d),t.ref=r.ref,t.return=r,r.child=t)}if(m=t.child,!Tp(t,d)){var k=m.memoizedProps;if(i=i.compare,i=i===null?Ns:i,i(k,l)&&t.ref===r.ref)return Qr(t,r,d)}return r.flags|=1,t=Vr(m,l),t.ref=r.ref,t.return=r,r.child=t}function qv(t,r,i,l,d){if(t!==null){var m=t.memoizedProps;if(Ns(m,l)&&t.ref===r.ref)if(zt=!1,r.pendingProps=l=m,Tp(t,d))t.flags&131072&&(zt=!0);else return r.lanes=t.lanes,Qr(t,r,d)}return wp(t,r,i,l,d)}function Bv(t,r,i,l){var d=l.children,m=t===null?null:t.memoizedState;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if(r.flags&128){if(m=m===null?i:m.baseLanes|i,t!==null){for(l=r.child=t.child,d=0;l!==null;)d=d|l.lanes|l.childLanes,l=l.sibling;l=d&~m}else l=0,r.child=null;return Fv(t,r,m,i,l)}if(i&536870912)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Oc(r,m===null?null:m.cachePool),m===null?Jf():Uy(r,m),Ky(r);else return l=r.lanes=536870912,Fv(t,r,m===null?i:m.baseLanes|i,i,l)}else m===null?(t!==null&&Oc(r,null),Jf(),Ma(r)):(Oc(r,m.cachePool),Uy(r,m),Ma(r),r.memoizedState=null);return tn(t,r,d,i),r.child}function Js(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Fv(t,r,i,l,d){var m=$f();return m=m===null?null:{parent:Dt._currentValue,pool:m},r.memoizedState={baseLanes:i,cachePool:m},t!==null&&Oc(r,null),Jf(),Ky(r),t!==null&&Ao(t,r,l,!0),r.childLanes=d,null}function Wc(t,r){return r=Kc({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function Vv(t,r,i){return Mi(r,t.child,null,i),t=Wc(r,r.pendingProps),t.flags|=2,jn(r),r.memoizedState=null,t}function q4(t,r,i){var l=r.pendingProps,d=(r.flags&128)!=0;if(r.flags&=-129,t===null){if(Ke){if(l.mode==="hidden")return t=Wc(r,l),r.lanes=536870912,Js(null,t);if(Yf(r),(t=vt)?(t=t2(t,Gn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Ta===null?null:{id:Tr,overflow:Lr},retryLane:536870912,hydrationErrors:null},i=Ly(t),i.return=r,r.child=i,Zt=r,vt=null)):t=null,t===null)throw Oa(r);return r.lanes=536870912,null}return Wc(r,l)}var m=t.memoizedState;if(m!==null){var k=m.dehydrated;if(Yf(r),d)if(r.flags&256)r.flags&=-257,r=Vv(t,r,i);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(s(558));else if(zt||Ao(t,r,i,!1),d=(i&t.childLanes)!==0,zt||d){if(l=dt,l!==null&&(k=oc(l,i),k!==0&&k!==m.retryLane))throw m.retryLane=k,Ci(t,k),Cn(l,t,k),bp;nu(),r=Vv(t,r,i)}else t=m.treeContext,vt=Xn(k.nextSibling),Zt=r,Ke=!0,La=null,Gn=!1,t!==null&&Iy(r,t),r=Wc(r,l),r.flags|=4096;return r}return t=Vr(t.child,{mode:l.mode,children:l.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Uc(t,r){var i=r.ref;if(i===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(s(284));(t===null||t.ref!==i)&&(r.flags|=4194816)}}function wp(t,r,i,l,d){return Oi(r),i=ep(t,r,i,l,void 0,d),l=tp(),t!==null&&!zt?(np(t,r,d),Qr(t,r,d)):(Ke&&l&&Nf(r),r.flags|=1,tn(t,r,i,d),r.child)}function Hv(t,r,i,l,d,m){return Oi(r),r.updateQueue=null,i=Gy(r,l,i,d),Qy(t),l=tp(),t!==null&&!zt?(np(t,r,m),Qr(t,r,m)):(Ke&&l&&Nf(r),r.flags|=1,tn(t,r,i,m),r.child)}function $v(t,r,i,l,d){if(Oi(r),r.stateNode===null){var m=Eo,k=i.contextType;typeof k=="object"&&k&&(m=en(k)),m=new i(l,m),r.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=yp,r.stateNode=m,m._reactInternals=r,m=r.stateNode,m.props=l,m.state=r.memoizedState,m.refs={},Uf(r),k=i.contextType,m.context=typeof k=="object"&&k?en(k):Eo,m.state=r.memoizedState,k=i.getDerivedStateFromProps,typeof k=="function"&&(gp(r,i,k,l),m.state=r.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(k=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),k!==m.state&&yp.enqueueReplaceState(m,m.state,null),Ws(r,l,m,d),$s(),m.state=r.memoizedState),typeof m.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(t===null){m=r.stateNode;var L=r.memoizedProps,q=ji(i,L);m.props=q;var J=m.context,oe=i.contextType;k=Eo,typeof oe=="object"&&oe&&(k=en(oe));var ue=i.getDerivedStateFromProps;oe=typeof ue=="function"||typeof m.getSnapshotBeforeUpdate=="function",L=r.pendingProps!==L,oe||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(L||J!==k)&&Mv(r,m,l,k),Ia=!1;var Y=r.memoizedState;m.state=Y,Ws(r,l,m,d),$s(),J=r.memoizedState,L||Y!==J||Ia?(typeof ue=="function"&&(gp(r,i,ue,l),J=r.memoizedState),(q=Ia||Rv(r,i,q,l,Y,J,k))?(oe||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(r.flags|=4194308)):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=J),m.props=l,m.state=J,m.context=k,l=q):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{m=r.stateNode,Kf(t,r),k=r.memoizedProps,oe=ji(i,k),m.props=oe,ue=r.pendingProps,Y=m.context,J=i.contextType,q=Eo,typeof J=="object"&&J&&(q=en(J)),L=i.getDerivedStateFromProps,(J=typeof L=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(k!==ue||Y!==q)&&Mv(r,m,l,q),Ia=!1,Y=r.memoizedState,m.state=Y,Ws(r,l,m,d),$s();var ae=r.memoizedState;k!==ue||Y!==ae||Ia||t!==null&&t.dependencies!==null&&Tc(t.dependencies)?(typeof L=="function"&&(gp(r,i,L,l),ae=r.memoizedState),(oe=Ia||Rv(r,i,oe,l,Y,ae,q)||t!==null&&t.dependencies!==null&&Tc(t.dependencies))?(J||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(l,ae,q),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(l,ae,q)),typeof m.componentDidUpdate=="function"&&(r.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof m.componentDidUpdate!="function"||k===t.memoizedProps&&Y===t.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||k===t.memoizedProps&&Y===t.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=ae),m.props=l,m.state=ae,m.context=q,l=oe):(typeof m.componentDidUpdate!="function"||k===t.memoizedProps&&Y===t.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||k===t.memoizedProps&&Y===t.memoizedState||(r.flags|=1024),l=!1)}return m=l,Uc(t,r),l=(r.flags&128)!=0,m||l?(m=r.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:m.render(),r.flags|=1,t!==null&&l?(r.child=Mi(r,t.child,null,d),r.child=Mi(r,null,i,d)):tn(t,r,i,d),r.memoizedState=m.state,t=r.child):t=Qr(t,r,d),t}function Wv(t,r,i,l){return Ti(),r.flags|=256,tn(t,r,i,l),r.child}var _p={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xp(t){return{baseLanes:t,cachePool:jy()}}function kp(t,r,i){return t=t===null?0:t.childLanes&~i,r&&(t|=qn),t}function Uv(t,r,i){var l=r.pendingProps,d=!1,m=(r.flags&128)!=0,k;if((k=m)||(k=t!==null&&t.memoizedState===null?!1:(At.current&2)!=0),k&&(d=!0,r.flags&=-129),k=(r.flags&32)!=0,r.flags&=-33,t===null){if(Ke){if(d?Ra(r):Ma(r),(t=vt)?(t=t2(t,Gn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Ta===null?null:{id:Tr,overflow:Lr},retryLane:536870912,hydrationErrors:null},i=Ly(t),i.return=r,r.child=i,Zt=r,vt=null)):t=null,t===null)throw Oa(r);return ah(t)?r.lanes=32:r.lanes=536870912,null}var L=l.children;return l=l.fallback,d?(Ma(r),d=r.mode,L=Kc({mode:"hidden",children:L},d),l=Ei(l,d,i,null),L.return=r,l.return=r,L.sibling=l,r.child=L,l=r.child,l.memoizedState=xp(i),l.childLanes=kp(t,k,i),r.memoizedState=_p,Js(null,l)):(Ra(r),Sp(r,L))}var q=t.memoizedState;if(q!==null&&(L=q.dehydrated,L!==null)){if(m)r.flags&256?(Ra(r),r.flags&=-257,r=Cp(t,r,i)):r.memoizedState===null?(Ma(r),L=l.fallback,d=r.mode,l=Kc({mode:"visible",children:l.children},d),L=Ei(L,d,i,null),L.flags|=2,l.return=r,L.return=r,l.sibling=L,r.child=l,Mi(r,t.child,null,i),l=r.child,l.memoizedState=xp(i),l.childLanes=kp(t,k,i),r.memoizedState=_p,r=Js(null,l)):(Ma(r),r.child=t.child,r.flags|=128,r=null);else if(Ra(r),ah(L)){if(k=L.nextSibling&&L.nextSibling.dataset,k)var J=k.dgst;k=J,l=Error(s(419)),l.stack="",l.digest=k,zs({value:l,source:null,stack:null}),r=Cp(t,r,i)}else if(zt||Ao(t,r,i,!1),k=(i&t.childLanes)!==0,zt||k){if(k=dt,k!==null&&(l=oc(k,i),l!==0&&l!==q.retryLane))throw q.retryLane=l,Ci(t,l),Cn(k,t,l),bp;rh(L)||nu(),r=Cp(t,r,i)}else rh(L)?(r.flags|=192,r.child=t.child,r=null):(t=q.treeContext,vt=Xn(L.nextSibling),Zt=r,Ke=!0,La=null,Gn=!1,t!==null&&Iy(r,t),r=Sp(r,l.children),r.flags|=4096);return r}return d?(Ma(r),L=l.fallback,d=r.mode,q=t.child,J=q.sibling,l=Vr(q,{mode:"hidden",children:l.children}),l.subtreeFlags=q.subtreeFlags&65011712,J===null?(L=Ei(L,d,i,null),L.flags|=2):L=Vr(J,L),L.return=r,l.return=r,l.sibling=L,r.child=l,Js(null,l),l=r.child,L=t.child.memoizedState,L===null?L=xp(i):(d=L.cachePool,d===null?d=jy():(q=Dt._currentValue,d=d.parent===q?d:{parent:q,pool:q}),L={baseLanes:L.baseLanes|i,cachePool:d}),l.memoizedState=L,l.childLanes=kp(t,k,i),r.memoizedState=_p,Js(t.child,l)):(Ra(r),i=t.child,t=i.sibling,i=Vr(i,{mode:"visible",children:l.children}),i.return=r,i.sibling=null,t!==null&&(k=r.deletions,k===null?(r.deletions=[t],r.flags|=16):k.push(t)),r.child=i,r.memoizedState=null,i)}function Sp(t,r){return r=Kc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Kc(t,r){return t=Nn(22,t,null,r),t.lanes=0,t}function Cp(t,r,i){return Mi(r,t.child,null,i),t=Sp(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function Kv(t,r,i){t.lanes|=r;var l=t.alternate;l!==null&&(l.lanes|=r),Bf(t.return,r,i)}function Ep(t,r,i,l,d,m){var k=t.memoizedState;k===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:d,treeForkCount:m}:(k.isBackwards=r,k.rendering=null,k.renderingStartTime=0,k.last=l,k.tail=i,k.tailMode=d,k.treeForkCount=m)}function Qv(t,r,i){var l=r.pendingProps,d=l.revealOrder,m=l.tail;l=l.children;var k=At.current,L=(k&2)!=0;if(L?(k=k&1|2,r.flags|=128):k&=1,Le(At,k),tn(t,r,l,i),l=Ke?js:0,!L&&t!==null&&t.flags&128)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Kv(t,i,r);else if(t.tag===19)Kv(t,i,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(d){case"forwards":for(i=r.child,d=null;i!==null;)t=i.alternate,t!==null&&Nc(t)===null&&(d=i),i=i.sibling;i=d,i===null?(d=r.child,r.child=null):(d=i.sibling,i.sibling=null),Ep(r,!1,d,i,m,l);break;case"backwards":case"unstable_legacy-backwards":for(i=null,d=r.child,r.child=null;d!==null;){if(t=d.alternate,t!==null&&Nc(t)===null){r.child=d;break}t=d.sibling,d.sibling=i,i=d,d=t}Ep(r,!0,i,null,m,l);break;case"together":Ep(r,!1,null,null,void 0,l);break;default:r.memoizedState=null}return r.child}function Qr(t,r,i){if(t!==null&&(r.dependencies=t.dependencies),Da|=r.lanes,(i&r.childLanes)===0)if(t!==null){if(Ao(t,r,i,!1),(i&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(s(153));if(r.child!==null){for(t=r.child,i=Vr(t,t.pendingProps),r.child=i,i.return=r;t.sibling!==null;)t=t.sibling,i=i.sibling=Vr(t,t.pendingProps),i.return=r;i.sibling=null}return r.child}function Tp(t,r){return(t.lanes&r)===0?(t=t.dependencies,!!(t!==null&&Tc(t))):!0}function B4(t,r,i){switch(r.tag){case 3:co(r,r.stateNode.containerInfo),Aa(r,Dt,t.memoizedState.cache),Ti();break;case 27:case 5:Pr(r);break;case 4:co(r,r.stateNode.containerInfo);break;case 10:Aa(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Yf(r),null;break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated===null?(i&r.child.childLanes)===0?(Ra(r),t=Qr(t,r,i),t===null?null:t.sibling):Uv(t,r,i):(Ra(r),r.flags|=128,null);Ra(r);break;case 19:var d=(t.flags&128)!=0;if(l=(i&r.childLanes)!==0,l||(l=(Ao(t,r,i,!1),(i&r.childLanes)!==0)),d){if(l)return Qv(t,r,i);r.flags|=128}if(d=r.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Le(At,At.current),l)break;return null;case 22:return r.lanes=0,Bv(t,r,i,r.pendingProps);case 24:Aa(r,Dt,t.memoizedState.cache)}return Qr(t,r,i)}function Gv(t,r,i){if(t!==null)if(t.memoizedProps!==r.pendingProps)zt=!0;else{if(!Tp(t,i)&&!(r.flags&128))return zt=!1,B4(t,r,i);zt=!!(t.flags&131072)}else zt=!1,Ke&&r.flags&1048576&&Ay(r,js,r.index);switch(r.lanes=0,r.tag){case 16:e:{var l=r.pendingProps;if(t=Ii(r.elementType),r.type=t,typeof t=="function")Rf(t)?(l=ji(t,l),r.tag=1,r=$v(null,r,t,l,i)):(r.tag=0,r=wp(null,r,t,l,i));else{if(t!=null){var d=t.$$typeof;if(d===fe){r.tag=11,r=jv(null,r,t,l,i);break e}else if(d===F){r.tag=14,r=zv(null,r,t,l,i);break e}}throw r=pe(t)||t,Error(s(306,r,""))}}return r;case 0:return wp(t,r,r.type,r.pendingProps,i);case 1:return l=r.type,d=ji(l,r.pendingProps),$v(t,r,l,d,i);case 3:e:{if(co(r,r.stateNode.containerInfo),t===null)throw Error(s(387));l=r.pendingProps;var m=r.memoizedState;d=m.element,Kf(t,r),Ws(r,l,null,i);var k=r.memoizedState;if(l=k.cache,Aa(r,Dt,l),l!==m.cache&&Ff(r,[Dt],i,!0),$s(),l=k.element,m.isDehydrated)if(m={element:l,isDehydrated:!1,cache:k.cache},r.updateQueue.baseState=m,r.memoizedState=m,r.flags&256){r=Wv(t,r,l,i);break e}else if(l!==d){d=Un(Error(s(424)),r),zs(d),r=Wv(t,r,l,i);break e}else for((t=r.stateNode.containerInfo,t.nodeType)===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,vt=Xn(t.firstChild),Zt=r,Ke=!0,La=null,Gn=!0,i=Hy(r,null,l,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Ti(),l===d){r=Qr(t,r,i);break e}tn(t,r,l,i)}r=r.child}return r;case 26:return Uc(t,r),t===null?(i=s2(r.type,null,r.pendingProps,null))?r.memoizedState=i:Ke||(i=r.type,t=r.pendingProps,l=cu(Mt.current).createElement(i),l[Ft]=r,l[Yt]=t,nn(l,i,t),Ot(l),r.stateNode=l):r.memoizedState=s2(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return Pr(r),t===null&&Ke&&(l=r.stateNode=a2(r.type,r.pendingProps,Mt.current),Zt=r,Gn=!0,d=vt,Fa(r.type)?(ih=d,vt=Xn(l.firstChild)):vt=d),tn(t,r,r.pendingProps.children,i),Uc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&Ke&&((d=l=vt)&&(l=h6(l,r.type,r.pendingProps,Gn),l===null?d=!1:(r.stateNode=l,Zt=r,vt=Xn(l.firstChild),Gn=!1,d=!0)),d||Oa(r)),Pr(r),d=r.type,m=r.pendingProps,k=t===null?null:t.memoizedProps,l=m.children,eh(d,m)?l=null:k!==null&&eh(d,k)&&(r.flags|=32),r.memoizedState!==null&&(d=ep(t,r,L4,null,null,i),dl._currentValue=d),Uc(t,r),tn(t,r,l,i),r.child;case 6:return t===null&&Ke&&((t=i=vt)&&(i=m6(i,r.pendingProps,Gn),i===null?t=!1:(r.stateNode=i,Zt=r,vt=null,t=!0)),t||Oa(r)),null;case 13:return Uv(t,r,i);case 4:return co(r,r.stateNode.containerInfo),l=r.pendingProps,t===null?r.child=Mi(r,null,l,i):tn(t,r,l,i),r.child;case 11:return jv(t,r,r.type,r.pendingProps,i);case 7:return tn(t,r,r.pendingProps,i),r.child;case 8:return tn(t,r,r.pendingProps.children,i),r.child;case 12:return tn(t,r,r.pendingProps.children,i),r.child;case 10:return l=r.pendingProps,Aa(r,r.type,l.value),tn(t,r,l.children,i),r.child;case 9:return d=r.type._context,l=r.pendingProps.children,Oi(r),d=en(d),l=l(d),r.flags|=1,tn(t,r,l,i),r.child;case 14:return zv(t,r,r.type,r.pendingProps,i);case 15:return qv(t,r,r.type,r.pendingProps,i);case 19:return Qv(t,r,i);case 31:return q4(t,r,i);case 22:return Bv(t,r,i,r.pendingProps);case 24:return Oi(r),l=en(Dt),t===null?(d=$f(),d===null&&(d=dt,m=Vf(),d.pooledCache=m,m.refCount++,m!==null&&(d.pooledCacheLanes|=i),d=m),r.memoizedState={parent:l,cache:d},Uf(r),Aa(r,Dt,d)):((t.lanes&i)!==0&&(Kf(t,r),Ws(r,null,null,i),$s()),d=t.memoizedState,m=r.memoizedState,d.parent===l?(l=m.cache,Aa(r,Dt,l),l!==d.cache&&Ff(r,[Dt],i,!0)):(d={parent:l,cache:l},r.memoizedState=d,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=d),Aa(r,Dt,l))),tn(t,r,r.pendingProps.children,i),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Gr(t){t.flags|=4}function Lp(t,r,i,l,d){if((r=(t.mode&32)!=0)&&(r=!1),r){if(t.flags|=16777216,(d&335544128)===d)if(t.stateNode.complete)t.flags|=8192;else if(xb())t.flags|=8192;else throw Ri=Ic,Wf}else t.flags&=-16777217}function Jv(t,r){if(r.type!=="stylesheet"||r.state.loading&4)t.flags&=-16777217;else if(t.flags|=16777216,!f2(r))if(xb())t.flags|=8192;else throw Ri=Ic,Wf}function Qc(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag===22?536870912:ic(),t.lanes|=r,Vo|=r)}function Xs(t,r){if(!Ke)switch(t.tailMode){case"hidden":r=t.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function bt(t){var r=t.alternate!==null&&t.alternate.child===t.child,i=0,l=0;if(r)for(var d=t.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags&65011712,l|=d.flags&65011712,d.return=t,d=d.sibling;else for(d=t.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=t,d=d.sibling;return t.subtreeFlags|=l,t.childLanes=i,r}function F4(t,r,i){var l=r.pendingProps;switch(Df(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(r),null;case 1:return bt(r),null;case 3:return i=r.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),Wr(Dt),An(),i.pendingContext&&(i.pendingContext=(i.context=i.pendingContext,null)),(t===null||t.child===null)&&(Oo(r)?Gr(r):t===null||t.memoizedState.isDehydrated&&!(r.flags&256)||(r.flags|=1024,zf())),bt(r),null;case 26:var d=r.type,m=r.memoizedState;return t===null?(Gr(r),m===null?(bt(r),Lp(r,d,null,l,i)):(bt(r),Jv(r,m))):m?m===t.memoizedState?(bt(r),r.flags&=-16777217):(Gr(r),bt(r),Jv(r,m)):(t=t.memoizedProps,t!==l&&Gr(r),bt(r),Lp(r,d,t,l,i)),null;case 27:if(ci(r),i=Mt.current,d=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Gr(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return bt(r),null}t=Re.current,Oo(r)?Ry(r,t):(t=a2(d,l,i),r.stateNode=t,Gr(r))}return bt(r),null;case 5:if(ci(r),d=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Gr(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return bt(r),null}if(m=Re.current,Oo(r))Ry(r,m);else{var k=cu(Mt.current);switch(m){case 1:m=k.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:m=k.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":m=k.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":m=k.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":m=k.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof l.is=="string"?k.createElement("select",{is:l.is}):k.createElement("select"),l.multiple?m.multiple=!0:l.size&&(m.size=l.size);break;default:m=typeof l.is=="string"?k.createElement(d,{is:l.is}):k.createElement(d)}}m[Ft]=r,m[Yt]=l;e:for(k=r.child;k!==null;){if(k.tag===5||k.tag===6)m.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===r)break e;for(;k.sibling===null;){if(k.return===null||k.return===r)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}r.stateNode=m;e:switch(nn(m,d,l),d){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Gr(r)}}return bt(r),Lp(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,i),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==l&&Gr(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(t=Mt.current,Oo(r)){if(t=r.stateNode,i=r.memoizedProps,l=null,d=Zt,d!==null)switch(d.tag){case 27:case 5:l=d.memoizedProps}t[Ft]=r,t=!!(t.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||Kb(t.nodeValue,i)),t||Oa(r,!0)}else t=cu(t).createTextNode(l),t[Ft]=r,r.stateNode=t}return bt(r),null;case 31:if(i=r.memoizedState,t===null||t.memoizedState!==null){if(l=Oo(r),i!==null){if(t===null){if(!l)throw Error(s(318));if(t=r.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(557));t[Ft]=r}else Ti(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;bt(r),t=!1}else i=zf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return r.flags&256?(jn(r),r):(jn(r),null);if(r.flags&128)throw Error(s(558))}return bt(r),null;case 13:if(l=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(d=Oo(r),l!==null&&l.dehydrated!==null){if(t===null){if(!d)throw Error(s(318));if(d=r.memoizedState,d=d===null?null:d.dehydrated,!d)throw Error(s(317));d[Ft]=r}else Ti(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;bt(r),d=!1}else d=zf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=d),d=!0;if(!d)return r.flags&256?(jn(r),r):(jn(r),null)}return jn(r),r.flags&128?(r.lanes=i,r):(i=l!==null,t=t!==null&&t.memoizedState!==null,i&&(l=r.child,d=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(d=l.alternate.memoizedState.cachePool.pool),m=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(m=l.memoizedState.cachePool.pool),m!==d&&(l.flags|=2048)),i!==t&&i&&(r.child.flags|=8192),Qc(r,r.updateQueue),bt(r),null);case 4:return An(),t===null&&Hb(r.stateNode.containerInfo),bt(r),null;case 10:return Wr(r.type),bt(r),null;case 19:if(ze(At),l=r.memoizedState,l===null)return bt(r),null;if(d=(r.flags&128)!=0,m=l.rendering,m===null)if(d)Xs(l,!1);else{if(Ct!==0||t!==null&&t.flags&128)for(t=r.child;t!==null;){if(m=Nc(t),m!==null){for(r.flags|=128,Xs(l,!1),t=m.updateQueue,r.updateQueue=t,Qc(r,t),r.subtreeFlags=0,t=i,i=r.child;i!==null;)Ty(i,t),i=i.sibling;return Le(At,At.current&1|2),Ke&&Hr(r,l.treeForkCount),r.child}t=t.sibling}l.tail!==null&&Jt()>Zc&&(r.flags|=128,d=!0,Xs(l,!1),r.lanes=4194304)}else{if(!d)if(t=Nc(m),t!==null){if(r.flags|=128,d=!0,t=t.updateQueue,r.updateQueue=t,Qc(r,t),Xs(l,!0),l.tail===null&&l.tailMode==="hidden"&&!m.alternate&&!Ke)return bt(r),null}else 2*Jt()-l.renderingStartTime>Zc&&i!==536870912&&(r.flags|=128,d=!0,Xs(l,!1),r.lanes=4194304);l.isBackwards?(m.sibling=r.child,r.child=m):(t=l.last,t===null?r.child=m:t.sibling=m,l.last=m)}return l.tail===null?(bt(r),null):(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Jt(),t.sibling=null,i=At.current,Le(At,d?i&1|2:i&1),Ke&&Hr(r,l.treeForkCount),t);case 22:case 23:return jn(r),Xf(),l=r.memoizedState!==null,t===null?l&&(r.flags|=8192):t.memoizedState!==null!==l&&(r.flags|=8192),l?i&536870912&&!(r.flags&128)&&(bt(r),r.subtreeFlags&6&&(r.flags|=8192)):bt(r),i=r.updateQueue,i!==null&&Qc(r,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==i&&(r.flags|=2048),t!==null&&ze(Ai),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),r.memoizedState.cache!==i&&(r.flags|=2048),Wr(Dt),bt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function V4(t,r){switch(Df(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Wr(Dt),An(),t=r.flags,t&65536&&!(t&128)?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return ci(r),null;case 31:if(r.memoizedState!==null){if(jn(r),r.alternate===null)throw Error(s(340));Ti()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(jn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Ti()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return ze(At),null;case 4:return An(),null;case 10:return Wr(r.type),null;case 22:case 23:return jn(r),Xf(),t!==null&&ze(Ai),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Wr(Dt),null;case 25:return null;default:return null}}function Xv(t,r){switch(Df(r),r.tag){case 3:Wr(Dt),An();break;case 26:case 27:case 5:ci(r);break;case 4:An();break;case 31:r.memoizedState!==null&&jn(r);break;case 13:jn(r);break;case 19:ze(At);break;case 10:Wr(r.type);break;case 22:case 23:jn(r),Xf(),t!==null&&ze(Ai);break;case 24:Wr(Dt)}}function Ys(t,r){try{var i=r.updateQueue,l=i===null?null:i.lastEffect;if(l!==null){var d=l.next;i=d;do{if((i.tag&t)===t){l=void 0;var m=i.create,k=i.inst;l=m(),k.destroy=l}i=i.next}while(i!==d)}}catch(L){at(r,r.return,L)}}function Pa(t,r,i){try{var l=r.updateQueue,d=l===null?null:l.lastEffect;if(d!==null){var m=d.next;l=m;do{if((l.tag&t)===t){var k=l.inst,L=k.destroy;if(L!==void 0){k.destroy=void 0,d=r;var q=i,J=L;try{J()}catch(oe){at(d,q,oe)}}}l=l.next}while(l!==m)}}catch(oe){at(r,r.return,oe)}}function Yv(t){var r=t.updateQueue;if(r!==null){var i=t.stateNode;try{Wy(r,i)}catch(l){at(t,t.return,l)}}}function Zv(t,r,i){i.props=ji(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(l){at(t,r,l)}}function Zs(t,r){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof i=="function"?t.refCleanup=i(l):i.current=l}}catch(d){at(t,r,d)}}function Or(t,r){var i=t.ref,l=t.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(d){at(t,r,d)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(d){at(t,r,d)}else i.current=null}function eb(t){var r=t.type,i=t.memoizedProps,l=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(d){at(t,t.return,d)}}function Op(t,r,i){try{var l=t.stateNode;l6(l,t.type,i,r),l[Yt]=r}catch(d){at(t,t.return,d)}}function tb(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Fa(t.type)||t.tag===4}function Ap(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||tb(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Fa(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ip(t,r,i){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,r):(r=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,r.appendChild(t),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=$n));else if(l!==4&&(l===27&&Fa(t.type)&&(i=t.stateNode,r=null),t=t.child,t!==null))for(Ip(t,r,i),t=t.sibling;t!==null;)Ip(t,r,i),t=t.sibling}function Gc(t,r,i){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?i.insertBefore(t,r):i.appendChild(t);else if(l!==4&&(l===27&&Fa(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(Gc(t,r,i),t=t.sibling;t!==null;)Gc(t,r,i),t=t.sibling}function nb(t){var r=t.stateNode,i=t.memoizedProps;try{for(var l=t.type,d=r.attributes;d.length;)r.removeAttributeNode(d[0]);nn(r,l,i),r[Ft]=t,r[Yt]=i}catch(m){at(t,t.return,m)}}var Jr=!1,qt=!1,Rp=!1,rb=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function H4(t,r){if(t=t.containerInfo,Yp=gu,t=vy(t),Cf(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var d=l.anchorOffset,m=l.focusNode;l=l.focusOffset;try{i.nodeType,m.nodeType}catch{i=null;break e}var k=0,L=-1,q=-1,J=0,oe=0,ue=t,Y=null;t:for(;;){for(var ae;ue!==i||d!==0&&ue.nodeType!==3||(L=k+d),ue!==m||l!==0&&ue.nodeType!==3||(q=k+l),ue.nodeType===3&&(k+=ue.nodeValue.length),(ae=ue.firstChild)!==null;)Y=ue,ue=ae;for(;;){if(ue===t)break t;if(Y===i&&++J===d&&(L=k),Y===m&&++oe===l&&(q=k),(ae=ue.nextSibling)!==null)break;ue=Y,Y=ue.parentNode}ue=ae}i=L===-1||q===-1?null:{start:L,end:q}}else i=null}i||(i={start:0,end:0})}else i=null;for(Zp={focusedElem:t,selectionRange:i},gu=!1,Gt=r;Gt!==null;)if(r=Gt,t=r.child,r.subtreeFlags&1028&&t!==null)t.return=r,Gt=t;else for(;Gt!==null;){switch(r=Gt,m=r.alternate,t=r.flags,r.tag){case 0:if(t&4&&(t=r.updateQueue,t=t===null?null:t.events,t!==null))for(i=0;i<t.length;i++)d=t[i],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if(t&1024&&m!==null){t=void 0,i=r,d=m.memoizedProps,m=m.memoizedState,l=i.stateNode;try{var _e=ji(i.type,d);t=l.getSnapshotBeforeUpdate(_e,m),l.__reactInternalSnapshotBeforeUpdate=t}catch(Te){at(i,i.return,Te)}}break;case 3:if(t&1024){if(t=r.stateNode.containerInfo,i=t.nodeType,i===9)nh(t);else if(i===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":nh(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(t&1024)throw Error(s(163))}if(t=r.sibling,t!==null){t.return=r.return,Gt=t;break}Gt=r.return}}function ab(t,r,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:Yr(t,i),l&4&&Ys(5,i);break;case 1:if(Yr(t,i),l&4)if(t=i.stateNode,r===null)try{t.componentDidMount()}catch(k){at(i,i.return,k)}else{var d=ji(i.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(d,r,t.__reactInternalSnapshotBeforeUpdate)}catch(k){at(i,i.return,k)}}l&64&&Yv(i),l&512&&Zs(i,i.return);break;case 3:if(Yr(t,i),l&64&&(t=i.updateQueue,t!==null)){if(r=null,i.child!==null)switch(i.child.tag){case 27:case 5:r=i.child.stateNode;break;case 1:r=i.child.stateNode}try{Wy(t,r)}catch(k){at(i,i.return,k)}}break;case 27:r===null&&l&4&&nb(i);case 26:case 5:Yr(t,i),r===null&&l&4&&eb(i),l&512&&Zs(i,i.return);break;case 12:Yr(t,i);break;case 31:Yr(t,i),l&4&&sb(t,i);break;case 13:Yr(t,i),l&4&&lb(t,i),l&64&&(t=i.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(i=Y4.bind(null,i),g6(t,i))));break;case 22:if(l=i.memoizedState!==null||Jr,!l){r=r!==null&&r.memoizedState!==null||qt,d=Jr;var m=qt;Jr=l,(qt=r)&&!m?Zr(t,i,(i.subtreeFlags&8772)!=0):Yr(t,i),Jr=d,qt=m}break;case 30:break;default:Yr(t,i)}}function ib(t){var r=t.alternate;r!==null&&(t.alternate=null,ib(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&go(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var xt=null,_n=!1;function Xr(t,r,i){for(i=i.child;i!==null;)ob(t,r,i),i=i.sibling}function ob(t,r,i){if(on&&typeof on.onCommitFiberUnmount=="function")try{on.onCommitFiberUnmount(ui,i)}catch{}switch(i.tag){case 26:qt||Or(i,r),Xr(t,r,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:qt||Or(i,r);var l=xt,d=_n;Fa(i.type)&&(xt=i.stateNode,_n=!1),Xr(t,r,i),ll(i.stateNode),xt=l,_n=d;break;case 5:qt||Or(i,r);case 6:if(l=xt,d=_n,xt=null,Xr(t,r,i),xt=l,_n=d,xt!==null)if(_n)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(i.stateNode)}catch(m){at(i,r,m)}else try{xt.removeChild(i.stateNode)}catch(m){at(i,r,m)}break;case 18:xt!==null&&(_n?(t=xt,Zb(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,i.stateNode),Jo(t)):Zb(xt,i.stateNode));break;case 4:l=xt,d=_n,xt=i.stateNode.containerInfo,_n=!0,Xr(t,r,i),xt=l,_n=d;break;case 0:case 11:case 14:case 15:Pa(2,i,r),qt||Pa(4,i,r),Xr(t,r,i);break;case 1:qt||(Or(i,r),l=i.stateNode,typeof l.componentWillUnmount=="function"&&Zv(i,r,l)),Xr(t,r,i);break;case 21:Xr(t,r,i);break;case 22:qt=(l=qt)||i.memoizedState!==null,Xr(t,r,i),qt=l;break;default:Xr(t,r,i)}}function sb(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Jo(t)}catch(i){at(r,r.return,i)}}}function lb(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Jo(t)}catch(i){at(r,r.return,i)}}function $4(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new rb),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new rb),r;default:throw Error(s(435,t.tag))}}function Jc(t,r){var i=$4(t);r.forEach(function(l){if(!i.has(l)){i.add(l);var d=Z4.bind(null,t,l);l.then(d,d)}})}function xn(t,r){var i=r.deletions;if(i!==null)for(var l=0;l<i.length;l++){var d=i[l],m=t,k=r,L=k;e:for(;L!==null;){switch(L.tag){case 27:if(Fa(L.type)){xt=L.stateNode,_n=!1;break e}break;case 5:xt=L.stateNode,_n=!1;break e;case 3:case 4:xt=L.stateNode.containerInfo,_n=!0;break e}L=L.return}if(xt===null)throw Error(s(160));ob(m,k,d),xt=null,_n=!1,m=d.alternate,m!==null&&(m.return=null),d.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)cb(r,t),r=r.sibling}var gr=null;function cb(t,r){var i=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:xn(r,t),kn(t),l&4&&(Pa(3,t,t.return),Ys(3,t),Pa(5,t,t.return));break;case 1:xn(r,t),kn(t),l&512&&(qt||i===null||Or(i,i.return)),l&64&&Jr&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(i=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var d=gr;if(xn(r,t),kn(t),l&512&&(qt||i===null||Or(i,i.return)),l&4){var m=i===null?null:i.memoizedState;if(l=t.memoizedState,i===null)if(l===null)if(t.stateNode===null){e:{l=t.type,i=t.memoizedProps,d=d.ownerDocument||d;t:switch(l){case"title":m=d.getElementsByTagName("title")[0],(!m||m[pi]||m[Ft]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=d.createElement(l),d.head.insertBefore(m,d.querySelector("head > title"))),nn(m,l,i),m[Ft]=t,Ot(m),l=m;break e;case"link":var k=u2("link","href",d).get(l+(i.href||""));if(k){for(var L=0;L<k.length;L++)if(m=k[L],m.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&m.getAttribute("rel")===(i.rel==null?null:i.rel)&&m.getAttribute("title")===(i.title==null?null:i.title)&&m.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){k.splice(L,1);break t}}m=d.createElement(l),nn(m,l,i),d.head.appendChild(m);break;case"meta":if(k=u2("meta","content",d).get(l+(i.content||""))){for(L=0;L<k.length;L++)if(m=k[L],m.getAttribute("content")===(i.content==null?null:""+i.content)&&m.getAttribute("name")===(i.name==null?null:i.name)&&m.getAttribute("property")===(i.property==null?null:i.property)&&m.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&m.getAttribute("charset")===(i.charSet==null?null:i.charSet)){k.splice(L,1);break t}}m=d.createElement(l),nn(m,l,i),d.head.appendChild(m);break;default:throw Error(s(468,l))}m[Ft]=t,Ot(m),l=m}t.stateNode=l}else d2(d,t.type,t.stateNode);else t.stateNode=c2(d,l,t.memoizedProps);else m===l?l===null&&t.stateNode!==null&&Op(t,t.memoizedProps,i.memoizedProps):(m===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):m.count--,l===null?d2(d,t.type,t.stateNode):c2(d,l,t.memoizedProps))}break;case 27:xn(r,t),kn(t),l&512&&(qt||i===null||Or(i,i.return)),i!==null&&l&4&&Op(t,t.memoizedProps,i.memoizedProps);break;case 5:if(xn(r,t),kn(t),l&512&&(qt||i===null||Or(i,i.return)),t.flags&32){d=t.stateNode;try{qr(d,"")}catch(_e){at(t,t.return,_e)}}l&4&&t.stateNode!=null&&(d=t.memoizedProps,Op(t,d,i===null?d:i.memoizedProps)),l&1024&&(Rp=!0);break;case 6:if(xn(r,t),kn(t),l&4){if(t.stateNode===null)throw Error(s(162));l=t.memoizedProps,i=t.stateNode;try{i.nodeValue=l}catch(_e){at(t,t.return,_e)}}break;case 3:if(fu=null,d=gr,gr=uu(r.containerInfo),xn(r,t),gr=d,kn(t),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Jo(r.containerInfo)}catch(_e){at(t,t.return,_e)}Rp&&(Rp=!1,ub(t));break;case 4:l=gr,gr=uu(t.stateNode.containerInfo),xn(r,t),kn(t),gr=l;break;case 12:xn(r,t),kn(t);break;case 31:xn(r,t),kn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Jc(t,l)));break;case 13:xn(r,t),kn(t),t.child.flags&8192&&t.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Yc=Jt()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Jc(t,l)));break;case 22:d=t.memoizedState!==null;var q=i!==null&&i.memoizedState!==null,J=Jr,oe=qt;if(Jr=J||d,qt=oe||q,xn(r,t),qt=oe,Jr=J,kn(t),l&8192)e:for(r=t.stateNode,r._visibility=d?r._visibility&-2:r._visibility|1,d&&(i===null||q||Jr||qt||zi(t)),i=null,r=t;;){if(r.tag===5||r.tag===26){if(i===null){q=i=r;try{if(m=q.stateNode,d)k=m.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{L=q.stateNode;var ue=q.memoizedProps.style,Y=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;L.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(_e){at(q,q.return,_e)}}}else if(r.tag===6){if(i===null){q=r;try{q.stateNode.nodeValue=d?"":q.memoizedProps}catch(_e){at(q,q.return,_e)}}}else if(r.tag===18){if(i===null){q=r;try{var ae=q.stateNode;d?e2(ae,!0):e2(q.stateNode,!1)}catch(_e){at(q,q.return,_e)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;i===r&&(i=null),r=r.return}i===r&&(i=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=t.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,Jc(t,i))));break;case 19:xn(r,t),kn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Jc(t,l)));break;case 30:break;case 21:break;default:xn(r,t),kn(t)}}function kn(t){var r=t.flags;if(r&2){try{for(var i,l=t.return;l!==null;){if(tb(l)){i=l;break}l=l.return}if(i==null)throw Error(s(160));switch(i.tag){case 27:var d=i.stateNode;Gc(t,Ap(t),d);break;case 5:var m=i.stateNode;i.flags&32&&(qr(m,""),i.flags&=-33),Gc(t,Ap(t),m);break;case 3:case 4:var k=i.stateNode.containerInfo;Ip(t,Ap(t),k);break;default:throw Error(s(161))}}catch(L){at(t,t.return,L)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function ub(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;ub(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Yr(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)ab(t,r.alternate,r),r=r.sibling}function zi(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:Pa(4,r,r.return),zi(r);break;case 1:Or(r,r.return);var i=r.stateNode;typeof i.componentWillUnmount=="function"&&Zv(r,r.return,i),zi(r);break;case 27:ll(r.stateNode);case 26:case 5:Or(r,r.return),zi(r);break;case 22:r.memoizedState===null&&zi(r);break;case 30:zi(r);break;default:zi(r)}t=t.sibling}}function Zr(t,r,i){for(i&&(i=(r.subtreeFlags&8772)!=0),r=r.child;r!==null;){var l=r.alternate,d=t,m=r,k=m.flags;switch(m.tag){case 0:case 11:case 15:Zr(d,m,i),Ys(4,m);break;case 1:if(Zr(d,m,i),l=m,d=l.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(J){at(l,l.return,J)}if(l=m,d=l.updateQueue,d!==null){var L=l.stateNode;try{var q=d.shared.hiddenCallbacks;if(q!==null)for(d.shared.hiddenCallbacks=null,d=0;d<q.length;d++)$y(q[d],L)}catch(J){at(l,l.return,J)}}i&&k&64&&Yv(m),Zs(m,m.return);break;case 27:nb(m);case 26:case 5:Zr(d,m,i),i&&l===null&&k&4&&eb(m),Zs(m,m.return);break;case 12:Zr(d,m,i);break;case 31:Zr(d,m,i),i&&k&4&&sb(d,m);break;case 13:Zr(d,m,i),i&&k&4&&lb(d,m);break;case 22:m.memoizedState===null&&Zr(d,m,i),Zs(m,m.return);break;case 30:break;default:Zr(d,m,i)}r=r.sibling}}function Mp(t,r){var i=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==i&&(t!=null&&t.refCount++,i!=null&&qs(i))}function Pp(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&qs(t))}function yr(t,r,i,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)db(t,r,i,l),r=r.sibling}function db(t,r,i,l){var d=r.flags;switch(r.tag){case 0:case 11:case 15:yr(t,r,i,l),d&2048&&Ys(9,r);break;case 1:yr(t,r,i,l);break;case 3:yr(t,r,i,l),d&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&qs(t)));break;case 12:if(d&2048){yr(t,r,i,l),t=r.stateNode;try{var m=r.memoizedProps,k=m.id,L=m.onPostCommit;typeof L=="function"&&L(k,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(q){at(r,r.return,q)}}else yr(t,r,i,l);break;case 31:yr(t,r,i,l);break;case 13:yr(t,r,i,l);break;case 23:break;case 22:m=r.stateNode,k=r.alternate,r.memoizedState===null?m._visibility&2?yr(t,r,i,l):(m._visibility|=2,qo(t,r,i,l,(r.subtreeFlags&10256)!=0||!1)):m._visibility&2?yr(t,r,i,l):el(t,r),d&2048&&Mp(k,r);break;case 24:yr(t,r,i,l),d&2048&&Pp(r.alternate,r);break;default:yr(t,r,i,l)}}function qo(t,r,i,l,d){for(d&&(d=(r.subtreeFlags&10256)!=0||!1),r=r.child;r!==null;){var m=t,k=r,L=i,q=l,J=k.flags;switch(k.tag){case 0:case 11:case 15:qo(m,k,L,q,d),Ys(8,k);break;case 23:break;case 22:var oe=k.stateNode;k.memoizedState===null?(oe._visibility|=2,qo(m,k,L,q,d)):oe._visibility&2?qo(m,k,L,q,d):el(m,k),d&&J&2048&&Mp(k.alternate,k);break;case 24:qo(m,k,L,q,d),d&&J&2048&&Pp(k.alternate,k);break;default:qo(m,k,L,q,d)}r=r.sibling}}function el(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var i=t,l=r,d=l.flags;switch(l.tag){case 22:el(i,l),d&2048&&Mp(l.alternate,l);break;case 24:el(i,l),d&2048&&Pp(l.alternate,l);break;default:el(i,l)}r=r.sibling}}var tl=8192;function Bo(t,r,i){if(t.subtreeFlags&tl)for(t=t.child;t!==null;)fb(t,r,i),t=t.sibling}function fb(t,r,i){switch(t.tag){case 26:Bo(t,r,i),t.flags&tl&&t.memoizedState!==null&&L6(i,gr,t.memoizedState,t.memoizedProps);break;case 5:Bo(t,r,i);break;case 3:case 4:var l=gr;gr=uu(t.stateNode.containerInfo),Bo(t,r,i),gr=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=tl,tl=16777216,Bo(t,r,i),tl=l):Bo(t,r,i));break;default:Bo(t,r,i)}}function pb(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function nl(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var i=0;i<r.length;i++){var l=r[i];Gt=l,mb(l,t)}pb(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)hb(t),t=t.sibling}function hb(t){switch(t.tag){case 0:case 11:case 15:nl(t),t.flags&2048&&Pa(9,t,t.return);break;case 3:nl(t);break;case 12:nl(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Xc(t)):nl(t);break;default:nl(t)}}function Xc(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var i=0;i<r.length;i++){var l=r[i];Gt=l,mb(l,t)}pb(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:Pa(8,r,r.return),Xc(r);break;case 22:i=r.stateNode,i._visibility&2&&(i._visibility&=-3,Xc(r));break;default:Xc(r)}t=t.sibling}}function mb(t,r){for(;Gt!==null;){var i=Gt;switch(i.tag){case 0:case 11:case 15:Pa(8,i,r);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:qs(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,Gt=l;else e:for(i=t;Gt!==null;){l=Gt;var d=l.sibling,m=l.return;if(ib(l),l===i){Gt=null;break e}if(d!==null){d.return=m,Gt=d;break e}Gt=m}}}var W4={getCacheForType:function(t){var r=en(Dt),i=r.data.get(t);return i===void 0&&(i=t(),r.data.set(t,i)),i},cacheSignal:function(){return en(Dt).controller.signal}},U4=typeof WeakMap=="function"?WeakMap:Map,Ze=0,dt=null,qe=null,$e=0,rt=0,zn=null,Na=!1,Fo=!1,Np=!1,ea=0,Ct=0,Da=0,qi=0,Dp=0,qn=0,Vo=0,rl=null,Sn=null,jp=!1,Yc=0,gb=0,Zc=1/0,eu=null,ja=null,Ht=0,za=null,Ho=null,ta=0,zp=0,qp=null,yb=null,al=0,Bp=null;function Jn(){return Ze&2&&$e!==0?$e&-$e:ee.T===null?sc():Up()}function vb(){if(qn===0)if(!($e&536870912)||Ke){var t=Lt;Lt<<=1,!(Lt&3932160)&&(Lt=262144),qn=t}else qn=536870912;return t=Dn.current,t!==null&&(t.flags|=32),qn}function Cn(t,r,i){(t===dt&&(rt===2||rt===9)||t.cancelPendingCommit!==null)&&($o(t,0),qa(t,$e,qn,!1)),fi(t,i),(!(Ze&2)||t!==dt)&&(t===dt&&(!(Ze&2)&&(qi|=i),Ct===4&&qa(t,$e,qn,!1)),na(t))}function bb(t,r,i){if(Ze&6)throw Error(s(327));var l=!i&&(r&127)==0&&(r&t.expiredLanes)===0||ba(t,r),d=l?G4(t,r):Vp(t,r,!0),m=l;do{if(d===0){Fo&&!l&&qa(t,r,0,!1);break}else{if(i=t.current.alternate,m&&!K4(i)){d=Vp(t,r,!1),m=!1;continue}if(d===2){if(m=r,t.errorRecoveryDisabledLanes&m)var k=0;else k=t.pendingLanes&-536870913,k=k===0?k&536870912?536870912:0:k;if(k!==0){r=k;e:{var L=t;d=rl;var q=L.current.memoizedState.isDehydrated;if(q&&($o(L,k).flags|=256),k=Vp(L,k,!1),k!==2){if(Np&&!q){L.errorRecoveryDisabledLanes|=m,qi|=m,d=4;break e}m=Sn,Sn=d,m!==null&&(Sn===null?Sn=m:Sn.push.apply(Sn,m))}d=k}if(m=!1,d!==2)continue}}if(d===1){$o(t,0),qa(t,r,0,!0);break}e:{switch(l=t,m=d,m){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:qa(l,r,qn,!Na);break e;case 2:Sn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(d=Yc+300-Jt(),10<d)){if(qa(l,r,qn,!Na),ho(l,0,!0)!==0)break e;ta=r,l.timeoutHandle=Xb(wb.bind(null,l,i,Sn,eu,jp,r,qn,qi,Vo,Na,m,"Throttled",-0,0),d);break e}wb(l,i,Sn,eu,jp,r,qn,qi,Vo,Na,m,null,-0,0)}}break}while(!0);na(t)}function wb(t,r,i,l,d,m,k,L,q,J,oe,ue,Y,ae){if(t.timeoutHandle=-1,ue=r.subtreeFlags,ue&8192||(ue&16785408)==16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$n},fb(r,m,ue);var _e=(m&62914560)===m?Yc-Jt():(m&4194048)===m?gb-Jt():0;if(_e=O6(ue,_e),_e!==null){ta=m,t.cancelPendingCommit=_e(Lb.bind(null,t,r,m,i,l,d,k,L,q,oe,ue,null,Y,ae)),qa(t,m,k,!J);return}}Lb(t,r,m,i,l,d,k,L,q)}function K4(t){for(var r=t;;){var i=r.tag;if((i===0||i===11||i===15)&&r.flags&16384&&(i=r.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var d=i[l],m=d.getSnapshot;d=d.value;try{if(!Pn(m(),d))return!1}catch{return!1}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function qa(t,r,i,l){r&=~Dp,r&=~qi,t.suspendedLanes|=r,t.pingedLanes&=~r,l&&(t.warmLanes|=r),l=t.expirationTimes;for(var d=r;0<d;){var m=31-mt(d),k=1<<m;l[m]=-1,d&=~k}i!==0&&jr(t,i,r)}function tu(){return Ze&6?!0:(il(0,!1),!1)}function Fp(){if(qe!==null){if(rt===0)var t=qe.return;else t=qe,$r=Li=null,rp(t),Po=null,Fs=0,t=qe;for(;t!==null;)Xv(t.alternate,t),t=t.return;qe=null}}function $o(t,r){var i=t.timeoutHandle;i!==-1&&(t.timeoutHandle=-1,d6(i)),i=t.cancelPendingCommit,i!==null&&(t.cancelPendingCommit=null,i()),ta=0,Fp(),dt=t,qe=i=Vr(t.current,null),$e=r,rt=0,zn=null,Na=!1,Fo=ba(t,r),Np=!1,Vo=qn=Dp=qi=Da=Ct=0,Sn=rl=null,jp=!1,r&8&&(r|=r&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=r;0<l;){var d=31-mt(l),m=1<<d;r|=t[d],l&=~m}return ea=r,xc(),i}function _b(t,r){Pe=null,ee.H=Gs,r===Mo||r===Ac?(r=By(),rt=3):r===Wf?(r=By(),rt=4):rt=r===bp?8:typeof r=="object"&&r&&typeof r.then=="function"?6:1,zn=r,qe===null&&(Ct=1,$c(t,Un(r,t.current)))}function xb(){var t=Dn.current;return t===null?!0:($e&4194048)===$e?mr===null:($e&62914560)===$e||$e&536870912?t===mr:!1}function kb(){var t=ee.H;return ee.H=Gs,t===null?Gs:t}function Sb(){var t=ee.A;return ee.A=W4,t}function nu(){Ct=4,Na||($e&4194048)!==$e&&Dn.current!==null||(Fo=!0),!(Da&134217727)&&!(qi&134217727)||dt===null||qa(dt,$e,qn,!1)}function Vp(t,r,i){var l=Ze;Ze|=2;var d=kb(),m=Sb();(dt!==t||$e!==r)&&(eu=null,$o(t,r)),r=!1;var k=Ct;e:do try{if(rt!==0&&qe!==null){var L=qe,q=zn;switch(rt){case 8:Fp(),k=6;break e;case 3:case 2:case 9:case 6:Dn.current===null&&(r=!0);var J=rt;if(rt=0,zn=null,Wo(t,L,q,J),i&&Fo){k=0;break e}break;default:J=rt,rt=0,zn=null,Wo(t,L,q,J)}}Q4(),k=Ct;break}catch(oe){_b(t,oe)}while(!0);return r&&t.shellSuspendCounter++,$r=Li=null,Ze=l,ee.H=d,ee.A=m,qe===null&&(dt=null,$e=0,xc()),k}function Q4(){for(;qe!==null;)Cb(qe)}function G4(t,r){var i=Ze;Ze|=2;var l=kb(),d=Sb();dt!==t||$e!==r?(eu=null,Zc=Jt()+500,$o(t,r)):Fo=ba(t,r);e:do try{if(rt!==0&&qe!==null){r=qe;var m=zn;t:switch(rt){case 1:rt=0,zn=null,Wo(t,r,m,1);break;case 2:case 9:if(zy(m)){rt=0,zn=null,Eb(r);break}r=function(){rt!==2&&rt!==9||dt!==t||(rt=7),na(t)},m.then(r,r);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:zy(m)?(rt=0,zn=null,Eb(r)):(rt=0,zn=null,Wo(t,r,m,7));break;case 5:var k=null;switch(qe.tag){case 26:k=qe.memoizedState;case 5:case 27:var L=qe;if(k?f2(k):L.stateNode.complete){rt=0,zn=null;var q=L.sibling;if(q!==null)qe=q;else{var J=L.return;J===null?qe=null:(qe=J,ru(J))}break t}}rt=0,zn=null,Wo(t,r,m,5);break;case 6:rt=0,zn=null,Wo(t,r,m,6);break;case 8:Fp(),Ct=6;break e;default:throw Error(s(462))}}J4();break}catch(oe){_b(t,oe)}while(!0);return $r=Li=null,ee.H=l,ee.A=d,Ze=i,qe===null?(dt=null,$e=0,xc(),Ct):0}function J4(){for(;qe!==null&&!hf();)Cb(qe)}function Cb(t){var r=Gv(t.alternate,t,ea);t.memoizedProps=t.pendingProps,r===null?ru(t):qe=r}function Eb(t){var r=t,i=r.alternate;switch(r.tag){case 15:case 0:r=Hv(i,r,r.pendingProps,r.type,void 0,$e);break;case 11:r=Hv(i,r,r.pendingProps,r.type.render,r.ref,$e);break;case 5:rp(r);default:Xv(i,r),r=qe=Ty(r,ea),r=Gv(i,r,ea)}t.memoizedProps=t.pendingProps,r===null?ru(t):qe=r}function Wo(t,r,i,l){$r=Li=null,rp(r),Po=null,Fs=0;var d=r.return;try{if(z4(t,d,r,i,$e)){Ct=1,$c(t,Un(i,t.current)),qe=null;return}}catch(m){if(d!==null)throw qe=d,m;Ct=1,$c(t,Un(i,t.current)),qe=null;return}r.flags&32768?(Ke||l===1?t=!0:Fo||$e&536870912?t=!1:(Na=t=!0,(l===2||l===9||l===3||l===6)&&(l=Dn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Tb(r,t)):ru(r)}function ru(t){var r=t;do{if(r.flags&32768){Tb(r,Na);return}t=r.return;var i=F4(r.alternate,r,ea);if(i!==null){qe=i;return}if(r=r.sibling,r!==null){qe=r;return}qe=r=t}while(r!==null);Ct===0&&(Ct=5)}function Tb(t,r){do{var i=V4(t.alternate,t);if(i!==null){i.flags&=32767,qe=i;return}if(i=t.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!r&&(t=t.sibling,t!==null)){qe=t;return}qe=t=i}while(t!==null);Ct=6,qe=null}function Lb(t,r,i,l,d,m,k,L,q){t.cancelPendingCommit=null;do au();while(Ht!==0);if(Ze&6)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(m=r.lanes|r.childLanes,m|=Af,vf(t,i,m,k,L,q),t===dt&&(qe=dt=null,$e=0),Ho=r,za=t,ta=i,zp=m,qp=d,yb=l,r.subtreeFlags&10256||r.flags&10256?(t.callbackNode=null,t.callbackPriority=0,e6(Pt,function(){return Mb(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(r.flags&13878)!=0,r.subtreeFlags&13878||l){l=ee.T,ee.T=null,d=U.p,U.p=2,k=Ze,Ze|=4;try{H4(t,r,i)}finally{Ze=k,U.p=d,ee.T=l}}Ht=1,Ob(),Ab(),Ib()}}function Ob(){if(Ht===1){Ht=0;var t=za,r=Ho,i=(r.flags&13878)!=0;if(r.subtreeFlags&13878||i){i=ee.T,ee.T=null;var l=U.p;U.p=2;var d=Ze;Ze|=4;try{cb(r,t);var m=Zp,k=vy(t.containerInfo),L=m.focusedElem,q=m.selectionRange;if(k!==L&&L&&L.ownerDocument&&yy(L.ownerDocument.documentElement,L)){if(q!==null&&Cf(L)){var J=q.start,oe=q.end;if(oe===void 0&&(oe=J),"selectionStart"in L)L.selectionStart=J,L.selectionEnd=Math.min(oe,L.value.length);else{var ue=L.ownerDocument||document,Y=ue&&ue.defaultView||window;if(Y.getSelection){var ae=Y.getSelection(),_e=L.textContent.length,Te=Math.min(q.start,_e),st=q.end===void 0?Te:Math.min(q.end,_e);!ae.extend&&Te>st&&(k=st,st=Te,Te=k);var W=gy(L,Te),B=gy(L,st);if(W&&B&&(ae.rangeCount!==1||ae.anchorNode!==W.node||ae.anchorOffset!==W.offset||ae.focusNode!==B.node||ae.focusOffset!==B.offset)){var G=ue.createRange();G.setStart(W.node,W.offset),ae.removeAllRanges(),Te>st?(ae.addRange(G),ae.extend(B.node,B.offset)):(G.setEnd(B.node,B.offset),ae.addRange(G))}}}}for(ue=[],ae=L;ae=ae.parentNode;)ae.nodeType===1&&ue.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<ue.length;L++){var le=ue[L];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}gu=!!Yp,Zp=Yp=null}finally{Ze=d,U.p=l,ee.T=i}}t.current=r,Ht=2}}function Ab(){if(Ht===2){Ht=0;var t=za,r=Ho,i=(r.flags&8772)!=0;if(r.subtreeFlags&8772||i){i=ee.T,ee.T=null;var l=U.p;U.p=2;var d=Ze;Ze|=4;try{ab(t,r.alternate,r)}finally{Ze=d,U.p=l,ee.T=i}}Ht=3}}function Ib(){if(Ht===4||Ht===3){Ht=0,nc();var t=za,r=Ho,i=ta,l=yb;r.subtreeFlags&10256||r.flags&10256?Ht=5:(Ht=0,Ho=za=null,Rb(t,t.pendingLanes));var d=t.pendingLanes;if(d===0&&(ja=null),xs(i),r=r.stateNode,on&&typeof on.onCommitFiberRoot=="function")try{on.onCommitFiberRoot(ui,r,void 0,(r.current.flags&128)==128)}catch{}if(l!==null){r=ee.T,d=U.p,U.p=2,ee.T=null;try{for(var m=t.onRecoverableError,k=0;k<l.length;k++){var L=l[k];m(L.value,{componentStack:L.stack})}}finally{ee.T=r,U.p=d}}ta&3&&au(),na(t),d=t.pendingLanes,i&261930&&d&42?t===Bp?al++:(al=0,Bp=t):al=0,il(0,!1)}}function Rb(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,qs(r)))}function au(){return Ob(),Ab(),Ib(),Mb()}function Mb(){if(Ht!==5)return!1;var t=za,r=zp;zp=0;var i=xs(ta),l=ee.T,d=U.p;try{U.p=32>i?32:i,ee.T=null,i=qp,qp=null;var m=za,k=ta;if(Ht=0,Ho=za=null,ta=0,Ze&6)throw Error(s(331));var L=Ze;if(Ze|=4,hb(m.current),db(m,m.current,k,i),Ze=L,il(0,!1),on&&typeof on.onPostCommitFiberRoot=="function")try{on.onPostCommitFiberRoot(ui,m)}catch{}return!0}finally{U.p=d,ee.T=l,Rb(t,r)}}function Pb(t,r,i){r=Un(i,r),r=vp(t.stateNode,r,2),t=Ni(t,r,2),t!==null&&(fi(t,2),na(t))}function at(t,r,i){if(t.tag===3)Pb(t,t,i);else for(;r!==null;){if(r.tag===3){Pb(r,t,i);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ja===null||!ja.has(l))){t=Un(i,t),i=Nv(2),l=Ni(r,i,2),l!==null&&(Dv(i,l,r,t),fi(l,2),na(l));break}}r=r.return}}function Hp(t,r,i){var l=t.pingCache;if(l===null){l=t.pingCache=new U4;var d=new Set;l.set(r,d)}else d=l.get(r),d===void 0&&(d=new Set,l.set(r,d));d.has(i)||(Np=!0,d.add(i),t=X4.bind(null,t,r,i),r.then(t,t))}function X4(t,r,i){var l=t.pingCache;l!==null&&l.delete(r),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,dt===t&&($e&i)===i&&(Ct===4||Ct===3&&($e&62914560)===$e&&300>Jt()-Yc?!(Ze&2)&&$o(t,0):Dp|=i,Vo===$e&&(Vo=0)),na(t)}function Nb(t,r){r===0&&(r=ic()),t=Ci(t,r),t!==null&&(fi(t,r),na(t))}function Y4(t){var r=t.memoizedState,i=0;r!==null&&(i=r.retryLane),Nb(t,i)}function Z4(t,r){var i=0;switch(t.tag){case 31:case 13:var l=t.stateNode,d=t.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(r),Nb(t,i)}function e6(t,r){return ur(t,r)}var iu=null,Uo=null,$p=!1,ou=!1,Wp=!1,Ba=0;function na(t){t!==Uo&&t.next===null&&(Uo===null?iu=Uo=t:Uo=Uo.next=t),ou=!0,$p||($p=!0,n6())}function il(t,r){if(!Wp&&ou){Wp=!0;do for(var i=!1,l=iu;l!==null;){if(!r)if(t!==0){var d=l.pendingLanes;if(d===0)var m=0;else{var k=l.suspendedLanes,L=l.pingedLanes;m=(1<<31-mt(42|t)+1)-1,m&=d&~(k&~L),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(i=!0,qb(l,m))}else m=$e,m=ho(l,l===dt?m:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),!(m&3)||ba(l,m)||(i=!0,qb(l,m));l=l.next}while(i);Wp=!1}}function t6(){Db()}function Db(){ou=$p=!1;var t=0;Ba!==0&&u6()&&(t=Ba);for(var r=Jt(),i=null,l=iu;l!==null;){var d=l.next,m=jb(l,r);m===0?(l.next=null,i===null?iu=d:i.next=d,d===null&&(Uo=i)):(i=l,(t!==0||m&3)&&(ou=!0)),l=d}Ht!==0&&Ht!==5||il(t,!1),Ba!==0&&(Ba=0)}function jb(t,r){for(var i=t.suspendedLanes,l=t.pingedLanes,d=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var k=31-mt(m),L=1<<k,q=d[k];q===-1?((L&i)===0||(L&l)!==0)&&(d[k]=ac(L,r)):q<=r&&(t.expiredLanes|=L),m&=~L}if(r=dt,i=$e,i=ho(t,t===r?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,i===0||t===r&&(rt===2||rt===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&bn(l),t.callbackNode=null,t.callbackPriority=0;if(!(i&3)||ba(t,i)){if(r=i&-i,r===t.callbackPriority)return r;switch(l!==null&&bn(l),xs(i)){case 2:case 8:i=rc;break;case 32:i=Pt;break;case 268435456:i=kt;break;default:i=Pt}return l=zb.bind(null,t),i=ur(i,l),t.callbackPriority=r,t.callbackNode=i,r}return l!==null&&l!==null&&bn(l),t.callbackPriority=2,t.callbackNode=null,2}function zb(t,r){if(Ht!==0&&Ht!==5)return t.callbackNode=null,t.callbackPriority=0,null;var i=t.callbackNode;if(au()&&t.callbackNode!==i)return null;var l=$e;return l=ho(t,t===dt?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(bb(t,l,r),jb(t,Jt()),t.callbackNode!=null&&t.callbackNode===i?zb.bind(null,t):null)}function qb(t,r){if(au())return null;bb(t,r,!0)}function n6(){f6(function(){Ze&6?ur(Nr,t6):Db()})}function Up(){if(Ba===0){var t=Io;t===0&&(t=di,di<<=1,!(di&261888)&&(di=256)),Ba=t}return Ba}function Bb(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:bo(""+t)}function Fb(t,r){var i=r.ownerDocument.createElement("input");return i.name=r.name,i.value=r.value,t.id&&i.setAttribute("form",t.id),r.parentNode.insertBefore(i,r),t=new FormData(t),i.parentNode.removeChild(i),t}function r6(t,r,i,l,d){if(r==="submit"&&i&&i.stateNode===d){var m=Bb((d[Yt]||null).action),k=l.submitter;k&&(r=(r=k[Yt]||null)?Bb(r.formAction):k.getAttribute("formAction"),r!==null&&(m=r,k=null));var L=new u("action","action",null,l,d);t.push({event:L,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ba!==0){var q=k?Fb(d,k):new FormData(d);fp(i,{pending:!0,data:q,method:d.method,action:m},null,q)}}else typeof m=="function"&&(L.preventDefault(),q=k?Fb(d,k):new FormData(d),fp(i,{pending:!0,data:q,method:d.method,action:m},m,q))},currentTarget:d}]})}}for(var Kp=0;Kp<Of.length;Kp++){var Qp=Of[Kp];hr(Qp.toLowerCase(),"on"+(Qp[0].toUpperCase()+Qp.slice(1)))}hr(_y,"onAnimationEnd"),hr(xy,"onAnimationIteration"),hr(ky,"onAnimationStart"),hr("dblclick","onDoubleClick"),hr("focusin","onFocus"),hr("focusout","onBlur"),hr(v4,"onTransitionRun"),hr(b4,"onTransitionStart"),hr(w4,"onTransitionCancel"),hr(Sy,"onTransitionEnd"),ka("onMouseEnter",["mouseout","mouseover"]),ka("onMouseLeave",["mouseout","mouseover"]),ka("onPointerEnter",["pointerout","pointerover"]),ka("onPointerLeave",["pointerout","pointerover"]),Cr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Cr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Cr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Cr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Cr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Cr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ol="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),a6=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ol));function Vb(t,r){r=(r&4)!=0;for(var i=0;i<t.length;i++){var l=t[i],d=l.event;l=l.listeners;e:{var m=void 0;if(r)for(var k=l.length-1;0<=k;k--){var L=l[k],q=L.instance,J=L.currentTarget;if(L=L.listener,q!==m&&d.isPropagationStopped())break e;m=L,d.currentTarget=J;try{m(d)}catch(oe){_c(oe)}d.currentTarget=null,m=q}else for(k=0;k<l.length;k++){if(L=l[k],q=L.instance,J=L.currentTarget,L=L.listener,q!==m&&d.isPropagationStopped())break e;m=L,d.currentTarget=J;try{m(d)}catch(oe){_c(oe)}d.currentTarget=null,m=q}}}}function Be(t,r){var i=r[ks];i===void 0&&(i=r[ks]=new Set);var l=t+"__bubble";i.has(l)||($b(r,t,2,!1),i.add(l))}function Gp(t,r,i){var l=0;r&&(l|=4),$b(i,t,l,r)}var su="_reactListening"+Math.random().toString(36).slice(2);function Hb(t){if(!t[su]){t[su]=!0,Cs.forEach(function(i){i!=="selectionchange"&&(a6.has(i)||Gp(i,!1,t),Gp(i,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[su]||(r[su]=!0,Gp("selectionchange",!1,r))}}function $b(t,r,i,l){switch(y2(r)){case 2:var d=P6;break;case 8:d=N6;break;default:d=uh}i=d.bind(null,r,i,t),d=void 0,!As||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(d=!0),l?d===void 0?t.addEventListener(r,i,!0):t.addEventListener(r,i,{capture:!0,passive:d}):d===void 0?t.addEventListener(r,i,!1):t.addEventListener(r,i,{passive:d})}function Jp(t,r,i,l,d){var m=l;if(!(r&1)&&!(r&2)&&l!==null)e:for(;;){if(l===null)return;var k=l.tag;if(k===3||k===4){var L=l.stateNode.containerInfo;if(L===d)break;if(k===4)for(k=l.return;k!==null;){var q=k.tag;if((q===3||q===4)&&k.stateNode.containerInfo===d)return;k=k.return}for(;L!==null;){if(k=Sr(L),k===null)return;if(q=k.tag,q===5||q===6||q===26||q===27){l=m=k;continue e}L=L.parentNode}}l=l.return}yc(function(){var J=m,oe=Ls(i),ue=[];e:{var Y=Cy.get(t);if(Y!==void 0){var ae=u,_e=t;switch(t){case"keypress":if(wi(i)===0)break e;case"keydown":case"keyup":ae=we;break;case"focusin":_e="focus",ae=D;break;case"focusout":_e="blur",ae=D;break;case"beforeblur":case"afterblur":ae=D;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=A;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=I;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=Je;break;case _y:case xy:case ky:ae=P;break;case Sy:ae=De;break;case"scroll":case"scrollend":ae=y;break;case"wheel":ae=ut;break;case"copy":case"cut":case"paste":ae=Z;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=Ee;break;case"toggle":case"beforetoggle":ae=yt}var Te=(r&4)!=0,st=!Te&&(t==="scroll"||t==="scrollend"),W=Te?Y===null?null:Y+"Capture":Y;Te=[];for(var B=J,G;B!==null;){var le=B;if(G=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||G===null||W===null||(le=yi(B,W),le!=null&&Te.push(sl(B,le,G))),st)break;B=B.return}0<Te.length&&(Y=new ae(Y,_e,null,i,oe),ue.push({event:Y,listeners:Te}))}}if(!(r&7)){e:{if(Y=t==="mouseover"||t==="pointerover",ae=t==="mouseout"||t==="pointerout",Y&&i!==Kt&&(_e=i.relatedTarget||i.fromElement)&&(Sr(_e)||_e[wa]))break e;if((ae||Y)&&(Y=oe.window===oe?oe:(Y=oe.ownerDocument)?Y.defaultView||Y.parentWindow:window,ae?(_e=i.relatedTarget||i.toElement,ae=J,_e=_e?Sr(_e):null,_e!==null&&(st=h(_e),Te=_e.tag,_e!==st||Te!==5&&Te!==27&&Te!==6)&&(_e=null)):(ae=null,_e=J),ae!==_e)){if(Te=A,le="onMouseLeave",W="onMouseEnter",B="mouse",(t==="pointerout"||t==="pointerover")&&(Te=Ee,le="onPointerLeave",W="onPointerEnter",B="pointer"),st=ae==null?Y:dn(ae),G=_e==null?Y:dn(_e),Y=new Te(le,B+"leave",ae,i,oe),Y.target=st,Y.relatedTarget=G,le=null,Sr(oe)===J&&(Te=new Te(W,B+"enter",_e,i,oe),Te.target=G,Te.relatedTarget=st,le=Te),st=le,ae&&_e)t:{for(Te=i6,W=ae,B=_e,G=0,le=W;le;le=Te(le))G++;le=0;for(var Se=B;Se;Se=Te(Se))le++;for(;0<G-le;)W=Te(W),G--;for(;0<le-G;)B=Te(B),le--;for(;G--;){if(W===B||B!==null&&W===B.alternate){Te=W;break t}W=Te(W),B=Te(B)}Te=null}else Te=null;ae!==null&&Wb(ue,Y,ae,Te,!1),_e!==null&&st!==null&&Wb(ue,st,_e,Te,!0)}}e:{if(Y=J?dn(J):window,ae=Y.nodeName&&Y.nodeName.toLowerCase(),ae==="select"||ae==="input"&&Y.type==="file")var et=uy;else if(ly(Y))if(dy)et=m4;else{et=p4;var ke=f4}else ae=Y.nodeName,!ae||ae.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?J&&gi(J.elementType)&&(et=uy):et=h4;if(et&&(et=et(t,J))){cy(ue,et,i,oe);break e}ke&&ke(t,Y,J),t==="focusout"&&J&&Y.type==="number"&&J.memoizedProps.value!=null&&zr(Y,"number",Y.value)}switch(ke=J?dn(J):window,t){case"focusin":(ly(ke)||ke.contentEditable==="true")&&(ko=ke,Ef=J,Ds=null);break;case"focusout":Ds=Ef=ko=null;break;case"mousedown":Tf=!0;break;case"contextmenu":case"mouseup":case"dragend":Tf=!1,by(ue,i,oe);break;case"selectionchange":if(y4)break;case"keydown":case"keyup":by(ue,i,oe)}var Ne;if(Ie)e:{switch(t){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else xo?bc(t,i)&&(We="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(We="onCompositionStart");We&&(Vt&&i.locale!=="ko"&&(xo||We!=="onCompositionStart"?We==="onCompositionEnd"&&xo&&(Ne=Is()):(pr=oe,wo="value"in pr?pr.value:pr.textContent,xo=!0)),ke=lu(J,We),0<ke.length&&(We=new X(We,t,null,i,oe),ue.push({event:We,listeners:ke}),Ne?We.data=Ne:(Ne=_o(i),Ne!==null&&(We.data=Ne)))),(Ne=Nt?l4(t,i):c4(t,i))&&(We=lu(J,"onBeforeInput"),0<We.length&&(ke=new X("onBeforeInput","beforeinput",null,i,oe),ue.push({event:ke,listeners:We}),ke.data=Ne)),r6(ue,t,J,i,oe)}Vb(ue,r)})}function sl(t,r,i){return{instance:t,listener:r,currentTarget:i}}function lu(t,r){for(var i=r+"Capture",l=[];t!==null;){var d=t,m=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||m===null||(d=yi(t,i),d!=null&&l.unshift(sl(t,d,m)),d=yi(t,r),d!=null&&l.push(sl(t,d,m))),t.tag===3)return l;t=t.return}return[]}function i6(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Wb(t,r,i,l,d){for(var m=r._reactName,k=[];i!==null&&i!==l;){var L=i,q=L.alternate,J=L.stateNode;if(L=L.tag,q!==null&&q===l)break;L!==5&&L!==26&&L!==27||J===null||(q=J,d?(J=yi(i,m),J!=null&&k.unshift(sl(i,J,q))):d||(J=yi(i,m),J!=null&&k.push(sl(i,J,q)))),i=i.return}k.length!==0&&t.push({event:r,listeners:k})}var o6=/\r\n?/g,s6=/\u0000|\uFFFD/g;function Ub(t){return(typeof t=="string"?t:""+t).replace(o6,`
10
- `).replace(s6,"")}function Kb(t,r){return r=Ub(r),Ub(t)===r}function ot(t,r,i,l,d,m){switch(i){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||qr(t,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&qr(t,""+l);break;case"className":mi(t,"class",l);break;case"tabIndex":mi(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":mi(t,i,l);break;case"style":hc(t,l,m);break;case"data":if(r!=="object"){mi(t,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||i!=="href")){t.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(i);break}l=bo(""+l),t.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(i==="formAction"?(r!=="input"&&ot(t,r,"name",d.name,d,null),ot(t,r,"formEncType",d.formEncType,d,null),ot(t,r,"formMethod",d.formMethod,d,null),ot(t,r,"formTarget",d.formTarget,d,null)):(ot(t,r,"encType",d.encType,d,null),ot(t,r,"method",d.method,d,null),ot(t,r,"target",d.target,d,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(i);break}l=bo(""+l),t.setAttribute(i,l);break;case"onClick":l!=null&&(t.onclick=$n);break;case"onScroll":l!=null&&Be("scroll",t);break;case"onScrollEnd":l!=null&&Be("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(d.children!=null)throw Error(s(60));t.innerHTML=i}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}i=bo(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(i,""+l):t.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(i,""):t.removeAttribute(i);break;case"capture":case"download":l===!0?t.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(i,l):t.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(i,l):t.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(i):t.setAttribute(i,l);break;case"popover":Be("beforetoggle",t),Be("toggle",t),hi(t,"popover",l);break;case"xlinkActuate":dr(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":dr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":dr(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":dr(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":dr(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":dr(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":dr(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":dr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":dr(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":hi(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=vo.get(i)||i,hi(t,i,l))}}function Xp(t,r,i,l,d,m){switch(i){case"style":hc(t,l,m);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(d.children!=null)throw Error(s(60));t.innerHTML=i}}break;case"children":typeof l=="string"?qr(t,l):(typeof l=="number"||typeof l=="bigint")&&qr(t,""+l);break;case"onScroll":l!=null&&Be("scroll",t);break;case"onScrollEnd":l!=null&&Be("scrollend",t);break;case"onClick":l!=null&&(t.onclick=$n);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!cc.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(d=i.endsWith("Capture"),r=i.slice(2,d?i.length-7:void 0),m=t[Yt]||null,m=m==null?null:m[i],typeof m=="function"&&t.removeEventListener(r,m,d),typeof l=="function")){typeof m!="function"&&m!==null&&(i in t?t[i]=null:t.hasAttribute(i)&&t.removeAttribute(i)),t.addEventListener(r,l,d);break e}i in t?t[i]=l:l===!0?t.setAttribute(i,""):hi(t,i,l)}}}function nn(t,r,i){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",t),Be("load",t);var l=!1,d=!1,m;for(m in i)if(i.hasOwnProperty(m)){var k=i[m];if(k!=null)switch(m){case"src":l=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:ot(t,r,m,k,i,null)}}d&&ot(t,r,"srcSet",i.srcSet,i,null),l&&ot(t,r,"src",i.src,i,null);return;case"input":Be("invalid",t);var L=m=k=d=null,q=null,J=null;for(l in i)if(i.hasOwnProperty(l)){var oe=i[l];if(oe!=null)switch(l){case"name":d=oe;break;case"type":k=oe;break;case"checked":q=oe;break;case"defaultChecked":J=oe;break;case"value":m=oe;break;case"defaultValue":L=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(s(137,r));break;default:ot(t,r,l,oe,i,null)}}pc(t,m,L,q,J,k,d,!1);return;case"select":for(d in Be("invalid",t),l=k=m=null,i)if(i.hasOwnProperty(d)&&(L=i[d],L!=null))switch(d){case"value":m=L;break;case"defaultValue":k=L;break;case"multiple":l=L;default:ot(t,r,d,L,i,null)}r=m,i=k,t.multiple=!!l,r==null?i!=null&&Ca(t,!!l,i,!0):Ca(t,!!l,r,!1);return;case"textarea":for(k in Be("invalid",t),m=d=l=null,i)if(i.hasOwnProperty(k)&&(L=i[k],L!=null))switch(k){case"value":l=L;break;case"defaultValue":d=L;break;case"children":m=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(s(91));break;default:ot(t,r,k,L,i,null)}yo(t,l,d,m);return;case"option":for(q in i)i.hasOwnProperty(q)&&(l=i[q],l!=null)&&(q==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":ot(t,r,q,l,i,null));return;case"dialog":Be("beforetoggle",t),Be("toggle",t),Be("cancel",t),Be("close",t);break;case"iframe":case"object":Be("load",t);break;case"video":case"audio":for(l=0;l<ol.length;l++)Be(ol[l],t);break;case"image":Be("error",t),Be("load",t);break;case"details":Be("toggle",t);break;case"embed":case"source":case"link":Be("error",t),Be("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in i)if(i.hasOwnProperty(J)&&(l=i[J],l!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:ot(t,r,J,l,i,null)}return;default:if(gi(r)){for(oe in i)i.hasOwnProperty(oe)&&(l=i[oe],l!==void 0&&Xp(t,r,oe,l,i,void 0));return}}for(L in i)i.hasOwnProperty(L)&&(l=i[L],l!=null&&ot(t,r,L,l,i,null))}function l6(t,r,i,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,m=null,k=null,L=null,q=null,J=null,oe=null;for(ae in i){var ue=i[ae];if(i.hasOwnProperty(ae)&&ue!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":q=ue;default:l.hasOwnProperty(ae)||ot(t,r,ae,null,l,ue)}}for(var Y in l){var ae=l[Y];if(ue=i[Y],l.hasOwnProperty(Y)&&(ae!=null||ue!=null))switch(Y){case"type":m=ae;break;case"name":d=ae;break;case"checked":J=ae;break;case"defaultChecked":oe=ae;break;case"value":k=ae;break;case"defaultValue":L=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(s(137,r));break;default:ae!==ue&&ot(t,r,Y,ae,l,ue)}}Sa(t,k,L,q,J,oe,m,d);return;case"select":for(m in ae=k=L=Y=null,i)if(q=i[m],i.hasOwnProperty(m)&&q!=null)switch(m){case"value":break;case"multiple":ae=q;default:l.hasOwnProperty(m)||ot(t,r,m,null,l,q)}for(d in l)if(m=l[d],q=i[d],l.hasOwnProperty(d)&&(m!=null||q!=null))switch(d){case"value":Y=m;break;case"defaultValue":L=m;break;case"multiple":k=m;default:m!==q&&ot(t,r,d,m,l,q)}r=L,i=k,l=ae,Y==null?!!l!=!!i&&(r==null?Ca(t,!!i,i?[]:"",!1):Ca(t,!!i,r,!0)):Ca(t,!!i,Y,!1);return;case"textarea":for(L in ae=Y=null,i)if(d=i[L],i.hasOwnProperty(L)&&d!=null&&!l.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:ot(t,r,L,null,l,d)}for(k in l)if(d=l[k],m=i[k],l.hasOwnProperty(k)&&(d!=null||m!=null))switch(k){case"value":Y=d;break;case"defaultValue":ae=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(s(91));break;default:d!==m&&ot(t,r,k,d,l,m)}Ea(t,Y,ae);return;case"option":for(var _e in i)Y=i[_e],i.hasOwnProperty(_e)&&Y!=null&&!l.hasOwnProperty(_e)&&(_e==="selected"?t.selected=!1:ot(t,r,_e,null,l,Y));for(q in l)Y=l[q],ae=i[q],l.hasOwnProperty(q)&&Y!==ae&&(Y!=null||ae!=null)&&(q==="selected"?t.selected=Y&&typeof Y!="function"&&typeof Y!="symbol":ot(t,r,q,Y,l,ae));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Te in i)Y=i[Te],i.hasOwnProperty(Te)&&Y!=null&&!l.hasOwnProperty(Te)&&ot(t,r,Te,null,l,Y);for(J in l)if(Y=l[J],ae=i[J],l.hasOwnProperty(J)&&Y!==ae&&(Y!=null||ae!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(s(137,r));break;default:ot(t,r,J,Y,l,ae)}return;default:if(gi(r)){for(var st in i)Y=i[st],i.hasOwnProperty(st)&&Y!==void 0&&!l.hasOwnProperty(st)&&Xp(t,r,st,void 0,l,Y);for(oe in l)Y=l[oe],ae=i[oe],!l.hasOwnProperty(oe)||Y===ae||Y===void 0&&ae===void 0||Xp(t,r,oe,Y,l,ae);return}}for(var W in i)Y=i[W],i.hasOwnProperty(W)&&Y!=null&&!l.hasOwnProperty(W)&&ot(t,r,W,null,l,Y);for(ue in l)Y=l[ue],ae=i[ue],!l.hasOwnProperty(ue)||Y===ae||Y==null&&ae==null||ot(t,r,ue,Y,l,ae)}function Qb(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function c6(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var d=i[l],m=d.transferSize,k=d.initiatorType,L=d.duration;if(m&&L&&Qb(k)){for(k=0,L=d.responseEnd,l+=1;l<i.length;l++){var q=i[l],J=q.startTime;if(J>L)break;var oe=q.transferSize,ue=q.initiatorType;oe&&Qb(ue)&&(q=q.responseEnd,k+=oe*(q<L?1:(L-J)/(q-J)))}if(--l,r+=8*(m+k)/(d.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Yp=null,Zp=null;function cu(t){return t.nodeType===9?t:t.ownerDocument}function Gb(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Jb(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function eh(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var th=null;function u6(){var t=window.event;return t&&t.type==="popstate"?t===th?!1:(th=t,!0):(th=null,!1)}var Xb=typeof setTimeout=="function"?setTimeout:void 0,d6=typeof clearTimeout=="function"?clearTimeout:void 0,Yb=typeof Promise=="function"?Promise:void 0,f6=typeof queueMicrotask=="function"?queueMicrotask:Yb===void 0?Xb:function(t){return Yb.resolve(null).then(t).catch(p6)};function p6(t){setTimeout(function(){throw t})}function Fa(t){return t==="head"}function Zb(t,r){var i=r,l=0;do{var d=i.nextSibling;if(t.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"||i==="/&"){if(l===0){t.removeChild(d),Jo(r);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")ll(t.ownerDocument.documentElement);else if(i==="head"){i=t.ownerDocument.head,ll(i);for(var m=i.firstChild;m;){var k=m.nextSibling,L=m.nodeName;m[pi]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&m.rel.toLowerCase()==="stylesheet"||i.removeChild(m),m=k}}else i==="body"&&ll(t.ownerDocument.body);i=d}while(i);Jo(r)}function e2(t,r){var i=t;t=0;do{var l=i.nextSibling;if(i.nodeType===1?r?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(r?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(t===0)break;t--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||t++;i=l}while(i)}function nh(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var i=r;switch(r=r.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":nh(i),go(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}t.removeChild(i)}}function h6(t,r,i,l){for(;t.nodeType===1;){var d=i;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[pi])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(m=t.getAttribute("rel"),m==="stylesheet"&&t.hasAttribute("data-precedence")||m!==d.rel||t.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||t.getAttribute("title")!==(d.title==null?null:d.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(m=t.getAttribute("src"),(m!==(d.src==null?null:d.src)||t.getAttribute("type")!==(d.type==null?null:d.type)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&m&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var m=d.name==null?null:""+d.name;if(d.type==="hidden"&&t.getAttribute("name")===m)return t}else return t;if(t=Xn(t.nextSibling),t===null)break}return null}function m6(t,r,i){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Xn(t.nextSibling),t===null))return null;return t}function t2(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Xn(t.nextSibling),t===null))return null;return t}function rh(t){return t.data==="$?"||t.data==="$~"}function ah(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function g6(t,r){var i=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||i.readyState!=="loading")r();else{var l=function(){r(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function Xn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var ih=null;function n2(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"||i==="/&"){if(r===0)return Xn(t.nextSibling);r--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||r++}t=t.nextSibling}return null}function r2(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(r===0)return t;r--}else i!=="/$"&&i!=="/&"||r++}t=t.previousSibling}return null}function a2(t,r,i){switch(r=cu(i),t){case"html":if(t=r.documentElement,!t)throw Error(s(452));return t;case"head":if(t=r.head,!t)throw Error(s(453));return t;case"body":if(t=r.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function ll(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);go(t)}var Yn=new Map,i2=new Set;function uu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var ra=U.d;U.d={f:y6,r:v6,D:b6,C:w6,L:_6,m:x6,X:S6,S:k6,M:C6};function y6(){var t=ra.f(),r=tu();return t||r}function v6(t){var r=_a(t);r!==null&&r.tag===5&&r.type==="form"?Sv(r):ra.r(t)}var Ko=typeof document>"u"?null:document;function o2(t,r,i){var l=Ko;if(l&&typeof r=="string"&&r){var d=Mn(r);d='link[rel="'+t+'"][href="'+d+'"]',typeof i=="string"&&(d+='[crossorigin="'+i+'"]'),i2.has(d)||(i2.add(d),t={rel:t,crossOrigin:i,href:r},l.querySelector(d)===null&&(r=l.createElement("link"),nn(r,"link",t),Ot(r),l.head.appendChild(r)))}}function b6(t){ra.D(t),o2("dns-prefetch",t,null)}function w6(t,r){ra.C(t,r),o2("preconnect",t,r)}function _6(t,r,i){ra.L(t,r,i);var l=Ko;if(l&&t&&r){var d='link[rel="preload"][as="'+Mn(r)+'"]';r==="image"&&i&&i.imageSrcSet?(d+='[imagesrcset="'+Mn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(d+='[imagesizes="'+Mn(i.imageSizes)+'"]')):d+='[href="'+Mn(t)+'"]';var m=d;switch(r){case"style":m=Qo(t);break;case"script":m=Go(t)}Yn.has(m)||(t=C({rel:"preload",href:r==="image"&&i&&i.imageSrcSet?void 0:t,as:r},i),Yn.set(m,t),l.querySelector(d)!==null||r==="style"&&l.querySelector(cl(m))||r==="script"&&l.querySelector(ul(m))||(r=l.createElement("link"),nn(r,"link",t),Ot(r),l.head.appendChild(r)))}}function x6(t,r){ra.m(t,r);var i=Ko;if(i&&t){var l=r&&typeof r.as=="string"?r.as:"script",d='link[rel="modulepreload"][as="'+Mn(l)+'"][href="'+Mn(t)+'"]',m=d;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Go(t)}if(!Yn.has(m)&&(t=C({rel:"modulepreload",href:t},r),Yn.set(m,t),i.querySelector(d)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(ul(m)))return}l=i.createElement("link"),nn(l,"link",t),Ot(l),i.head.appendChild(l)}}}function k6(t,r,i){ra.S(t,r,i);var l=Ko;if(l&&t){var d=xa(l).hoistableStyles,m=Qo(t);r||(r="default");var k=d.get(m);if(!k){var L={loading:0,preload:null};if(k=l.querySelector(cl(m)))L.loading=5;else{t=C({rel:"stylesheet",href:t,"data-precedence":r},i),(i=Yn.get(m))&&oh(t,i);var q=k=l.createElement("link");Ot(q),nn(q,"link",t),q._p=new Promise(function(J,oe){q.onload=J,q.onerror=oe}),q.addEventListener("load",function(){L.loading|=1}),q.addEventListener("error",function(){L.loading|=2}),L.loading|=4,du(k,r,l)}k={type:"stylesheet",instance:k,count:1,state:L},d.set(m,k)}}}function S6(t,r){ra.X(t,r);var i=Ko;if(i&&t){var l=xa(i).hoistableScripts,d=Go(t),m=l.get(d);m||(m=i.querySelector(ul(d)),m||(t=C({src:t,async:!0},r),(r=Yn.get(d))&&sh(t,r),m=i.createElement("script"),Ot(m),nn(m,"link",t),i.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(d,m))}}function C6(t,r){ra.M(t,r);var i=Ko;if(i&&t){var l=xa(i).hoistableScripts,d=Go(t),m=l.get(d);m||(m=i.querySelector(ul(d)),m||(t=C({src:t,async:!0,type:"module"},r),(r=Yn.get(d))&&sh(t,r),m=i.createElement("script"),Ot(m),nn(m,"link",t),i.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(d,m))}}function s2(t,r,i,l){var d=(d=Mt.current)?uu(d):null;if(!d)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(r=Qo(i.href),i=xa(d).hoistableStyles,l=i.get(r),l||(l={type:"style",instance:null,count:0,state:null},i.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=Qo(i.href);var m=xa(d).hoistableStyles,k=m.get(t);if(k||(d=d.ownerDocument||d,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,k),(m=d.querySelector(cl(t)))&&!m._p&&(k.instance=m,k.state.loading=5),Yn.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Yn.set(t,i),m||E6(d,t,i,k.state))),r&&l===null)throw Error(s(528,""));return k}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=i.async,i=i.src,typeof i=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Go(i),i=xa(d).hoistableScripts,l=i.get(r),l||(l={type:"script",instance:null,count:0,state:null},i.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Qo(t){return'href="'+Mn(t)+'"'}function cl(t){return'link[rel="stylesheet"]['+t+"]"}function l2(t){return C({},t,{"data-precedence":t.precedence,precedence:null})}function E6(t,r,i,l){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=t.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),nn(r,"link",i),Ot(r),t.head.appendChild(r))}function Go(t){return'[src="'+Mn(t)+'"]'}function ul(t){return"script[async]"+t}function c2(t,r,i){if(r.count++,r.instance===null)switch(r.type){case"style":var l=t.querySelector('style[data-href~="'+Mn(i.href)+'"]');if(l)return r.instance=l,Ot(l),l;var d=C({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Ot(l),nn(l,"style",d),du(l,i.precedence,t),r.instance=l;case"stylesheet":d=Qo(i.href);var m=t.querySelector(cl(d));if(m)return r.state.loading|=4,r.instance=m,Ot(m),m;l=l2(i),(d=Yn.get(d))&&oh(l,d),m=(t.ownerDocument||t).createElement("link"),Ot(m);var k=m;return k._p=new Promise(function(L,q){k.onload=L,k.onerror=q}),nn(m,"link",l),r.state.loading|=4,du(m,i.precedence,t),r.instance=m;case"script":return m=Go(i.src),(d=t.querySelector(ul(m)))?(r.instance=d,Ot(d),d):(l=i,(d=Yn.get(m))&&(l=C({},i),sh(l,d)),t=t.ownerDocument||t,d=t.createElement("script"),Ot(d),nn(d,"link",l),t.head.appendChild(d),r.instance=d);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&!(r.state.loading&4)&&(l=r.instance,r.state.loading|=4,du(l,i.precedence,t));return r.instance}function du(t,r,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=l.length?l[l.length-1]:null,m=d,k=0;k<l.length;k++){var L=l[k];if(L.dataset.precedence===r)m=L;else if(m!==d)break}m?m.parentNode.insertBefore(t,m.nextSibling):(r=i.nodeType===9?i.head:i,r.insertBefore(t,r.firstChild))}function oh(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.title??(t.title=r.title)}function sh(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.integrity??(t.integrity=r.integrity)}var fu=null;function u2(t,r,i){if(fu===null){var l=new Map,d=fu=new Map;d.set(i,l)}else d=fu,l=d.get(i),l||(l=new Map,d.set(i,l));if(l.has(t))return l;for(l.set(t,null),i=i.getElementsByTagName(t),d=0;d<i.length;d++){var m=i[d];if(!(m[pi]||m[Ft]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var k=m.getAttribute(r)||"";k=t+k;var L=l.get(k);L?L.push(m):l.set(k,[m])}}return l}function d2(t,r,i){t=t.ownerDocument||t,t.head.insertBefore(i,r==="title"?t.querySelector("head > title"):null)}function T6(t,r,i){if(i===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function f2(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function L6(t,r,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&!(i.state.loading&4)){if(i.instance===null){var d=Qo(l.href),m=r.querySelector(cl(d));if(m){r=m._p,typeof r=="object"&&r&&typeof r.then=="function"&&(t.count++,t=pu.bind(t),r.then(t,t)),i.state.loading|=4,i.instance=m,Ot(m);return}m=r.ownerDocument||r,l=l2(l),(d=Yn.get(d))&&oh(l,d),m=m.createElement("link"),Ot(m);var k=m;k._p=new Promise(function(L,q){k.onload=L,k.onerror=q}),nn(m,"link",l),i.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,r),(r=i.state.preload)&&!(i.state.loading&3)&&(t.count++,i=pu.bind(t),r.addEventListener("load",i),r.addEventListener("error",i))}}var lh=0;function O6(t,r){return t.stylesheets&&t.count===0&&mu(t,t.stylesheets),0<t.count||0<t.imgCount?function(i){var l=setTimeout(function(){if(t.stylesheets&&mu(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+r);0<t.imgBytes&&lh===0&&(lh=62500*c6());var d=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&mu(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>lh?50:800)+r);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(d)}}:null}function pu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)mu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var hu=null;function mu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,hu=new Map,r.forEach(A6,t),hu=null,pu.call(t))}function A6(t,r){if(!(r.state.loading&4)){var i=hu.get(t);if(i)var l=i.get(null);else{i=new Map,hu.set(t,i);for(var d=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<d.length;m++){var k=d[m];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(i.set(k.dataset.precedence,k),l=k)}l&&i.set(null,l)}d=r.instance,k=d.getAttribute("data-precedence"),m=i.get(k)||l,m===l&&i.set(null,d),i.set(k,d),this.count++,l=pu.bind(this),d.addEventListener("load",l),d.addEventListener("error",l),m?m.parentNode.insertBefore(d,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(d,t.firstChild)),r.state.loading|=4}}var dl={$$typeof:ne,Provider:null,Consumer:null,_currentValue:Ae,_currentValue2:Ae,_threadCount:0};function I6(t,r,i,l,d,m,k,L,q){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=_s(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_s(0),this.hiddenUpdates=_s(null),this.identifierPrefix=l,this.onUncaughtError=d,this.onCaughtError=m,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function R6(t,r,i,l,d,m,k,L,q,J,oe,ue){return t=new I6(t,r,i,k,q,J,oe,ue,L),r=1,m===!0&&(r|=24),m=Nn(3,null,null,r),t.current=m,m.stateNode=t,r=Vf(),r.refCount++,t.pooledCache=r,r.refCount++,m.memoizedState={element:l,isDehydrated:i,cache:r},Uf(m),t}function M6(t){return t?(t=Eo,t):Eo}function p2(t,r,i,l,d,m){d=M6(d),l.context===null?l.context=d:l.pendingContext=d,l=Pi(r),l.payload={element:i},m=m===void 0?null:m,m!==null&&(l.callback=m),i=Ni(t,l,r),i!==null&&(Cn(i,t,r),Hs(i,t,r))}function h2(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<r?i:r}}function ch(t,r){h2(t,r),(t=t.alternate)&&h2(t,r)}function m2(t){if(t.tag===13||t.tag===31){var r=Ci(t,67108864);r!==null&&Cn(r,t,67108864),ch(t,67108864)}}function g2(t){if(t.tag===13||t.tag===31){var r=Jn();r=In(r);var i=Ci(t,r);i!==null&&Cn(i,t,r),ch(t,r)}}var gu=!0;function P6(t,r,i,l){var d=ee.T;ee.T=null;var m=U.p;try{U.p=2,uh(t,r,i,l)}finally{U.p=m,ee.T=d}}function N6(t,r,i,l){var d=ee.T;ee.T=null;var m=U.p;try{U.p=8,uh(t,r,i,l)}finally{U.p=m,ee.T=d}}function uh(t,r,i,l){if(gu){var d=dh(l);if(d===null)Jp(t,r,l,yu,i),v2(t,l);else if(j6(d,t,r,i,l))l.stopPropagation();else if(v2(t,l),r&4&&-1<D6.indexOf(t)){for(;d!==null;){var m=_a(d);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var k=Dr(m.pendingLanes);if(k!==0){var L=m;for(L.pendingLanes|=2,L.entangledLanes|=2;k;){var q=1<<31-mt(k);L.entanglements[1]|=q,k&=~q}na(m),!(Ze&6)&&(Zc=Jt()+500,il(0,!1))}}break;case 31:case 13:L=Ci(m,2),L!==null&&Cn(L,m,2),tu(),ch(m,2)}if(m=dh(l),m===null&&Jp(t,r,l,yu,i),m===d)break;d=m}d!==null&&l.stopPropagation()}else Jp(t,r,l,null,i)}}function dh(t){return t=Ls(t),fh(t)}var yu=null;function fh(t){if(yu=null,t=Sr(t),t!==null){var r=h(t);if(r===null)t=null;else{var i=r.tag;if(i===13){if(t=p(r),t!==null)return t;t=null}else if(i===31){if(t=g(r),t!==null)return t;t=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return yu=t,null}function y2(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(mf()){case Nr:return 2;case rc:return 8;case Pt:case po:return 32;case kt:return 268435456;default:return 32}default:return 32}}var ph=!1,Va=null,Ha=null,$a=null,fl=new Map,pl=new Map,Wa=[],D6="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function v2(t,r){switch(t){case"focusin":case"focusout":Va=null;break;case"dragenter":case"dragleave":Ha=null;break;case"mouseover":case"mouseout":$a=null;break;case"pointerover":case"pointerout":fl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":pl.delete(r.pointerId)}}function hl(t,r,i,l,d,m){return t===null||t.nativeEvent!==m?(t={blockedOn:r,domEventName:i,eventSystemFlags:l,nativeEvent:m,targetContainers:[d]},r!==null&&(r=_a(r),r!==null&&m2(r)),t):(t.eventSystemFlags|=l,r=t.targetContainers,d!==null&&r.indexOf(d)===-1&&r.push(d),t)}function j6(t,r,i,l,d){switch(r){case"focusin":return Va=hl(Va,t,r,i,l,d),!0;case"dragenter":return Ha=hl(Ha,t,r,i,l,d),!0;case"mouseover":return $a=hl($a,t,r,i,l,d),!0;case"pointerover":var m=d.pointerId;return fl.set(m,hl(fl.get(m)||null,t,r,i,l,d)),!0;case"gotpointercapture":return m=d.pointerId,pl.set(m,hl(pl.get(m)||null,t,r,i,l,d)),!0}return!1}function b2(t){var r=Sr(t.target);if(r!==null){var i=h(r);if(i!==null){if(r=i.tag,r===13){if(r=p(i),r!==null){t.blockedOn=r,Rn(t.priority,function(){g2(i)});return}}else if(r===31){if(r=g(i),r!==null){t.blockedOn=r,Rn(t.priority,function(){g2(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function vu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var i=dh(t.nativeEvent);if(i===null){i=t.nativeEvent;var l=new i.constructor(i.type,i);Kt=l,i.target.dispatchEvent(l),Kt=null}else return r=_a(i),r!==null&&m2(r),t.blockedOn=i,!1;r.shift()}return!0}function w2(t,r,i){vu(t)&&i.delete(r)}function z6(){ph=!1,Va!==null&&vu(Va)&&(Va=null),Ha!==null&&vu(Ha)&&(Ha=null),$a!==null&&vu($a)&&($a=null),fl.forEach(w2),pl.forEach(w2)}function bu(t,r){t.blockedOn===r&&(t.blockedOn=null,ph||(ph=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,z6)))}var wu=null;function _2(t){wu!==t&&(wu=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){wu===t&&(wu=null);for(var r=0;r<t.length;r+=3){var i=t[r],l=t[r+1],d=t[r+2];if(typeof l!="function"){if(fh(l||i)===null)continue;break}var m=_a(i);m!==null&&(t.splice(r,3),r-=3,fp(m,{pending:!0,data:d,method:i.method,action:l},l,d))}}))}function Jo(t){function r(q){return bu(q,t)}Va!==null&&bu(Va,t),Ha!==null&&bu(Ha,t),$a!==null&&bu($a,t),fl.forEach(r),pl.forEach(r);for(var i=0;i<Wa.length;i++){var l=Wa[i];l.blockedOn===t&&(l.blockedOn=null)}for(;0<Wa.length&&(i=Wa[0],i.blockedOn===null);)b2(i),i.blockedOn===null&&Wa.shift();if(i=(t.ownerDocument||t).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var d=i[l],m=i[l+1],k=d[Yt]||null;if(typeof m=="function")k||_2(i);else if(k){var L=null;if(m&&m.hasAttribute("formAction")){if(d=m,k=m[Yt]||null)L=k.formAction;else if(fh(d)!==null)continue}else L=k.action;typeof L=="function"?i[l+1]=L:(i.splice(l,3),l-=3),_2(i)}}}function q6(){function t(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(k){return d=k})},focusReset:"manual",scroll:"manual"})}function r(){d!==null&&(d(),d=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,d=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),d!==null&&(d(),d=null)}}}function hh(t){this._internalRoot=t}mh.prototype.render=hh.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var i=r.current;p2(i,Jn(),t,r,null,null)},mh.prototype.unmount=hh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;p2(t.current,2,null,t,null,null),tu(),r[wa]=null}};function mh(t){this._internalRoot=t}mh.prototype.unstable_scheduleHydration=function(t){if(t){var r=sc();t={blockedOn:null,target:t,priority:r};for(var i=0;i<Wa.length&&r!==0&&r<Wa[i].priority;i++);Wa.splice(i,0,t),i===0&&b2(t)}};var x2=a.version;if(x2!=="19.2.4")throw Error(s(527,x2,"19.2.4"));U.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=_(r),t=t===null?null:S(t),t=t===null?null:t.stateNode,t};var B6={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:ee,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_u.isDisabled&&_u.supportsFiber)try{ui=_u.inject(B6),on=_u}catch{}}e.createRoot=function(t,r){if(!c(t))throw Error(s(299));var i=!1,l="",d=N4,m=D4,k=j4;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(d=r.onUncaughtError),r.onCaughtError!==void 0&&(m=r.onCaughtError),r.onRecoverableError!==void 0&&(k=r.onRecoverableError)),r=R6(t,1,!1,null,null,i,l,null,d,m,k,q6),t[wa]=r.current,Hb(t),new hh(r)}})),Ru=tt(((e,n)=>{function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(o){console.error(o)}}a(),n.exports=Za()})),Hm="Expected a function";function Z_(e,n){var a;if(typeof n!="function")throw TypeError(Hm);return e=r5(e),function(){return--e>0&&(a=n.apply(this,arguments)),e<=1&&(n=void 0),a}}var ex=Z_;function tx(e){return ex(2,e)}let $m;qh=tx,$m=Math.max;function nx(e){if(!(e&&e.length))return[];var n=0;return e=o5(e,function(a){if(i5(a))return n=$m(a.length,n),!0}),t5(n,function(a){return n5(e,f5(a))})}var rx=a5(nx);Vu=function(e,n){if(e==null)throw Error(n||`Expected value but got ${e}`)},BigInt.prototype.toJSON=function(){return JSON.rawJSON(this.toString())},em=function(e){try{return JSON.parse(e,(n,a)=>fd(a))}catch{}if(e==null||e==="")return{};try{return e??(e=""),e=e.replaceAll(new RegExp(`(?<=\\s|^|\\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\\\]*(\\\\.|'([^'\\\\]*\\\\.)*[^'\\\\]*'|"([^"\\\\]*\\\\.)*[^"\\\\]*"))*[^"']*$)`,"g"),'"\u25D0$1\u25D0"'),JSON.parse(e,(n,a)=>typeof a=="string"?a==="\u25D0NaN\u25D0"?NaN:a==="\u25D0Infinity\u25D0"?1/0:a==="\u25D0-Infinity\u25D0"?-1/0:fd(a):fd(a))}catch{return{}}};function ax(e,n){return e==null?"":typeof e=="number"&&!Number.isNaN(e)?e.toLocaleString(n,{useGrouping:!1,maximumFractionDigits:20}):String(e)}j_=function(e,n){if(e.length===0)return"";let a=Object.keys(e[0]),o=e.map(s=>a.map(c=>ax(s[c],n)).join(" "));return`${a.join(" ")}
9
+ `+l.stack}}var fo=Object.prototype.hasOwnProperty,ur=n.unstable_scheduleCallback,bn=n.unstable_cancelCallback,hf=n.unstable_shouldYield,nc=n.unstable_requestPaint,Jt=n.unstable_now,mf=n.unstable_getCurrentPriorityLevel,Nr=n.unstable_ImmediatePriority,rc=n.unstable_UserBlockingPriority,Pt=n.unstable_NormalPriority,po=n.unstable_LowPriority,kt=n.unstable_IdlePriority,gf=n.log,yf=n.unstable_setDisableYieldValue,ui=null,on=null;function Ue(t){if(typeof gf=="function"&&yf(t),on&&typeof on.setStrictMode=="function")try{on.setStrictMode(ui,t)}catch{}}var mt=Math.clz32?Math.clz32:kr,wt=Math.log,Xt=Math.LN2;function kr(t){return t>>>=0,t===0?32:31-(wt(t)/Xt|0)|0}var di=256,Lt=262144,va=4194304;function Dr(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ho(t,r,i){var l=t.pendingLanes;if(l===0)return 0;var d=0,m=t.suspendedLanes,k=t.pingedLanes;t=t.warmLanes;var L=l&134217727;return L===0?(L=l&~m,L===0?k===0?i||(i=l&~t,i!==0&&(d=Dr(i))):d=Dr(k):d=Dr(L)):(l=L&~m,l===0?(k&=L,k===0?i||(i=L&~t,i!==0&&(d=Dr(i))):d=Dr(k)):d=Dr(l)),d===0?0:r!==0&&r!==d&&(r&m)===0&&(m=d&-d,i=r&-r,m>=i||m===32&&i&4194048)?r:d}function ba(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function ac(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ic(){var t=va;return va<<=1,!(va&62914560)&&(va=4194304),t}function _s(t){for(var r=[],i=0;31>i;i++)r.push(t);return r}function fi(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function vf(t,r,i,l,d,m){var k=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var L=t.entanglements,q=t.expirationTimes,J=t.hiddenUpdates;for(i=k&~i;0<i;){var oe=31-mt(i),ue=1<<oe;L[oe]=0,q[oe]=-1;var Y=J[oe];if(Y!==null)for(J[oe]=null,oe=0;oe<Y.length;oe++){var ae=Y[oe];ae!==null&&(ae.lane&=-536870913)}i&=~ue}l!==0&&jr(t,l,0),m!==0&&d===0&&t.tag!==0&&(t.suspendedLanes|=m&~(k&~r))}function jr(t,r,i){t.pendingLanes|=r,t.suspendedLanes&=~r;var l=31-mt(r);t.entangledLanes|=r,t.entanglements[l]=t.entanglements[l]|1073741824|i&261930}function mo(t,r){var i=t.entangledLanes|=r;for(t=t.entanglements;i;){var l=31-mt(i),d=1<<l;d&r|t[l]&r&&(t[l]|=r),i&=~d}}function oc(t,r){var i=r&-r;return i=i&42?1:In(i),(i&(t.suspendedLanes|r))===0?i:0}function In(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function xs(t){return t&=-t,2<t?8<t?t&134217727?32:268435456:8:2}function sc(){var t=U.p;return t===0?(t=window.event,t===void 0?32:y2(t.type)):t}function Rn(t,r){var i=U.p;try{return U.p=t,r()}finally{U.p=i}}var Hn=Math.random().toString(36).slice(2),Ft="__reactFiber$"+Hn,Yt="__reactProps$"+Hn,wa="__reactContainer$"+Hn,ks="__reactEvents$"+Hn,lc="__reactListeners$"+Hn,bf="__reactHandles$"+Hn,Ss="__reactResources$"+Hn,pi="__reactMarker$"+Hn;function go(t){delete t[Ft],delete t[Yt],delete t[ks],delete t[lc],delete t[bf]}function Sr(t){var r=t[Ft];if(r)return r;for(var i=t.parentNode;i;){if(r=i[wa]||i[Ft]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(t=r2(t);t!==null;){if(i=t[Ft])return i;t=r2(t)}return r}t=i,i=t.parentNode}return null}function _a(t){if(t=t[Ft]||t[wa]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function dn(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function xa(t){var r=t[Ss];return r||(r=t[Ss]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Ot(t){t[pi]=!0}var Cs=new Set,cc={};function Cr(t,r){ka(t,r),ka(t+"Capture",r)}function ka(t,r){for(cc[t]=r,t=0;t<r.length;t++)Cs.add(r[t])}var wf=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),wn={},uc={};function _f(t){return fo.call(uc,t)?!0:fo.call(wn,t)?!1:wf.test(t)?uc[t]=!0:(wn[t]=!0,!1)}function hi(t,r,i){if(_f(r))if(i===null)t.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+i)}}function mi(t,r,i){if(i===null)t.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+i)}}function dr(t,r,i,l){if(l===null)t.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttributeNS(r,i,""+l)}}function fn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function dc(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function fc(t,r,i){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&l!==void 0&&typeof l.get=="function"&&typeof l.set=="function"){var d=l.get,m=l.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return d.call(this)},set:function(k){i=""+k,m.call(this,k)}}),Object.defineProperty(t,r,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(k){i=""+k},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Es(t){if(!t._valueTracker){var r=dc(t)?"checked":"value";t._valueTracker=fc(t,r,""+t[r])}}function Ts(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var i=r.getValue(),l="";return t&&(l=dc(t)?t.checked?"true":"false":t.value),t=l,t===i?!1:(r.setValue(t),!0)}function sn(t){if(t||(t=typeof document<"u"?document:void 0),t===void 0)return null;try{return t.activeElement||t.body}catch{return t.body}}var Ge=/[\n"\\]/g;function Mn(t){return t.replace(Ge,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Sa(t,r,i,l,d,m,k,L){t.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?t.type=k:t.removeAttribute("type"),r==null?k!=="submit"&&k!=="reset"||t.removeAttribute("value"):k==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+fn(r)):t.value!==""+fn(r)&&(t.value=""+fn(r)),r==null?i==null?l!=null&&t.removeAttribute("value"):zr(t,k,fn(i)):zr(t,k,fn(r)),d==null&&m!=null&&(t.defaultChecked=!!m),d!=null&&(t.checked=d&&typeof d!="function"&&typeof d!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?t.name=""+fn(L):t.removeAttribute("name")}function pc(t,r,i,l,d,m,k,L){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),r!=null||i!=null){if(!(m!=="submit"&&m!=="reset"||r!=null)){Es(t);return}i=i==null?"":""+fn(i),r=r==null?i:""+fn(r),L||r===t.value||(t.value=r),t.defaultValue=r}l??(l=d),l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=L?t.checked:!!l,t.defaultChecked=!!l,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(t.name=k),Es(t)}function zr(t,r,i){r==="number"&&sn(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function Ca(t,r,i,l){if(t=t.options,r){r={};for(var d=0;d<i.length;d++)r["$"+i[d]]=!0;for(i=0;i<t.length;i++)d=r.hasOwnProperty("$"+t[i].value),t[i].selected!==d&&(t[i].selected=d),d&&l&&(t[i].defaultSelected=!0)}else{for(i=""+fn(i),r=null,d=0;d<t.length;d++){if(t[d].value===i){t[d].selected=!0,l&&(t[d].defaultSelected=!0);return}r!==null||t[d].disabled||(r=t[d])}r!==null&&(r.selected=!0)}}function Ea(t,r,i){if(r!=null&&(r=""+fn(r),r!==t.value&&(t.value=r),i==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=i==null?"":""+fn(i)}function yo(t,r,i,l){if(r==null){if(l!=null){if(i!=null)throw Error(s(92));if(ie(l)){if(1<l.length)throw Error(s(93));l=l[0]}i=l}i??(i=""),r=i}i=fn(r),t.defaultValue=i,l=t.textContent,l===i&&l!==""&&l!==null&&(t.value=l),Es(t)}function qr(t,r){if(r){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=r;return}}t.textContent=r}var xf=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Br(t,r,i){var l=r.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":l?t.setProperty(r,i):typeof i!="number"||i===0||xf.has(r)?r==="float"?t.cssFloat=i:t[r]=(""+i).trim():t[r]=i+"px"}function hc(t,r,i){if(r!=null&&typeof r!="object")throw Error(s(62));if(t=t.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var d in r)l=r[d],r.hasOwnProperty(d)&&i[d]!==l&&Br(t,d,l)}else for(var m in r)r.hasOwnProperty(m)&&Br(t,m,r[m])}function gi(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var vo=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),mc=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function bo(t){return mc.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function $n(){}var Kt=null;function Ls(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var pn=null,Er=null;function gc(t){var r=_a(t);if(r&&(t=r.stateNode)){var i=t[Yt]||null;e:switch(t=r.stateNode,r.type){case"input":if(Sa(t,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),r=i.name,i.type==="radio"&&r!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Mn(""+r)+'"][type="radio"]'),r=0;r<i.length;r++){var l=i[r];if(l!==t&&l.form===t.form){var d=l[Yt]||null;if(!d)throw Error(s(90));Sa(l,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(r=0;r<i.length;r++)l=i[r],l.form===t.form&&Ts(l)}break e;case"textarea":Ea(t,i.value,i.defaultValue);break e;case"select":r=i.value,r!=null&&Ca(t,!!i.multiple,r,!1)}}}var Os=!1;function yc(t,r,i){if(Os)return t(r,i);Os=!0;try{return t(r)}finally{if(Os=!1,(pn!==null||Er!==null)&&(tu(),pn&&(r=pn,t=Er,Er=pn=null,gc(r),t)))for(r=0;r<t.length;r++)gc(t[r])}}function yi(t,r){var i=t.stateNode;if(i===null)return null;var l=i[Yt]||null;if(l===null)return null;i=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(s(231,r,typeof i));return i}var fr=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0),As=!1;if(fr)try{var vi={};Object.defineProperty(vi,"passive",{get:function(){As=!0}}),window.addEventListener("test",vi,vi),window.removeEventListener("test",vi,vi)}catch{As=!1}var pr=null,wo=null,bi=null;function Is(){if(bi)return bi;var t,r=wo,i=r.length,l,d="value"in pr?pr.value:pr.textContent,m=d.length;for(t=0;t<i&&r[t]===d[t];t++);var k=i-t;for(l=1;l<=k&&r[i-l]===d[m-l];l++);return bi=d.slice(t,1<l?1-l:void 0)}function wi(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function _i(){return!0}function Rs(){return!1}function Qt(t){function r(i,l,d,m,k){for(var L in this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=m,this.target=k,this.currentTarget=null,t)t.hasOwnProperty(L)&&(i=t[L],this[L]=i?i(m):m[L]);return this.isDefaultPrevented=(m.defaultPrevented==null?m.returnValue===!1:m.defaultPrevented)?_i:Rs,this.isPropagationStopped=Rs,this}return C(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=_i)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=_i)},persist:function(){},isPersistent:_i}),r}var Fr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},u=Qt(Fr),f=C({},Fr,{view:0,detail:0}),y=Qt(f),v,w,x,T=C({},f,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Oe,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==x&&(x&&t.type==="mousemove"?(v=t.screenX-x.screenX,w=t.screenY-x.screenY):w=v=0,x=t),v)},movementY:function(t){return"movementY"in t?t.movementY:w}}),A=Qt(T),I=Qt(C({},T,{dataTransfer:0})),D=Qt(C({},f,{relatedTarget:0})),P=Qt(C({},Fr,{animationName:0,elapsedTime:0,pseudoElement:0})),Z=Qt(C({},Fr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}})),X=Qt(C({},Fr,{data:0})),K={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Q={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ge={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function me(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=ge[t])?!!r[t]:!1}function Oe(){return me}var we=Qt(C({},f,{key:function(t){if(t.key){var r=K[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=wi(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Q[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Oe,charCode:function(t){return t.type==="keypress"?wi(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?wi(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}})),Ee=Qt(C({},T,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Je=Qt(C({},f,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Oe})),De=Qt(C({},Fr,{propertyName:0,elapsedTime:0,pseudoElement:0})),ut=Qt(C({},T,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0})),yt=Qt(C({},Fr,{newState:0,oldState:0})),Me=[9,13,27,32],Ie=fr&&"CompositionEvent"in window,_t=null;fr&&"documentMode"in document&&(_t=document.documentMode);var Nt=fr&&"TextEvent"in window&&!_t,Vt=fr&&(!Ie||_t&&8<_t&&11>=_t),xi=" ",vc=!1;function bc(t,r){switch(t){case"keyup":return Me.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _o(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var xo=!1;function c4(t,r){switch(t){case"compositionend":return _o(r);case"keypress":return r.which===32?(vc=!0,xi):null;case"textInput":return t=r.data,t===xi&&vc?null:t;default:return null}}function u4(t,r){if(xo)return t==="compositionend"||!Ie&&bc(t,r)?(t=Is(),bi=wo=pr=null,xo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Vt&&r.locale!=="ko"?null:r.data;default:return null}}var d4={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ly(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!d4[t.type]:r==="textarea"}function cy(t,r,i,l){pn?Er?Er.push(l):Er=[l]:pn=l,r=lu(r,"onChange"),0<r.length&&(i=new u("onChange","change",null,i,l),t.push({event:i,listeners:r}))}var Ms=null,Ps=null;function f4(t){Vb(t,0)}function wc(t){if(Ts(dn(t)))return t}function uy(t,r){if(t==="change")return r}var dy=!1;if(fr){var kf;if(fr){var Sf="oninput"in document;if(!Sf){var fy=document.createElement("div");fy.setAttribute("oninput","return;"),Sf=typeof fy.oninput=="function"}kf=Sf}else kf=!1;dy=kf&&(!document.documentMode||9<document.documentMode)}function py(){Ms&&(Ms.detachEvent("onpropertychange",hy),Ps=Ms=null)}function hy(t){if(t.propertyName==="value"&&wc(Ps)){var r=[];cy(r,Ps,t,Ls(t)),yc(f4,r)}}function p4(t,r,i){t==="focusin"?(py(),Ms=r,Ps=i,Ms.attachEvent("onpropertychange",hy)):t==="focusout"&&py()}function h4(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return wc(Ps)}function m4(t,r){if(t==="click")return wc(r)}function g4(t,r){if(t==="input"||t==="change")return wc(r)}function y4(t,r){return t===r&&(t!==0||1/t==1/r)||t!==t&&r!==r}var Pn=typeof Object.is=="function"?Object.is:y4;function Ns(t,r){if(Pn(t,r))return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var i=Object.keys(t),l=Object.keys(r);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var d=i[l];if(!fo.call(r,d)||!Pn(t[d],r[d]))return!1}return!0}function my(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function gy(t,r){var i=my(t);t=0;for(var l;i;){if(i.nodeType===3){if(l=t+i.textContent.length,t<=r&&l>=r)return{node:i,offset:r-t};t=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=my(i)}}function yy(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?yy(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function vy(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=sn(t.document);r instanceof t.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)t=r.contentWindow;else break;r=sn(t.document)}return r}function Cf(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var v4=fr&&"documentMode"in document&&11>=document.documentMode,ko=null,Ef=null,Ds=null,Tf=!1;function by(t,r,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Tf||ko==null||ko!==sn(l)||(l=ko,"selectionStart"in l&&Cf(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ds&&Ns(Ds,l)||(Ds=l,l=lu(Ef,"onSelect"),0<l.length&&(r=new u("onSelect","select",null,r,i),t.push({event:r,listeners:l}),r.target=ko)))}function ki(t,r){var i={};return i[t.toLowerCase()]=r.toLowerCase(),i["Webkit"+t]="webkit"+r,i["Moz"+t]="moz"+r,i}var So={animationend:ki("Animation","AnimationEnd"),animationiteration:ki("Animation","AnimationIteration"),animationstart:ki("Animation","AnimationStart"),transitionrun:ki("Transition","TransitionRun"),transitionstart:ki("Transition","TransitionStart"),transitioncancel:ki("Transition","TransitionCancel"),transitionend:ki("Transition","TransitionEnd")},Lf={},wy={};fr&&(wy=document.createElement("div").style,"AnimationEvent"in window||(delete So.animationend.animation,delete So.animationiteration.animation,delete So.animationstart.animation),"TransitionEvent"in window||delete So.transitionend.transition);function Si(t){if(Lf[t])return Lf[t];if(!So[t])return t;var r=So[t],i;for(i in r)if(r.hasOwnProperty(i)&&i in wy)return Lf[t]=r[i];return t}var _y=Si("animationend"),xy=Si("animationiteration"),ky=Si("animationstart"),b4=Si("transitionrun"),w4=Si("transitionstart"),_4=Si("transitioncancel"),Sy=Si("transitionend"),Cy=new Map,Of="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Of.push("scrollEnd");function hr(t,r){Cy.set(t,r),Cr(r,[t])}var _c=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Wn=[],Co=0,Af=0;function xc(){for(var t=Co,r=Af=Co=0;r<t;){var i=Wn[r];Wn[r++]=null;var l=Wn[r];Wn[r++]=null;var d=Wn[r];Wn[r++]=null;var m=Wn[r];if(Wn[r++]=null,l!==null&&d!==null){var k=l.pending;k===null?d.next=d:(d.next=k.next,k.next=d),l.pending=d}m!==0&&Ey(i,d,m)}}function kc(t,r,i,l){Wn[Co++]=t,Wn[Co++]=r,Wn[Co++]=i,Wn[Co++]=l,Af|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function If(t,r,i,l){return kc(t,r,i,l),Sc(t)}function Ci(t,r){return kc(t,null,null,r),Sc(t)}function Ey(t,r,i){t.lanes|=i;var l=t.alternate;l!==null&&(l.lanes|=i);for(var d=!1,m=t.return;m!==null;)m.childLanes|=i,l=m.alternate,l!==null&&(l.childLanes|=i),m.tag===22&&(t=m.stateNode,t===null||t._visibility&1||(d=!0)),t=m,m=m.return;return t.tag===3?(m=t.stateNode,d&&r!==null&&(d=31-mt(i),t=m.hiddenUpdates,l=t[d],l===null?t[d]=[r]:l.push(r),r.lane=i|536870912),m):null}function Sc(t){if(50<al)throw al=0,Bp=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Eo={};function x4(t,r,i,l){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nn(t,r,i,l){return new x4(t,r,i,l)}function Rf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Vr(t,r){var i=t.alternate;return i===null?(i=Nn(t.tag,r,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=r,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&65011712,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,r=t.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i.refCleanup=t.refCleanup,i}function Ty(t,r){t.flags&=65011714;var i=t.alternate;return i===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,t.type=i.type,r=i.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function Cc(t,r,i,l,d,m){var k=0;if(l=t,typeof t=="function")Rf(t)&&(k=1);else if(typeof t=="string")k=L6(t,i,Re.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ce:return t=Nn(31,i,r,d),t.elementType=ce,t.lanes=m,t;case V:return Ei(i.children,d,m,r);case H:k=8,d|=24;break;case $:return t=Nn(12,i,r,d|2),t.elementType=$,t.lanes=m,t;case R:return t=Nn(13,i,r,d),t.elementType=R,t.lanes=m,t;case j:return t=Nn(19,i,r,d),t.elementType=j,t.lanes=m,t;default:if(typeof t=="object"&&t)switch(t.$$typeof){case ne:k=10;break e;case N:k=9;break e;case fe:k=11;break e;case F:k=14;break e;case se:k=16,l=null;break e}k=29,i=Error(s(130,t===null?"null":typeof t,"")),l=null}return r=Nn(k,i,r,d),r.elementType=t,r.type=l,r.lanes=m,r}function Ei(t,r,i,l){return t=Nn(7,t,l,r),t.lanes=i,t}function Mf(t,r,i){return t=Nn(6,t,null,r),t.lanes=i,t}function Ly(t){var r=Nn(18,null,null,0);return r.stateNode=t,r}function Pf(t,r,i){return r=Nn(4,t.children===null?[]:t.children,t.key,r),r.lanes=i,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var Oy=new WeakMap;function Un(t,r){if(typeof t=="object"&&t){var i=Oy.get(t);return i===void 0?(r={value:t,source:r,stack:tc(r)},Oy.set(t,r),r):i}return{value:t,source:r,stack:tc(r)}}var To=[],Lo=0,Ec=null,js=0,Kn=[],Qn=0,Ta=null,Tr=1,Lr="";function Hr(t,r){To[Lo++]=js,To[Lo++]=Ec,Ec=t,js=r}function Ay(t,r,i){Kn[Qn++]=Tr,Kn[Qn++]=Lr,Kn[Qn++]=Ta,Ta=t;var l=Tr;t=Lr;var d=32-mt(l)-1;l&=~(1<<d),i+=1;var m=32-mt(r)+d;if(30<m){var k=d-d%5;m=(l&(1<<k)-1).toString(32),l>>=k,d-=k,Tr=1<<32-mt(r)+d|i<<d|l,Lr=m+t}else Tr=1<<m|i<<d|l,Lr=t}function Nf(t){t.return!==null&&(Hr(t,1),Ay(t,1,0))}function Df(t){for(;t===Ec;)Ec=To[--Lo],To[Lo]=null,js=To[--Lo],To[Lo]=null;for(;t===Ta;)Ta=Kn[--Qn],Kn[Qn]=null,Lr=Kn[--Qn],Kn[Qn]=null,Tr=Kn[--Qn],Kn[Qn]=null}function Iy(t,r){Kn[Qn++]=Tr,Kn[Qn++]=Lr,Kn[Qn++]=Ta,Tr=r.id,Lr=r.overflow,Ta=t}var Zt=null,vt=null,Ke=!1,La=null,Gn=!1,jf=Error(s(519));function Oa(t){throw zs(Un(Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML","")),t)),jf}function Ry(t){var r=t.stateNode,i=t.type,l=t.memoizedProps;switch(r[Ft]=t,r[Yt]=l,i){case"dialog":Be("cancel",r),Be("close",r);break;case"iframe":case"object":case"embed":Be("load",r);break;case"video":case"audio":for(i=0;i<ol.length;i++)Be(ol[i],r);break;case"source":Be("error",r);break;case"img":case"image":case"link":Be("error",r),Be("load",r);break;case"details":Be("toggle",r);break;case"input":Be("invalid",r),pc(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Be("invalid",r);break;case"textarea":Be("invalid",r),yo(r,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||r.textContent===""+i||l.suppressHydrationWarning===!0||Kb(r.textContent,i)?(l.popover!=null&&(Be("beforetoggle",r),Be("toggle",r)),l.onScroll!=null&&Be("scroll",r),l.onScrollEnd!=null&&Be("scrollend",r),l.onClick!=null&&(r.onclick=$n),r=!0):r=!1,r||Oa(t,!0)}function My(t){for(Zt=t.return;Zt;)switch(Zt.tag){case 5:case 31:case 13:Gn=!1;return;case 27:case 3:Gn=!0;return;default:Zt=Zt.return}}function Oo(t){if(t!==Zt)return!1;if(!Ke)return My(t),Ke=!0,!1;var r=t.tag,i;if((i=r!==3&&r!==27)&&((i=r===5)&&(i=t.type,i=!(i!=="form"&&i!=="button")||eh(t.type,t.memoizedProps)),i=!i),i&&vt&&Oa(t),My(t),r===13){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));vt=n2(t)}else if(r===31){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));vt=n2(t)}else r===27?(r=vt,Fa(t.type)?(t=ih,ih=null,vt=t):vt=r):vt=Zt?Xn(t.stateNode.nextSibling):null;return!0}function Ti(){vt=Zt=null,Ke=!1}function zf(){var t=La;return t!==null&&(Sn===null?Sn=t:Sn.push.apply(Sn,t),La=null),t}function zs(t){La===null?La=[t]:La.push(t)}var qf=He(null),Li=null,$r=null;function Aa(t,r,i){Le(qf,r._currentValue),r._currentValue=i}function Wr(t){t._currentValue=qf.current,ze(qf)}function Bf(t,r,i){for(;t!==null;){var l=t.alternate;if((t.childLanes&r)===r?l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r):(t.childLanes|=r,l!==null&&(l.childLanes|=r)),t===i)break;t=t.return}}function Ff(t,r,i,l){var d=t.child;for(d!==null&&(d.return=t);d!==null;){var m=d.dependencies;if(m!==null){var k=d.child;m=m.firstContext;e:for(;m!==null;){var L=m;m=d;for(var q=0;q<r.length;q++)if(L.context===r[q]){m.lanes|=i,L=m.alternate,L!==null&&(L.lanes|=i),Bf(m.return,i,t),l||(k=null);break e}m=L.next}}else if(d.tag===18){if(k=d.return,k===null)throw Error(s(341));k.lanes|=i,m=k.alternate,m!==null&&(m.lanes|=i),Bf(k,i,t),k=null}else k=d.child;if(k!==null)k.return=d;else for(k=d;k!==null;){if(k===t){k=null;break}if(d=k.sibling,d!==null){d.return=k.return,k=d;break}k=k.return}d=k}}function Ao(t,r,i,l){t=null;for(var d=r,m=!1;d!==null;){if(!m){if(d.flags&524288)m=!0;else if(d.flags&262144)break}if(d.tag===10){var k=d.alternate;if(k===null)throw Error(s(387));if(k=k.memoizedProps,k!==null){var L=d.type;Pn(d.pendingProps.value,k.value)||(t===null?t=[L]:t.push(L))}}else if(d===ya.current){if(k=d.alternate,k===null)throw Error(s(387));k.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(t===null?t=[dl]:t.push(dl))}d=d.return}t!==null&&Ff(r,t,i,l),r.flags|=262144}function Tc(t){for(t=t.firstContext;t!==null;){if(!Pn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Oi(t){Li=t,$r=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function en(t){return Py(Li,t)}function Lc(t,r){return Li===null&&Oi(t),Py(t,r)}function Py(t,r){var i=r._currentValue;if(r={context:r,memoizedValue:i,next:null},$r===null){if(t===null)throw Error(s(308));$r=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else $r=$r.next=r;return i}var k4=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(i,l){t.push(l)}};this.abort=function(){r.aborted=!0,t.forEach(function(i){return i()})}},S4=n.unstable_scheduleCallback,C4=n.unstable_NormalPriority,Dt={$$typeof:ne,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vf(){return{controller:new k4,data:new Map,refCount:0}}function qs(t){t.refCount--,t.refCount===0&&S4(C4,function(){t.controller.abort()})}var Bs=null,Hf=0,Io=0,Ro=null;function E4(t,r){if(Bs===null){var i=Bs=[];Hf=0,Io=Up(),Ro={status:"pending",value:void 0,then:function(l){i.push(l)}}}return Hf++,r.then(Ny,Ny),r}function Ny(){if(--Hf===0&&Bs!==null){Ro!==null&&(Ro.status="fulfilled");var t=Bs;Bs=null,Io=0,Ro=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function T4(t,r){var i=[],l={status:"pending",value:null,reason:null,then:function(d){i.push(d)}};return t.then(function(){l.status="fulfilled",l.value=r;for(var d=0;d<i.length;d++)(0,i[d])(r)},function(d){for(l.status="rejected",l.reason=d,d=0;d<i.length;d++)(0,i[d])(void 0)}),l}var Dy=ee.S;ee.S=function(t,r){gb=Jt(),typeof r=="object"&&r&&typeof r.then=="function"&&E4(t,r),Dy!==null&&Dy(t,r)};var Ai=He(null);function $f(){var t=Ai.current;return t===null?dt.pooledCache:t}function Oc(t,r){r===null?Le(Ai,Ai.current):Le(Ai,r.pool)}function jy(){var t=$f();return t===null?null:{parent:Dt._currentValue,pool:t}}var Mo=Error(s(460)),Wf=Error(s(474)),Ac=Error(s(542)),Ic={then:function(){}};function zy(t){return t=t.status,t==="fulfilled"||t==="rejected"}function qy(t,r,i){switch(i=t[i],i===void 0?t.push(r):i!==r&&(r.then($n,$n),r=i),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Fy(t),t;default:if(typeof r.status=="string")r.then($n,$n);else{if(t=dt,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(l){if(r.status==="pending"){var d=r;d.status="fulfilled",d.value=l}},function(l){if(r.status==="pending"){var d=r;d.status="rejected",d.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Fy(t),t}throw Ri=r,Mo}}function Ii(t){try{var r=t._init;return r(t._payload)}catch(i){throw typeof i=="object"&&i&&typeof i.then=="function"?(Ri=i,Mo):i}}var Ri=null;function By(){if(Ri===null)throw Error(s(459));var t=Ri;return Ri=null,t}function Fy(t){if(t===Mo||t===Ac)throw Error(s(483))}var Po=null,Fs=0;function Rc(t){var r=Fs;return Fs+=1,Po===null&&(Po=[]),qy(Po,t,r)}function Vs(t,r){r=r.props.ref,t.ref=r===void 0?null:r}function Mc(t,r){throw r.$$typeof===E?Error(s(525)):(t=Object.prototype.toString.call(r),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Vy(t){function r(W,B){if(t){var G=W.deletions;G===null?(W.deletions=[B],W.flags|=16):G.push(B)}}function i(W,B){if(!t)return null;for(;B!==null;)r(W,B),B=B.sibling;return null}function l(W){for(var B=new Map;W!==null;)W.key===null?B.set(W.index,W):B.set(W.key,W),W=W.sibling;return B}function d(W,B){return W=Vr(W,B),W.index=0,W.sibling=null,W}function m(W,B,G){return W.index=G,t?(G=W.alternate,G===null?(W.flags|=67108866,B):(G=G.index,G<B?(W.flags|=67108866,B):G)):(W.flags|=1048576,B)}function k(W){return t&&W.alternate===null&&(W.flags|=67108866),W}function L(W,B,G,le){return B===null||B.tag!==6?(B=Mf(G,W.mode,le),B.return=W,B):(B=d(B,G),B.return=W,B)}function q(W,B,G,le){var Se=G.type;return Se===V?oe(W,B,G.props.children,le,G.key):B!==null&&(B.elementType===Se||typeof Se=="object"&&Se&&Se.$$typeof===se&&Ii(Se)===B.type)?(B=d(B,G.props),Vs(B,G),B.return=W,B):(B=Cc(G.type,G.key,G.props,null,W.mode,le),Vs(B,G),B.return=W,B)}function J(W,B,G,le){return B===null||B.tag!==4||B.stateNode.containerInfo!==G.containerInfo||B.stateNode.implementation!==G.implementation?(B=Pf(G,W.mode,le),B.return=W,B):(B=d(B,G.children||[]),B.return=W,B)}function oe(W,B,G,le,Se){return B===null||B.tag!==7?(B=Ei(G,W.mode,le,Se),B.return=W,B):(B=d(B,G),B.return=W,B)}function ue(W,B,G){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Mf(""+B,W.mode,G),B.return=W,B;if(typeof B=="object"&&B){switch(B.$$typeof){case O:return G=Cc(B.type,B.key,B.props,null,W.mode,G),Vs(G,B),G.return=W,G;case M:return B=Pf(B,W.mode,G),B.return=W,B;case se:return B=Ii(B),ue(W,B,G)}if(ie(B)||xe(B))return B=Ei(B,W.mode,G,null),B.return=W,B;if(typeof B.then=="function")return ue(W,Rc(B),G);if(B.$$typeof===ne)return ue(W,Lc(W,B),G);Mc(W,B)}return null}function Y(W,B,G,le){var Se=B===null?null:B.key;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return Se===null?L(W,B,""+G,le):null;if(typeof G=="object"&&G){switch(G.$$typeof){case O:return G.key===Se?q(W,B,G,le):null;case M:return G.key===Se?J(W,B,G,le):null;case se:return G=Ii(G),Y(W,B,G,le)}if(ie(G)||xe(G))return Se===null?oe(W,B,G,le,null):null;if(typeof G.then=="function")return Y(W,B,Rc(G),le);if(G.$$typeof===ne)return Y(W,B,Lc(W,G),le);Mc(W,G)}return null}function ae(W,B,G,le,Se){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return W=W.get(G)||null,L(B,W,""+le,Se);if(typeof le=="object"&&le){switch(le.$$typeof){case O:return W=W.get(le.key===null?G:le.key)||null,q(B,W,le,Se);case M:return W=W.get(le.key===null?G:le.key)||null,J(B,W,le,Se);case se:return le=Ii(le),ae(W,B,G,le,Se)}if(ie(le)||xe(le))return W=W.get(G)||null,oe(B,W,le,Se,null);if(typeof le.then=="function")return ae(W,B,G,Rc(le),Se);if(le.$$typeof===ne)return ae(W,B,G,Lc(B,le),Se);Mc(B,le)}return null}function _e(W,B,G,le){for(var Se=null,et=null,ke=B,Ne=B=0,We=null;ke!==null&&Ne<G.length;Ne++){ke.index>Ne?(We=ke,ke=null):We=ke.sibling;var Xe=Y(W,ke,G[Ne],le);if(Xe===null){ke===null&&(ke=We);break}t&&ke&&Xe.alternate===null&&r(W,ke),B=m(Xe,B,Ne),et===null?Se=Xe:et.sibling=Xe,et=Xe,ke=We}if(Ne===G.length)return i(W,ke),Ke&&Hr(W,Ne),Se;if(ke===null){for(;Ne<G.length;Ne++)ke=ue(W,G[Ne],le),ke!==null&&(B=m(ke,B,Ne),et===null?Se=ke:et.sibling=ke,et=ke);return Ke&&Hr(W,Ne),Se}for(ke=l(ke);Ne<G.length;Ne++)We=ae(ke,W,Ne,G[Ne],le),We!==null&&(t&&We.alternate!==null&&ke.delete(We.key===null?Ne:We.key),B=m(We,B,Ne),et===null?Se=We:et.sibling=We,et=We);return t&&ke.forEach(function(Ua){return r(W,Ua)}),Ke&&Hr(W,Ne),Se}function Te(W,B,G,le){if(G==null)throw Error(s(151));for(var Se=null,et=null,ke=B,Ne=B=0,We=null,Xe=G.next();ke!==null&&!Xe.done;Ne++,Xe=G.next()){ke.index>Ne?(We=ke,ke=null):We=ke.sibling;var Ua=Y(W,ke,Xe.value,le);if(Ua===null){ke===null&&(ke=We);break}t&&ke&&Ua.alternate===null&&r(W,ke),B=m(Ua,B,Ne),et===null?Se=Ua:et.sibling=Ua,et=Ua,ke=We}if(Xe.done)return i(W,ke),Ke&&Hr(W,Ne),Se;if(ke===null){for(;!Xe.done;Ne++,Xe=G.next())Xe=ue(W,Xe.value,le),Xe!==null&&(B=m(Xe,B,Ne),et===null?Se=Xe:et.sibling=Xe,et=Xe);return Ke&&Hr(W,Ne),Se}for(ke=l(ke);!Xe.done;Ne++,Xe=G.next())Xe=ae(ke,W,Ne,Xe.value,le),Xe!==null&&(t&&Xe.alternate!==null&&ke.delete(Xe.key===null?Ne:Xe.key),B=m(Xe,B,Ne),et===null?Se=Xe:et.sibling=Xe,et=Xe);return t&&ke.forEach(function(V6){return r(W,V6)}),Ke&&Hr(W,Ne),Se}function st(W,B,G,le){if(typeof G=="object"&&G&&G.type===V&&G.key===null&&(G=G.props.children),typeof G=="object"&&G){switch(G.$$typeof){case O:e:{for(var Se=G.key;B!==null;){if(B.key===Se){if(Se=G.type,Se===V){if(B.tag===7){i(W,B.sibling),le=d(B,G.props.children),le.return=W,W=le;break e}}else if(B.elementType===Se||typeof Se=="object"&&Se&&Se.$$typeof===se&&Ii(Se)===B.type){i(W,B.sibling),le=d(B,G.props),Vs(le,G),le.return=W,W=le;break e}i(W,B);break}else r(W,B);B=B.sibling}G.type===V?(le=Ei(G.props.children,W.mode,le,G.key),le.return=W,W=le):(le=Cc(G.type,G.key,G.props,null,W.mode,le),Vs(le,G),le.return=W,W=le)}return k(W);case M:e:{for(Se=G.key;B!==null;){if(B.key===Se)if(B.tag===4&&B.stateNode.containerInfo===G.containerInfo&&B.stateNode.implementation===G.implementation){i(W,B.sibling),le=d(B,G.children||[]),le.return=W,W=le;break e}else{i(W,B);break}else r(W,B);B=B.sibling}le=Pf(G,W.mode,le),le.return=W,W=le}return k(W);case se:return G=Ii(G),st(W,B,G,le)}if(ie(G))return _e(W,B,G,le);if(xe(G)){if(Se=xe(G),typeof Se!="function")throw Error(s(150));return G=Se.call(G),Te(W,B,G,le)}if(typeof G.then=="function")return st(W,B,Rc(G),le);if(G.$$typeof===ne)return st(W,B,Lc(W,G),le);Mc(W,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,B!==null&&B.tag===6?(i(W,B.sibling),le=d(B,G),le.return=W,W=le):(i(W,B),le=Mf(G,W.mode,le),le.return=W,W=le),k(W)):i(W,B)}return function(W,B,G,le){try{Fs=0;var Se=st(W,B,G,le);return Po=null,Se}catch(ke){if(ke===Mo||ke===Ac)throw ke;var et=Nn(29,ke,null,W.mode);return et.lanes=le,et.return=W,et}}}var Mi=Vy(!0),Hy=Vy(!1),Ia=!1;function Uf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kf(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Pi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ni(t,r,i){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,Ze&2){var d=l.pending;return d===null?r.next=r:(r.next=d.next,d.next=r),l.pending=r,r=Sc(t),Ey(t,null,i),r}return kc(t,l,r,i),Sc(t)}function Hs(t,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,i&4194048)){var l=r.lanes;l&=t.pendingLanes,i|=l,r.lanes=i,mo(t,i)}}function Qf(t,r){var i=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var d=null,m=null;if(i=i.firstBaseUpdate,i!==null){do{var k={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};m===null?d=m=k:m=m.next=k,i=i.next}while(i!==null);m===null?d=m=r:m=m.next=r}else d=m=r;i={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:l.shared,callbacks:l.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=r:t.next=r,i.lastBaseUpdate=r}var Gf=!1;function $s(){if(Gf){var t=Ro;if(t!==null)throw t}}function Ws(t,r,i,l){Gf=!1;var d=t.updateQueue;Ia=!1;var m=d.firstBaseUpdate,k=d.lastBaseUpdate,L=d.shared.pending;if(L!==null){d.shared.pending=null;var q=L,J=q.next;q.next=null,k===null?m=J:k.next=J,k=q;var oe=t.alternate;oe!==null&&(oe=oe.updateQueue,L=oe.lastBaseUpdate,L!==k&&(L===null?oe.firstBaseUpdate=J:L.next=J,oe.lastBaseUpdate=q))}if(m!==null){var ue=d.baseState;k=0,oe=J=q=null,L=m;do{var Y=L.lane&-536870913,ae=Y!==L.lane;if(ae?($e&Y)===Y:(l&Y)===Y){Y!==0&&Y===Io&&(Gf=!0),oe!==null&&(oe=oe.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var _e=t,Te=L;Y=r;var st=i;switch(Te.tag){case 1:if(_e=Te.payload,typeof _e=="function"){ue=_e.call(st,ue,Y);break e}ue=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=Te.payload,Y=typeof _e=="function"?_e.call(st,ue,Y):_e,Y==null)break e;ue=C({},ue,Y);break e;case 2:Ia=!0}}Y=L.callback,Y!==null&&(t.flags|=64,ae&&(t.flags|=8192),ae=d.callbacks,ae===null?d.callbacks=[Y]:ae.push(Y))}else ae={lane:Y,tag:L.tag,payload:L.payload,callback:L.callback,next:null},oe===null?(J=oe=ae,q=ue):oe=oe.next=ae,k|=Y;if(L=L.next,L===null){if(L=d.shared.pending,L===null)break;ae=L,L=ae.next,ae.next=null,d.lastBaseUpdate=ae,d.shared.pending=null}}while(!0);oe===null&&(q=ue),d.baseState=q,d.firstBaseUpdate=J,d.lastBaseUpdate=oe,m===null&&(d.shared.lanes=0),Da|=k,t.lanes=k,t.memoizedState=ue}}function $y(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function Wy(t,r){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;t<i.length;t++)$y(i[t],r)}var No=He(null),Pc=He(0);function Uy(t,r){t=ea,Le(Pc,t),Le(No,r),ea=t|r.baseLanes}function Jf(){Le(Pc,ea),Le(No,No.current)}function Xf(){ea=Pc.current,ze(No),ze(Pc)}var Dn=He(null),mr=null;function Ra(t){var r=t.alternate;Le(At,At.current&1),Le(Dn,t),mr===null&&(r===null||No.current!==null||r.memoizedState!==null)&&(mr=t)}function Yf(t){Le(At,At.current),Le(Dn,t),mr===null&&(mr=t)}function Ky(t){t.tag===22?(Le(At,At.current),Le(Dn,t),mr===null&&(mr=t)):Ma(t)}function Ma(){Le(At,At.current),Le(Dn,Dn.current)}function jn(t){ze(Dn),mr===t&&(mr=null),ze(At)}var At=He(0);function Nc(t){for(var r=t;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||rh(i)||ah(i)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if(r.flags&128)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Ur=0,Pe=null,it=null,jt=null,Dc=!1,Do=!1,Di=!1,jc=0,Us=0,jo=null,L4=0;function St(){throw Error(s(321))}function Zf(t,r){if(r===null)return!1;for(var i=0;i<r.length&&i<t.length;i++)if(!Pn(t[i],r[i]))return!1;return!0}function ep(t,r,i,l,d,m){return Ur=m,Pe=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,ee.H=t===null||t.memoizedState===null?Av:mp,Di=!1,m=i(l,d),Di=!1,Do&&(m=Gy(r,i,l,d)),Qy(t),m}function Qy(t){ee.H=Gs;var r=it!==null&&it.next!==null;if(Ur=0,jt=it=Pe=null,Dc=!1,Us=0,jo=null,r)throw Error(s(300));t===null||zt||(t=t.dependencies,t!==null&&Tc(t)&&(zt=!0))}function Gy(t,r,i,l){Pe=t;var d=0;do{if(Do&&(jo=null),Us=0,Do=!1,25<=d)throw Error(s(301));if(d+=1,jt=it=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}ee.H=Iv,m=r(i,l)}while(Do);return m}function O4(){var t=ee.H,r=t.useState()[0];return r=typeof r.then=="function"?Ks(r):r,t=t.useState()[0],(it===null?null:it.memoizedState)!==t&&(Pe.flags|=1024),r}function tp(){var t=jc!==0;return jc=0,t}function np(t,r,i){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~i}function rp(t){if(Dc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Dc=!1}Ur=0,jt=it=Pe=null,Do=!1,Us=jc=0,jo=null}function hn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?Pe.memoizedState=jt=t:jt=jt.next=t,jt}function It(){if(it===null){var t=Pe.alternate;t=t===null?null:t.memoizedState}else t=it.next;var r=jt===null?Pe.memoizedState:jt.next;if(r!==null)jt=r,it=t;else{if(t===null)throw Pe.alternate===null?Error(s(467)):Error(s(310));it=t,t={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},jt===null?Pe.memoizedState=jt=t:jt=jt.next=t}return jt}function zc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ks(t){var r=Us;return Us+=1,jo===null&&(jo=[]),t=qy(jo,t,r),r=Pe,(jt===null?r.memoizedState:jt.next)===null&&(r=r.alternate,ee.H=r===null||r.memoizedState===null?Av:mp),t}function qc(t){if(typeof t=="object"&&t){if(typeof t.then=="function")return Ks(t);if(t.$$typeof===ne)return en(t)}throw Error(s(438,String(t)))}function ap(t){var r=null,i=Pe.updateQueue;if(i!==null&&(r=i.memoCache),r==null){var l=Pe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(d){return d.slice()}),index:0})))}if(r??(r={data:[],index:0}),i===null&&(i=zc(),Pe.updateQueue=i),i.memoCache=r,i=r.data[r.index],i===void 0)for(i=r.data[r.index]=Array(t),l=0;l<t;l++)i[l]=he;return r.index++,i}function Kr(t,r){return typeof r=="function"?r(t):r}function Bc(t){return ip(It(),it,t)}function ip(t,r,i){var l=t.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=i;var d=t.baseQueue,m=l.pending;if(m!==null){if(d!==null){var k=d.next;d.next=m.next,m.next=k}r.baseQueue=d=m,l.pending=null}if(m=t.baseState,d===null)t.memoizedState=m;else{r=d.next;var L=k=null,q=null,J=r,oe=!1;do{var ue=J.lane&-536870913;if(ue===J.lane?(Ur&ue)===ue:($e&ue)===ue){var Y=J.revertLane;if(Y===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),ue===Io&&(oe=!0);else if((Ur&Y)===Y){J=J.next,Y===Io&&(oe=!0);continue}else ue={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},q===null?(L=q=ue,k=m):q=q.next=ue,Pe.lanes|=Y,Da|=Y;ue=J.action,Di&&i(m,ue),m=J.hasEagerState?J.eagerState:i(m,ue)}else Y={lane:ue,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},q===null?(L=q=Y,k=m):q=q.next=Y,Pe.lanes|=ue,Da|=ue;J=J.next}while(J!==null&&J!==r);if(q===null?k=m:q.next=L,!Pn(m,t.memoizedState)&&(zt=!0,oe&&(i=Ro,i!==null)))throw i;t.memoizedState=m,t.baseState=k,t.baseQueue=q,l.lastRenderedState=m}return d===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function op(t){var r=It(),i=r.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=t;var l=i.dispatch,d=i.pending,m=r.memoizedState;if(d!==null){i.pending=null;var k=d=d.next;do m=t(m,k.action),k=k.next;while(k!==d);Pn(m,r.memoizedState)||(zt=!0),r.memoizedState=m,r.baseQueue===null&&(r.baseState=m),i.lastRenderedState=m}return[m,l]}function Jy(t,r,i){var l=Pe,d=It(),m=Ke;if(m){if(i===void 0)throw Error(s(407));i=i()}else i=r();var k=!Pn((it||d).memoizedState,i);if(k&&(d.memoizedState=i,zt=!0),d=d.queue,cp(Zy.bind(null,l,d,t),[t]),d.getSnapshot!==r||k||jt!==null&&jt.memoizedState.tag&1){if(l.flags|=2048,zo(9,{destroy:void 0},Yy.bind(null,l,d,i,r),null),dt===null)throw Error(s(349));m||Ur&127||Xy(l,r,i)}return i}function Xy(t,r,i){t.flags|=16384,t={getSnapshot:r,value:i},r=Pe.updateQueue,r===null?(r=zc(),Pe.updateQueue=r,r.stores=[t]):(i=r.stores,i===null?r.stores=[t]:i.push(t))}function Yy(t,r,i,l){r.value=i,r.getSnapshot=l,ev(r)&&tv(t)}function Zy(t,r,i){return i(function(){ev(r)&&tv(t)})}function ev(t){var r=t.getSnapshot;t=t.value;try{var i=r();return!Pn(t,i)}catch{return!0}}function tv(t){var r=Ci(t,2);r!==null&&Cn(r,t,2)}function sp(t){var r=hn();if(typeof t=="function"){var i=t;if(t=i(),Di){Ue(!0);try{i()}finally{Ue(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kr,lastRenderedState:t},r}function nv(t,r,i,l){return t.baseState=i,ip(t,it,typeof l=="function"?l:Kr)}function A4(t,r,i,l,d){if(Hc(t))throw Error(s(485));if(t=r.action,t!==null){var m={payload:d,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){m.listeners.push(k)}};ee.T===null?m.isTransition=!1:i(!0),l(m),i=r.pending,i===null?(m.next=r.pending=m,rv(r,m)):(m.next=i.next,r.pending=i.next=m)}}function rv(t,r){var i=r.action,l=r.payload,d=t.state;if(r.isTransition){var m=ee.T,k={};ee.T=k;try{var L=i(d,l),q=ee.S;q!==null&&q(k,L),av(t,r,L)}catch(J){lp(t,r,J)}finally{m!==null&&k.types!==null&&(m.types=k.types),ee.T=m}}else try{m=i(d,l),av(t,r,m)}catch(J){lp(t,r,J)}}function av(t,r,i){typeof i=="object"&&i&&typeof i.then=="function"?i.then(function(l){iv(t,r,l)},function(l){return lp(t,r,l)}):iv(t,r,i)}function iv(t,r,i){r.status="fulfilled",r.value=i,ov(r),t.state=i,r=t.pending,r!==null&&(i=r.next,i===r?t.pending=null:(i=i.next,r.next=i,rv(t,i)))}function lp(t,r,i){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=i,ov(r),r=r.next;while(r!==l)}t.action=null}function ov(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function sv(t,r){return r}function lv(t,r){if(Ke){var i=dt.formState;if(i!==null){e:{var l=Pe;if(Ke){if(vt){t:{for(var d=vt,m=Gn;d.nodeType!==8;){if(!m){d=null;break t}if(d=Xn(d.nextSibling),d===null){d=null;break t}}m=d.data,d=m==="F!"||m==="F"?d:null}if(d){vt=Xn(d.nextSibling),l=d.data==="F!";break e}}Oa(l)}l=!1}l&&(r=i[0])}}return i=hn(),i.memoizedState=i.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sv,lastRenderedState:r},i.queue=l,i=Tv.bind(null,Pe,l),l.dispatch=i,l=sp(!1),m=hp.bind(null,Pe,!1,l.queue),l=hn(),d={state:r,dispatch:null,action:t,pending:null},l.queue=d,i=A4.bind(null,Pe,d,m,i),d.dispatch=i,l.memoizedState=t,[r,i,!1]}function cv(t){return uv(It(),it,t)}function uv(t,r,i){if(r=ip(t,r,sv)[0],t=Bc(Kr)[0],typeof r=="object"&&r&&typeof r.then=="function")try{var l=Ks(r)}catch(k){throw k===Mo?Ac:k}else l=r;r=It();var d=r.queue,m=d.dispatch;return i!==r.memoizedState&&(Pe.flags|=2048,zo(9,{destroy:void 0},I4.bind(null,d,i),null)),[l,m,t]}function I4(t,r){t.action=r}function dv(t){var r=It(),i=it;if(i!==null)return uv(r,i,t);It(),r=r.memoizedState,i=It();var l=i.queue.dispatch;return i.memoizedState=t,[r,l,!1]}function zo(t,r,i,l){return t={tag:t,create:i,deps:l,inst:r,next:null},r=Pe.updateQueue,r===null&&(r=zc(),Pe.updateQueue=r),i=r.lastEffect,i===null?r.lastEffect=t.next=t:(l=i.next,i.next=t,t.next=l,r.lastEffect=t),t}function fv(){return It().memoizedState}function Fc(t,r,i,l){var d=hn();Pe.flags|=t,d.memoizedState=zo(1|r,{destroy:void 0},i,l===void 0?null:l)}function Vc(t,r,i,l){var d=It();l=l===void 0?null:l;var m=d.memoizedState.inst;it!==null&&l!==null&&Zf(l,it.memoizedState.deps)?d.memoizedState=zo(r,m,i,l):(Pe.flags|=t,d.memoizedState=zo(1|r,m,i,l))}function pv(t,r){Fc(8390656,8,t,r)}function cp(t,r){Vc(2048,8,t,r)}function R4(t){Pe.flags|=4;var r=Pe.updateQueue;if(r===null)r=zc(),Pe.updateQueue=r,r.events=[t];else{var i=r.events;i===null?r.events=[t]:i.push(t)}}function hv(t){var r=It().memoizedState;return R4({ref:r,nextImpl:t}),function(){if(Ze&2)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function mv(t,r){return Vc(4,2,t,r)}function gv(t,r){return Vc(4,4,t,r)}function yv(t,r){if(typeof r=="function"){t=t();var i=r(t);return function(){typeof i=="function"?i():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function vv(t,r,i){i=i==null?null:i.concat([t]),Vc(4,4,yv.bind(null,r,t),i)}function up(){}function bv(t,r){var i=It();r=r===void 0?null:r;var l=i.memoizedState;return r!==null&&Zf(r,l[1])?l[0]:(i.memoizedState=[t,r],t)}function wv(t,r){var i=It();r=r===void 0?null:r;var l=i.memoizedState;if(r!==null&&Zf(r,l[1]))return l[0];if(l=t(),Di){Ue(!0);try{t()}finally{Ue(!1)}}return i.memoizedState=[l,r],l}function dp(t,r,i){return i===void 0||Ur&1073741824&&!($e&261930)?t.memoizedState=r:(t.memoizedState=i,t=vb(),Pe.lanes|=t,Da|=t,i)}function _v(t,r,i,l){return Pn(i,r)?i:No.current===null?!(Ur&42)||Ur&1073741824&&!($e&261930)?(zt=!0,t.memoizedState=i):(t=vb(),Pe.lanes|=t,Da|=t,r):(t=dp(t,i,l),Pn(t,r)||(zt=!0),t)}function xv(t,r,i,l,d){var m=U.p;U.p=m!==0&&8>m?m:8;var k=ee.T,L={};ee.T=L,hp(t,!1,r,i);try{var q=d(),J=ee.S;J!==null&&J(L,q),typeof q=="object"&&q&&typeof q.then=="function"?Qs(t,r,T4(q,l),Jn(t)):Qs(t,r,l,Jn(t))}catch(oe){Qs(t,r,{then:function(){},status:"rejected",reason:oe},Jn())}finally{U.p=m,k!==null&&L.types!==null&&(k.types=L.types),ee.T=k}}function M4(){}function fp(t,r,i,l){if(t.tag!==5)throw Error(s(476));var d=kv(t).queue;xv(t,d,r,Ae,i===null?M4:function(){return Sv(t),i(l)})}function kv(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Ae,baseState:Ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kr,lastRenderedState:Ae},next:null};var i={};return r.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kr,lastRenderedState:i},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function Sv(t){var r=kv(t);r.next===null&&(r=t.alternate.memoizedState),Qs(t,r.next.queue,{},Jn())}function pp(){return en(dl)}function Cv(){return It().memoizedState}function Ev(){return It().memoizedState}function P4(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var i=Jn();t=Pi(i);var l=Ni(r,t,i);l!==null&&(Cn(l,r,i),Hs(l,r,i)),r={cache:Vf()},t.payload=r;return}r=r.return}}function N4(t,r,i){var l=Jn();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Hc(t)?Lv(r,i):(i=If(t,r,i,l),i!==null&&(Cn(i,t,l),Ov(i,r,l)))}function Tv(t,r,i){Qs(t,r,i,Jn())}function Qs(t,r,i,l){var d={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Hc(t))Lv(r,d);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=r.lastRenderedReducer,m!==null))try{var k=r.lastRenderedState,L=m(k,i);if(d.hasEagerState=!0,d.eagerState=L,Pn(L,k))return kc(t,r,d,0),dt===null&&xc(),!1}catch{}if(i=If(t,r,d,l),i!==null)return Cn(i,t,l),Ov(i,r,l),!0}return!1}function hp(t,r,i,l){if(l={lane:2,revertLane:Up(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Hc(t)){if(r)throw Error(s(479))}else r=If(t,i,l,2),r!==null&&Cn(r,t,2)}function Hc(t){var r=t.alternate;return t===Pe||r!==null&&r===Pe}function Lv(t,r){Do=Dc=!0;var i=t.pending;i===null?r.next=r:(r.next=i.next,i.next=r),t.pending=r}function Ov(t,r,i){if(i&4194048){var l=r.lanes;l&=t.pendingLanes,i|=l,r.lanes=i,mo(t,i)}}var Gs={readContext:en,use:qc,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useLayoutEffect:St,useInsertionEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useSyncExternalStore:St,useId:St,useHostTransitionStatus:St,useFormState:St,useActionState:St,useOptimistic:St,useMemoCache:St,useCacheRefresh:St};Gs.useEffectEvent=St;var Av={readContext:en,use:qc,useCallback:function(t,r){return hn().memoizedState=[t,r===void 0?null:r],t},useContext:en,useEffect:pv,useImperativeHandle:function(t,r,i){i=i==null?null:i.concat([t]),Fc(4194308,4,yv.bind(null,r,t),i)},useLayoutEffect:function(t,r){return Fc(4194308,4,t,r)},useInsertionEffect:function(t,r){Fc(4,2,t,r)},useMemo:function(t,r){var i=hn();r=r===void 0?null:r;var l=t();if(Di){Ue(!0);try{t()}finally{Ue(!1)}}return i.memoizedState=[l,r],l},useReducer:function(t,r,i){var l=hn();if(i!==void 0){var d=i(r);if(Di){Ue(!0);try{i(r)}finally{Ue(!1)}}}else d=r;return l.memoizedState=l.baseState=d,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:d},l.queue=t,t=t.dispatch=N4.bind(null,Pe,t),[l.memoizedState,t]},useRef:function(t){var r=hn();return t={current:t},r.memoizedState=t},useState:function(t){t=sp(t);var r=t.queue,i=Tv.bind(null,Pe,r);return r.dispatch=i,[t.memoizedState,i]},useDebugValue:up,useDeferredValue:function(t,r){return dp(hn(),t,r)},useTransition:function(){var t=sp(!1);return t=xv.bind(null,Pe,t.queue,!0,!1),hn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,i){var l=Pe,d=hn();if(Ke){if(i===void 0)throw Error(s(407));i=i()}else{if(i=r(),dt===null)throw Error(s(349));$e&127||Xy(l,r,i)}d.memoizedState=i;var m={value:i,getSnapshot:r};return d.queue=m,pv(Zy.bind(null,l,m,t),[t]),l.flags|=2048,zo(9,{destroy:void 0},Yy.bind(null,l,m,i,r),null),i},useId:function(){var t=hn(),r=dt.identifierPrefix;if(Ke){var i=Lr,l=Tr;i=(l&~(1<<32-mt(l)-1)).toString(32)+i,r="_"+r+"R_"+i,i=jc++,0<i&&(r+="H"+i.toString(32)),r+="_"}else i=L4++,r="_"+r+"r_"+i.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:pp,useFormState:lv,useActionState:lv,useOptimistic:function(t){var r=hn();r.memoizedState=r.baseState=t;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=i,r=hp.bind(null,Pe,!0,i),i.dispatch=r,[t,r]},useMemoCache:ap,useCacheRefresh:function(){return hn().memoizedState=P4.bind(null,Pe)},useEffectEvent:function(t){var r=hn(),i={impl:t};return r.memoizedState=i,function(){if(Ze&2)throw Error(s(440));return i.impl.apply(void 0,arguments)}}},mp={readContext:en,use:qc,useCallback:bv,useContext:en,useEffect:cp,useImperativeHandle:vv,useInsertionEffect:mv,useLayoutEffect:gv,useMemo:wv,useReducer:Bc,useRef:fv,useState:function(){return Bc(Kr)},useDebugValue:up,useDeferredValue:function(t,r){return _v(It(),it.memoizedState,t,r)},useTransition:function(){var t=Bc(Kr)[0],r=It().memoizedState;return[typeof t=="boolean"?t:Ks(t),r]},useSyncExternalStore:Jy,useId:Cv,useHostTransitionStatus:pp,useFormState:cv,useActionState:cv,useOptimistic:function(t,r){return nv(It(),it,t,r)},useMemoCache:ap,useCacheRefresh:Ev};mp.useEffectEvent=hv;var Iv={readContext:en,use:qc,useCallback:bv,useContext:en,useEffect:cp,useImperativeHandle:vv,useInsertionEffect:mv,useLayoutEffect:gv,useMemo:wv,useReducer:op,useRef:fv,useState:function(){return op(Kr)},useDebugValue:up,useDeferredValue:function(t,r){var i=It();return it===null?dp(i,t,r):_v(i,it.memoizedState,t,r)},useTransition:function(){var t=op(Kr)[0],r=It().memoizedState;return[typeof t=="boolean"?t:Ks(t),r]},useSyncExternalStore:Jy,useId:Cv,useHostTransitionStatus:pp,useFormState:dv,useActionState:dv,useOptimistic:function(t,r){var i=It();return it===null?(i.baseState=t,[t,i.queue.dispatch]):nv(i,it,t,r)},useMemoCache:ap,useCacheRefresh:Ev};Iv.useEffectEvent=hv;function gp(t,r,i,l){r=t.memoizedState,i=i(l,r),i=i==null?r:C({},r,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var yp={enqueueSetState:function(t,r,i){t=t._reactInternals;var l=Jn(),d=Pi(l);d.payload=r,i!=null&&(d.callback=i),r=Ni(t,d,l),r!==null&&(Cn(r,t,l),Hs(r,t,l))},enqueueReplaceState:function(t,r,i){t=t._reactInternals;var l=Jn(),d=Pi(l);d.tag=1,d.payload=r,i!=null&&(d.callback=i),r=Ni(t,d,l),r!==null&&(Cn(r,t,l),Hs(r,t,l))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var i=Jn(),l=Pi(i);l.tag=2,r!=null&&(l.callback=r),r=Ni(t,l,i),r!==null&&(Cn(r,t,i),Hs(r,t,i))}};function Rv(t,r,i,l,d,m,k){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,m,k):r.prototype&&r.prototype.isPureReactComponent?!Ns(i,l)||!Ns(d,m):!0}function Mv(t,r,i,l){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,l),r.state!==t&&yp.enqueueReplaceState(r,r.state,null)}function ji(t,r){var i=r;if("ref"in r)for(var l in i={},r)l!=="ref"&&(i[l]=r[l]);if(t=t.defaultProps)for(var d in i===r&&(i=C({},i)),t)i[d]===void 0&&(i[d]=t[d]);return i}function D4(t){_c(t)}function j4(t){console.error(t)}function z4(t){_c(t)}function $c(t,r){try{var i=t.onUncaughtError;i(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function Pv(t,r,i){try{var l=t.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function vp(t,r,i){return i=Pi(i),i.tag=3,i.payload={element:null},i.callback=function(){$c(t,r)},i}function Nv(t){return t=Pi(t),t.tag=3,t}function Dv(t,r,i,l){var d=i.type.getDerivedStateFromError;if(typeof d=="function"){var m=l.value;t.payload=function(){return d(m)},t.callback=function(){Pv(r,i,l)}}var k=i.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(t.callback=function(){Pv(r,i,l),typeof d!="function"&&(ja===null?ja=new Set([this]):ja.add(this));var L=l.stack;this.componentDidCatch(l.value,{componentStack:L===null?"":L})})}function q4(t,r,i,l,d){if(i.flags|=32768,typeof l=="object"&&l&&typeof l.then=="function"){if(r=i.alternate,r!==null&&Ao(r,i,d,!0),i=Dn.current,i!==null){switch(i.tag){case 31:case 13:return mr===null?nu():i.alternate===null&&Ct===0&&(Ct=3),i.flags&=-257,i.flags|=65536,i.lanes=d,l===Ic?i.flags|=16384:(r=i.updateQueue,r===null?i.updateQueue=new Set([l]):r.add(l),Hp(t,l,d)),!1;case 22:return i.flags|=65536,l===Ic?i.flags|=16384:(r=i.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=r):(i=r.retryQueue,i===null?r.retryQueue=new Set([l]):i.add(l)),Hp(t,l,d)),!1}throw Error(s(435,i.tag))}return Hp(t,l,d),nu(),!1}if(Ke)return r=Dn.current,r===null?(l!==jf&&(r=Error(s(423),{cause:l}),zs(Un(r,i))),t=t.current.alternate,t.flags|=65536,d&=-d,t.lanes|=d,l=Un(l,i),d=vp(t.stateNode,l,d),Qf(t,d),Ct!==4&&(Ct=2)):(!(r.flags&65536)&&(r.flags|=256),r.flags|=65536,r.lanes=d,l!==jf&&(t=Error(s(422),{cause:l}),zs(Un(t,i)))),!1;var m=Error(s(520),{cause:l});if(m=Un(m,i),rl===null?rl=[m]:rl.push(m),Ct!==4&&(Ct=2),r===null)return!0;l=Un(l,i),i=r;do{switch(i.tag){case 3:return i.flags|=65536,t=d&-d,i.lanes|=t,t=vp(i.stateNode,l,t),Qf(i,t),!1;case 1:if(r=i.type,m=i.stateNode,!(i.flags&128)&&(typeof r.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(ja===null||!ja.has(m))))return i.flags|=65536,d&=-d,i.lanes|=d,d=Nv(d),Dv(d,t,i,l),Qf(i,d),!1}i=i.return}while(i!==null);return!1}var bp=Error(s(461)),zt=!1;function tn(t,r,i,l){r.child=t===null?Hy(r,null,i,l):Mi(r,t.child,i,l)}function jv(t,r,i,l,d){i=i.render;var m=r.ref;if("ref"in l){var k={};for(var L in l)L!=="ref"&&(k[L]=l[L])}else k=l;return Oi(r),l=ep(t,r,i,k,m,d),L=tp(),t!==null&&!zt?(np(t,r,d),Qr(t,r,d)):(Ke&&L&&Nf(r),r.flags|=1,tn(t,r,l,d),r.child)}function zv(t,r,i,l,d){if(t===null){var m=i.type;return typeof m=="function"&&!Rf(m)&&m.defaultProps===void 0&&i.compare===null?(r.tag=15,r.type=m,qv(t,r,m,l,d)):(t=Cc(i.type,null,l,r,r.mode,d),t.ref=r.ref,t.return=r,r.child=t)}if(m=t.child,!Tp(t,d)){var k=m.memoizedProps;if(i=i.compare,i=i===null?Ns:i,i(k,l)&&t.ref===r.ref)return Qr(t,r,d)}return r.flags|=1,t=Vr(m,l),t.ref=r.ref,t.return=r,r.child=t}function qv(t,r,i,l,d){if(t!==null){var m=t.memoizedProps;if(Ns(m,l)&&t.ref===r.ref)if(zt=!1,r.pendingProps=l=m,Tp(t,d))t.flags&131072&&(zt=!0);else return r.lanes=t.lanes,Qr(t,r,d)}return wp(t,r,i,l,d)}function Bv(t,r,i,l){var d=l.children,m=t===null?null:t.memoizedState;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if(r.flags&128){if(m=m===null?i:m.baseLanes|i,t!==null){for(l=r.child=t.child,d=0;l!==null;)d=d|l.lanes|l.childLanes,l=l.sibling;l=d&~m}else l=0,r.child=null;return Fv(t,r,m,i,l)}if(i&536870912)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Oc(r,m===null?null:m.cachePool),m===null?Jf():Uy(r,m),Ky(r);else return l=r.lanes=536870912,Fv(t,r,m===null?i:m.baseLanes|i,i,l)}else m===null?(t!==null&&Oc(r,null),Jf(),Ma(r)):(Oc(r,m.cachePool),Uy(r,m),Ma(r),r.memoizedState=null);return tn(t,r,d,i),r.child}function Js(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Fv(t,r,i,l,d){var m=$f();return m=m===null?null:{parent:Dt._currentValue,pool:m},r.memoizedState={baseLanes:i,cachePool:m},t!==null&&Oc(r,null),Jf(),Ky(r),t!==null&&Ao(t,r,l,!0),r.childLanes=d,null}function Wc(t,r){return r=Kc({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function Vv(t,r,i){return Mi(r,t.child,null,i),t=Wc(r,r.pendingProps),t.flags|=2,jn(r),r.memoizedState=null,t}function B4(t,r,i){var l=r.pendingProps,d=(r.flags&128)!=0;if(r.flags&=-129,t===null){if(Ke){if(l.mode==="hidden")return t=Wc(r,l),r.lanes=536870912,Js(null,t);if(Yf(r),(t=vt)?(t=t2(t,Gn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Ta===null?null:{id:Tr,overflow:Lr},retryLane:536870912,hydrationErrors:null},i=Ly(t),i.return=r,r.child=i,Zt=r,vt=null)):t=null,t===null)throw Oa(r);return r.lanes=536870912,null}return Wc(r,l)}var m=t.memoizedState;if(m!==null){var k=m.dehydrated;if(Yf(r),d)if(r.flags&256)r.flags&=-257,r=Vv(t,r,i);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(s(558));else if(zt||Ao(t,r,i,!1),d=(i&t.childLanes)!==0,zt||d){if(l=dt,l!==null&&(k=oc(l,i),k!==0&&k!==m.retryLane))throw m.retryLane=k,Ci(t,k),Cn(l,t,k),bp;nu(),r=Vv(t,r,i)}else t=m.treeContext,vt=Xn(k.nextSibling),Zt=r,Ke=!0,La=null,Gn=!1,t!==null&&Iy(r,t),r=Wc(r,l),r.flags|=4096;return r}return t=Vr(t.child,{mode:l.mode,children:l.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Uc(t,r){var i=r.ref;if(i===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(s(284));(t===null||t.ref!==i)&&(r.flags|=4194816)}}function wp(t,r,i,l,d){return Oi(r),i=ep(t,r,i,l,void 0,d),l=tp(),t!==null&&!zt?(np(t,r,d),Qr(t,r,d)):(Ke&&l&&Nf(r),r.flags|=1,tn(t,r,i,d),r.child)}function Hv(t,r,i,l,d,m){return Oi(r),r.updateQueue=null,i=Gy(r,l,i,d),Qy(t),l=tp(),t!==null&&!zt?(np(t,r,m),Qr(t,r,m)):(Ke&&l&&Nf(r),r.flags|=1,tn(t,r,i,m),r.child)}function $v(t,r,i,l,d){if(Oi(r),r.stateNode===null){var m=Eo,k=i.contextType;typeof k=="object"&&k&&(m=en(k)),m=new i(l,m),r.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=yp,r.stateNode=m,m._reactInternals=r,m=r.stateNode,m.props=l,m.state=r.memoizedState,m.refs={},Uf(r),k=i.contextType,m.context=typeof k=="object"&&k?en(k):Eo,m.state=r.memoizedState,k=i.getDerivedStateFromProps,typeof k=="function"&&(gp(r,i,k,l),m.state=r.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(k=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),k!==m.state&&yp.enqueueReplaceState(m,m.state,null),Ws(r,l,m,d),$s(),m.state=r.memoizedState),typeof m.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(t===null){m=r.stateNode;var L=r.memoizedProps,q=ji(i,L);m.props=q;var J=m.context,oe=i.contextType;k=Eo,typeof oe=="object"&&oe&&(k=en(oe));var ue=i.getDerivedStateFromProps;oe=typeof ue=="function"||typeof m.getSnapshotBeforeUpdate=="function",L=r.pendingProps!==L,oe||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(L||J!==k)&&Mv(r,m,l,k),Ia=!1;var Y=r.memoizedState;m.state=Y,Ws(r,l,m,d),$s(),J=r.memoizedState,L||Y!==J||Ia?(typeof ue=="function"&&(gp(r,i,ue,l),J=r.memoizedState),(q=Ia||Rv(r,i,q,l,Y,J,k))?(oe||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(r.flags|=4194308)):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=J),m.props=l,m.state=J,m.context=k,l=q):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{m=r.stateNode,Kf(t,r),k=r.memoizedProps,oe=ji(i,k),m.props=oe,ue=r.pendingProps,Y=m.context,J=i.contextType,q=Eo,typeof J=="object"&&J&&(q=en(J)),L=i.getDerivedStateFromProps,(J=typeof L=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(k!==ue||Y!==q)&&Mv(r,m,l,q),Ia=!1,Y=r.memoizedState,m.state=Y,Ws(r,l,m,d),$s();var ae=r.memoizedState;k!==ue||Y!==ae||Ia||t!==null&&t.dependencies!==null&&Tc(t.dependencies)?(typeof L=="function"&&(gp(r,i,L,l),ae=r.memoizedState),(oe=Ia||Rv(r,i,oe,l,Y,ae,q)||t!==null&&t.dependencies!==null&&Tc(t.dependencies))?(J||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(l,ae,q),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(l,ae,q)),typeof m.componentDidUpdate=="function"&&(r.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof m.componentDidUpdate!="function"||k===t.memoizedProps&&Y===t.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||k===t.memoizedProps&&Y===t.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=ae),m.props=l,m.state=ae,m.context=q,l=oe):(typeof m.componentDidUpdate!="function"||k===t.memoizedProps&&Y===t.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||k===t.memoizedProps&&Y===t.memoizedState||(r.flags|=1024),l=!1)}return m=l,Uc(t,r),l=(r.flags&128)!=0,m||l?(m=r.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:m.render(),r.flags|=1,t!==null&&l?(r.child=Mi(r,t.child,null,d),r.child=Mi(r,null,i,d)):tn(t,r,i,d),r.memoizedState=m.state,t=r.child):t=Qr(t,r,d),t}function Wv(t,r,i,l){return Ti(),r.flags|=256,tn(t,r,i,l),r.child}var _p={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xp(t){return{baseLanes:t,cachePool:jy()}}function kp(t,r,i){return t=t===null?0:t.childLanes&~i,r&&(t|=qn),t}function Uv(t,r,i){var l=r.pendingProps,d=!1,m=(r.flags&128)!=0,k;if((k=m)||(k=t!==null&&t.memoizedState===null?!1:(At.current&2)!=0),k&&(d=!0,r.flags&=-129),k=(r.flags&32)!=0,r.flags&=-33,t===null){if(Ke){if(d?Ra(r):Ma(r),(t=vt)?(t=t2(t,Gn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Ta===null?null:{id:Tr,overflow:Lr},retryLane:536870912,hydrationErrors:null},i=Ly(t),i.return=r,r.child=i,Zt=r,vt=null)):t=null,t===null)throw Oa(r);return ah(t)?r.lanes=32:r.lanes=536870912,null}var L=l.children;return l=l.fallback,d?(Ma(r),d=r.mode,L=Kc({mode:"hidden",children:L},d),l=Ei(l,d,i,null),L.return=r,l.return=r,L.sibling=l,r.child=L,l=r.child,l.memoizedState=xp(i),l.childLanes=kp(t,k,i),r.memoizedState=_p,Js(null,l)):(Ra(r),Sp(r,L))}var q=t.memoizedState;if(q!==null&&(L=q.dehydrated,L!==null)){if(m)r.flags&256?(Ra(r),r.flags&=-257,r=Cp(t,r,i)):r.memoizedState===null?(Ma(r),L=l.fallback,d=r.mode,l=Kc({mode:"visible",children:l.children},d),L=Ei(L,d,i,null),L.flags|=2,l.return=r,L.return=r,l.sibling=L,r.child=l,Mi(r,t.child,null,i),l=r.child,l.memoizedState=xp(i),l.childLanes=kp(t,k,i),r.memoizedState=_p,r=Js(null,l)):(Ma(r),r.child=t.child,r.flags|=128,r=null);else if(Ra(r),ah(L)){if(k=L.nextSibling&&L.nextSibling.dataset,k)var J=k.dgst;k=J,l=Error(s(419)),l.stack="",l.digest=k,zs({value:l,source:null,stack:null}),r=Cp(t,r,i)}else if(zt||Ao(t,r,i,!1),k=(i&t.childLanes)!==0,zt||k){if(k=dt,k!==null&&(l=oc(k,i),l!==0&&l!==q.retryLane))throw q.retryLane=l,Ci(t,l),Cn(k,t,l),bp;rh(L)||nu(),r=Cp(t,r,i)}else rh(L)?(r.flags|=192,r.child=t.child,r=null):(t=q.treeContext,vt=Xn(L.nextSibling),Zt=r,Ke=!0,La=null,Gn=!1,t!==null&&Iy(r,t),r=Sp(r,l.children),r.flags|=4096);return r}return d?(Ma(r),L=l.fallback,d=r.mode,q=t.child,J=q.sibling,l=Vr(q,{mode:"hidden",children:l.children}),l.subtreeFlags=q.subtreeFlags&65011712,J===null?(L=Ei(L,d,i,null),L.flags|=2):L=Vr(J,L),L.return=r,l.return=r,l.sibling=L,r.child=l,Js(null,l),l=r.child,L=t.child.memoizedState,L===null?L=xp(i):(d=L.cachePool,d===null?d=jy():(q=Dt._currentValue,d=d.parent===q?d:{parent:q,pool:q}),L={baseLanes:L.baseLanes|i,cachePool:d}),l.memoizedState=L,l.childLanes=kp(t,k,i),r.memoizedState=_p,Js(t.child,l)):(Ra(r),i=t.child,t=i.sibling,i=Vr(i,{mode:"visible",children:l.children}),i.return=r,i.sibling=null,t!==null&&(k=r.deletions,k===null?(r.deletions=[t],r.flags|=16):k.push(t)),r.child=i,r.memoizedState=null,i)}function Sp(t,r){return r=Kc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Kc(t,r){return t=Nn(22,t,null,r),t.lanes=0,t}function Cp(t,r,i){return Mi(r,t.child,null,i),t=Sp(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function Kv(t,r,i){t.lanes|=r;var l=t.alternate;l!==null&&(l.lanes|=r),Bf(t.return,r,i)}function Ep(t,r,i,l,d,m){var k=t.memoizedState;k===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:d,treeForkCount:m}:(k.isBackwards=r,k.rendering=null,k.renderingStartTime=0,k.last=l,k.tail=i,k.tailMode=d,k.treeForkCount=m)}function Qv(t,r,i){var l=r.pendingProps,d=l.revealOrder,m=l.tail;l=l.children;var k=At.current,L=(k&2)!=0;if(L?(k=k&1|2,r.flags|=128):k&=1,Le(At,k),tn(t,r,l,i),l=Ke?js:0,!L&&t!==null&&t.flags&128)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Kv(t,i,r);else if(t.tag===19)Kv(t,i,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(d){case"forwards":for(i=r.child,d=null;i!==null;)t=i.alternate,t!==null&&Nc(t)===null&&(d=i),i=i.sibling;i=d,i===null?(d=r.child,r.child=null):(d=i.sibling,i.sibling=null),Ep(r,!1,d,i,m,l);break;case"backwards":case"unstable_legacy-backwards":for(i=null,d=r.child,r.child=null;d!==null;){if(t=d.alternate,t!==null&&Nc(t)===null){r.child=d;break}t=d.sibling,d.sibling=i,i=d,d=t}Ep(r,!0,i,null,m,l);break;case"together":Ep(r,!1,null,null,void 0,l);break;default:r.memoizedState=null}return r.child}function Qr(t,r,i){if(t!==null&&(r.dependencies=t.dependencies),Da|=r.lanes,(i&r.childLanes)===0)if(t!==null){if(Ao(t,r,i,!1),(i&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(s(153));if(r.child!==null){for(t=r.child,i=Vr(t,t.pendingProps),r.child=i,i.return=r;t.sibling!==null;)t=t.sibling,i=i.sibling=Vr(t,t.pendingProps),i.return=r;i.sibling=null}return r.child}function Tp(t,r){return(t.lanes&r)===0?(t=t.dependencies,!!(t!==null&&Tc(t))):!0}function F4(t,r,i){switch(r.tag){case 3:co(r,r.stateNode.containerInfo),Aa(r,Dt,t.memoizedState.cache),Ti();break;case 27:case 5:Pr(r);break;case 4:co(r,r.stateNode.containerInfo);break;case 10:Aa(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Yf(r),null;break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated===null?(i&r.child.childLanes)===0?(Ra(r),t=Qr(t,r,i),t===null?null:t.sibling):Uv(t,r,i):(Ra(r),r.flags|=128,null);Ra(r);break;case 19:var d=(t.flags&128)!=0;if(l=(i&r.childLanes)!==0,l||(l=(Ao(t,r,i,!1),(i&r.childLanes)!==0)),d){if(l)return Qv(t,r,i);r.flags|=128}if(d=r.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Le(At,At.current),l)break;return null;case 22:return r.lanes=0,Bv(t,r,i,r.pendingProps);case 24:Aa(r,Dt,t.memoizedState.cache)}return Qr(t,r,i)}function Gv(t,r,i){if(t!==null)if(t.memoizedProps!==r.pendingProps)zt=!0;else{if(!Tp(t,i)&&!(r.flags&128))return zt=!1,F4(t,r,i);zt=!!(t.flags&131072)}else zt=!1,Ke&&r.flags&1048576&&Ay(r,js,r.index);switch(r.lanes=0,r.tag){case 16:e:{var l=r.pendingProps;if(t=Ii(r.elementType),r.type=t,typeof t=="function")Rf(t)?(l=ji(t,l),r.tag=1,r=$v(null,r,t,l,i)):(r.tag=0,r=wp(null,r,t,l,i));else{if(t!=null){var d=t.$$typeof;if(d===fe){r.tag=11,r=jv(null,r,t,l,i);break e}else if(d===F){r.tag=14,r=zv(null,r,t,l,i);break e}}throw r=pe(t)||t,Error(s(306,r,""))}}return r;case 0:return wp(t,r,r.type,r.pendingProps,i);case 1:return l=r.type,d=ji(l,r.pendingProps),$v(t,r,l,d,i);case 3:e:{if(co(r,r.stateNode.containerInfo),t===null)throw Error(s(387));l=r.pendingProps;var m=r.memoizedState;d=m.element,Kf(t,r),Ws(r,l,null,i);var k=r.memoizedState;if(l=k.cache,Aa(r,Dt,l),l!==m.cache&&Ff(r,[Dt],i,!0),$s(),l=k.element,m.isDehydrated)if(m={element:l,isDehydrated:!1,cache:k.cache},r.updateQueue.baseState=m,r.memoizedState=m,r.flags&256){r=Wv(t,r,l,i);break e}else if(l!==d){d=Un(Error(s(424)),r),zs(d),r=Wv(t,r,l,i);break e}else for((t=r.stateNode.containerInfo,t.nodeType)===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,vt=Xn(t.firstChild),Zt=r,Ke=!0,La=null,Gn=!0,i=Hy(r,null,l,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Ti(),l===d){r=Qr(t,r,i);break e}tn(t,r,l,i)}r=r.child}return r;case 26:return Uc(t,r),t===null?(i=s2(r.type,null,r.pendingProps,null))?r.memoizedState=i:Ke||(i=r.type,t=r.pendingProps,l=cu(Mt.current).createElement(i),l[Ft]=r,l[Yt]=t,nn(l,i,t),Ot(l),r.stateNode=l):r.memoizedState=s2(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return Pr(r),t===null&&Ke&&(l=r.stateNode=a2(r.type,r.pendingProps,Mt.current),Zt=r,Gn=!0,d=vt,Fa(r.type)?(ih=d,vt=Xn(l.firstChild)):vt=d),tn(t,r,r.pendingProps.children,i),Uc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&Ke&&((d=l=vt)&&(l=m6(l,r.type,r.pendingProps,Gn),l===null?d=!1:(r.stateNode=l,Zt=r,vt=Xn(l.firstChild),Gn=!1,d=!0)),d||Oa(r)),Pr(r),d=r.type,m=r.pendingProps,k=t===null?null:t.memoizedProps,l=m.children,eh(d,m)?l=null:k!==null&&eh(d,k)&&(r.flags|=32),r.memoizedState!==null&&(d=ep(t,r,O4,null,null,i),dl._currentValue=d),Uc(t,r),tn(t,r,l,i),r.child;case 6:return t===null&&Ke&&((t=i=vt)&&(i=g6(i,r.pendingProps,Gn),i===null?t=!1:(r.stateNode=i,Zt=r,vt=null,t=!0)),t||Oa(r)),null;case 13:return Uv(t,r,i);case 4:return co(r,r.stateNode.containerInfo),l=r.pendingProps,t===null?r.child=Mi(r,null,l,i):tn(t,r,l,i),r.child;case 11:return jv(t,r,r.type,r.pendingProps,i);case 7:return tn(t,r,r.pendingProps,i),r.child;case 8:return tn(t,r,r.pendingProps.children,i),r.child;case 12:return tn(t,r,r.pendingProps.children,i),r.child;case 10:return l=r.pendingProps,Aa(r,r.type,l.value),tn(t,r,l.children,i),r.child;case 9:return d=r.type._context,l=r.pendingProps.children,Oi(r),d=en(d),l=l(d),r.flags|=1,tn(t,r,l,i),r.child;case 14:return zv(t,r,r.type,r.pendingProps,i);case 15:return qv(t,r,r.type,r.pendingProps,i);case 19:return Qv(t,r,i);case 31:return B4(t,r,i);case 22:return Bv(t,r,i,r.pendingProps);case 24:return Oi(r),l=en(Dt),t===null?(d=$f(),d===null&&(d=dt,m=Vf(),d.pooledCache=m,m.refCount++,m!==null&&(d.pooledCacheLanes|=i),d=m),r.memoizedState={parent:l,cache:d},Uf(r),Aa(r,Dt,d)):((t.lanes&i)!==0&&(Kf(t,r),Ws(r,null,null,i),$s()),d=t.memoizedState,m=r.memoizedState,d.parent===l?(l=m.cache,Aa(r,Dt,l),l!==d.cache&&Ff(r,[Dt],i,!0)):(d={parent:l,cache:l},r.memoizedState=d,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=d),Aa(r,Dt,l))),tn(t,r,r.pendingProps.children,i),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Gr(t){t.flags|=4}function Lp(t,r,i,l,d){if((r=(t.mode&32)!=0)&&(r=!1),r){if(t.flags|=16777216,(d&335544128)===d)if(t.stateNode.complete)t.flags|=8192;else if(xb())t.flags|=8192;else throw Ri=Ic,Wf}else t.flags&=-16777217}function Jv(t,r){if(r.type!=="stylesheet"||r.state.loading&4)t.flags&=-16777217;else if(t.flags|=16777216,!f2(r))if(xb())t.flags|=8192;else throw Ri=Ic,Wf}function Qc(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag===22?536870912:ic(),t.lanes|=r,Vo|=r)}function Xs(t,r){if(!Ke)switch(t.tailMode){case"hidden":r=t.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function bt(t){var r=t.alternate!==null&&t.alternate.child===t.child,i=0,l=0;if(r)for(var d=t.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags&65011712,l|=d.flags&65011712,d.return=t,d=d.sibling;else for(d=t.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=t,d=d.sibling;return t.subtreeFlags|=l,t.childLanes=i,r}function V4(t,r,i){var l=r.pendingProps;switch(Df(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(r),null;case 1:return bt(r),null;case 3:return i=r.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),Wr(Dt),An(),i.pendingContext&&(i.pendingContext=(i.context=i.pendingContext,null)),(t===null||t.child===null)&&(Oo(r)?Gr(r):t===null||t.memoizedState.isDehydrated&&!(r.flags&256)||(r.flags|=1024,zf())),bt(r),null;case 26:var d=r.type,m=r.memoizedState;return t===null?(Gr(r),m===null?(bt(r),Lp(r,d,null,l,i)):(bt(r),Jv(r,m))):m?m===t.memoizedState?(bt(r),r.flags&=-16777217):(Gr(r),bt(r),Jv(r,m)):(t=t.memoizedProps,t!==l&&Gr(r),bt(r),Lp(r,d,t,l,i)),null;case 27:if(ci(r),i=Mt.current,d=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Gr(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return bt(r),null}t=Re.current,Oo(r)?Ry(r,t):(t=a2(d,l,i),r.stateNode=t,Gr(r))}return bt(r),null;case 5:if(ci(r),d=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Gr(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return bt(r),null}if(m=Re.current,Oo(r))Ry(r,m);else{var k=cu(Mt.current);switch(m){case 1:m=k.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:m=k.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":m=k.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":m=k.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":m=k.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof l.is=="string"?k.createElement("select",{is:l.is}):k.createElement("select"),l.multiple?m.multiple=!0:l.size&&(m.size=l.size);break;default:m=typeof l.is=="string"?k.createElement(d,{is:l.is}):k.createElement(d)}}m[Ft]=r,m[Yt]=l;e:for(k=r.child;k!==null;){if(k.tag===5||k.tag===6)m.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===r)break e;for(;k.sibling===null;){if(k.return===null||k.return===r)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}r.stateNode=m;e:switch(nn(m,d,l),d){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Gr(r)}}return bt(r),Lp(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,i),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==l&&Gr(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(t=Mt.current,Oo(r)){if(t=r.stateNode,i=r.memoizedProps,l=null,d=Zt,d!==null)switch(d.tag){case 27:case 5:l=d.memoizedProps}t[Ft]=r,t=!!(t.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||Kb(t.nodeValue,i)),t||Oa(r,!0)}else t=cu(t).createTextNode(l),t[Ft]=r,r.stateNode=t}return bt(r),null;case 31:if(i=r.memoizedState,t===null||t.memoizedState!==null){if(l=Oo(r),i!==null){if(t===null){if(!l)throw Error(s(318));if(t=r.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(557));t[Ft]=r}else Ti(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;bt(r),t=!1}else i=zf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return r.flags&256?(jn(r),r):(jn(r),null);if(r.flags&128)throw Error(s(558))}return bt(r),null;case 13:if(l=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(d=Oo(r),l!==null&&l.dehydrated!==null){if(t===null){if(!d)throw Error(s(318));if(d=r.memoizedState,d=d===null?null:d.dehydrated,!d)throw Error(s(317));d[Ft]=r}else Ti(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;bt(r),d=!1}else d=zf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=d),d=!0;if(!d)return r.flags&256?(jn(r),r):(jn(r),null)}return jn(r),r.flags&128?(r.lanes=i,r):(i=l!==null,t=t!==null&&t.memoizedState!==null,i&&(l=r.child,d=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(d=l.alternate.memoizedState.cachePool.pool),m=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(m=l.memoizedState.cachePool.pool),m!==d&&(l.flags|=2048)),i!==t&&i&&(r.child.flags|=8192),Qc(r,r.updateQueue),bt(r),null);case 4:return An(),t===null&&Hb(r.stateNode.containerInfo),bt(r),null;case 10:return Wr(r.type),bt(r),null;case 19:if(ze(At),l=r.memoizedState,l===null)return bt(r),null;if(d=(r.flags&128)!=0,m=l.rendering,m===null)if(d)Xs(l,!1);else{if(Ct!==0||t!==null&&t.flags&128)for(t=r.child;t!==null;){if(m=Nc(t),m!==null){for(r.flags|=128,Xs(l,!1),t=m.updateQueue,r.updateQueue=t,Qc(r,t),r.subtreeFlags=0,t=i,i=r.child;i!==null;)Ty(i,t),i=i.sibling;return Le(At,At.current&1|2),Ke&&Hr(r,l.treeForkCount),r.child}t=t.sibling}l.tail!==null&&Jt()>Zc&&(r.flags|=128,d=!0,Xs(l,!1),r.lanes=4194304)}else{if(!d)if(t=Nc(m),t!==null){if(r.flags|=128,d=!0,t=t.updateQueue,r.updateQueue=t,Qc(r,t),Xs(l,!0),l.tail===null&&l.tailMode==="hidden"&&!m.alternate&&!Ke)return bt(r),null}else 2*Jt()-l.renderingStartTime>Zc&&i!==536870912&&(r.flags|=128,d=!0,Xs(l,!1),r.lanes=4194304);l.isBackwards?(m.sibling=r.child,r.child=m):(t=l.last,t===null?r.child=m:t.sibling=m,l.last=m)}return l.tail===null?(bt(r),null):(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Jt(),t.sibling=null,i=At.current,Le(At,d?i&1|2:i&1),Ke&&Hr(r,l.treeForkCount),t);case 22:case 23:return jn(r),Xf(),l=r.memoizedState!==null,t===null?l&&(r.flags|=8192):t.memoizedState!==null!==l&&(r.flags|=8192),l?i&536870912&&!(r.flags&128)&&(bt(r),r.subtreeFlags&6&&(r.flags|=8192)):bt(r),i=r.updateQueue,i!==null&&Qc(r,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==i&&(r.flags|=2048),t!==null&&ze(Ai),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),r.memoizedState.cache!==i&&(r.flags|=2048),Wr(Dt),bt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function H4(t,r){switch(Df(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Wr(Dt),An(),t=r.flags,t&65536&&!(t&128)?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return ci(r),null;case 31:if(r.memoizedState!==null){if(jn(r),r.alternate===null)throw Error(s(340));Ti()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(jn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Ti()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return ze(At),null;case 4:return An(),null;case 10:return Wr(r.type),null;case 22:case 23:return jn(r),Xf(),t!==null&&ze(Ai),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Wr(Dt),null;case 25:return null;default:return null}}function Xv(t,r){switch(Df(r),r.tag){case 3:Wr(Dt),An();break;case 26:case 27:case 5:ci(r);break;case 4:An();break;case 31:r.memoizedState!==null&&jn(r);break;case 13:jn(r);break;case 19:ze(At);break;case 10:Wr(r.type);break;case 22:case 23:jn(r),Xf(),t!==null&&ze(Ai);break;case 24:Wr(Dt)}}function Ys(t,r){try{var i=r.updateQueue,l=i===null?null:i.lastEffect;if(l!==null){var d=l.next;i=d;do{if((i.tag&t)===t){l=void 0;var m=i.create,k=i.inst;l=m(),k.destroy=l}i=i.next}while(i!==d)}}catch(L){at(r,r.return,L)}}function Pa(t,r,i){try{var l=r.updateQueue,d=l===null?null:l.lastEffect;if(d!==null){var m=d.next;l=m;do{if((l.tag&t)===t){var k=l.inst,L=k.destroy;if(L!==void 0){k.destroy=void 0,d=r;var q=i,J=L;try{J()}catch(oe){at(d,q,oe)}}}l=l.next}while(l!==m)}}catch(oe){at(r,r.return,oe)}}function Yv(t){var r=t.updateQueue;if(r!==null){var i=t.stateNode;try{Wy(r,i)}catch(l){at(t,t.return,l)}}}function Zv(t,r,i){i.props=ji(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(l){at(t,r,l)}}function Zs(t,r){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof i=="function"?t.refCleanup=i(l):i.current=l}}catch(d){at(t,r,d)}}function Or(t,r){var i=t.ref,l=t.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(d){at(t,r,d)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(d){at(t,r,d)}else i.current=null}function eb(t){var r=t.type,i=t.memoizedProps,l=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(d){at(t,t.return,d)}}function Op(t,r,i){try{var l=t.stateNode;c6(l,t.type,i,r),l[Yt]=r}catch(d){at(t,t.return,d)}}function tb(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Fa(t.type)||t.tag===4}function Ap(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||tb(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Fa(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ip(t,r,i){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,r):(r=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,r.appendChild(t),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=$n));else if(l!==4&&(l===27&&Fa(t.type)&&(i=t.stateNode,r=null),t=t.child,t!==null))for(Ip(t,r,i),t=t.sibling;t!==null;)Ip(t,r,i),t=t.sibling}function Gc(t,r,i){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?i.insertBefore(t,r):i.appendChild(t);else if(l!==4&&(l===27&&Fa(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(Gc(t,r,i),t=t.sibling;t!==null;)Gc(t,r,i),t=t.sibling}function nb(t){var r=t.stateNode,i=t.memoizedProps;try{for(var l=t.type,d=r.attributes;d.length;)r.removeAttributeNode(d[0]);nn(r,l,i),r[Ft]=t,r[Yt]=i}catch(m){at(t,t.return,m)}}var Jr=!1,qt=!1,Rp=!1,rb=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function $4(t,r){if(t=t.containerInfo,Yp=gu,t=vy(t),Cf(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var d=l.anchorOffset,m=l.focusNode;l=l.focusOffset;try{i.nodeType,m.nodeType}catch{i=null;break e}var k=0,L=-1,q=-1,J=0,oe=0,ue=t,Y=null;t:for(;;){for(var ae;ue!==i||d!==0&&ue.nodeType!==3||(L=k+d),ue!==m||l!==0&&ue.nodeType!==3||(q=k+l),ue.nodeType===3&&(k+=ue.nodeValue.length),(ae=ue.firstChild)!==null;)Y=ue,ue=ae;for(;;){if(ue===t)break t;if(Y===i&&++J===d&&(L=k),Y===m&&++oe===l&&(q=k),(ae=ue.nextSibling)!==null)break;ue=Y,Y=ue.parentNode}ue=ae}i=L===-1||q===-1?null:{start:L,end:q}}else i=null}i||(i={start:0,end:0})}else i=null;for(Zp={focusedElem:t,selectionRange:i},gu=!1,Gt=r;Gt!==null;)if(r=Gt,t=r.child,r.subtreeFlags&1028&&t!==null)t.return=r,Gt=t;else for(;Gt!==null;){switch(r=Gt,m=r.alternate,t=r.flags,r.tag){case 0:if(t&4&&(t=r.updateQueue,t=t===null?null:t.events,t!==null))for(i=0;i<t.length;i++)d=t[i],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if(t&1024&&m!==null){t=void 0,i=r,d=m.memoizedProps,m=m.memoizedState,l=i.stateNode;try{var _e=ji(i.type,d);t=l.getSnapshotBeforeUpdate(_e,m),l.__reactInternalSnapshotBeforeUpdate=t}catch(Te){at(i,i.return,Te)}}break;case 3:if(t&1024){if(t=r.stateNode.containerInfo,i=t.nodeType,i===9)nh(t);else if(i===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":nh(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(t&1024)throw Error(s(163))}if(t=r.sibling,t!==null){t.return=r.return,Gt=t;break}Gt=r.return}}function ab(t,r,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:Yr(t,i),l&4&&Ys(5,i);break;case 1:if(Yr(t,i),l&4)if(t=i.stateNode,r===null)try{t.componentDidMount()}catch(k){at(i,i.return,k)}else{var d=ji(i.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(d,r,t.__reactInternalSnapshotBeforeUpdate)}catch(k){at(i,i.return,k)}}l&64&&Yv(i),l&512&&Zs(i,i.return);break;case 3:if(Yr(t,i),l&64&&(t=i.updateQueue,t!==null)){if(r=null,i.child!==null)switch(i.child.tag){case 27:case 5:r=i.child.stateNode;break;case 1:r=i.child.stateNode}try{Wy(t,r)}catch(k){at(i,i.return,k)}}break;case 27:r===null&&l&4&&nb(i);case 26:case 5:Yr(t,i),r===null&&l&4&&eb(i),l&512&&Zs(i,i.return);break;case 12:Yr(t,i);break;case 31:Yr(t,i),l&4&&sb(t,i);break;case 13:Yr(t,i),l&4&&lb(t,i),l&64&&(t=i.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(i=Z4.bind(null,i),y6(t,i))));break;case 22:if(l=i.memoizedState!==null||Jr,!l){r=r!==null&&r.memoizedState!==null||qt,d=Jr;var m=qt;Jr=l,(qt=r)&&!m?Zr(t,i,(i.subtreeFlags&8772)!=0):Yr(t,i),Jr=d,qt=m}break;case 30:break;default:Yr(t,i)}}function ib(t){var r=t.alternate;r!==null&&(t.alternate=null,ib(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&go(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var xt=null,_n=!1;function Xr(t,r,i){for(i=i.child;i!==null;)ob(t,r,i),i=i.sibling}function ob(t,r,i){if(on&&typeof on.onCommitFiberUnmount=="function")try{on.onCommitFiberUnmount(ui,i)}catch{}switch(i.tag){case 26:qt||Or(i,r),Xr(t,r,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:qt||Or(i,r);var l=xt,d=_n;Fa(i.type)&&(xt=i.stateNode,_n=!1),Xr(t,r,i),ll(i.stateNode),xt=l,_n=d;break;case 5:qt||Or(i,r);case 6:if(l=xt,d=_n,xt=null,Xr(t,r,i),xt=l,_n=d,xt!==null)if(_n)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(i.stateNode)}catch(m){at(i,r,m)}else try{xt.removeChild(i.stateNode)}catch(m){at(i,r,m)}break;case 18:xt!==null&&(_n?(t=xt,Zb(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,i.stateNode),Jo(t)):Zb(xt,i.stateNode));break;case 4:l=xt,d=_n,xt=i.stateNode.containerInfo,_n=!0,Xr(t,r,i),xt=l,_n=d;break;case 0:case 11:case 14:case 15:Pa(2,i,r),qt||Pa(4,i,r),Xr(t,r,i);break;case 1:qt||(Or(i,r),l=i.stateNode,typeof l.componentWillUnmount=="function"&&Zv(i,r,l)),Xr(t,r,i);break;case 21:Xr(t,r,i);break;case 22:qt=(l=qt)||i.memoizedState!==null,Xr(t,r,i),qt=l;break;default:Xr(t,r,i)}}function sb(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Jo(t)}catch(i){at(r,r.return,i)}}}function lb(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Jo(t)}catch(i){at(r,r.return,i)}}function W4(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new rb),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new rb),r;default:throw Error(s(435,t.tag))}}function Jc(t,r){var i=W4(t);r.forEach(function(l){if(!i.has(l)){i.add(l);var d=e6.bind(null,t,l);l.then(d,d)}})}function xn(t,r){var i=r.deletions;if(i!==null)for(var l=0;l<i.length;l++){var d=i[l],m=t,k=r,L=k;e:for(;L!==null;){switch(L.tag){case 27:if(Fa(L.type)){xt=L.stateNode,_n=!1;break e}break;case 5:xt=L.stateNode,_n=!1;break e;case 3:case 4:xt=L.stateNode.containerInfo,_n=!0;break e}L=L.return}if(xt===null)throw Error(s(160));ob(m,k,d),xt=null,_n=!1,m=d.alternate,m!==null&&(m.return=null),d.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)cb(r,t),r=r.sibling}var gr=null;function cb(t,r){var i=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:xn(r,t),kn(t),l&4&&(Pa(3,t,t.return),Ys(3,t),Pa(5,t,t.return));break;case 1:xn(r,t),kn(t),l&512&&(qt||i===null||Or(i,i.return)),l&64&&Jr&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(i=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var d=gr;if(xn(r,t),kn(t),l&512&&(qt||i===null||Or(i,i.return)),l&4){var m=i===null?null:i.memoizedState;if(l=t.memoizedState,i===null)if(l===null)if(t.stateNode===null){e:{l=t.type,i=t.memoizedProps,d=d.ownerDocument||d;t:switch(l){case"title":m=d.getElementsByTagName("title")[0],(!m||m[pi]||m[Ft]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=d.createElement(l),d.head.insertBefore(m,d.querySelector("head > title"))),nn(m,l,i),m[Ft]=t,Ot(m),l=m;break e;case"link":var k=u2("link","href",d).get(l+(i.href||""));if(k){for(var L=0;L<k.length;L++)if(m=k[L],m.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&m.getAttribute("rel")===(i.rel==null?null:i.rel)&&m.getAttribute("title")===(i.title==null?null:i.title)&&m.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){k.splice(L,1);break t}}m=d.createElement(l),nn(m,l,i),d.head.appendChild(m);break;case"meta":if(k=u2("meta","content",d).get(l+(i.content||""))){for(L=0;L<k.length;L++)if(m=k[L],m.getAttribute("content")===(i.content==null?null:""+i.content)&&m.getAttribute("name")===(i.name==null?null:i.name)&&m.getAttribute("property")===(i.property==null?null:i.property)&&m.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&m.getAttribute("charset")===(i.charSet==null?null:i.charSet)){k.splice(L,1);break t}}m=d.createElement(l),nn(m,l,i),d.head.appendChild(m);break;default:throw Error(s(468,l))}m[Ft]=t,Ot(m),l=m}t.stateNode=l}else d2(d,t.type,t.stateNode);else t.stateNode=c2(d,l,t.memoizedProps);else m===l?l===null&&t.stateNode!==null&&Op(t,t.memoizedProps,i.memoizedProps):(m===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):m.count--,l===null?d2(d,t.type,t.stateNode):c2(d,l,t.memoizedProps))}break;case 27:xn(r,t),kn(t),l&512&&(qt||i===null||Or(i,i.return)),i!==null&&l&4&&Op(t,t.memoizedProps,i.memoizedProps);break;case 5:if(xn(r,t),kn(t),l&512&&(qt||i===null||Or(i,i.return)),t.flags&32){d=t.stateNode;try{qr(d,"")}catch(_e){at(t,t.return,_e)}}l&4&&t.stateNode!=null&&(d=t.memoizedProps,Op(t,d,i===null?d:i.memoizedProps)),l&1024&&(Rp=!0);break;case 6:if(xn(r,t),kn(t),l&4){if(t.stateNode===null)throw Error(s(162));l=t.memoizedProps,i=t.stateNode;try{i.nodeValue=l}catch(_e){at(t,t.return,_e)}}break;case 3:if(fu=null,d=gr,gr=uu(r.containerInfo),xn(r,t),gr=d,kn(t),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Jo(r.containerInfo)}catch(_e){at(t,t.return,_e)}Rp&&(Rp=!1,ub(t));break;case 4:l=gr,gr=uu(t.stateNode.containerInfo),xn(r,t),kn(t),gr=l;break;case 12:xn(r,t),kn(t);break;case 31:xn(r,t),kn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Jc(t,l)));break;case 13:xn(r,t),kn(t),t.child.flags&8192&&t.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Yc=Jt()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Jc(t,l)));break;case 22:d=t.memoizedState!==null;var q=i!==null&&i.memoizedState!==null,J=Jr,oe=qt;if(Jr=J||d,qt=oe||q,xn(r,t),qt=oe,Jr=J,kn(t),l&8192)e:for(r=t.stateNode,r._visibility=d?r._visibility&-2:r._visibility|1,d&&(i===null||q||Jr||qt||zi(t)),i=null,r=t;;){if(r.tag===5||r.tag===26){if(i===null){q=i=r;try{if(m=q.stateNode,d)k=m.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{L=q.stateNode;var ue=q.memoizedProps.style,Y=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;L.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(_e){at(q,q.return,_e)}}}else if(r.tag===6){if(i===null){q=r;try{q.stateNode.nodeValue=d?"":q.memoizedProps}catch(_e){at(q,q.return,_e)}}}else if(r.tag===18){if(i===null){q=r;try{var ae=q.stateNode;d?e2(ae,!0):e2(q.stateNode,!1)}catch(_e){at(q,q.return,_e)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;i===r&&(i=null),r=r.return}i===r&&(i=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=t.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,Jc(t,i))));break;case 19:xn(r,t),kn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Jc(t,l)));break;case 30:break;case 21:break;default:xn(r,t),kn(t)}}function kn(t){var r=t.flags;if(r&2){try{for(var i,l=t.return;l!==null;){if(tb(l)){i=l;break}l=l.return}if(i==null)throw Error(s(160));switch(i.tag){case 27:var d=i.stateNode;Gc(t,Ap(t),d);break;case 5:var m=i.stateNode;i.flags&32&&(qr(m,""),i.flags&=-33),Gc(t,Ap(t),m);break;case 3:case 4:var k=i.stateNode.containerInfo;Ip(t,Ap(t),k);break;default:throw Error(s(161))}}catch(L){at(t,t.return,L)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function ub(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;ub(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Yr(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)ab(t,r.alternate,r),r=r.sibling}function zi(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:Pa(4,r,r.return),zi(r);break;case 1:Or(r,r.return);var i=r.stateNode;typeof i.componentWillUnmount=="function"&&Zv(r,r.return,i),zi(r);break;case 27:ll(r.stateNode);case 26:case 5:Or(r,r.return),zi(r);break;case 22:r.memoizedState===null&&zi(r);break;case 30:zi(r);break;default:zi(r)}t=t.sibling}}function Zr(t,r,i){for(i&&(i=(r.subtreeFlags&8772)!=0),r=r.child;r!==null;){var l=r.alternate,d=t,m=r,k=m.flags;switch(m.tag){case 0:case 11:case 15:Zr(d,m,i),Ys(4,m);break;case 1:if(Zr(d,m,i),l=m,d=l.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(J){at(l,l.return,J)}if(l=m,d=l.updateQueue,d!==null){var L=l.stateNode;try{var q=d.shared.hiddenCallbacks;if(q!==null)for(d.shared.hiddenCallbacks=null,d=0;d<q.length;d++)$y(q[d],L)}catch(J){at(l,l.return,J)}}i&&k&64&&Yv(m),Zs(m,m.return);break;case 27:nb(m);case 26:case 5:Zr(d,m,i),i&&l===null&&k&4&&eb(m),Zs(m,m.return);break;case 12:Zr(d,m,i);break;case 31:Zr(d,m,i),i&&k&4&&sb(d,m);break;case 13:Zr(d,m,i),i&&k&4&&lb(d,m);break;case 22:m.memoizedState===null&&Zr(d,m,i),Zs(m,m.return);break;case 30:break;default:Zr(d,m,i)}r=r.sibling}}function Mp(t,r){var i=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==i&&(t!=null&&t.refCount++,i!=null&&qs(i))}function Pp(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&qs(t))}function yr(t,r,i,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)db(t,r,i,l),r=r.sibling}function db(t,r,i,l){var d=r.flags;switch(r.tag){case 0:case 11:case 15:yr(t,r,i,l),d&2048&&Ys(9,r);break;case 1:yr(t,r,i,l);break;case 3:yr(t,r,i,l),d&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&qs(t)));break;case 12:if(d&2048){yr(t,r,i,l),t=r.stateNode;try{var m=r.memoizedProps,k=m.id,L=m.onPostCommit;typeof L=="function"&&L(k,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(q){at(r,r.return,q)}}else yr(t,r,i,l);break;case 31:yr(t,r,i,l);break;case 13:yr(t,r,i,l);break;case 23:break;case 22:m=r.stateNode,k=r.alternate,r.memoizedState===null?m._visibility&2?yr(t,r,i,l):(m._visibility|=2,qo(t,r,i,l,(r.subtreeFlags&10256)!=0||!1)):m._visibility&2?yr(t,r,i,l):el(t,r),d&2048&&Mp(k,r);break;case 24:yr(t,r,i,l),d&2048&&Pp(r.alternate,r);break;default:yr(t,r,i,l)}}function qo(t,r,i,l,d){for(d&&(d=(r.subtreeFlags&10256)!=0||!1),r=r.child;r!==null;){var m=t,k=r,L=i,q=l,J=k.flags;switch(k.tag){case 0:case 11:case 15:qo(m,k,L,q,d),Ys(8,k);break;case 23:break;case 22:var oe=k.stateNode;k.memoizedState===null?(oe._visibility|=2,qo(m,k,L,q,d)):oe._visibility&2?qo(m,k,L,q,d):el(m,k),d&&J&2048&&Mp(k.alternate,k);break;case 24:qo(m,k,L,q,d),d&&J&2048&&Pp(k.alternate,k);break;default:qo(m,k,L,q,d)}r=r.sibling}}function el(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var i=t,l=r,d=l.flags;switch(l.tag){case 22:el(i,l),d&2048&&Mp(l.alternate,l);break;case 24:el(i,l),d&2048&&Pp(l.alternate,l);break;default:el(i,l)}r=r.sibling}}var tl=8192;function Bo(t,r,i){if(t.subtreeFlags&tl)for(t=t.child;t!==null;)fb(t,r,i),t=t.sibling}function fb(t,r,i){switch(t.tag){case 26:Bo(t,r,i),t.flags&tl&&t.memoizedState!==null&&O6(i,gr,t.memoizedState,t.memoizedProps);break;case 5:Bo(t,r,i);break;case 3:case 4:var l=gr;gr=uu(t.stateNode.containerInfo),Bo(t,r,i),gr=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=tl,tl=16777216,Bo(t,r,i),tl=l):Bo(t,r,i));break;default:Bo(t,r,i)}}function pb(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function nl(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var i=0;i<r.length;i++){var l=r[i];Gt=l,mb(l,t)}pb(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)hb(t),t=t.sibling}function hb(t){switch(t.tag){case 0:case 11:case 15:nl(t),t.flags&2048&&Pa(9,t,t.return);break;case 3:nl(t);break;case 12:nl(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Xc(t)):nl(t);break;default:nl(t)}}function Xc(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var i=0;i<r.length;i++){var l=r[i];Gt=l,mb(l,t)}pb(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:Pa(8,r,r.return),Xc(r);break;case 22:i=r.stateNode,i._visibility&2&&(i._visibility&=-3,Xc(r));break;default:Xc(r)}t=t.sibling}}function mb(t,r){for(;Gt!==null;){var i=Gt;switch(i.tag){case 0:case 11:case 15:Pa(8,i,r);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:qs(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,Gt=l;else e:for(i=t;Gt!==null;){l=Gt;var d=l.sibling,m=l.return;if(ib(l),l===i){Gt=null;break e}if(d!==null){d.return=m,Gt=d;break e}Gt=m}}}var U4={getCacheForType:function(t){var r=en(Dt),i=r.data.get(t);return i===void 0&&(i=t(),r.data.set(t,i)),i},cacheSignal:function(){return en(Dt).controller.signal}},K4=typeof WeakMap=="function"?WeakMap:Map,Ze=0,dt=null,qe=null,$e=0,rt=0,zn=null,Na=!1,Fo=!1,Np=!1,ea=0,Ct=0,Da=0,qi=0,Dp=0,qn=0,Vo=0,rl=null,Sn=null,jp=!1,Yc=0,gb=0,Zc=1/0,eu=null,ja=null,Ht=0,za=null,Ho=null,ta=0,zp=0,qp=null,yb=null,al=0,Bp=null;function Jn(){return Ze&2&&$e!==0?$e&-$e:ee.T===null?sc():Up()}function vb(){if(qn===0)if(!($e&536870912)||Ke){var t=Lt;Lt<<=1,!(Lt&3932160)&&(Lt=262144),qn=t}else qn=536870912;return t=Dn.current,t!==null&&(t.flags|=32),qn}function Cn(t,r,i){(t===dt&&(rt===2||rt===9)||t.cancelPendingCommit!==null)&&($o(t,0),qa(t,$e,qn,!1)),fi(t,i),(!(Ze&2)||t!==dt)&&(t===dt&&(!(Ze&2)&&(qi|=i),Ct===4&&qa(t,$e,qn,!1)),na(t))}function bb(t,r,i){if(Ze&6)throw Error(s(327));var l=!i&&(r&127)==0&&(r&t.expiredLanes)===0||ba(t,r),d=l?J4(t,r):Vp(t,r,!0),m=l;do{if(d===0){Fo&&!l&&qa(t,r,0,!1);break}else{if(i=t.current.alternate,m&&!Q4(i)){d=Vp(t,r,!1),m=!1;continue}if(d===2){if(m=r,t.errorRecoveryDisabledLanes&m)var k=0;else k=t.pendingLanes&-536870913,k=k===0?k&536870912?536870912:0:k;if(k!==0){r=k;e:{var L=t;d=rl;var q=L.current.memoizedState.isDehydrated;if(q&&($o(L,k).flags|=256),k=Vp(L,k,!1),k!==2){if(Np&&!q){L.errorRecoveryDisabledLanes|=m,qi|=m,d=4;break e}m=Sn,Sn=d,m!==null&&(Sn===null?Sn=m:Sn.push.apply(Sn,m))}d=k}if(m=!1,d!==2)continue}}if(d===1){$o(t,0),qa(t,r,0,!0);break}e:{switch(l=t,m=d,m){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:qa(l,r,qn,!Na);break e;case 2:Sn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(d=Yc+300-Jt(),10<d)){if(qa(l,r,qn,!Na),ho(l,0,!0)!==0)break e;ta=r,l.timeoutHandle=Xb(wb.bind(null,l,i,Sn,eu,jp,r,qn,qi,Vo,Na,m,"Throttled",-0,0),d);break e}wb(l,i,Sn,eu,jp,r,qn,qi,Vo,Na,m,null,-0,0)}}break}while(!0);na(t)}function wb(t,r,i,l,d,m,k,L,q,J,oe,ue,Y,ae){if(t.timeoutHandle=-1,ue=r.subtreeFlags,ue&8192||(ue&16785408)==16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$n},fb(r,m,ue);var _e=(m&62914560)===m?Yc-Jt():(m&4194048)===m?gb-Jt():0;if(_e=A6(ue,_e),_e!==null){ta=m,t.cancelPendingCommit=_e(Lb.bind(null,t,r,m,i,l,d,k,L,q,oe,ue,null,Y,ae)),qa(t,m,k,!J);return}}Lb(t,r,m,i,l,d,k,L,q)}function Q4(t){for(var r=t;;){var i=r.tag;if((i===0||i===11||i===15)&&r.flags&16384&&(i=r.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var d=i[l],m=d.getSnapshot;d=d.value;try{if(!Pn(m(),d))return!1}catch{return!1}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function qa(t,r,i,l){r&=~Dp,r&=~qi,t.suspendedLanes|=r,t.pingedLanes&=~r,l&&(t.warmLanes|=r),l=t.expirationTimes;for(var d=r;0<d;){var m=31-mt(d),k=1<<m;l[m]=-1,d&=~k}i!==0&&jr(t,i,r)}function tu(){return Ze&6?!0:(il(0,!1),!1)}function Fp(){if(qe!==null){if(rt===0)var t=qe.return;else t=qe,$r=Li=null,rp(t),Po=null,Fs=0,t=qe;for(;t!==null;)Xv(t.alternate,t),t=t.return;qe=null}}function $o(t,r){var i=t.timeoutHandle;i!==-1&&(t.timeoutHandle=-1,f6(i)),i=t.cancelPendingCommit,i!==null&&(t.cancelPendingCommit=null,i()),ta=0,Fp(),dt=t,qe=i=Vr(t.current,null),$e=r,rt=0,zn=null,Na=!1,Fo=ba(t,r),Np=!1,Vo=qn=Dp=qi=Da=Ct=0,Sn=rl=null,jp=!1,r&8&&(r|=r&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=r;0<l;){var d=31-mt(l),m=1<<d;r|=t[d],l&=~m}return ea=r,xc(),i}function _b(t,r){Pe=null,ee.H=Gs,r===Mo||r===Ac?(r=By(),rt=3):r===Wf?(r=By(),rt=4):rt=r===bp?8:typeof r=="object"&&r&&typeof r.then=="function"?6:1,zn=r,qe===null&&(Ct=1,$c(t,Un(r,t.current)))}function xb(){var t=Dn.current;return t===null?!0:($e&4194048)===$e?mr===null:($e&62914560)===$e||$e&536870912?t===mr:!1}function kb(){var t=ee.H;return ee.H=Gs,t===null?Gs:t}function Sb(){var t=ee.A;return ee.A=U4,t}function nu(){Ct=4,Na||($e&4194048)!==$e&&Dn.current!==null||(Fo=!0),!(Da&134217727)&&!(qi&134217727)||dt===null||qa(dt,$e,qn,!1)}function Vp(t,r,i){var l=Ze;Ze|=2;var d=kb(),m=Sb();(dt!==t||$e!==r)&&(eu=null,$o(t,r)),r=!1;var k=Ct;e:do try{if(rt!==0&&qe!==null){var L=qe,q=zn;switch(rt){case 8:Fp(),k=6;break e;case 3:case 2:case 9:case 6:Dn.current===null&&(r=!0);var J=rt;if(rt=0,zn=null,Wo(t,L,q,J),i&&Fo){k=0;break e}break;default:J=rt,rt=0,zn=null,Wo(t,L,q,J)}}G4(),k=Ct;break}catch(oe){_b(t,oe)}while(!0);return r&&t.shellSuspendCounter++,$r=Li=null,Ze=l,ee.H=d,ee.A=m,qe===null&&(dt=null,$e=0,xc()),k}function G4(){for(;qe!==null;)Cb(qe)}function J4(t,r){var i=Ze;Ze|=2;var l=kb(),d=Sb();dt!==t||$e!==r?(eu=null,Zc=Jt()+500,$o(t,r)):Fo=ba(t,r);e:do try{if(rt!==0&&qe!==null){r=qe;var m=zn;t:switch(rt){case 1:rt=0,zn=null,Wo(t,r,m,1);break;case 2:case 9:if(zy(m)){rt=0,zn=null,Eb(r);break}r=function(){rt!==2&&rt!==9||dt!==t||(rt=7),na(t)},m.then(r,r);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:zy(m)?(rt=0,zn=null,Eb(r)):(rt=0,zn=null,Wo(t,r,m,7));break;case 5:var k=null;switch(qe.tag){case 26:k=qe.memoizedState;case 5:case 27:var L=qe;if(k?f2(k):L.stateNode.complete){rt=0,zn=null;var q=L.sibling;if(q!==null)qe=q;else{var J=L.return;J===null?qe=null:(qe=J,ru(J))}break t}}rt=0,zn=null,Wo(t,r,m,5);break;case 6:rt=0,zn=null,Wo(t,r,m,6);break;case 8:Fp(),Ct=6;break e;default:throw Error(s(462))}}X4();break}catch(oe){_b(t,oe)}while(!0);return $r=Li=null,ee.H=l,ee.A=d,Ze=i,qe===null?(dt=null,$e=0,xc(),Ct):0}function X4(){for(;qe!==null&&!hf();)Cb(qe)}function Cb(t){var r=Gv(t.alternate,t,ea);t.memoizedProps=t.pendingProps,r===null?ru(t):qe=r}function Eb(t){var r=t,i=r.alternate;switch(r.tag){case 15:case 0:r=Hv(i,r,r.pendingProps,r.type,void 0,$e);break;case 11:r=Hv(i,r,r.pendingProps,r.type.render,r.ref,$e);break;case 5:rp(r);default:Xv(i,r),r=qe=Ty(r,ea),r=Gv(i,r,ea)}t.memoizedProps=t.pendingProps,r===null?ru(t):qe=r}function Wo(t,r,i,l){$r=Li=null,rp(r),Po=null,Fs=0;var d=r.return;try{if(q4(t,d,r,i,$e)){Ct=1,$c(t,Un(i,t.current)),qe=null;return}}catch(m){if(d!==null)throw qe=d,m;Ct=1,$c(t,Un(i,t.current)),qe=null;return}r.flags&32768?(Ke||l===1?t=!0:Fo||$e&536870912?t=!1:(Na=t=!0,(l===2||l===9||l===3||l===6)&&(l=Dn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Tb(r,t)):ru(r)}function ru(t){var r=t;do{if(r.flags&32768){Tb(r,Na);return}t=r.return;var i=V4(r.alternate,r,ea);if(i!==null){qe=i;return}if(r=r.sibling,r!==null){qe=r;return}qe=r=t}while(r!==null);Ct===0&&(Ct=5)}function Tb(t,r){do{var i=H4(t.alternate,t);if(i!==null){i.flags&=32767,qe=i;return}if(i=t.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!r&&(t=t.sibling,t!==null)){qe=t;return}qe=t=i}while(t!==null);Ct=6,qe=null}function Lb(t,r,i,l,d,m,k,L,q){t.cancelPendingCommit=null;do au();while(Ht!==0);if(Ze&6)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(m=r.lanes|r.childLanes,m|=Af,vf(t,i,m,k,L,q),t===dt&&(qe=dt=null,$e=0),Ho=r,za=t,ta=i,zp=m,qp=d,yb=l,r.subtreeFlags&10256||r.flags&10256?(t.callbackNode=null,t.callbackPriority=0,t6(Pt,function(){return Mb(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(r.flags&13878)!=0,r.subtreeFlags&13878||l){l=ee.T,ee.T=null,d=U.p,U.p=2,k=Ze,Ze|=4;try{$4(t,r,i)}finally{Ze=k,U.p=d,ee.T=l}}Ht=1,Ob(),Ab(),Ib()}}function Ob(){if(Ht===1){Ht=0;var t=za,r=Ho,i=(r.flags&13878)!=0;if(r.subtreeFlags&13878||i){i=ee.T,ee.T=null;var l=U.p;U.p=2;var d=Ze;Ze|=4;try{cb(r,t);var m=Zp,k=vy(t.containerInfo),L=m.focusedElem,q=m.selectionRange;if(k!==L&&L&&L.ownerDocument&&yy(L.ownerDocument.documentElement,L)){if(q!==null&&Cf(L)){var J=q.start,oe=q.end;if(oe===void 0&&(oe=J),"selectionStart"in L)L.selectionStart=J,L.selectionEnd=Math.min(oe,L.value.length);else{var ue=L.ownerDocument||document,Y=ue&&ue.defaultView||window;if(Y.getSelection){var ae=Y.getSelection(),_e=L.textContent.length,Te=Math.min(q.start,_e),st=q.end===void 0?Te:Math.min(q.end,_e);!ae.extend&&Te>st&&(k=st,st=Te,Te=k);var W=gy(L,Te),B=gy(L,st);if(W&&B&&(ae.rangeCount!==1||ae.anchorNode!==W.node||ae.anchorOffset!==W.offset||ae.focusNode!==B.node||ae.focusOffset!==B.offset)){var G=ue.createRange();G.setStart(W.node,W.offset),ae.removeAllRanges(),Te>st?(ae.addRange(G),ae.extend(B.node,B.offset)):(G.setEnd(B.node,B.offset),ae.addRange(G))}}}}for(ue=[],ae=L;ae=ae.parentNode;)ae.nodeType===1&&ue.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<ue.length;L++){var le=ue[L];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}gu=!!Yp,Zp=Yp=null}finally{Ze=d,U.p=l,ee.T=i}}t.current=r,Ht=2}}function Ab(){if(Ht===2){Ht=0;var t=za,r=Ho,i=(r.flags&8772)!=0;if(r.subtreeFlags&8772||i){i=ee.T,ee.T=null;var l=U.p;U.p=2;var d=Ze;Ze|=4;try{ab(t,r.alternate,r)}finally{Ze=d,U.p=l,ee.T=i}}Ht=3}}function Ib(){if(Ht===4||Ht===3){Ht=0,nc();var t=za,r=Ho,i=ta,l=yb;r.subtreeFlags&10256||r.flags&10256?Ht=5:(Ht=0,Ho=za=null,Rb(t,t.pendingLanes));var d=t.pendingLanes;if(d===0&&(ja=null),xs(i),r=r.stateNode,on&&typeof on.onCommitFiberRoot=="function")try{on.onCommitFiberRoot(ui,r,void 0,(r.current.flags&128)==128)}catch{}if(l!==null){r=ee.T,d=U.p,U.p=2,ee.T=null;try{for(var m=t.onRecoverableError,k=0;k<l.length;k++){var L=l[k];m(L.value,{componentStack:L.stack})}}finally{ee.T=r,U.p=d}}ta&3&&au(),na(t),d=t.pendingLanes,i&261930&&d&42?t===Bp?al++:(al=0,Bp=t):al=0,il(0,!1)}}function Rb(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,qs(r)))}function au(){return Ob(),Ab(),Ib(),Mb()}function Mb(){if(Ht!==5)return!1;var t=za,r=zp;zp=0;var i=xs(ta),l=ee.T,d=U.p;try{U.p=32>i?32:i,ee.T=null,i=qp,qp=null;var m=za,k=ta;if(Ht=0,Ho=za=null,ta=0,Ze&6)throw Error(s(331));var L=Ze;if(Ze|=4,hb(m.current),db(m,m.current,k,i),Ze=L,il(0,!1),on&&typeof on.onPostCommitFiberRoot=="function")try{on.onPostCommitFiberRoot(ui,m)}catch{}return!0}finally{U.p=d,ee.T=l,Rb(t,r)}}function Pb(t,r,i){r=Un(i,r),r=vp(t.stateNode,r,2),t=Ni(t,r,2),t!==null&&(fi(t,2),na(t))}function at(t,r,i){if(t.tag===3)Pb(t,t,i);else for(;r!==null;){if(r.tag===3){Pb(r,t,i);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ja===null||!ja.has(l))){t=Un(i,t),i=Nv(2),l=Ni(r,i,2),l!==null&&(Dv(i,l,r,t),fi(l,2),na(l));break}}r=r.return}}function Hp(t,r,i){var l=t.pingCache;if(l===null){l=t.pingCache=new K4;var d=new Set;l.set(r,d)}else d=l.get(r),d===void 0&&(d=new Set,l.set(r,d));d.has(i)||(Np=!0,d.add(i),t=Y4.bind(null,t,r,i),r.then(t,t))}function Y4(t,r,i){var l=t.pingCache;l!==null&&l.delete(r),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,dt===t&&($e&i)===i&&(Ct===4||Ct===3&&($e&62914560)===$e&&300>Jt()-Yc?!(Ze&2)&&$o(t,0):Dp|=i,Vo===$e&&(Vo=0)),na(t)}function Nb(t,r){r===0&&(r=ic()),t=Ci(t,r),t!==null&&(fi(t,r),na(t))}function Z4(t){var r=t.memoizedState,i=0;r!==null&&(i=r.retryLane),Nb(t,i)}function e6(t,r){var i=0;switch(t.tag){case 31:case 13:var l=t.stateNode,d=t.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(r),Nb(t,i)}function t6(t,r){return ur(t,r)}var iu=null,Uo=null,$p=!1,ou=!1,Wp=!1,Ba=0;function na(t){t!==Uo&&t.next===null&&(Uo===null?iu=Uo=t:Uo=Uo.next=t),ou=!0,$p||($p=!0,r6())}function il(t,r){if(!Wp&&ou){Wp=!0;do for(var i=!1,l=iu;l!==null;){if(!r)if(t!==0){var d=l.pendingLanes;if(d===0)var m=0;else{var k=l.suspendedLanes,L=l.pingedLanes;m=(1<<31-mt(42|t)+1)-1,m&=d&~(k&~L),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(i=!0,qb(l,m))}else m=$e,m=ho(l,l===dt?m:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),!(m&3)||ba(l,m)||(i=!0,qb(l,m));l=l.next}while(i);Wp=!1}}function n6(){Db()}function Db(){ou=$p=!1;var t=0;Ba!==0&&d6()&&(t=Ba);for(var r=Jt(),i=null,l=iu;l!==null;){var d=l.next,m=jb(l,r);m===0?(l.next=null,i===null?iu=d:i.next=d,d===null&&(Uo=i)):(i=l,(t!==0||m&3)&&(ou=!0)),l=d}Ht!==0&&Ht!==5||il(t,!1),Ba!==0&&(Ba=0)}function jb(t,r){for(var i=t.suspendedLanes,l=t.pingedLanes,d=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var k=31-mt(m),L=1<<k,q=d[k];q===-1?((L&i)===0||(L&l)!==0)&&(d[k]=ac(L,r)):q<=r&&(t.expiredLanes|=L),m&=~L}if(r=dt,i=$e,i=ho(t,t===r?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,i===0||t===r&&(rt===2||rt===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&bn(l),t.callbackNode=null,t.callbackPriority=0;if(!(i&3)||ba(t,i)){if(r=i&-i,r===t.callbackPriority)return r;switch(l!==null&&bn(l),xs(i)){case 2:case 8:i=rc;break;case 32:i=Pt;break;case 268435456:i=kt;break;default:i=Pt}return l=zb.bind(null,t),i=ur(i,l),t.callbackPriority=r,t.callbackNode=i,r}return l!==null&&l!==null&&bn(l),t.callbackPriority=2,t.callbackNode=null,2}function zb(t,r){if(Ht!==0&&Ht!==5)return t.callbackNode=null,t.callbackPriority=0,null;var i=t.callbackNode;if(au()&&t.callbackNode!==i)return null;var l=$e;return l=ho(t,t===dt?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(bb(t,l,r),jb(t,Jt()),t.callbackNode!=null&&t.callbackNode===i?zb.bind(null,t):null)}function qb(t,r){if(au())return null;bb(t,r,!0)}function r6(){p6(function(){Ze&6?ur(Nr,n6):Db()})}function Up(){if(Ba===0){var t=Io;t===0&&(t=di,di<<=1,!(di&261888)&&(di=256)),Ba=t}return Ba}function Bb(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:bo(""+t)}function Fb(t,r){var i=r.ownerDocument.createElement("input");return i.name=r.name,i.value=r.value,t.id&&i.setAttribute("form",t.id),r.parentNode.insertBefore(i,r),t=new FormData(t),i.parentNode.removeChild(i),t}function a6(t,r,i,l,d){if(r==="submit"&&i&&i.stateNode===d){var m=Bb((d[Yt]||null).action),k=l.submitter;k&&(r=(r=k[Yt]||null)?Bb(r.formAction):k.getAttribute("formAction"),r!==null&&(m=r,k=null));var L=new u("action","action",null,l,d);t.push({event:L,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ba!==0){var q=k?Fb(d,k):new FormData(d);fp(i,{pending:!0,data:q,method:d.method,action:m},null,q)}}else typeof m=="function"&&(L.preventDefault(),q=k?Fb(d,k):new FormData(d),fp(i,{pending:!0,data:q,method:d.method,action:m},m,q))},currentTarget:d}]})}}for(var Kp=0;Kp<Of.length;Kp++){var Qp=Of[Kp];hr(Qp.toLowerCase(),"on"+(Qp[0].toUpperCase()+Qp.slice(1)))}hr(_y,"onAnimationEnd"),hr(xy,"onAnimationIteration"),hr(ky,"onAnimationStart"),hr("dblclick","onDoubleClick"),hr("focusin","onFocus"),hr("focusout","onBlur"),hr(b4,"onTransitionRun"),hr(w4,"onTransitionStart"),hr(_4,"onTransitionCancel"),hr(Sy,"onTransitionEnd"),ka("onMouseEnter",["mouseout","mouseover"]),ka("onMouseLeave",["mouseout","mouseover"]),ka("onPointerEnter",["pointerout","pointerover"]),ka("onPointerLeave",["pointerout","pointerover"]),Cr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Cr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Cr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Cr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Cr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Cr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ol="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),i6=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ol));function Vb(t,r){r=(r&4)!=0;for(var i=0;i<t.length;i++){var l=t[i],d=l.event;l=l.listeners;e:{var m=void 0;if(r)for(var k=l.length-1;0<=k;k--){var L=l[k],q=L.instance,J=L.currentTarget;if(L=L.listener,q!==m&&d.isPropagationStopped())break e;m=L,d.currentTarget=J;try{m(d)}catch(oe){_c(oe)}d.currentTarget=null,m=q}else for(k=0;k<l.length;k++){if(L=l[k],q=L.instance,J=L.currentTarget,L=L.listener,q!==m&&d.isPropagationStopped())break e;m=L,d.currentTarget=J;try{m(d)}catch(oe){_c(oe)}d.currentTarget=null,m=q}}}}function Be(t,r){var i=r[ks];i===void 0&&(i=r[ks]=new Set);var l=t+"__bubble";i.has(l)||($b(r,t,2,!1),i.add(l))}function Gp(t,r,i){var l=0;r&&(l|=4),$b(i,t,l,r)}var su="_reactListening"+Math.random().toString(36).slice(2);function Hb(t){if(!t[su]){t[su]=!0,Cs.forEach(function(i){i!=="selectionchange"&&(i6.has(i)||Gp(i,!1,t),Gp(i,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[su]||(r[su]=!0,Gp("selectionchange",!1,r))}}function $b(t,r,i,l){switch(y2(r)){case 2:var d=N6;break;case 8:d=D6;break;default:d=uh}i=d.bind(null,r,i,t),d=void 0,!As||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(d=!0),l?d===void 0?t.addEventListener(r,i,!0):t.addEventListener(r,i,{capture:!0,passive:d}):d===void 0?t.addEventListener(r,i,!1):t.addEventListener(r,i,{passive:d})}function Jp(t,r,i,l,d){var m=l;if(!(r&1)&&!(r&2)&&l!==null)e:for(;;){if(l===null)return;var k=l.tag;if(k===3||k===4){var L=l.stateNode.containerInfo;if(L===d)break;if(k===4)for(k=l.return;k!==null;){var q=k.tag;if((q===3||q===4)&&k.stateNode.containerInfo===d)return;k=k.return}for(;L!==null;){if(k=Sr(L),k===null)return;if(q=k.tag,q===5||q===6||q===26||q===27){l=m=k;continue e}L=L.parentNode}}l=l.return}yc(function(){var J=m,oe=Ls(i),ue=[];e:{var Y=Cy.get(t);if(Y!==void 0){var ae=u,_e=t;switch(t){case"keypress":if(wi(i)===0)break e;case"keydown":case"keyup":ae=we;break;case"focusin":_e="focus",ae=D;break;case"focusout":_e="blur",ae=D;break;case"beforeblur":case"afterblur":ae=D;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=A;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=I;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=Je;break;case _y:case xy:case ky:ae=P;break;case Sy:ae=De;break;case"scroll":case"scrollend":ae=y;break;case"wheel":ae=ut;break;case"copy":case"cut":case"paste":ae=Z;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=Ee;break;case"toggle":case"beforetoggle":ae=yt}var Te=(r&4)!=0,st=!Te&&(t==="scroll"||t==="scrollend"),W=Te?Y===null?null:Y+"Capture":Y;Te=[];for(var B=J,G;B!==null;){var le=B;if(G=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||G===null||W===null||(le=yi(B,W),le!=null&&Te.push(sl(B,le,G))),st)break;B=B.return}0<Te.length&&(Y=new ae(Y,_e,null,i,oe),ue.push({event:Y,listeners:Te}))}}if(!(r&7)){e:{if(Y=t==="mouseover"||t==="pointerover",ae=t==="mouseout"||t==="pointerout",Y&&i!==Kt&&(_e=i.relatedTarget||i.fromElement)&&(Sr(_e)||_e[wa]))break e;if((ae||Y)&&(Y=oe.window===oe?oe:(Y=oe.ownerDocument)?Y.defaultView||Y.parentWindow:window,ae?(_e=i.relatedTarget||i.toElement,ae=J,_e=_e?Sr(_e):null,_e!==null&&(st=h(_e),Te=_e.tag,_e!==st||Te!==5&&Te!==27&&Te!==6)&&(_e=null)):(ae=null,_e=J),ae!==_e)){if(Te=A,le="onMouseLeave",W="onMouseEnter",B="mouse",(t==="pointerout"||t==="pointerover")&&(Te=Ee,le="onPointerLeave",W="onPointerEnter",B="pointer"),st=ae==null?Y:dn(ae),G=_e==null?Y:dn(_e),Y=new Te(le,B+"leave",ae,i,oe),Y.target=st,Y.relatedTarget=G,le=null,Sr(oe)===J&&(Te=new Te(W,B+"enter",_e,i,oe),Te.target=G,Te.relatedTarget=st,le=Te),st=le,ae&&_e)t:{for(Te=o6,W=ae,B=_e,G=0,le=W;le;le=Te(le))G++;le=0;for(var Se=B;Se;Se=Te(Se))le++;for(;0<G-le;)W=Te(W),G--;for(;0<le-G;)B=Te(B),le--;for(;G--;){if(W===B||B!==null&&W===B.alternate){Te=W;break t}W=Te(W),B=Te(B)}Te=null}else Te=null;ae!==null&&Wb(ue,Y,ae,Te,!1),_e!==null&&st!==null&&Wb(ue,st,_e,Te,!0)}}e:{if(Y=J?dn(J):window,ae=Y.nodeName&&Y.nodeName.toLowerCase(),ae==="select"||ae==="input"&&Y.type==="file")var et=uy;else if(ly(Y))if(dy)et=g4;else{et=h4;var ke=p4}else ae=Y.nodeName,!ae||ae.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?J&&gi(J.elementType)&&(et=uy):et=m4;if(et&&(et=et(t,J))){cy(ue,et,i,oe);break e}ke&&ke(t,Y,J),t==="focusout"&&J&&Y.type==="number"&&J.memoizedProps.value!=null&&zr(Y,"number",Y.value)}switch(ke=J?dn(J):window,t){case"focusin":(ly(ke)||ke.contentEditable==="true")&&(ko=ke,Ef=J,Ds=null);break;case"focusout":Ds=Ef=ko=null;break;case"mousedown":Tf=!0;break;case"contextmenu":case"mouseup":case"dragend":Tf=!1,by(ue,i,oe);break;case"selectionchange":if(v4)break;case"keydown":case"keyup":by(ue,i,oe)}var Ne;if(Ie)e:{switch(t){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else xo?bc(t,i)&&(We="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(We="onCompositionStart");We&&(Vt&&i.locale!=="ko"&&(xo||We!=="onCompositionStart"?We==="onCompositionEnd"&&xo&&(Ne=Is()):(pr=oe,wo="value"in pr?pr.value:pr.textContent,xo=!0)),ke=lu(J,We),0<ke.length&&(We=new X(We,t,null,i,oe),ue.push({event:We,listeners:ke}),Ne?We.data=Ne:(Ne=_o(i),Ne!==null&&(We.data=Ne)))),(Ne=Nt?c4(t,i):u4(t,i))&&(We=lu(J,"onBeforeInput"),0<We.length&&(ke=new X("onBeforeInput","beforeinput",null,i,oe),ue.push({event:ke,listeners:We}),ke.data=Ne)),a6(ue,t,J,i,oe)}Vb(ue,r)})}function sl(t,r,i){return{instance:t,listener:r,currentTarget:i}}function lu(t,r){for(var i=r+"Capture",l=[];t!==null;){var d=t,m=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||m===null||(d=yi(t,i),d!=null&&l.unshift(sl(t,d,m)),d=yi(t,r),d!=null&&l.push(sl(t,d,m))),t.tag===3)return l;t=t.return}return[]}function o6(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Wb(t,r,i,l,d){for(var m=r._reactName,k=[];i!==null&&i!==l;){var L=i,q=L.alternate,J=L.stateNode;if(L=L.tag,q!==null&&q===l)break;L!==5&&L!==26&&L!==27||J===null||(q=J,d?(J=yi(i,m),J!=null&&k.unshift(sl(i,J,q))):d||(J=yi(i,m),J!=null&&k.push(sl(i,J,q)))),i=i.return}k.length!==0&&t.push({event:r,listeners:k})}var s6=/\r\n?/g,l6=/\u0000|\uFFFD/g;function Ub(t){return(typeof t=="string"?t:""+t).replace(s6,`
10
+ `).replace(l6,"")}function Kb(t,r){return r=Ub(r),Ub(t)===r}function ot(t,r,i,l,d,m){switch(i){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||qr(t,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&qr(t,""+l);break;case"className":mi(t,"class",l);break;case"tabIndex":mi(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":mi(t,i,l);break;case"style":hc(t,l,m);break;case"data":if(r!=="object"){mi(t,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||i!=="href")){t.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(i);break}l=bo(""+l),t.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(i==="formAction"?(r!=="input"&&ot(t,r,"name",d.name,d,null),ot(t,r,"formEncType",d.formEncType,d,null),ot(t,r,"formMethod",d.formMethod,d,null),ot(t,r,"formTarget",d.formTarget,d,null)):(ot(t,r,"encType",d.encType,d,null),ot(t,r,"method",d.method,d,null),ot(t,r,"target",d.target,d,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(i);break}l=bo(""+l),t.setAttribute(i,l);break;case"onClick":l!=null&&(t.onclick=$n);break;case"onScroll":l!=null&&Be("scroll",t);break;case"onScrollEnd":l!=null&&Be("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(d.children!=null)throw Error(s(60));t.innerHTML=i}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}i=bo(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(i,""+l):t.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(i,""):t.removeAttribute(i);break;case"capture":case"download":l===!0?t.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(i,l):t.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(i,l):t.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(i):t.setAttribute(i,l);break;case"popover":Be("beforetoggle",t),Be("toggle",t),hi(t,"popover",l);break;case"xlinkActuate":dr(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":dr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":dr(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":dr(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":dr(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":dr(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":dr(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":dr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":dr(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":hi(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=vo.get(i)||i,hi(t,i,l))}}function Xp(t,r,i,l,d,m){switch(i){case"style":hc(t,l,m);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(d.children!=null)throw Error(s(60));t.innerHTML=i}}break;case"children":typeof l=="string"?qr(t,l):(typeof l=="number"||typeof l=="bigint")&&qr(t,""+l);break;case"onScroll":l!=null&&Be("scroll",t);break;case"onScrollEnd":l!=null&&Be("scrollend",t);break;case"onClick":l!=null&&(t.onclick=$n);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!cc.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(d=i.endsWith("Capture"),r=i.slice(2,d?i.length-7:void 0),m=t[Yt]||null,m=m==null?null:m[i],typeof m=="function"&&t.removeEventListener(r,m,d),typeof l=="function")){typeof m!="function"&&m!==null&&(i in t?t[i]=null:t.hasAttribute(i)&&t.removeAttribute(i)),t.addEventListener(r,l,d);break e}i in t?t[i]=l:l===!0?t.setAttribute(i,""):hi(t,i,l)}}}function nn(t,r,i){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",t),Be("load",t);var l=!1,d=!1,m;for(m in i)if(i.hasOwnProperty(m)){var k=i[m];if(k!=null)switch(m){case"src":l=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:ot(t,r,m,k,i,null)}}d&&ot(t,r,"srcSet",i.srcSet,i,null),l&&ot(t,r,"src",i.src,i,null);return;case"input":Be("invalid",t);var L=m=k=d=null,q=null,J=null;for(l in i)if(i.hasOwnProperty(l)){var oe=i[l];if(oe!=null)switch(l){case"name":d=oe;break;case"type":k=oe;break;case"checked":q=oe;break;case"defaultChecked":J=oe;break;case"value":m=oe;break;case"defaultValue":L=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(s(137,r));break;default:ot(t,r,l,oe,i,null)}}pc(t,m,L,q,J,k,d,!1);return;case"select":for(d in Be("invalid",t),l=k=m=null,i)if(i.hasOwnProperty(d)&&(L=i[d],L!=null))switch(d){case"value":m=L;break;case"defaultValue":k=L;break;case"multiple":l=L;default:ot(t,r,d,L,i,null)}r=m,i=k,t.multiple=!!l,r==null?i!=null&&Ca(t,!!l,i,!0):Ca(t,!!l,r,!1);return;case"textarea":for(k in Be("invalid",t),m=d=l=null,i)if(i.hasOwnProperty(k)&&(L=i[k],L!=null))switch(k){case"value":l=L;break;case"defaultValue":d=L;break;case"children":m=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(s(91));break;default:ot(t,r,k,L,i,null)}yo(t,l,d,m);return;case"option":for(q in i)i.hasOwnProperty(q)&&(l=i[q],l!=null)&&(q==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":ot(t,r,q,l,i,null));return;case"dialog":Be("beforetoggle",t),Be("toggle",t),Be("cancel",t),Be("close",t);break;case"iframe":case"object":Be("load",t);break;case"video":case"audio":for(l=0;l<ol.length;l++)Be(ol[l],t);break;case"image":Be("error",t),Be("load",t);break;case"details":Be("toggle",t);break;case"embed":case"source":case"link":Be("error",t),Be("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in i)if(i.hasOwnProperty(J)&&(l=i[J],l!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:ot(t,r,J,l,i,null)}return;default:if(gi(r)){for(oe in i)i.hasOwnProperty(oe)&&(l=i[oe],l!==void 0&&Xp(t,r,oe,l,i,void 0));return}}for(L in i)i.hasOwnProperty(L)&&(l=i[L],l!=null&&ot(t,r,L,l,i,null))}function c6(t,r,i,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,m=null,k=null,L=null,q=null,J=null,oe=null;for(ae in i){var ue=i[ae];if(i.hasOwnProperty(ae)&&ue!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":q=ue;default:l.hasOwnProperty(ae)||ot(t,r,ae,null,l,ue)}}for(var Y in l){var ae=l[Y];if(ue=i[Y],l.hasOwnProperty(Y)&&(ae!=null||ue!=null))switch(Y){case"type":m=ae;break;case"name":d=ae;break;case"checked":J=ae;break;case"defaultChecked":oe=ae;break;case"value":k=ae;break;case"defaultValue":L=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(s(137,r));break;default:ae!==ue&&ot(t,r,Y,ae,l,ue)}}Sa(t,k,L,q,J,oe,m,d);return;case"select":for(m in ae=k=L=Y=null,i)if(q=i[m],i.hasOwnProperty(m)&&q!=null)switch(m){case"value":break;case"multiple":ae=q;default:l.hasOwnProperty(m)||ot(t,r,m,null,l,q)}for(d in l)if(m=l[d],q=i[d],l.hasOwnProperty(d)&&(m!=null||q!=null))switch(d){case"value":Y=m;break;case"defaultValue":L=m;break;case"multiple":k=m;default:m!==q&&ot(t,r,d,m,l,q)}r=L,i=k,l=ae,Y==null?!!l!=!!i&&(r==null?Ca(t,!!i,i?[]:"",!1):Ca(t,!!i,r,!0)):Ca(t,!!i,Y,!1);return;case"textarea":for(L in ae=Y=null,i)if(d=i[L],i.hasOwnProperty(L)&&d!=null&&!l.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:ot(t,r,L,null,l,d)}for(k in l)if(d=l[k],m=i[k],l.hasOwnProperty(k)&&(d!=null||m!=null))switch(k){case"value":Y=d;break;case"defaultValue":ae=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(s(91));break;default:d!==m&&ot(t,r,k,d,l,m)}Ea(t,Y,ae);return;case"option":for(var _e in i)Y=i[_e],i.hasOwnProperty(_e)&&Y!=null&&!l.hasOwnProperty(_e)&&(_e==="selected"?t.selected=!1:ot(t,r,_e,null,l,Y));for(q in l)Y=l[q],ae=i[q],l.hasOwnProperty(q)&&Y!==ae&&(Y!=null||ae!=null)&&(q==="selected"?t.selected=Y&&typeof Y!="function"&&typeof Y!="symbol":ot(t,r,q,Y,l,ae));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Te in i)Y=i[Te],i.hasOwnProperty(Te)&&Y!=null&&!l.hasOwnProperty(Te)&&ot(t,r,Te,null,l,Y);for(J in l)if(Y=l[J],ae=i[J],l.hasOwnProperty(J)&&Y!==ae&&(Y!=null||ae!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(s(137,r));break;default:ot(t,r,J,Y,l,ae)}return;default:if(gi(r)){for(var st in i)Y=i[st],i.hasOwnProperty(st)&&Y!==void 0&&!l.hasOwnProperty(st)&&Xp(t,r,st,void 0,l,Y);for(oe in l)Y=l[oe],ae=i[oe],!l.hasOwnProperty(oe)||Y===ae||Y===void 0&&ae===void 0||Xp(t,r,oe,Y,l,ae);return}}for(var W in i)Y=i[W],i.hasOwnProperty(W)&&Y!=null&&!l.hasOwnProperty(W)&&ot(t,r,W,null,l,Y);for(ue in l)Y=l[ue],ae=i[ue],!l.hasOwnProperty(ue)||Y===ae||Y==null&&ae==null||ot(t,r,ue,Y,l,ae)}function Qb(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function u6(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var d=i[l],m=d.transferSize,k=d.initiatorType,L=d.duration;if(m&&L&&Qb(k)){for(k=0,L=d.responseEnd,l+=1;l<i.length;l++){var q=i[l],J=q.startTime;if(J>L)break;var oe=q.transferSize,ue=q.initiatorType;oe&&Qb(ue)&&(q=q.responseEnd,k+=oe*(q<L?1:(L-J)/(q-J)))}if(--l,r+=8*(m+k)/(d.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Yp=null,Zp=null;function cu(t){return t.nodeType===9?t:t.ownerDocument}function Gb(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Jb(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function eh(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var th=null;function d6(){var t=window.event;return t&&t.type==="popstate"?t===th?!1:(th=t,!0):(th=null,!1)}var Xb=typeof setTimeout=="function"?setTimeout:void 0,f6=typeof clearTimeout=="function"?clearTimeout:void 0,Yb=typeof Promise=="function"?Promise:void 0,p6=typeof queueMicrotask=="function"?queueMicrotask:Yb===void 0?Xb:function(t){return Yb.resolve(null).then(t).catch(h6)};function h6(t){setTimeout(function(){throw t})}function Fa(t){return t==="head"}function Zb(t,r){var i=r,l=0;do{var d=i.nextSibling;if(t.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"||i==="/&"){if(l===0){t.removeChild(d),Jo(r);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")ll(t.ownerDocument.documentElement);else if(i==="head"){i=t.ownerDocument.head,ll(i);for(var m=i.firstChild;m;){var k=m.nextSibling,L=m.nodeName;m[pi]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&m.rel.toLowerCase()==="stylesheet"||i.removeChild(m),m=k}}else i==="body"&&ll(t.ownerDocument.body);i=d}while(i);Jo(r)}function e2(t,r){var i=t;t=0;do{var l=i.nextSibling;if(i.nodeType===1?r?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(r?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(t===0)break;t--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||t++;i=l}while(i)}function nh(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var i=r;switch(r=r.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":nh(i),go(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}t.removeChild(i)}}function m6(t,r,i,l){for(;t.nodeType===1;){var d=i;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[pi])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(m=t.getAttribute("rel"),m==="stylesheet"&&t.hasAttribute("data-precedence")||m!==d.rel||t.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||t.getAttribute("title")!==(d.title==null?null:d.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(m=t.getAttribute("src"),(m!==(d.src==null?null:d.src)||t.getAttribute("type")!==(d.type==null?null:d.type)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&m&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var m=d.name==null?null:""+d.name;if(d.type==="hidden"&&t.getAttribute("name")===m)return t}else return t;if(t=Xn(t.nextSibling),t===null)break}return null}function g6(t,r,i){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Xn(t.nextSibling),t===null))return null;return t}function t2(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Xn(t.nextSibling),t===null))return null;return t}function rh(t){return t.data==="$?"||t.data==="$~"}function ah(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function y6(t,r){var i=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||i.readyState!=="loading")r();else{var l=function(){r(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function Xn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var ih=null;function n2(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"||i==="/&"){if(r===0)return Xn(t.nextSibling);r--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||r++}t=t.nextSibling}return null}function r2(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(r===0)return t;r--}else i!=="/$"&&i!=="/&"||r++}t=t.previousSibling}return null}function a2(t,r,i){switch(r=cu(i),t){case"html":if(t=r.documentElement,!t)throw Error(s(452));return t;case"head":if(t=r.head,!t)throw Error(s(453));return t;case"body":if(t=r.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function ll(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);go(t)}var Yn=new Map,i2=new Set;function uu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var ra=U.d;U.d={f:v6,r:b6,D:w6,C:_6,L:x6,m:k6,X:C6,S:S6,M:E6};function v6(){var t=ra.f(),r=tu();return t||r}function b6(t){var r=_a(t);r!==null&&r.tag===5&&r.type==="form"?Sv(r):ra.r(t)}var Ko=typeof document>"u"?null:document;function o2(t,r,i){var l=Ko;if(l&&typeof r=="string"&&r){var d=Mn(r);d='link[rel="'+t+'"][href="'+d+'"]',typeof i=="string"&&(d+='[crossorigin="'+i+'"]'),i2.has(d)||(i2.add(d),t={rel:t,crossOrigin:i,href:r},l.querySelector(d)===null&&(r=l.createElement("link"),nn(r,"link",t),Ot(r),l.head.appendChild(r)))}}function w6(t){ra.D(t),o2("dns-prefetch",t,null)}function _6(t,r){ra.C(t,r),o2("preconnect",t,r)}function x6(t,r,i){ra.L(t,r,i);var l=Ko;if(l&&t&&r){var d='link[rel="preload"][as="'+Mn(r)+'"]';r==="image"&&i&&i.imageSrcSet?(d+='[imagesrcset="'+Mn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(d+='[imagesizes="'+Mn(i.imageSizes)+'"]')):d+='[href="'+Mn(t)+'"]';var m=d;switch(r){case"style":m=Qo(t);break;case"script":m=Go(t)}Yn.has(m)||(t=C({rel:"preload",href:r==="image"&&i&&i.imageSrcSet?void 0:t,as:r},i),Yn.set(m,t),l.querySelector(d)!==null||r==="style"&&l.querySelector(cl(m))||r==="script"&&l.querySelector(ul(m))||(r=l.createElement("link"),nn(r,"link",t),Ot(r),l.head.appendChild(r)))}}function k6(t,r){ra.m(t,r);var i=Ko;if(i&&t){var l=r&&typeof r.as=="string"?r.as:"script",d='link[rel="modulepreload"][as="'+Mn(l)+'"][href="'+Mn(t)+'"]',m=d;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Go(t)}if(!Yn.has(m)&&(t=C({rel:"modulepreload",href:t},r),Yn.set(m,t),i.querySelector(d)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(ul(m)))return}l=i.createElement("link"),nn(l,"link",t),Ot(l),i.head.appendChild(l)}}}function S6(t,r,i){ra.S(t,r,i);var l=Ko;if(l&&t){var d=xa(l).hoistableStyles,m=Qo(t);r||(r="default");var k=d.get(m);if(!k){var L={loading:0,preload:null};if(k=l.querySelector(cl(m)))L.loading=5;else{t=C({rel:"stylesheet",href:t,"data-precedence":r},i),(i=Yn.get(m))&&oh(t,i);var q=k=l.createElement("link");Ot(q),nn(q,"link",t),q._p=new Promise(function(J,oe){q.onload=J,q.onerror=oe}),q.addEventListener("load",function(){L.loading|=1}),q.addEventListener("error",function(){L.loading|=2}),L.loading|=4,du(k,r,l)}k={type:"stylesheet",instance:k,count:1,state:L},d.set(m,k)}}}function C6(t,r){ra.X(t,r);var i=Ko;if(i&&t){var l=xa(i).hoistableScripts,d=Go(t),m=l.get(d);m||(m=i.querySelector(ul(d)),m||(t=C({src:t,async:!0},r),(r=Yn.get(d))&&sh(t,r),m=i.createElement("script"),Ot(m),nn(m,"link",t),i.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(d,m))}}function E6(t,r){ra.M(t,r);var i=Ko;if(i&&t){var l=xa(i).hoistableScripts,d=Go(t),m=l.get(d);m||(m=i.querySelector(ul(d)),m||(t=C({src:t,async:!0,type:"module"},r),(r=Yn.get(d))&&sh(t,r),m=i.createElement("script"),Ot(m),nn(m,"link",t),i.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(d,m))}}function s2(t,r,i,l){var d=(d=Mt.current)?uu(d):null;if(!d)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(r=Qo(i.href),i=xa(d).hoistableStyles,l=i.get(r),l||(l={type:"style",instance:null,count:0,state:null},i.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=Qo(i.href);var m=xa(d).hoistableStyles,k=m.get(t);if(k||(d=d.ownerDocument||d,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,k),(m=d.querySelector(cl(t)))&&!m._p&&(k.instance=m,k.state.loading=5),Yn.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Yn.set(t,i),m||T6(d,t,i,k.state))),r&&l===null)throw Error(s(528,""));return k}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=i.async,i=i.src,typeof i=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Go(i),i=xa(d).hoistableScripts,l=i.get(r),l||(l={type:"script",instance:null,count:0,state:null},i.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Qo(t){return'href="'+Mn(t)+'"'}function cl(t){return'link[rel="stylesheet"]['+t+"]"}function l2(t){return C({},t,{"data-precedence":t.precedence,precedence:null})}function T6(t,r,i,l){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=t.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),nn(r,"link",i),Ot(r),t.head.appendChild(r))}function Go(t){return'[src="'+Mn(t)+'"]'}function ul(t){return"script[async]"+t}function c2(t,r,i){if(r.count++,r.instance===null)switch(r.type){case"style":var l=t.querySelector('style[data-href~="'+Mn(i.href)+'"]');if(l)return r.instance=l,Ot(l),l;var d=C({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Ot(l),nn(l,"style",d),du(l,i.precedence,t),r.instance=l;case"stylesheet":d=Qo(i.href);var m=t.querySelector(cl(d));if(m)return r.state.loading|=4,r.instance=m,Ot(m),m;l=l2(i),(d=Yn.get(d))&&oh(l,d),m=(t.ownerDocument||t).createElement("link"),Ot(m);var k=m;return k._p=new Promise(function(L,q){k.onload=L,k.onerror=q}),nn(m,"link",l),r.state.loading|=4,du(m,i.precedence,t),r.instance=m;case"script":return m=Go(i.src),(d=t.querySelector(ul(m)))?(r.instance=d,Ot(d),d):(l=i,(d=Yn.get(m))&&(l=C({},i),sh(l,d)),t=t.ownerDocument||t,d=t.createElement("script"),Ot(d),nn(d,"link",l),t.head.appendChild(d),r.instance=d);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&!(r.state.loading&4)&&(l=r.instance,r.state.loading|=4,du(l,i.precedence,t));return r.instance}function du(t,r,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=l.length?l[l.length-1]:null,m=d,k=0;k<l.length;k++){var L=l[k];if(L.dataset.precedence===r)m=L;else if(m!==d)break}m?m.parentNode.insertBefore(t,m.nextSibling):(r=i.nodeType===9?i.head:i,r.insertBefore(t,r.firstChild))}function oh(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.title??(t.title=r.title)}function sh(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.integrity??(t.integrity=r.integrity)}var fu=null;function u2(t,r,i){if(fu===null){var l=new Map,d=fu=new Map;d.set(i,l)}else d=fu,l=d.get(i),l||(l=new Map,d.set(i,l));if(l.has(t))return l;for(l.set(t,null),i=i.getElementsByTagName(t),d=0;d<i.length;d++){var m=i[d];if(!(m[pi]||m[Ft]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var k=m.getAttribute(r)||"";k=t+k;var L=l.get(k);L?L.push(m):l.set(k,[m])}}return l}function d2(t,r,i){t=t.ownerDocument||t,t.head.insertBefore(i,r==="title"?t.querySelector("head > title"):null)}function L6(t,r,i){if(i===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function f2(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function O6(t,r,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&!(i.state.loading&4)){if(i.instance===null){var d=Qo(l.href),m=r.querySelector(cl(d));if(m){r=m._p,typeof r=="object"&&r&&typeof r.then=="function"&&(t.count++,t=pu.bind(t),r.then(t,t)),i.state.loading|=4,i.instance=m,Ot(m);return}m=r.ownerDocument||r,l=l2(l),(d=Yn.get(d))&&oh(l,d),m=m.createElement("link"),Ot(m);var k=m;k._p=new Promise(function(L,q){k.onload=L,k.onerror=q}),nn(m,"link",l),i.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,r),(r=i.state.preload)&&!(i.state.loading&3)&&(t.count++,i=pu.bind(t),r.addEventListener("load",i),r.addEventListener("error",i))}}var lh=0;function A6(t,r){return t.stylesheets&&t.count===0&&mu(t,t.stylesheets),0<t.count||0<t.imgCount?function(i){var l=setTimeout(function(){if(t.stylesheets&&mu(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+r);0<t.imgBytes&&lh===0&&(lh=62500*u6());var d=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&mu(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>lh?50:800)+r);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(d)}}:null}function pu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)mu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var hu=null;function mu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,hu=new Map,r.forEach(I6,t),hu=null,pu.call(t))}function I6(t,r){if(!(r.state.loading&4)){var i=hu.get(t);if(i)var l=i.get(null);else{i=new Map,hu.set(t,i);for(var d=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<d.length;m++){var k=d[m];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(i.set(k.dataset.precedence,k),l=k)}l&&i.set(null,l)}d=r.instance,k=d.getAttribute("data-precedence"),m=i.get(k)||l,m===l&&i.set(null,d),i.set(k,d),this.count++,l=pu.bind(this),d.addEventListener("load",l),d.addEventListener("error",l),m?m.parentNode.insertBefore(d,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(d,t.firstChild)),r.state.loading|=4}}var dl={$$typeof:ne,Provider:null,Consumer:null,_currentValue:Ae,_currentValue2:Ae,_threadCount:0};function R6(t,r,i,l,d,m,k,L,q){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=_s(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_s(0),this.hiddenUpdates=_s(null),this.identifierPrefix=l,this.onUncaughtError=d,this.onCaughtError=m,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function M6(t,r,i,l,d,m,k,L,q,J,oe,ue){return t=new R6(t,r,i,k,q,J,oe,ue,L),r=1,m===!0&&(r|=24),m=Nn(3,null,null,r),t.current=m,m.stateNode=t,r=Vf(),r.refCount++,t.pooledCache=r,r.refCount++,m.memoizedState={element:l,isDehydrated:i,cache:r},Uf(m),t}function P6(t){return t?(t=Eo,t):Eo}function p2(t,r,i,l,d,m){d=P6(d),l.context===null?l.context=d:l.pendingContext=d,l=Pi(r),l.payload={element:i},m=m===void 0?null:m,m!==null&&(l.callback=m),i=Ni(t,l,r),i!==null&&(Cn(i,t,r),Hs(i,t,r))}function h2(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<r?i:r}}function ch(t,r){h2(t,r),(t=t.alternate)&&h2(t,r)}function m2(t){if(t.tag===13||t.tag===31){var r=Ci(t,67108864);r!==null&&Cn(r,t,67108864),ch(t,67108864)}}function g2(t){if(t.tag===13||t.tag===31){var r=Jn();r=In(r);var i=Ci(t,r);i!==null&&Cn(i,t,r),ch(t,r)}}var gu=!0;function N6(t,r,i,l){var d=ee.T;ee.T=null;var m=U.p;try{U.p=2,uh(t,r,i,l)}finally{U.p=m,ee.T=d}}function D6(t,r,i,l){var d=ee.T;ee.T=null;var m=U.p;try{U.p=8,uh(t,r,i,l)}finally{U.p=m,ee.T=d}}function uh(t,r,i,l){if(gu){var d=dh(l);if(d===null)Jp(t,r,l,yu,i),v2(t,l);else if(z6(d,t,r,i,l))l.stopPropagation();else if(v2(t,l),r&4&&-1<j6.indexOf(t)){for(;d!==null;){var m=_a(d);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var k=Dr(m.pendingLanes);if(k!==0){var L=m;for(L.pendingLanes|=2,L.entangledLanes|=2;k;){var q=1<<31-mt(k);L.entanglements[1]|=q,k&=~q}na(m),!(Ze&6)&&(Zc=Jt()+500,il(0,!1))}}break;case 31:case 13:L=Ci(m,2),L!==null&&Cn(L,m,2),tu(),ch(m,2)}if(m=dh(l),m===null&&Jp(t,r,l,yu,i),m===d)break;d=m}d!==null&&l.stopPropagation()}else Jp(t,r,l,null,i)}}function dh(t){return t=Ls(t),fh(t)}var yu=null;function fh(t){if(yu=null,t=Sr(t),t!==null){var r=h(t);if(r===null)t=null;else{var i=r.tag;if(i===13){if(t=p(r),t!==null)return t;t=null}else if(i===31){if(t=g(r),t!==null)return t;t=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return yu=t,null}function y2(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(mf()){case Nr:return 2;case rc:return 8;case Pt:case po:return 32;case kt:return 268435456;default:return 32}default:return 32}}var ph=!1,Va=null,Ha=null,$a=null,fl=new Map,pl=new Map,Wa=[],j6="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function v2(t,r){switch(t){case"focusin":case"focusout":Va=null;break;case"dragenter":case"dragleave":Ha=null;break;case"mouseover":case"mouseout":$a=null;break;case"pointerover":case"pointerout":fl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":pl.delete(r.pointerId)}}function hl(t,r,i,l,d,m){return t===null||t.nativeEvent!==m?(t={blockedOn:r,domEventName:i,eventSystemFlags:l,nativeEvent:m,targetContainers:[d]},r!==null&&(r=_a(r),r!==null&&m2(r)),t):(t.eventSystemFlags|=l,r=t.targetContainers,d!==null&&r.indexOf(d)===-1&&r.push(d),t)}function z6(t,r,i,l,d){switch(r){case"focusin":return Va=hl(Va,t,r,i,l,d),!0;case"dragenter":return Ha=hl(Ha,t,r,i,l,d),!0;case"mouseover":return $a=hl($a,t,r,i,l,d),!0;case"pointerover":var m=d.pointerId;return fl.set(m,hl(fl.get(m)||null,t,r,i,l,d)),!0;case"gotpointercapture":return m=d.pointerId,pl.set(m,hl(pl.get(m)||null,t,r,i,l,d)),!0}return!1}function b2(t){var r=Sr(t.target);if(r!==null){var i=h(r);if(i!==null){if(r=i.tag,r===13){if(r=p(i),r!==null){t.blockedOn=r,Rn(t.priority,function(){g2(i)});return}}else if(r===31){if(r=g(i),r!==null){t.blockedOn=r,Rn(t.priority,function(){g2(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function vu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var i=dh(t.nativeEvent);if(i===null){i=t.nativeEvent;var l=new i.constructor(i.type,i);Kt=l,i.target.dispatchEvent(l),Kt=null}else return r=_a(i),r!==null&&m2(r),t.blockedOn=i,!1;r.shift()}return!0}function w2(t,r,i){vu(t)&&i.delete(r)}function q6(){ph=!1,Va!==null&&vu(Va)&&(Va=null),Ha!==null&&vu(Ha)&&(Ha=null),$a!==null&&vu($a)&&($a=null),fl.forEach(w2),pl.forEach(w2)}function bu(t,r){t.blockedOn===r&&(t.blockedOn=null,ph||(ph=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,q6)))}var wu=null;function _2(t){wu!==t&&(wu=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){wu===t&&(wu=null);for(var r=0;r<t.length;r+=3){var i=t[r],l=t[r+1],d=t[r+2];if(typeof l!="function"){if(fh(l||i)===null)continue;break}var m=_a(i);m!==null&&(t.splice(r,3),r-=3,fp(m,{pending:!0,data:d,method:i.method,action:l},l,d))}}))}function Jo(t){function r(q){return bu(q,t)}Va!==null&&bu(Va,t),Ha!==null&&bu(Ha,t),$a!==null&&bu($a,t),fl.forEach(r),pl.forEach(r);for(var i=0;i<Wa.length;i++){var l=Wa[i];l.blockedOn===t&&(l.blockedOn=null)}for(;0<Wa.length&&(i=Wa[0],i.blockedOn===null);)b2(i),i.blockedOn===null&&Wa.shift();if(i=(t.ownerDocument||t).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var d=i[l],m=i[l+1],k=d[Yt]||null;if(typeof m=="function")k||_2(i);else if(k){var L=null;if(m&&m.hasAttribute("formAction")){if(d=m,k=m[Yt]||null)L=k.formAction;else if(fh(d)!==null)continue}else L=k.action;typeof L=="function"?i[l+1]=L:(i.splice(l,3),l-=3),_2(i)}}}function B6(){function t(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(k){return d=k})},focusReset:"manual",scroll:"manual"})}function r(){d!==null&&(d(),d=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,d=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),d!==null&&(d(),d=null)}}}function hh(t){this._internalRoot=t}mh.prototype.render=hh.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var i=r.current;p2(i,Jn(),t,r,null,null)},mh.prototype.unmount=hh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;p2(t.current,2,null,t,null,null),tu(),r[wa]=null}};function mh(t){this._internalRoot=t}mh.prototype.unstable_scheduleHydration=function(t){if(t){var r=sc();t={blockedOn:null,target:t,priority:r};for(var i=0;i<Wa.length&&r!==0&&r<Wa[i].priority;i++);Wa.splice(i,0,t),i===0&&b2(t)}};var x2=a.version;if(x2!=="19.2.4")throw Error(s(527,x2,"19.2.4"));U.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=_(r),t=t===null?null:S(t),t=t===null?null:t.stateNode,t};var F6={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:ee,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_u.isDisabled&&_u.supportsFiber)try{ui=_u.inject(F6),on=_u}catch{}}e.createRoot=function(t,r){if(!c(t))throw Error(s(299));var i=!1,l="",d=D4,m=j4,k=z4;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(d=r.onUncaughtError),r.onCaughtError!==void 0&&(m=r.onCaughtError),r.onRecoverableError!==void 0&&(k=r.onRecoverableError)),r=M6(t,1,!1,null,null,i,l,null,d,m,k,B6),t[wa]=r.current,Hb(t),new hh(r)}})),Fu=tt(((e,n)=>{function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(o){console.error(o)}}a(),n.exports=Za()})),Hm="Expected a function";function ex(e,n){var a;if(typeof n!="function")throw TypeError(Hm);return e=a5(e),function(){return--e>0&&(a=n.apply(this,arguments)),e<=1&&(n=void 0),a}}var tx=ex;function nx(e){return tx(2,e)}let $m;zh=nx,$m=Math.max;function rx(e){if(!(e&&e.length))return[];var n=0;return e=s5(e,function(a){if(o5(a))return n=$m(a.length,n),!0}),n5(n,function(a){return r5(e,p5(a))})}var ax=i5(rx);Ru=function(e,n){if(e==null)throw Error(n||`Expected value but got ${e}`)},BigInt.prototype.toJSON=function(){return JSON.rawJSON(this.toString())},jh=function(e){try{return JSON.parse(e,(n,a)=>fd(a))}catch{}if(e==null||e==="")return{};try{return e??(e=""),e=e.replaceAll(new RegExp(`(?<=\\s|^|\\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\\\]*(\\\\.|'([^'\\\\]*\\\\.)*[^'\\\\]*'|"([^"\\\\]*\\\\.)*[^"\\\\]*"))*[^"']*$)`,"g"),'"\u25D0$1\u25D0"'),JSON.parse(e,(n,a)=>typeof a=="string"?a==="\u25D0NaN\u25D0"?NaN:a==="\u25D0Infinity\u25D0"?1/0:a==="\u25D0-Infinity\u25D0"?-1/0:fd(a):fd(a))}catch{return{}}};function ix(e,n){return e==null?"":typeof e=="number"&&!Number.isNaN(e)?e.toLocaleString(n,{useGrouping:!1,maximumFractionDigits:20}):String(e)}Nw=function(e,n){if(e.length===0)return"";let a=Object.keys(e[0]),o=e.map(s=>a.map(c=>ix(s[c],n)).join(" "));return`${a.join(" ")}
11
11
  ${o.join(`
12
- `)}`},cw=function(e){if(e.length===0)return"";let n=Object.keys(e[0]);return[`| ${n.join(" | ")} |`,`|${n.map(()=>"---").join("|")}|`,...e.map(a=>`| ${n.map(o=>ix(a[o])).join(" | ")} |`)].join(`
13
- `)};function ix(e){if(e==null)return"";if(Array.isArray(e)||typeof e=="object")return Wm(JSON.stringify(e));let n=String(e),a=/\[([^\]]+)]\((https?:\/\/[^)]+)\)/g,o=new Map,s=0;n=n.replaceAll(a,c=>{let h=`__MDLINK_${s++}__`;return o.set(h,c),h}),n=n.replaceAll(/(https?:\/\/\S+)/g,"[$1]($1)");for(let[c,h]of o)n=n.replace(c,h);return Wm(n)}function Wm(e){return e.replaceAll("\\","\\\\").replaceAll("|","\\|").replaceAll(`
14
- `," ").replaceAll("\r","")}function fd(e){return typeof e=="object"&&e&&"$bigint"in e&&typeof e.$bigint=="string"?BigInt(e.$bigint):e}var Um="abcdefghijklmnopqrstuvwxyz",Km=Um+Um.toUpperCase(),Qm=new Set;os="__scratch__",Vn="setup",Xa={create(){let e=0,n;do{let a="";for(let o=0;o<4;o++)a+=Km[Math.floor(Math.random()*Km.length)];n=a,e++}while(Qm.has(n)&&e<100);if(e>=100)throw Error("Failed to generate unique CellId after 100 attempts");return Qm.add(n),n}},En={create(e){return rn(e!=null,"cellId is required"),`cell-${e}`},parse(e){return e.slice(5)},findElement(e){return e.closest('div[id^="cell-"]')},findElementThroughShadowDOMs(e){let n=e;for(;n;){let a=En.findElement(n);if(a)return a;let o=n.getRootNode();if(n=o instanceof ShadowRoot?o.host:n.parentElement,n===o)break}return null}},F_=function(e){let n=null,a=En.findElementThroughShadowDOMs(e);return a&&(n=En.parse(a.id)),n},Ku={parse(e){return e.getAttribute("object-id")},parseOrThrow(e){let n=Ku.parse(e);return rn(n,"<marimo-ui-element/> missing object-id attribute"),n}},a_={create(e){return`output-${e}`}},Tm=new class{getFilename(){return this.getSearchParam("filename")}setFilename(e){this.setSearchParam("filename",e)}getCodeFromSearchParam(){return this.getSearchParam("code")}getCodeFromHash(){let e=window.location.hash;return e.startsWith("#code/")?e.slice(6):null}setCodeForHash(e){window.location.hash=`#code/${e}`}setSearchParam(e,n){let a=new URL(window.location.href);a.searchParams.set(e,n),window.history.replaceState({},"",a.toString())}getSearchParam(e){return new URL(window.location.href).searchParams.get(e)}},Qu=function(e){return em(e??"")},t_=function(e){return Ar.mapValues(e.dataset,n=>typeof n=="string"?Qu(n):n)},S_=function(e,n){let a=e.parentElement?Ku.parse(e.parentElement):void 0;return a&&n.has(a)?n.lookupValue(a):Qu(e.dataset.initialValue)},Rl=function(){if(M2())return document.title||null;if(vh()){let a=Tm.getFilename();if(a)return a}let e=document.querySelector("marimo-filename");Vu(e,"marimo-filename tag not found");let n=e.innerHTML;return n.length===0?null:n};var ox=Symbol("");Gw=function(e,n){return Ce(e,function(a,o,s){o(this,n(a(this),s))})};function pd(e,n){let a=null,o=new Map,s=new Set,c=p=>{let g;if(n===void 0)g=o.get(p);else for(let[_,S]of o)if(n(_,p)){g=S;break}if(g!==void 0)if(a!=null&&a(g[1],p))c.remove(p);else return g[0];let b=e(p);return o.set(p,[b,Date.now()]),h("CREATE",p,b),b},h=(p,g,b)=>{for(let _ of s)_({type:p,param:g,atom:b})};return c.unstable_listen=p=>(s.add(p),()=>{s.delete(p)}),c.getParams=()=>o.keys(),c.remove=p=>{if(n===void 0){if(!o.has(p))return;let[g]=o.get(p);o.delete(p),h("REMOVE",p,g)}else for(let[g,[b]]of o)if(n(g,p)){o.delete(g),h("REMOVE",g,b);break}},c.setShouldRemove=p=>{if(a=p,a)for(let[g,[b,_]]of o)a(_,g)&&(o.delete(g),h("REMOVE",g,b))},c}var hd=(e,n,a)=>(n.has(a)?n:n.set(a,e())).get(a),sx=new WeakMap,lx=(e,n,a,o)=>hd(e,hd(()=>new WeakMap,hd(()=>new WeakMap,sx,n),a),o);function cx(e,n,a=Object.is){return lx(()=>{let o=Symbol(),s=([h,p])=>{if(p===o)return n(h);let g=n(h,p);return a(p,g)?p:g},c=Ce(h=>{let p=h(c);return s([h(e),p])});return c.init=o,c},e,n,a)}var Gm=(e,n,a)=>(n.has(a)?n:n.set(a,e())).get(a),ux=new WeakMap,dx=(e,n,a)=>Gm(e,Gm(()=>new WeakMap,ux,n),a),fx={},Jm=e=>!!e.write,px=e=>typeof e=="function";function hx(e,n){return dx(()=>{let a=new WeakMap,o=(h,p)=>{let g=a.get(h);if(g)return g;let b=p&&a.get(p),_=[],S=[];return h.forEach((C,E)=>{let O=n?n(C):E;S[E]=O;let M=b&&b.atomList[b.keyList.indexOf(O)];if(M){_[E]=M;return}let V=H=>{let $=H(s),N=H(e),ne=o(N,$==null?void 0:$.arr).keyList.indexOf(O);if(ne<0||ne>=N.length){let fe=h[o(h).keyList.indexOf(O)];if(fe)return fe;throw Error("splitAtom: index out of bounds for read")}return N[ne]};_[E]=Jm(e)?Ce(V,(H,$,N)=>{let ne=H(s),fe=H(e),R=o(fe,ne==null?void 0:ne.arr).keyList.indexOf(O);if(R<0||R>=fe.length)throw Error("splitAtom: index out of bounds for write");let j=px(N)?N(fe[R]):N;Object.is(fe[R],j)||$(e,[...fe.slice(0,R),j,...fe.slice(R+1)])}):Ce(V)}),g=b&&b.keyList.length===S.length&&b.keyList.every((C,E)=>C===S[E])?b:{arr:h,atomList:_,keyList:S},a.set(h,g),g},s=Ce(h=>{let p=h(s);return o(h(e),p==null?void 0:p.arr)});s.init=void 0;let c=Jm(e)?Ce(h=>h(s).atomList,(h,p,g)=>{switch(g.type){case"remove":{let b=h(c).indexOf(g.atom);if(b>=0){let _=h(e);p(e,[..._.slice(0,b),..._.slice(b+1)])}break}case"insert":{let b=g.before?h(c).indexOf(g.before):h(c).length;if(b>=0){let _=h(e);p(e,[..._.slice(0,b),g.value,..._.slice(b)])}break}case"move":{let b=h(c).indexOf(g.atom),_=g.before?h(c).indexOf(g.before):h(c).length;if(b>=0&&_>=0){let S=h(e);b<_?p(e,[...S.slice(0,b),...S.slice(b+1,_),S[b],...S.slice(_)]):p(e,[...S.slice(0,_),S[b],...S.slice(_,b),...S.slice(b+1)])}break}}}):Ce(h=>h(s).atomList);return c},e,n||fx)}var Xm=e=>typeof(e==null?void 0:e.then)=="function";function Ym(e=()=>{try{return window.localStorage}catch{return}},n){var p;let a,o,s={getItem:(g,b)=>{var C;let _=E=>{if(E||(E=""),a!==E){try{o=JSON.parse(E,n==null?void 0:n.reviver)}catch{return b}a=E}return o},S=((C=e())==null?void 0:C.getItem(g))??null;return Xm(S)?S.then(_):_(S)},setItem:(g,b)=>{var _;return(_=e())==null?void 0:_.setItem(g,JSON.stringify(b,n==null?void 0:n.replacer))},removeItem:g=>{var b;return(b=e())==null?void 0:b.removeItem(g)}},c=g=>(b,_,S)=>g(b,C=>{let E;try{E=JSON.parse(C||"")}catch{E=S}_(E)}),h;try{h=(p=e())==null?void 0:p.subscribe}catch{}return!h&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(h=(g,b)=>{if(!(e()instanceof window.Storage))return()=>{};let _=S=>{S.storageArea===e()&&S.key===g&&b(S.newValue)};return window.addEventListener("storage",_),()=>{window.removeEventListener("storage",_)}}),h&&(s.subscribe=c(h)),s}var mx=Ym();Al=function(e,n,a=mx,o){let s=Ce(o!=null&&o.getOnInit?a.getItem(e,n):n);return s.onMount=c=>{c(a.getItem(e,n));let h;return a.subscribe&&(h=a.subscribe(e,c,n)),h},Ce(c=>c(s),(c,h,p)=>{let g=typeof p=="function"?p(c(s)):p;return g===ox?(h(s,n),a.removeItem(e)):Xm(g)?g.then(b=>(h(s,b),a.setItem(e,b))):(h(s,g),a.setItem(e,g))})},gn=function(e){let n,a,o;return typeof e=="object"?(n=e.hashFunction,a=e.expiring,o=e.tags):n=e,(s,c,h)=>{if(h.value!=null)h.value=Zm(h.value,n,a,o);else if(h.get!=null)h.get=Zm(h.get,n,a,o);else throw"Only put a Memoize() decorator on a method or get accessor."}};var md=new Map;function Zm(e,n,a=0,o){let s=Symbol("__memoized_map__");return function(...c){let h;this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let p=this[s];if(Array.isArray(o))for(let g of o)md.has(g)?md.get(g).push(p):md.set(g,[p]);if(n||c.length>0||a>0){let g;g=n===!0?c.map(S=>S.toString()).join("!"):n?n.apply(this,c):c[0];let b=`${g}__timestamp`,_=!1;if(a>0)if(!p.has(b))_=!0;else{let S=p.get(b);_=Date.now()-S>a}p.has(g)&&!_?h=p.get(g):(h=e.apply(this,c),p.set(g,h),a>0&&p.set(b,Date.now()))}else{let g=this;p.has(g)?h=p.get(g):(h=e.apply(this,c),p.set(g,h))}return h}}is=Ce(Rl()),Ww=Ce(void 0);var gx=class{constructor(){ve(this,"store",new Map)}get length(){return this.store.size}clear(){this.store.clear()}getItem(e){return this.store.get(e)||null}key(e){return[...this.store.keys()][e]||null}removeItem(e){this.store.delete(e)}setItem(e,n){this.store.set(e,n)}};function yx(){let{hasLocalStorage:e,hasSessionStorage:n}=Z5();return e?window.localStorage:n?window.sessionStorage:new gx}as=yx();let da;v_=class{constructor(e,n=as){this.defaultValue=e,this.storage=n}get(e){try{let n=this.storage.getItem(e);return n?JSON.parse(n):this.defaultValue}catch{return this.defaultValue}}set(e,n){this.storage.setItem(e,JSON.stringify(n))}remove(e){this.storage.removeItem(e)}},sd=class{constructor(e,n,a=as){this.schema=e,this.getDefaultValue=n,this.storage=a}get(e){try{let n=this.storage.getItem(e);if(n==null)return this.getDefaultValue();let a=this.schema.safeParse(JSON.parse(n));return a.success?a.data:(be.warn("Error parsing zod local storage",a.error),this.getDefaultValue())}catch(n){return be.warn("Error getting zod local storage",n),this.getDefaultValue()}}set(e,n){this.storage.setItem(e,JSON.stringify(n))}remove(e){this.storage.removeItem(e)}},Dm=class extends sd{constructor(e,n,a){let o=Fe.get(is);super(n,a),this.filename=o;try{this.unsubscribeFromFilename=Fe.sub(is,()=>{let s=Fe.get(is);this.handleFilenameChange(e,s)})}catch{this.unsubscribeFromFilename=null}}get(e){return super.get(this.createScopedKey(e,this.filename))}set(e,n){super.set(this.createScopedKey(e,this.filename),n)}remove(e){super.remove(this.createScopedKey(e,this.filename))}createScopedKey(e,n){return n?`${e}:${n}`:e}handleFilenameChange(e,n){if(n&&n!==this.filename){let a=this.get(e);this.remove(e),this.filename=n,this.set(e,a)}}dispose(){this.unsubscribeFromFilename&&(this.unsubscribeFromFilename=(this.unsubscribeFromFilename(),null))}},da="marimo:notebook-col-sizes";function vx(){return{widths:[]}}var Gi=new Dm(da,E2({widths:e5(X6([Y6(),Z6("contentWidth")]).default("contentWidth"))}),vx);Zw={getColumnWidth:e=>Gi.get(da).widths[e]??"contentWidth",saveColumnWidth:(e,n)=>{let a=Gi.get(da).widths;if(a[e])a[e]=n;else{for(;a.length<=e;)a.push("contentWidth");a[e]=n}Gi.set(da,{widths:a})},clearStorage:()=>{Gi.remove(da)}};function bx(e,n){let a=Gi.get(da).widths,o=gl(a,e,n);Gi.set(da,{widths:o})}var e0,t0,n0,ar,r0,a0,i0,o0,yn,s0,l0,c0,u0,d0,f0,Rt;function Tn(e,n,a,o,s){var c={};return Object.keys(o).forEach(function(h){c[h]=o[h]}),c.enumerable=!!c.enumerable,c.configurable=!!c.configurable,("value"in c||c.initializer)&&(c.writable=!0),c=a.slice().reverse().reduce(function(h,p){return p(e,n,h)||h},c),s&&c.initializer!==void 0&&(c.value=c.initializer?c.initializer.call(s):void 0,c.initializer=void 0),c.initializer===void 0?(Object.defineProperty(e,n,c),null):c}let ei=(e0=gn(),t0=gn(),n0=gn(),ar=class{constructor(e,n,a){this.value=e,this.isCollapsed=n,this.children=a}geDescendantCount(){let e=0,n=[...this.children];for(;n.length>0;){let a=n.pop();e++;for(let o=a.children.length-1;o>=0;o--)n.push(a.children[o])}return e}getDescendants(){let e=[],n=[...this.children];for(;n.length>0;){let a=n.pop();e.push(a.value);for(let o=a.children.length-1;o>=0;o--)n.push(a.children[o])}return e}get inOrderIds(){let e=[],n=a=>{e.push(a.value);for(let o of a.children)n(o)};for(let a of this.children)n(a);return e}toString(){return this.isCollapsed?`${this.value} (collapsed)`:String(this.value)}equals(e){return this.value===e.value}},Tn(ar.prototype,"geDescendantCount",[e0],Object.getOwnPropertyDescriptor(ar.prototype,"geDescendantCount"),ar.prototype),Tn(ar.prototype,"getDescendants",[t0],Object.getOwnPropertyDescriptor(ar.prototype,"getDescendants"),ar.prototype),Tn(ar.prototype,"inOrderIds",[n0],Object.getOwnPropertyDescriptor(ar.prototype,"inOrderIds"),ar.prototype),ar);var wx=0;let Ji;Ji=(r0=gn(),a0=gn(),i0=gn(),o0=gn(),yn=class Qi{constructor(n,a){this.nodes=n,this.id=a}static from(n){let a=`tree_${wx++}`;return new Qi(n.map(o=>new ei(o,!1,[])),a)}static fromWithPreviousShape(n,a){var c;if(!a)return Qi.from(n);let o=a.id,s=new Qi(n.map(h=>new ei(h,!1,[])),o);for(let h of n)if(a.isCollapsed(h)){let p=((c=a._nodeMap.get(h))==null?void 0:c.children)??[];for(let g=p.length-1;g>=0;g--){let b=p[g];if(s._nodeMap.has(b.value)){s=s.collapse(h,b.value);break}}}return s}withNodes(n){return new Qi(n,this.id)}get topLevelIds(){return this.nodes.map(n=>n.value)}get inOrderIds(){return this.nodes.flatMap(n=>[n.value,...n.inOrderIds])}get idSet(){return new Set(this.inOrderIds)}get length(){return this.nodes.length}get _nodeMap(){let n=new Map;for(let a of this.nodes)n.set(a.value,a);return n}getDescendants(n){let a=this._nodeMap.get(n);return a?a.getDescendants():(be.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),[])}isCollapsed(n){let a=this._nodeMap.get(n);return a?a.isCollapsed:(be.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),!1)}indexOfOrThrow(n){let a=this.nodes.findIndex(o=>o.value===n);if(a===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);return a}slice(n,a){return this.nodes.slice(n,a).map(o=>o.value)}moveToFront(n){let a=this.indexOfOrThrow(n);return this.withNodes(gl(this.nodes,a,0))}moveToBack(n){let a=this.indexOfOrThrow(n);return this.withNodes(gl(this.nodes,a,this.nodes.length-1))}collapse(n,a){let o=this.nodes.findIndex(g=>g.value===n);if(o===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let s=a===void 0?this.nodes.length:this.nodes.findIndex(g=>g.value===a);if(s===-1)throw Error(`Node ${a} not found in tree`);if(s<o)throw Error(`Node ${a} is before node ${n}`);let c=[...this.nodes],h=c[o];if(h.isCollapsed)throw Error(`Node ${n} is already collapsed`);let p=c.splice(o+1,s-o);return c[o]=new ei(h.value,!0,p),this.withNodes(c)}collapseAll(n){let a=[...this.nodes];if(n.length===0)throw Error("No collapse ranges provided");if(n.length!==a.length)throw Error(`Collapse ranges length ${n.length} does not match tree length ${a.length}`);let o=a.length-1;for(;o>=0;){let s=a[o],c=n[o];if(!s.isCollapsed&&c){let{id:h,until:p}=c;if(h!==s.value)throw Error(`Node ${s.value} does not match collapse range id ${h}`);let g=p===void 0?a.length:a.findIndex(_=>_.value===p);if(g===-1)throw Error(`Node ${p} not found in tree`);if(g<o)throw Error(`Node ${p} is before node ${h}`);let b=a.splice(o+1,g-o);a[o]=new ei(s.value,!0,b),o--}else o--}return this.withNodes(a)}expand(n){let a=this.nodes.findIndex(c=>c.value===n);if(a===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let o=[...this.nodes],s=o[a];return s.isCollapsed?(o[a]=new ei(s.value,!1,[]),o=Q2(o,a+1,s.children),this.withNodes(o)):this}expandAll(){let n=[...this.nodes],a=0;for(;a<n.length;){let o=n[a];o.isCollapsed&&(n[a]=new ei(o.value,!1,[]),n=Q2(n,a+1,o.children)),a++}return this.withNodes(n)}move(n,a){return this.withNodes(gl(this.nodes,n,a))}at(n){var a;return(a=this.nodes.at(n))==null?void 0:a.value}atOrThrow(n){let a=this.nodes.at(n);if(a===void 0)throw Error(`Node at index ${n} not found in tree`);return a.value}first(){return this.atOrThrow(0)}last(){return this.atOrThrow(this.nodes.length-1)}after(n){let a=this.indexOfOrThrow(n);if(a!==this.nodes.length-1)return this.at(a+1)}before(n){let a=this.indexOfOrThrow(n);if(a!==0)return this.at(a-1)}insert(n,a){return this.withNodes(K2(this.nodes,a,new ei(n,!1,[])))}insertAtEnd(n){return this.insert(n,this.nodes.length)}insertAtStart(n){return this.insert(n,0)}deleteAtIndex(n){let a=this.atOrThrow(n),o=this.expand(a);return o.withNodes(Y5(o.nodes,n))}delete(n){let a=this.indexOfOrThrow(n);return this.deleteAtIndex(a)}getCount(n){var a;return((a=this._nodeMap.get(n))==null?void 0:a.geDescendantCount())??0}findAndExpandDeep(n){let a=this.find(n);return a.length===0?this:a.reduce((o,s)=>o.expand(s),this)}find(n){function a(o,s){for(let c of o){if(c.value===n)return[...s,n];let h=a(c.children,[...s,c.value]);if(h.length>0)return h}return[]}return a(this.nodes,[])}split(n){let a=this.nodes.findIndex(c=>c.value===n);if(a===-1)throw Error(`Node ${n} not found in tree`);let o=this.nodes.slice(0,a),s=this.nodes.slice(a);return o.length===0?[Qi.from([]),this.withNodes(s)]:[this.withNodes(o),Qi.from([]).withNodes(s)]}equals(n){return this.nodes.length===n.nodes.length&&this.nodes.every((a,o)=>a.value===n.nodes[o].value)}toString(){let n=0,a="",o=s=>{for(let c of s)a+=`${" ".repeat(n*2)}${c.toString()}
15
- `,n+=1,o(c.children),--n};return o(this.nodes),a}},Tn(yn.prototype,"topLevelIds",[r0],Object.getOwnPropertyDescriptor(yn.prototype,"topLevelIds"),yn.prototype),Tn(yn.prototype,"inOrderIds",[a0],Object.getOwnPropertyDescriptor(yn.prototype,"inOrderIds"),yn.prototype),Tn(yn.prototype,"idSet",[i0],Object.getOwnPropertyDescriptor(yn.prototype,"idSet"),yn.prototype),Tn(yn.prototype,"_nodeMap",[o0],Object.getOwnPropertyDescriptor(yn.prototype,"_nodeMap"),yn.prototype),yn),bl=(s0=gn(),l0=gn(),c0=gn(),u0=gn(),d0=gn(),f0=gn(),Rt=class ln{constructor(n){this.columns=n,n.length===0&&(this.columns=[Ji.from([])])}static from(n){return new ln(n.map(a=>Ji.from(a)))}static fromWithPreviousShape(n,a){if(!a)return ln.from([n]);let o=a.getColumns(),s=Array.from({length:o.length},()=>[]),c=0;for(let h of n){let p=o.findIndex(g=>g.idSet.has(h));p===-1?s[c].push(h):(c=p,s[p].push(h))}return new ln(s.map((h,p)=>Ji.fromWithPreviousShape(h,o[p])))}isEmpty(){return this.columns.length===0?!0:this.columns.every(n=>n.nodes.length===0)}static fromIdsAndColumns(n){let a=Math.max(1,...n.map(([,c])=>(c??0)+1)),o=Array.from({length:a},()=>[]),s=0;for(let[c,h]of n)h==null||h<0?o[s].push(c):(o[h].push(c),s=h);return ln.from(o)}get topLevelIds(){return this.columns.map(n=>n.topLevelIds)}get iterateTopLevelIds(){let n=this.columns;function*a(){for(let o of n)for(let s of o.topLevelIds)yield s}return a()}get inOrderIds(){return this.columns.flatMap(n=>n.inOrderIds)}get colLength(){return this.columns.length}get idLength(){return this.columns.reduce((n,a)=>n+a.nodes.length,0)}get _columnMap(){return new Map(this.columns.map(n=>[n.id,n]))}at(n){return this.columns[n]}get(n){return this._columnMap.get(n)}atOrThrow(n){let a=this.columns[n];if(!a)throw Error(`Column ${n} not found`);return a}hasOnlyOneColumn(){return this.columns.length===1}getColumns(){return this.columns}hasOnlyOneId(){return this.idLength===1}getColumnIds(){return this.columns.map(n=>n.id)}indexOf(n){return this.columns.indexOf(n)}addColumn(n,a=[]){return new ln(this.columns.flatMap(o=>o.id===n?[o,Ji.from(a)]:[o]))}insertBreakpoint(n){let a=this.findWithId(n),[o,s]=a.split(n);return new ln(this.columns.flatMap(c=>c===a?[o,s].filter(Boolean):[c]))}delete(n){if(this.columns.length<=1)return this;let a=this.indexOfOrThrow(n),o=a===0?1:a-1,s=[...this.columns],c=s[a];return s[o]=c.withNodes([...s[o].nodes,...c.nodes]),s.splice(a,1),new ln(s)}mergeAllColumns(){if(this.columns.length<=1)return this;let n=this.columns.flatMap(o=>o.nodes),a=this.columns[0];return new ln([a.withNodes(n)])}moveWithinColumn(n,a,o){return this.transform(n,s=>s.move(a,o))}moveAcrossColumns(n,a,o,s){let c=this.indexOfOrThrow(n),h=this.indexOfOrThrow(o),p=[...this.columns],g=p[c],b=g.nodes.findIndex(C=>C.value===a);if(b===-1)throw Error(`Node ${a} not found in column ${n}`);let _=g.nodes[b];p[c]=g.withNodes(g.nodes.filter((C,E)=>E!==b));let S=p[h];if(s){let C=S.indexOfOrThrow(s);p[h]=S.withNodes(K2(S.nodes,C,_))}else p[h]=S.withNodes([_,...S.nodes]);return new ln(p)}indexOfOrThrow(n){let a=this.columns.findIndex(o=>o.id===n);if(a===-1)throw Error(`Column ${n} not found. Possible values: ${this.getColumnIds().join(", ")}`);return a}moveColumn(n,a){if(n===a)return this;let o=this.indexOfOrThrow(n),s=a==="_left_"?o-1:a==="_right_"?o+1:this.indexOfOrThrow(a);return bx(o,s),new ln(gl([...this.columns],o,s))}moveToNewColumn(n){let a=this.findWithId(n),o=this.columns.map(c=>c.id===a.id?c.delete(n):c),s=Ji.from([n]);return new ln([...o,s])}findWithId(n){let a=this.columns.find(o=>o.inOrderIds.includes(n));if(!a)throw be.log(`Possible values: ${this.columns.map(o=>o.inOrderIds).join(", ")}`),Error(`Cell ${n} not found in any column`);return a}transformWithCellId(n,a){let o=!1,s=this.columns.map(c=>{if(c.inOrderIds.includes(n)){let h=a(c);return c!==h&&(o=!0),h}return c});return o?new ln(s):this}setupCellExists(){return this.columns.some(n=>n.topLevelIds.includes(Vn))}insertId(n,a,o){return this.transform(a,s=>s.insert(n,o))}deleteById(n){return this.transformWithCellId(n,a=>a.delete(n))}compact(){return this.columns.length===1||!this.columns.some(n=>n.nodes.length===0)?this:new ln(this.columns.filter(n=>n.nodes.length>0))}transform(n,a){let o=this._columnMap.get(n);if(!o)return be.warn(`Column ${n} not found`),this;let s=a(o);return o===s?this:new ln(this.columns.map(c=>c.id===n?s:c))}transformAll(n){let a=!1,o=this.columns.map(s=>{let c=n(s);return s.equals(c)||(a=!0),c});return a?new ln(o):this}},Tn(Rt.prototype,"isEmpty",[s0],Object.getOwnPropertyDescriptor(Rt.prototype,"isEmpty"),Rt.prototype),Tn(Rt.prototype,"topLevelIds",[l0],Object.getOwnPropertyDescriptor(Rt.prototype,"topLevelIds"),Rt.prototype),Tn(Rt.prototype,"inOrderIds",[c0],Object.getOwnPropertyDescriptor(Rt.prototype,"inOrderIds"),Rt.prototype),Tn(Rt.prototype,"idLength",[u0],Object.getOwnPropertyDescriptor(Rt.prototype,"idLength"),Rt.prototype),Tn(Rt.prototype,"_columnMap",[d0],Object.getOwnPropertyDescriptor(Rt.prototype,"_columnMap"),Rt.prototype),Tn(Rt.prototype,"getColumnIds",[f0],Object.getOwnPropertyDescriptor(Rt.prototype,"getColumnIds"),Rt.prototype),Rt);let gd,yd,vd,p0,bd,h0,m0,g0,y0,wd,_d,v0,xd,kd;gd=tt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var n;(function(o){o.Root="root",o.Text="text",o.Directive="directive",o.Comment="comment",o.Script="script",o.Style="style",o.Tag="tag",o.CDATA="cdata",o.Doctype="doctype"})(n=e.ElementType||(e.ElementType={}));function a(o){return o.type===n.Tag||o.type===n.Script||o.type===n.Style}e.isTag=a,e.Root=n.Root,e.Text=n.Text,e.Directive=n.Directive,e.Comment=n.Comment,e.Script=n.Script,e.Style=n.Style,e.Tag=n.Tag,e.CDATA=n.CDATA,e.Doctype=n.Doctype})),yd=tt((e=>{var n=e&&e.__extends||(function(){var R=function(j,F){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(se,ce){se.__proto__=ce}||function(se,ce){for(var he in ce)Object.prototype.hasOwnProperty.call(ce,he)&&(se[he]=ce[he])},R(j,F)};return function(j,F){if(typeof F!="function"&&F!==null)throw TypeError("Class extends value "+String(F)+" is not a constructor or null");R(j,F);function se(){this.constructor=j}j.prototype=F===null?Object.create(F):(se.prototype=F.prototype,new se)}})(),a=e&&e.__assign||function(){return a=Object.assign||function(R){for(var j,F=1,se=arguments.length;F<se;F++)for(var ce in j=arguments[F],j)Object.prototype.hasOwnProperty.call(j,ce)&&(R[ce]=j[ce]);return R},a.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.cloneNode=e.hasChildren=e.isDocument=e.isDirective=e.isComment=e.isText=e.isCDATA=e.isTag=e.Element=e.Document=e.CDATA=e.NodeWithChildren=e.ProcessingInstruction=e.Comment=e.Text=e.DataNode=e.Node=void 0;var o=gd(),s=(function(){function R(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(R.prototype,"parentNode",{get:function(){return this.parent},set:function(j){this.parent=j},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"previousSibling",{get:function(){return this.prev},set:function(j){this.prev=j},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"nextSibling",{get:function(){return this.next},set:function(j){this.next=j},enumerable:!1,configurable:!0}),R.prototype.cloneNode=function(j){return j===void 0&&(j=!1),ne(this,j)},R})();e.Node=s;var c=(function(R){n(j,R);function j(F){var se=R.call(this)||this;return se.data=F,se}return Object.defineProperty(j.prototype,"nodeValue",{get:function(){return this.data},set:function(F){this.data=F},enumerable:!1,configurable:!0}),j})(s);e.DataNode=c;var h=(function(R){n(j,R);function j(){var F=R!==null&&R.apply(this,arguments)||this;return F.type=o.ElementType.Text,F}return Object.defineProperty(j.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),j})(c);e.Text=h;var p=(function(R){n(j,R);function j(){var F=R!==null&&R.apply(this,arguments)||this;return F.type=o.ElementType.Comment,F}return Object.defineProperty(j.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),j})(c);e.Comment=p;var g=(function(R){n(j,R);function j(F,se){var ce=R.call(this,se)||this;return ce.name=F,ce.type=o.ElementType.Directive,ce}return Object.defineProperty(j.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),j})(c);e.ProcessingInstruction=g;var b=(function(R){n(j,R);function j(F){var se=R.call(this)||this;return se.children=F,se}return Object.defineProperty(j.prototype,"firstChild",{get:function(){return this.children[0]??null},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"childNodes",{get:function(){return this.children},set:function(F){this.children=F},enumerable:!1,configurable:!0}),j})(s);e.NodeWithChildren=b;var _=(function(R){n(j,R);function j(){var F=R!==null&&R.apply(this,arguments)||this;return F.type=o.ElementType.CDATA,F}return Object.defineProperty(j.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),j})(b);e.CDATA=_;var S=(function(R){n(j,R);function j(){var F=R!==null&&R.apply(this,arguments)||this;return F.type=o.ElementType.Root,F}return Object.defineProperty(j.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),j})(b);e.Document=S;var C=(function(R){n(j,R);function j(F,se,ce,he){ce===void 0&&(ce=[]),he===void 0&&(he=F==="script"?o.ElementType.Script:F==="style"?o.ElementType.Style:o.ElementType.Tag);var ye=R.call(this,ce)||this;return ye.name=F,ye.attribs=se,ye.type=he,ye}return Object.defineProperty(j.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"tagName",{get:function(){return this.name},set:function(F){this.name=F},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"attributes",{get:function(){var F=this;return Object.keys(this.attribs).map(function(se){var ce,he;return{name:se,value:F.attribs[se],namespace:(ce=F["x-attribsNamespace"])==null?void 0:ce[se],prefix:(he=F["x-attribsPrefix"])==null?void 0:he[se]}})},enumerable:!1,configurable:!0}),j})(b);e.Element=C;function E(R){return(0,o.isTag)(R)}e.isTag=E;function O(R){return R.type===o.ElementType.CDATA}e.isCDATA=O;function M(R){return R.type===o.ElementType.Text}e.isText=M;function V(R){return R.type===o.ElementType.Comment}e.isComment=V;function H(R){return R.type===o.ElementType.Directive}e.isDirective=H;function $(R){return R.type===o.ElementType.Root}e.isDocument=$;function N(R){return Object.prototype.hasOwnProperty.call(R,"children")}e.hasChildren=N;function ne(R,j){j===void 0&&(j=!1);var F;if(M(R))F=new h(R.data);else if(V(R))F=new p(R.data);else if(E(R)){var se=j?fe(R.children):[],ce=new C(R.name,a({},R.attribs),se);se.forEach(function(Qe){return Qe.parent=ce}),R.namespace!=null&&(ce.namespace=R.namespace),R["x-attribsNamespace"]&&(ce["x-attribsNamespace"]=a({},R["x-attribsNamespace"])),R["x-attribsPrefix"]&&(ce["x-attribsPrefix"]=a({},R["x-attribsPrefix"])),F=ce}else if(O(R)){var se=j?fe(R.children):[],he=new _(se);se.forEach(function(pe){return pe.parent=he}),F=he}else if($(R)){var se=j?fe(R.children):[],ye=new S(se);se.forEach(function(pe){return pe.parent=ye}),R["x-mode"]&&(ye["x-mode"]=R["x-mode"]),F=ye}else if(H(R)){var xe=new g(R.name,R.data);R["x-name"]!=null&&(xe["x-name"]=R["x-name"],xe["x-publicId"]=R["x-publicId"],xe["x-systemId"]=R["x-systemId"]),F=xe}else throw Error(`Not implemented yet: ${R.type}`);return F.startIndex=R.startIndex,F.endIndex=R.endIndex,R.sourceCodeLocation!=null&&(F.sourceCodeLocation=R.sourceCodeLocation),F}e.cloneNode=ne;function fe(R){for(var j=R.map(function(se){return ne(se,!0)}),F=1;F<j.length;F++)j[F].prev=j[F-1],j[F-1].next=j[F];return j}})),vd=tt((e=>{var n=e&&e.__createBinding||(Object.create?(function(p,g,b,_){_===void 0&&(_=b);var S=Object.getOwnPropertyDescriptor(g,b);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[b]}}),Object.defineProperty(p,_,S)}):(function(p,g,b,_){_===void 0&&(_=b),p[_]=g[b]})),a=e&&e.__exportStar||function(p,g){for(var b in p)b!=="default"&&!Object.prototype.hasOwnProperty.call(g,b)&&n(g,p,b)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var o=gd(),s=yd();a(yd(),e);var c={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},h=(function(){function p(g,b,_){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof b=="function"&&(_=b,b=c),typeof g=="object"&&(b=g,g=void 0),this.callback=g??null,this.options=b??c,this.elementCB=_??null}return p.prototype.onparserinit=function(g){this.parser=g},p.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},p.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},p.prototype.onerror=function(g){this.handleCallback(g)},p.prototype.onclosetag=function(){this.lastNode=null;var g=this.tagStack.pop();this.options.withEndIndices&&(g.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(g)},p.prototype.onopentag=function(g,b){var _=this.options.xmlMode?o.ElementType.Tag:void 0,S=new s.Element(g,b,void 0,_);this.addNode(S),this.tagStack.push(S)},p.prototype.ontext=function(g){var b=this.lastNode;if(b&&b.type===o.ElementType.Text)b.data+=g,this.options.withEndIndices&&(b.endIndex=this.parser.endIndex);else{var _=new s.Text(g);this.addNode(_),this.lastNode=_}},p.prototype.oncomment=function(g){if(this.lastNode&&this.lastNode.type===o.ElementType.Comment){this.lastNode.data+=g;return}var b=new s.Comment(g);this.addNode(b),this.lastNode=b},p.prototype.oncommentend=function(){this.lastNode=null},p.prototype.oncdatastart=function(){var g=new s.Text(""),b=new s.CDATA([g]);this.addNode(b),g.parent=b,this.lastNode=g},p.prototype.oncdataend=function(){this.lastNode=null},p.prototype.onprocessinginstruction=function(g,b){var _=new s.ProcessingInstruction(g,b);this.addNode(_)},p.prototype.handleCallback=function(g){if(typeof this.callback=="function")this.callback(g,this.dom);else if(g)throw g},p.prototype.addNode=function(g){var b=this.tagStack[this.tagStack.length-1],_=b.children[b.children.length-1];this.options.withStartIndices&&(g.startIndex=this.parser.startIndex),this.options.withEndIndices&&(g.endIndex=this.parser.endIndex),b.children.push(g),_&&(g.prev=_,_.next=g),g.parent=b,this.lastNode=null},p})();e.DomHandler=h,e.default=h})),p0=tt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=e.CARRIAGE_RETURN_PLACEHOLDER=e.CARRIAGE_RETURN_REGEX=e.CARRIAGE_RETURN=e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES="animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.linearGradient.radialGradient.textPath".split("."),e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce(function(n,a){return n[a.toLowerCase()]=a,n},{}),e.CARRIAGE_RETURN="\r",e.CARRIAGE_RETURN_REGEX=new RegExp(e.CARRIAGE_RETURN,"g"),e.CARRIAGE_RETURN_PLACEHOLDER=`__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_${Date.now()}__`,e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(e.CARRIAGE_RETURN_PLACEHOLDER,"g")})),bd=tt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=s,e.escapeSpecialCharacters=h,e.revertEscapedCharacters=p,e.formatDOM=g;var n=vd(),a=p0();function o(b){return a.CASE_SENSITIVE_TAG_NAMES_MAP[b]}function s(b){for(var _={},S=0,C=b.length;S<C;S++){var E=b[S];_[E.name]=E.value}return _}function c(b){return b=b.toLowerCase(),o(b)||b}function h(b){return b.replace(a.CARRIAGE_RETURN_REGEX,a.CARRIAGE_RETURN_PLACEHOLDER)}function p(b){return b.replace(a.CARRIAGE_RETURN_PLACEHOLDER_REGEX,a.CARRIAGE_RETURN)}function g(b,_,S){_===void 0&&(_=null);for(var C=[],E,O=0,M=b.length;O<M;O++){var V=b[O];switch(V.nodeType){case 1:var H=c(V.nodeName);E=new n.Element(H,s(V.attributes)),E.children=g(H==="template"?V.content.childNodes:V.childNodes,E);break;case 3:E=new n.Text(p(V.nodeValue));break;case 8:E=new n.Comment(V.nodeValue);break;default:continue}var $=C[O-1]||null;$&&($.next=E),E.parent=_,E.prev=$,E.next=null,C.push(E)}return S&&(E=new n.ProcessingInstruction(S.substring(0,S.indexOf(" ")).toLowerCase(),S),E.next=C[0]||null,E.parent=_,C.unshift(E),C[1]&&(C[1].prev=C[0])),C}})),h0=tt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=V;var n=bd(),a="html",o="head",s="body",c=/<([a-zA-Z]+[0-9]?)/,h=/<head[^]*>/i,p=/<body[^]*>/i,g=function(H,$){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},b=function(H,$){throw Error("This browser does not support `DOMParser.prototype.parseFromString`")},_=typeof window=="object"&&window.DOMParser;if(typeof _=="function"){var S=new _,C="text/html";b=function(H,$){return $&&(H=`<${$}>${H}</${$}>`),S.parseFromString(H,C)},g=b}if(typeof document=="object"&&document.implementation){var E=document.implementation.createHTMLDocument();g=function(H,$){if($){var N=E.documentElement.querySelector($);return N&&(N.innerHTML=H),E}return E.documentElement.innerHTML=H,E}}var O=typeof document=="object"&&document.createElement("template"),M;O&&O.content&&(M=function(H){return O.innerHTML=H,O.content.childNodes});function V(H){var $,N;H=(0,n.escapeSpecialCharacters)(H);var ne=H.match(c),fe=ne&&ne[1]?ne[1].toLowerCase():"";switch(fe){case a:var R=b(H);if(!h.test(H)){var F=R.querySelector(o);($=F==null?void 0:F.parentNode)==null||$.removeChild(F)}if(!p.test(H)){var F=R.querySelector(s);(N=F==null?void 0:F.parentNode)==null||N.removeChild(F)}return R.querySelectorAll(a);case o:case s:var j=g(H).querySelectorAll(fe);return p.test(H)&&h.test(H)?j[0].parentNode.childNodes:j;default:if(M)return M(H);var F=g(H,s).querySelector(s);return F.childNodes}}})),m0=tt((e=>{var n=e&&e.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var a=n(h0()),o=bd(),s=/<(![a-zA-Z\s]+)>/;function c(h){if(typeof h!="string")throw TypeError("First argument must be a string");if(!h)return[];var p=h.match(s),g=p?p[1]:void 0;return(0,o.formatDOM)((0,a.default)(h),null,g)}})),g0=tt((e=>{e.SAME=0,e.CAMELCASE=1,e.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}})),y0=tt((e=>{var n=0,a=1,o=2,s=3,c=4,h=5,p=6;function g(N){return _.hasOwnProperty(N)?_[N]:null}function b(N,ne,fe,R,j,F,se){this.acceptsBooleans=ne===o||ne===s||ne===c,this.attributeName=R,this.attributeNamespace=j,this.mustUseProperty=fe,this.propertyName=N,this.type=ne,this.sanitizeURL=F,this.removeEmptyString=se}var _={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(N=>{_[N]=new b(N,n,!1,N,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([N,ne])=>{_[N]=new b(N,a,!1,ne,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(N=>{_[N]=new b(N,o,!1,N.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(N=>{_[N]=new b(N,o,!1,N,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(N=>{_[N]=new b(N,s,!1,N.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(N=>{_[N]=new b(N,s,!0,N,null,!1,!1)}),["capture","download"].forEach(N=>{_[N]=new b(N,c,!1,N,null,!1,!1)}),["cols","rows","size","span"].forEach(N=>{_[N]=new b(N,p,!1,N,null,!1,!1)}),["rowSpan","start"].forEach(N=>{_[N]=new b(N,h,!1,N.toLowerCase(),null,!1,!1)});var S=/[\-\:]([a-z])/g,C=N=>N[1].toUpperCase();"accent-height.alignment-baseline.arabic-form.baseline-shift.cap-height.clip-path.clip-rule.color-interpolation.color-interpolation-filters.color-profile.color-rendering.dominant-baseline.enable-background.fill-opacity.fill-rule.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.glyph-name.glyph-orientation-horizontal.glyph-orientation-vertical.horiz-adv-x.horiz-origin-x.image-rendering.letter-spacing.lighting-color.marker-end.marker-mid.marker-start.overline-position.overline-thickness.paint-order.panose-1.pointer-events.rendering-intent.shape-rendering.stop-color.stop-opacity.strikethrough-position.strikethrough-thickness.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.text-anchor.text-decoration.text-rendering.underline-position.underline-thickness.unicode-bidi.unicode-range.units-per-em.v-alphabetic.v-hanging.v-ideographic.v-mathematical.vector-effect.vert-adv-y.vert-origin-x.vert-origin-y.word-spacing.writing-mode.xmlns:xlink.x-height".split(".").forEach(N=>{let ne=N.replace(S,C);_[ne]=new b(ne,a,!1,N,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(N=>{let ne=N.replace(S,C);_[ne]=new b(ne,a,!1,N,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(N=>{let ne=N.replace(S,C);_[ne]=new b(ne,a,!1,N,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(N=>{_[N]=new b(N,a,!1,N.toLowerCase(),null,!1,!1)});var E="xlinkHref";_[E]=new b("xlinkHref",a,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(N=>{_[N]=new b(N,a,!1,N.toLowerCase(),null,!0,!0)});var{CAMELCASE:O,SAME:M,possibleStandardNames:V}=g0(),H=RegExp.prototype.test.bind(RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),$=Object.keys(V).reduce((N,ne)=>{let fe=V[ne];return fe===M?N[ne]=ne:fe===O?N[ne.toLowerCase()]=ne:N[ne]=fe,N},{});e.BOOLEAN=s,e.BOOLEANISH_STRING=o,e.NUMERIC=h,e.OVERLOADED_BOOLEAN=c,e.POSITIVE_NUMERIC=p,e.RESERVED=n,e.STRING=a,e.getPropertyInfo=g,e.isCustomAttribute=H,e.possibleStandardNames=$})),wd=tt((e=>{var n=e&&e.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=c,e.setStyleProp=p;var a=ku(),o=n(eT()),s=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function c(g,b){return g.includes("-")?!s.has(g):!!(b&&typeof b.is=="string")}var h={reactCompat:!0};function p(g,b){if(typeof g=="string"){if(!g.trim()){b.style={};return}try{b.style=(0,o.default)(g,h)}catch{b.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(a.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),e.canTextBeChildOfNode=function(g){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(g.name)},e.returnFirstArg=function(g){return g}})),_d=tt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=h;var n=y0(),a=wd(),o=["checked","value"],s=["input","select","textarea"],c={reset:!0,submit:!0};function h(g,b){g===void 0&&(g={});var _={},S=!!(g.type&&c[g.type]);for(var C in g){var E=g[C];if((0,n.isCustomAttribute)(C)){_[C]=E;continue}var O=C.toLowerCase(),M=p(O);if(M){var V=(0,n.getPropertyInfo)(M);switch(o.includes(M)&&s.includes(b)&&!S&&(M=p("default"+O)),_[M]=E,V&&V.type){case n.BOOLEAN:_[M]=!0;break;case n.OVERLOADED_BOOLEAN:E===""&&(_[M]=!0);break}continue}a.PRESERVE_CUSTOM_ATTRIBUTES&&(_[C]=E)}return(0,a.setStyleProp)(g.style,_),_}function p(g){return n.possibleStandardNames[g]}})),v0=tt((e=>{var n=e&&e.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=h;var a=ku(),o=n(_d()),s=wd(),c={cloneElement:a.cloneElement,createElement:a.createElement,isValidElement:a.isValidElement};function h(g,b){b===void 0&&(b={});for(var _=[],S=typeof b.replace=="function",C=b.transform||s.returnFirstArg,E=b.library||c,O=E.cloneElement,M=E.createElement,V=E.isValidElement,H=g.length,$=0;$<H;$++){var N=g[$];if(S){var ne=b.replace(N,$);if(V(ne)){H>1&&(ne=O(ne,{key:ne.key||$})),_.push(C(ne,N,$));continue}}if(N.type==="text"){var fe=!N.data.trim().length;if(fe&&N.parent&&!(0,s.canTextBeChildOfNode)(N.parent)||b.trim&&fe)continue;_.push(C(N.data,N,$));continue}var R=N,j={};p(R)?((0,s.setStyleProp)(R.attribs.style,R.attribs),j=R.attribs):R.attribs&&(j=(0,o.default)(R.attribs,R.name));var F=void 0;switch(N.type){case"script":case"style":N.children[0]&&(j.dangerouslySetInnerHTML={__html:N.children[0].data});break;case"tag":N.name==="textarea"&&N.children[0]?j.defaultValue=N.children[0].data:N.children&&N.children.length&&(F=h(N.children,b));break;default:continue}H>1&&(j.key=$),_.push(C(M(N.name,j,F),N,$))}return _.length===1?_[0]:_}function p(g){return s.PRESERVE_CUSTOM_ATTRIBUTES&&g.type==="tag"&&(0,s.isCustomComponent)(g.name,g.attribs)}})),xd=tt((e=>{var n=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=h;var a=n(m0());e.htmlToDOM=a.default,e.attributesToProps=n(_d()).default;var o=n(v0());e.domToReact=o.default;var s=vd();Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return s.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return s.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return s.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return s.Text}});var c={lowerCaseAttributeNames:!1};function h(p,g){if(typeof p!="string")throw TypeError("First argument must be a string");return p?(0,o.default)((0,a.default)(p,(g==null?void 0:g.htmlparser2)||c),g):[]}})),kd=gh(xd(),1),Ja=xd(),pm=kd.default.default||kd.default;let Ml;Ml=(e,n)=>{let[a,...o]=n.split("."),s=(e.attribs.class||"").split(" ");return e.tagName===a&&o.every(c=>s.includes(c))},vw=e=>{var n;return e&&Ml(e,"span.nb")&&e.firstChild instanceof Ja.Text&&((n=e.firstChild.nodeValue)==null?void 0:n.includes("__marimo__"))},sm=function(e){var n,a,o;if(e instanceof Ja.Element&&e.firstChild instanceof Ja.Text&&Ml(e,"span.nb")){let s=e.next;if(s&&s instanceof Ja.Text){let c=s.next;if(c&&c instanceof Ja.Element&&c.firstChild instanceof Ja.Text&&Ml(c,"span.m")){let h=Number.parseInt(c.firstChild.nodeValue||"0",10);if((n=e.firstChild.nodeValue)!=null&&n.includes("__marimo__")){let p=(a=/__marimo__cell_(\w+)_/.exec(e.firstChild.nodeValue))==null?void 0:a[1];if(p&&h)return{kind:"cell",cellId:p,lineNumber:h}}else{let p=(o=/"(.+?)"/.exec(e.firstChild.nodeValue))==null?void 0:o[1];if(p&&h)return{kind:"file",filePath:p,lineNumber:h}}}}}return null},um=function(e){let n=[];return pm(e,{replace:a=>{let o=sm(a);if(o)return n.push(o),"dummy"}}),n};function b0(e){return n=>{let a=!1;for(let o of n)o&&(a=e(o)||a);return a}}const _x=b0(k5),xx=b0(S5);let Sd,w0,Xi,_0,Yi,x0;Sd=tt(((e,n)=>{var a=typeof Reflect=="object"?Reflect:null,o=a&&typeof a.apply=="function"?a.apply:function(R,j,F){return Function.prototype.apply.call(R,j,F)},s=a&&typeof a.ownKeys=="function"?a.ownKeys:Object.getOwnPropertySymbols?function(R){return Object.getOwnPropertyNames(R).concat(Object.getOwnPropertySymbols(R))}:function(R){return Object.getOwnPropertyNames(R)};function c(R){console&&console.warn&&console.warn(R)}var h=Number.isNaN||function(R){return R!==R};function p(){p.init.call(this)}n.exports=p,n.exports.once=N,p.EventEmitter=p,p.prototype._events=void 0,p.prototype._eventsCount=0,p.prototype._maxListeners=void 0;var g=10;function b(R){if(typeof R!="function")throw TypeError('The "listener" argument must be of type Function. Received type '+typeof R)}Object.defineProperty(p,"defaultMaxListeners",{enumerable:!0,get:function(){return g},set:function(R){if(typeof R!="number"||R<0||h(R))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+R+".");g=R}}),p.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},p.prototype.setMaxListeners=function(R){if(typeof R!="number"||R<0||h(R))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+R+".");return this._maxListeners=R,this};function _(R){return R._maxListeners===void 0?p.defaultMaxListeners:R._maxListeners}p.prototype.getMaxListeners=function(){return _(this)},p.prototype.emit=function(R){for(var j=[],F=1;F<arguments.length;F++)j.push(arguments[F]);var se=R==="error",ce=this._events;if(ce!==void 0)se&&(se=ce.error===void 0);else if(!se)return!1;if(se){var he;if(j.length>0&&(he=j[0]),he instanceof Error)throw he;var ye=Error("Unhandled error."+(he?" ("+he.message+")":""));throw ye.context=he,ye}var xe=ce[R];if(xe===void 0)return!1;if(typeof xe=="function")o(xe,this,j);else for(var Qe=xe.length,pe=V(xe,Qe),F=0;F<Qe;++F)o(pe[F],this,j);return!0};function S(R,j,F,se){var ce,he,ye;if(b(F),he=R._events,he===void 0?(he=R._events=Object.create(null),R._eventsCount=0):(he.newListener!==void 0&&(R.emit("newListener",j,F.listener?F.listener:F),he=R._events),ye=he[j]),ye===void 0)ye=he[j]=F,++R._eventsCount;else if(typeof ye=="function"?ye=he[j]=se?[F,ye]:[ye,F]:se?ye.unshift(F):ye.push(F),ce=_(R),ce>0&&ye.length>ce&&!ye.warned){ye.warned=!0;var xe=Error("Possible EventEmitter memory leak detected. "+ye.length+" "+String(j)+" listeners added. Use emitter.setMaxListeners() to increase limit");xe.name="MaxListenersExceededWarning",xe.emitter=R,xe.type=j,xe.count=ye.length,c(xe)}return R}p.prototype.addListener=function(R,j){return S(this,R,j,!1)},p.prototype.on=p.prototype.addListener,p.prototype.prependListener=function(R,j){return S(this,R,j,!0)};function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function E(R,j,F){var se={fired:!1,wrapFn:void 0,target:R,type:j,listener:F},ce=C.bind(se);return ce.listener=F,se.wrapFn=ce,ce}p.prototype.once=function(R,j){return b(j),this.on(R,E(this,R,j)),this},p.prototype.prependOnceListener=function(R,j){return b(j),this.prependListener(R,E(this,R,j)),this},p.prototype.removeListener=function(R,j){var F,se,ce,he,ye;if(b(j),se=this._events,se===void 0||(F=se[R],F===void 0))return this;if(F===j||F.listener===j)--this._eventsCount===0?this._events=Object.create(null):(delete se[R],se.removeListener&&this.emit("removeListener",R,F.listener||j));else if(typeof F!="function"){for(ce=-1,he=F.length-1;he>=0;he--)if(F[he]===j||F[he].listener===j){ye=F[he].listener,ce=he;break}if(ce<0)return this;ce===0?F.shift():H(F,ce),F.length===1&&(se[R]=F[0]),se.removeListener!==void 0&&this.emit("removeListener",R,ye||j)}return this},p.prototype.off=p.prototype.removeListener,p.prototype.removeAllListeners=function(R){var j,F=this._events,se;if(F===void 0)return this;if(F.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):F[R]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete F[R]),this;if(arguments.length===0){var ce=Object.keys(F),he;for(se=0;se<ce.length;++se)he=ce[se],he!=="removeListener"&&this.removeAllListeners(he);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(j=F[R],typeof j=="function")this.removeListener(R,j);else if(j!==void 0)for(se=j.length-1;se>=0;se--)this.removeListener(R,j[se]);return this};function O(R,j,F){var se=R._events;if(se===void 0)return[];var ce=se[j];return ce===void 0?[]:typeof ce=="function"?F?[ce.listener||ce]:[ce]:F?$(ce):V(ce,ce.length)}p.prototype.listeners=function(R){return O(this,R,!0)},p.prototype.rawListeners=function(R){return O(this,R,!1)},p.listenerCount=function(R,j){return typeof R.listenerCount=="function"?R.listenerCount(j):M.call(R,j)},p.prototype.listenerCount=M;function M(R){var j=this._events;if(j!==void 0){var F=j[R];if(typeof F=="function")return 1;if(F!==void 0)return F.length}return 0}p.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function V(R,j){for(var F=Array(j),se=0;se<j;++se)F[se]=R[se];return F}function H(R,j){for(;j+1<R.length;j++)R[j]=R[j+1];R.pop()}function $(R){for(var j=Array(R.length),F=0;F<j.length;++F)j[F]=R[F].listener||R[F];return j}function N(R,j){return new Promise(function(F,se){function ce(ye){R.removeListener(j,he),se(ye)}function he(){typeof R.removeListener=="function"&&R.removeListener("error",ce),F([].slice.call(arguments))}fe(R,j,he,{once:!0}),j!=="error"&&ne(R,ce,{once:!0})})}function ne(R,j,F){typeof R.on=="function"&&fe(R,"error",j,F)}function fe(R,j,F,se){if(typeof R.on=="function")se.once?R.once(j,F):R.on(j,F);else if(typeof R.addEventListener=="function")R.addEventListener(j,function ce(he){se.once&&R.removeEventListener(j,ce),F(he)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof R)}})),w0=tt((e=>{var n=e&&e.__awaiter||function(s,c,h,p){function g(b){return b instanceof h?b:new h(function(_){_(b)})}return new(h||(h=Promise))(function(b,_){function S(O){try{E(p.next(O))}catch(M){_(M)}}function C(O){try{E(p.throw(O))}catch(M){_(M)}}function E(O){O.done?b(O.value):g(O.value).then(S,C)}E((p=p.apply(s,c||[])).next())})},a=e&&e.__generator||function(s,c){var h={label:0,sent:function(){if(b[0]&1)throw b[1];return b[1]},trys:[],ops:[]},p,g,b,_;return _={next:S(0),throw:S(1),return:S(2)},typeof Symbol=="function"&&(_[Symbol.iterator]=function(){return this}),_;function S(E){return function(O){return C([E,O])}}function C(E){if(p)throw TypeError("Generator is already executing.");for(;h;)try{if(p=1,g&&(b=E[0]&2?g.return:E[0]?g.throw||((b=g.return)&&b.call(g),0):g.next)&&!(b=b.call(g,E[1])).done)return b;switch(g=0,b&&(E=[E[0]&2,b.value]),E[0]){case 0:case 1:b=E;break;case 4:return h.label++,{value:E[1],done:!1};case 5:h.label++,g=E[1],E=[0];continue;case 7:E=h.ops.pop(),h.trys.pop();continue;default:if(b=h.trys,!(b=b.length>0&&b[b.length-1])&&(E[0]===6||E[0]===2)){h=0;continue}if(E[0]===3&&(!b||E[1]>b[0]&&E[1]<b[3])){h.label=E[1];break}if(E[0]===6&&h.label<b[1]){h.label=b[1],b=E;break}if(b&&h.label<b[2]){h.label=b[2],h.ops.push(E);break}b[2]&&h.ops.pop(),h.trys.pop();continue}E=c.call(s,h)}catch(O){E=[6,O],g=0}finally{p=b=0}if(E[0]&5)throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultNextRequest=void 0;var o=Sd();e.defaultNextRequest=function(){var s=-1;return function(){return++s}},e.default=(function(){function s(c,h){h===void 0&&(h=e.defaultNextRequest()),this.batch=[],this.batchStarted=!1,this.lastId=-1,this.transports=c,this.requests={},this.connectPromise=this.connect(),this.requestChannel=new o.EventEmitter,this.nextID=h}return s.prototype.connect=function(){var c=this;return Promise.all(this.transports.map(function(h){return n(c,void 0,void 0,function(){return a(this,function(p){switch(p.label){case 0:return h.subscribe("error",this.handleError.bind(this)),h.subscribe("notification",this.handleNotification.bind(this)),[4,h.connect()];case 1:return p.sent(),[2]}})})}))},s.prototype.getPrimaryTransport=function(){return this.transports[0]},s.prototype.request=function(c,h,p){return h===void 0&&(h=!1),n(this,void 0,void 0,function(){var g,b,_,S,C=this;return a(this,function(E){return g=this.nextID().toString(),b=h?null:g,_={request:this.makeRequest(c.method,c.params||[],b),internalID:g},this.batchStarted?(S=new Promise(function(O,M){C.batch.push({resolve:O,reject:M,request:_})}),[2,S]):[2,this.getPrimaryTransport().sendData(_,p)]})})},s.prototype.close=function(){this.requestChannel.removeAllListeners(),this.transports.forEach(function(c){c.unsubscribe(),c.close()})},s.prototype.startBatch=function(){this.batchStarted=!0},s.prototype.stopBatch=function(){if(this.batchStarted===!1)throw Error("cannot end that which has never started");if(this.batch.length===0){this.batchStarted=!1;return}this.getPrimaryTransport().sendData(this.batch),this.batch=[],this.batchStarted=!1},s.prototype.makeRequest=function(c,h,p){return p?{jsonrpc:"2.0",id:p,method:c,params:h}:{jsonrpc:"2.0",method:c,params:h}},s.prototype.handleError=function(c){this.requestChannel.emit("error",c)},s.prototype.handleNotification=function(c){this.requestChannel.emit("notification",c)},s})()})),Xi=tt((e=>{var n=e&&e.__extends||(function(){var o=function(s,c){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var g in p)p.hasOwnProperty(g)&&(h[g]=p[g])},o(s,c)};return function(s,c){o(s,c);function h(){this.constructor=s}s.prototype=c===null?Object.create(c):(h.prototype=c.prototype,new h)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.convertJSONToRPCError=e.JSONRPCError=e.ERR_UNKNOWN=e.ERR_MISSIING_ID=e.ERR_TIMEOUT=void 0,e.ERR_TIMEOUT=7777,e.ERR_MISSIING_ID=7878,e.ERR_UNKNOWN=7979;var a=(function(o){n(s,o);function s(c,h,p){var g=this.constructor,b=o.call(this,c)||this;return b.message=c,b.code=h,b.data=p,Object.setPrototypeOf(b,g.prototype),b}return s})(Error);e.JSONRPCError=a,e.convertJSONToRPCError=function(o){if(o.error){var s=o.error,c=s.message,h=s.code,p=s.data;return new a(c,h,p)}return new a("Unknown error",e.ERR_UNKNOWN,o)}})),_0=tt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TransportRequestManager=void 0;var n=Sd(),a=Xi();e.TransportRequestManager=(function(){function o(){this.pendingRequest={},this.pendingBatchRequest={},this.transportEventChannel=new n.EventEmitter}return o.prototype.addRequest=function(s,c){return this.transportEventChannel.emit("pending",s),s instanceof Array?(this.addBatchReq(s,c),Promise.resolve()):this.addReq(s.internalID,c)},o.prototype.settlePendingRequest=function(s,c){var h=this;s.forEach(function(p){var g=h.pendingRequest[p.internalID];if(delete h.pendingBatchRequest[p.internalID],g!==void 0){if(c){g.reject(c);return}g.resolve(),(p.request.id===null||p.request.id===void 0)&&delete h.pendingRequest[p.internalID]}})},o.prototype.isPendingRequest=function(s){return this.pendingRequest.hasOwnProperty(s)},o.prototype.resolveResponse=function(s,c){c===void 0&&(c=!0);var h=s;try{return h=JSON.parse(s),this.checkJSONRPC(h)===!1?void 0:h instanceof Array?this.resolveBatch(h,c):this.resolveRes(h,c)}catch{var p=new a.JSONRPCError("Bad response format",a.ERR_UNKNOWN,s);return c&&this.transportEventChannel.emit("error",p),p}},o.prototype.addBatchReq=function(s,c){var h=this;return s.forEach(function(p){var g=p.resolve,b=p.reject,_=p.request.internalID;h.pendingBatchRequest[_]=!0,h.pendingRequest[_]={resolve:g,reject:b}}),Promise.resolve()},o.prototype.addReq=function(s,c){var h=this;return new Promise(function(p,g){c!==null&&c&&h.setRequestTimeout(s,c,g),h.pendingRequest[s]={resolve:p,reject:g}})},o.prototype.checkJSONRPC=function(s){var c=[s];return s instanceof Array&&(c=s),c.every(function(h){return h.result!==void 0||h.error!==void 0||h.method!==void 0})},o.prototype.processResult=function(s,c){if(s.error){var h=a.convertJSONToRPCError(s);c.reject(h);return}c.resolve(s.result)},o.prototype.resolveBatch=function(s,c){var h=this,p=s.map(function(g){return h.resolveRes(g,c)}).filter(function(g){return g});if(p.length>0)return p[0]},o.prototype.resolveRes=function(s,c){var h=s.id,p=s.error,g=this.pendingRequest[h];if(g){delete this.pendingRequest[h],this.processResult(s,g),this.transportEventChannel.emit("response",s);return}if(h===void 0&&p===void 0){this.transportEventChannel.emit("notification",s);return}var b;return p&&(b=a.convertJSONToRPCError(s)),c&&p&&b&&this.transportEventChannel.emit("error",b),b},o.prototype.setRequestTimeout=function(s,c,h){var p=this;setTimeout(function(){delete p.pendingRequest[s],h(new a.JSONRPCError("Request timeout request took longer than "+c+" ms to resolve",a.ERR_TIMEOUT))},c)},o})()})),Ya=tt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Transport=void 0;var n=_0();e.Transport=(function(){function a(){this.transportRequestManager=new n.TransportRequestManager,this.transportRequestManager.transportEventChannel.on("error",function(){})}return a.prototype.subscribe=function(o,s){this.transportRequestManager.transportEventChannel.addListener(o,s)},a.prototype.unsubscribe=function(o,s){if(!o)return this.transportRequestManager.transportEventChannel.removeAllListeners();o&&s&&this.transportRequestManager.transportEventChannel.removeListener(o,s)},a.prototype.parseData=function(o){return o instanceof Array?o.map(function(s){return s.request.request}):o.request},a})()})),Yi=tt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getNotifications=e.getBatchRequests=e.isNotification=void 0,e.isNotification=function(n){return n.request.id===void 0||n.request.id===null},e.getBatchRequests=function(n){return n instanceof Array?n.filter(function(a){return a.request.request.id!=null}).map(function(a){return a.request}):[]},e.getNotifications=function(n){return n instanceof Array?n.filter(function(a){return e.isNotification(a.request)}).map(function(a){return a.request}):e.isNotification(n)?[n]:[]}})),x0=tt((e=>{var n=e&&e.__extends||(function(){var c=function(h,p){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,b){g.__proto__=b}||function(g,b){for(var _ in b)b.hasOwnProperty(_)&&(g[_]=b[_])},c(h,p)};return function(h,p){c(h,p);function g(){this.constructor=h}h.prototype=p===null?Object.create(p):(g.prototype=p.prototype,new g)}})();Object.defineProperty(e,"__esModule",{value:!0});var a=Ya(),o=Yi(),s=Xi();e.default=(function(c){n(h,c);function h(p,g,b){var _=c.call(this)||this;return _.connection=p,_.reqUri=g,_.resUri=b,_}return h.prototype.connect=function(){var p=this;return this.connection.on(this.resUri,function(g){p.transportRequestManager.resolveResponse(g)}),Promise.resolve()},h.prototype.sendData=function(p,g){g===void 0&&(g=null);var b=this.transportRequestManager.addRequest(p,g),_=o.getNotifications(p),S=this.parseData(p);try{return this.connection.emit(this.reqUri,S),this.transportRequestManager.settlePendingRequest(_),b}catch(E){var C=new s.JSONRPCError(E.message,s.ERR_UNKNOWN,E);return this.transportRequestManager.settlePendingRequest(_,C),Promise.reject(C)}},h.prototype.close=function(){this.connection.removeAllListeners()},h})(a.Transport)}));function kx(e){return e&&DataView.prototype.isPrototypeOf(e)}function Zi(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Cd(e){return typeof e!="string"&&(e=String(e)),e}function Ed(e){var n={next:function(){var a=e.shift();return{done:a===void 0,value:a}}};return an.iterable&&(n[Symbol.iterator]=function(){return n}),n}function Bt(e){this.map={},e instanceof Bt?e.forEach(function(n,a){this.append(a,n)},this):Array.isArray(e)?e.forEach(function(n){if(n.length!=2)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+n.length);this.append(n[0],n[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(n){this.append(n,e[n])},this)}function Td(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function k0(e){return new Promise(function(n,a){e.onload=function(){n(e.result)},e.onerror=function(){a(e.error)}})}function Sx(e){var n=new FileReader,a=k0(n);return n.readAsArrayBuffer(e),a}function Cx(e){var n=new FileReader,a=k0(n),o=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=o?o[1]:"utf-8";return n.readAsText(e,s),a}function Ex(e){for(var n=new Uint8Array(e),a=Array(n.length),o=0;o<n.length;o++)a[o]=String.fromCharCode(n[o]);return a.join("")}function S0(e){if(e.slice)return e.slice(0);var n=new Uint8Array(e.byteLength);return n.set(new Uint8Array(e)),n.buffer}function C0(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:an.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:an.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:an.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():an.arrayBuffer&&an.blob&&kx(e)?(this._bodyArrayBuffer=S0(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):an.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||L0(e))?this._bodyArrayBuffer=S0(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):an.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},an.blob&&(this.blob=function(){var e=Td(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return Td(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(an.blob)return this.blob().then(Sx);throw Error("could not read as ArrayBuffer")},this.text=function(){var e=Td(this);if(e)return e;if(this._bodyBlob)return Cx(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Ex(this._bodyArrayBuffer));if(this._bodyFormData)throw Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},an.formData&&(this.formData=function(){return this.text().then(Lx)}),this.json=function(){return this.text().then(JSON.parse)},this}function Tx(e){var n=e.toUpperCase();return O0.indexOf(n)>-1?n:e}function ti(e,n){if(!(this instanceof ti))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');n||(n={});var a=n.body;if(e instanceof ti){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,n.headers||(this.headers=new Bt(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!a&&e._bodyInit!=null&&(a=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=n.credentials||this.credentials||"same-origin",(n.headers||!this.headers)&&(this.headers=new Bt(n.headers)),this.method=Tx(n.method||this.method||"GET"),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal||(function(){if("AbortController"in Wt)return new AbortController().signal})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&a)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(a),(this.method==="GET"||this.method==="HEAD")&&(n.cache==="no-store"||n.cache==="no-cache")){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function Lx(e){var n=new FormData;return e.trim().split("&").forEach(function(a){if(a){var o=a.split("="),s=o.shift().replace(/\+/g," "),c=o.join("=").replace(/\+/g," ");n.append(decodeURIComponent(s),decodeURIComponent(c))}}),n}function Ox(e){var n=new Bt;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(a){return a.indexOf(`
16
- `)===0?a.substr(1,a.length):a}).forEach(function(a){var o=a.split(":"),s=o.shift().trim();if(s){var c=o.join(":").trim();try{n.append(s,c)}catch(h){console.warn("Response "+h.message)}}}),n}function wr(e,n){if(!(this instanceof wr))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(n||(n={}),this.type="default",this.status=n.status===void 0?200:n.status,this.status<200||this.status>599)throw RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=n.statusText===void 0?"":""+n.statusText,this.headers=new Bt(n.headers),this.url=n.url||"",this._initBody(e)}function E0(e,n){return new Promise(function(a,o){var s=new ti(e,n);if(s.signal&&s.signal.aborted)return o(new fa("Aborted","AbortError"));var c=new XMLHttpRequest;function h(){c.abort()}c.onload=function(){var b={statusText:c.statusText,headers:Ox(c.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(c.status<200||c.status>599)?b.status=200:b.status=c.status,b.url="responseURL"in c?c.responseURL:b.headers.get("X-Request-URL");var _="response"in c?c.response:c.responseText;setTimeout(function(){a(new wr(_,b))},0)},c.onerror=function(){setTimeout(function(){o(TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){o(TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){o(new fa("Aborted","AbortError"))},0)};function p(b){try{return b===""&&Wt.location.href?Wt.location.href:b}catch{return b}}if(c.open(s.method,p(s.url),!0),s.credentials==="include"?c.withCredentials=!0:s.credentials==="omit"&&(c.withCredentials=!1),"responseType"in c&&(an.blob?c.responseType="blob":an.arrayBuffer&&(c.responseType="arraybuffer")),n&&typeof n.headers=="object"&&!(n.headers instanceof Bt||Wt.Headers&&n.headers instanceof Wt.Headers)){var g=[];Object.getOwnPropertyNames(n.headers).forEach(function(b){g.push(Zi(b)),c.setRequestHeader(b,Cd(n.headers[b]))}),s.headers.forEach(function(b,_){g.indexOf(_)===-1&&c.setRequestHeader(_,b)})}else s.headers.forEach(function(b,_){c.setRequestHeader(_,b)});s.signal&&(s.signal.addEventListener("abort",h),c.onreadystatechange=function(){c.readyState===4&&s.signal.removeEventListener("abort",h)}),c.send(s._bodyInit===void 0?null:s._bodyInit)})}let Wt,an,T0,L0,O0,A0,fa,I0,R0,M0,P0,ni,N0,D0,j0,z0,q0,B0;I0=k2((()=>{Wt=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},an={searchParams:"URLSearchParams"in Wt,iterable:"Symbol"in Wt&&"iterator"in Symbol,blob:"FileReader"in Wt&&"Blob"in Wt&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in Wt,arrayBuffer:"ArrayBuffer"in Wt},an.arrayBuffer&&(T0=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],L0=ArrayBuffer.isView||function(e){return e&&T0.indexOf(Object.prototype.toString.call(e))>-1}),Bt.prototype.append=function(e,n){e=Zi(e),n=Cd(n);var a=this.map[e];this.map[e]=a?a+", "+n:n},Bt.prototype.delete=function(e){delete this.map[Zi(e)]},Bt.prototype.get=function(e){return e=Zi(e),this.has(e)?this.map[e]:null},Bt.prototype.has=function(e){return this.map.hasOwnProperty(Zi(e))},Bt.prototype.set=function(e,n){this.map[Zi(e)]=Cd(n)},Bt.prototype.forEach=function(e,n){for(var a in this.map)this.map.hasOwnProperty(a)&&e.call(n,this.map[a],a,this)},Bt.prototype.keys=function(){var e=[];return this.forEach(function(n,a){e.push(a)}),Ed(e)},Bt.prototype.values=function(){var e=[];return this.forEach(function(n){e.push(n)}),Ed(e)},Bt.prototype.entries=function(){var e=[];return this.forEach(function(n,a){e.push([a,n])}),Ed(e)},an.iterable&&(Bt.prototype[Symbol.iterator]=Bt.prototype.entries),O0=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],ti.prototype.clone=function(){return new ti(this,{body:this._bodyInit})},C0.call(ti.prototype),C0.call(wr.prototype),wr.prototype.clone=function(){return new wr(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Bt(this.headers),url:this.url})},wr.error=function(){var e=new wr(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e},A0=[301,302,303,307,308],wr.redirect=function(e,n){if(A0.indexOf(n)===-1)throw RangeError("Invalid status code");return new wr(null,{status:n,headers:{location:e}})},fa=Wt.DOMException;try{new fa}catch{fa=function(e,n){this.message=e,this.name=n,this.stack=Error(e).stack},fa.prototype=Object.create(Error.prototype),fa.prototype.constructor=fa}E0.polyfill=!0,Wt.fetch||(Wt.fetch=E0,Wt.Headers=Bt,Wt.Request=ti,Wt.Response=wr)})),R0=tt(((e,n)=>{I0(),n.exports=self.fetch.bind(self)})),M0=tt((e=>{var n=e&&e.__extends||(function(){var _=function(S,C){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,O){E.__proto__=O}||function(E,O){for(var M in O)O.hasOwnProperty(M)&&(E[M]=O[M])},_(S,C)};return function(S,C){_(S,C);function E(){this.constructor=S}S.prototype=C===null?Object.create(C):(E.prototype=C.prototype,new E)}})(),a=e&&e.__awaiter||function(_,S,C,E){function O(M){return M instanceof C?M:new C(function(V){V(M)})}return new(C||(C=Promise))(function(M,V){function H(ne){try{N(E.next(ne))}catch(fe){V(fe)}}function $(ne){try{N(E.throw(ne))}catch(fe){V(fe)}}function N(ne){ne.done?M(ne.value):O(ne.value).then(H,$)}N((E=E.apply(_,S||[])).next())})},o=e&&e.__generator||function(_,S){var C={label:0,sent:function(){if(M[0]&1)throw M[1];return M[1]},trys:[],ops:[]},E,O,M,V;return V={next:H(0),throw:H(1),return:H(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function H(N){return function(ne){return $([N,ne])}}function $(N){if(E)throw TypeError("Generator is already executing.");for(;C;)try{if(E=1,O&&(M=N[0]&2?O.return:N[0]?O.throw||((M=O.return)&&M.call(O),0):O.next)&&!(M=M.call(O,N[1])).done)return M;switch(O=0,M&&(N=[N[0]&2,M.value]),N[0]){case 0:case 1:M=N;break;case 4:return C.label++,{value:N[1],done:!1};case 5:C.label++,O=N[1],N=[0];continue;case 7:N=C.ops.pop(),C.trys.pop();continue;default:if(M=C.trys,!(M=M.length>0&&M[M.length-1])&&(N[0]===6||N[0]===2)){C=0;continue}if(N[0]===3&&(!M||N[1]>M[0]&&N[1]<M[3])){C.label=N[1];break}if(N[0]===6&&C.label<M[1]){C.label=M[1],M=N;break}if(M&&C.label<M[2]){C.label=M[2],C.ops.push(N);break}M[2]&&C.ops.pop(),C.trys.pop();continue}N=S.call(_,C)}catch(ne){N=[6,ne],O=0}finally{E=M=0}if(N[0]&5)throw N[1];return{value:N[0]?N[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTTPTransport=void 0;var c=s(R0()),h=Ya(),p=Yi(),g=Xi(),b=(function(_){n(S,_);function S(C,E){var O=_.call(this)||this;return O.onlyNotifications=function(M){return M instanceof Array?M.every(function(V){return V.request.request.id===null||V.request.request.id===void 0}):M.request.id===null||M.request.id===void 0},O.uri=C,O.credentials=E&&E.credentials,O.headers=S.setupHeaders(E&&E.headers),O.injectedFetcher=E==null?void 0:E.fetcher,O}return S.prototype.connect=function(){return Promise.resolve()},S.prototype.sendData=function(C,E){return E===void 0&&(E=null),a(this,void 0,void 0,function(){var O,M,V,H,$,N,fe,ne,fe;return o(this,function(R){switch(R.label){case 0:O=this.transportRequestManager.addRequest(C,E),M=p.getNotifications(C),V=p.getBatchRequests(C),H=this.injectedFetcher||c.default,R.label=1;case 1:return R.trys.push([1,4,,5]),[4,H(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(C)),credentials:this.credentials})];case 2:return $=R.sent(),this.transportRequestManager.settlePendingRequest(M),this.onlyNotifications(C)?[2,Promise.resolve()]:[4,$.text()];case 3:return N=R.sent(),fe=this.transportRequestManager.resolveResponse(N),fe?(this.transportRequestManager.settlePendingRequest(V,fe),[2,Promise.reject(fe)]):[3,5];case 4:return ne=R.sent(),fe=new g.JSONRPCError(ne.message,g.ERR_UNKNOWN,ne),this.transportRequestManager.settlePendingRequest(M,fe),this.transportRequestManager.settlePendingRequest(p.getBatchRequests(C),fe),[2,Promise.reject(fe)];case 5:return[2,O]}})})},S.prototype.close=function(){},S.setupHeaders=function(C){var E=new Headers(C);return E.set("Content-Type","application/json"),E},S})(h.Transport);e.HTTPTransport=b,e.default=b})),P0=U6({default:()=>N0},1),D0=k2((()=>{ni=null,typeof WebSocket<"u"?ni=WebSocket:typeof MozWebSocket<"u"?ni=MozWebSocket:typeof global<"u"?ni=global.WebSocket||global.MozWebSocket:typeof window<"u"?ni=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(ni=self.WebSocket||self.MozWebSocket),N0=ni})),j0=tt((e=>{var n=e&&e.__extends||(function(){var b=function(_,S){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,E){C.__proto__=E}||function(C,E){for(var O in E)E.hasOwnProperty(O)&&(C[O]=E[O])},b(_,S)};return function(_,S){b(_,S);function C(){this.constructor=_}_.prototype=S===null?Object.create(S):(C.prototype=S.prototype,new C)}})(),a=e&&e.__awaiter||function(b,_,S,C){function E(O){return O instanceof S?O:new S(function(M){M(O)})}return new(S||(S=Promise))(function(O,M){function V(N){try{$(C.next(N))}catch(ne){M(ne)}}function H(N){try{$(C.throw(N))}catch(ne){M(ne)}}function $(N){N.done?O(N.value):E(N.value).then(V,H)}$((C=C.apply(b,_||[])).next())})},o=e&&e.__generator||function(b,_){var S={label:0,sent:function(){if(O[0]&1)throw O[1];return O[1]},trys:[],ops:[]},C,E,O,M;return M={next:V(0),throw:V(1),return:V(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function V($){return function(N){return H([$,N])}}function H($){if(C)throw TypeError("Generator is already executing.");for(;S;)try{if(C=1,E&&(O=$[0]&2?E.return:$[0]?E.throw||((O=E.return)&&O.call(E),0):E.next)&&!(O=O.call(E,$[1])).done)return O;switch(E=0,O&&($=[$[0]&2,O.value]),$[0]){case 0:case 1:O=$;break;case 4:return S.label++,{value:$[1],done:!1};case 5:S.label++,E=$[1],$=[0];continue;case 7:$=S.ops.pop(),S.trys.pop();continue;default:if(O=S.trys,!(O=O.length>0&&O[O.length-1])&&($[0]===6||$[0]===2)){S=0;continue}if($[0]===3&&(!O||$[1]>O[0]&&$[1]<O[3])){S.label=$[1];break}if($[0]===6&&S.label<O[1]){S.label=O[1],O=$;break}if(O&&S.label<O[2]){S.label=O[2],S.ops.push($);break}O[2]&&S.ops.pop(),S.trys.pop();continue}$=_.call(b,S)}catch(N){$=[6,N],E=0}finally{C=O=0}if($[0]&5)throw $[1];return{value:$[0]?$[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0});var c=s((D0(),$6(P0))),h=Ya(),p=Yi(),g=Xi();e.default=(function(b){n(_,b);function _(S){var C=b.call(this)||this;return C.uri=S,C.connection=new c.default(S),C}return _.prototype.connect=function(){var S=this;return new Promise(function(C,E){var O=function(){S.connection.removeEventListener("open",O),C()};S.connection.addEventListener("open",O),S.connection.addEventListener("message",function(M){var V=M.data;S.transportRequestManager.resolveResponse(V)})})},_.prototype.sendData=function(S,C){return C===void 0&&(C=5e3),a(this,void 0,void 0,function(){var E,O,M;return o(this,function(V){E=this.transportRequestManager.addRequest(S,C),O=p.getNotifications(S);try{this.connection.send(JSON.stringify(this.parseData(S))),this.transportRequestManager.settlePendingRequest(O)}catch(H){M=new g.JSONRPCError(H.message,g.ERR_UNKNOWN,H),this.transportRequestManager.settlePendingRequest(O,M),this.transportRequestManager.settlePendingRequest(p.getBatchRequests(S),M),E=Promise.reject(M)}return[2,E]})})},_.prototype.close=function(){this.connection.close()},_})(h.Transport)})),z0=tt((e=>{var n=e&&e.__extends||(function(){var p=function(g,b){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,S){_.__proto__=S}||function(_,S){for(var C in S)S.hasOwnProperty(C)&&(_[C]=S[C])},p(g,b)};return function(g,b){p(g,b);function _(){this.constructor=g}g.prototype=b===null?Object.create(b):(_.prototype=b.prototype,new _)}})(),a=e&&e.__awaiter||function(p,g,b,_){function S(C){return C instanceof b?C:new b(function(E){E(C)})}return new(b||(b=Promise))(function(C,E){function O(H){try{V(_.next(H))}catch($){E($)}}function M(H){try{V(_.throw(H))}catch($){E($)}}function V(H){H.done?C(H.value):S(H.value).then(O,M)}V((_=_.apply(p,g||[])).next())})},o=e&&e.__generator||function(p,g){var b={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},_,S,C,E;return E={next:O(0),throw:O(1),return:O(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function O(V){return function(H){return M([V,H])}}function M(V){if(_)throw TypeError("Generator is already executing.");for(;b;)try{if(_=1,S&&(C=V[0]&2?S.return:V[0]?S.throw||((C=S.return)&&C.call(S),0):S.next)&&!(C=C.call(S,V[1])).done)return C;switch(S=0,C&&(V=[V[0]&2,C.value]),V[0]){case 0:case 1:C=V;break;case 4:return b.label++,{value:V[1],done:!1};case 5:b.label++,S=V[1],V=[0];continue;case 7:V=b.ops.pop(),b.trys.pop();continue;default:if(C=b.trys,!(C=C.length>0&&C[C.length-1])&&(V[0]===6||V[0]===2)){b=0;continue}if(V[0]===3&&(!C||V[1]>C[0]&&V[1]<C[3])){b.label=V[1];break}if(V[0]===6&&b.label<C[1]){b.label=C[1],C=V;break}if(C&&b.label<C[2]){b.label=C[2],b.ops.push(V);break}C[2]&&b.ops.pop(),b.trys.pop();continue}V=g.call(p,b)}catch(H){V=[6,H],S=0}finally{_=C=0}if(V[0]&5)throw V[1];return{value:V[0]?V[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=Ya(),c=Yi(),h=function(p){var g=400,b=window.screen.height;return window.open(p,"inspector:popup","left=0,top=0,width="+g+",height="+b+",resizable,scrollbars=yes,status=1")};e.default=(function(p){n(g,p);function g(b){var _=p.call(this)||this;return _.messageHandler=function(S){_.transportRequestManager.resolveResponse(JSON.stringify(S.data))},_.uri=b,_.postMessageID="post-message-transport-"+Math.random(),_}return g.prototype.createWindow=function(b){return new Promise(function(_,S){var C=h(b);setTimeout(function(){_(C)},3e3)})},g.prototype.connect=function(){var b=this,_=/^(http|https):\/\/.*$/;return new Promise(function(S,C){return a(b,void 0,void 0,function(){var E;return o(this,function(O){switch(O.label){case 0:return _.test(this.uri)||C(Error("Bad URI")),E=this,[4,this.createWindow(this.uri)];case 1:return E.frame=O.sent(),window.addEventListener("message",this.messageHandler),S(),[2]}})})})},g.prototype.sendData=function(b,_){return _===void 0&&(_=5e3),a(this,void 0,void 0,function(){var S,C;return o(this,function(E){return S=this.transportRequestManager.addRequest(b,null),C=c.getNotifications(b),this.frame&&(this.frame.postMessage(b.request,this.uri),this.transportRequestManager.settlePendingRequest(C)),[2,S]})})},g.prototype.close=function(){this.frame&&(window.removeEventListener("message",this.messageHandler),this.frame.close())},g})(s.Transport)})),q0=tt((e=>{var n=e&&e.__extends||(function(){var h=function(p,g){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,_){b.__proto__=_}||function(b,_){for(var S in _)_.hasOwnProperty(S)&&(b[S]=_[S])},h(p,g)};return function(p,g){h(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}})(),a=e&&e.__awaiter||function(h,p,g,b){function _(S){return S instanceof g?S:new g(function(C){C(S)})}return new(g||(g=Promise))(function(S,C){function E(V){try{M(b.next(V))}catch(H){C(H)}}function O(V){try{M(b.throw(V))}catch(H){C(H)}}function M(V){V.done?S(V.value):_(V.value).then(E,O)}M((b=b.apply(h,p||[])).next())})},o=e&&e.__generator||function(h,p){var g={label:0,sent:function(){if(S[0]&1)throw S[1];return S[1]},trys:[],ops:[]},b,_,S,C;return C={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function E(M){return function(V){return O([M,V])}}function O(M){if(b)throw TypeError("Generator is already executing.");for(;g;)try{if(b=1,_&&(S=M[0]&2?_.return:M[0]?_.throw||((S=_.return)&&S.call(_),0):_.next)&&!(S=S.call(_,M[1])).done)return S;switch(_=0,S&&(M=[M[0]&2,S.value]),M[0]){case 0:case 1:S=M;break;case 4:return g.label++,{value:M[1],done:!1};case 5:g.label++,_=M[1],M=[0];continue;case 7:M=g.ops.pop(),g.trys.pop();continue;default:if(S=g.trys,!(S=S.length>0&&S[S.length-1])&&(M[0]===6||M[0]===2)){g=0;continue}if(M[0]===3&&(!S||M[1]>S[0]&&M[1]<S[3])){g.label=M[1];break}if(M[0]===6&&g.label<S[1]){g.label=S[1],S=M;break}if(S&&g.label<S[2]){g.label=S[2],g.ops.push(M);break}S[2]&&g.ops.pop(),g.trys.pop();continue}M=p.call(h,g)}catch(V){M=[6,V],_=0}finally{b=S=0}if(M[0]&5)throw M[1];return{value:M[0]?M[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=Ya(),c=Yi();e.default=(function(h){n(p,h);function p(g){var b=h.call(this)||this;return b.messageHandler=function(_){b.transportRequestManager.resolveResponse(JSON.stringify(_.data))},b.uri=g,b.postMessageID="post-message-transport-"+Math.random(),b}return p.prototype.createWindow=function(g){var b=this;return new Promise(function(_,S){var C,E=document.createElement("iframe");E.setAttribute("id",b.postMessageID),E.setAttribute("width","0px"),E.setAttribute("height","0px"),E.setAttribute("style","visiblity:hidden;border:none;outline:none;"),E.addEventListener("load",function(){_(C)}),E.setAttribute("src",g),window.document.body.appendChild(E),C=E.contentWindow})},p.prototype.connect=function(){var g=this,b=/^(http|https):\/\/.*$/;return new Promise(function(_,S){return a(g,void 0,void 0,function(){var C;return o(this,function(E){switch(E.label){case 0:return b.test(this.uri)||S(Error("Bad URI")),C=this,[4,this.createWindow(this.uri)];case 1:return C.frame=E.sent(),window.addEventListener("message",this.messageHandler),_(),[2]}})})})},p.prototype.sendData=function(g,b){return b===void 0&&(b=5e3),a(this,void 0,void 0,function(){var _,S;return o(this,function(C){return _=this.transportRequestManager.addRequest(g,null),S=c.getNotifications(g),this.frame&&(this.frame.postMessage(g.request,"*"),this.transportRequestManager.settlePendingRequest(S)),[2,_]})})},p.prototype.close=function(){var g;(g=document.getElementById(this.postMessageID))==null||g.remove(),window.removeEventListener("message",this.messageHandler)},p})(s.Transport)})),B0=tt((e=>{var n=e&&e.__awaiter||function(o,s,c,h){function p(g){return g instanceof c?g:new c(function(b){b(g)})}return new(c||(c=Promise))(function(g,b){function _(E){try{C(h.next(E))}catch(O){b(O)}}function S(E){try{C(h.throw(E))}catch(O){b(O)}}function C(E){E.done?g(E.value):p(E.value).then(_,S)}C((h=h.apply(o,s||[])).next())})},a=e&&e.__generator||function(o,s){var c={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},h,p,g,b;return b={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function _(C){return function(E){return S([C,E])}}function S(C){if(h)throw TypeError("Generator is already executing.");for(;c;)try{if(h=1,p&&(g=C[0]&2?p.return:C[0]?p.throw||((g=p.return)&&g.call(p),0):p.next)&&!(g=g.call(p,C[1])).done)return g;switch(p=0,g&&(C=[C[0]&2,g.value]),C[0]){case 0:case 1:g=C;break;case 4:return c.label++,{value:C[1],done:!1};case 5:c.label++,p=C[1],C=[0];continue;case 7:C=c.ops.pop(),c.trys.pop();continue;default:if(g=c.trys,!(g=g.length>0&&g[g.length-1])&&(C[0]===6||C[0]===2)){c=0;continue}if(C[0]===3&&(!g||C[1]>g[0]&&C[1]<g[3])){c.label=C[1];break}if(C[0]===6&&c.label<g[1]){c.label=g[1],g=C;break}if(g&&c.label<g[2]){c.label=g[2],c.ops.push(C);break}g[2]&&c.ops.pop(),c.trys.pop();continue}C=s.call(o,c)}catch(E){C=[6,E],p=0}finally{h=g=0}if(C[0]&5)throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=(function(){function o(s){this.requestManager=s}return o.prototype.startBatch=function(){return this.requestManager.startBatch()},o.prototype.stopBatch=function(){return this.requestManager.stopBatch()},o.prototype.request=function(s,c){return n(this,void 0,void 0,function(){return a(this,function(h){switch(h.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:h.sent(),h.label=2;case 2:return[2,this.requestManager.request(s,!1,c)]}})})},o.prototype.notify=function(s){return n(this,void 0,void 0,function(){return a(this,function(c){switch(c.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:c.sent(),c.label=2;case 2:return[2,this.requestManager.request(s,!0,null)]}})})},o.prototype.onNotification=function(s){this.requestManager.requestChannel.addListener("notification",s)},o.prototype.onError=function(s){this.requestManager.requestChannel.addListener("error",s)},o.prototype.close=function(){this.requestManager.close()},o})()})),Sl=tt((e=>{var n=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.PostMessageIframeTransport=e.PostMessageWindowTransport=e.JSONRPCError=e.WebSocketTransport=e.EventEmitterTransport=e.HTTPTransport=e.RequestManager=e.Client=void 0,e.RequestManager=n(w0()).default,e.EventEmitterTransport=n(x0()).default,e.HTTPTransport=n(M0()).default,e.WebSocketTransport=n(j0()).default,e.PostMessageWindowTransport=n(z0()).default,e.PostMessageIframeTransport=n(q0()).default;var a=Xi();Object.defineProperty(e,"JSONRPCError",{enumerable:!0,get:function(){return a.JSONRPCError}});var o=n(B0());e.Client=o.default,e.default=o.default}));function Ut(e,n){if(n.line>=e.lines)return n.character===0?e.length:void 0;let a=e.line(n.line+1).from+n.character;if(!(a>e.length))return a}function ir(e,n){return Ut(e,n)||0}function pa(e,n){let a=e.lineAt(n);return{character:n-a.from,line:a.number-1}}var Pl=new Y2.Renderer,Ax=Pl.code;Pl.code=e=>e.text.trim()?Ax.call(Pl,e):"";function F0(e){return Y2(e,{async:!1,gfm:!0,breaks:!0,renderer:Pl})}function or(e,n=F0){if(!e)return"";if(Px(e)){let a=e.value;return e.kind==="markdown"&&(a=n(a.trim())),a}return Array.isArray(e)?e.map(a=>or(a,n)).filter(Boolean).join(`
12
+ `)}`},q_=function(e){if(e.length===0)return"";let n=Object.keys(e[0]);return[`| ${n.join(" | ")} |`,`|${n.map(()=>"---").join("|")}|`,...e.map(a=>`| ${n.map(o=>ox(a[o])).join(" | ")} |`)].join(`
13
+ `)};function ox(e){if(e==null)return"";if(Array.isArray(e)||typeof e=="object")return Wm(JSON.stringify(e));let n=String(e),a=/\[([^\]]+)]\((https?:\/\/[^)]+)\)/g,o=new Map,s=0;n=n.replaceAll(a,c=>{let h=`__MDLINK_${s++}__`;return o.set(h,c),h}),n=n.replaceAll(/(https?:\/\/\S+)/g,"[$1]($1)");for(let[c,h]of o)n=n.replace(c,h);return Wm(n)}function Wm(e){return e.replaceAll("\\","\\\\").replaceAll("|","\\|").replaceAll(`
14
+ `," ").replaceAll("\r","")}function fd(e){return typeof e=="object"&&e&&"$bigint"in e&&typeof e.$bigint=="string"?BigInt(e.$bigint):e}var Um="abcdefghijklmnopqrstuvwxyz",Km=Um+Um.toUpperCase(),Qm=new Set;os="__scratch__",Vn="setup",Xa={create(){let e=0,n;do{let a="";for(let o=0;o<4;o++)a+=Km[Math.floor(Math.random()*Km.length)];n=a,e++}while(Qm.has(n)&&e<100);if(e>=100)throw Error("Failed to generate unique CellId after 100 attempts");return Qm.add(n),n}},En={create(e){return rn(e!=null,"cellId is required"),`cell-${e}`},parse(e){return e.slice(5)},findElement(e){return e.closest('div[id^="cell-"]')},findElementThroughShadowDOMs(e){let n=e;for(;n;){let a=En.findElement(n);if(a)return a;let o=n.getRootNode();if(n=o instanceof ShadowRoot?o.host:n.parentElement,n===o)break}return null}},Iw=function(e){let n=null,a=En.findElementThroughShadowDOMs(e);return a&&(n=En.parse(a.id)),n},ld={parse(e){return e.getAttribute("object-id")},parseOrThrow(e){let n=ld.parse(e);return rn(n,"<marimo-ui-element/> missing object-id attribute"),n}},Uw={create(e){return`output-${e}`}},Sm=new class{getFilename(){return this.getSearchParam("filename")}setFilename(e){this.setSearchParam("filename",e)}getCodeFromSearchParam(){return this.getSearchParam("code")}getCodeFromHash(){let e=window.location.hash;return e.startsWith("#code/")?e.slice(6):null}setCodeForHash(e){window.location.hash=`#code/${e}`}setSearchParam(e,n){let a=new URL(window.location.href);a.searchParams.set(e,n),window.history.replaceState({},"",a.toString())}getSearchParam(e){return new URL(window.location.href).searchParams.get(e)}},Gu=function(e){return jh(e??"")},E_=function(e){return Ar.mapValues(e.dataset,n=>typeof n=="string"?Gu(n):n)},g_=function(e,n){let a=e.parentElement?ld.parse(e.parentElement):void 0;return a&&n.has(a)?n.lookupValue(a):Gu(e.dataset.initialValue)},Ol=function(){if(M2())return document.title||null;if(vh()){let a=Sm.getFilename();if(a)return a}let e=document.querySelector("marimo-filename");Ru(e,"marimo-filename tag not found");let n=e.innerHTML;return n.length===0?null:n};var sx=Symbol("");p_=function(e,n){return Ce(e,function(a,o,s){o(this,n(a(this),s))})};function pd(e,n){let a=null,o=new Map,s=new Set,c=p=>{let g;if(n===void 0)g=o.get(p);else for(let[_,S]of o)if(n(_,p)){g=S;break}if(g!==void 0)if(a!=null&&a(g[1],p))c.remove(p);else return g[0];let b=e(p);return o.set(p,[b,Date.now()]),h("CREATE",p,b),b},h=(p,g,b)=>{for(let _ of s)_({type:p,param:g,atom:b})};return c.unstable_listen=p=>(s.add(p),()=>{s.delete(p)}),c.getParams=()=>o.keys(),c.remove=p=>{if(n===void 0){if(!o.has(p))return;let[g]=o.get(p);o.delete(p),h("REMOVE",p,g)}else for(let[g,[b]]of o)if(n(g,p)){o.delete(g),h("REMOVE",g,b);break}},c.setShouldRemove=p=>{if(a=p,a)for(let[g,[b,_]]of o)a(_,g)&&(o.delete(g),h("REMOVE",g,b))},c}var hd=(e,n,a)=>(n.has(a)?n:n.set(a,e())).get(a),lx=new WeakMap,cx=(e,n,a,o)=>hd(e,hd(()=>new WeakMap,hd(()=>new WeakMap,lx,n),a),o);function ux(e,n,a=Object.is){return cx(()=>{let o=Symbol(),s=([h,p])=>{if(p===o)return n(h);let g=n(h,p);return a(p,g)?p:g},c=Ce(h=>{let p=h(c);return s([h(e),p])});return c.init=o,c},e,n,a)}var Gm=(e,n,a)=>(n.has(a)?n:n.set(a,e())).get(a),dx=new WeakMap,fx=(e,n,a)=>Gm(e,Gm(()=>new WeakMap,dx,n),a),px={},Jm=e=>!!e.write,hx=e=>typeof e=="function";function mx(e,n){return fx(()=>{let a=new WeakMap,o=(h,p)=>{let g=a.get(h);if(g)return g;let b=p&&a.get(p),_=[],S=[];return h.forEach((C,E)=>{let O=n?n(C):E;S[E]=O;let M=b&&b.atomList[b.keyList.indexOf(O)];if(M){_[E]=M;return}let V=H=>{let $=H(s),N=H(e),ne=o(N,$==null?void 0:$.arr).keyList.indexOf(O);if(ne<0||ne>=N.length){let fe=h[o(h).keyList.indexOf(O)];if(fe)return fe;throw Error("splitAtom: index out of bounds for read")}return N[ne]};_[E]=Jm(e)?Ce(V,(H,$,N)=>{let ne=H(s),fe=H(e),R=o(fe,ne==null?void 0:ne.arr).keyList.indexOf(O);if(R<0||R>=fe.length)throw Error("splitAtom: index out of bounds for write");let j=hx(N)?N(fe[R]):N;Object.is(fe[R],j)||$(e,[...fe.slice(0,R),j,...fe.slice(R+1)])}):Ce(V)}),g=b&&b.keyList.length===S.length&&b.keyList.every((C,E)=>C===S[E])?b:{arr:h,atomList:_,keyList:S},a.set(h,g),g},s=Ce(h=>{let p=h(s);return o(h(e),p==null?void 0:p.arr)});s.init=void 0;let c=Jm(e)?Ce(h=>h(s).atomList,(h,p,g)=>{switch(g.type){case"remove":{let b=h(c).indexOf(g.atom);if(b>=0){let _=h(e);p(e,[..._.slice(0,b),..._.slice(b+1)])}break}case"insert":{let b=g.before?h(c).indexOf(g.before):h(c).length;if(b>=0){let _=h(e);p(e,[..._.slice(0,b),g.value,..._.slice(b)])}break}case"move":{let b=h(c).indexOf(g.atom),_=g.before?h(c).indexOf(g.before):h(c).length;if(b>=0&&_>=0){let S=h(e);b<_?p(e,[...S.slice(0,b),...S.slice(b+1,_),S[b],...S.slice(_)]):p(e,[...S.slice(0,_),S[b],...S.slice(_,b),...S.slice(b+1)])}break}}}):Ce(h=>h(s).atomList);return c},e,n||px)}var Xm=e=>typeof(e==null?void 0:e.then)=="function";function Ym(e=()=>{try{return window.localStorage}catch{return}},n){var p;let a,o,s={getItem:(g,b)=>{var C;let _=E=>{if(E||(E=""),a!==E){try{o=JSON.parse(E,n==null?void 0:n.reviver)}catch{return b}a=E}return o},S=((C=e())==null?void 0:C.getItem(g))??null;return Xm(S)?S.then(_):_(S)},setItem:(g,b)=>{var _;return(_=e())==null?void 0:_.setItem(g,JSON.stringify(b,n==null?void 0:n.replacer))},removeItem:g=>{var b;return(b=e())==null?void 0:b.removeItem(g)}},c=g=>(b,_,S)=>g(b,C=>{let E;try{E=JSON.parse(C||"")}catch{E=S}_(E)}),h;try{h=(p=e())==null?void 0:p.subscribe}catch{}return!h&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(h=(g,b)=>{if(!(e()instanceof window.Storage))return()=>{};let _=S=>{S.storageArea===e()&&S.key===g&&b(S.newValue)};return window.addEventListener("storage",_),()=>{window.removeEventListener("storage",_)}}),h&&(s.subscribe=c(h)),s}var gx=Ym();Rl=function(e,n,a=gx,o){let s=Ce(o!=null&&o.getOnInit?a.getItem(e,n):n);return s.onMount=c=>{c(a.getItem(e,n));let h;return a.subscribe&&(h=a.subscribe(e,c,n)),h},Ce(c=>c(s),(c,h,p)=>{let g=typeof p=="function"?p(c(s)):p;return g===sx?(h(s,n),a.removeItem(e)):Xm(g)?g.then(b=>(h(s,b),a.setItem(e,b))):(h(s,g),a.setItem(e,g))})},gn=function(e){let n,a,o;return typeof e=="object"?(n=e.hashFunction,a=e.expiring,o=e.tags):n=e,(s,c,h)=>{if(h.value!=null)h.value=Zm(h.value,n,a,o);else if(h.get!=null)h.get=Zm(h.get,n,a,o);else throw"Only put a Memoize() decorator on a method or get accessor."}};var md=new Map;function Zm(e,n,a=0,o){let s=Symbol("__memoized_map__");return function(...c){let h;this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let p=this[s];if(Array.isArray(o))for(let g of o)md.has(g)?md.get(g).push(p):md.set(g,[p]);if(n||c.length>0||a>0){let g;g=n===!0?c.map(S=>S.toString()).join("!"):n?n.apply(this,c):c[0];let b=`${g}__timestamp`,_=!1;if(a>0)if(!p.has(b))_=!0;else{let S=p.get(b);_=Date.now()-S>a}p.has(g)&&!_?h=p.get(g):(h=e.apply(this,c),p.set(g,h),a>0&&p.set(b,Date.now()))}else{let g=this;p.has(g)?h=p.get(g):(h=e.apply(this,c),p.set(g,h))}return h}}is=Ce(Ol()),k_=Ce(null),Kw=Ce(void 0);var yx=class{constructor(){ve(this,"store",new Map)}get length(){return this.store.size}clear(){this.store.clear()}getItem(e){return this.store.get(e)||null}key(e){return[...this.store.keys()][e]||null}removeItem(e){this.store.delete(e)}setItem(e,n){this.store.set(e,n)}};function vx(){let{hasLocalStorage:e,hasSessionStorage:n}=eT();return e?window.localStorage:n?window.sessionStorage:new yx}as=vx();let da;b_=class{constructor(e,n=as){this.defaultValue=e,this.storage=n}get(e){try{let n=this.storage.getItem(e);return n?JSON.parse(n):this.defaultValue}catch{return this.defaultValue}}set(e,n){this.storage.setItem(e,JSON.stringify(n))}remove(e){this.storage.removeItem(e)}},od=class{constructor(e,n,a=as){this.schema=e,this.getDefaultValue=n,this.storage=a}get(e){try{let n=this.storage.getItem(e);if(n==null)return this.getDefaultValue();let a=this.schema.safeParse(JSON.parse(n));return a.success?a.data:(be.warn("Error parsing zod local storage",a.error),this.getDefaultValue())}catch(n){return be.warn("Error getting zod local storage",n),this.getDefaultValue()}}set(e,n){this.storage.setItem(e,JSON.stringify(n))}remove(e){this.storage.removeItem(e)}},Dm=class extends od{constructor(e,n,a){let o=Fe.get(is);super(n,a),this.filename=o;try{this.unsubscribeFromFilename=Fe.sub(is,()=>{let s=Fe.get(is);this.handleFilenameChange(e,s)})}catch{this.unsubscribeFromFilename=null}}get(e){return super.get(this.createScopedKey(e,this.filename))}set(e,n){super.set(this.createScopedKey(e,this.filename),n)}remove(e){super.remove(this.createScopedKey(e,this.filename))}createScopedKey(e,n){return n?`${e}:${n}`:e}handleFilenameChange(e,n){if(n&&n!==this.filename){let a=this.get(e);this.remove(e),this.filename=n,this.set(e,a)}}dispose(){this.unsubscribeFromFilename&&(this.unsubscribeFromFilename=(this.unsubscribeFromFilename(),null))}},da="marimo:notebook-col-sizes";function bx(){return{widths:[]}}var Gi=new Dm(da,E2({widths:t5(Y6([Z6(),e5("contentWidth")]).default("contentWidth"))}),bx);e_={getColumnWidth:e=>Gi.get(da).widths[e]??"contentWidth",saveColumnWidth:(e,n)=>{let a=Gi.get(da).widths;if(a[e])a[e]=n;else{for(;a.length<=e;)a.push("contentWidth");a[e]=n}Gi.set(da,{widths:a})},clearStorage:()=>{Gi.remove(da)}};function wx(e,n){let a=Gi.get(da).widths,o=gl(a,e,n);Gi.set(da,{widths:o})}var e0,t0,n0,ar,r0,a0,i0,o0,yn,s0,l0,c0,u0,d0,f0,Rt;function Tn(e,n,a,o,s){var c={};return Object.keys(o).forEach(function(h){c[h]=o[h]}),c.enumerable=!!c.enumerable,c.configurable=!!c.configurable,("value"in c||c.initializer)&&(c.writable=!0),c=a.slice().reverse().reduce(function(h,p){return p(e,n,h)||h},c),s&&c.initializer!==void 0&&(c.value=c.initializer?c.initializer.call(s):void 0,c.initializer=void 0),c.initializer===void 0?(Object.defineProperty(e,n,c),null):c}let ei=(e0=gn(),t0=gn(),n0=gn(),ar=class{constructor(e,n,a){this.value=e,this.isCollapsed=n,this.children=a}geDescendantCount(){let e=0,n=[...this.children];for(;n.length>0;){let a=n.pop();e++;for(let o=a.children.length-1;o>=0;o--)n.push(a.children[o])}return e}getDescendants(){let e=[],n=[...this.children];for(;n.length>0;){let a=n.pop();e.push(a.value);for(let o=a.children.length-1;o>=0;o--)n.push(a.children[o])}return e}get inOrderIds(){let e=[],n=a=>{e.push(a.value);for(let o of a.children)n(o)};for(let a of this.children)n(a);return e}toString(){return this.isCollapsed?`${this.value} (collapsed)`:String(this.value)}equals(e){return this.value===e.value}},Tn(ar.prototype,"geDescendantCount",[e0],Object.getOwnPropertyDescriptor(ar.prototype,"geDescendantCount"),ar.prototype),Tn(ar.prototype,"getDescendants",[t0],Object.getOwnPropertyDescriptor(ar.prototype,"getDescendants"),ar.prototype),Tn(ar.prototype,"inOrderIds",[n0],Object.getOwnPropertyDescriptor(ar.prototype,"inOrderIds"),ar.prototype),ar);var _x=0;let Ji;Ji=(r0=gn(),a0=gn(),i0=gn(),o0=gn(),yn=class Qi{constructor(n,a){this.nodes=n,this.id=a}static from(n){let a=`tree_${_x++}`;return new Qi(n.map(o=>new ei(o,!1,[])),a)}static fromWithPreviousShape(n,a){var c;if(!a)return Qi.from(n);let o=a.id,s=new Qi(n.map(h=>new ei(h,!1,[])),o);for(let h of n)if(a.isCollapsed(h)){let p=((c=a._nodeMap.get(h))==null?void 0:c.children)??[];for(let g=p.length-1;g>=0;g--){let b=p[g];if(s._nodeMap.has(b.value)){s=s.collapse(h,b.value);break}}}return s}withNodes(n){return new Qi(n,this.id)}get topLevelIds(){return this.nodes.map(n=>n.value)}get inOrderIds(){return this.nodes.flatMap(n=>[n.value,...n.inOrderIds])}get idSet(){return new Set(this.inOrderIds)}get length(){return this.nodes.length}get _nodeMap(){let n=new Map;for(let a of this.nodes)n.set(a.value,a);return n}getDescendants(n){let a=this._nodeMap.get(n);return a?a.getDescendants():(be.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),[])}isCollapsed(n){let a=this._nodeMap.get(n);return a?a.isCollapsed:(be.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),!1)}indexOfOrThrow(n){let a=this.nodes.findIndex(o=>o.value===n);if(a===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);return a}slice(n,a){return this.nodes.slice(n,a).map(o=>o.value)}moveToFront(n){let a=this.indexOfOrThrow(n);return this.withNodes(gl(this.nodes,a,0))}moveToBack(n){let a=this.indexOfOrThrow(n);return this.withNodes(gl(this.nodes,a,this.nodes.length-1))}collapse(n,a){let o=this.nodes.findIndex(g=>g.value===n);if(o===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let s=a===void 0?this.nodes.length:this.nodes.findIndex(g=>g.value===a);if(s===-1)throw Error(`Node ${a} not found in tree`);if(s<o)throw Error(`Node ${a} is before node ${n}`);let c=[...this.nodes],h=c[o];if(h.isCollapsed)throw Error(`Node ${n} is already collapsed`);let p=c.splice(o+1,s-o);return c[o]=new ei(h.value,!0,p),this.withNodes(c)}collapseAll(n){let a=[...this.nodes];if(n.length===0)throw Error("No collapse ranges provided");if(n.length!==a.length)throw Error(`Collapse ranges length ${n.length} does not match tree length ${a.length}`);let o=a.length-1;for(;o>=0;){let s=a[o],c=n[o];if(!s.isCollapsed&&c){let{id:h,until:p}=c;if(h!==s.value)throw Error(`Node ${s.value} does not match collapse range id ${h}`);let g=p===void 0?a.length:a.findIndex(_=>_.value===p);if(g===-1)throw Error(`Node ${p} not found in tree`);if(g<o)throw Error(`Node ${p} is before node ${h}`);let b=a.splice(o+1,g-o);a[o]=new ei(s.value,!0,b),o--}else o--}return this.withNodes(a)}expand(n){let a=this.nodes.findIndex(c=>c.value===n);if(a===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let o=[...this.nodes],s=o[a];return s.isCollapsed?(o[a]=new ei(s.value,!1,[]),o=Q2(o,a+1,s.children),this.withNodes(o)):this}expandAll(){let n=[...this.nodes],a=0;for(;a<n.length;){let o=n[a];o.isCollapsed&&(n[a]=new ei(o.value,!1,[]),n=Q2(n,a+1,o.children)),a++}return this.withNodes(n)}move(n,a){return this.withNodes(gl(this.nodes,n,a))}at(n){var a;return(a=this.nodes.at(n))==null?void 0:a.value}atOrThrow(n){let a=this.nodes.at(n);if(a===void 0)throw Error(`Node at index ${n} not found in tree`);return a.value}first(){return this.atOrThrow(0)}last(){return this.atOrThrow(this.nodes.length-1)}after(n){let a=this.indexOfOrThrow(n);if(a!==this.nodes.length-1)return this.at(a+1)}before(n){let a=this.indexOfOrThrow(n);if(a!==0)return this.at(a-1)}insert(n,a){return this.withNodes(K2(this.nodes,a,new ei(n,!1,[])))}insertAtEnd(n){return this.insert(n,this.nodes.length)}insertAtStart(n){return this.insert(n,0)}deleteAtIndex(n){let a=this.atOrThrow(n),o=this.expand(a);return o.withNodes(Z5(o.nodes,n))}delete(n){let a=this.indexOfOrThrow(n);return this.deleteAtIndex(a)}getCount(n){var a;return((a=this._nodeMap.get(n))==null?void 0:a.geDescendantCount())??0}findAndExpandDeep(n){let a=this.find(n);return a.length===0?this:a.reduce((o,s)=>o.expand(s),this)}find(n){function a(o,s){for(let c of o){if(c.value===n)return[...s,n];let h=a(c.children,[...s,c.value]);if(h.length>0)return h}return[]}return a(this.nodes,[])}split(n){let a=this.nodes.findIndex(c=>c.value===n);if(a===-1)throw Error(`Node ${n} not found in tree`);let o=this.nodes.slice(0,a),s=this.nodes.slice(a);return o.length===0?[Qi.from([]),this.withNodes(s)]:[this.withNodes(o),Qi.from([]).withNodes(s)]}equals(n){return this.nodes.length===n.nodes.length&&this.nodes.every((a,o)=>a.value===n.nodes[o].value)}toString(){let n=0,a="",o=s=>{for(let c of s)a+=`${" ".repeat(n*2)}${c.toString()}
15
+ `,n+=1,o(c.children),--n};return o(this.nodes),a}},Tn(yn.prototype,"topLevelIds",[r0],Object.getOwnPropertyDescriptor(yn.prototype,"topLevelIds"),yn.prototype),Tn(yn.prototype,"inOrderIds",[a0],Object.getOwnPropertyDescriptor(yn.prototype,"inOrderIds"),yn.prototype),Tn(yn.prototype,"idSet",[i0],Object.getOwnPropertyDescriptor(yn.prototype,"idSet"),yn.prototype),Tn(yn.prototype,"_nodeMap",[o0],Object.getOwnPropertyDescriptor(yn.prototype,"_nodeMap"),yn.prototype),yn),bl=(s0=gn(),l0=gn(),c0=gn(),u0=gn(),d0=gn(),f0=gn(),Rt=class ln{constructor(n){this.columns=n,n.length===0&&(this.columns=[Ji.from([])])}static from(n){return new ln(n.map(a=>Ji.from(a)))}static fromWithPreviousShape(n,a){if(!a)return ln.from([n]);let o=a.getColumns(),s=Array.from({length:o.length},()=>[]),c=0;for(let h of n){let p=o.findIndex(g=>g.idSet.has(h));p===-1?s[c].push(h):(c=p,s[p].push(h))}return new ln(s.map((h,p)=>Ji.fromWithPreviousShape(h,o[p])))}isEmpty(){return this.columns.length===0?!0:this.columns.every(n=>n.nodes.length===0)}static fromIdsAndColumns(n){let a=Math.max(1,...n.map(([,c])=>(c??0)+1)),o=Array.from({length:a},()=>[]),s=0;for(let[c,h]of n)h==null||h<0?o[s].push(c):(o[h].push(c),s=h);return ln.from(o)}get topLevelIds(){return this.columns.map(n=>n.topLevelIds)}get iterateTopLevelIds(){let n=this.columns;function*a(){for(let o of n)for(let s of o.topLevelIds)yield s}return a()}get inOrderIds(){return this.columns.flatMap(n=>n.inOrderIds)}get colLength(){return this.columns.length}get idLength(){return this.columns.reduce((n,a)=>n+a.nodes.length,0)}get _columnMap(){return new Map(this.columns.map(n=>[n.id,n]))}at(n){return this.columns[n]}get(n){return this._columnMap.get(n)}atOrThrow(n){let a=this.columns[n];if(!a)throw Error(`Column ${n} not found`);return a}hasOnlyOneColumn(){return this.columns.length===1}getColumns(){return this.columns}hasOnlyOneId(){return this.idLength===1}getColumnIds(){return this.columns.map(n=>n.id)}indexOf(n){return this.columns.indexOf(n)}addColumn(n,a=[]){return new ln(this.columns.flatMap(o=>o.id===n?[o,Ji.from(a)]:[o]))}insertBreakpoint(n){let a=this.findWithId(n),[o,s]=a.split(n);return new ln(this.columns.flatMap(c=>c===a?[o,s].filter(Boolean):[c]))}delete(n){if(this.columns.length<=1)return this;let a=this.indexOfOrThrow(n),o=a===0?1:a-1,s=[...this.columns],c=s[a];return s[o]=c.withNodes([...s[o].nodes,...c.nodes]),s.splice(a,1),new ln(s)}mergeAllColumns(){if(this.columns.length<=1)return this;let n=this.columns.flatMap(o=>o.nodes),a=this.columns[0];return new ln([a.withNodes(n)])}moveWithinColumn(n,a,o){return this.transform(n,s=>s.move(a,o))}moveAcrossColumns(n,a,o,s){let c=this.indexOfOrThrow(n),h=this.indexOfOrThrow(o),p=[...this.columns],g=p[c],b=g.nodes.findIndex(C=>C.value===a);if(b===-1)throw Error(`Node ${a} not found in column ${n}`);let _=g.nodes[b];p[c]=g.withNodes(g.nodes.filter((C,E)=>E!==b));let S=p[h];if(s){let C=S.indexOfOrThrow(s);p[h]=S.withNodes(K2(S.nodes,C,_))}else p[h]=S.withNodes([_,...S.nodes]);return new ln(p)}indexOfOrThrow(n){let a=this.columns.findIndex(o=>o.id===n);if(a===-1)throw Error(`Column ${n} not found. Possible values: ${this.getColumnIds().join(", ")}`);return a}moveColumn(n,a){if(n===a)return this;let o=this.indexOfOrThrow(n),s=a==="_left_"?o-1:a==="_right_"?o+1:this.indexOfOrThrow(a);return wx(o,s),new ln(gl([...this.columns],o,s))}moveToNewColumn(n){let a=this.findWithId(n),o=this.columns.map(c=>c.id===a.id?c.delete(n):c),s=Ji.from([n]);return new ln([...o,s])}findWithId(n){let a=this.columns.find(o=>o.inOrderIds.includes(n));if(!a)throw be.log(`Possible values: ${this.columns.map(o=>o.inOrderIds).join(", ")}`),Error(`Cell ${n} not found in any column`);return a}transformWithCellId(n,a){let o=!1,s=this.columns.map(c=>{if(c.inOrderIds.includes(n)){let h=a(c);return c!==h&&(o=!0),h}return c});return o?new ln(s):this}setupCellExists(){return this.columns.some(n=>n.topLevelIds.includes(Vn))}insertId(n,a,o){return this.transform(a,s=>s.insert(n,o))}deleteById(n){return this.transformWithCellId(n,a=>a.delete(n))}compact(){return this.columns.length===1||!this.columns.some(n=>n.nodes.length===0)?this:new ln(this.columns.filter(n=>n.nodes.length>0))}transform(n,a){let o=this._columnMap.get(n);if(!o)return be.warn(`Column ${n} not found`),this;let s=a(o);return o===s?this:new ln(this.columns.map(c=>c.id===n?s:c))}transformAll(n){let a=!1,o=this.columns.map(s=>{let c=n(s);return s.equals(c)||(a=!0),c});return a?new ln(o):this}},Tn(Rt.prototype,"isEmpty",[s0],Object.getOwnPropertyDescriptor(Rt.prototype,"isEmpty"),Rt.prototype),Tn(Rt.prototype,"topLevelIds",[l0],Object.getOwnPropertyDescriptor(Rt.prototype,"topLevelIds"),Rt.prototype),Tn(Rt.prototype,"inOrderIds",[c0],Object.getOwnPropertyDescriptor(Rt.prototype,"inOrderIds"),Rt.prototype),Tn(Rt.prototype,"idLength",[u0],Object.getOwnPropertyDescriptor(Rt.prototype,"idLength"),Rt.prototype),Tn(Rt.prototype,"_columnMap",[d0],Object.getOwnPropertyDescriptor(Rt.prototype,"_columnMap"),Rt.prototype),Tn(Rt.prototype,"getColumnIds",[f0],Object.getOwnPropertyDescriptor(Rt.prototype,"getColumnIds"),Rt.prototype),Rt);let gd,yd,vd,p0,bd,h0,m0,g0,y0,wd,_d,v0,xd,kd;gd=tt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var n;(function(o){o.Root="root",o.Text="text",o.Directive="directive",o.Comment="comment",o.Script="script",o.Style="style",o.Tag="tag",o.CDATA="cdata",o.Doctype="doctype"})(n=e.ElementType||(e.ElementType={}));function a(o){return o.type===n.Tag||o.type===n.Script||o.type===n.Style}e.isTag=a,e.Root=n.Root,e.Text=n.Text,e.Directive=n.Directive,e.Comment=n.Comment,e.Script=n.Script,e.Style=n.Style,e.Tag=n.Tag,e.CDATA=n.CDATA,e.Doctype=n.Doctype})),yd=tt((e=>{var n=e&&e.__extends||(function(){var R=function(j,F){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(se,ce){se.__proto__=ce}||function(se,ce){for(var he in ce)Object.prototype.hasOwnProperty.call(ce,he)&&(se[he]=ce[he])},R(j,F)};return function(j,F){if(typeof F!="function"&&F!==null)throw TypeError("Class extends value "+String(F)+" is not a constructor or null");R(j,F);function se(){this.constructor=j}j.prototype=F===null?Object.create(F):(se.prototype=F.prototype,new se)}})(),a=e&&e.__assign||function(){return a=Object.assign||function(R){for(var j,F=1,se=arguments.length;F<se;F++)for(var ce in j=arguments[F],j)Object.prototype.hasOwnProperty.call(j,ce)&&(R[ce]=j[ce]);return R},a.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.cloneNode=e.hasChildren=e.isDocument=e.isDirective=e.isComment=e.isText=e.isCDATA=e.isTag=e.Element=e.Document=e.CDATA=e.NodeWithChildren=e.ProcessingInstruction=e.Comment=e.Text=e.DataNode=e.Node=void 0;var o=gd(),s=(function(){function R(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(R.prototype,"parentNode",{get:function(){return this.parent},set:function(j){this.parent=j},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"previousSibling",{get:function(){return this.prev},set:function(j){this.prev=j},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"nextSibling",{get:function(){return this.next},set:function(j){this.next=j},enumerable:!1,configurable:!0}),R.prototype.cloneNode=function(j){return j===void 0&&(j=!1),ne(this,j)},R})();e.Node=s;var c=(function(R){n(j,R);function j(F){var se=R.call(this)||this;return se.data=F,se}return Object.defineProperty(j.prototype,"nodeValue",{get:function(){return this.data},set:function(F){this.data=F},enumerable:!1,configurable:!0}),j})(s);e.DataNode=c;var h=(function(R){n(j,R);function j(){var F=R!==null&&R.apply(this,arguments)||this;return F.type=o.ElementType.Text,F}return Object.defineProperty(j.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),j})(c);e.Text=h;var p=(function(R){n(j,R);function j(){var F=R!==null&&R.apply(this,arguments)||this;return F.type=o.ElementType.Comment,F}return Object.defineProperty(j.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),j})(c);e.Comment=p;var g=(function(R){n(j,R);function j(F,se){var ce=R.call(this,se)||this;return ce.name=F,ce.type=o.ElementType.Directive,ce}return Object.defineProperty(j.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),j})(c);e.ProcessingInstruction=g;var b=(function(R){n(j,R);function j(F){var se=R.call(this)||this;return se.children=F,se}return Object.defineProperty(j.prototype,"firstChild",{get:function(){return this.children[0]??null},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"childNodes",{get:function(){return this.children},set:function(F){this.children=F},enumerable:!1,configurable:!0}),j})(s);e.NodeWithChildren=b;var _=(function(R){n(j,R);function j(){var F=R!==null&&R.apply(this,arguments)||this;return F.type=o.ElementType.CDATA,F}return Object.defineProperty(j.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),j})(b);e.CDATA=_;var S=(function(R){n(j,R);function j(){var F=R!==null&&R.apply(this,arguments)||this;return F.type=o.ElementType.Root,F}return Object.defineProperty(j.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),j})(b);e.Document=S;var C=(function(R){n(j,R);function j(F,se,ce,he){ce===void 0&&(ce=[]),he===void 0&&(he=F==="script"?o.ElementType.Script:F==="style"?o.ElementType.Style:o.ElementType.Tag);var ye=R.call(this,ce)||this;return ye.name=F,ye.attribs=se,ye.type=he,ye}return Object.defineProperty(j.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"tagName",{get:function(){return this.name},set:function(F){this.name=F},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"attributes",{get:function(){var F=this;return Object.keys(this.attribs).map(function(se){var ce,he;return{name:se,value:F.attribs[se],namespace:(ce=F["x-attribsNamespace"])==null?void 0:ce[se],prefix:(he=F["x-attribsPrefix"])==null?void 0:he[se]}})},enumerable:!1,configurable:!0}),j})(b);e.Element=C;function E(R){return(0,o.isTag)(R)}e.isTag=E;function O(R){return R.type===o.ElementType.CDATA}e.isCDATA=O;function M(R){return R.type===o.ElementType.Text}e.isText=M;function V(R){return R.type===o.ElementType.Comment}e.isComment=V;function H(R){return R.type===o.ElementType.Directive}e.isDirective=H;function $(R){return R.type===o.ElementType.Root}e.isDocument=$;function N(R){return Object.prototype.hasOwnProperty.call(R,"children")}e.hasChildren=N;function ne(R,j){j===void 0&&(j=!1);var F;if(M(R))F=new h(R.data);else if(V(R))F=new p(R.data);else if(E(R)){var se=j?fe(R.children):[],ce=new C(R.name,a({},R.attribs),se);se.forEach(function(Qe){return Qe.parent=ce}),R.namespace!=null&&(ce.namespace=R.namespace),R["x-attribsNamespace"]&&(ce["x-attribsNamespace"]=a({},R["x-attribsNamespace"])),R["x-attribsPrefix"]&&(ce["x-attribsPrefix"]=a({},R["x-attribsPrefix"])),F=ce}else if(O(R)){var se=j?fe(R.children):[],he=new _(se);se.forEach(function(pe){return pe.parent=he}),F=he}else if($(R)){var se=j?fe(R.children):[],ye=new S(se);se.forEach(function(pe){return pe.parent=ye}),R["x-mode"]&&(ye["x-mode"]=R["x-mode"]),F=ye}else if(H(R)){var xe=new g(R.name,R.data);R["x-name"]!=null&&(xe["x-name"]=R["x-name"],xe["x-publicId"]=R["x-publicId"],xe["x-systemId"]=R["x-systemId"]),F=xe}else throw Error(`Not implemented yet: ${R.type}`);return F.startIndex=R.startIndex,F.endIndex=R.endIndex,R.sourceCodeLocation!=null&&(F.sourceCodeLocation=R.sourceCodeLocation),F}e.cloneNode=ne;function fe(R){for(var j=R.map(function(se){return ne(se,!0)}),F=1;F<j.length;F++)j[F].prev=j[F-1],j[F-1].next=j[F];return j}})),vd=tt((e=>{var n=e&&e.__createBinding||(Object.create?(function(p,g,b,_){_===void 0&&(_=b);var S=Object.getOwnPropertyDescriptor(g,b);(!S||("get"in S?!g.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return g[b]}}),Object.defineProperty(p,_,S)}):(function(p,g,b,_){_===void 0&&(_=b),p[_]=g[b]})),a=e&&e.__exportStar||function(p,g){for(var b in p)b!=="default"&&!Object.prototype.hasOwnProperty.call(g,b)&&n(g,p,b)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var o=gd(),s=yd();a(yd(),e);var c={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},h=(function(){function p(g,b,_){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof b=="function"&&(_=b,b=c),typeof g=="object"&&(b=g,g=void 0),this.callback=g??null,this.options=b??c,this.elementCB=_??null}return p.prototype.onparserinit=function(g){this.parser=g},p.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},p.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},p.prototype.onerror=function(g){this.handleCallback(g)},p.prototype.onclosetag=function(){this.lastNode=null;var g=this.tagStack.pop();this.options.withEndIndices&&(g.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(g)},p.prototype.onopentag=function(g,b){var _=this.options.xmlMode?o.ElementType.Tag:void 0,S=new s.Element(g,b,void 0,_);this.addNode(S),this.tagStack.push(S)},p.prototype.ontext=function(g){var b=this.lastNode;if(b&&b.type===o.ElementType.Text)b.data+=g,this.options.withEndIndices&&(b.endIndex=this.parser.endIndex);else{var _=new s.Text(g);this.addNode(_),this.lastNode=_}},p.prototype.oncomment=function(g){if(this.lastNode&&this.lastNode.type===o.ElementType.Comment){this.lastNode.data+=g;return}var b=new s.Comment(g);this.addNode(b),this.lastNode=b},p.prototype.oncommentend=function(){this.lastNode=null},p.prototype.oncdatastart=function(){var g=new s.Text(""),b=new s.CDATA([g]);this.addNode(b),g.parent=b,this.lastNode=g},p.prototype.oncdataend=function(){this.lastNode=null},p.prototype.onprocessinginstruction=function(g,b){var _=new s.ProcessingInstruction(g,b);this.addNode(_)},p.prototype.handleCallback=function(g){if(typeof this.callback=="function")this.callback(g,this.dom);else if(g)throw g},p.prototype.addNode=function(g){var b=this.tagStack[this.tagStack.length-1],_=b.children[b.children.length-1];this.options.withStartIndices&&(g.startIndex=this.parser.startIndex),this.options.withEndIndices&&(g.endIndex=this.parser.endIndex),b.children.push(g),_&&(g.prev=_,_.next=g),g.parent=b,this.lastNode=null},p})();e.DomHandler=h,e.default=h})),p0=tt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=e.CARRIAGE_RETURN_PLACEHOLDER=e.CARRIAGE_RETURN_REGEX=e.CARRIAGE_RETURN=e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES="animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.linearGradient.radialGradient.textPath".split("."),e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce(function(n,a){return n[a.toLowerCase()]=a,n},{}),e.CARRIAGE_RETURN="\r",e.CARRIAGE_RETURN_REGEX=new RegExp(e.CARRIAGE_RETURN,"g"),e.CARRIAGE_RETURN_PLACEHOLDER=`__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_${Date.now()}__`,e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(e.CARRIAGE_RETURN_PLACEHOLDER,"g")})),bd=tt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=s,e.escapeSpecialCharacters=h,e.revertEscapedCharacters=p,e.formatDOM=g;var n=vd(),a=p0();function o(b){return a.CASE_SENSITIVE_TAG_NAMES_MAP[b]}function s(b){for(var _={},S=0,C=b.length;S<C;S++){var E=b[S];_[E.name]=E.value}return _}function c(b){return b=b.toLowerCase(),o(b)||b}function h(b){return b.replace(a.CARRIAGE_RETURN_REGEX,a.CARRIAGE_RETURN_PLACEHOLDER)}function p(b){return b.replace(a.CARRIAGE_RETURN_PLACEHOLDER_REGEX,a.CARRIAGE_RETURN)}function g(b,_,S){_===void 0&&(_=null);for(var C=[],E,O=0,M=b.length;O<M;O++){var V=b[O];switch(V.nodeType){case 1:var H=c(V.nodeName);E=new n.Element(H,s(V.attributes)),E.children=g(H==="template"?V.content.childNodes:V.childNodes,E);break;case 3:E=new n.Text(p(V.nodeValue));break;case 8:E=new n.Comment(V.nodeValue);break;default:continue}var $=C[O-1]||null;$&&($.next=E),E.parent=_,E.prev=$,E.next=null,C.push(E)}return S&&(E=new n.ProcessingInstruction(S.substring(0,S.indexOf(" ")).toLowerCase(),S),E.next=C[0]||null,E.parent=_,C.unshift(E),C[1]&&(C[1].prev=C[0])),C}})),h0=tt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=V;var n=bd(),a="html",o="head",s="body",c=/<([a-zA-Z]+[0-9]?)/,h=/<head[^]*>/i,p=/<body[^]*>/i,g=function(H,$){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},b=function(H,$){throw Error("This browser does not support `DOMParser.prototype.parseFromString`")},_=typeof window=="object"&&window.DOMParser;if(typeof _=="function"){var S=new _,C="text/html";b=function(H,$){return $&&(H=`<${$}>${H}</${$}>`),S.parseFromString(H,C)},g=b}if(typeof document=="object"&&document.implementation){var E=document.implementation.createHTMLDocument();g=function(H,$){if($){var N=E.documentElement.querySelector($);return N&&(N.innerHTML=H),E}return E.documentElement.innerHTML=H,E}}var O=typeof document=="object"&&document.createElement("template"),M;O&&O.content&&(M=function(H){return O.innerHTML=H,O.content.childNodes});function V(H){var $,N;H=(0,n.escapeSpecialCharacters)(H);var ne=H.match(c),fe=ne&&ne[1]?ne[1].toLowerCase():"";switch(fe){case a:var R=b(H);if(!h.test(H)){var F=R.querySelector(o);($=F==null?void 0:F.parentNode)==null||$.removeChild(F)}if(!p.test(H)){var F=R.querySelector(s);(N=F==null?void 0:F.parentNode)==null||N.removeChild(F)}return R.querySelectorAll(a);case o:case s:var j=g(H).querySelectorAll(fe);return p.test(H)&&h.test(H)?j[0].parentNode.childNodes:j;default:if(M)return M(H);var F=g(H,s).querySelector(s);return F.childNodes}}})),m0=tt((e=>{var n=e&&e.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var a=n(h0()),o=bd(),s=/<(![a-zA-Z\s]+)>/;function c(h){if(typeof h!="string")throw TypeError("First argument must be a string");if(!h)return[];var p=h.match(s),g=p?p[1]:void 0;return(0,o.formatDOM)((0,a.default)(h),null,g)}})),g0=tt((e=>{e.SAME=0,e.CAMELCASE=1,e.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}})),y0=tt((e=>{var n=0,a=1,o=2,s=3,c=4,h=5,p=6;function g(N){return _.hasOwnProperty(N)?_[N]:null}function b(N,ne,fe,R,j,F,se){this.acceptsBooleans=ne===o||ne===s||ne===c,this.attributeName=R,this.attributeNamespace=j,this.mustUseProperty=fe,this.propertyName=N,this.type=ne,this.sanitizeURL=F,this.removeEmptyString=se}var _={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(N=>{_[N]=new b(N,n,!1,N,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([N,ne])=>{_[N]=new b(N,a,!1,ne,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(N=>{_[N]=new b(N,o,!1,N.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(N=>{_[N]=new b(N,o,!1,N,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(N=>{_[N]=new b(N,s,!1,N.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(N=>{_[N]=new b(N,s,!0,N,null,!1,!1)}),["capture","download"].forEach(N=>{_[N]=new b(N,c,!1,N,null,!1,!1)}),["cols","rows","size","span"].forEach(N=>{_[N]=new b(N,p,!1,N,null,!1,!1)}),["rowSpan","start"].forEach(N=>{_[N]=new b(N,h,!1,N.toLowerCase(),null,!1,!1)});var S=/[\-\:]([a-z])/g,C=N=>N[1].toUpperCase();"accent-height.alignment-baseline.arabic-form.baseline-shift.cap-height.clip-path.clip-rule.color-interpolation.color-interpolation-filters.color-profile.color-rendering.dominant-baseline.enable-background.fill-opacity.fill-rule.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.glyph-name.glyph-orientation-horizontal.glyph-orientation-vertical.horiz-adv-x.horiz-origin-x.image-rendering.letter-spacing.lighting-color.marker-end.marker-mid.marker-start.overline-position.overline-thickness.paint-order.panose-1.pointer-events.rendering-intent.shape-rendering.stop-color.stop-opacity.strikethrough-position.strikethrough-thickness.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.text-anchor.text-decoration.text-rendering.underline-position.underline-thickness.unicode-bidi.unicode-range.units-per-em.v-alphabetic.v-hanging.v-ideographic.v-mathematical.vector-effect.vert-adv-y.vert-origin-x.vert-origin-y.word-spacing.writing-mode.xmlns:xlink.x-height".split(".").forEach(N=>{let ne=N.replace(S,C);_[ne]=new b(ne,a,!1,N,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(N=>{let ne=N.replace(S,C);_[ne]=new b(ne,a,!1,N,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(N=>{let ne=N.replace(S,C);_[ne]=new b(ne,a,!1,N,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(N=>{_[N]=new b(N,a,!1,N.toLowerCase(),null,!1,!1)});var E="xlinkHref";_[E]=new b("xlinkHref",a,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(N=>{_[N]=new b(N,a,!1,N.toLowerCase(),null,!0,!0)});var{CAMELCASE:O,SAME:M,possibleStandardNames:V}=g0(),H=RegExp.prototype.test.bind(RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),$=Object.keys(V).reduce((N,ne)=>{let fe=V[ne];return fe===M?N[ne]=ne:fe===O?N[ne.toLowerCase()]=ne:N[ne]=fe,N},{});e.BOOLEAN=s,e.BOOLEANISH_STRING=o,e.NUMERIC=h,e.OVERLOADED_BOOLEAN=c,e.POSITIVE_NUMERIC=p,e.RESERVED=n,e.STRING=a,e.getPropertyInfo=g,e.isCustomAttribute=H,e.possibleStandardNames=$})),wd=tt((e=>{var n=e&&e.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=c,e.setStyleProp=p;var a=ku(),o=n(tT()),s=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function c(g,b){return g.includes("-")?!s.has(g):!!(b&&typeof b.is=="string")}var h={reactCompat:!0};function p(g,b){if(typeof g=="string"){if(!g.trim()){b.style={};return}try{b.style=(0,o.default)(g,h)}catch{b.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(a.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),e.canTextBeChildOfNode=function(g){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(g.name)},e.returnFirstArg=function(g){return g}})),_d=tt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=h;var n=y0(),a=wd(),o=["checked","value"],s=["input","select","textarea"],c={reset:!0,submit:!0};function h(g,b){g===void 0&&(g={});var _={},S=!!(g.type&&c[g.type]);for(var C in g){var E=g[C];if((0,n.isCustomAttribute)(C)){_[C]=E;continue}var O=C.toLowerCase(),M=p(O);if(M){var V=(0,n.getPropertyInfo)(M);switch(o.includes(M)&&s.includes(b)&&!S&&(M=p("default"+O)),_[M]=E,V&&V.type){case n.BOOLEAN:_[M]=!0;break;case n.OVERLOADED_BOOLEAN:E===""&&(_[M]=!0);break}continue}a.PRESERVE_CUSTOM_ATTRIBUTES&&(_[C]=E)}return(0,a.setStyleProp)(g.style,_),_}function p(g){return n.possibleStandardNames[g]}})),v0=tt((e=>{var n=e&&e.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=h;var a=ku(),o=n(_d()),s=wd(),c={cloneElement:a.cloneElement,createElement:a.createElement,isValidElement:a.isValidElement};function h(g,b){b===void 0&&(b={});for(var _=[],S=typeof b.replace=="function",C=b.transform||s.returnFirstArg,E=b.library||c,O=E.cloneElement,M=E.createElement,V=E.isValidElement,H=g.length,$=0;$<H;$++){var N=g[$];if(S){var ne=b.replace(N,$);if(V(ne)){H>1&&(ne=O(ne,{key:ne.key||$})),_.push(C(ne,N,$));continue}}if(N.type==="text"){var fe=!N.data.trim().length;if(fe&&N.parent&&!(0,s.canTextBeChildOfNode)(N.parent)||b.trim&&fe)continue;_.push(C(N.data,N,$));continue}var R=N,j={};p(R)?((0,s.setStyleProp)(R.attribs.style,R.attribs),j=R.attribs):R.attribs&&(j=(0,o.default)(R.attribs,R.name));var F=void 0;switch(N.type){case"script":case"style":N.children[0]&&(j.dangerouslySetInnerHTML={__html:N.children[0].data});break;case"tag":N.name==="textarea"&&N.children[0]?j.defaultValue=N.children[0].data:N.children&&N.children.length&&(F=h(N.children,b));break;default:continue}H>1&&(j.key=$),_.push(C(M(N.name,j,F),N,$))}return _.length===1?_[0]:_}function p(g){return s.PRESERVE_CUSTOM_ATTRIBUTES&&g.type==="tag"&&(0,s.isCustomComponent)(g.name,g.attribs)}})),xd=tt((e=>{var n=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=h;var a=n(m0());e.htmlToDOM=a.default,e.attributesToProps=n(_d()).default;var o=n(v0());e.domToReact=o.default;var s=vd();Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return s.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return s.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return s.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return s.Text}});var c={lowerCaseAttributeNames:!1};function h(p,g){if(typeof p!="string")throw TypeError("First argument must be a string");return p?(0,o.default)((0,a.default)(p,(g==null?void 0:g.htmlparser2)||c),g):[]}})),kd=gh(xd(),1),Ja=xd(),pm=kd.default.default||kd.default;let Ml;Ml=(e,n)=>{let[a,...o]=n.split("."),s=(e.attribs.class||"").split(" ");return e.tagName===a&&o.every(c=>s.includes(c))},yw=e=>{var n;return e&&Ml(e,"span.nb")&&e.firstChild instanceof Ja.Text&&((n=e.firstChild.nodeValue)==null?void 0:n.includes("__marimo__"))},sm=function(e){var n,a,o;if(e instanceof Ja.Element&&e.firstChild instanceof Ja.Text&&Ml(e,"span.nb")){let s=e.next;if(s&&s instanceof Ja.Text){let c=s.next;if(c&&c instanceof Ja.Element&&c.firstChild instanceof Ja.Text&&Ml(c,"span.m")){let h=Number.parseInt(c.firstChild.nodeValue||"0",10);if((n=e.firstChild.nodeValue)!=null&&n.includes("__marimo__")){let p=(a=/__marimo__cell_(\w+)_/.exec(e.firstChild.nodeValue))==null?void 0:a[1];if(p&&h)return{kind:"cell",cellId:p,lineNumber:h}}else{let p=(o=/"(.+?)"/.exec(e.firstChild.nodeValue))==null?void 0:o[1];if(p&&h)return{kind:"file",filePath:p,lineNumber:h}}}}}return null},um=function(e){let n=[];return pm(e,{replace:a=>{let o=sm(a);if(o)return n.push(o),"dummy"}}),n};function b0(e){return n=>{let a=!1;for(let o of n)o&&(a=e(o)||a);return a}}const xx=b0(S5),kx=b0(C5);let Sd,w0,Xi,_0,Yi,x0;Sd=tt(((e,n)=>{var a=typeof Reflect=="object"?Reflect:null,o=a&&typeof a.apply=="function"?a.apply:function(R,j,F){return Function.prototype.apply.call(R,j,F)},s=a&&typeof a.ownKeys=="function"?a.ownKeys:Object.getOwnPropertySymbols?function(R){return Object.getOwnPropertyNames(R).concat(Object.getOwnPropertySymbols(R))}:function(R){return Object.getOwnPropertyNames(R)};function c(R){console&&console.warn&&console.warn(R)}var h=Number.isNaN||function(R){return R!==R};function p(){p.init.call(this)}n.exports=p,n.exports.once=N,p.EventEmitter=p,p.prototype._events=void 0,p.prototype._eventsCount=0,p.prototype._maxListeners=void 0;var g=10;function b(R){if(typeof R!="function")throw TypeError('The "listener" argument must be of type Function. Received type '+typeof R)}Object.defineProperty(p,"defaultMaxListeners",{enumerable:!0,get:function(){return g},set:function(R){if(typeof R!="number"||R<0||h(R))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+R+".");g=R}}),p.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},p.prototype.setMaxListeners=function(R){if(typeof R!="number"||R<0||h(R))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+R+".");return this._maxListeners=R,this};function _(R){return R._maxListeners===void 0?p.defaultMaxListeners:R._maxListeners}p.prototype.getMaxListeners=function(){return _(this)},p.prototype.emit=function(R){for(var j=[],F=1;F<arguments.length;F++)j.push(arguments[F]);var se=R==="error",ce=this._events;if(ce!==void 0)se&&(se=ce.error===void 0);else if(!se)return!1;if(se){var he;if(j.length>0&&(he=j[0]),he instanceof Error)throw he;var ye=Error("Unhandled error."+(he?" ("+he.message+")":""));throw ye.context=he,ye}var xe=ce[R];if(xe===void 0)return!1;if(typeof xe=="function")o(xe,this,j);else for(var Qe=xe.length,pe=V(xe,Qe),F=0;F<Qe;++F)o(pe[F],this,j);return!0};function S(R,j,F,se){var ce,he,ye;if(b(F),he=R._events,he===void 0?(he=R._events=Object.create(null),R._eventsCount=0):(he.newListener!==void 0&&(R.emit("newListener",j,F.listener?F.listener:F),he=R._events),ye=he[j]),ye===void 0)ye=he[j]=F,++R._eventsCount;else if(typeof ye=="function"?ye=he[j]=se?[F,ye]:[ye,F]:se?ye.unshift(F):ye.push(F),ce=_(R),ce>0&&ye.length>ce&&!ye.warned){ye.warned=!0;var xe=Error("Possible EventEmitter memory leak detected. "+ye.length+" "+String(j)+" listeners added. Use emitter.setMaxListeners() to increase limit");xe.name="MaxListenersExceededWarning",xe.emitter=R,xe.type=j,xe.count=ye.length,c(xe)}return R}p.prototype.addListener=function(R,j){return S(this,R,j,!1)},p.prototype.on=p.prototype.addListener,p.prototype.prependListener=function(R,j){return S(this,R,j,!0)};function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function E(R,j,F){var se={fired:!1,wrapFn:void 0,target:R,type:j,listener:F},ce=C.bind(se);return ce.listener=F,se.wrapFn=ce,ce}p.prototype.once=function(R,j){return b(j),this.on(R,E(this,R,j)),this},p.prototype.prependOnceListener=function(R,j){return b(j),this.prependListener(R,E(this,R,j)),this},p.prototype.removeListener=function(R,j){var F,se,ce,he,ye;if(b(j),se=this._events,se===void 0||(F=se[R],F===void 0))return this;if(F===j||F.listener===j)--this._eventsCount===0?this._events=Object.create(null):(delete se[R],se.removeListener&&this.emit("removeListener",R,F.listener||j));else if(typeof F!="function"){for(ce=-1,he=F.length-1;he>=0;he--)if(F[he]===j||F[he].listener===j){ye=F[he].listener,ce=he;break}if(ce<0)return this;ce===0?F.shift():H(F,ce),F.length===1&&(se[R]=F[0]),se.removeListener!==void 0&&this.emit("removeListener",R,ye||j)}return this},p.prototype.off=p.prototype.removeListener,p.prototype.removeAllListeners=function(R){var j,F=this._events,se;if(F===void 0)return this;if(F.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):F[R]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete F[R]),this;if(arguments.length===0){var ce=Object.keys(F),he;for(se=0;se<ce.length;++se)he=ce[se],he!=="removeListener"&&this.removeAllListeners(he);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(j=F[R],typeof j=="function")this.removeListener(R,j);else if(j!==void 0)for(se=j.length-1;se>=0;se--)this.removeListener(R,j[se]);return this};function O(R,j,F){var se=R._events;if(se===void 0)return[];var ce=se[j];return ce===void 0?[]:typeof ce=="function"?F?[ce.listener||ce]:[ce]:F?$(ce):V(ce,ce.length)}p.prototype.listeners=function(R){return O(this,R,!0)},p.prototype.rawListeners=function(R){return O(this,R,!1)},p.listenerCount=function(R,j){return typeof R.listenerCount=="function"?R.listenerCount(j):M.call(R,j)},p.prototype.listenerCount=M;function M(R){var j=this._events;if(j!==void 0){var F=j[R];if(typeof F=="function")return 1;if(F!==void 0)return F.length}return 0}p.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function V(R,j){for(var F=Array(j),se=0;se<j;++se)F[se]=R[se];return F}function H(R,j){for(;j+1<R.length;j++)R[j]=R[j+1];R.pop()}function $(R){for(var j=Array(R.length),F=0;F<j.length;++F)j[F]=R[F].listener||R[F];return j}function N(R,j){return new Promise(function(F,se){function ce(ye){R.removeListener(j,he),se(ye)}function he(){typeof R.removeListener=="function"&&R.removeListener("error",ce),F([].slice.call(arguments))}fe(R,j,he,{once:!0}),j!=="error"&&ne(R,ce,{once:!0})})}function ne(R,j,F){typeof R.on=="function"&&fe(R,"error",j,F)}function fe(R,j,F,se){if(typeof R.on=="function")se.once?R.once(j,F):R.on(j,F);else if(typeof R.addEventListener=="function")R.addEventListener(j,function ce(he){se.once&&R.removeEventListener(j,ce),F(he)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof R)}})),w0=tt((e=>{var n=e&&e.__awaiter||function(s,c,h,p){function g(b){return b instanceof h?b:new h(function(_){_(b)})}return new(h||(h=Promise))(function(b,_){function S(O){try{E(p.next(O))}catch(M){_(M)}}function C(O){try{E(p.throw(O))}catch(M){_(M)}}function E(O){O.done?b(O.value):g(O.value).then(S,C)}E((p=p.apply(s,c||[])).next())})},a=e&&e.__generator||function(s,c){var h={label:0,sent:function(){if(b[0]&1)throw b[1];return b[1]},trys:[],ops:[]},p,g,b,_;return _={next:S(0),throw:S(1),return:S(2)},typeof Symbol=="function"&&(_[Symbol.iterator]=function(){return this}),_;function S(E){return function(O){return C([E,O])}}function C(E){if(p)throw TypeError("Generator is already executing.");for(;h;)try{if(p=1,g&&(b=E[0]&2?g.return:E[0]?g.throw||((b=g.return)&&b.call(g),0):g.next)&&!(b=b.call(g,E[1])).done)return b;switch(g=0,b&&(E=[E[0]&2,b.value]),E[0]){case 0:case 1:b=E;break;case 4:return h.label++,{value:E[1],done:!1};case 5:h.label++,g=E[1],E=[0];continue;case 7:E=h.ops.pop(),h.trys.pop();continue;default:if(b=h.trys,!(b=b.length>0&&b[b.length-1])&&(E[0]===6||E[0]===2)){h=0;continue}if(E[0]===3&&(!b||E[1]>b[0]&&E[1]<b[3])){h.label=E[1];break}if(E[0]===6&&h.label<b[1]){h.label=b[1],b=E;break}if(b&&h.label<b[2]){h.label=b[2],h.ops.push(E);break}b[2]&&h.ops.pop(),h.trys.pop();continue}E=c.call(s,h)}catch(O){E=[6,O],g=0}finally{p=b=0}if(E[0]&5)throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultNextRequest=void 0;var o=Sd();e.defaultNextRequest=function(){var s=-1;return function(){return++s}},e.default=(function(){function s(c,h){h===void 0&&(h=e.defaultNextRequest()),this.batch=[],this.batchStarted=!1,this.lastId=-1,this.transports=c,this.requests={},this.connectPromise=this.connect(),this.requestChannel=new o.EventEmitter,this.nextID=h}return s.prototype.connect=function(){var c=this;return Promise.all(this.transports.map(function(h){return n(c,void 0,void 0,function(){return a(this,function(p){switch(p.label){case 0:return h.subscribe("error",this.handleError.bind(this)),h.subscribe("notification",this.handleNotification.bind(this)),[4,h.connect()];case 1:return p.sent(),[2]}})})}))},s.prototype.getPrimaryTransport=function(){return this.transports[0]},s.prototype.request=function(c,h,p){return h===void 0&&(h=!1),n(this,void 0,void 0,function(){var g,b,_,S,C=this;return a(this,function(E){return g=this.nextID().toString(),b=h?null:g,_={request:this.makeRequest(c.method,c.params||[],b),internalID:g},this.batchStarted?(S=new Promise(function(O,M){C.batch.push({resolve:O,reject:M,request:_})}),[2,S]):[2,this.getPrimaryTransport().sendData(_,p)]})})},s.prototype.close=function(){this.requestChannel.removeAllListeners(),this.transports.forEach(function(c){c.unsubscribe(),c.close()})},s.prototype.startBatch=function(){this.batchStarted=!0},s.prototype.stopBatch=function(){if(this.batchStarted===!1)throw Error("cannot end that which has never started");if(this.batch.length===0){this.batchStarted=!1;return}this.getPrimaryTransport().sendData(this.batch),this.batch=[],this.batchStarted=!1},s.prototype.makeRequest=function(c,h,p){return p?{jsonrpc:"2.0",id:p,method:c,params:h}:{jsonrpc:"2.0",method:c,params:h}},s.prototype.handleError=function(c){this.requestChannel.emit("error",c)},s.prototype.handleNotification=function(c){this.requestChannel.emit("notification",c)},s})()})),Xi=tt((e=>{var n=e&&e.__extends||(function(){var o=function(s,c){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var g in p)p.hasOwnProperty(g)&&(h[g]=p[g])},o(s,c)};return function(s,c){o(s,c);function h(){this.constructor=s}s.prototype=c===null?Object.create(c):(h.prototype=c.prototype,new h)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.convertJSONToRPCError=e.JSONRPCError=e.ERR_UNKNOWN=e.ERR_MISSIING_ID=e.ERR_TIMEOUT=void 0,e.ERR_TIMEOUT=7777,e.ERR_MISSIING_ID=7878,e.ERR_UNKNOWN=7979;var a=(function(o){n(s,o);function s(c,h,p){var g=this.constructor,b=o.call(this,c)||this;return b.message=c,b.code=h,b.data=p,Object.setPrototypeOf(b,g.prototype),b}return s})(Error);e.JSONRPCError=a,e.convertJSONToRPCError=function(o){if(o.error){var s=o.error,c=s.message,h=s.code,p=s.data;return new a(c,h,p)}return new a("Unknown error",e.ERR_UNKNOWN,o)}})),_0=tt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TransportRequestManager=void 0;var n=Sd(),a=Xi();e.TransportRequestManager=(function(){function o(){this.pendingRequest={},this.pendingBatchRequest={},this.transportEventChannel=new n.EventEmitter}return o.prototype.addRequest=function(s,c){return this.transportEventChannel.emit("pending",s),s instanceof Array?(this.addBatchReq(s,c),Promise.resolve()):this.addReq(s.internalID,c)},o.prototype.settlePendingRequest=function(s,c){var h=this;s.forEach(function(p){var g=h.pendingRequest[p.internalID];if(delete h.pendingBatchRequest[p.internalID],g!==void 0){if(c){g.reject(c);return}g.resolve(),(p.request.id===null||p.request.id===void 0)&&delete h.pendingRequest[p.internalID]}})},o.prototype.isPendingRequest=function(s){return this.pendingRequest.hasOwnProperty(s)},o.prototype.resolveResponse=function(s,c){c===void 0&&(c=!0);var h=s;try{return h=JSON.parse(s),this.checkJSONRPC(h)===!1?void 0:h instanceof Array?this.resolveBatch(h,c):this.resolveRes(h,c)}catch{var p=new a.JSONRPCError("Bad response format",a.ERR_UNKNOWN,s);return c&&this.transportEventChannel.emit("error",p),p}},o.prototype.addBatchReq=function(s,c){var h=this;return s.forEach(function(p){var g=p.resolve,b=p.reject,_=p.request.internalID;h.pendingBatchRequest[_]=!0,h.pendingRequest[_]={resolve:g,reject:b}}),Promise.resolve()},o.prototype.addReq=function(s,c){var h=this;return new Promise(function(p,g){c!==null&&c&&h.setRequestTimeout(s,c,g),h.pendingRequest[s]={resolve:p,reject:g}})},o.prototype.checkJSONRPC=function(s){var c=[s];return s instanceof Array&&(c=s),c.every(function(h){return h.result!==void 0||h.error!==void 0||h.method!==void 0})},o.prototype.processResult=function(s,c){if(s.error){var h=a.convertJSONToRPCError(s);c.reject(h);return}c.resolve(s.result)},o.prototype.resolveBatch=function(s,c){var h=this,p=s.map(function(g){return h.resolveRes(g,c)}).filter(function(g){return g});if(p.length>0)return p[0]},o.prototype.resolveRes=function(s,c){var h=s.id,p=s.error,g=this.pendingRequest[h];if(g){delete this.pendingRequest[h],this.processResult(s,g),this.transportEventChannel.emit("response",s);return}if(h===void 0&&p===void 0){this.transportEventChannel.emit("notification",s);return}var b;return p&&(b=a.convertJSONToRPCError(s)),c&&p&&b&&this.transportEventChannel.emit("error",b),b},o.prototype.setRequestTimeout=function(s,c,h){var p=this;setTimeout(function(){delete p.pendingRequest[s],h(new a.JSONRPCError("Request timeout request took longer than "+c+" ms to resolve",a.ERR_TIMEOUT))},c)},o})()})),Ya=tt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Transport=void 0;var n=_0();e.Transport=(function(){function a(){this.transportRequestManager=new n.TransportRequestManager,this.transportRequestManager.transportEventChannel.on("error",function(){})}return a.prototype.subscribe=function(o,s){this.transportRequestManager.transportEventChannel.addListener(o,s)},a.prototype.unsubscribe=function(o,s){if(!o)return this.transportRequestManager.transportEventChannel.removeAllListeners();o&&s&&this.transportRequestManager.transportEventChannel.removeListener(o,s)},a.prototype.parseData=function(o){return o instanceof Array?o.map(function(s){return s.request.request}):o.request},a})()})),Yi=tt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getNotifications=e.getBatchRequests=e.isNotification=void 0,e.isNotification=function(n){return n.request.id===void 0||n.request.id===null},e.getBatchRequests=function(n){return n instanceof Array?n.filter(function(a){return a.request.request.id!=null}).map(function(a){return a.request}):[]},e.getNotifications=function(n){return n instanceof Array?n.filter(function(a){return e.isNotification(a.request)}).map(function(a){return a.request}):e.isNotification(n)?[n]:[]}})),x0=tt((e=>{var n=e&&e.__extends||(function(){var c=function(h,p){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,b){g.__proto__=b}||function(g,b){for(var _ in b)b.hasOwnProperty(_)&&(g[_]=b[_])},c(h,p)};return function(h,p){c(h,p);function g(){this.constructor=h}h.prototype=p===null?Object.create(p):(g.prototype=p.prototype,new g)}})();Object.defineProperty(e,"__esModule",{value:!0});var a=Ya(),o=Yi(),s=Xi();e.default=(function(c){n(h,c);function h(p,g,b){var _=c.call(this)||this;return _.connection=p,_.reqUri=g,_.resUri=b,_}return h.prototype.connect=function(){var p=this;return this.connection.on(this.resUri,function(g){p.transportRequestManager.resolveResponse(g)}),Promise.resolve()},h.prototype.sendData=function(p,g){g===void 0&&(g=null);var b=this.transportRequestManager.addRequest(p,g),_=o.getNotifications(p),S=this.parseData(p);try{return this.connection.emit(this.reqUri,S),this.transportRequestManager.settlePendingRequest(_),b}catch(E){var C=new s.JSONRPCError(E.message,s.ERR_UNKNOWN,E);return this.transportRequestManager.settlePendingRequest(_,C),Promise.reject(C)}},h.prototype.close=function(){this.connection.removeAllListeners()},h})(a.Transport)}));function Sx(e){return e&&DataView.prototype.isPrototypeOf(e)}function Zi(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Cd(e){return typeof e!="string"&&(e=String(e)),e}function Ed(e){var n={next:function(){var a=e.shift();return{done:a===void 0,value:a}}};return an.iterable&&(n[Symbol.iterator]=function(){return n}),n}function Bt(e){this.map={},e instanceof Bt?e.forEach(function(n,a){this.append(a,n)},this):Array.isArray(e)?e.forEach(function(n){if(n.length!=2)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+n.length);this.append(n[0],n[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(n){this.append(n,e[n])},this)}function Td(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function k0(e){return new Promise(function(n,a){e.onload=function(){n(e.result)},e.onerror=function(){a(e.error)}})}function Cx(e){var n=new FileReader,a=k0(n);return n.readAsArrayBuffer(e),a}function Ex(e){var n=new FileReader,a=k0(n),o=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=o?o[1]:"utf-8";return n.readAsText(e,s),a}function Tx(e){for(var n=new Uint8Array(e),a=Array(n.length),o=0;o<n.length;o++)a[o]=String.fromCharCode(n[o]);return a.join("")}function S0(e){if(e.slice)return e.slice(0);var n=new Uint8Array(e.byteLength);return n.set(new Uint8Array(e)),n.buffer}function C0(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:an.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:an.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:an.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():an.arrayBuffer&&an.blob&&Sx(e)?(this._bodyArrayBuffer=S0(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):an.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||L0(e))?this._bodyArrayBuffer=S0(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):an.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},an.blob&&(this.blob=function(){var e=Td(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return Td(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(an.blob)return this.blob().then(Cx);throw Error("could not read as ArrayBuffer")},this.text=function(){var e=Td(this);if(e)return e;if(this._bodyBlob)return Ex(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Tx(this._bodyArrayBuffer));if(this._bodyFormData)throw Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},an.formData&&(this.formData=function(){return this.text().then(Ox)}),this.json=function(){return this.text().then(JSON.parse)},this}function Lx(e){var n=e.toUpperCase();return O0.indexOf(n)>-1?n:e}function ti(e,n){if(!(this instanceof ti))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');n||(n={});var a=n.body;if(e instanceof ti){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,n.headers||(this.headers=new Bt(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!a&&e._bodyInit!=null&&(a=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=n.credentials||this.credentials||"same-origin",(n.headers||!this.headers)&&(this.headers=new Bt(n.headers)),this.method=Lx(n.method||this.method||"GET"),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal||(function(){if("AbortController"in Wt)return new AbortController().signal})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&a)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(a),(this.method==="GET"||this.method==="HEAD")&&(n.cache==="no-store"||n.cache==="no-cache")){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function Ox(e){var n=new FormData;return e.trim().split("&").forEach(function(a){if(a){var o=a.split("="),s=o.shift().replace(/\+/g," "),c=o.join("=").replace(/\+/g," ");n.append(decodeURIComponent(s),decodeURIComponent(c))}}),n}function Ax(e){var n=new Bt;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(a){return a.indexOf(`
16
+ `)===0?a.substr(1,a.length):a}).forEach(function(a){var o=a.split(":"),s=o.shift().trim();if(s){var c=o.join(":").trim();try{n.append(s,c)}catch(h){console.warn("Response "+h.message)}}}),n}function wr(e,n){if(!(this instanceof wr))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(n||(n={}),this.type="default",this.status=n.status===void 0?200:n.status,this.status<200||this.status>599)throw RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=n.statusText===void 0?"":""+n.statusText,this.headers=new Bt(n.headers),this.url=n.url||"",this._initBody(e)}function E0(e,n){return new Promise(function(a,o){var s=new ti(e,n);if(s.signal&&s.signal.aborted)return o(new fa("Aborted","AbortError"));var c=new XMLHttpRequest;function h(){c.abort()}c.onload=function(){var b={statusText:c.statusText,headers:Ax(c.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(c.status<200||c.status>599)?b.status=200:b.status=c.status,b.url="responseURL"in c?c.responseURL:b.headers.get("X-Request-URL");var _="response"in c?c.response:c.responseText;setTimeout(function(){a(new wr(_,b))},0)},c.onerror=function(){setTimeout(function(){o(TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){o(TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){o(new fa("Aborted","AbortError"))},0)};function p(b){try{return b===""&&Wt.location.href?Wt.location.href:b}catch{return b}}if(c.open(s.method,p(s.url),!0),s.credentials==="include"?c.withCredentials=!0:s.credentials==="omit"&&(c.withCredentials=!1),"responseType"in c&&(an.blob?c.responseType="blob":an.arrayBuffer&&(c.responseType="arraybuffer")),n&&typeof n.headers=="object"&&!(n.headers instanceof Bt||Wt.Headers&&n.headers instanceof Wt.Headers)){var g=[];Object.getOwnPropertyNames(n.headers).forEach(function(b){g.push(Zi(b)),c.setRequestHeader(b,Cd(n.headers[b]))}),s.headers.forEach(function(b,_){g.indexOf(_)===-1&&c.setRequestHeader(_,b)})}else s.headers.forEach(function(b,_){c.setRequestHeader(_,b)});s.signal&&(s.signal.addEventListener("abort",h),c.onreadystatechange=function(){c.readyState===4&&s.signal.removeEventListener("abort",h)}),c.send(s._bodyInit===void 0?null:s._bodyInit)})}let Wt,an,T0,L0,O0,A0,fa,I0,R0,M0,P0,ni,N0,D0,j0,z0,q0,B0;I0=k2((()=>{Wt=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},an={searchParams:"URLSearchParams"in Wt,iterable:"Symbol"in Wt&&"iterator"in Symbol,blob:"FileReader"in Wt&&"Blob"in Wt&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in Wt,arrayBuffer:"ArrayBuffer"in Wt},an.arrayBuffer&&(T0=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],L0=ArrayBuffer.isView||function(e){return e&&T0.indexOf(Object.prototype.toString.call(e))>-1}),Bt.prototype.append=function(e,n){e=Zi(e),n=Cd(n);var a=this.map[e];this.map[e]=a?a+", "+n:n},Bt.prototype.delete=function(e){delete this.map[Zi(e)]},Bt.prototype.get=function(e){return e=Zi(e),this.has(e)?this.map[e]:null},Bt.prototype.has=function(e){return this.map.hasOwnProperty(Zi(e))},Bt.prototype.set=function(e,n){this.map[Zi(e)]=Cd(n)},Bt.prototype.forEach=function(e,n){for(var a in this.map)this.map.hasOwnProperty(a)&&e.call(n,this.map[a],a,this)},Bt.prototype.keys=function(){var e=[];return this.forEach(function(n,a){e.push(a)}),Ed(e)},Bt.prototype.values=function(){var e=[];return this.forEach(function(n){e.push(n)}),Ed(e)},Bt.prototype.entries=function(){var e=[];return this.forEach(function(n,a){e.push([a,n])}),Ed(e)},an.iterable&&(Bt.prototype[Symbol.iterator]=Bt.prototype.entries),O0=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],ti.prototype.clone=function(){return new ti(this,{body:this._bodyInit})},C0.call(ti.prototype),C0.call(wr.prototype),wr.prototype.clone=function(){return new wr(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Bt(this.headers),url:this.url})},wr.error=function(){var e=new wr(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e},A0=[301,302,303,307,308],wr.redirect=function(e,n){if(A0.indexOf(n)===-1)throw RangeError("Invalid status code");return new wr(null,{status:n,headers:{location:e}})},fa=Wt.DOMException;try{new fa}catch{fa=function(e,n){this.message=e,this.name=n,this.stack=Error(e).stack},fa.prototype=Object.create(Error.prototype),fa.prototype.constructor=fa}E0.polyfill=!0,Wt.fetch||(Wt.fetch=E0,Wt.Headers=Bt,Wt.Request=ti,Wt.Response=wr)})),R0=tt(((e,n)=>{I0(),n.exports=self.fetch.bind(self)})),M0=tt((e=>{var n=e&&e.__extends||(function(){var _=function(S,C){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,O){E.__proto__=O}||function(E,O){for(var M in O)O.hasOwnProperty(M)&&(E[M]=O[M])},_(S,C)};return function(S,C){_(S,C);function E(){this.constructor=S}S.prototype=C===null?Object.create(C):(E.prototype=C.prototype,new E)}})(),a=e&&e.__awaiter||function(_,S,C,E){function O(M){return M instanceof C?M:new C(function(V){V(M)})}return new(C||(C=Promise))(function(M,V){function H(ne){try{N(E.next(ne))}catch(fe){V(fe)}}function $(ne){try{N(E.throw(ne))}catch(fe){V(fe)}}function N(ne){ne.done?M(ne.value):O(ne.value).then(H,$)}N((E=E.apply(_,S||[])).next())})},o=e&&e.__generator||function(_,S){var C={label:0,sent:function(){if(M[0]&1)throw M[1];return M[1]},trys:[],ops:[]},E,O,M,V;return V={next:H(0),throw:H(1),return:H(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function H(N){return function(ne){return $([N,ne])}}function $(N){if(E)throw TypeError("Generator is already executing.");for(;C;)try{if(E=1,O&&(M=N[0]&2?O.return:N[0]?O.throw||((M=O.return)&&M.call(O),0):O.next)&&!(M=M.call(O,N[1])).done)return M;switch(O=0,M&&(N=[N[0]&2,M.value]),N[0]){case 0:case 1:M=N;break;case 4:return C.label++,{value:N[1],done:!1};case 5:C.label++,O=N[1],N=[0];continue;case 7:N=C.ops.pop(),C.trys.pop();continue;default:if(M=C.trys,!(M=M.length>0&&M[M.length-1])&&(N[0]===6||N[0]===2)){C=0;continue}if(N[0]===3&&(!M||N[1]>M[0]&&N[1]<M[3])){C.label=N[1];break}if(N[0]===6&&C.label<M[1]){C.label=M[1],M=N;break}if(M&&C.label<M[2]){C.label=M[2],C.ops.push(N);break}M[2]&&C.ops.pop(),C.trys.pop();continue}N=S.call(_,C)}catch(ne){N=[6,ne],O=0}finally{E=M=0}if(N[0]&5)throw N[1];return{value:N[0]?N[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTTPTransport=void 0;var c=s(R0()),h=Ya(),p=Yi(),g=Xi(),b=(function(_){n(S,_);function S(C,E){var O=_.call(this)||this;return O.onlyNotifications=function(M){return M instanceof Array?M.every(function(V){return V.request.request.id===null||V.request.request.id===void 0}):M.request.id===null||M.request.id===void 0},O.uri=C,O.credentials=E&&E.credentials,O.headers=S.setupHeaders(E&&E.headers),O.injectedFetcher=E==null?void 0:E.fetcher,O}return S.prototype.connect=function(){return Promise.resolve()},S.prototype.sendData=function(C,E){return E===void 0&&(E=null),a(this,void 0,void 0,function(){var O,M,V,H,$,N,fe,ne,fe;return o(this,function(R){switch(R.label){case 0:O=this.transportRequestManager.addRequest(C,E),M=p.getNotifications(C),V=p.getBatchRequests(C),H=this.injectedFetcher||c.default,R.label=1;case 1:return R.trys.push([1,4,,5]),[4,H(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(C)),credentials:this.credentials})];case 2:return $=R.sent(),this.transportRequestManager.settlePendingRequest(M),this.onlyNotifications(C)?[2,Promise.resolve()]:[4,$.text()];case 3:return N=R.sent(),fe=this.transportRequestManager.resolveResponse(N),fe?(this.transportRequestManager.settlePendingRequest(V,fe),[2,Promise.reject(fe)]):[3,5];case 4:return ne=R.sent(),fe=new g.JSONRPCError(ne.message,g.ERR_UNKNOWN,ne),this.transportRequestManager.settlePendingRequest(M,fe),this.transportRequestManager.settlePendingRequest(p.getBatchRequests(C),fe),[2,Promise.reject(fe)];case 5:return[2,O]}})})},S.prototype.close=function(){},S.setupHeaders=function(C){var E=new Headers(C);return E.set("Content-Type","application/json"),E},S})(h.Transport);e.HTTPTransport=b,e.default=b})),P0=K6({default:()=>N0},1),D0=k2((()=>{ni=null,typeof WebSocket<"u"?ni=WebSocket:typeof MozWebSocket<"u"?ni=MozWebSocket:typeof global<"u"?ni=global.WebSocket||global.MozWebSocket:typeof window<"u"?ni=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(ni=self.WebSocket||self.MozWebSocket),N0=ni})),j0=tt((e=>{var n=e&&e.__extends||(function(){var b=function(_,S){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,E){C.__proto__=E}||function(C,E){for(var O in E)E.hasOwnProperty(O)&&(C[O]=E[O])},b(_,S)};return function(_,S){b(_,S);function C(){this.constructor=_}_.prototype=S===null?Object.create(S):(C.prototype=S.prototype,new C)}})(),a=e&&e.__awaiter||function(b,_,S,C){function E(O){return O instanceof S?O:new S(function(M){M(O)})}return new(S||(S=Promise))(function(O,M){function V(N){try{$(C.next(N))}catch(ne){M(ne)}}function H(N){try{$(C.throw(N))}catch(ne){M(ne)}}function $(N){N.done?O(N.value):E(N.value).then(V,H)}$((C=C.apply(b,_||[])).next())})},o=e&&e.__generator||function(b,_){var S={label:0,sent:function(){if(O[0]&1)throw O[1];return O[1]},trys:[],ops:[]},C,E,O,M;return M={next:V(0),throw:V(1),return:V(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function V($){return function(N){return H([$,N])}}function H($){if(C)throw TypeError("Generator is already executing.");for(;S;)try{if(C=1,E&&(O=$[0]&2?E.return:$[0]?E.throw||((O=E.return)&&O.call(E),0):E.next)&&!(O=O.call(E,$[1])).done)return O;switch(E=0,O&&($=[$[0]&2,O.value]),$[0]){case 0:case 1:O=$;break;case 4:return S.label++,{value:$[1],done:!1};case 5:S.label++,E=$[1],$=[0];continue;case 7:$=S.ops.pop(),S.trys.pop();continue;default:if(O=S.trys,!(O=O.length>0&&O[O.length-1])&&($[0]===6||$[0]===2)){S=0;continue}if($[0]===3&&(!O||$[1]>O[0]&&$[1]<O[3])){S.label=$[1];break}if($[0]===6&&S.label<O[1]){S.label=O[1],O=$;break}if(O&&S.label<O[2]){S.label=O[2],S.ops.push($);break}O[2]&&S.ops.pop(),S.trys.pop();continue}$=_.call(b,S)}catch(N){$=[6,N],E=0}finally{C=O=0}if($[0]&5)throw $[1];return{value:$[0]?$[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0});var c=s((D0(),W6(P0))),h=Ya(),p=Yi(),g=Xi();e.default=(function(b){n(_,b);function _(S){var C=b.call(this)||this;return C.uri=S,C.connection=new c.default(S),C}return _.prototype.connect=function(){var S=this;return new Promise(function(C,E){var O=function(){S.connection.removeEventListener("open",O),C()};S.connection.addEventListener("open",O),S.connection.addEventListener("message",function(M){var V=M.data;S.transportRequestManager.resolveResponse(V)})})},_.prototype.sendData=function(S,C){return C===void 0&&(C=5e3),a(this,void 0,void 0,function(){var E,O,M;return o(this,function(V){E=this.transportRequestManager.addRequest(S,C),O=p.getNotifications(S);try{this.connection.send(JSON.stringify(this.parseData(S))),this.transportRequestManager.settlePendingRequest(O)}catch(H){M=new g.JSONRPCError(H.message,g.ERR_UNKNOWN,H),this.transportRequestManager.settlePendingRequest(O,M),this.transportRequestManager.settlePendingRequest(p.getBatchRequests(S),M),E=Promise.reject(M)}return[2,E]})})},_.prototype.close=function(){this.connection.close()},_})(h.Transport)})),z0=tt((e=>{var n=e&&e.__extends||(function(){var p=function(g,b){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,S){_.__proto__=S}||function(_,S){for(var C in S)S.hasOwnProperty(C)&&(_[C]=S[C])},p(g,b)};return function(g,b){p(g,b);function _(){this.constructor=g}g.prototype=b===null?Object.create(b):(_.prototype=b.prototype,new _)}})(),a=e&&e.__awaiter||function(p,g,b,_){function S(C){return C instanceof b?C:new b(function(E){E(C)})}return new(b||(b=Promise))(function(C,E){function O(H){try{V(_.next(H))}catch($){E($)}}function M(H){try{V(_.throw(H))}catch($){E($)}}function V(H){H.done?C(H.value):S(H.value).then(O,M)}V((_=_.apply(p,g||[])).next())})},o=e&&e.__generator||function(p,g){var b={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},_,S,C,E;return E={next:O(0),throw:O(1),return:O(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function O(V){return function(H){return M([V,H])}}function M(V){if(_)throw TypeError("Generator is already executing.");for(;b;)try{if(_=1,S&&(C=V[0]&2?S.return:V[0]?S.throw||((C=S.return)&&C.call(S),0):S.next)&&!(C=C.call(S,V[1])).done)return C;switch(S=0,C&&(V=[V[0]&2,C.value]),V[0]){case 0:case 1:C=V;break;case 4:return b.label++,{value:V[1],done:!1};case 5:b.label++,S=V[1],V=[0];continue;case 7:V=b.ops.pop(),b.trys.pop();continue;default:if(C=b.trys,!(C=C.length>0&&C[C.length-1])&&(V[0]===6||V[0]===2)){b=0;continue}if(V[0]===3&&(!C||V[1]>C[0]&&V[1]<C[3])){b.label=V[1];break}if(V[0]===6&&b.label<C[1]){b.label=C[1],C=V;break}if(C&&b.label<C[2]){b.label=C[2],b.ops.push(V);break}C[2]&&b.ops.pop(),b.trys.pop();continue}V=g.call(p,b)}catch(H){V=[6,H],S=0}finally{_=C=0}if(V[0]&5)throw V[1];return{value:V[0]?V[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=Ya(),c=Yi(),h=function(p){var g=400,b=window.screen.height;return window.open(p,"inspector:popup","left=0,top=0,width="+g+",height="+b+",resizable,scrollbars=yes,status=1")};e.default=(function(p){n(g,p);function g(b){var _=p.call(this)||this;return _.messageHandler=function(S){_.transportRequestManager.resolveResponse(JSON.stringify(S.data))},_.uri=b,_.postMessageID="post-message-transport-"+Math.random(),_}return g.prototype.createWindow=function(b){return new Promise(function(_,S){var C=h(b);setTimeout(function(){_(C)},3e3)})},g.prototype.connect=function(){var b=this,_=/^(http|https):\/\/.*$/;return new Promise(function(S,C){return a(b,void 0,void 0,function(){var E;return o(this,function(O){switch(O.label){case 0:return _.test(this.uri)||C(Error("Bad URI")),E=this,[4,this.createWindow(this.uri)];case 1:return E.frame=O.sent(),window.addEventListener("message",this.messageHandler),S(),[2]}})})})},g.prototype.sendData=function(b,_){return _===void 0&&(_=5e3),a(this,void 0,void 0,function(){var S,C;return o(this,function(E){return S=this.transportRequestManager.addRequest(b,null),C=c.getNotifications(b),this.frame&&(this.frame.postMessage(b.request,this.uri),this.transportRequestManager.settlePendingRequest(C)),[2,S]})})},g.prototype.close=function(){this.frame&&(window.removeEventListener("message",this.messageHandler),this.frame.close())},g})(s.Transport)})),q0=tt((e=>{var n=e&&e.__extends||(function(){var h=function(p,g){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,_){b.__proto__=_}||function(b,_){for(var S in _)_.hasOwnProperty(S)&&(b[S]=_[S])},h(p,g)};return function(p,g){h(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}})(),a=e&&e.__awaiter||function(h,p,g,b){function _(S){return S instanceof g?S:new g(function(C){C(S)})}return new(g||(g=Promise))(function(S,C){function E(V){try{M(b.next(V))}catch(H){C(H)}}function O(V){try{M(b.throw(V))}catch(H){C(H)}}function M(V){V.done?S(V.value):_(V.value).then(E,O)}M((b=b.apply(h,p||[])).next())})},o=e&&e.__generator||function(h,p){var g={label:0,sent:function(){if(S[0]&1)throw S[1];return S[1]},trys:[],ops:[]},b,_,S,C;return C={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function E(M){return function(V){return O([M,V])}}function O(M){if(b)throw TypeError("Generator is already executing.");for(;g;)try{if(b=1,_&&(S=M[0]&2?_.return:M[0]?_.throw||((S=_.return)&&S.call(_),0):_.next)&&!(S=S.call(_,M[1])).done)return S;switch(_=0,S&&(M=[M[0]&2,S.value]),M[0]){case 0:case 1:S=M;break;case 4:return g.label++,{value:M[1],done:!1};case 5:g.label++,_=M[1],M=[0];continue;case 7:M=g.ops.pop(),g.trys.pop();continue;default:if(S=g.trys,!(S=S.length>0&&S[S.length-1])&&(M[0]===6||M[0]===2)){g=0;continue}if(M[0]===3&&(!S||M[1]>S[0]&&M[1]<S[3])){g.label=M[1];break}if(M[0]===6&&g.label<S[1]){g.label=S[1],S=M;break}if(S&&g.label<S[2]){g.label=S[2],g.ops.push(M);break}S[2]&&g.ops.pop(),g.trys.pop();continue}M=p.call(h,g)}catch(V){M=[6,V],_=0}finally{b=S=0}if(M[0]&5)throw M[1];return{value:M[0]?M[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=Ya(),c=Yi();e.default=(function(h){n(p,h);function p(g){var b=h.call(this)||this;return b.messageHandler=function(_){b.transportRequestManager.resolveResponse(JSON.stringify(_.data))},b.uri=g,b.postMessageID="post-message-transport-"+Math.random(),b}return p.prototype.createWindow=function(g){var b=this;return new Promise(function(_,S){var C,E=document.createElement("iframe");E.setAttribute("id",b.postMessageID),E.setAttribute("width","0px"),E.setAttribute("height","0px"),E.setAttribute("style","visiblity:hidden;border:none;outline:none;"),E.addEventListener("load",function(){_(C)}),E.setAttribute("src",g),window.document.body.appendChild(E),C=E.contentWindow})},p.prototype.connect=function(){var g=this,b=/^(http|https):\/\/.*$/;return new Promise(function(_,S){return a(g,void 0,void 0,function(){var C;return o(this,function(E){switch(E.label){case 0:return b.test(this.uri)||S(Error("Bad URI")),C=this,[4,this.createWindow(this.uri)];case 1:return C.frame=E.sent(),window.addEventListener("message",this.messageHandler),_(),[2]}})})})},p.prototype.sendData=function(g,b){return b===void 0&&(b=5e3),a(this,void 0,void 0,function(){var _,S;return o(this,function(C){return _=this.transportRequestManager.addRequest(g,null),S=c.getNotifications(g),this.frame&&(this.frame.postMessage(g.request,"*"),this.transportRequestManager.settlePendingRequest(S)),[2,_]})})},p.prototype.close=function(){var g;(g=document.getElementById(this.postMessageID))==null||g.remove(),window.removeEventListener("message",this.messageHandler)},p})(s.Transport)})),B0=tt((e=>{var n=e&&e.__awaiter||function(o,s,c,h){function p(g){return g instanceof c?g:new c(function(b){b(g)})}return new(c||(c=Promise))(function(g,b){function _(E){try{C(h.next(E))}catch(O){b(O)}}function S(E){try{C(h.throw(E))}catch(O){b(O)}}function C(E){E.done?g(E.value):p(E.value).then(_,S)}C((h=h.apply(o,s||[])).next())})},a=e&&e.__generator||function(o,s){var c={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},h,p,g,b;return b={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function _(C){return function(E){return S([C,E])}}function S(C){if(h)throw TypeError("Generator is already executing.");for(;c;)try{if(h=1,p&&(g=C[0]&2?p.return:C[0]?p.throw||((g=p.return)&&g.call(p),0):p.next)&&!(g=g.call(p,C[1])).done)return g;switch(p=0,g&&(C=[C[0]&2,g.value]),C[0]){case 0:case 1:g=C;break;case 4:return c.label++,{value:C[1],done:!1};case 5:c.label++,p=C[1],C=[0];continue;case 7:C=c.ops.pop(),c.trys.pop();continue;default:if(g=c.trys,!(g=g.length>0&&g[g.length-1])&&(C[0]===6||C[0]===2)){c=0;continue}if(C[0]===3&&(!g||C[1]>g[0]&&C[1]<g[3])){c.label=C[1];break}if(C[0]===6&&c.label<g[1]){c.label=g[1],g=C;break}if(g&&c.label<g[2]){c.label=g[2],c.ops.push(C);break}g[2]&&c.ops.pop(),c.trys.pop();continue}C=s.call(o,c)}catch(E){C=[6,E],p=0}finally{h=g=0}if(C[0]&5)throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=(function(){function o(s){this.requestManager=s}return o.prototype.startBatch=function(){return this.requestManager.startBatch()},o.prototype.stopBatch=function(){return this.requestManager.stopBatch()},o.prototype.request=function(s,c){return n(this,void 0,void 0,function(){return a(this,function(h){switch(h.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:h.sent(),h.label=2;case 2:return[2,this.requestManager.request(s,!1,c)]}})})},o.prototype.notify=function(s){return n(this,void 0,void 0,function(){return a(this,function(c){switch(c.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:c.sent(),c.label=2;case 2:return[2,this.requestManager.request(s,!0,null)]}})})},o.prototype.onNotification=function(s){this.requestManager.requestChannel.addListener("notification",s)},o.prototype.onError=function(s){this.requestManager.requestChannel.addListener("error",s)},o.prototype.close=function(){this.requestManager.close()},o})()})),Sl=tt((e=>{var n=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.PostMessageIframeTransport=e.PostMessageWindowTransport=e.JSONRPCError=e.WebSocketTransport=e.EventEmitterTransport=e.HTTPTransport=e.RequestManager=e.Client=void 0,e.RequestManager=n(w0()).default,e.EventEmitterTransport=n(x0()).default,e.HTTPTransport=n(M0()).default,e.WebSocketTransport=n(j0()).default,e.PostMessageWindowTransport=n(z0()).default,e.PostMessageIframeTransport=n(q0()).default;var a=Xi();Object.defineProperty(e,"JSONRPCError",{enumerable:!0,get:function(){return a.JSONRPCError}});var o=n(B0());e.Client=o.default,e.default=o.default}));function Ut(e,n){if(n.line>=e.lines)return n.character===0?e.length:void 0;let a=e.line(n.line+1).from+n.character;if(!(a>e.length))return a}function ir(e,n){return Ut(e,n)||0}function pa(e,n){let a=e.lineAt(n);return{character:n-a.from,line:a.number-1}}var Pl=new Y2.Renderer,Ix=Pl.code;Pl.code=e=>e.text.trim()?Ix.call(Pl,e):"";function F0(e){return Y2(e,{async:!1,gfm:!0,breaks:!0,renderer:Pl})}function or(e,n=F0){if(!e)return"";if(Nx(e)){let a=e.value;return e.kind==="markdown"&&(a=n(a.trim())),a}return Array.isArray(e)?e.map(a=>or(a,n)).filter(Boolean).join(`
17
17
 
18
- `):typeof e=="string"?e:""}function Ix(e){if(e.length===0)return"";if(e.length===1)return e[0]||"";e.sort();let n=e[0]||"",a=e[e.length-1]||"",o=0;for(;o<n.length&&n[o]===a[o];)o++;return n.substring(0,o)}function Rx(e){if(e.length===0)return;let n=Ix(e.map(s=>{var c;return((c=s.textEdit)==null?void 0:c.newText)||s.label}));if(n==="")return;let a=[];for(let s=0;s<n.length;s++){let c=n.slice(0,s+1);if(c.length>0){let h=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a.push(h)}}let o=a.join("|");return RegExp(`(${o})$`)}function Mx(e){return(e==null?void 0:e.range)!==void 0}function Px(e){return e.kind!==void 0}function Ln(e,n){let a=document.createElement("div");a.className="cm-error-message",a.style.cssText=`
18
+ `):typeof e=="string"?e:""}function Rx(e){if(e.length===0)return"";if(e.length===1)return e[0]||"";e.sort();let n=e[0]||"",a=e[e.length-1]||"",o=0;for(;o<n.length&&n[o]===a[o];)o++;return n.substring(0,o)}function Mx(e){if(e.length===0)return;let n=Rx(e.map(s=>{var c;return((c=s.textEdit)==null?void 0:c.newText)||s.label}));if(n==="")return;let a=[];for(let s=0;s<n.length;s++){let c=n.slice(0,s+1);if(c.length>0){let h=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a.push(h)}}let o=a.join("|");return RegExp(`(${o})$`)}function Px(e){return(e==null?void 0:e.range)!==void 0}function Nx(e){return e.kind!==void 0}function Ln(e,n){let a=document.createElement("div");a.className="cm-error-message",a.style.cssText=`
19
19
  position: absolute;
20
20
  padding: 8px;
21
21
  background: #fee;
@@ -26,20 +26,20 @@ ${o.join(`
26
26
  z-index: 100;
27
27
  max-width: 300px;
28
28
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
29
- `,a.textContent=n;let o=e.coordsAtPos(e.state.selection.main.head);o&&(a.style.left=`${o.left}px`,a.style.top=`${o.bottom+5}px`),document.body.appendChild(a),setTimeout(()=>{a.style.opacity="0",a.style.transition="opacity 0.2s",setTimeout(()=>a.remove(),200)},3e3)}function Nl(e){if(e==null)return!0;if(Array.isArray(e))return e.length===0||e.every(Nl);if(typeof e=="string")return V0(e);let n=e.value;return typeof n=="string"?V0(n):!1}function V0(e){return e==null?!0:typeof e=="string"?e.trim()===""||/^[\s\n`]*$/.test(e):!1}function Nx(e,n){let a=[];return n.iterChanges((o,s,c,h,p)=>{let g=p.toString();if(o===0&&s===e.length){a.push({text:g});return}let b=pa(e,o),_=pa(e,s);a.push({range:{start:b,end:_},text:g})}),a.sort((o,s)=>{if(!o.range)return 1;if(!s.range)return-1;let c=o.range.start.line??-1,h=s.range.start.line??-1;if(c!==h)return h-c;let p=o.range.start.character??-1;return(s.range.start.character??-1)-p}),a}var Dx=X2(),jx=Object.fromEntries(Object.entries(Dx.CompletionItemKind).map(([e,n])=>[n,e])),H0;(function(e){e.PlainText=1,e.Snippet=2})(H0||(H0={}));function zx(e){return e.replaceAll(/\\\\/g,"").replaceAll(/(\$(\d+))/g,(n,a,o)=>"${"+o+"}")}function qx(e,n){let{detail:a,labelDetails:o,label:s,kind:c,textEdit:h,insertText:p,documentation:g,additionalTextEdits:b,insertTextFormat:_}=e,S={label:s,detail:(o==null?void 0:o.detail)||a,apply(C,E,O,M){if(h&&Mx(h)?C.dispatch(G2(C.state,h.newText,ir(C.state.doc,h.range.start),ir(C.state.doc,h.range.end))):p&&_===H0.Snippet&&n.useSnippetOnCompletion?nT(zx(p))(C,null,O,M):C.dispatch(G2(C.state,p||s,O,M)),!b)return;let V=b.sort(({range:{end:H}},{range:{end:$}})=>ir(C.state.doc,H)<ir(C.state.doc,$)?1:ir(C.state.doc,H)>ir(C.state.doc,$)?-1:0);for(let H of V)C.dispatch(C.state.update({changes:{from:ir(C.state.doc,H.range.start),to:Ut(C.state.doc,H.range.end),insert:H.newText}}))},type:c&&jx[c].toLowerCase()};return n.hasResolveProvider&&n.resolveItem?S.info=async()=>{var C;try{let E=await((C=n.resolveItem)==null?void 0:C.call(n,e)),O=document.createElement("div");O.classList.add("documentation");let M=(E==null?void 0:E.documentation)||g;return!M||Nl(M)?null:(n.allowHTMLContent?O.innerHTML=or(M,n.markdownRenderer):O.textContent=or(M,n.markdownRenderer),O)}catch(E){if(console.error("Failed to resolve completion item:",E),Nl(g))return null;if(g){let O=document.createElement("div");return O.classList.add("documentation"),n.allowHTMLContent?O.innerHTML=or(g,n.markdownRenderer):O.textContent=or(g,n.markdownRenderer),O}return null}}:g&&(S.info=()=>{let C=document.createElement("div");return C.classList.add("documentation"),n.allowHTMLContent?C.innerHTML=or(g,n.markdownRenderer):C.textContent=or(g,n.markdownRenderer),C}),S}function Bx(e,n,a){let o=[n?Fx(n):Vx,a==="python"?Hx:void 0].filter(Boolean),s=e;if(n){let c=n.toLowerCase();/^\w+$/.test(c)&&(s=s.filter(({label:h,filterText:p})=>(p??h).toLowerCase().startsWith(c)))}for(let c of o)s.sort(c);return s}function Fx(e){return(n,a)=>{let o=n.sortText??n.label,s=a.sortText??a.label;switch(!0){case(o.startsWith(e)&&!s.startsWith(e)):return-1;case(!o.startsWith(e)&&s.startsWith(e)):return 1}return o.localeCompare(s)}}function Vx(e,n){let a=e.sortText??e.label,o=n.sortText??n.label;return a.localeCompare(o)}function Hx(e,n){let a=e.label.endsWith("="),o=n.label.endsWith("=");return a&&!o?-1:!a&&o?1:0}function $0(e){let n=new Proxy({},{get(){throw Error(e)}});return function(a){return a.at(-1)??n}}const W0=ml.define({combine:$0("No document URI provided. Either pass a one into the extension or use documentUri.of().")}),$x=ml.define({combine:$0("No language ID provided. Either pass a one into the extension or use languageId.of().")});let Ld,U0;Ld=Sl(),U0=1e4,ns=class{constructor({rootUri:e,workspaceFolders:n,transport:a,initializationOptions:o,capabilities:s,timeout:c=U0,getWorkspaceConfiguration:h}){ve(this,"ready");ve(this,"capabilities");ve(this,"initializePromise");ve(this,"rootUri");ve(this,"workspaceFolders");ve(this,"timeout");ve(this,"transport");ve(this,"requestManager");ve(this,"client");ve(this,"initializationOptions");ve(this,"clientCapabilities");ve(this,"notificationListeners",new Set);this.rootUri=e,this.workspaceFolders=n,this.transport=a,this.initializationOptions=o,this.clientCapabilities=s,this.timeout=c,this.ready=!1,this.capabilities=null,this.requestManager=new Ld.RequestManager([this.transport]),this.client=new Ld.Client(this.requestManager),this.client.onNotification(g=>{this.processNotification(g)});let p=this.transport;p!=null&&p.connection&&p.connection.addEventListener("message",g=>{let b=JSON.parse(g.data);b.method==="workspace/configuration"&&h?p.connection.send(JSON.stringify({jsonrpc:"2.0",id:b.id,result:h(b.params)})):b.method&&b.id&&p.connection.send(JSON.stringify({jsonrpc:"2.0",id:b.id,result:null}))}),this.initializePromise=this.initialize()}getInitializationOptions(){let e={textDocument:{hover:{dynamicRegistration:!0,contentFormat:["markdown","plaintext"]},moniker:{},synchronization:{dynamicRegistration:!0,willSave:!1,didSave:!1,willSaveWaitUntil:!1},codeAction:{dynamicRegistration:!0,codeActionLiteralSupport:{codeActionKind:{valueSet:["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},resolveSupport:{properties:["edit"]}},completion:{dynamicRegistration:!0,completionItem:{snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:["markdown","plaintext"],deprecatedSupport:!1,preselectSupport:!1},contextSupport:!1},signatureHelp:{dynamicRegistration:!0,signatureInformation:{documentationFormat:["markdown","plaintext"]}},declaration:{dynamicRegistration:!0,linkSupport:!0},definition:{dynamicRegistration:!0,linkSupport:!0},typeDefinition:{dynamicRegistration:!0,linkSupport:!0},implementation:{dynamicRegistration:!0,linkSupport:!0},rename:{dynamicRegistration:!0,prepareSupport:!0}},workspace:{didChangeConfiguration:{dynamicRegistration:!0}}};return{capabilities:this.clientCapabilities?typeof this.clientCapabilities=="function"?this.clientCapabilities(e):this.clientCapabilities:e,initializationOptions:this.initializationOptions,processId:null,rootUri:this.rootUri,workspaceFolders:this.workspaceFolders}}async initialize(){let{capabilities:e}=await this.request("initialize",this.getInitializationOptions(),this.timeout*3);this.capabilities=e,this.notify("initialized",{}),this.ready=!0}close(){this.client.close()}textDocumentDidOpen(e){return this.notify("textDocument/didOpen",e)}textDocumentDidChange(e){return this.notify("textDocument/didChange",e)}async textDocumentHover(e){return await this.request("textDocument/hover",e,this.timeout)}async textDocumentCompletion(e){return await this.request("textDocument/completion",e,this.timeout)}async completionItemResolve(e){return await this.request("completionItem/resolve",e,this.timeout)}async textDocumentDefinition(e){return await this.request("textDocument/definition",e,this.timeout)}async textDocumentCodeAction(e){return await this.request("textDocument/codeAction",e,this.timeout)}async textDocumentRename(e){return await this.request("textDocument/rename",e,this.timeout)}async textDocumentPrepareRename(e){return await this.request("textDocument/prepareRename",e,this.timeout)}async textDocumentSignatureHelp(e){return await this.request("textDocument/signatureHelp",e,this.timeout)}onNotification(e){return this.notificationListeners.add(e),()=>this.notificationListeners.delete(e)}request(e,n,a){return this.client.request({method:e,params:n},a)}notify(e,n){return this.client.notify({method:e,params:n})}processNotification(e){this.notificationListeners.forEach(n=>n(e))}},Sl();var ha=X2(),K0=console.log;function Wx(){return String(Date.now()+Math.random())}let Od;Tl=aa.define(),Ll=Zo.define({create:()=>null,update(e,n){for(let a of n.effects)if(a.is(Tl))return a.value;if(e&&n.docChanged){let a=n.changes.mapPos(e.pos),o=e.end==null?void 0:n.changes.mapPos(e.end);return{...e,pos:a,end:o}}return e},provide:e=>O5.from(e)}),Od=_5.define();var Ux=20,Kx=class{constructor(e){ve(this,"documentVersion");ve(this,"pluginId");ve(this,"client");ve(this,"documentUri");ve(this,"languageId");ve(this,"view");ve(this,"allowHTMLContent");ve(this,"useSnippetOnCompletion");ve(this,"sendIncrementalChanges");ve(this,"featureOptions");ve(this,"onGoToDefinition");ve(this,"markdownRenderer");ve(this,"disposeListener");ve(this,"lastSeenDiagnosticsVersion",0);let{client:n,documentUri:a,languageId:o,view:s,featureOptions:c,sendIncrementalChanges:h=!0,allowHTMLContent:p=!1,useSnippetOnCompletion:g=!1,onGoToDefinition:b,markdownRenderer:_=F0}=e;this.documentVersion=0,this.pluginId=Wx(),this.client=n,this.documentUri=a,this.languageId=o,this.view=s,this.allowHTMLContent=p,this.useSnippetOnCompletion=g,this.sendIncrementalChanges=h,this.featureOptions=c,this.onGoToDefinition=b,this.markdownRenderer=_,this.disposeListener=n.onNotification(this.processNotification.bind(this)),this.initialize({documentText:this.view.state.doc.toString()})}update({state:e,docChanged:n,startState:{doc:a},changes:o}){n&&(this.sendIncrementalChanges?this.sendChanges(Nx(a,o)):this.sendChanges([{text:e.doc.toString()}]))}destroy(){var e;(e=this.disposeListener)==null||e.call(this)}async initialize({documentText:e}){this.client.initializePromise&&await this.client.initializePromise,await this.client.textDocumentDidOpen({textDocument:{uri:this.documentUri,languageId:this.languageId,text:e,version:this.documentVersion}})}async sendChanges(e){if(this.client.ready)try{await this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:++this.documentVersion},contentChanges:e})}catch(n){console.error(n)}}requestDiagnostics(e){this.sendChanges([{text:e.state.doc.toString()}])}async requestHoverTooltip(e,{line:n,character:a}){var b;if(!this.featureOptions.hoverEnabled||!(this.client.ready&&((b=this.client.capabilities)!=null&&b.hoverProvider)))return null;let o=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:n,character:a}});if(!o)return null;let{contents:s,range:c}=o,h=Ut(e.state.doc,{line:n,character:a}),p;if(c&&(h=Ut(e.state.doc,c.start),p=Ut(e.state.doc,c.end)),h==null||Nl(s))return null;let g=document.createElement("div");return g.classList.add("documentation","cm-lsp-hover-tooltip"),this.allowHTMLContent?g.innerHTML=or(s,this.markdownRenderer):g.textContent=or(s,this.markdownRenderer),{pos:h,end:p,create:_=>({dom:g}),above:!0}}async requestCompletion(e,{line:n,character:a},{triggerKind:o,triggerCharacter:s}){var C;if(!this.featureOptions.completionEnabled||!(this.client.ready&&((C=this.client.capabilities)!=null&&C.completionProvider)))return null;let c=await this.client.textDocumentCompletion({textDocument:{uri:this.documentUri},position:{line:n,character:a},context:{triggerKind:o,triggerCharacter:s}});if(!c)return null;let h="items"in c?c.items:c,p=Rx(h),g=p?e.matchBefore(p)??e.matchBefore(/[a-zA-Z0-9_]+/):e.matchBefore(/[a-zA-Z0-9_]+/),{pos:b}=e,_=Bx(h,g==null?void 0:g.text,this.languageId);g&&(b=g.from);let S=_.map(E=>{var O,M;return qx(E,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:((M=(O=this.client.capabilities)==null?void 0:O.completionProvider)==null?void 0:M.resolveProvider)??!1,resolveItem:this.client.completionItemResolve.bind(this.client)})});return{from:b,options:S,filter:!1}}async requestDefinition(e,{line:n,character:a}){var _;if(!this.featureOptions.definitionEnabled||!(this.client.ready&&((_=this.client.capabilities)!=null&&_.definitionProvider)))return;let o=await this.client.textDocumentDefinition({textDocument:{uri:this.documentUri},position:{line:n,character:a}});if(!o)return;let s=Array.isArray(o)?o:[o];if(s.length===0)return;let c=s[0];if(!c)return;let h="uri"in c?c.uri:c.targetUri,p="range"in c?c.range:c.targetRange,g=h!==this.documentUri,b={uri:h,range:p,isExternalDocument:g};return g||e.dispatch(e.state.update({selection:{anchor:ir(e.state.doc,p.start),head:Ut(e.state.doc,p.end)}})),this.onGoToDefinition&&this.onGoToDefinition(b),b}processNotification(e){try{e.method==="textDocument/publishDiagnostics"&&this.processDiagnostics(e.params)}catch(n){K0(n)}}async processDiagnostics(e){if(e.uri!==this.documentUri)return;if(e.version!=null&&e.version>this.lastSeenDiagnosticsVersion&&(this.lastSeenDiagnosticsVersion=e.version,this.clearDiagnostics()),!this.featureOptions.diagnosticsEnabled){this.clearDiagnostics();return}let n={[ha.DiagnosticSeverity.Error]:"error",[ha.DiagnosticSeverity.Warning]:"warning",[ha.DiagnosticSeverity.Information]:"info",[ha.DiagnosticSeverity.Hint]:"info"},a=e.diagnostics.map(async({range:s,message:c,severity:h,code:p,source:g})=>{var _;let b=(_=await this.requestCodeActions(s,[p]))==null?void 0:_.map(S=>{var C;return{name:"command"in S&&typeof S.command=="object"&&((C=S.command)==null?void 0:C.title)||S.title,apply:async()=>{var E;if("edit"in S&&((E=S.edit)!=null&&E.changes)){let O=S.edit.changes[this.documentUri];if(!O)return;for(let M of O)this.view.dispatch(this.view.state.update({changes:{from:ir(this.view.state.doc,M.range.start),to:Ut(this.view.state.doc,M.range.end),insert:M.newText}}))}"command"in S&&S.command&&K0("Executing command:",S.command)}}});return{from:ir(this.view.state.doc,s.start),to:ir(this.view.state.doc,s.end),severity:n[h??ha.DiagnosticSeverity.Error],message:c,renderMessage:()=>{let S=document.createElement("div");return S.innerHTML=this.markdownRenderer(c),S},source:g||this.languageId,markClass:this.pluginId,actions:b}}),o=await Promise.all(a);this.addDiagnostics(o)}addDiagnostics(e){if(e.length===0)return;let n=this.view.state,a=[];U5(n,c=>(a.push(c),!0));let o=new Set(e.map(c=>c.source).filter(Boolean)),s=e.filter(c=>!o.has(c.source));this.view.dispatch(U2(n,[...s,...e]))}clearDiagnostics(){this.view.dispatch(U2(this.view.state,[]))}async requestCodeActions(e,n){var a;return!this.featureOptions.codeActionsEnabled||!(this.client.ready&&((a=this.client.capabilities)!=null&&a.codeActionProvider))?null:await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:e,context:{diagnostics:[{range:e,code:n[0],source:this.languageId,message:""}]}})}async requestRename(e,{line:n,character:a}){var o;if(this.featureOptions.renameEnabled){if(!this.client.ready){Ln(e,"Language server not ready");return}if(!((o=this.client.capabilities)!=null&&o.renameProvider)){Ln(e,"Rename not supported by language server");return}try{let s=await this.client.textDocumentPrepareRename({textDocument:{uri:this.documentUri},position:{line:n,character:a}}).catch(()=>this.prepareRenameFallback(e,{line:n,character:a}));if(!s||"defaultBehavior"in s){Ln(e,"Cannot rename this symbol");return}let c=document.createElement("div");c.className="cm-rename-popup",c.style.cssText="position: absolute; padding: 4px; background: white; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 99;";let h=document.createElement("input");h.type="text",h.style.cssText="width: 200px; padding: 4px; border: 1px solid #ddd;";let p="range"in s?s.range:s,g=Ut(e.state.doc,p.start);if(g==null)return;let b=Ut(e.state.doc,p.end);h.value=e.state.doc.sliceString(g,b),c.appendChild(h);let _=e.coordsAtPos(g);if(!_)return;c.style.left=`${_.left}px`,c.style.top=`${_.bottom+5}px`;let S=async()=>{let E=h.value.trim();if(!E){Ln(e,"New name cannot be empty"),c.remove();return}if(E===h.defaultValue){c.remove();return}try{let O=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:n,character:a},newName:E});await this.applyRenameEdit(e,O)}catch(O){Ln(e,`Rename failed: ${O instanceof Error?O.message:"Unknown error"}`)}finally{c.remove()}};h.addEventListener("keydown",E=>{E.key==="Enter"?S():E.key==="Escape"&&c.remove(),E.stopPropagation()});let C=E=>{c.contains(E.target)||(c.remove(),document.removeEventListener("mousedown",C))};document.addEventListener("mousedown",C),document.body.appendChild(c),h.focus(),h.select()}catch(s){Ln(e,`Rename failed: ${s instanceof Error?s.message:"Unknown error"}`)}}}async requestSignatureHelp(e,{line:n,character:a},o=void 0){var s,c,h;if(!(this.featureOptions.signatureHelpEnabled&&this.client.ready&&((s=this.client.capabilities)!=null&&s.signatureHelpProvider)))return null;try{let p=await this.client.textDocumentSignatureHelp({textDocument:{uri:this.documentUri},position:{line:n,character:a},context:{isRetrigger:!1,triggerKind:1,triggerCharacter:o}});if(!(p!=null&&p.signatures)||p.signatures.length===0)return null;let g=this.createTooltipContainer(),b=p.activeSignature??0,_=p.signatures[b]||p.signatures[0];if(!_)return null;let S=p.activeParameter??_.activeParameter??0,C=this.createSignatureElement(_,S);g.appendChild(C),_.documentation&&g.appendChild(this.createDocumentationElement(_.documentation));let E=(c=_.parameters)==null?void 0:c[S];E!=null&&E.documentation&&g.appendChild(this.createParameterDocElement(E.documentation));let O=Ut(e.state.doc,{line:n,character:a});return O==null?null:{pos:O,end:O,create:M=>({dom:g}),above:((h=this.featureOptions.signatureHelpOptions)==null?void 0:h.position)==="above"}}catch(p){return console.error("Signature help error:",p),null}}async showSignatureHelpTooltip(e,n,a){let o=await this.requestSignatureHelp(e,pa(e.state.doc,n),a);e.dispatch({effects:Tl.of(o)})}createTooltipContainer(){let e=document.createElement("div");return e.classList.add("cm-signature-help"),e.style.cssText="padding: 6px; max-width: 400px;",e}createSignatureElement(e,n){let a=document.createElement("div");if(a.classList.add("cm-signature"),a.style.cssText="font-family: monospace; margin-bottom: 4px;",!e.label||typeof e.label!="string")return a.textContent="Signature information unavailable",a;let o=e.label,s=e.parameters||[];if(s.length===0||!s[n])return a.textContent=o,a;let c=s[n].label;return typeof c=="string"?this.allowHTMLContent?a.innerHTML=o.replace(c,`<strong class="cm-signature-active-param">${c}</strong>`):a.textContent=o.replace(c,`\xAB${c}\xBB`):Array.isArray(c)&&c.length===2?this.applyRangeHighlighting(a,o,c[0],c[1]):a.textContent=o,a}applyRangeHighlighting(e,n,a,o){e.textContent="";let s=n.substring(0,a),c=n.substring(a,o),h=n.substring(o);e.appendChild(document.createTextNode(s));let p=document.createElement("span");p.classList.add("cm-signature-active-param"),p.style.cssText="font-weight: bold; text-decoration: underline;",p.textContent=c,e.appendChild(p),e.appendChild(document.createTextNode(h))}createDocumentationElement(e){let n=document.createElement("div");n.classList.add("cm-signature-docs"),n.style.cssText="margin-top: 4px; color: #666;";let a=or(e,this.markdownRenderer);return this.allowHTMLContent?n.innerHTML=a:n.textContent=a,n}createParameterDocElement(e){let n=document.createElement("div");n.classList.add("cm-parameter-docs"),n.style.cssText="margin-top: 4px; font-style: italic; border-top: 1px solid #eee; padding-top: 4px;";let a=or(e,this.markdownRenderer);return this.allowHTMLContent?n.innerHTML=a:n.textContent=a,n}prepareRenameFallback(e,{line:n,character:a}){let o=e.state.doc.line(n+1).text,s=/\w+/g,c,h=a,p=a;for(;(c=s.exec(o))!==null;){let g=c.index,b=c.index+c[0].length;if(a>=g&&a<=b){h=g,p=b;break}}return h===a&&p===a?null:{range:{start:{line:n,character:h},end:{line:n,character:p}},placeholder:o.slice(h,p)}}async applyRenameEdit(e,n){if(!n)return Ln(e,"No edit returned from language server"),!1;let a=n.changes??{},o=n.documentChanges??[];if(Object.keys(a).length===0&&o.length===0)return Ln(e,"No changes to apply"),!1;if(o.length>0)for(let s of o){if("textDocument"in s){if(s.textDocument.uri!==this.documentUri){Ln(e,"Multi-file rename not supported yet");continue}let c=s.edits.sort((h,p)=>{let g=Ut(e.state.doc,h.range.start);return(Ut(e.state.doc,p.range.start)??0)-(g??0)}).map(h=>({from:Ut(e.state.doc,h.range.start)??0,to:Ut(e.state.doc,h.range.end)??0,insert:h.newText}));return e.dispatch(e.state.update({changes:c})),!0}return Ln(e,"File creation, deletion, or renaming operations not supported yet"),!1}else if(Object.keys(a).length>0)for(let[s,c]of Object.entries(a)){if(s!==this.documentUri){Ln(e,"Multi-file rename not supported yet");continue}let h=c.sort((p,g)=>{let b=Ut(e.state.doc,p.range.start);return(Ut(e.state.doc,g.range.start)??0)-(b??0)}).map(p=>({from:Ut(e.state.doc,p.range.start)??0,to:Ut(e.state.doc,p.range.end)??0,insert:p.newText}));e.dispatch(e.state.update({changes:h}))}return!1}};$h=function(e){var h;let n=null,a={rename:"F2",goToDefinition:"F12",signatureHelp:"Mod-Shift-Space",...e.keyboardShortcuts},o=e.client,s={diagnosticsEnabled:!0,hoverEnabled:!0,completionEnabled:!0,definitionEnabled:!0,renameEnabled:!0,codeActionsEnabled:!0,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,signatureHelpOptions:{position:"below"},...e},c=[ts.define(p=>(n=new Kx({client:o,documentUri:e.documentUri??p.state.facet(W0),languageId:e.languageId??p.state.facet($x),view:p,featureOptions:s,sendIncrementalChanges:e.sendIncrementalChanges,allowHTMLContent:e.allowHTMLContent,useSnippetOnCompletion:e.useSnippetOnCompletion,onGoToDefinition:e.onGoToDefinition,markdownRenderer:e.markdownRenderer}),n))];if(c.push(Ka.of([{key:a.signatureHelp,run:p=>{if(!(n&&s.signatureHelpEnabled))return!1;let g=p.state.selection.main.head;return n.showSignatureHelpTooltip(p,g),!0}},{key:a.rename,run:p=>{if(!(n&&s.renameEnabled))return!1;let g=p.state.selection.main.head;return n.requestRename(p,pa(p.state.doc,g)),!0}},{key:a.goToDefinition,run:p=>{if(!(n&&s.definitionEnabled))return!1;let g=p.state.selection.main.head;return n.requestDefinition(p,pa(p.state.doc,g)).catch(b=>Ln(p,`Go to definition failed: ${b instanceof Error?b.message:"Unknown error"}`)),!0}}])),s.hoverEnabled&&c.push(wh((p,g)=>n==null?null:n.requestHoverTooltip(p,pa(p.state.doc,g)),e.hoverConfig)),s.signatureHelpEnabled){c.push(Ll);let p=g=>g.state.field(Ll)?(g.dispatch({effects:Tl.of(null)}),!0):!1;c.push(Et.domEventHandlers({mousedown:(g,b)=>(p(b),!1)})),c.push(Ka.of([{key:")",run:g=>(p(g),!1)},{key:"Escape",run:g=>p(g)}])),c.push(Et.updateListener.of(g=>{if(!(n&&s.signatureActivateOnTyping)||!g.state.field(Ll)||!(g.selectionSet||g.docChanged))return;let b=g.state.selection.main.head;Xx(g.state.doc,b)||p(g.view)})),c.push(Et.updateListener.of(async g=>{var E;if(!(n&&g.docChanged)||g.transactions.some(O=>O.annotation(Od))||!((E=n.client.capabilities)!=null&&E.signatureHelpProvider)||!s.signatureActivateOnTyping)return;let b=n.client.capabilities.signatureHelpProvider.triggerCharacters||["(",","],_=g.changes,S=-1,C;_.iterChanges((O,M,V,H,$)=>{if(S>=0)return;let N=Gx($.toString(),V,b);N&&(S=N.triggerPos,C=N.triggerCharacter)}),S>=0&&n.showSignatureHelpTooltip(g.view,S,C)}))}return s.completionEnabled&&c.push(Lu({...e.completionConfig,override:[async p=>{var S,C;if(n==null)return null;let{state:g,pos:b}=p,_=Qx(p,((C=(S=n.client.capabilities)==null?void 0:S.completionProvider)==null?void 0:C.triggerCharacters)??[],e.completionMatchBefore);return _==null?null:await n.requestCompletion(p,pa(g.doc,b),_)},...((h=e.completionConfig)==null?void 0:h.override)||[]]})),c.push(Et.domEventHandlers({click:(p,g)=>{if(s.definitionEnabled&&a.goToDefinition==="ctrlcmd"&&(p.ctrlKey||p.metaKey)){let b=g.posAtCoords({x:p.clientX,y:p.clientY});b&&n&&(n.requestDefinition(g,pa(g.state.doc,b)).catch(_=>Ln(g,`Go to definition failed: ${_ instanceof Error?_.message:"Unknown error"}`)),p.preventDefault())}}})),c};function Qx(e,n,a){let{state:o,pos:s,explicit:c}=e,h=o.doc.lineAt(s),p=ha.CompletionTriggerKind.Invoked,g,b=h.text[s-h.from-1]||"",_=n==null?void 0:n.includes(b);return!c&&_&&(p=ha.CompletionTriggerKind.TriggerCharacter,g=b),p===ha.CompletionTriggerKind.Invoked&&!e.matchBefore(a||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:p,triggerCharacter:g}}function Gx(e,n,a){if(!e)return null;for(let o of a){let s=e.indexOf(o);if(s!==-1)return{triggerPos:n+s+1,triggerCharacter:o}}return null}function Jx(e){let n=0;for(let a of e)a==="("?n++:a===")"&&n--;return n}function Xx(e,n,a=Ux){let o=e.lineAt(n),s=Math.max(1,o.number-a),c=e.line(s).from;return Jx(e.sliceString(c,n))>0}Hu=function(e,n,a={}){let{preserveCursor:o=!0,effects:s,userEvent:c}=a,h=e.state.doc;if(h.toString()!==n)if(o&&e.hasFocus){let p=e.state.selection.main.head,g=h.lineAt(p),b=g.number,_=p-g.from,S=e.state.update({changes:{from:0,to:h.length,insert:n}}).state.doc,C;if(b<=S.lines){let E=S.line(b),O=E.length;C=E.from+Math.min(_,O)}else C=S.line(S.lines).to;e.dispatch({changes:{from:0,to:h.length,insert:n},annotations:Od.of(!0),selection:{anchor:C},effects:s,userEvent:c})}else e.dispatch({changes:{from:0,to:h.length,insert:n},effects:s,userEvent:c})},Vi=function(){return ml.define({combine:e=>e.find(n=>n!==void 0)})};const Q0=Vi(),G0=Vi(),Ad=Vi(),Dl=Vi(),J0=Vi();Q_=function({cellId:e,completionConfig:n,hotkeys:a,placeholderType:o,lspConfig:s,diagnosticsConfig:c}){return[Dl.of(e),Q0.of(n),G0.of(a),Ad.of(o),J0.of({...s,diagnostics:c})]},Fu=new Tu;function Yx(e){return Object.values(e.cellRuntime).some(n=>n.status==="running")}function Zx(e){return Object.values(e.cellRuntime).filter(n=>n.status==="running"||n.status==="queued").length}function ek(e){return qu(e).length>0}yw=function(e){return e.cellIds.inOrderIds.map(n=>e.cellData[n])};function tk({cellHandles:e}){let n={};for(let[a,o]of Ar.entries(e))o.current&&(n[a]=o.current.editorView);return n}Qh=function(e){let{cellIds:n,cellData:a}=e,o=[];for(let s of n.inOrderIds)a[s].config.disabled&&o.push(s);return o};function X0(e){let{cellIds:n,cellData:a}=e,o=[];for(let s of n.inOrderIds)a[s].config.disabled||o.push(s);return o}function nk(e){return e.history.length>0}Tw=function(e,n){let a=e.cellIds.findWithId(n).getDescendants(n);return{stale:a.some(o=>{var s,c;return((s=e.cellRuntime[o])==null?void 0:s.staleInputs)||((c=e.cellData[o])==null?void 0:c.edited)}),errored:a.some(o=>{var s;return(s=e.cellRuntime[o])==null?void 0:s.errored}),runningOrQueued:a.some(o=>{var s,c;return((s=e.cellRuntime[o])==null?void 0:s.status)==="running"||((c=e.cellRuntime[o])==null?void 0:c.status)==="queued"})}},qu=function(e){let{cellIds:n,cellData:a,cellRuntime:o}=e;return n.inOrderIds.filter(s=>Vh({executionTime:o[s].runElapsedTimeMs??a[s].lastExecutionTime,status:o[s].status,errored:o[s].errored,interrupted:o[s].interrupted,stopped:o[s].stopped})||a[s].edited||o[s].interrupted||o[s].staleInputs&&!(o[s].status==="disabled-transitively"||a[s].config.disabled))},Vh=function({executionTime:e,status:n,errored:a,interrupted:o,stopped:s}){return e===null&&n!=="queued"&&n!=="running"&&!(a||o||s)},ct=ml.define({combine:e=>e[0]}),sa=ml.define({combine:e=>e[0]});var rk={...Sh,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"};const Y0=Ch.define(rk),Z0=Ch.define({charSetCasts:!0,doubleQuotedStrings:!1,unquotedBitLiterals:!0,hashComments:!1,spaceAfterDashes:!1,specialVar:"@?",identifierQuotes:'"',caseInsensitiveIdentifiers:!0,keywords:"percentile_cont row_number rank dense_rank rank_dense percent_rank cume_dist ntile lag lead first_value last_value nth_value !__postfix !~~ !~~* % & && * ** + - ->> / // <-> << <=> <@ >> @ @> Calendar JSON TimeZone ^ ^@ abort abs absolute access access_mode acos acosh action add add_parquet_key admin after age aggregate alias all all_profiling_output allow_community_extensions allow_extensions_metadata_mismatch allow_persistent_secrets allow_unredacted_secrets allow_unsigned_extensions allowed_directories allowed_paths also alter always analyse analyze and anti any any_value apply approx_count_distinct approx_quantile approx_top_k arbitrary arg_max arg_max_null arg_min arg_min_null argmax argmin array array_agg array_aggr array_aggregate array_append array_apply array_cat array_concat array_contains array_cosine_distance array_cosine_similarity array_cross_product array_distance array_distinct array_dot_product array_extract array_filter array_grade_up array_has array_has_all array_has_any array_indexof array_inner_product array_intersect array_length array_negative_dot_product array_negative_inner_product array_pop_back array_pop_front array_position array_prepend array_push_back array_push_front array_reduce array_resize array_reverse array_reverse_sort array_select array_slice array_sort array_to_json array_to_string array_to_string_comma_default array_transform array_unique array_value array_where array_zip arrow_large_buffer_size arrow_lossless_conversion arrow_output_list_view arrow_output_version arrow_scan arrow_scan_dumb as asc ascii asin asinh asof asof_loop_join_threshold assertion assignment asymmetric at atan atan2 atanh attach attribute authorization autoinstall_extension_repository autoinstall_known_extensions autoload_known_extensions avg backward bar base64 before begin between bigint bin binary binary_as_string bit bit_and bit_count bit_length bit_or bit_position bit_xor bitstring bitstring_agg blob bool bool_and bool_or boolean both bpchar by bytea cache call called can_cast_implicitly cardinality cascade cascaded case cast cast_to_type catalog catalog_error_max_schemas cbrt ceil ceiling centuries century chain char char_length character character_length characteristics check checkpoint checkpoint_threshold chr class close cluster coalesce col_description collate collation collations column columns combine comment comments commit committed compression concat concat_ws concurrently configuration conflict connection constant_or_null constraint constraints contains content continue conversion copy copy_database corr cos cosh cost cot count count_if count_star countif covar_pop covar_samp create create_sort_key cross csv cube current current_catalog current_connection_id current_database current_date current_localtime current_localtimestamp current_query current_query_id current_role current_schema current_schemas current_setting current_transaction_id current_user currval cursor custom_extension_repository custom_profiling_settings custom_user_agent cycle damerau_levenshtein data database database_list database_size date date_add date_diff date_part date_sub date_trunc datediff datepart datesub datetime datetrunc day dayname dayofmonth dayofweek dayofyear days deallocate debug_asof_iejoin debug_checkpoint_abort debug_force_external debug_force_no_cross_product debug_skip_checkpoint_on_commit debug_verify_vector debug_window_mode dec decade decades decimal declare decode default default_block_size default_collation default_null_order default_order default_secret_storage defaults deferrable deferred definer degrees delete delimiter delimiters depends desc describe detach dictionary disable disable_checkpoint_on_shutdown disable_logging disable_object_cache disable_optimizer disable_parquet_prefetching disable_print_progress_bar disable_profile disable_profiling disable_progress_bar disable_timestamptz_casts disable_verification disable_verify_external disable_verify_fetch_row disable_verify_parallelism disable_verify_serializer disabled_compression_methods disabled_filesystems disabled_log_types disabled_optimizers discard distinct divide do document domain double drop duckdb_api duckdb_columns duckdb_constraints duckdb_databases duckdb_dependencies duckdb_extensions duckdb_external_file_cache duckdb_functions duckdb_indexes duckdb_keywords duckdb_log_contexts duckdb_logs duckdb_logs_parsed duckdb_memory duckdb_optimizers duckdb_prepared_statements duckdb_schemas duckdb_secret_types duckdb_secrets duckdb_sequences duckdb_settings duckdb_table_sample duckdb_tables duckdb_temporary_files duckdb_types duckdb_variables duckdb_views dynamic_or_filter_threshold each editdist3 element_at else enable enable_checkpoint_on_shutdown enable_external_access enable_external_file_cache enable_fsst_vectors enable_geoparquet_conversion enable_http_logging enable_http_metadata_cache enable_logging enable_macro_dependencies enable_object_cache enable_optimizer enable_print_progress_bar enable_profile enable_profiling enable_progress_bar enable_progress_bar_print enable_verification enable_view_dependencies enabled_log_types encode encoding encrypted end ends_with entropy enum enum_code enum_first enum_last enum_range enum_range_boundary epoch epoch_ms epoch_ns epoch_us equi_width_bins era error errors_as_json escape even event except exclude excluding exclusive execute exists exp explain explain_output export export_state extension extension_directory extension_versions extensions external external_threads extract factorial false family favg fdiv fetch file_search_path filter finalize first flatten float float4 float8 floor fmod following for force force_bitpacking_mode force_checkpoint force_compression foreign format formatReadableDecimalSize formatReadableSize format_bytes format_pg_type format_type forward freeze from from_base64 from_binary from_hex from_json from_json_strict fsum full function functions gamma gcd gen_random_uuid generate_series generate_subscripts generated geomean geometric_mean get_bit get_block_size get_current_time get_current_timestamp getvariable glob global grade_up grant granted greatest greatest_common_divisor group group_concat grouping grouping_id groups guid hamming handler having header hex histogram histogram_exact histogram_values hold home_directory hour hours http_logging_output http_proxy http_proxy_password http_proxy_username hugeint identity ieee_floating_point_ops if ignore ilike ilike_escape immediate immediate_transaction_mode immutable implicit import import_database in in_search_path include including increment index index_scan_max_count index_scan_percentage indexes inet_client_addr inet_client_port inet_server_addr inet_server_port inherit inherits initially inline inner inout input insensitive insert install instead instr int int1 int128 int16 int2 int32 int4 int64 int8 integer integer_division integral intersect interval into invoker is is_histogram_other_bin isfinite isinf isnan isnull isodow isolation isoyear jaccard jaro_similarity jaro_winkler_similarity join json json_array json_array_length json_contains json_deserialize_sql json_each json_execute_serialized_sql json_exists json_extract json_extract_path json_extract_path_text json_extract_string json_group_array json_group_object json_group_structure json_keys json_merge_patch json_object json_pretty json_quote json_serialize_plan json_serialize_sql json_structure json_transform json_transform_strict json_tree json_type json_valid json_value julian kahan_sum key kurtosis kurtosis_pop label lambda lambda_syntax language large last last_day late_materialization_max_rows lateral lcase lcm leading leakproof least least_common_multiple left left_grapheme len length length_grapheme level levenshtein lgamma like like_escape limit list list_aggr list_aggregate list_any_value list_append list_apply list_approx_count_distinct list_avg list_bit_and list_bit_or list_bit_xor list_bool_and list_bool_or list_cat list_concat list_contains list_cosine_distance list_cosine_similarity list_count list_distance list_distinct list_dot_product list_element list_entropy list_extract list_filter list_first list_grade_up list_has list_has_all list_has_any list_histogram list_indexof list_inner_product list_intersect list_kurtosis list_kurtosis_pop list_last list_mad list_max list_median list_min list_mode list_negative_dot_product list_negative_inner_product list_pack list_position list_prepend list_product list_reduce list_resize list_reverse list_reverse_sort list_select list_sem list_skewness list_slice list_sort list_stddev_pop list_stddev_samp list_string_agg list_sum list_transform list_unique list_value list_var_pop list_var_samp list_where list_zip listagg listen ln load local location lock lock_configuration locked log log10 log2 log_query_path logged logging_level logging_mode logging_storage logical long lower lpad ltrim macro mad make_date make_time make_timestamp make_timestamp_ns make_timestamptz map map_concat map_contains map_contains_entry map_contains_value map_entries map_extract map_extract_value map_from_entries map_keys map_to_pg_oid map_values mapping match materialized max max_by max_expression_depth max_memory max_temp_directory_size max_vacuum_tasks maxvalue md5 md5_number md5_number_lower md5_number_upper mean median memory_limit merge_join_threshold metadata_info method microsecond microseconds millennia millennium millisecond milliseconds min min_by minute minutes minvalue mismatches mod mode month monthname months move multiply name names nanosecond national natural nchar nested_loop_join_threshold new next nextafter nextval nfc_normalize no none normalized_interval not not_ilike_escape not_like_escape nothing notify notnull now nowait null null_order nullif nulls numeric nvarchar obj_description object octet_length of off offset oid oids old old_implicit_casting on only operator option options or ord order order_by_non_integer_literal ordered_aggregate_threshold ordinality others out outer over overlaps overlay overriding owned owner pandas_analyze_sample pandas_scan parallel parquet_bloom_probe parquet_file_metadata parquet_kv_metadata parquet_metadata parquet_metadata_cache parquet_scan parquet_schema parse_dirname parse_dirpath parse_duckdb_log_message parse_filename parse_path parser partial partition partitioned partitioned_write_flush_threshold partitioned_write_max_open_files passing password percent perfect_ht_threshold persistent pi pivot pivot_filter_threshold pivot_limit pivot_longer pivot_wider placing plans platform policy position positional pow power pragma pragma_collations pragma_database_size pragma_metadata_info pragma_platform pragma_show pragma_storage_info pragma_table_info pragma_user_agent pragma_version preceding precision prefer_range_joins prefetch_all_parquet_files prefix prepare prepared preserve preserve_identifier_case preserve_insertion_order primary printf prior privileges procedural procedure produce_arrow_string_view product profile_output profiling_mode profiling_output program progress_bar_time publication python_enable_replacements python_map_function python_scan_all_frames qualify quantile quantile_cont quantile_disc quarter quarters query query_table quote radians random range read read_blob read_csv read_csv_auto read_json read_json_auto read_json_objects read_json_objects_auto read_ndjson read_ndjson_auto read_ndjson_objects read_parquet read_text real reassign recheck recursive reduce ref references referencing refresh regexp_escape regexp_extract regexp_extract_all regexp_full_match regexp_matches regexp_replace regexp_split_to_array regexp_split_to_table regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release remap_struct rename repeat repeat_row repeatable replace replica reservoir_quantile reset respect restart restrict returning returns reverse revoke right right_grapheme role rollback rollup round round_even roundbankers row row_to_json rows rpad rtrim rule sample savepoint scalar_subquery_error_on_multiple_rows scheduler_process_partial schema schemas scope scroll search search_path second seconds secret secret_directory security select sem semi seq_scan sequence sequences serializable server session session_user set set_bit setof sets setseed sha1 sha256 share shobj_description short show show_databases show_tables show_tables_expanded sign signbit signed similar simple sin sinh skewness skip smallint snapshot sniff_csv some sorted split split_part sql sqrt stable standalone start starts_with statement statistics stats stddev stddev_pop stddev_samp stdin stdout storage storage_compatibility_version storage_info stored str_split str_split_regex streaming_buffer_size strftime strict string string_agg string_split string_split_regex string_to_array strip strip_accents strlen strpos strptime struct struct_concat struct_extract struct_extract_at struct_insert struct_pack subscription substr substring substring_grapheme subtract suffix sum sum_no_overflow sumkahan summarize summary symmetric sysid system table table_info tables tablesample tablespace tan tanh temp temp_directory template temporary test_all_types test_vector_types text then threads ties time time_bucket timestamp timestamp_ms timestamp_ns timestamp_s timestamp_us timestamptz timetz timetz_byte_comparable timezone timezone_hour timezone_minute tinyint to to_base to_base64 to_binary to_centuries to_days to_decades to_hex to_hours to_json to_microseconds to_millennia to_milliseconds to_minutes to_months to_quarters to_seconds to_timestamp to_weeks to_years today trailing transaction transaction_timestamp transform translate treat trigger trim true trunc truncate truncate_duckdb_logs trusted try_cast try_strptime txid_current type typeof types ubigint ucase uhugeint uint128 uint16 uint32 uint64 uint8 uinteger unbin unbounded uncommitted unencrypted unhex unicode union union_extract union_tag union_value unique unknown unlisten unlogged unnest unpack unpivot unpivot_list until update upper url_decode url_encode use user user_agent username using usmallint utinyint uuid uuid_extract_timestamp uuid_extract_version uuidv4 uuidv7 vacuum valid validate validator value values var_pop var_samp varbinary varchar variable variadic variance varint varying vector_type verbose verify_external verify_fetch_row verify_parallelism verify_serializer version view views virtual volatile wal_autocheckpoint wavg week weekday weekofyear weeks weighted_avg when where which_secret whitespace window with within without work worker_threads wrapper write write_log xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlnamespaces xmlparse xmlpi xmlroot xmlserialize xmltable xor year years yearweek yes zone zstd_min_string_length | || ~ ~~ ~~* ~~~",types:"JSON bigint binary bit bitstring blob bool boolean bpchar bytea char date datetime dec decimal double enum float float4 float8 guid hugeint int int1 int128 int16 int2 int32 int4 int64 int8 integer integral interval list logical long map null numeric nvarchar oid real row short signed smallint string struct text time timestamp timestamp_ms timestamp_ns timestamp_s timestamp_us timestamptz timetz tinyint ubigint uhugeint uint128 uint16 uint32 uint64 uint8 uinteger union usmallint utinyint uuid varbinary varchar varint"});var ak=new Set("postgresql.postgres.couchbase.db2.db2i.tidb.mysql.sqlite.mssql.sqlserver.duckdb.mariadb.cassandra.noql.spark.awsathena.athena.bigquery.hive.redshift.snowflake.flink.mongodb.trino.oracle.oracledb.singlestoredb.timescaledb.databricks.datafusion.microsoft sql server".split("."));function jl(e){return ak.has(e)}function eg(e){let n=e.dialect;if(!jl(n))return be.debug("Unknown dialect",{dialect:n}),ss;switch(n){case"postgresql":case"postgres":return Sh;case"mysql":return lT;case"sqlite":return oT;case"mssql":case"sqlserver":case"microsoft sql server":return uT;case"duckdb":return Z0;case"mariadb":return dT;case"cassandra":return fT;case"oracledb":case"oracle":return iT;case"bigquery":return Y0;case"timescaledb":return Sh;case"awsathena":case"athena":case"db2i":case"db2":case"hive":case"redshift":case"snowflake":case"flink":case"mongodb":case"noql":case"couchbase":case"trino":case"tidb":case"singlestoredb":case"spark":case"databricks":case"datafusion":return be.debug("Unsupported dialect",{dialect:n}),ss;default:return Xo(n),ss}}var ik={...cT,caseInsensitiveIdentifiers:!0,identifierQuotes:"'"};let ss;ss=Ch.define(ik),ca="__marimo_duckdb",Fi=new Set([ca]),Sw="memory",_l=function(e){return e===""};var ls={formatTableName:e=>e,formatSelectClause:(e,n)=>`SELECT ${e} FROM ${n} LIMIT 100`};function ok(e){if(e=e.toLowerCase(),!jl(e))return ls;switch(e){case"bigquery":{let n=Y0.spec.identifierQuotes;return{formatTableName:a=>`${n}${a}${n}`,formatSelectClause:ls.formatSelectClause}}case"mssql":case"sqlserver":case"microsoft sql server":return{formatTableName:ls.formatTableName,formatSelectClause:(n,a)=>`SELECT TOP 100 ${n} FROM ${a}`};case"timescaledb":case"postgres":case"postgresql":case"duckdb":return{formatTableName:n=>n.split(".").map(a=>`"${a}"`).join("."),formatSelectClause:(n,a)=>`SELECT ${n==="*"?"*":`"${n}"`} FROM ${a} LIMIT 100`};case"db2":case"db2i":case"mysql":case"sqlite":case"mariadb":case"cassandra":case"noql":case"awsathena":case"athena":case"hive":case"redshift":case"snowflake":case"flink":case"mongodb":case"oracle":case"oracledb":case"couchbase":case"tidb":case"spark":case"trino":case"singlestoredb":case"databricks":case"datafusion":return ls;default:return Xo(e),ls}}fw=function({table:e,columnName:n,sqlTableContext:a}){if(a){let{engine:o,schema:s,defaultSchema:c,defaultDatabase:h,database:p,dialect:g}=a,b=e.name;_l(s)?b=p===h?b:`${p}.${b}`:(s!==c&&(b=`${s}.${b}`),p!==h&&(b=`${p}.${b}`));let _=ok(g),S=_.formatTableName(b),C=_.formatSelectClause(n,S);return o==="__marimo_duckdb"?`_df = mo.sql(f"""
29
+ `,a.textContent=n;let o=e.coordsAtPos(e.state.selection.main.head);o&&(a.style.left=`${o.left}px`,a.style.top=`${o.bottom+5}px`),document.body.appendChild(a),setTimeout(()=>{a.style.opacity="0",a.style.transition="opacity 0.2s",setTimeout(()=>a.remove(),200)},3e3)}function Nl(e){if(e==null)return!0;if(Array.isArray(e))return e.length===0||e.every(Nl);if(typeof e=="string")return V0(e);let n=e.value;return typeof n=="string"?V0(n):!1}function V0(e){return e==null?!0:typeof e=="string"?e.trim()===""||/^[\s\n`]*$/.test(e):!1}function Dx(e,n){let a=[];return n.iterChanges((o,s,c,h,p)=>{let g=p.toString();if(o===0&&s===e.length){a.push({text:g});return}let b=pa(e,o),_=pa(e,s);a.push({range:{start:b,end:_},text:g})}),a.sort((o,s)=>{if(!o.range)return 1;if(!s.range)return-1;let c=o.range.start.line??-1,h=s.range.start.line??-1;if(c!==h)return h-c;let p=o.range.start.character??-1;return(s.range.start.character??-1)-p}),a}var jx=X2(),zx=Object.fromEntries(Object.entries(jx.CompletionItemKind).map(([e,n])=>[n,e])),H0;(function(e){e.PlainText=1,e.Snippet=2})(H0||(H0={}));function qx(e){return e.replaceAll(/\\\\/g,"").replaceAll(/(\$(\d+))/g,(n,a,o)=>"${"+o+"}")}function Bx(e,n){let{detail:a,labelDetails:o,label:s,kind:c,textEdit:h,insertText:p,documentation:g,additionalTextEdits:b,insertTextFormat:_}=e,S={label:s,detail:(o==null?void 0:o.detail)||a,apply(C,E,O,M){if(h&&Px(h)?C.dispatch(G2(C.state,h.newText,ir(C.state.doc,h.range.start),ir(C.state.doc,h.range.end))):p&&_===H0.Snippet&&n.useSnippetOnCompletion?rT(qx(p))(C,null,O,M):C.dispatch(G2(C.state,p||s,O,M)),!b)return;let V=b.sort(({range:{end:H}},{range:{end:$}})=>ir(C.state.doc,H)<ir(C.state.doc,$)?1:ir(C.state.doc,H)>ir(C.state.doc,$)?-1:0);for(let H of V)C.dispatch(C.state.update({changes:{from:ir(C.state.doc,H.range.start),to:Ut(C.state.doc,H.range.end),insert:H.newText}}))},type:c&&zx[c].toLowerCase()};return n.hasResolveProvider&&n.resolveItem?S.info=async()=>{var C;try{let E=await((C=n.resolveItem)==null?void 0:C.call(n,e)),O=document.createElement("div");O.classList.add("documentation");let M=(E==null?void 0:E.documentation)||g;return!M||Nl(M)?null:(n.allowHTMLContent?O.innerHTML=or(M,n.markdownRenderer):O.textContent=or(M,n.markdownRenderer),O)}catch(E){if(console.error("Failed to resolve completion item:",E),Nl(g))return null;if(g){let O=document.createElement("div");return O.classList.add("documentation"),n.allowHTMLContent?O.innerHTML=or(g,n.markdownRenderer):O.textContent=or(g,n.markdownRenderer),O}return null}}:g&&(S.info=()=>{let C=document.createElement("div");return C.classList.add("documentation"),n.allowHTMLContent?C.innerHTML=or(g,n.markdownRenderer):C.textContent=or(g,n.markdownRenderer),C}),S}function Fx(e,n,a){let o=[n?Vx(n):Hx,a==="python"?$x:void 0].filter(Boolean),s=e;if(n){let c=n.toLowerCase();/^\w+$/.test(c)&&(s=s.filter(({label:h,filterText:p})=>(p??h).toLowerCase().startsWith(c)))}for(let c of o)s.sort(c);return s}function Vx(e){return(n,a)=>{let o=n.sortText??n.label,s=a.sortText??a.label;switch(!0){case(o.startsWith(e)&&!s.startsWith(e)):return-1;case(!o.startsWith(e)&&s.startsWith(e)):return 1}return o.localeCompare(s)}}function Hx(e,n){let a=e.sortText??e.label,o=n.sortText??n.label;return a.localeCompare(o)}function $x(e,n){let a=e.label.endsWith("="),o=n.label.endsWith("=");return a&&!o?-1:!a&&o?1:0}function $0(e){let n=new Proxy({},{get(){throw Error(e)}});return function(a){return a.at(-1)??n}}const W0=ml.define({combine:$0("No document URI provided. Either pass a one into the extension or use documentUri.of().")}),Wx=ml.define({combine:$0("No language ID provided. Either pass a one into the extension or use languageId.of().")});let Ld,U0;Ld=Sl(),U0=1e4,ns=class{constructor({rootUri:e,workspaceFolders:n,transport:a,initializationOptions:o,capabilities:s,timeout:c=U0,getWorkspaceConfiguration:h}){ve(this,"ready");ve(this,"capabilities");ve(this,"initializePromise");ve(this,"rootUri");ve(this,"workspaceFolders");ve(this,"timeout");ve(this,"transport");ve(this,"requestManager");ve(this,"client");ve(this,"initializationOptions");ve(this,"clientCapabilities");ve(this,"notificationListeners",new Set);this.rootUri=e,this.workspaceFolders=n,this.transport=a,this.initializationOptions=o,this.clientCapabilities=s,this.timeout=c,this.ready=!1,this.capabilities=null,this.requestManager=new Ld.RequestManager([this.transport]),this.client=new Ld.Client(this.requestManager),this.client.onNotification(g=>{this.processNotification(g)});let p=this.transport;p!=null&&p.connection&&p.connection.addEventListener("message",g=>{let b=JSON.parse(g.data);b.method==="workspace/configuration"&&h?p.connection.send(JSON.stringify({jsonrpc:"2.0",id:b.id,result:h(b.params)})):b.method&&b.id&&p.connection.send(JSON.stringify({jsonrpc:"2.0",id:b.id,result:null}))}),this.initializePromise=this.initialize()}getInitializationOptions(){let e={textDocument:{hover:{dynamicRegistration:!0,contentFormat:["markdown","plaintext"]},moniker:{},synchronization:{dynamicRegistration:!0,willSave:!1,didSave:!1,willSaveWaitUntil:!1},codeAction:{dynamicRegistration:!0,codeActionLiteralSupport:{codeActionKind:{valueSet:["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},resolveSupport:{properties:["edit"]}},completion:{dynamicRegistration:!0,completionItem:{snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:["markdown","plaintext"],deprecatedSupport:!1,preselectSupport:!1},contextSupport:!1},signatureHelp:{dynamicRegistration:!0,signatureInformation:{documentationFormat:["markdown","plaintext"]}},declaration:{dynamicRegistration:!0,linkSupport:!0},definition:{dynamicRegistration:!0,linkSupport:!0},typeDefinition:{dynamicRegistration:!0,linkSupport:!0},implementation:{dynamicRegistration:!0,linkSupport:!0},rename:{dynamicRegistration:!0,prepareSupport:!0}},workspace:{didChangeConfiguration:{dynamicRegistration:!0}}};return{capabilities:this.clientCapabilities?typeof this.clientCapabilities=="function"?this.clientCapabilities(e):this.clientCapabilities:e,initializationOptions:this.initializationOptions,processId:null,rootUri:this.rootUri,workspaceFolders:this.workspaceFolders}}async initialize(){let{capabilities:e}=await this.request("initialize",this.getInitializationOptions(),this.timeout*3);this.capabilities=e,this.notify("initialized",{}),this.ready=!0}close(){this.client.close()}textDocumentDidOpen(e){return this.notify("textDocument/didOpen",e)}textDocumentDidChange(e){return this.notify("textDocument/didChange",e)}async textDocumentHover(e){return await this.request("textDocument/hover",e,this.timeout)}async textDocumentCompletion(e){return await this.request("textDocument/completion",e,this.timeout)}async completionItemResolve(e){return await this.request("completionItem/resolve",e,this.timeout)}async textDocumentDefinition(e){return await this.request("textDocument/definition",e,this.timeout)}async textDocumentCodeAction(e){return await this.request("textDocument/codeAction",e,this.timeout)}async textDocumentRename(e){return await this.request("textDocument/rename",e,this.timeout)}async textDocumentPrepareRename(e){return await this.request("textDocument/prepareRename",e,this.timeout)}async textDocumentSignatureHelp(e){return await this.request("textDocument/signatureHelp",e,this.timeout)}onNotification(e){return this.notificationListeners.add(e),()=>this.notificationListeners.delete(e)}request(e,n,a){return this.client.request({method:e,params:n},a)}notify(e,n){return this.client.notify({method:e,params:n})}processNotification(e){this.notificationListeners.forEach(n=>n(e))}},Sl();var ha=X2(),K0=console.log;function Ux(){return String(Date.now()+Math.random())}let Od;Tl=aa.define(),Ll=Zo.define({create:()=>null,update(e,n){for(let a of n.effects)if(a.is(Tl))return a.value;if(e&&n.docChanged){let a=n.changes.mapPos(e.pos),o=e.end==null?void 0:n.changes.mapPos(e.end);return{...e,pos:a,end:o}}return e},provide:e=>A5.from(e)}),Od=x5.define();var Kx=20,Qx=class{constructor(e){ve(this,"documentVersion");ve(this,"pluginId");ve(this,"client");ve(this,"documentUri");ve(this,"languageId");ve(this,"view");ve(this,"allowHTMLContent");ve(this,"useSnippetOnCompletion");ve(this,"sendIncrementalChanges");ve(this,"featureOptions");ve(this,"onGoToDefinition");ve(this,"markdownRenderer");ve(this,"disposeListener");ve(this,"lastSeenDiagnosticsVersion",0);let{client:n,documentUri:a,languageId:o,view:s,featureOptions:c,sendIncrementalChanges:h=!0,allowHTMLContent:p=!1,useSnippetOnCompletion:g=!1,onGoToDefinition:b,markdownRenderer:_=F0}=e;this.documentVersion=0,this.pluginId=Ux(),this.client=n,this.documentUri=a,this.languageId=o,this.view=s,this.allowHTMLContent=p,this.useSnippetOnCompletion=g,this.sendIncrementalChanges=h,this.featureOptions=c,this.onGoToDefinition=b,this.markdownRenderer=_,this.disposeListener=n.onNotification(this.processNotification.bind(this)),this.initialize({documentText:this.view.state.doc.toString()})}update({state:e,docChanged:n,startState:{doc:a},changes:o}){n&&(this.sendIncrementalChanges?this.sendChanges(Dx(a,o)):this.sendChanges([{text:e.doc.toString()}]))}destroy(){var e;(e=this.disposeListener)==null||e.call(this)}async initialize({documentText:e}){this.client.initializePromise&&await this.client.initializePromise,await this.client.textDocumentDidOpen({textDocument:{uri:this.documentUri,languageId:this.languageId,text:e,version:this.documentVersion}})}async sendChanges(e){if(this.client.ready)try{await this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:++this.documentVersion},contentChanges:e})}catch(n){console.error(n)}}requestDiagnostics(e){this.sendChanges([{text:e.state.doc.toString()}])}async requestHoverTooltip(e,{line:n,character:a}){var b;if(!this.featureOptions.hoverEnabled||!(this.client.ready&&((b=this.client.capabilities)!=null&&b.hoverProvider)))return null;let o=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:n,character:a}});if(!o)return null;let{contents:s,range:c}=o,h=Ut(e.state.doc,{line:n,character:a}),p;if(c&&(h=Ut(e.state.doc,c.start),p=Ut(e.state.doc,c.end)),h==null||Nl(s))return null;let g=document.createElement("div");return g.classList.add("documentation","cm-lsp-hover-tooltip"),this.allowHTMLContent?g.innerHTML=or(s,this.markdownRenderer):g.textContent=or(s,this.markdownRenderer),{pos:h,end:p,create:_=>({dom:g}),above:!0}}async requestCompletion(e,{line:n,character:a},{triggerKind:o,triggerCharacter:s}){var C;if(!this.featureOptions.completionEnabled||!(this.client.ready&&((C=this.client.capabilities)!=null&&C.completionProvider)))return null;let c=await this.client.textDocumentCompletion({textDocument:{uri:this.documentUri},position:{line:n,character:a},context:{triggerKind:o,triggerCharacter:s}});if(!c)return null;let h="items"in c?c.items:c,p=Mx(h),g=p?e.matchBefore(p)??e.matchBefore(/[a-zA-Z0-9_]+/):e.matchBefore(/[a-zA-Z0-9_]+/),{pos:b}=e,_=Fx(h,g==null?void 0:g.text,this.languageId);g&&(b=g.from);let S=_.map(E=>{var O,M;return Bx(E,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:((M=(O=this.client.capabilities)==null?void 0:O.completionProvider)==null?void 0:M.resolveProvider)??!1,resolveItem:this.client.completionItemResolve.bind(this.client)})});return{from:b,options:S,filter:!1}}async requestDefinition(e,{line:n,character:a}){var _;if(!this.featureOptions.definitionEnabled||!(this.client.ready&&((_=this.client.capabilities)!=null&&_.definitionProvider)))return;let o=await this.client.textDocumentDefinition({textDocument:{uri:this.documentUri},position:{line:n,character:a}});if(!o)return;let s=Array.isArray(o)?o:[o];if(s.length===0)return;let c=s[0];if(!c)return;let h="uri"in c?c.uri:c.targetUri,p="range"in c?c.range:c.targetRange,g=h!==this.documentUri,b={uri:h,range:p,isExternalDocument:g};return g||e.dispatch(e.state.update({selection:{anchor:ir(e.state.doc,p.start),head:Ut(e.state.doc,p.end)}})),this.onGoToDefinition&&this.onGoToDefinition(b),b}processNotification(e){try{e.method==="textDocument/publishDiagnostics"&&this.processDiagnostics(e.params)}catch(n){K0(n)}}async processDiagnostics(e){if(e.uri!==this.documentUri)return;if(e.version!=null&&e.version>this.lastSeenDiagnosticsVersion&&(this.lastSeenDiagnosticsVersion=e.version,this.clearDiagnostics()),!this.featureOptions.diagnosticsEnabled){this.clearDiagnostics();return}let n={[ha.DiagnosticSeverity.Error]:"error",[ha.DiagnosticSeverity.Warning]:"warning",[ha.DiagnosticSeverity.Information]:"info",[ha.DiagnosticSeverity.Hint]:"info"},a=e.diagnostics.map(async({range:s,message:c,severity:h,code:p,source:g})=>{var _;let b=(_=await this.requestCodeActions(s,[p]))==null?void 0:_.map(S=>{var C;return{name:"command"in S&&typeof S.command=="object"&&((C=S.command)==null?void 0:C.title)||S.title,apply:async()=>{var E;if("edit"in S&&((E=S.edit)!=null&&E.changes)){let O=S.edit.changes[this.documentUri];if(!O)return;for(let M of O)this.view.dispatch(this.view.state.update({changes:{from:ir(this.view.state.doc,M.range.start),to:Ut(this.view.state.doc,M.range.end),insert:M.newText}}))}"command"in S&&S.command&&K0("Executing command:",S.command)}}});return{from:ir(this.view.state.doc,s.start),to:ir(this.view.state.doc,s.end),severity:n[h??ha.DiagnosticSeverity.Error],message:c,renderMessage:()=>{let S=document.createElement("div");return S.innerHTML=this.markdownRenderer(c),S},source:g||this.languageId,markClass:this.pluginId,actions:b}}),o=await Promise.all(a);this.addDiagnostics(o)}addDiagnostics(e){if(e.length===0)return;let n=this.view.state,a=[];K5(n,c=>(a.push(c),!0));let o=new Set(e.map(c=>c.source).filter(Boolean)),s=e.filter(c=>!o.has(c.source));this.view.dispatch(U2(n,[...s,...e]))}clearDiagnostics(){this.view.dispatch(U2(this.view.state,[]))}async requestCodeActions(e,n){var a;return!this.featureOptions.codeActionsEnabled||!(this.client.ready&&((a=this.client.capabilities)!=null&&a.codeActionProvider))?null:await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:e,context:{diagnostics:[{range:e,code:n[0],source:this.languageId,message:""}]}})}async requestRename(e,{line:n,character:a}){var o;if(this.featureOptions.renameEnabled){if(!this.client.ready){Ln(e,"Language server not ready");return}if(!((o=this.client.capabilities)!=null&&o.renameProvider)){Ln(e,"Rename not supported by language server");return}try{let s=await this.client.textDocumentPrepareRename({textDocument:{uri:this.documentUri},position:{line:n,character:a}}).catch(()=>this.prepareRenameFallback(e,{line:n,character:a}));if(!s||"defaultBehavior"in s){Ln(e,"Cannot rename this symbol");return}let c=document.createElement("div");c.className="cm-rename-popup",c.style.cssText="position: absolute; padding: 4px; background: white; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 99;";let h=document.createElement("input");h.type="text",h.style.cssText="width: 200px; padding: 4px; border: 1px solid #ddd;";let p="range"in s?s.range:s,g=Ut(e.state.doc,p.start);if(g==null)return;let b=Ut(e.state.doc,p.end);h.value=e.state.doc.sliceString(g,b),c.appendChild(h);let _=e.coordsAtPos(g);if(!_)return;c.style.left=`${_.left}px`,c.style.top=`${_.bottom+5}px`;let S=async()=>{let E=h.value.trim();if(!E){Ln(e,"New name cannot be empty"),c.remove();return}if(E===h.defaultValue){c.remove();return}try{let O=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:n,character:a},newName:E});await this.applyRenameEdit(e,O)}catch(O){Ln(e,`Rename failed: ${O instanceof Error?O.message:"Unknown error"}`)}finally{c.remove()}};h.addEventListener("keydown",E=>{E.key==="Enter"?S():E.key==="Escape"&&c.remove(),E.stopPropagation()});let C=E=>{c.contains(E.target)||(c.remove(),document.removeEventListener("mousedown",C))};document.addEventListener("mousedown",C),document.body.appendChild(c),h.focus(),h.select()}catch(s){Ln(e,`Rename failed: ${s instanceof Error?s.message:"Unknown error"}`)}}}async requestSignatureHelp(e,{line:n,character:a},o=void 0){var s,c,h;if(!(this.featureOptions.signatureHelpEnabled&&this.client.ready&&((s=this.client.capabilities)!=null&&s.signatureHelpProvider)))return null;try{let p=await this.client.textDocumentSignatureHelp({textDocument:{uri:this.documentUri},position:{line:n,character:a},context:{isRetrigger:!1,triggerKind:1,triggerCharacter:o}});if(!(p!=null&&p.signatures)||p.signatures.length===0)return null;let g=this.createTooltipContainer(),b=p.activeSignature??0,_=p.signatures[b]||p.signatures[0];if(!_)return null;let S=p.activeParameter??_.activeParameter??0,C=this.createSignatureElement(_,S);g.appendChild(C),_.documentation&&g.appendChild(this.createDocumentationElement(_.documentation));let E=(c=_.parameters)==null?void 0:c[S];E!=null&&E.documentation&&g.appendChild(this.createParameterDocElement(E.documentation));let O=Ut(e.state.doc,{line:n,character:a});return O==null?null:{pos:O,end:O,create:M=>({dom:g}),above:((h=this.featureOptions.signatureHelpOptions)==null?void 0:h.position)==="above"}}catch(p){return console.error("Signature help error:",p),null}}async showSignatureHelpTooltip(e,n,a){let o=await this.requestSignatureHelp(e,pa(e.state.doc,n),a);e.dispatch({effects:Tl.of(o)})}createTooltipContainer(){let e=document.createElement("div");return e.classList.add("cm-signature-help"),e.style.cssText="padding: 6px; max-width: 400px;",e}createSignatureElement(e,n){let a=document.createElement("div");if(a.classList.add("cm-signature"),a.style.cssText="font-family: monospace; margin-bottom: 4px;",!e.label||typeof e.label!="string")return a.textContent="Signature information unavailable",a;let o=e.label,s=e.parameters||[];if(s.length===0||!s[n])return a.textContent=o,a;let c=s[n].label;return typeof c=="string"?this.allowHTMLContent?a.innerHTML=o.replace(c,`<strong class="cm-signature-active-param">${c}</strong>`):a.textContent=o.replace(c,`\xAB${c}\xBB`):Array.isArray(c)&&c.length===2?this.applyRangeHighlighting(a,o,c[0],c[1]):a.textContent=o,a}applyRangeHighlighting(e,n,a,o){e.textContent="";let s=n.substring(0,a),c=n.substring(a,o),h=n.substring(o);e.appendChild(document.createTextNode(s));let p=document.createElement("span");p.classList.add("cm-signature-active-param"),p.style.cssText="font-weight: bold; text-decoration: underline;",p.textContent=c,e.appendChild(p),e.appendChild(document.createTextNode(h))}createDocumentationElement(e){let n=document.createElement("div");n.classList.add("cm-signature-docs"),n.style.cssText="margin-top: 4px; color: #666;";let a=or(e,this.markdownRenderer);return this.allowHTMLContent?n.innerHTML=a:n.textContent=a,n}createParameterDocElement(e){let n=document.createElement("div");n.classList.add("cm-parameter-docs"),n.style.cssText="margin-top: 4px; font-style: italic; border-top: 1px solid #eee; padding-top: 4px;";let a=or(e,this.markdownRenderer);return this.allowHTMLContent?n.innerHTML=a:n.textContent=a,n}prepareRenameFallback(e,{line:n,character:a}){let o=e.state.doc.line(n+1).text,s=/\w+/g,c,h=a,p=a;for(;(c=s.exec(o))!==null;){let g=c.index,b=c.index+c[0].length;if(a>=g&&a<=b){h=g,p=b;break}}return h===a&&p===a?null:{range:{start:{line:n,character:h},end:{line:n,character:p}},placeholder:o.slice(h,p)}}async applyRenameEdit(e,n){if(!n)return Ln(e,"No edit returned from language server"),!1;let a=n.changes??{},o=n.documentChanges??[];if(Object.keys(a).length===0&&o.length===0)return Ln(e,"No changes to apply"),!1;if(o.length>0)for(let s of o){if("textDocument"in s){if(s.textDocument.uri!==this.documentUri){Ln(e,"Multi-file rename not supported yet");continue}let c=s.edits.sort((h,p)=>{let g=Ut(e.state.doc,h.range.start);return(Ut(e.state.doc,p.range.start)??0)-(g??0)}).map(h=>({from:Ut(e.state.doc,h.range.start)??0,to:Ut(e.state.doc,h.range.end)??0,insert:h.newText}));return e.dispatch(e.state.update({changes:c})),!0}return Ln(e,"File creation, deletion, or renaming operations not supported yet"),!1}else if(Object.keys(a).length>0)for(let[s,c]of Object.entries(a)){if(s!==this.documentUri){Ln(e,"Multi-file rename not supported yet");continue}let h=c.sort((p,g)=>{let b=Ut(e.state.doc,p.range.start);return(Ut(e.state.doc,g.range.start)??0)-(b??0)}).map(p=>({from:Ut(e.state.doc,p.range.start)??0,to:Ut(e.state.doc,p.range.end)??0,insert:p.newText}));e.dispatch(e.state.update({changes:h}))}return!1}};Wh=function(e){var h;let n=null,a={rename:"F2",goToDefinition:"F12",signatureHelp:"Mod-Shift-Space",...e.keyboardShortcuts},o=e.client,s={diagnosticsEnabled:!0,hoverEnabled:!0,completionEnabled:!0,definitionEnabled:!0,renameEnabled:!0,codeActionsEnabled:!0,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,signatureHelpOptions:{position:"below"},...e},c=[ts.define(p=>(n=new Qx({client:o,documentUri:e.documentUri??p.state.facet(W0),languageId:e.languageId??p.state.facet(Wx),view:p,featureOptions:s,sendIncrementalChanges:e.sendIncrementalChanges,allowHTMLContent:e.allowHTMLContent,useSnippetOnCompletion:e.useSnippetOnCompletion,onGoToDefinition:e.onGoToDefinition,markdownRenderer:e.markdownRenderer}),n))];if(c.push(Ka.of([{key:a.signatureHelp,run:p=>{if(!(n&&s.signatureHelpEnabled))return!1;let g=p.state.selection.main.head;return n.showSignatureHelpTooltip(p,g),!0}},{key:a.rename,run:p=>{if(!(n&&s.renameEnabled))return!1;let g=p.state.selection.main.head;return n.requestRename(p,pa(p.state.doc,g)),!0}},{key:a.goToDefinition,run:p=>{if(!(n&&s.definitionEnabled))return!1;let g=p.state.selection.main.head;return n.requestDefinition(p,pa(p.state.doc,g)).catch(b=>Ln(p,`Go to definition failed: ${b instanceof Error?b.message:"Unknown error"}`)),!0}}])),s.hoverEnabled&&c.push(wh((p,g)=>n==null?null:n.requestHoverTooltip(p,pa(p.state.doc,g)),e.hoverConfig)),s.signatureHelpEnabled){c.push(Ll);let p=g=>g.state.field(Ll)?(g.dispatch({effects:Tl.of(null)}),!0):!1;c.push(Et.domEventHandlers({mousedown:(g,b)=>(p(b),!1)})),c.push(Ka.of([{key:")",run:g=>(p(g),!1)},{key:"Escape",run:g=>p(g)}])),c.push(Et.updateListener.of(g=>{if(!(n&&s.signatureActivateOnTyping)||!g.state.field(Ll)||!(g.selectionSet||g.docChanged))return;let b=g.state.selection.main.head;Yx(g.state.doc,b)||p(g.view)})),c.push(Et.updateListener.of(async g=>{var E;if(!(n&&g.docChanged)||g.transactions.some(O=>O.annotation(Od))||!((E=n.client.capabilities)!=null&&E.signatureHelpProvider)||!s.signatureActivateOnTyping)return;let b=n.client.capabilities.signatureHelpProvider.triggerCharacters||["(",","],_=g.changes,S=-1,C;_.iterChanges((O,M,V,H,$)=>{if(S>=0)return;let N=Jx($.toString(),V,b);N&&(S=N.triggerPos,C=N.triggerCharacter)}),S>=0&&n.showSignatureHelpTooltip(g.view,S,C)}))}return s.completionEnabled&&c.push(Lu({...e.completionConfig,override:[async p=>{var S,C;if(n==null)return null;let{state:g,pos:b}=p,_=Gx(p,((C=(S=n.client.capabilities)==null?void 0:S.completionProvider)==null?void 0:C.triggerCharacters)??[],e.completionMatchBefore);return _==null?null:await n.requestCompletion(p,pa(g.doc,b),_)},...((h=e.completionConfig)==null?void 0:h.override)||[]]})),c.push(Et.domEventHandlers({click:(p,g)=>{if(s.definitionEnabled&&a.goToDefinition==="ctrlcmd"&&(p.ctrlKey||p.metaKey)){let b=g.posAtCoords({x:p.clientX,y:p.clientY});b&&n&&(n.requestDefinition(g,pa(g.state.doc,b)).catch(_=>Ln(g,`Go to definition failed: ${_ instanceof Error?_.message:"Unknown error"}`)),p.preventDefault())}}})),c};function Gx(e,n,a){let{state:o,pos:s,explicit:c}=e,h=o.doc.lineAt(s),p=ha.CompletionTriggerKind.Invoked,g,b=h.text[s-h.from-1]||"",_=n==null?void 0:n.includes(b);return!c&&_&&(p=ha.CompletionTriggerKind.TriggerCharacter,g=b),p===ha.CompletionTriggerKind.Invoked&&!e.matchBefore(a||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:p,triggerCharacter:g}}function Jx(e,n,a){if(!e)return null;for(let o of a){let s=e.indexOf(o);if(s!==-1)return{triggerPos:n+s+1,triggerCharacter:o}}return null}function Xx(e){let n=0;for(let a of e)a==="("?n++:a===")"&&n--;return n}function Yx(e,n,a=Kx){let o=e.lineAt(n),s=Math.max(1,o.number-a),c=e.line(s).from;return Xx(e.sliceString(c,n))>0}Hu=function(e,n,a={}){let{preserveCursor:o=!0,effects:s,userEvent:c}=a,h=e.state.doc;if(h.toString()!==n)if(o&&e.hasFocus){let p=e.state.selection.main.head,g=h.lineAt(p),b=g.number,_=p-g.from,S=e.state.update({changes:{from:0,to:h.length,insert:n}}).state.doc,C;if(b<=S.lines){let E=S.line(b),O=E.length;C=E.from+Math.min(_,O)}else C=S.line(S.lines).to;e.dispatch({changes:{from:0,to:h.length,insert:n},annotations:Od.of(!0),selection:{anchor:C},effects:s,userEvent:c})}else e.dispatch({changes:{from:0,to:h.length,insert:n},effects:s,userEvent:c})},Vi=function(){return ml.define({combine:e=>e.find(n=>n!==void 0)})};const Q0=Vi(),G0=Vi(),Ad=Vi(),Dl=Vi(),J0=Vi();G_=function({cellId:e,completionConfig:n,hotkeys:a,placeholderType:o,lspConfig:s,diagnosticsConfig:c}){return[Dl.of(e),Q0.of(n),G0.of(a),Ad.of(o),J0.of({...s,diagnostics:c})]},Vu=new Tu;function Zx(e){return Object.values(e.cellRuntime).some(n=>n.status==="running")}function ek(e){return Object.values(e.cellRuntime).filter(n=>n.status==="running"||n.status==="queued").length}function tk(e){return qu(e).length>0}gw=function(e){return e.cellIds.inOrderIds.map(n=>e.cellData[n])};function nk({cellHandles:e}){let n={};for(let[a,o]of Ar.entries(e))o.current&&(n[a]=o.current.editorView);return n}Gh=function(e){let{cellIds:n,cellData:a}=e,o=[];for(let s of n.inOrderIds)a[s].config.disabled&&o.push(s);return o};function X0(e){let{cellIds:n,cellData:a}=e,o=[];for(let s of n.inOrderIds)a[s].config.disabled||o.push(s);return o}function rk(e){return e.history.length>0}Ew=function(e,n){let a=e.cellIds.findWithId(n).getDescendants(n);return{stale:a.some(o=>{var s,c;return((s=e.cellRuntime[o])==null?void 0:s.staleInputs)||((c=e.cellData[o])==null?void 0:c.edited)}),errored:a.some(o=>{var s;return(s=e.cellRuntime[o])==null?void 0:s.errored}),runningOrQueued:a.some(o=>{var s,c;return((s=e.cellRuntime[o])==null?void 0:s.status)==="running"||((c=e.cellRuntime[o])==null?void 0:c.status)==="queued"})}},qu=function(e){let{cellIds:n,cellData:a,cellRuntime:o}=e;return n.inOrderIds.filter(s=>Hh({executionTime:o[s].runElapsedTimeMs??a[s].lastExecutionTime,status:o[s].status,errored:o[s].errored,interrupted:o[s].interrupted,stopped:o[s].stopped})||a[s].edited||o[s].interrupted||o[s].staleInputs&&!(o[s].status==="disabled-transitively"||a[s].config.disabled))},Hh=function({executionTime:e,status:n,errored:a,interrupted:o,stopped:s}){return e===null&&n!=="queued"&&n!=="running"&&!(a||o||s)},ct=ml.define({combine:e=>e[0]}),sa=ml.define({combine:e=>e[0]});var ak={...Sh,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"};const Y0=Ch.define(ak),Z0=Ch.define({charSetCasts:!0,doubleQuotedStrings:!1,unquotedBitLiterals:!0,hashComments:!1,spaceAfterDashes:!1,specialVar:"@?",identifierQuotes:'"',caseInsensitiveIdentifiers:!0,keywords:"percentile_cont row_number rank dense_rank rank_dense percent_rank cume_dist ntile lag lead first_value last_value nth_value !__postfix !~~ !~~* % & && * ** + - ->> / // <-> << <=> <@ >> @ @> Calendar JSON TimeZone ^ ^@ abort abs absolute access access_mode acos acosh action add add_parquet_key admin after age aggregate alias all all_profiling_output allow_community_extensions allow_extensions_metadata_mismatch allow_persistent_secrets allow_unredacted_secrets allow_unsigned_extensions allowed_directories allowed_paths also alter always analyse analyze and anti any any_value apply approx_count_distinct approx_quantile approx_top_k arbitrary arg_max arg_max_null arg_min arg_min_null argmax argmin array array_agg array_aggr array_aggregate array_append array_apply array_cat array_concat array_contains array_cosine_distance array_cosine_similarity array_cross_product array_distance array_distinct array_dot_product array_extract array_filter array_grade_up array_has array_has_all array_has_any array_indexof array_inner_product array_intersect array_length array_negative_dot_product array_negative_inner_product array_pop_back array_pop_front array_position array_prepend array_push_back array_push_front array_reduce array_resize array_reverse array_reverse_sort array_select array_slice array_sort array_to_json array_to_string array_to_string_comma_default array_transform array_unique array_value array_where array_zip arrow_large_buffer_size arrow_lossless_conversion arrow_output_list_view arrow_output_version arrow_scan arrow_scan_dumb as asc ascii asin asinh asof asof_loop_join_threshold assertion assignment asymmetric at atan atan2 atanh attach attribute authorization autoinstall_extension_repository autoinstall_known_extensions autoload_known_extensions avg backward bar base64 before begin between bigint bin binary binary_as_string bit bit_and bit_count bit_length bit_or bit_position bit_xor bitstring bitstring_agg blob bool bool_and bool_or boolean both bpchar by bytea cache call called can_cast_implicitly cardinality cascade cascaded case cast cast_to_type catalog catalog_error_max_schemas cbrt ceil ceiling centuries century chain char char_length character character_length characteristics check checkpoint checkpoint_threshold chr class close cluster coalesce col_description collate collation collations column columns combine comment comments commit committed compression concat concat_ws concurrently configuration conflict connection constant_or_null constraint constraints contains content continue conversion copy copy_database corr cos cosh cost cot count count_if count_star countif covar_pop covar_samp create create_sort_key cross csv cube current current_catalog current_connection_id current_database current_date current_localtime current_localtimestamp current_query current_query_id current_role current_schema current_schemas current_setting current_transaction_id current_user currval cursor custom_extension_repository custom_profiling_settings custom_user_agent cycle damerau_levenshtein data database database_list database_size date date_add date_diff date_part date_sub date_trunc datediff datepart datesub datetime datetrunc day dayname dayofmonth dayofweek dayofyear days deallocate debug_asof_iejoin debug_checkpoint_abort debug_force_external debug_force_no_cross_product debug_skip_checkpoint_on_commit debug_verify_vector debug_window_mode dec decade decades decimal declare decode default default_block_size default_collation default_null_order default_order default_secret_storage defaults deferrable deferred definer degrees delete delimiter delimiters depends desc describe detach dictionary disable disable_checkpoint_on_shutdown disable_logging disable_object_cache disable_optimizer disable_parquet_prefetching disable_print_progress_bar disable_profile disable_profiling disable_progress_bar disable_timestamptz_casts disable_verification disable_verify_external disable_verify_fetch_row disable_verify_parallelism disable_verify_serializer disabled_compression_methods disabled_filesystems disabled_log_types disabled_optimizers discard distinct divide do document domain double drop duckdb_api duckdb_columns duckdb_constraints duckdb_databases duckdb_dependencies duckdb_extensions duckdb_external_file_cache duckdb_functions duckdb_indexes duckdb_keywords duckdb_log_contexts duckdb_logs duckdb_logs_parsed duckdb_memory duckdb_optimizers duckdb_prepared_statements duckdb_schemas duckdb_secret_types duckdb_secrets duckdb_sequences duckdb_settings duckdb_table_sample duckdb_tables duckdb_temporary_files duckdb_types duckdb_variables duckdb_views dynamic_or_filter_threshold each editdist3 element_at else enable enable_checkpoint_on_shutdown enable_external_access enable_external_file_cache enable_fsst_vectors enable_geoparquet_conversion enable_http_logging enable_http_metadata_cache enable_logging enable_macro_dependencies enable_object_cache enable_optimizer enable_print_progress_bar enable_profile enable_profiling enable_progress_bar enable_progress_bar_print enable_verification enable_view_dependencies enabled_log_types encode encoding encrypted end ends_with entropy enum enum_code enum_first enum_last enum_range enum_range_boundary epoch epoch_ms epoch_ns epoch_us equi_width_bins era error errors_as_json escape even event except exclude excluding exclusive execute exists exp explain explain_output export export_state extension extension_directory extension_versions extensions external external_threads extract factorial false family favg fdiv fetch file_search_path filter finalize first flatten float float4 float8 floor fmod following for force force_bitpacking_mode force_checkpoint force_compression foreign format formatReadableDecimalSize formatReadableSize format_bytes format_pg_type format_type forward freeze from from_base64 from_binary from_hex from_json from_json_strict fsum full function functions gamma gcd gen_random_uuid generate_series generate_subscripts generated geomean geometric_mean get_bit get_block_size get_current_time get_current_timestamp getvariable glob global grade_up grant granted greatest greatest_common_divisor group group_concat grouping grouping_id groups guid hamming handler having header hex histogram histogram_exact histogram_values hold home_directory hour hours http_logging_output http_proxy http_proxy_password http_proxy_username hugeint identity ieee_floating_point_ops if ignore ilike ilike_escape immediate immediate_transaction_mode immutable implicit import import_database in in_search_path include including increment index index_scan_max_count index_scan_percentage indexes inet_client_addr inet_client_port inet_server_addr inet_server_port inherit inherits initially inline inner inout input insensitive insert install instead instr int int1 int128 int16 int2 int32 int4 int64 int8 integer integer_division integral intersect interval into invoker is is_histogram_other_bin isfinite isinf isnan isnull isodow isolation isoyear jaccard jaro_similarity jaro_winkler_similarity join json json_array json_array_length json_contains json_deserialize_sql json_each json_execute_serialized_sql json_exists json_extract json_extract_path json_extract_path_text json_extract_string json_group_array json_group_object json_group_structure json_keys json_merge_patch json_object json_pretty json_quote json_serialize_plan json_serialize_sql json_structure json_transform json_transform_strict json_tree json_type json_valid json_value julian kahan_sum key kurtosis kurtosis_pop label lambda lambda_syntax language large last last_day late_materialization_max_rows lateral lcase lcm leading leakproof least least_common_multiple left left_grapheme len length length_grapheme level levenshtein lgamma like like_escape limit list list_aggr list_aggregate list_any_value list_append list_apply list_approx_count_distinct list_avg list_bit_and list_bit_or list_bit_xor list_bool_and list_bool_or list_cat list_concat list_contains list_cosine_distance list_cosine_similarity list_count list_distance list_distinct list_dot_product list_element list_entropy list_extract list_filter list_first list_grade_up list_has list_has_all list_has_any list_histogram list_indexof list_inner_product list_intersect list_kurtosis list_kurtosis_pop list_last list_mad list_max list_median list_min list_mode list_negative_dot_product list_negative_inner_product list_pack list_position list_prepend list_product list_reduce list_resize list_reverse list_reverse_sort list_select list_sem list_skewness list_slice list_sort list_stddev_pop list_stddev_samp list_string_agg list_sum list_transform list_unique list_value list_var_pop list_var_samp list_where list_zip listagg listen ln load local location lock lock_configuration locked log log10 log2 log_query_path logged logging_level logging_mode logging_storage logical long lower lpad ltrim macro mad make_date make_time make_timestamp make_timestamp_ns make_timestamptz map map_concat map_contains map_contains_entry map_contains_value map_entries map_extract map_extract_value map_from_entries map_keys map_to_pg_oid map_values mapping match materialized max max_by max_expression_depth max_memory max_temp_directory_size max_vacuum_tasks maxvalue md5 md5_number md5_number_lower md5_number_upper mean median memory_limit merge_join_threshold metadata_info method microsecond microseconds millennia millennium millisecond milliseconds min min_by minute minutes minvalue mismatches mod mode month monthname months move multiply name names nanosecond national natural nchar nested_loop_join_threshold new next nextafter nextval nfc_normalize no none normalized_interval not not_ilike_escape not_like_escape nothing notify notnull now nowait null null_order nullif nulls numeric nvarchar obj_description object octet_length of off offset oid oids old old_implicit_casting on only operator option options or ord order order_by_non_integer_literal ordered_aggregate_threshold ordinality others out outer over overlaps overlay overriding owned owner pandas_analyze_sample pandas_scan parallel parquet_bloom_probe parquet_file_metadata parquet_kv_metadata parquet_metadata parquet_metadata_cache parquet_scan parquet_schema parse_dirname parse_dirpath parse_duckdb_log_message parse_filename parse_path parser partial partition partitioned partitioned_write_flush_threshold partitioned_write_max_open_files passing password percent perfect_ht_threshold persistent pi pivot pivot_filter_threshold pivot_limit pivot_longer pivot_wider placing plans platform policy position positional pow power pragma pragma_collations pragma_database_size pragma_metadata_info pragma_platform pragma_show pragma_storage_info pragma_table_info pragma_user_agent pragma_version preceding precision prefer_range_joins prefetch_all_parquet_files prefix prepare prepared preserve preserve_identifier_case preserve_insertion_order primary printf prior privileges procedural procedure produce_arrow_string_view product profile_output profiling_mode profiling_output program progress_bar_time publication python_enable_replacements python_map_function python_scan_all_frames qualify quantile quantile_cont quantile_disc quarter quarters query query_table quote radians random range read read_blob read_csv read_csv_auto read_json read_json_auto read_json_objects read_json_objects_auto read_ndjson read_ndjson_auto read_ndjson_objects read_parquet read_text real reassign recheck recursive reduce ref references referencing refresh regexp_escape regexp_extract regexp_extract_all regexp_full_match regexp_matches regexp_replace regexp_split_to_array regexp_split_to_table regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release remap_struct rename repeat repeat_row repeatable replace replica reservoir_quantile reset respect restart restrict returning returns reverse revoke right right_grapheme role rollback rollup round round_even roundbankers row row_to_json rows rpad rtrim rule sample savepoint scalar_subquery_error_on_multiple_rows scheduler_process_partial schema schemas scope scroll search search_path second seconds secret secret_directory security select sem semi seq_scan sequence sequences serializable server session session_user set set_bit setof sets setseed sha1 sha256 share shobj_description short show show_databases show_tables show_tables_expanded sign signbit signed similar simple sin sinh skewness skip smallint snapshot sniff_csv some sorted split split_part sql sqrt stable standalone start starts_with statement statistics stats stddev stddev_pop stddev_samp stdin stdout storage storage_compatibility_version storage_info stored str_split str_split_regex streaming_buffer_size strftime strict string string_agg string_split string_split_regex string_to_array strip strip_accents strlen strpos strptime struct struct_concat struct_extract struct_extract_at struct_insert struct_pack subscription substr substring substring_grapheme subtract suffix sum sum_no_overflow sumkahan summarize summary symmetric sysid system table table_info tables tablesample tablespace tan tanh temp temp_directory template temporary test_all_types test_vector_types text then threads ties time time_bucket timestamp timestamp_ms timestamp_ns timestamp_s timestamp_us timestamptz timetz timetz_byte_comparable timezone timezone_hour timezone_minute tinyint to to_base to_base64 to_binary to_centuries to_days to_decades to_hex to_hours to_json to_microseconds to_millennia to_milliseconds to_minutes to_months to_quarters to_seconds to_timestamp to_weeks to_years today trailing transaction transaction_timestamp transform translate treat trigger trim true trunc truncate truncate_duckdb_logs trusted try_cast try_strptime txid_current type typeof types ubigint ucase uhugeint uint128 uint16 uint32 uint64 uint8 uinteger unbin unbounded uncommitted unencrypted unhex unicode union union_extract union_tag union_value unique unknown unlisten unlogged unnest unpack unpivot unpivot_list until update upper url_decode url_encode use user user_agent username using usmallint utinyint uuid uuid_extract_timestamp uuid_extract_version uuidv4 uuidv7 vacuum valid validate validator value values var_pop var_samp varbinary varchar variable variadic variance varint varying vector_type verbose verify_external verify_fetch_row verify_parallelism verify_serializer version view views virtual volatile wal_autocheckpoint wavg week weekday weekofyear weeks weighted_avg when where which_secret whitespace window with within without work worker_threads wrapper write write_log xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlnamespaces xmlparse xmlpi xmlroot xmlserialize xmltable xor year years yearweek yes zone zstd_min_string_length | || ~ ~~ ~~* ~~~",types:"JSON bigint binary bit bitstring blob bool boolean bpchar bytea char date datetime dec decimal double enum float float4 float8 guid hugeint int int1 int128 int16 int2 int32 int4 int64 int8 integer integral interval list logical long map null numeric nvarchar oid real row short signed smallint string struct text time timestamp timestamp_ms timestamp_ns timestamp_s timestamp_us timestamptz timetz tinyint ubigint uhugeint uint128 uint16 uint32 uint64 uint8 uinteger union usmallint utinyint uuid varbinary varchar varint"});var ik=new Set("postgresql.postgres.couchbase.db2.db2i.tidb.mysql.sqlite.mssql.sqlserver.duckdb.mariadb.cassandra.noql.spark.awsathena.athena.bigquery.hive.redshift.snowflake.flink.mongodb.trino.oracle.oracledb.singlestoredb.timescaledb.databricks.datafusion.microsoft sql server".split("."));function jl(e){return ik.has(e)}function eg(e){let n=e.dialect;if(!jl(n))return be.debug("Unknown dialect",{dialect:n}),ss;switch(n){case"postgresql":case"postgres":return Sh;case"mysql":return cT;case"sqlite":return sT;case"mssql":case"sqlserver":case"microsoft sql server":return dT;case"duckdb":return Z0;case"mariadb":return fT;case"cassandra":return pT;case"oracledb":case"oracle":return oT;case"bigquery":return Y0;case"timescaledb":return Sh;case"awsathena":case"athena":case"db2i":case"db2":case"hive":case"redshift":case"snowflake":case"flink":case"mongodb":case"noql":case"couchbase":case"trino":case"tidb":case"singlestoredb":case"spark":case"databricks":case"datafusion":return be.debug("Unsupported dialect",{dialect:n}),ss;default:return Xo(n),ss}}var ok={...uT,caseInsensitiveIdentifiers:!0,identifierQuotes:"'"};let ss;ss=Ch.define(ok),ca="__marimo_duckdb",Fi=new Set([ca]),kw="memory",_l=function(e){return e===""};var ls={formatTableName:e=>e,formatSelectClause:(e,n)=>`SELECT ${e} FROM ${n} LIMIT 100`};function sk(e){if(e=e.toLowerCase(),!jl(e))return ls;switch(e){case"bigquery":{let n=Y0.spec.identifierQuotes;return{formatTableName:a=>`${n}${a}${n}`,formatSelectClause:ls.formatSelectClause}}case"mssql":case"sqlserver":case"microsoft sql server":return{formatTableName:ls.formatTableName,formatSelectClause:(n,a)=>`SELECT TOP 100 ${n} FROM ${a}`};case"timescaledb":case"postgres":case"postgresql":case"duckdb":return{formatTableName:n=>n.split(".").map(a=>`"${a}"`).join("."),formatSelectClause:(n,a)=>`SELECT ${n==="*"?"*":`"${n}"`} FROM ${a} LIMIT 100`};case"db2":case"db2i":case"mysql":case"sqlite":case"mariadb":case"cassandra":case"noql":case"awsathena":case"athena":case"hive":case"redshift":case"snowflake":case"flink":case"mongodb":case"oracle":case"oracledb":case"couchbase":case"tidb":case"spark":case"trino":case"singlestoredb":case"databricks":case"datafusion":return ls;default:return Xo(e),ls}}dw=function({table:e,columnName:n,sqlTableContext:a}){if(a){let{engine:o,schema:s,defaultSchema:c,defaultDatabase:h,database:p,dialect:g}=a,b=e.name;_l(s)?b=p===h?b:`${p}.${b}`:(s!==c&&(b=`${s}.${b}`),p!==h&&(b=`${p}.${b}`));let _=sk(g),S=_.formatTableName(b),C=_.formatSelectClause(n,S);return o==="__marimo_duckdb"?`_df = mo.sql(f"""
30
30
  ${C}
31
31
  """)`:`_df = mo.sql(f"""
32
32
  ${C}
33
- """, engine=${o})`}return`_df = mo.sql(f'SELECT "${n}" FROM ${e.name} LIMIT 100')`},Dw=function(e,n){if(n==="date"||n==="datetime"||n==="time"){if(e==="min")return"Earliest";if(e==="max")return"Latest"}return e};function sk(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:jT,createActions:zT,valueAtom:tg,useActions:lk}=yl(sk,{addDatasets:(e,n)=>{let{previewDatasetColumn:a}=oa();for(let p of n.tables)for(let g of p.columns){let b=`${p.name}:${g.name}`;e.expandedColumns.has(b)&&a({tableName:p.name,columnName:g.name,source:p.source,sourceType:p.source_type})}let o=e.tables;n.clear_channel&&(o=o.filter(p=>p.source!==n.clear_channel));let s=[...n.tables,...o],c=new Set,h=s.filter(p=>{let g=`${p.name}:${p.source}`;return c.has(g)?!1:(c.add(g),!0)}).sort((p,g)=>p.name.localeCompare(g.name));return{...e,tables:h}},filterDatasetsFromVariables:(e,n)=>{let a=new Set(n),o=e.tables.filter(s=>s.variable_name?a.has(s.variable_name):!0);return{...e,tables:o}},toggleTable:(e,n)=>{let a=new Set(e.expandedTables);return a.has(n)?a.delete(n):a.add(n),{...e,expandedTables:a}},toggleColumn:(e,n)=>{let a=`${n.table}:${n.column}`,o=new Set(e.expandedColumns);return o.has(a)?o.delete(a):o.add(a),{...e,expandedColumns:o}},closeAllColumns:e=>({...e,expandedColumns:new Set}),addColumnPreview:(e,n)=>{let a=`${n.table_name}:${n.column_name}`,o=new Map(e.columnsPreviews);return o.set(a,n),{...e,columnsPreviews:o}}});uw=()=>mn(tg),cd=Ce(e=>e(tg).tables),Mw=Ce(new Set),Uw=Ce(!1),q_=function(){return lk()};var ck=new Map([[ca,{name:ca,dialect:"duckdb",source:"duckdb",display_name:"DuckDB (In-Memory)",databases:[]}]]);function uk(){return{latestEngineSelected:ca,connectionsMap:ck}}let dk,fk;({reducer:dk,createActions:fk,valueAtom:$i,useActions:$_}=yl(uk,{addDataSourceConnection:(e,n)=>{if(n.connections.length===0)return e;let{latestEngineSelected:a,connectionsMap:o}=e,s=new Map(o);for(let c of n.connections)s.set(c.name,c);return{latestEngineSelected:a,connectionsMap:s}},filterDataSourcesFromVariables:(e,n)=>{let{latestEngineSelected:a,connectionsMap:o}=e,s=new Set(n),c=new Map([...o].filter(([h])=>Fi.has(h)?!0:s.has(h)));return{latestEngineSelected:c.has(a)?a:ca,connectionsMap:c}},clearDataSourceConnections:()=>({latestEngineSelected:ca,connectionsMap:new Map}),removeDataSourceConnection:(e,n)=>{let{latestEngineSelected:a,connectionsMap:o}=e,s=new Map(o);return s.delete(n),{latestEngineSelected:s.has(a)?a:ca,connectionsMap:s}},addTableList:(e,n)=>{let{tables:a,sqlTableContext:o}=n,{connectionsMap:s,latestEngineSelected:c}=e,h=o.engine,p=s.get(h);if(!p)return e;let g=new Map(s),b={...p,databases:p.databases.map(_=>_.name===o.database?{..._,schemas:_.schemas.map(S=>S.name===o.schema?{...S,tables:a}:S)}:_)};return g.set(h,b),{latestEngineSelected:c,connectionsMap:g}},addTable:(e,n)=>{let{table:a,sqlTableContext:o}=n,{connectionsMap:s,latestEngineSelected:c}=e,h=o.engine,p=a.name,g=s.get(h);if(!g)return e;let b=new Map(s),_={...g,databases:g.databases.map(S=>S.name===o.database?{...S,schemas:S.schemas.map(C=>{if(C.name!==o.schema)return C;let E=C.tables.length===0?[a]:C.tables.map(O=>O.name===p?a:O);return{...C,tables:E}})}:S)};return b.set(h,_),{latestEngineSelected:c,connectionsMap:b}}})),Yu=Ce(e=>e($i).connectionsMap);function ng(e){let n=Fe.get($i);n.connectionsMap.has(e)&&Fe.set($i,{...n,latestEngineSelected:e})}s_=Ce(e=>{let n=Fe.get(cd),a=e($i).connectionsMap,o=new Map;for(let s of n)o.set(s.name,s);for(let s of a.values())for(let c of s.databases){let h=c.name===s.default_database||s.databases.length===1;for(let p of c.schemas){let g=p.name===s.default_schema,b=_l(p.name);for(let _ of p.tables){let S;if(S=_.name,b){S=h?_.name:`${c.name}.${_.name}`,o.has(S)?be.warn(`Table name collision for ${S}. Skipping.`):o.set(S,_);continue}if(h&&g&&!o.has(S)){o.set(S,_);continue}if(S=`${p.name}.${_.name}`,h&&!o.has(S)){o.set(S,_);continue}S=`${c.name}.${p.name}.${_.name}`,o.has(S)?be.warn(`Table name collision for ${S}. Skipping.`):o.set(S,_)}}}return o}),N_=function(e){return e.variable_name?"dataframe":"table"};let zl,Id,rg,ag,ig,Rd,og;zl=class{constructor(e,n={}){ve(this,"cache",new Map);this.maxSize=e,this.options=n}getOrCreate(e){rn(this.options.create,"create function is required");let n=this.cache.get(e);if(n!==void 0)return n;let a=this.options.create(e);return this.cache.set(e,a),a}get(e){let n=this.cache.get(e);return n!==void 0&&(this.cache.delete(e),this.cache.set(e,n)),n}set(e,n){if(this.cache.has(e)&&this.cache.delete(e),this.cache.set(e,n),this.cache.size>this.maxSize){let a=this.cache.keys().next().value;a!==void 0&&this.cache.delete(a)}}keys(){return this.cache.keys()}values(){return this.cache.values()}entries(){return this.cache.entries()}delete(e){this.cache.delete(e)}},Lm=lt("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),Am=lt("book-marked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]),xm=lt("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),bm=lt("box",[["path",{d:"M21 8a2 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 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),qm=lt("braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]),Id=lt("calendar-clock",[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]),Em=lt("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),ym=lt("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),Pm=lt("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),rg=lt("cog",[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]]),Om=lt("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),rs=lt("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),ed=lt("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),Rm=lt("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),ag=lt("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"}]]),ad=lt("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),ig=lt("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"}]]),Ui=lt("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),_m=lt("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"}]]),Ph=lt("notebook-pen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.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:"pqwjuv"}]]),Zh=lt("paint-roller",[["rect",{width:"16",height:"6",x:"2",y:"2",rx:"2",key:"jcyz7m"}],["path",{d:"M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2",key:"1b9h7c"}],["rect",{width:"4",height:"6",x:"8",y:"16",rx:"1",key:"d6e7yl"}]]),fm=lt("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"}]]),Rd=lt("search-check",[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),og=lt("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"}]]),om=lt("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"}]]),Hi=lt("table-2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]),Uh=lt("text-search",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M10 12H3",key:"1ulcyk"}],["path",{d:"M10 19H3",key:"108z41"}],["circle",{cx:"17",cy:"15",r:"3",key:"1upz2a"}],["path",{d:"m21 19-1.9-1.9",key:"dwi7p8"}]]),Im=lt("variable",[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]),kl=function(e){switch(e){case"duckdb":return"DuckDB";case"motherduck":return"MotherDuck";case"sqlite":return"SQLite";case"postgres":case"postgresql":return"PostgreSQL";case"mysql":return"MySQL";case"mariadb":return"MariaDB";case"mssql":case"microsoft sql server":return"Microsoft SQL Server";case"oracle":return"Oracle";case"redshift":return"Amazon Redshift";case"snowflake":return"Snowflake";case"bigquery":return"Google BigQuery";case"clickhouse":return"ClickHouse";case"timeplus":return"Timeplus";case"databricks":return"Databricks";case"db2":return"IBM Db2";case"hive":return"Apache Hive";case"impala":return"Apache Impala";case"presto":return"Presto";case"trino":return"Trino";case"cockroachdb":return"CockroachDB";case"timescaledb":return"TimescaleDB";case"singlestore":return"SingleStore";case"cassandra":return"Apache Cassandra";case"mongodb":return"MongoDB";case"iceberg":return"Apache Iceberg";default:return e}};function sg(e){let[n,a]=e.split(" ");return a?`${kl(n)} ${a}`:kl(e)}$u={boolean:s5,date:l5,time:Pm,datetime:Id,temporal:Id,number:yh,string:c5,integer:yh,unknown:qm},mw=function(e){switch(e){case"boolean":return"bg-(--orange-4)";case"date":case"time":case"datetime":case"temporal":return"bg-(--grass-4) dark:bg-(--grass-5)";case"number":case"integer":return"bg-(--purple-4)";case"string":return"bg-(--blue-4)";case"unknown":return"bg-(--slate-4) dark:bg-(--slate-6)";default:return Xo(e),"bg-(--slate-4) dark:bg-(--slate-6)"}};let cs,z,lg,Md,cg,eo,ug,dg,fg,pg,hg,to,_r,ri,Rr,Pd;Qa=class{constructor(e,n){this.singular=e,this._plural=n}pluralize(e){return e===1?this.singular:this.plural}get plural(){return this._plural??`${this.singular}s`}},jw=class J_{constructor(n){this.words=n}static of(...n){return new J_(n.map(a=>typeof a=="string"?new Qa(a):a))}join(n,a){return this.words.map(o=>o.pluralize(a)).join(n)}},cs=Zn(),z=gh(y5(),1),lg=5,Md={boolean:"bg-[var(--orange-4)] text-[var(--orange-11)]",date:"bg-[var(--grass-4)] text-[var(--grass-11)]",time:"bg-[var(--grass-4)] text-[var(--grass-11)]",datetime:"bg-[var(--grass-4)] text-[var(--grass-11)]",number:"bg-[var(--purple-4)] text-[var(--purple-11)]",integer:"bg-[var(--purple-4)] text-[var(--purple-11)]",string:"bg-[var(--blue-4)] text-[var(--blue-11)]",unknown:"bg-[var(--slate-4)] text-[var(--slate-11)]"},cg={local:"bg-[var(--blue-4)] text-[var(--blue-11)]",duckdb:"bg-[var(--amber-4)] text-[var(--amber-11)]",connection:"bg-[var(--green-4)] text-[var(--green-11)]",catalog:"bg-[var(--purple-4)] text-[var(--purple-11)]"},eo="p-3 min-w-[250px] flex flex-col divide-y",ug=new Qa("column","columns"),dg=new Qa("row","rows"),fg=new Qa("schema","schemas"),pg=new Qa("table","tables"),hg=new Qa("database","databases"),to=e=>{let n=(0,cs.c)(6),{icon:a,title:o,badge:s}=e,c;n[0]===o?c=n[1]:(c=(0,z.jsx)("h3",{className:"font-semibold text-sm",children:o}),n[0]=o,n[1]=c);let h;return n[2]!==s||n[3]!==a||n[4]!==c?(h=(0,z.jsxs)("div",{className:"flex items-center gap-2 pb-2",children:[a,c,s]}),n[2]=s,n[3]=a,n[4]=c,n[5]=h):h=n[5],h},_r=e=>{let n=(0,cs.c)(5),{label:a,value:o}=e,s;n[0]===a?s=n[1]:(s=(0,z.jsxs)("span",{className:"text-[var(--slate-11)]",children:[a,":"]}),n[0]=a,n[1]=s);let c;return n[2]!==s||n[3]!==o?(c=(0,z.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[s,o]}),n[2]=s,n[3]=o,n[4]=c):c=n[4],c},ri=e=>{let n=(0,cs.c)(5),{icon:a,text:o}=e,s;n[0]===o?s=n[1]:(s=(0,z.jsx)("span",{className:"text-xs text-[var(--slate-11)]",children:o}),n[0]=o,n[1]=s);let c;return n[2]!==a||n[3]!==s?(c=(0,z.jsxs)("div",{className:"flex items-center gap-1",children:[a,s]}),n[2]=a,n[3]=s,n[4]=c):c=n[4],c},Rr=e=>{let n=(0,cs.c)(15),{title:a,items:o,totalCount:s,limit:c}=e,h=a===void 0?"":a,p=c===void 0?lg:c;if(o.length===0)return null;let g;n[0]!==o||n[1]!==p?(g=o.slice(0,p),n[0]=o,n[1]=p,n[2]=g):g=n[2];let b=g,_=s>p,S;n[3]===h?S=n[4]:(S=h&&(0,z.jsxs)("h4",{className:"text-xs font-medium text-[var(--slate-11)] mb-2",children:[h,":"]}),n[3]=h,n[4]=S);let C;n[5]!==_||n[6]!==p||n[7]!==s?(C=_&&(0,z.jsxs)("div",{className:"text-xs text-[var(--slate-10)] text-center py-1",children:["... and ",s-p," more"]}),n[5]=_,n[6]=p,n[7]=s,n[8]=C):C=n[8];let E;n[9]!==C||n[10]!==b?(E=(0,z.jsxs)("div",{className:"flex flex-col gap-1 overflow-y-auto",children:[b,C]}),n[9]=C,n[10]=b,n[11]=E):E=n[11];let O;return n[12]!==S||n[13]!==E?(O=(0,z.jsxs)("div",{className:"py-2",children:[S,E]}),n[12]=S,n[13]=E,n[14]=O):O=n[14],O},Pd=e=>Md[e]||Md.unknown;const pk=e=>{var h,p;let n=e.type==="view"?(0,z.jsx)(ed,{className:"w-4 h-4 text-[var(--blue-9)]"}):(0,z.jsx)(Hi,{className:"w-4 h-4 text-[var(--green-9)]"}),a=(0,z.jsx)(Bn,{variant:"secondary",className:`text-xs ${e.type==="view"?"bg-[var(--blue-4)] text-[var(--blue-11)]":"bg-[var(--green-4)] text-[var(--green-11)]"}`,children:e.type}),o=e.columns.map(g=>{let b=$u[g.type];return(0,z.jsxs)("div",{className:"flex items-center justify-between text-xs rounded",children:[(0,z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,z.jsx)(b,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,z.jsx)("span",{className:"font-mono",children:g.name})]}),(0,z.jsx)(Bn,{variant:"outline",className:`text-xs ${Pd(g.type)}`,children:g.type})]},g.name)}),s=e.primary_keys&&e.primary_keys.length>0,c=e.indexes&&e.indexes.length>0;return(0,z.jsxs)("div",{className:`${eo} min-w-[300px]`,children:[(0,z.jsx)(to,{icon:n,title:e.name,badge:a}),(0,z.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,z.jsx)(_r,{label:"Source",value:(0,z.jsx)(Bn,{variant:"outline",className:`text-xs ${cg[e.source_type]}`,children:e.source})}),e.variable_name&&(0,z.jsx)(_r,{label:"Variable",value:(0,z.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.variable_name})}),e.engine&&(0,z.jsx)(_r,{label:"Engine",value:(0,z.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(e.num_columns!=null||e.num_rows!=null)&&(0,z.jsxs)("div",{className:"grid grid-cols-2 gap-2 py-2",children:[e.num_columns!=null&&(0,z.jsx)(ri,{icon:(0,z.jsx)(Om,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_columns} ${ug.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,z.jsx)(ri,{icon:(0,z.jsx)(yh,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_rows} ${dg.pluralize(e.num_rows)}`})]}),e.columns.length===0&&ql("column"),(s||c)&&(0,z.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[s&&(0,z.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,z.jsxs)("div",{className:"flex items-center gap-1",children:[(0,z.jsx)(yT,{className:"w-3 h-3 text-[var(--amber-9)]"}),(0,z.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Primary Keys:"})]}),(h=e.primary_keys)==null?void 0:h.map(g=>(0,z.jsx)(Bn,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:g},g))]}),c&&(0,z.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,z.jsxs)("div",{className:"flex items-center gap-1 mb-1",children:[(0,z.jsx)(Am,{className:"w-3 h-3 text-[var(--purple-9)]"}),(0,z.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Indexes:"})]}),(p=e.indexes)==null?void 0:p.map(g=>(0,z.jsx)(Bn,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:g},g))]})]}),e.columns.length>0&&(0,z.jsx)(Rr,{items:o,totalCount:e.columns.length})]})},hk=e=>{var s;let n=$u[e.type],a=(0,z.jsx)(Bn,{variant:"outline",className:`text-xs ${Pd(e.type)}`,children:e.type}),o=((s=e.sample_values)==null?void 0:s.map((c,h)=>(0,z.jsx)("div",{className:"text-xs bg-[var(--slate-3)] rounded font-mono",children:c==null?"null":String(c)},h)))||[];return(0,z.jsxs)("div",{className:eo,children:[(0,z.jsx)(to,{icon:(0,z.jsx)(n,{className:"w-4 h-4 text-[var(--slate-9)]"}),title:e.name,badge:a}),(0,z.jsxs)("div",{className:"flex flex-col gap-2 mt-2",children:[(0,z.jsx)(_r,{label:"Type",value:(0,z.jsx)("span",{className:"font-medium",children:e.type})}),(0,z.jsx)(_r,{label:"External Type",value:(0,z.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.external_type})})]}),e.sample_values&&e.sample_values.length>0&&(0,z.jsx)(Rr,{title:"Sample Values",items:o,totalCount:e.sample_values.length})]})},mk=e=>{let n=(0,z.jsx)(Bn,{variant:"outline",className:"text-xs bg-[var(--blue-4)] text-[var(--blue-11)]",children:e.dialect}),a=e.schemas.map(o=>(0,z.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,z.jsx)(Ui,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,z.jsx)("span",{children:o.name})]}),(0,z.jsxs)(Bn,{variant:"outline",className:"text-xs",children:[o.tables.length," ",pg.pluralize(o.tables.length)]})]},o.name));return(0,z.jsxs)("div",{className:eo,children:[(0,z.jsx)(to,{icon:(0,z.jsx)(rs,{className:"w-4 h-4 text-[var(--blue-9)]"}),title:e.name,badge:n}),(0,z.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,z.jsx)(_r,{label:"Dialect",value:(0,z.jsx)("span",{className:"font-medium",children:e.dialect})}),e.engine&&(0,z.jsx)(_r,{label:"Engine",value:(0,z.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(0,z.jsx)("div",{className:"py-2",children:(0,z.jsx)(ri,{icon:(0,z.jsx)(Ui,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.schemas.length} schema${e.schemas.length===1?"":"s"}`})}),e.schemas.length===0&&ql("schema"),e.schemas.length>0&&(0,z.jsx)(Rr,{title:"Schemas",items:a,totalCount:e.schemas.length})]})},gk=e=>{let n=(0,z.jsx)(Bn,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:"Schema"}),a=e.tables.map(o=>(0,z.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,z.jsxs)("div",{className:"flex items-center gap-2",children:[o.type==="view"?(0,z.jsx)(ed,{className:"w-3 h-3 text-[var(--blue-9)]"}):(0,z.jsx)(Hi,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,z.jsx)("span",{children:o.name})]}),(0,z.jsx)(Bn,{variant:"outline",className:`text-xs ${o.type==="view"?"bg-[var(--blue-4)] text-[var(--blue-11)]":"bg-[var(--green-4)] text-[var(--green-11)]"}`,children:o.type})]},o.name));return(0,z.jsxs)("div",{className:eo,children:[(0,z.jsx)(to,{icon:(0,z.jsx)(Ui,{className:"w-4 h-4 text-[var(--green-9)]"}),title:e.name,badge:n}),(0,z.jsx)("div",{className:"py-2",children:(0,z.jsx)(ri,{icon:(0,z.jsx)(Hi,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.tables.length} table${e.tables.length===1?"":"s"}`})}),e.tables.length===0&&ql("table"),e.tables.length>0&&(0,z.jsx)(Rr,{title:"Tables",items:a,totalCount:e.tables.length})]})};var mg=(0,z.jsx)(Bn,{variant:"outline",children:"default"}),yk=8,gg=3;let ql;Bw=(e,n)=>{let a=e.databases.length,o=e.databases.reduce((g,b)=>g+b.schemas.length,0),s=(g,b)=>{if(g.tables.length===0)return null;let _=g.name===e.default_schema&&b,S=[];return o<yk&&(S=g.tables.slice(0,gg+1).map(C=>(0,z.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,z.jsx)(Hi,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,z.jsx)("span",{className:"text-xs",children:C.name})]},C.name))),(0,z.jsxs)("div",{children:[(0,z.jsxs)("div",{className:"flex items-center gap-2 text-xs rounded hover:bg-[var(--slate-3)] ml-2",children:[(0,z.jsx)(Ui,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,z.jsx)("span",{children:g.name}),_&&mg,(0,z.jsxs)(Bn,{variant:"outline",className:"text-xs ml-auto",children:[g.tables.length," tables"]})]}),(0,z.jsx)(Rr,{items:S,totalCount:g.tables.length,limit:gg})]},g.name)},c=e.databases.map(g=>{let b=g.name===e.default_database||e.databases.length===1,_=g.schemas.map(S=>s(S,b));return(0,z.jsxs)("div",{children:[(0,z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,z.jsx)(rs,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,z.jsx)("span",{className:"text-xs",children:g.name}),b&&mg]}),_&&(0,z.jsx)(Rr,{items:_,totalCount:g.schemas.length})]},g.name)}),h=e.name;Fi.has(e.name)&&(h="In-Memory");let p=n==null?void 0:n.map(g=>(0,z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,z.jsx)(Hi,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,z.jsx)("span",{className:"text-xs",children:g.name})]},g.name));return(0,z.jsxs)("div",{className:`${eo} px-1`,children:[(0,z.jsx)(to,{icon:(0,z.jsx)(rg,{className:"w-4 h-4 text-[var(--purple-9)]"}),title:h}),(0,z.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,z.jsx)(_r,{label:"Dialect",value:(0,z.jsx)("span",{className:"font-medium",children:kl(e.dialect)})}),(0,z.jsx)(_r,{label:"Source",value:(0,z.jsx)(Bn,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:e.source})})]}),(0,z.jsxs)("div",{className:"flex flex-row justify-between py-2",children:[(0,z.jsx)(ri,{icon:(0,z.jsx)(rs,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${a} ${hg.pluralize(a)}`}),(0,z.jsx)(ri,{icon:(0,z.jsx)(Ui,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${o} ${fg.pluralize(o)}`})]}),a>0&&(0,z.jsx)(Rr,{items:c,totalCount:a}),p&&p.length>0&&(0,z.jsx)(Rr,{title:"Dataframes",items:p,totalCount:p.length})]})},ql=e=>(0,z.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,z.jsx)(ad,{size:10,className:"mt-1 text-[var(--slate-10)] shrink-0"}),(0,z.jsxs)("span",{className:"text-xs text-[var(--slate-11)]",children:["No ",e," information available.",`
34
- `,(0,z.jsx)("span",{className:"text-[var(--blue-10)]",children:"Introspect to see more details."})]})]});var Bl=Ru(),yg=class{constructor(){ve(this,"schema",{})}addTable(e,n){let a={self:bk({table:n}),children:n.columns.map(o=>vk({column:o}))};return this.setAt([...e,n.name],a),this}addSchema(e,n){let a={self:wk({namespace:n,path:e}),children:{}};return this.setAt(e,a),this}addDatabase(e,n){let a={self:_k({namespace:n,path:e}),children:{}};return this.setAt(e,a),this}setAt(e,n){let a=this.schema;for(let o of e.slice(0,-1))a[o]||(a[o]={children:{}}),a=a[o].children;a[e[e.length-1]]=n}build(){return this.schema}reset(){return this.schema={},this}};function vk(e){return{label:e.column.name,type:"column",info:()=>{let n=document.createElement("div");return(0,Bl.createRoot)(n).render(hk(e.column)),{dom:n}}}}function bk(e){return{label:e.table.name,type:"table",info:()=>{let n=document.createElement("div");return(0,Bl.createRoot)(n).render(pk(e.table)),{dom:n}}}}function wk(e){return{label:e.namespace.name,detail:e.path.join("."),type:"schema",info:()=>{let n=document.createElement("div");return(0,Bl.createRoot)(n).render(gk(e.namespace)),{dom:n}}}}function _k(e){return{label:e.namespace.name,detail:e.path.join("."),type:"database",info:()=>{let n=document.createElement("div");return(0,Bl.createRoot)(n).render(mk(e.namespace)),{dom:n}}}}var xk=Ce(e=>{let n=e(cd),a=new yg;for(let o of n)a.addTable([],o);return a.build()}),kk=class{constructor(){this.cache=new zl(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return Fe.get(Yu).get(e)}getConnectionSchema(e){var h;let{default_database:n,databases:a,default_schema:o}=e,s=new yg,c=a.find(p=>p.name===n||a.length===1);if(((h=c??a[0])==null?void 0:h.schemas.some(p=>_l(p.name)))??!1){for(let p of a){let g=p.name===(c==null?void 0:c.name),b=p.schemas.flatMap(_=>_.tables);s.addDatabase([p.name],p);for(let _ of b)g?s.addTable([],_):s.addTable([p.name],_)}return{shouldAddLocalTables:!1,schema:s.build(),defaultSchema:c==null?void 0:c.name}}if(c)for(let p of c.schemas){s.addSchema([p.name],p);for(let g of p.tables)s.addTable([p.name],g)}for(let p of a){s.addDatabase([p.name],p);for(let g of p.schemas){s.addSchema([p.name,g.name],g);for(let b of g.tables)s.addTable([p.name,g.name],b)}}return{shouldAddLocalTables:!0,schema:s.build(),defaultSchema:o??void 0}}getInternalDialect(e){let n=this.getConnection(e);return n?n.dialect.toLowerCase():null}getDialect(e){let n=this.getConnection(e);return n?eg(n):ss}getCompletionSource(e){let n=this.getConnection(e);if(!n)return null;let a=()=>Fe.get(xk),o=this.cache.getOrCreate(n);return{dialect:eg(n),schema:o.shouldAddLocalTables?{...o.schema,...a()}:o.schema,defaultSchema:o.defaultSchema,defaultTable:Sk(n)}}};function Sk(e){if(e.databases.length!==1)return;let n=e.databases[0];if(n.schemas.length!==1)return;let a=n.schemas[0];if(a.tables.length===1)return a.tables[0].name}const ai=new kk,us=aa.define();Au=async function(e){let{sendFormat:n}=oa(),a=Ar.mapValues(e,s=>nr(s)),o=await n({codes:a,lineLength:R2().formatting.line_length});for(let[s,c]of Ar.entries(o.codes)){let h=s,p=a[h],g=e[h];g&&c!==p&&(g.state.facet(ct).updateCellCode({cellId:h,code:c,formattingChange:!0}),Ki(g,c))}},K_=function(){return Au(tk(Wi()))};async function Ck(e,n){let{formatDialect:a}=await re(async()=>{let{formatDialect:S}=await import("./esm-C9WujutX.js").then(async C=>(await C.__tla,C));return{formatDialect:S}},__vite__mapDeps([0,1]),import.meta.url),o=await Ek(ai.getInternalDialect(n)),s=e.state.field(rr),c=v5(e.state);if(s.type!=="sql"){be.error("Language adapter is not SQL");return}let h=e.state.doc.toString(),p;try{p=a(h,{dialect:o,tabWidth:c,useTabs:!1})}catch(S){be.error("Error formatting SQL",{error:S});return}let g=s.transformIn(p)[0],b=e.state.facet(ct),_=e.state.facet(Dl);b.updateCellCode({cellId:_,code:g,formattingChange:!0}),Hu(e,p,{effects:[us.of(!0)]})}async function Ek(e){let{bigquery:n,db2:a,db2i:o,duckdb:s,hive:c,mariadb:h,mysql:p,tidb:g,n1ql:b,plsql:_,postgresql:S,redshift:C,spark:E,sqlite:O,sql:M,trino:V,transactsql:H,singlestoredb:$,snowflake:N}=await re(async()=>{let{bigquery:fe,db2:R,db2i:j,duckdb:F,hive:se,mariadb:ce,mysql:he,tidb:ye,n1ql:xe,plsql:Qe,postgresql:pe,redshift:ie,spark:ee,sqlite:U,sql:Ae,trino:Ve,transactsql:nt,singlestoredb:He,snowflake:ze}=await import("./esm-C9WujutX.js").then(async Le=>(await Le.__tla,Le));return{bigquery:fe,db2:R,db2i:j,duckdb:F,hive:se,mariadb:ce,mysql:he,tidb:ye,n1ql:xe,plsql:Qe,postgresql:pe,redshift:ie,spark:ee,sqlite:U,sql:Ae,trino:Ve,transactsql:nt,singlestoredb:He,snowflake:ze}},__vite__mapDeps([0,1]),import.meta.url),ne=M;if(!e||!jl(e))return ne;switch(e){case"mysql":return p;case"mariadb":return h;case"postgres":case"postgresql":return S;case"sqlite":return O;case"db2":return a;case"db2i":return o;case"hive":return c;case"redshift":return C;case"snowflake":return N;case"trino":return V;case"tidb":return g;case"oracle":case"oracledb":return _;case"spark":return E;case"singlestoredb":return $;case"couchbase":return b;case"bigquery":return n;case"duckdb":return s;case"mssql":case"sqlserver":case"microsoft sql server":return H;case"athena":case"awsathena":case"cassandra":case"noql":case"flink":case"mongodb":case"timescaledb":case"datafusion":return M;case"databricks":return E;default:return Xo(e),ne}}var Tk=Ru();function Lk(e,n){let a=document.createElement("div"),o;return{dom:a,mount(){o=(0,Tk.createRoot)(a),o.render((0,z.jsx)(S2,{store:Fe,children:(0,z.jsx)(n,{view:e})}))},update(){o==null||o.render((0,z.jsx)(S2,{store:Fe,children:(0,z.jsx)(n,{view:e})}))},destroy(){o==null||o.unmount()}}}function de(e){return new $2(V2.define(e))}function ma(e){return re(()=>import("./dist-CdZb2Grj.js").then(async n=>(await n.__tla,n)),__vite__mapDeps([2,3,4,5]),import.meta.url).then(n=>n.sql({dialect:n[e]}))}var Ok=[te.of({name:"C",extensions:["c","h","ino"],load(){return re(()=>import("./dist-OAWl1fS6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),te.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return re(()=>import("./dist-OAWl1fS6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),te.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return ma("Cassandra")}}),te.of({name:"CSS",extensions:["css"],load(){return re(()=>import("./dist-CRVvx8nD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([8,9,5]),import.meta.url).then(e=>e.css())}}),te.of({name:"Go",extensions:["go"],load(){return re(()=>import("./dist-BkKLXyVM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([10,11,4,5]),import.meta.url).then(e=>e.go())}}),te.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return re(()=>import("./dist-CtKltiBh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([12,9,5,13,14,4]),import.meta.url).then(e=>e.html())}}),te.of({name:"Java",extensions:["java"],load(){return re(()=>import("./dist-BRjtiDLy.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([15,16,5]),import.meta.url).then(e=>e.java())}}),te.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return re(()=>import("./dist-DwtQnQ8D.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript())}}),te.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return re(()=>import("./dist-Dz7aLgyk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([18,9,5,13,14,4,19]),import.meta.url).then(e=>e.jinja())}}),te.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return re(()=>import("./dist-C0GaLmeM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([20,21,5]),import.meta.url).then(e=>e.json())}}),te.of({name:"JSX",extensions:["jsx"],load(){return re(()=>import("./dist-DwtQnQ8D.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({jsx:!0}))}}),te.of({name:"LESS",extensions:["less"],load(){return re(()=>import("./dist-Bw5sFnNi.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([22,9,5,23]),import.meta.url).then(e=>e.less())}}),te.of({name:"Liquid",extensions:["liquid"],load(){return re(()=>import("./dist-D1GHSZQ_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([24,9,5,13,14,4,25]),import.meta.url).then(e=>e.liquid())}}),te.of({name:"MariaDB SQL",load(){return ma("MariaSQL")}}),te.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return re(()=>import("./dist-CqnPIH_S.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([26,9,5,13,14,4,27]),import.meta.url).then(e=>e.markdown())}}),te.of({name:"MS SQL",load(){return ma("MSSQL")}}),te.of({name:"MySQL",load(){return ma("MySQL")}}),te.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return re(()=>import("./dist-BveopvhJ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([28,9,5,13,14,4,29]),import.meta.url).then(e=>e.php())}}),te.of({name:"PLSQL",extensions:["pls"],load(){return ma("PLSQL")}}),te.of({name:"PostgreSQL",load(){return ma("PostgreSQL")}}),te.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return re(()=>import("./dist-gm5AeuIM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([30,31,4,5]),import.meta.url).then(e=>e.python())}}),te.of({name:"Rust",extensions:["rs"],load(){return re(()=>import("./dist-DZhm7iRc.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([32,33,5]),import.meta.url).then(e=>e.rust())}}),te.of({name:"Sass",extensions:["sass"],load(){return re(()=>import("./dist-DiZV-TgQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass({indented:!0}))}}),te.of({name:"SCSS",extensions:["scss"],load(){return re(()=>import("./dist-DiZV-TgQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass())}}),te.of({name:"SQL",extensions:["sql"],load(){return ma("StandardSQL")}}),te.of({name:"SQLite",load(){return ma("SQLite")}}),te.of({name:"TSX",extensions:["tsx"],load(){return re(()=>import("./dist-DwtQnQ8D.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),te.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return re(()=>import("./dist-DwtQnQ8D.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({typescript:!0}))}}),te.of({name:"WebAssembly",extensions:["wat","wast"],load(){return re(()=>import("./dist-x2aGlNO5.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([36,37,5]),import.meta.url).then(e=>e.wast())}}),te.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return re(()=>import("./dist-BmupR6hJ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([38,39,5]),import.meta.url).then(e=>e.xml())}}),te.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return re(()=>import("./dist-DUYSgv8L.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([40,41,5]),import.meta.url).then(e=>e.yaml())}}),te.of({name:"APL",extensions:["dyalog","apl"],load(){return re(()=>import("./apl-3xKEEmjQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([42,43]),import.meta.url).then(e=>de(e.apl))}}),te.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return re(()=>import("./asciiarmor-BCugLX69.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([44,45]),import.meta.url).then(e=>de(e.asciiArmor))}}),te.of({name:"ASN.1",extensions:["asn","asn1"],load(){return re(()=>import("./asn1-B8ndG_Ze.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([46,47]),import.meta.url).then(e=>de(e.asn1({})))}}),te.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return re(()=>import("./asterisk-DmqsRS7E.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.asterisk))}}),te.of({name:"Brainfuck",extensions:["b","bf"],load(){return re(()=>import("./brainfuck-h1OIoSEo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([48,49]),import.meta.url).then(e=>de(e.brainfuck))}}),te.of({name:"Cobol",extensions:["cob","cpy"],load(){return re(()=>import("./cobol-C5qkyUSJ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>de(e.cobol))}}),te.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return re(()=>import("./clike-DPuzjNcL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>de(e.csharp))}}),te.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return re(()=>import("./clojure-yGQavt_D.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>de(e.clojure))}}),te.of({name:"ClojureScript",extensions:["cljs"],load(){return re(()=>import("./clojure-yGQavt_D.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>de(e.clojure))}}),te.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return re(()=>import("./css-COQFxLQn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([56,57]),import.meta.url).then(e=>de(e.gss))}}),te.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return re(()=>import("./cmake-yLKyOybp.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([58,59]),import.meta.url).then(e=>de(e.cmake))}}),te.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return re(()=>import("./coffeescript-CtR3eWCa.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([60,61]),import.meta.url).then(e=>de(e.coffeeScript))}}),te.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return re(()=>import("./commonlisp-D-heOGa1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([62,63]),import.meta.url).then(e=>de(e.commonLisp))}}),te.of({name:"Cypher",extensions:["cyp","cypher"],load(){return re(()=>import("./cypher-whf3KLcn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([64,65]),import.meta.url).then(e=>de(e.cypher))}}),te.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return re(()=>import("./python-jVWqyNLt.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([66,67]),import.meta.url).then(e=>de(e.cython))}}),te.of({name:"Crystal",extensions:["cr"],load(){return re(()=>import("./crystal-PRx3aORZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([68,69]),import.meta.url).then(e=>de(e.crystal))}}),te.of({name:"D",extensions:["d"],load(){return re(()=>import("./d-Rxavm_nZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([70,71]),import.meta.url).then(e=>de(e.d))}}),te.of({name:"Dart",extensions:["dart"],load(){return re(()=>import("./clike-DPuzjNcL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>de(e.dart))}}),te.of({name:"diff",extensions:["diff","patch"],load(){return re(()=>import("./diff-BuBMfzxS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([72,73]),import.meta.url).then(e=>de(e.diff))}}),te.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return re(()=>import("./dockerfile-DGts-2Fo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([74,75]),import.meta.url).then(e=>de(e.dockerFile))}}),te.of({name:"DTD",extensions:["dtd"],load(){return re(()=>import("./dtd-Byyl3ADK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([76,77]),import.meta.url).then(e=>de(e.dtd))}}),te.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return re(()=>import("./dylan-zE-fWZ95.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([78,79]),import.meta.url).then(e=>de(e.dylan))}}),te.of({name:"EBNF",load(){return re(()=>import("./ebnf-dezZofVm.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.ebnf))}}),te.of({name:"ECL",extensions:["ecl"],load(){return re(()=>import("./ecl-oGqPqdsN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([80,81]),import.meta.url).then(e=>de(e.ecl))}}),te.of({name:"edn",extensions:["edn"],load(){return re(()=>import("./clojure-yGQavt_D.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>de(e.clojure))}}),te.of({name:"Eiffel",extensions:["e"],load(){return re(()=>import("./eiffel-C_tzASKk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([82,83]),import.meta.url).then(e=>de(e.eiffel))}}),te.of({name:"Elm",extensions:["elm"],load(){return re(()=>import("./elm-DowGsQrq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([84,85]),import.meta.url).then(e=>de(e.elm))}}),te.of({name:"Erlang",extensions:["erl"],load(){return re(()=>import("./erlang-DXj5Mety.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([86,87]),import.meta.url).then(e=>de(e.erlang))}}),te.of({name:"Esper",load(){return re(()=>import("./sql-DzyjqiRG.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.esper))}}),te.of({name:"Factor",extensions:["factor"],load(){return re(()=>import("./factor-BBRGvEpt.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([88,89,75]),import.meta.url).then(e=>de(e.factor))}}),te.of({name:"FCL",load(){return re(()=>import("./fcl-D566gDVV.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.fcl))}}),te.of({name:"Forth",extensions:["forth","fth","4th"],load(){return re(()=>import("./forth-ir5Q2myN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([90,91]),import.meta.url).then(e=>de(e.forth))}}),te.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return re(()=>import("./fortran-Ckvuc18T.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>de(e.fortran))}}),te.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return re(()=>import("./mllike-Cdk-SxrR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>de(e.fSharp))}}),te.of({name:"Gas",extensions:["s"],load(){return re(()=>import("./gas-IcbZgopn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([96,97]),import.meta.url).then(e=>de(e.gas))}}),te.of({name:"Gherkin",extensions:["feature"],load(){return re(()=>import("./gherkin-BUQFbyhq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([98,99]),import.meta.url).then(e=>de(e.gherkin))}}),te.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return re(()=>import("./groovy-CPRpPrR6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([100,101]),import.meta.url).then(e=>de(e.groovy))}}),te.of({name:"Haskell",extensions:["hs"],load(){return re(()=>import("./haskell-BZ64_L1W.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([102,103]),import.meta.url).then(e=>de(e.haskell))}}),te.of({name:"Haxe",extensions:["hx"],load(){return re(()=>import("./haxe-u0gVVSGf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>de(e.haxe))}}),te.of({name:"HXML",extensions:["hxml"],load(){return re(()=>import("./haxe-u0gVVSGf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>de(e.hxml))}}),te.of({name:"HTTP",load(){return re(()=>import("./http-Ms617AZI.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.http))}}),te.of({name:"IDL",extensions:["pro"],load(){return re(()=>import("./idl-D6vrTcdT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([106,107]),import.meta.url).then(e=>de(e.idl))}}),te.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return re(()=>import("./javascript-DtGa6W6u.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([108,109]),import.meta.url).then(e=>de(e.jsonld))}}),te.of({name:"Julia",extensions:["jl"],load(){return re(()=>import("./julia-ChDcWdzF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([110,111]),import.meta.url).then(e=>de(e.julia))}}),te.of({name:"Kotlin",extensions:["kt","kts"],load(){return re(()=>import("./clike-DPuzjNcL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>de(e.kotlin))}}),te.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return re(()=>import("./livescript-D3x57DP6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([112,113]),import.meta.url).then(e=>de(e.liveScript))}}),te.of({name:"Lua",extensions:["lua"],load(){return re(()=>import("./lua-CfeyF-5c.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([114,115]),import.meta.url).then(e=>de(e.lua))}}),te.of({name:"mIRC",extensions:["mrc"],load(){return re(()=>import("./mirc-B8ay9N_G.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([116,117]),import.meta.url).then(e=>de(e.mirc))}}),te.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return re(()=>import("./mathematica-CAUFFTVp.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([118,119]),import.meta.url).then(e=>de(e.mathematica))}}),te.of({name:"Modelica",extensions:["mo"],load(){return re(()=>import("./modelica-cErGJ40J.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([120,121]),import.meta.url).then(e=>de(e.modelica))}}),te.of({name:"MUMPS",extensions:["mps"],load(){return re(()=>import("./mumps-CPuZtknR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([122,123]),import.meta.url).then(e=>de(e.mumps))}}),te.of({name:"Mbox",extensions:["mbox"],load(){return re(()=>import("./mbox-Duq1SQ_k.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([124,125]),import.meta.url).then(e=>de(e.mbox))}}),te.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return re(()=>import("./nginx-CNtYBWy9.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.nginx))}}),te.of({name:"NSIS",extensions:["nsh","nsi"],load(){return re(()=>import("./nsis-ggFWkoqT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([126,127,75]),import.meta.url).then(e=>de(e.nsis))}}),te.of({name:"NTriples",extensions:["nt","nq"],load(){return re(()=>import("./ntriples-eQBrW6tI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([128,129]),import.meta.url).then(e=>de(e.ntriples))}}),te.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return re(()=>import("./clike-DPuzjNcL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>de(e.objectiveC))}}),te.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return re(()=>import("./clike-DPuzjNcL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>de(e.objectiveCpp))}}),te.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return re(()=>import("./mllike-Cdk-SxrR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>de(e.oCaml))}}),te.of({name:"Octave",extensions:["m"],load(){return re(()=>import("./octave-CcpumlkH.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([130,131]),import.meta.url).then(e=>de(e.octave))}}),te.of({name:"Oz",extensions:["oz"],load(){return re(()=>import("./oz-D3u6XBI4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([132,133]),import.meta.url).then(e=>de(e.oz))}}),te.of({name:"Pascal",extensions:["p","pas"],load(){return re(()=>import("./pascal-COvFIqNx.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([134,135]),import.meta.url).then(e=>de(e.pascal))}}),te.of({name:"Perl",extensions:["pl","pm"],load(){return re(()=>import("./perl-BSxTN_bc.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([136,137]),import.meta.url).then(e=>de(e.perl))}}),te.of({name:"Pig",extensions:["pig"],load(){return re(()=>import("./pig-B5SEJPfW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([138,139]),import.meta.url).then(e=>de(e.pig))}}),te.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return re(()=>import("./powershell-T0AiDBtK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([140,141]),import.meta.url).then(e=>de(e.powerShell))}}),te.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return re(()=>import("./properties-CEyxcWzr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([142,143]),import.meta.url).then(e=>de(e.properties))}}),te.of({name:"ProtoBuf",extensions:["proto"],load(){return re(()=>import("./protobuf-BgP8VdyX.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([144,145]),import.meta.url).then(e=>de(e.protobuf))}}),te.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return re(()=>import("./pug-D1MIs29p.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([146,147,109]),import.meta.url).then(e=>de(e.pug))}}),te.of({name:"Puppet",extensions:["pp"],load(){return re(()=>import("./puppet-DQ0s94I4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([148,149]),import.meta.url).then(e=>de(e.puppet))}}),te.of({name:"Q",extensions:["q"],load(){return re(()=>import("./q-Ddp_9iFq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([150,151]),import.meta.url).then(e=>de(e.q))}}),te.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return re(()=>import("./r-WnM9HAaQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([152,153]),import.meta.url).then(e=>de(e.r))}}),te.of({name:"RPM Changes",load(){return re(()=>import("./rpm-Cpb0cYbF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>de(e.rpmChanges))}}),te.of({name:"RPM Spec",extensions:["spec"],load(){return re(()=>import("./rpm-Cpb0cYbF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>de(e.rpmSpec))}}),te.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return re(()=>import("./ruby-npoQJqOj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([156,157]),import.meta.url).then(e=>de(e.ruby))}}),te.of({name:"SAS",extensions:["sas"],load(){return re(()=>import("./sas-D5R_hCoQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([158,159]),import.meta.url).then(e=>de(e.sas))}}),te.of({name:"Scala",extensions:["scala"],load(){return re(()=>import("./clike-DPuzjNcL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>de(e.scala))}}),te.of({name:"Scheme",extensions:["scm","ss"],load(){return re(()=>import("./scheme-oK64G5wG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([160,161]),import.meta.url).then(e=>de(e.scheme))}}),te.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return re(()=>import("./shell-D-C8eGy_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([162,163]),import.meta.url).then(e=>de(e.shell))}}),te.of({name:"Sieve",extensions:["siv","sieve"],load(){return re(()=>import("./sieve-DPRpRdV2.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([164,165]),import.meta.url).then(e=>de(e.sieve))}}),te.of({name:"Smalltalk",extensions:["st"],load(){return re(()=>import("./smalltalk-bsl5ZJOd.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([166,167]),import.meta.url).then(e=>de(e.smalltalk))}}),te.of({name:"Solr",load(){return re(()=>import("./solr-DndbfGC6.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.solr))}}),te.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return re(()=>import("./mllike-Cdk-SxrR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>de(e.sml))}}),te.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return re(()=>import("./sparql-CJUH6gR2.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([168,169]),import.meta.url).then(e=>de(e.sparql))}}),te.of({name:"Spreadsheet",alias:["excel","formula"],load(){return re(()=>import("./spreadsheet-DHoeoJHd.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.spreadsheet))}}),te.of({name:"Squirrel",extensions:["nut"],load(){return re(()=>import("./clike-DPuzjNcL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>de(e.squirrel))}}),te.of({name:"Stylus",extensions:["styl"],load(){return re(()=>import("./stylus-Dz-M3k6z.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([170,171]),import.meta.url).then(e=>de(e.stylus))}}),te.of({name:"Swift",extensions:["swift"],load(){return re(()=>import("./swift-BZHzeogd.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([172,173]),import.meta.url).then(e=>de(e.swift))}}),te.of({name:"sTeX",load(){return re(()=>import("./stex-pjf-hOob.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>de(e.stex))}}),te.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return re(()=>import("./stex-pjf-hOob.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>de(e.stex))}}),te.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return re(()=>import("./verilog-DO_FdUQ9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>de(e.verilog))}}),te.of({name:"Tcl",extensions:["tcl"],load(){return re(()=>import("./tcl-CjjnKQKi.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([178,179]),import.meta.url).then(e=>de(e.tcl))}}),te.of({name:"Textile",extensions:["textile"],load(){return re(()=>import("./textile-C6DxVHfN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([180,181]),import.meta.url).then(e=>de(e.textile))}}),te.of({name:"TiddlyWiki",load(){return re(()=>import("./tiddlywiki-Laz7iVQn.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.tiddlyWiki))}}),te.of({name:"Tiki wiki",load(){return re(()=>import("./tiki-Dd2_LAYu.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.tiki))}}),te.of({name:"TOML",extensions:["toml"],load(){return re(()=>import("./toml-DTuUvOIE.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([182,183]),import.meta.url).then(e=>de(e.toml))}}),te.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return re(()=>import("./troff-yA83BgDZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([184,185]),import.meta.url).then(e=>de(e.troff))}}),te.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return re(()=>import("./ttcn-F0FnYTMB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([186,187]),import.meta.url).then(e=>de(e.ttcn))}}),te.of({name:"TTCN_CFG",extensions:["cfg"],load(){return re(()=>import("./ttcn-cfg-CSr0YVH7.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([188,189]),import.meta.url).then(e=>de(e.ttcnCfg))}}),te.of({name:"Turtle",extensions:["ttl"],load(){return re(()=>import("./turtle-DaAbI02L.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([190,191]),import.meta.url).then(e=>de(e.turtle))}}),te.of({name:"Web IDL",extensions:["webidl"],load(){return re(()=>import("./webidl-DUTo0zWa.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([192,193]),import.meta.url).then(e=>de(e.webIDL))}}),te.of({name:"VB.NET",extensions:["vb"],load(){return re(()=>import("./vb-BYziWQVS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([194,195]),import.meta.url).then(e=>de(e.vb))}}),te.of({name:"VBScript",extensions:["vbs"],load(){return re(()=>import("./vbscript-CP_qFLQN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([196,197]),import.meta.url).then(e=>de(e.vbScript))}}),te.of({name:"Velocity",extensions:["vtl"],load(){return re(()=>import("./velocity-etCBW8YB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([198,199]),import.meta.url).then(e=>de(e.velocity))}}),te.of({name:"Verilog",extensions:["v"],load(){return re(()=>import("./verilog-DO_FdUQ9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>de(e.verilog))}}),te.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return re(()=>import("./vhdl-CtT4O7WT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([200,201]),import.meta.url).then(e=>de(e.vhdl))}}),te.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return re(()=>import("./xquery-B0wH9AmB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([202,203]),import.meta.url).then(e=>de(e.xQuery))}}),te.of({name:"Yacas",extensions:["ys"],load(){return re(()=>import("./yacas-UtDKR_RQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([204,205]),import.meta.url).then(e=>de(e.yacas))}}),te.of({name:"Z80",extensions:["z80"],load(){return re(()=>import("./z80-gTLyuPxz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([206,207]),import.meta.url).then(e=>de(e.z80))}}),te.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return re(()=>import("./mscgen-jRCec7TG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>de(e.mscgen))}}),te.of({name:"X\xF9",extensions:["xu"],load(){return re(()=>import("./mscgen-jRCec7TG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>de(e.xu))}}),te.of({name:"MsGenny",extensions:["msgenny"],load(){return re(()=>import("./mscgen-jRCec7TG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>de(e.msgenny))}}),te.of({name:"Vue",extensions:["vue"],load(){return re(()=>import("./dist-CwLG6Za2.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([210,9,5,13,14,4,211]),import.meta.url).then(e=>e.vue())}}),te.of({name:"Angular Template",load(){return re(()=>import("./dist-CTarqYcj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([212,9,5,13,14,4]),import.meta.url).then(e=>e.angular())}})],vg=new WeakMap,Ak=/(\n|\r\n?|\u2028|\u2029)/g,Ik=/^\s*/,Rk=/\S/,Mk=Array.prototype.slice,Nd=48,bg=57,wg=97,Pk=102,_g=65,Nk=70;El=function(e){if(typeof e=="string")return Sg([e])[0];if(typeof e=="function")return function(){let o=Mk.call(arguments);return o[0]=kg(o[0]),e.apply(this,o)};let n=kg(e),a=xg(n,0);for(let o=1;o<n.length;o++)a+=arguments[o]+xg(n,o);return a};function xg(e,n){let a=e[n];if(a===void 0)throw TypeError(`invalid cooked string at index ${n}`);return a}function kg(e){let n=vg.get(e);if(n)return n;let a=Sg(e.raw),o=a.map(jk);return Object.defineProperty(o,"raw",{value:Object.freeze(a)}),Object.freeze(o),vg.set(e,o),o}function Sg(e){let n=e.map(s=>s.split(Ak)),a;for(let s=0;s<n.length;s++){let c=n[s],h=s===0,p=s+1===n.length;if(h){if(c.length===1||c[0].length>0)throw Error("invalid content on opening line");c[1]=""}if(p){if(c.length===1||Rk.test(c[c.length-1]))throw Error("invalid content on closing line");c[c.length-2]="",c[c.length-1]=""}for(let g=2;g<c.length;g+=2){let b=c[g],_=g+1===c.length&&!p,S=Ik.exec(b)[0];if(!_&&S.length===b.length){c[g]="";continue}a=Dk(S,a)}}let o=a?a.length:0;return n.map(s=>{let c=s[0];for(let h=1;h<s.length;h+=2){let p=s[h],g=s[h+1];c+=p+g.slice(o)}return c})}function Dk(e,n){if(n===void 0||e===n)return e;let a=0;for(let o=Math.min(e.length,n.length);a<o&&e[a]===n[a];a++);return e.slice(0,a)}function jk(e){let n="",a=0,o=0;for(;(o=e.indexOf("\\",o))>-1;){if(n+=e.slice(a,o),++o===e.length)return;let s=e[o++];switch(s){case"b":n+="\b";break;case"t":n+=" ";break;case"n":n+=`
33
+ """, engine=${o})`}return`_df = mo.sql(f'SELECT "${n}" FROM ${e.name} LIMIT 100')`},jw=function(e,n){if(n==="date"||n==="datetime"||n==="time"){if(e==="min")return"Earliest";if(e==="max")return"Latest"}return e};function lk(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:zT,createActions:qT,valueAtom:tg,useActions:ck}=yl(lk,{addDatasets:(e,n)=>{let{previewDatasetColumn:a}=oa();for(let p of n.tables)for(let g of p.columns){let b=`${p.name}:${g.name}`;e.expandedColumns.has(b)&&a({tableName:p.name,columnName:g.name,source:p.source,sourceType:p.source_type})}let o=e.tables;n.clear_channel&&(o=o.filter(p=>p.source!==n.clear_channel));let s=[...n.tables,...o],c=new Set,h=s.filter(p=>{let g=`${p.name}:${p.source}`;return c.has(g)?!1:(c.add(g),!0)}).sort((p,g)=>p.name.localeCompare(g.name));return{...e,tables:h}},filterDatasetsFromVariables:(e,n)=>{let a=new Set(n),o=e.tables.filter(s=>s.variable_name?a.has(s.variable_name):!0);return{...e,tables:o}},toggleTable:(e,n)=>{let a=new Set(e.expandedTables);return a.has(n)?a.delete(n):a.add(n),{...e,expandedTables:a}},toggleColumn:(e,n)=>{let a=`${n.table}:${n.column}`,o=new Set(e.expandedColumns);return o.has(a)?o.delete(a):o.add(a),{...e,expandedColumns:o}},closeAllColumns:e=>({...e,expandedColumns:new Set}),addColumnPreview:(e,n)=>{let a=`${n.table_name}:${n.column_name}`,o=new Map(e.columnsPreviews);return o.set(a,n),{...e,columnsPreviews:o}}});cw=()=>mn(tg),cd=Ce(e=>e(tg).tables),Mw=Ce(new Set),Qw=Ce(!1),F_=function(){return ck()};var uk=new Map([[ca,{name:ca,dialect:"duckdb",source:"duckdb",display_name:"DuckDB (In-Memory)",databases:[]}]]);function dk(){return{latestEngineSelected:ca,connectionsMap:uk}}let fk,pk;({reducer:fk,createActions:pk,valueAtom:$i,useActions:W_}=yl(dk,{addDataSourceConnection:(e,n)=>{if(n.connections.length===0)return e;let{latestEngineSelected:a,connectionsMap:o}=e,s=new Map(o);for(let c of n.connections)s.set(c.name,c);return{latestEngineSelected:a,connectionsMap:s}},filterDataSourcesFromVariables:(e,n)=>{let{latestEngineSelected:a,connectionsMap:o}=e,s=new Set(n),c=new Map([...o].filter(([h])=>Fi.has(h)?!0:s.has(h)));return{latestEngineSelected:c.has(a)?a:ca,connectionsMap:c}},clearDataSourceConnections:()=>({latestEngineSelected:ca,connectionsMap:new Map}),removeDataSourceConnection:(e,n)=>{let{latestEngineSelected:a,connectionsMap:o}=e,s=new Map(o);return s.delete(n),{latestEngineSelected:s.has(a)?a:ca,connectionsMap:s}},addTableList:(e,n)=>{let{tables:a,sqlTableContext:o}=n,{connectionsMap:s,latestEngineSelected:c}=e,h=o.engine,p=s.get(h);if(!p)return e;let g=new Map(s),b={...p,databases:p.databases.map(_=>_.name===o.database?{..._,schemas:_.schemas.map(S=>S.name===o.schema?{...S,tables:a}:S)}:_)};return g.set(h,b),{latestEngineSelected:c,connectionsMap:g}},addTable:(e,n)=>{let{table:a,sqlTableContext:o}=n,{connectionsMap:s,latestEngineSelected:c}=e,h=o.engine,p=a.name,g=s.get(h);if(!g)return e;let b=new Map(s),_={...g,databases:g.databases.map(S=>S.name===o.database?{...S,schemas:S.schemas.map(C=>{if(C.name!==o.schema)return C;let E=C.tables.length===0?[a]:C.tables.map(O=>O.name===p?a:O);return{...C,tables:E}})}:S)};return b.set(h,_),{latestEngineSelected:c,connectionsMap:b}}})),Xu=Ce(e=>e($i).connectionsMap);function ng(e){let n=Fe.get($i);n.connectionsMap.has(e)&&Fe.set($i,{...n,latestEngineSelected:e})}o_=Ce(e=>{let n=Fe.get(cd),a=e($i).connectionsMap,o=new Map;for(let s of n)o.set(s.name,s);for(let s of a.values())for(let c of s.databases){let h=c.name===s.default_database||s.databases.length===1;for(let p of c.schemas){let g=p.name===s.default_schema,b=_l(p.name);for(let _ of p.tables){let S;if(S=_.name,b){S=h?_.name:`${c.name}.${_.name}`,o.has(S)?be.warn(`Table name collision for ${S}. Skipping.`):o.set(S,_);continue}if(h&&g&&!o.has(S)){o.set(S,_);continue}if(S=`${p.name}.${_.name}`,h&&!o.has(S)){o.set(S,_);continue}S=`${c.name}.${p.name}.${_.name}`,o.has(S)?be.warn(`Table name collision for ${S}. Skipping.`):o.set(S,_)}}}return o}),j_=function(e){return e.variable_name?"dataframe":"table"};let zl,Id,rg,ag,ig,Rd,og;zl=class{constructor(e,n={}){ve(this,"cache",new Map);this.maxSize=e,this.options=n}getOrCreate(e){rn(this.options.create,"create function is required");let n=this.cache.get(e);if(n!==void 0)return n;let a=this.options.create(e);return this.cache.set(e,a),a}get(e){let n=this.cache.get(e);return n!==void 0&&(this.cache.delete(e),this.cache.set(e,n)),n}set(e,n){if(this.cache.has(e)&&this.cache.delete(e),this.cache.set(e,n),this.cache.size>this.maxSize){let a=this.cache.keys().next().value;a!==void 0&&this.cache.delete(a)}}keys(){return this.cache.keys()}values(){return this.cache.values()}entries(){return this.cache.entries()}delete(e){this.cache.delete(e)}},Lm=lt("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),Am=lt("book-marked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]),xm=lt("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),bm=lt("box",[["path",{d:"M21 8a2 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 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),qm=lt("braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]),Id=lt("calendar-clock",[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]),Tm=lt("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),ym=lt("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),Pm=lt("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),rg=lt("cog",[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]]),Om=lt("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),rs=lt("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),Zu=lt("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),Rm=lt("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),ag=lt("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"}]]),rd=lt("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),ig=lt("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"}]]),Ui=lt("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),_m=lt("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"}]]),Ph=lt("notebook-pen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.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:"pqwjuv"}]]),em=lt("paint-roller",[["rect",{width:"16",height:"6",x:"2",y:"2",rx:"2",key:"jcyz7m"}],["path",{d:"M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2",key:"1b9h7c"}],["rect",{width:"4",height:"6",x:"8",y:"16",rx:"1",key:"d6e7yl"}]]),fm=lt("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"}]]),Rd=lt("search-check",[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),og=lt("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"}]]),om=lt("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"}]]),Hi=lt("table-2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]),Kh=lt("text-search",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M10 12H3",key:"1ulcyk"}],["path",{d:"M10 19H3",key:"108z41"}],["circle",{cx:"17",cy:"15",r:"3",key:"1upz2a"}],["path",{d:"m21 19-1.9-1.9",key:"dwi7p8"}]]),Im=lt("variable",[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]),kl=function(e){switch(e){case"duckdb":return"DuckDB";case"motherduck":return"MotherDuck";case"sqlite":return"SQLite";case"postgres":case"postgresql":return"PostgreSQL";case"mysql":return"MySQL";case"mariadb":return"MariaDB";case"mssql":case"microsoft sql server":return"Microsoft SQL Server";case"oracle":return"Oracle";case"redshift":return"Amazon Redshift";case"snowflake":return"Snowflake";case"bigquery":return"Google BigQuery";case"clickhouse":return"ClickHouse";case"timeplus":return"Timeplus";case"databricks":return"Databricks";case"db2":return"IBM Db2";case"hive":return"Apache Hive";case"impala":return"Apache Impala";case"presto":return"Presto";case"trino":return"Trino";case"cockroachdb":return"CockroachDB";case"timescaledb":return"TimescaleDB";case"singlestore":return"SingleStore";case"cassandra":return"Apache Cassandra";case"mongodb":return"MongoDB";case"iceberg":return"Apache Iceberg";default:return e}};function sg(e){let[n,a]=e.split(" ");return a?`${kl(n)} ${a}`:kl(e)}$u={boolean:l5,date:c5,time:Pm,datetime:Id,temporal:Id,number:yh,string:u5,integer:yh,unknown:qm},hw=function(e){switch(e){case"boolean":return"bg-(--orange-4)";case"date":case"time":case"datetime":case"temporal":return"bg-(--grass-4) dark:bg-(--grass-5)";case"number":case"integer":return"bg-(--purple-4)";case"string":return"bg-(--blue-4)";case"unknown":return"bg-(--slate-4) dark:bg-(--slate-6)";default:return Xo(e),"bg-(--slate-4) dark:bg-(--slate-6)"}};let cs,z,lg,Md,cg,eo,ug,dg,fg,pg,hg,to,_r,ri,Rr,Pd;Qa=class{constructor(e,n){this.singular=e,this._plural=n}pluralize(e){return e===1?this.singular:this.plural}get plural(){return this._plural??`${this.singular}s`}},zw=class X_{constructor(n){this.words=n}static of(...n){return new X_(n.map(a=>typeof a=="string"?new Qa(a):a))}join(n,a){return this.words.map(o=>o.pluralize(a)).join(n)}},cs=Zn(),z=gh(v5(),1),lg=5,Md={boolean:"bg-[var(--orange-4)] text-[var(--orange-11)]",date:"bg-[var(--grass-4)] text-[var(--grass-11)]",time:"bg-[var(--grass-4)] text-[var(--grass-11)]",datetime:"bg-[var(--grass-4)] text-[var(--grass-11)]",number:"bg-[var(--purple-4)] text-[var(--purple-11)]",integer:"bg-[var(--purple-4)] text-[var(--purple-11)]",string:"bg-[var(--blue-4)] text-[var(--blue-11)]",unknown:"bg-[var(--slate-4)] text-[var(--slate-11)]"},cg={local:"bg-[var(--blue-4)] text-[var(--blue-11)]",duckdb:"bg-[var(--amber-4)] text-[var(--amber-11)]",connection:"bg-[var(--green-4)] text-[var(--green-11)]",catalog:"bg-[var(--purple-4)] text-[var(--purple-11)]"},eo="p-3 min-w-[250px] flex flex-col divide-y",ug=new Qa("column","columns"),dg=new Qa("row","rows"),fg=new Qa("schema","schemas"),pg=new Qa("table","tables"),hg=new Qa("database","databases"),to=e=>{let n=(0,cs.c)(6),{icon:a,title:o,badge:s}=e,c;n[0]===o?c=n[1]:(c=(0,z.jsx)("h3",{className:"font-semibold text-sm",children:o}),n[0]=o,n[1]=c);let h;return n[2]!==s||n[3]!==a||n[4]!==c?(h=(0,z.jsxs)("div",{className:"flex items-center gap-2 pb-2",children:[a,c,s]}),n[2]=s,n[3]=a,n[4]=c,n[5]=h):h=n[5],h},_r=e=>{let n=(0,cs.c)(5),{label:a,value:o}=e,s;n[0]===a?s=n[1]:(s=(0,z.jsxs)("span",{className:"text-[var(--slate-11)]",children:[a,":"]}),n[0]=a,n[1]=s);let c;return n[2]!==s||n[3]!==o?(c=(0,z.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[s,o]}),n[2]=s,n[3]=o,n[4]=c):c=n[4],c},ri=e=>{let n=(0,cs.c)(5),{icon:a,text:o}=e,s;n[0]===o?s=n[1]:(s=(0,z.jsx)("span",{className:"text-xs text-[var(--slate-11)]",children:o}),n[0]=o,n[1]=s);let c;return n[2]!==a||n[3]!==s?(c=(0,z.jsxs)("div",{className:"flex items-center gap-1",children:[a,s]}),n[2]=a,n[3]=s,n[4]=c):c=n[4],c},Rr=e=>{let n=(0,cs.c)(15),{title:a,items:o,totalCount:s,limit:c}=e,h=a===void 0?"":a,p=c===void 0?lg:c;if(o.length===0)return null;let g;n[0]!==o||n[1]!==p?(g=o.slice(0,p),n[0]=o,n[1]=p,n[2]=g):g=n[2];let b=g,_=s>p,S;n[3]===h?S=n[4]:(S=h&&(0,z.jsxs)("h4",{className:"text-xs font-medium text-[var(--slate-11)] mb-2",children:[h,":"]}),n[3]=h,n[4]=S);let C;n[5]!==_||n[6]!==p||n[7]!==s?(C=_&&(0,z.jsxs)("div",{className:"text-xs text-[var(--slate-10)] text-center py-1",children:["... and ",s-p," more"]}),n[5]=_,n[6]=p,n[7]=s,n[8]=C):C=n[8];let E;n[9]!==C||n[10]!==b?(E=(0,z.jsxs)("div",{className:"flex flex-col gap-1 overflow-y-auto",children:[b,C]}),n[9]=C,n[10]=b,n[11]=E):E=n[11];let O;return n[12]!==S||n[13]!==E?(O=(0,z.jsxs)("div",{className:"py-2",children:[S,E]}),n[12]=S,n[13]=E,n[14]=O):O=n[14],O},Pd=e=>Md[e]||Md.unknown;const hk=e=>{var h,p;let n=e.type==="view"?(0,z.jsx)(Zu,{className:"w-4 h-4 text-[var(--blue-9)]"}):(0,z.jsx)(Hi,{className:"w-4 h-4 text-[var(--green-9)]"}),a=(0,z.jsx)(Bn,{variant:"secondary",className:`text-xs ${e.type==="view"?"bg-[var(--blue-4)] text-[var(--blue-11)]":"bg-[var(--green-4)] text-[var(--green-11)]"}`,children:e.type}),o=e.columns.map(g=>{let b=$u[g.type];return(0,z.jsxs)("div",{className:"flex items-center justify-between text-xs rounded",children:[(0,z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,z.jsx)(b,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,z.jsx)("span",{className:"font-mono",children:g.name})]}),(0,z.jsx)(Bn,{variant:"outline",className:`text-xs ${Pd(g.type)}`,children:g.type})]},g.name)}),s=e.primary_keys&&e.primary_keys.length>0,c=e.indexes&&e.indexes.length>0;return(0,z.jsxs)("div",{className:`${eo} min-w-[300px]`,children:[(0,z.jsx)(to,{icon:n,title:e.name,badge:a}),(0,z.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,z.jsx)(_r,{label:"Source",value:(0,z.jsx)(Bn,{variant:"outline",className:`text-xs ${cg[e.source_type]}`,children:e.source})}),e.variable_name&&(0,z.jsx)(_r,{label:"Variable",value:(0,z.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.variable_name})}),e.engine&&(0,z.jsx)(_r,{label:"Engine",value:(0,z.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(e.num_columns!=null||e.num_rows!=null)&&(0,z.jsxs)("div",{className:"grid grid-cols-2 gap-2 py-2",children:[e.num_columns!=null&&(0,z.jsx)(ri,{icon:(0,z.jsx)(Om,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_columns} ${ug.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,z.jsx)(ri,{icon:(0,z.jsx)(yh,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_rows} ${dg.pluralize(e.num_rows)}`})]}),e.columns.length===0&&ql("column"),(s||c)&&(0,z.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[s&&(0,z.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,z.jsxs)("div",{className:"flex items-center gap-1",children:[(0,z.jsx)(vT,{className:"w-3 h-3 text-[var(--amber-9)]"}),(0,z.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Primary Keys:"})]}),(h=e.primary_keys)==null?void 0:h.map(g=>(0,z.jsx)(Bn,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:g},g))]}),c&&(0,z.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,z.jsxs)("div",{className:"flex items-center gap-1 mb-1",children:[(0,z.jsx)(Am,{className:"w-3 h-3 text-[var(--purple-9)]"}),(0,z.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Indexes:"})]}),(p=e.indexes)==null?void 0:p.map(g=>(0,z.jsx)(Bn,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:g},g))]})]}),e.columns.length>0&&(0,z.jsx)(Rr,{items:o,totalCount:e.columns.length})]})},mk=e=>{var s;let n=$u[e.type],a=(0,z.jsx)(Bn,{variant:"outline",className:`text-xs ${Pd(e.type)}`,children:e.type}),o=((s=e.sample_values)==null?void 0:s.map((c,h)=>(0,z.jsx)("div",{className:"text-xs bg-[var(--slate-3)] rounded font-mono",children:c==null?"null":String(c)},h)))||[];return(0,z.jsxs)("div",{className:eo,children:[(0,z.jsx)(to,{icon:(0,z.jsx)(n,{className:"w-4 h-4 text-[var(--slate-9)]"}),title:e.name,badge:a}),(0,z.jsxs)("div",{className:"flex flex-col gap-2 mt-2",children:[(0,z.jsx)(_r,{label:"Type",value:(0,z.jsx)("span",{className:"font-medium",children:e.type})}),(0,z.jsx)(_r,{label:"External Type",value:(0,z.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.external_type})})]}),e.sample_values&&e.sample_values.length>0&&(0,z.jsx)(Rr,{title:"Sample Values",items:o,totalCount:e.sample_values.length})]})},gk=e=>{let n=(0,z.jsx)(Bn,{variant:"outline",className:"text-xs bg-[var(--blue-4)] text-[var(--blue-11)]",children:e.dialect}),a=e.schemas.map(o=>(0,z.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,z.jsx)(Ui,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,z.jsx)("span",{children:o.name})]}),(0,z.jsxs)(Bn,{variant:"outline",className:"text-xs",children:[o.tables.length," ",pg.pluralize(o.tables.length)]})]},o.name));return(0,z.jsxs)("div",{className:eo,children:[(0,z.jsx)(to,{icon:(0,z.jsx)(rs,{className:"w-4 h-4 text-[var(--blue-9)]"}),title:e.name,badge:n}),(0,z.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,z.jsx)(_r,{label:"Dialect",value:(0,z.jsx)("span",{className:"font-medium",children:e.dialect})}),e.engine&&(0,z.jsx)(_r,{label:"Engine",value:(0,z.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(0,z.jsx)("div",{className:"py-2",children:(0,z.jsx)(ri,{icon:(0,z.jsx)(Ui,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.schemas.length} schema${e.schemas.length===1?"":"s"}`})}),e.schemas.length===0&&ql("schema"),e.schemas.length>0&&(0,z.jsx)(Rr,{title:"Schemas",items:a,totalCount:e.schemas.length})]})},yk=e=>{let n=(0,z.jsx)(Bn,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:"Schema"}),a=e.tables.map(o=>(0,z.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,z.jsxs)("div",{className:"flex items-center gap-2",children:[o.type==="view"?(0,z.jsx)(Zu,{className:"w-3 h-3 text-[var(--blue-9)]"}):(0,z.jsx)(Hi,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,z.jsx)("span",{children:o.name})]}),(0,z.jsx)(Bn,{variant:"outline",className:`text-xs ${o.type==="view"?"bg-[var(--blue-4)] text-[var(--blue-11)]":"bg-[var(--green-4)] text-[var(--green-11)]"}`,children:o.type})]},o.name));return(0,z.jsxs)("div",{className:eo,children:[(0,z.jsx)(to,{icon:(0,z.jsx)(Ui,{className:"w-4 h-4 text-[var(--green-9)]"}),title:e.name,badge:n}),(0,z.jsx)("div",{className:"py-2",children:(0,z.jsx)(ri,{icon:(0,z.jsx)(Hi,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.tables.length} table${e.tables.length===1?"":"s"}`})}),e.tables.length===0&&ql("table"),e.tables.length>0&&(0,z.jsx)(Rr,{title:"Tables",items:a,totalCount:e.tables.length})]})};var mg=(0,z.jsx)(Bn,{variant:"outline",children:"default"}),vk=8,gg=3;let ql;Fw=(e,n)=>{let a=e.databases.length,o=e.databases.reduce((g,b)=>g+b.schemas.length,0),s=(g,b)=>{if(g.tables.length===0)return null;let _=g.name===e.default_schema&&b,S=[];return o<vk&&(S=g.tables.slice(0,gg+1).map(C=>(0,z.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,z.jsx)(Hi,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,z.jsx)("span",{className:"text-xs",children:C.name})]},C.name))),(0,z.jsxs)("div",{children:[(0,z.jsxs)("div",{className:"flex items-center gap-2 text-xs rounded hover:bg-[var(--slate-3)] ml-2",children:[(0,z.jsx)(Ui,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,z.jsx)("span",{children:g.name}),_&&mg,(0,z.jsxs)(Bn,{variant:"outline",className:"text-xs ml-auto",children:[g.tables.length," tables"]})]}),(0,z.jsx)(Rr,{items:S,totalCount:g.tables.length,limit:gg})]},g.name)},c=e.databases.map(g=>{let b=g.name===e.default_database||e.databases.length===1,_=g.schemas.map(S=>s(S,b));return(0,z.jsxs)("div",{children:[(0,z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,z.jsx)(rs,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,z.jsx)("span",{className:"text-xs",children:g.name}),b&&mg]}),_&&(0,z.jsx)(Rr,{items:_,totalCount:g.schemas.length})]},g.name)}),h=e.name;Fi.has(e.name)&&(h="In-Memory");let p=n==null?void 0:n.map(g=>(0,z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,z.jsx)(Hi,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,z.jsx)("span",{className:"text-xs",children:g.name})]},g.name));return(0,z.jsxs)("div",{className:`${eo} px-1`,children:[(0,z.jsx)(to,{icon:(0,z.jsx)(rg,{className:"w-4 h-4 text-[var(--purple-9)]"}),title:h}),(0,z.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,z.jsx)(_r,{label:"Dialect",value:(0,z.jsx)("span",{className:"font-medium",children:kl(e.dialect)})}),(0,z.jsx)(_r,{label:"Source",value:(0,z.jsx)(Bn,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:e.source})})]}),(0,z.jsxs)("div",{className:"flex flex-row justify-between py-2",children:[(0,z.jsx)(ri,{icon:(0,z.jsx)(rs,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${a} ${hg.pluralize(a)}`}),(0,z.jsx)(ri,{icon:(0,z.jsx)(Ui,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${o} ${fg.pluralize(o)}`})]}),a>0&&(0,z.jsx)(Rr,{items:c,totalCount:a}),p&&p.length>0&&(0,z.jsx)(Rr,{title:"Dataframes",items:p,totalCount:p.length})]})},ql=e=>(0,z.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,z.jsx)(rd,{size:10,className:"mt-1 text-[var(--slate-10)] shrink-0"}),(0,z.jsxs)("span",{className:"text-xs text-[var(--slate-11)]",children:["No ",e," information available.",`
34
+ `,(0,z.jsx)("span",{className:"text-[var(--blue-10)]",children:"Introspect to see more details."})]})]});var Bl=Fu(),yg=class{constructor(){ve(this,"schema",{})}addTable(e,n){let a={self:wk({table:n}),children:n.columns.map(o=>bk({column:o}))};return this.setAt([...e,n.name],a),this}addSchema(e,n){let a={self:_k({namespace:n,path:e}),children:{}};return this.setAt(e,a),this}addDatabase(e,n){let a={self:xk({namespace:n,path:e}),children:{}};return this.setAt(e,a),this}setAt(e,n){let a=this.schema;for(let o of e.slice(0,-1))a[o]||(a[o]={children:{}}),a=a[o].children;a[e[e.length-1]]=n}build(){return this.schema}reset(){return this.schema={},this}};function bk(e){return{label:e.column.name,type:"column",info:()=>{let n=document.createElement("div");return(0,Bl.createRoot)(n).render(mk(e.column)),{dom:n}}}}function wk(e){return{label:e.table.name,type:"table",info:()=>{let n=document.createElement("div");return(0,Bl.createRoot)(n).render(hk(e.table)),{dom:n}}}}function _k(e){return{label:e.namespace.name,detail:e.path.join("."),type:"schema",info:()=>{let n=document.createElement("div");return(0,Bl.createRoot)(n).render(yk(e.namespace)),{dom:n}}}}function xk(e){return{label:e.namespace.name,detail:e.path.join("."),type:"database",info:()=>{let n=document.createElement("div");return(0,Bl.createRoot)(n).render(gk(e.namespace)),{dom:n}}}}var kk=Ce(e=>{let n=e(cd),a=new yg;for(let o of n)a.addTable([],o);return a.build()}),Sk=class{constructor(){this.cache=new zl(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return Fe.get(Xu).get(e)}getConnectionSchema(e){var h;let{default_database:n,databases:a,default_schema:o}=e,s=new yg,c=a.find(p=>p.name===n||a.length===1);if(((h=c??a[0])==null?void 0:h.schemas.some(p=>_l(p.name)))??!1){for(let p of a){let g=p.name===(c==null?void 0:c.name),b=p.schemas.flatMap(_=>_.tables);s.addDatabase([p.name],p);for(let _ of b)g?s.addTable([],_):s.addTable([p.name],_)}return{shouldAddLocalTables:!1,schema:s.build(),defaultSchema:c==null?void 0:c.name}}if(c)for(let p of c.schemas){s.addSchema([p.name],p);for(let g of p.tables)s.addTable([p.name],g)}for(let p of a){s.addDatabase([p.name],p);for(let g of p.schemas){s.addSchema([p.name,g.name],g);for(let b of g.tables)s.addTable([p.name,g.name],b)}}return{shouldAddLocalTables:!0,schema:s.build(),defaultSchema:o??void 0}}getInternalDialect(e){let n=this.getConnection(e);return n?n.dialect.toLowerCase():null}getDialect(e){let n=this.getConnection(e);return n?eg(n):ss}getCompletionSource(e){let n=this.getConnection(e);if(!n)return null;let a=()=>Fe.get(kk),o=this.cache.getOrCreate(n);return{dialect:eg(n),schema:o.shouldAddLocalTables?{...o.schema,...a()}:o.schema,defaultSchema:o.defaultSchema,defaultTable:Ck(n)}}};function Ck(e){if(e.databases.length!==1)return;let n=e.databases[0];if(n.schemas.length!==1)return;let a=n.schemas[0];if(a.tables.length===1)return a.tables[0].name}const ai=new Sk,us=aa.define();Au=async function(e){let{sendFormat:n}=oa(),a=Ar.mapValues(e,s=>nr(s)),o=await n({codes:a,lineLength:R2().formatting.line_length});for(let[s,c]of Ar.entries(o.codes)){let h=s,p=a[h],g=e[h];g&&c!==p&&(g.state.facet(ct).updateCellCode({cellId:h,code:c,formattingChange:!0}),Ki(g,c))}},Q_=function(){return Au(nk(Wi()))};async function Ek(e,n){let{formatDialect:a}=await re(async()=>{let{formatDialect:S}=await import("./esm-C9WujutX.js").then(async C=>(await C.__tla,C));return{formatDialect:S}},__vite__mapDeps([0,1]),import.meta.url),o=await Tk(ai.getInternalDialect(n)),s=e.state.field(rr),c=b5(e.state);if(s.type!=="sql"){be.error("Language adapter is not SQL");return}let h=e.state.doc.toString(),p;try{p=a(h,{dialect:o,tabWidth:c,useTabs:!1})}catch(S){be.error("Error formatting SQL",{error:S});return}let g=s.transformIn(p)[0],b=e.state.facet(ct),_=e.state.facet(Dl);b.updateCellCode({cellId:_,code:g,formattingChange:!0}),Hu(e,p,{effects:[us.of(!0)]})}async function Tk(e){let{bigquery:n,db2:a,db2i:o,duckdb:s,hive:c,mariadb:h,mysql:p,tidb:g,n1ql:b,plsql:_,postgresql:S,redshift:C,spark:E,sqlite:O,sql:M,trino:V,transactsql:H,singlestoredb:$,snowflake:N}=await re(async()=>{let{bigquery:fe,db2:R,db2i:j,duckdb:F,hive:se,mariadb:ce,mysql:he,tidb:ye,n1ql:xe,plsql:Qe,postgresql:pe,redshift:ie,spark:ee,sqlite:U,sql:Ae,trino:Ve,transactsql:nt,singlestoredb:He,snowflake:ze}=await import("./esm-C9WujutX.js").then(async Le=>(await Le.__tla,Le));return{bigquery:fe,db2:R,db2i:j,duckdb:F,hive:se,mariadb:ce,mysql:he,tidb:ye,n1ql:xe,plsql:Qe,postgresql:pe,redshift:ie,spark:ee,sqlite:U,sql:Ae,trino:Ve,transactsql:nt,singlestoredb:He,snowflake:ze}},__vite__mapDeps([0,1]),import.meta.url),ne=M;if(!e||!jl(e))return ne;switch(e){case"mysql":return p;case"mariadb":return h;case"postgres":case"postgresql":return S;case"sqlite":return O;case"db2":return a;case"db2i":return o;case"hive":return c;case"redshift":return C;case"snowflake":return N;case"trino":return V;case"tidb":return g;case"oracle":case"oracledb":return _;case"spark":return E;case"singlestoredb":return $;case"couchbase":return b;case"bigquery":return n;case"duckdb":return s;case"mssql":case"sqlserver":case"microsoft sql server":return H;case"athena":case"awsathena":case"cassandra":case"noql":case"flink":case"mongodb":case"timescaledb":case"datafusion":return M;case"databricks":return E;default:return Xo(e),ne}}var Lk=Fu();function Ok(e,n){let a=document.createElement("div"),o;return{dom:a,mount(){o=(0,Lk.createRoot)(a),o.render((0,z.jsx)(S2,{store:Fe,children:(0,z.jsx)(n,{view:e})}))},update(){o==null||o.render((0,z.jsx)(S2,{store:Fe,children:(0,z.jsx)(n,{view:e})}))},destroy(){o==null||o.unmount()}}}function de(e){return new $2(V2.define(e))}function ma(e){return re(()=>import("./dist-CdZb2Grj.js").then(async n=>(await n.__tla,n)),__vite__mapDeps([2,3,4,5]),import.meta.url).then(n=>n.sql({dialect:n[e]}))}var Ak=[te.of({name:"C",extensions:["c","h","ino"],load(){return re(()=>import("./dist-OAWl1fS6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),te.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return re(()=>import("./dist-OAWl1fS6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),te.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return ma("Cassandra")}}),te.of({name:"CSS",extensions:["css"],load(){return re(()=>import("./dist-CRVvx8nD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([8,9,5]),import.meta.url).then(e=>e.css())}}),te.of({name:"Go",extensions:["go"],load(){return re(()=>import("./dist-BkKLXyVM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([10,11,4,5]),import.meta.url).then(e=>e.go())}}),te.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return re(()=>import("./dist-CtKltiBh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([12,9,5,13,14,4]),import.meta.url).then(e=>e.html())}}),te.of({name:"Java",extensions:["java"],load(){return re(()=>import("./dist-BRjtiDLy.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([15,16,5]),import.meta.url).then(e=>e.java())}}),te.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return re(()=>import("./dist-DwtQnQ8D.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript())}}),te.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return re(()=>import("./dist-Dz7aLgyk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([18,9,5,13,14,4,19]),import.meta.url).then(e=>e.jinja())}}),te.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return re(()=>import("./dist-C0GaLmeM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([20,21,5]),import.meta.url).then(e=>e.json())}}),te.of({name:"JSX",extensions:["jsx"],load(){return re(()=>import("./dist-DwtQnQ8D.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({jsx:!0}))}}),te.of({name:"LESS",extensions:["less"],load(){return re(()=>import("./dist-Bw5sFnNi.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([22,9,5,23]),import.meta.url).then(e=>e.less())}}),te.of({name:"Liquid",extensions:["liquid"],load(){return re(()=>import("./dist-D1GHSZQ_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([24,9,5,13,14,4,25]),import.meta.url).then(e=>e.liquid())}}),te.of({name:"MariaDB SQL",load(){return ma("MariaSQL")}}),te.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return re(()=>import("./dist-CqnPIH_S.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([26,9,5,13,14,4,27]),import.meta.url).then(e=>e.markdown())}}),te.of({name:"MS SQL",load(){return ma("MSSQL")}}),te.of({name:"MySQL",load(){return ma("MySQL")}}),te.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return re(()=>import("./dist-BveopvhJ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([28,9,5,13,14,4,29]),import.meta.url).then(e=>e.php())}}),te.of({name:"PLSQL",extensions:["pls"],load(){return ma("PLSQL")}}),te.of({name:"PostgreSQL",load(){return ma("PostgreSQL")}}),te.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return re(()=>import("./dist-gm5AeuIM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([30,31,4,5]),import.meta.url).then(e=>e.python())}}),te.of({name:"Rust",extensions:["rs"],load(){return re(()=>import("./dist-DZhm7iRc.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([32,33,5]),import.meta.url).then(e=>e.rust())}}),te.of({name:"Sass",extensions:["sass"],load(){return re(()=>import("./dist-DiZV-TgQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass({indented:!0}))}}),te.of({name:"SCSS",extensions:["scss"],load(){return re(()=>import("./dist-DiZV-TgQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass())}}),te.of({name:"SQL",extensions:["sql"],load(){return ma("StandardSQL")}}),te.of({name:"SQLite",load(){return ma("SQLite")}}),te.of({name:"TSX",extensions:["tsx"],load(){return re(()=>import("./dist-DwtQnQ8D.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),te.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return re(()=>import("./dist-DwtQnQ8D.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({typescript:!0}))}}),te.of({name:"WebAssembly",extensions:["wat","wast"],load(){return re(()=>import("./dist-x2aGlNO5.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([36,37,5]),import.meta.url).then(e=>e.wast())}}),te.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return re(()=>import("./dist-BmupR6hJ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([38,39,5]),import.meta.url).then(e=>e.xml())}}),te.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return re(()=>import("./dist-DUYSgv8L.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([40,41,5]),import.meta.url).then(e=>e.yaml())}}),te.of({name:"APL",extensions:["dyalog","apl"],load(){return re(()=>import("./apl-3xKEEmjQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([42,43]),import.meta.url).then(e=>de(e.apl))}}),te.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return re(()=>import("./asciiarmor-BCugLX69.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([44,45]),import.meta.url).then(e=>de(e.asciiArmor))}}),te.of({name:"ASN.1",extensions:["asn","asn1"],load(){return re(()=>import("./asn1-B8ndG_Ze.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([46,47]),import.meta.url).then(e=>de(e.asn1({})))}}),te.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return re(()=>import("./asterisk-DmqsRS7E.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.asterisk))}}),te.of({name:"Brainfuck",extensions:["b","bf"],load(){return re(()=>import("./brainfuck-h1OIoSEo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([48,49]),import.meta.url).then(e=>de(e.brainfuck))}}),te.of({name:"Cobol",extensions:["cob","cpy"],load(){return re(()=>import("./cobol-C5qkyUSJ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>de(e.cobol))}}),te.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return re(()=>import("./clike-DPuzjNcL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>de(e.csharp))}}),te.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return re(()=>import("./clojure-yGQavt_D.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>de(e.clojure))}}),te.of({name:"ClojureScript",extensions:["cljs"],load(){return re(()=>import("./clojure-yGQavt_D.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>de(e.clojure))}}),te.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return re(()=>import("./css-COQFxLQn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([56,57]),import.meta.url).then(e=>de(e.gss))}}),te.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return re(()=>import("./cmake-yLKyOybp.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([58,59]),import.meta.url).then(e=>de(e.cmake))}}),te.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return re(()=>import("./coffeescript-CtR3eWCa.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([60,61]),import.meta.url).then(e=>de(e.coffeeScript))}}),te.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return re(()=>import("./commonlisp-D-heOGa1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([62,63]),import.meta.url).then(e=>de(e.commonLisp))}}),te.of({name:"Cypher",extensions:["cyp","cypher"],load(){return re(()=>import("./cypher-whf3KLcn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([64,65]),import.meta.url).then(e=>de(e.cypher))}}),te.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return re(()=>import("./python-jVWqyNLt.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([66,67]),import.meta.url).then(e=>de(e.cython))}}),te.of({name:"Crystal",extensions:["cr"],load(){return re(()=>import("./crystal-PRx3aORZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([68,69]),import.meta.url).then(e=>de(e.crystal))}}),te.of({name:"D",extensions:["d"],load(){return re(()=>import("./d-Rxavm_nZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([70,71]),import.meta.url).then(e=>de(e.d))}}),te.of({name:"Dart",extensions:["dart"],load(){return re(()=>import("./clike-DPuzjNcL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>de(e.dart))}}),te.of({name:"diff",extensions:["diff","patch"],load(){return re(()=>import("./diff-BuBMfzxS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([72,73]),import.meta.url).then(e=>de(e.diff))}}),te.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return re(()=>import("./dockerfile-DGts-2Fo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([74,75]),import.meta.url).then(e=>de(e.dockerFile))}}),te.of({name:"DTD",extensions:["dtd"],load(){return re(()=>import("./dtd-Byyl3ADK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([76,77]),import.meta.url).then(e=>de(e.dtd))}}),te.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return re(()=>import("./dylan-zE-fWZ95.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([78,79]),import.meta.url).then(e=>de(e.dylan))}}),te.of({name:"EBNF",load(){return re(()=>import("./ebnf-dezZofVm.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.ebnf))}}),te.of({name:"ECL",extensions:["ecl"],load(){return re(()=>import("./ecl-oGqPqdsN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([80,81]),import.meta.url).then(e=>de(e.ecl))}}),te.of({name:"edn",extensions:["edn"],load(){return re(()=>import("./clojure-yGQavt_D.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>de(e.clojure))}}),te.of({name:"Eiffel",extensions:["e"],load(){return re(()=>import("./eiffel-C_tzASKk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([82,83]),import.meta.url).then(e=>de(e.eiffel))}}),te.of({name:"Elm",extensions:["elm"],load(){return re(()=>import("./elm-DowGsQrq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([84,85]),import.meta.url).then(e=>de(e.elm))}}),te.of({name:"Erlang",extensions:["erl"],load(){return re(()=>import("./erlang-DXj5Mety.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([86,87]),import.meta.url).then(e=>de(e.erlang))}}),te.of({name:"Esper",load(){return re(()=>import("./sql-DzyjqiRG.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.esper))}}),te.of({name:"Factor",extensions:["factor"],load(){return re(()=>import("./factor-BBRGvEpt.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([88,89,75]),import.meta.url).then(e=>de(e.factor))}}),te.of({name:"FCL",load(){return re(()=>import("./fcl-D566gDVV.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.fcl))}}),te.of({name:"Forth",extensions:["forth","fth","4th"],load(){return re(()=>import("./forth-ir5Q2myN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([90,91]),import.meta.url).then(e=>de(e.forth))}}),te.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return re(()=>import("./fortran-Ckvuc18T.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>de(e.fortran))}}),te.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return re(()=>import("./mllike-Cdk-SxrR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>de(e.fSharp))}}),te.of({name:"Gas",extensions:["s"],load(){return re(()=>import("./gas-IcbZgopn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([96,97]),import.meta.url).then(e=>de(e.gas))}}),te.of({name:"Gherkin",extensions:["feature"],load(){return re(()=>import("./gherkin-BUQFbyhq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([98,99]),import.meta.url).then(e=>de(e.gherkin))}}),te.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return re(()=>import("./groovy-CPRpPrR6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([100,101]),import.meta.url).then(e=>de(e.groovy))}}),te.of({name:"Haskell",extensions:["hs"],load(){return re(()=>import("./haskell-BZ64_L1W.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([102,103]),import.meta.url).then(e=>de(e.haskell))}}),te.of({name:"Haxe",extensions:["hx"],load(){return re(()=>import("./haxe-u0gVVSGf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>de(e.haxe))}}),te.of({name:"HXML",extensions:["hxml"],load(){return re(()=>import("./haxe-u0gVVSGf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>de(e.hxml))}}),te.of({name:"HTTP",load(){return re(()=>import("./http-Ms617AZI.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.http))}}),te.of({name:"IDL",extensions:["pro"],load(){return re(()=>import("./idl-D6vrTcdT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([106,107]),import.meta.url).then(e=>de(e.idl))}}),te.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return re(()=>import("./javascript-DtGa6W6u.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([108,109]),import.meta.url).then(e=>de(e.jsonld))}}),te.of({name:"Julia",extensions:["jl"],load(){return re(()=>import("./julia-ChDcWdzF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([110,111]),import.meta.url).then(e=>de(e.julia))}}),te.of({name:"Kotlin",extensions:["kt","kts"],load(){return re(()=>import("./clike-DPuzjNcL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>de(e.kotlin))}}),te.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return re(()=>import("./livescript-D3x57DP6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([112,113]),import.meta.url).then(e=>de(e.liveScript))}}),te.of({name:"Lua",extensions:["lua"],load(){return re(()=>import("./lua-CfeyF-5c.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([114,115]),import.meta.url).then(e=>de(e.lua))}}),te.of({name:"mIRC",extensions:["mrc"],load(){return re(()=>import("./mirc-B8ay9N_G.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([116,117]),import.meta.url).then(e=>de(e.mirc))}}),te.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return re(()=>import("./mathematica-CAUFFTVp.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([118,119]),import.meta.url).then(e=>de(e.mathematica))}}),te.of({name:"Modelica",extensions:["mo"],load(){return re(()=>import("./modelica-cErGJ40J.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([120,121]),import.meta.url).then(e=>de(e.modelica))}}),te.of({name:"MUMPS",extensions:["mps"],load(){return re(()=>import("./mumps-CPuZtknR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([122,123]),import.meta.url).then(e=>de(e.mumps))}}),te.of({name:"Mbox",extensions:["mbox"],load(){return re(()=>import("./mbox-Duq1SQ_k.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([124,125]),import.meta.url).then(e=>de(e.mbox))}}),te.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return re(()=>import("./nginx-CNtYBWy9.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.nginx))}}),te.of({name:"NSIS",extensions:["nsh","nsi"],load(){return re(()=>import("./nsis-ggFWkoqT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([126,127,75]),import.meta.url).then(e=>de(e.nsis))}}),te.of({name:"NTriples",extensions:["nt","nq"],load(){return re(()=>import("./ntriples-eQBrW6tI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([128,129]),import.meta.url).then(e=>de(e.ntriples))}}),te.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return re(()=>import("./clike-DPuzjNcL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>de(e.objectiveC))}}),te.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return re(()=>import("./clike-DPuzjNcL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>de(e.objectiveCpp))}}),te.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return re(()=>import("./mllike-Cdk-SxrR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>de(e.oCaml))}}),te.of({name:"Octave",extensions:["m"],load(){return re(()=>import("./octave-CcpumlkH.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([130,131]),import.meta.url).then(e=>de(e.octave))}}),te.of({name:"Oz",extensions:["oz"],load(){return re(()=>import("./oz-D3u6XBI4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([132,133]),import.meta.url).then(e=>de(e.oz))}}),te.of({name:"Pascal",extensions:["p","pas"],load(){return re(()=>import("./pascal-COvFIqNx.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([134,135]),import.meta.url).then(e=>de(e.pascal))}}),te.of({name:"Perl",extensions:["pl","pm"],load(){return re(()=>import("./perl-BSxTN_bc.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([136,137]),import.meta.url).then(e=>de(e.perl))}}),te.of({name:"Pig",extensions:["pig"],load(){return re(()=>import("./pig-B5SEJPfW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([138,139]),import.meta.url).then(e=>de(e.pig))}}),te.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return re(()=>import("./powershell-T0AiDBtK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([140,141]),import.meta.url).then(e=>de(e.powerShell))}}),te.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return re(()=>import("./properties-CEyxcWzr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([142,143]),import.meta.url).then(e=>de(e.properties))}}),te.of({name:"ProtoBuf",extensions:["proto"],load(){return re(()=>import("./protobuf-BgP8VdyX.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([144,145]),import.meta.url).then(e=>de(e.protobuf))}}),te.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return re(()=>import("./pug-D1MIs29p.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([146,147,109]),import.meta.url).then(e=>de(e.pug))}}),te.of({name:"Puppet",extensions:["pp"],load(){return re(()=>import("./puppet-DQ0s94I4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([148,149]),import.meta.url).then(e=>de(e.puppet))}}),te.of({name:"Q",extensions:["q"],load(){return re(()=>import("./q-Ddp_9iFq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([150,151]),import.meta.url).then(e=>de(e.q))}}),te.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return re(()=>import("./r-WnM9HAaQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([152,153]),import.meta.url).then(e=>de(e.r))}}),te.of({name:"RPM Changes",load(){return re(()=>import("./rpm-Cpb0cYbF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>de(e.rpmChanges))}}),te.of({name:"RPM Spec",extensions:["spec"],load(){return re(()=>import("./rpm-Cpb0cYbF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>de(e.rpmSpec))}}),te.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return re(()=>import("./ruby-npoQJqOj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([156,157]),import.meta.url).then(e=>de(e.ruby))}}),te.of({name:"SAS",extensions:["sas"],load(){return re(()=>import("./sas-D5R_hCoQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([158,159]),import.meta.url).then(e=>de(e.sas))}}),te.of({name:"Scala",extensions:["scala"],load(){return re(()=>import("./clike-DPuzjNcL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>de(e.scala))}}),te.of({name:"Scheme",extensions:["scm","ss"],load(){return re(()=>import("./scheme-oK64G5wG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([160,161]),import.meta.url).then(e=>de(e.scheme))}}),te.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return re(()=>import("./shell-D-C8eGy_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([162,163]),import.meta.url).then(e=>de(e.shell))}}),te.of({name:"Sieve",extensions:["siv","sieve"],load(){return re(()=>import("./sieve-DPRpRdV2.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([164,165]),import.meta.url).then(e=>de(e.sieve))}}),te.of({name:"Smalltalk",extensions:["st"],load(){return re(()=>import("./smalltalk-bsl5ZJOd.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([166,167]),import.meta.url).then(e=>de(e.smalltalk))}}),te.of({name:"Solr",load(){return re(()=>import("./solr-DndbfGC6.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.solr))}}),te.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return re(()=>import("./mllike-Cdk-SxrR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>de(e.sml))}}),te.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return re(()=>import("./sparql-CJUH6gR2.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([168,169]),import.meta.url).then(e=>de(e.sparql))}}),te.of({name:"Spreadsheet",alias:["excel","formula"],load(){return re(()=>import("./spreadsheet-DHoeoJHd.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.spreadsheet))}}),te.of({name:"Squirrel",extensions:["nut"],load(){return re(()=>import("./clike-DPuzjNcL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>de(e.squirrel))}}),te.of({name:"Stylus",extensions:["styl"],load(){return re(()=>import("./stylus-Dz-M3k6z.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([170,171]),import.meta.url).then(e=>de(e.stylus))}}),te.of({name:"Swift",extensions:["swift"],load(){return re(()=>import("./swift-BZHzeogd.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([172,173]),import.meta.url).then(e=>de(e.swift))}}),te.of({name:"sTeX",load(){return re(()=>import("./stex-pjf-hOob.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>de(e.stex))}}),te.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return re(()=>import("./stex-pjf-hOob.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>de(e.stex))}}),te.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return re(()=>import("./verilog-DO_FdUQ9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>de(e.verilog))}}),te.of({name:"Tcl",extensions:["tcl"],load(){return re(()=>import("./tcl-CjjnKQKi.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([178,179]),import.meta.url).then(e=>de(e.tcl))}}),te.of({name:"Textile",extensions:["textile"],load(){return re(()=>import("./textile-C6DxVHfN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([180,181]),import.meta.url).then(e=>de(e.textile))}}),te.of({name:"TiddlyWiki",load(){return re(()=>import("./tiddlywiki-Laz7iVQn.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.tiddlyWiki))}}),te.of({name:"Tiki wiki",load(){return re(()=>import("./tiki-Dd2_LAYu.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>de(e.tiki))}}),te.of({name:"TOML",extensions:["toml"],load(){return re(()=>import("./toml-DTuUvOIE.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([182,183]),import.meta.url).then(e=>de(e.toml))}}),te.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return re(()=>import("./troff-yA83BgDZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([184,185]),import.meta.url).then(e=>de(e.troff))}}),te.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return re(()=>import("./ttcn-F0FnYTMB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([186,187]),import.meta.url).then(e=>de(e.ttcn))}}),te.of({name:"TTCN_CFG",extensions:["cfg"],load(){return re(()=>import("./ttcn-cfg-CSr0YVH7.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([188,189]),import.meta.url).then(e=>de(e.ttcnCfg))}}),te.of({name:"Turtle",extensions:["ttl"],load(){return re(()=>import("./turtle-DaAbI02L.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([190,191]),import.meta.url).then(e=>de(e.turtle))}}),te.of({name:"Web IDL",extensions:["webidl"],load(){return re(()=>import("./webidl-DUTo0zWa.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([192,193]),import.meta.url).then(e=>de(e.webIDL))}}),te.of({name:"VB.NET",extensions:["vb"],load(){return re(()=>import("./vb-BYziWQVS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([194,195]),import.meta.url).then(e=>de(e.vb))}}),te.of({name:"VBScript",extensions:["vbs"],load(){return re(()=>import("./vbscript-CP_qFLQN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([196,197]),import.meta.url).then(e=>de(e.vbScript))}}),te.of({name:"Velocity",extensions:["vtl"],load(){return re(()=>import("./velocity-etCBW8YB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([198,199]),import.meta.url).then(e=>de(e.velocity))}}),te.of({name:"Verilog",extensions:["v"],load(){return re(()=>import("./verilog-DO_FdUQ9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>de(e.verilog))}}),te.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return re(()=>import("./vhdl-CtT4O7WT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([200,201]),import.meta.url).then(e=>de(e.vhdl))}}),te.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return re(()=>import("./xquery-B0wH9AmB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([202,203]),import.meta.url).then(e=>de(e.xQuery))}}),te.of({name:"Yacas",extensions:["ys"],load(){return re(()=>import("./yacas-UtDKR_RQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([204,205]),import.meta.url).then(e=>de(e.yacas))}}),te.of({name:"Z80",extensions:["z80"],load(){return re(()=>import("./z80-gTLyuPxz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([206,207]),import.meta.url).then(e=>de(e.z80))}}),te.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return re(()=>import("./mscgen-jRCec7TG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>de(e.mscgen))}}),te.of({name:"X\xF9",extensions:["xu"],load(){return re(()=>import("./mscgen-jRCec7TG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>de(e.xu))}}),te.of({name:"MsGenny",extensions:["msgenny"],load(){return re(()=>import("./mscgen-jRCec7TG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>de(e.msgenny))}}),te.of({name:"Vue",extensions:["vue"],load(){return re(()=>import("./dist-CwLG6Za2.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([210,9,5,13,14,4,211]),import.meta.url).then(e=>e.vue())}}),te.of({name:"Angular Template",load(){return re(()=>import("./dist-CTarqYcj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([212,9,5,13,14,4]),import.meta.url).then(e=>e.angular())}})],vg=new WeakMap,Ik=/(\n|\r\n?|\u2028|\u2029)/g,Rk=/^\s*/,Mk=/\S/,Pk=Array.prototype.slice,Nd=48,bg=57,wg=97,Nk=102,_g=65,Dk=70;El=function(e){if(typeof e=="string")return Sg([e])[0];if(typeof e=="function")return function(){let o=Pk.call(arguments);return o[0]=kg(o[0]),e.apply(this,o)};let n=kg(e),a=xg(n,0);for(let o=1;o<n.length;o++)a+=arguments[o]+xg(n,o);return a};function xg(e,n){let a=e[n];if(a===void 0)throw TypeError(`invalid cooked string at index ${n}`);return a}function kg(e){let n=vg.get(e);if(n)return n;let a=Sg(e.raw),o=a.map(zk);return Object.defineProperty(o,"raw",{value:Object.freeze(a)}),Object.freeze(o),vg.set(e,o),o}function Sg(e){let n=e.map(s=>s.split(Ik)),a;for(let s=0;s<n.length;s++){let c=n[s],h=s===0,p=s+1===n.length;if(h){if(c.length===1||c[0].length>0)throw Error("invalid content on opening line");c[1]=""}if(p){if(c.length===1||Mk.test(c[c.length-1]))throw Error("invalid content on closing line");c[c.length-2]="",c[c.length-1]=""}for(let g=2;g<c.length;g+=2){let b=c[g],_=g+1===c.length&&!p,S=Rk.exec(b)[0];if(!_&&S.length===b.length){c[g]="";continue}a=jk(S,a)}}let o=a?a.length:0;return n.map(s=>{let c=s[0];for(let h=1;h<s.length;h+=2){let p=s[h],g=s[h+1];c+=p+g.slice(o)}return c})}function jk(e,n){if(n===void 0||e===n)return e;let a=0;for(let o=Math.min(e.length,n.length);a<o&&e[a]===n[a];a++);return e.slice(0,a)}function zk(e){let n="",a=0,o=0;for(;(o=e.indexOf("\\",o))>-1;){if(n+=e.slice(a,o),++o===e.length)return;let s=e[o++];switch(s){case"b":n+="\b";break;case"t":n+=" ";break;case"n":n+=`
35
35
  `;break;case"v":n+="\v";break;case"f":n+="\f";break;case"r":n+="\r";break;case"\r":o<e.length&&e[o]===`
36
36
  `&&++o;case`
37
- `:case"\u2028":case"\u2029":break;case"0":if(Cg(e,o))return;n+="\0";break;case"x":{let c=Dd(e,o,o+2);if(c===-1)return;o+=2,n+=String.fromCharCode(c);break}case"u":{let c;if(o<e.length&&e[o]==="{"){let h=e.indexOf("}",++o);if(h===-1)return;c=Dd(e,o,h),o=h+1}else c=Dd(e,o,o+4),o+=4;if(c===-1||c>1114111)return;n+=String.fromCodePoint(c);break}default:if(Cg(s,0))return;n+=s}a=o}return n+e.slice(a)}function Cg(e,n){let a=e.charCodeAt(n);return a>=Nd&&a<=bg}function Dd(e,n,a){if(a>=e.length)return-1;let o=0;for(;n<a;n++){let s=zk(e.charCodeAt(n));if(s===-1)return-1;o=o*16+s}return o}function zk(e){return e>=Nd&&e<=bg?e-Nd:e>=wg&&e<=Pk?e-wg+10:e>=_g&&e<=Nk?e-_g+10:-1}const Eg=["","f","r","fr","rf"];function qk(e){try{return El(`
37
+ `:case"\u2028":case"\u2029":break;case"0":if(Cg(e,o))return;n+="\0";break;case"x":{let c=Dd(e,o,o+2);if(c===-1)return;o+=2,n+=String.fromCharCode(c);break}case"u":{let c;if(o<e.length&&e[o]==="{"){let h=e.indexOf("}",++o);if(h===-1)return;c=Dd(e,o,h),o=h+1}else c=Dd(e,o,o+4),o+=4;if(c===-1||c>1114111)return;n+=String.fromCodePoint(c);break}default:if(Cg(s,0))return;n+=s}a=o}return n+e.slice(a)}function Cg(e,n){let a=e.charCodeAt(n);return a>=Nd&&a<=bg}function Dd(e,n,a){if(a>=e.length)return-1;let o=0;for(;n<a;n++){let s=qk(e.charCodeAt(n));if(s===-1)return-1;o=o*16+s}return o}function qk(e){return e>=Nd&&e<=bg?e-Nd:e>=wg&&e<=Nk?e-wg+10:e>=_g&&e<=Dk?e-_g+10:-1}const Eg=["","f","r","fr","rf"];function Bk(e){try{return El(`
38
38
  ${e}
39
- `).trim()}catch{return e}}function Bk(e){return bT.parse(e)}var Fk=new Set(["(","[","{",",",")","]","}"]);function Vk(e,n){return e.name==="ArgList"?{args:Hk(e),kwargs:$k(e,n)}:(console.warn(`Not an ArgList, name: ${e.name}`),{args:[],kwargs:[]})}function Hk(e){var o;e.firstChild();let n=[],a=e.name;do if(a=e.name,!Fk.has(a)){if(a==="VariableName"&&((o=e.node.nextSibling)==null?void 0:o.name)==="AssignOp"){e.prev();break}n.push(e.node)}while(e.nextSibling());return n}function $k(e,n){let a=[],o=e.name;do if(o=e.name,o==="VariableName"){let s=n.slice(e.from,e.to),c=e.node.nextSibling;if(!c||c.name!=="AssignOp")continue;let h=c.nextSibling;if(!h)continue;let p=n.slice(h.from,h.to).trim();a.push({key:s,value:p})}while(e.nextSibling());return a}function Wk(e,n){if(e.name==="String"){let a=n.slice(e.from,e.to);return a.startsWith('r"""')||a.startsWith("r'''")?a.slice(4,-3):a.startsWith('"""')||a.startsWith("'''")?a.slice(3,-3):a.startsWith('r"')||a.startsWith("r'")?a.slice(2,-1):a.slice(1,-1)}if(e.name==="FormatString"){let a=n.slice(e.from,e.to);return a.startsWith('f"""')||a.startsWith("f'''")?a.slice(4,-3):a.startsWith('rf"""')||a.startsWith("rf'''")||a.startsWith('fr"""')||a.startsWith("fr'''")?a.slice(5,-3):a.startsWith('r"""')||a.startsWith("r'''")?a.slice(4,-3):a.startsWith('f"')||a.startsWith("f'")?a.slice(2,-1):a.startsWith('rf"')||a.startsWith("rf'")||a.startsWith('fr"')||a.startsWith("fr'")?a.slice(3,-1):(a.startsWith('r"')||a.startsWith("r'"),a.slice(2,-1))}return null}function Uk(e){return e===""?0:e.startsWith('rf"""')||e.startsWith("rf'''")||e.startsWith('fr"""')||e.startsWith("fr'''")?5:e.startsWith('f"""')||e.startsWith("f'''")||e.startsWith('r"""')||e.startsWith("r'''")?4:e.startsWith('"""')||e.startsWith("'''")||e.startsWith("rf'")||e.startsWith('rf"')||e.startsWith("fr'")||e.startsWith('fr"')?3:e.startsWith("f'")||e.startsWith('f"')||e.startsWith("r'")||e.startsWith('r"')?2:e.startsWith("'")||e.startsWith('"')?1:0}function Kk(e){let n=[...Eg].sort((a,o)=>o.length-a.length);for(let a of n)if(e.startsWith(a))return[a,e.slice(a.length)];return["",e]}function Qk(e,n){return e.replaceAll(`\\${n}`,n)}var Gk=[['"""','"""'],["'''","'''"],['"','"'],["'","'"]],Jk=Eg.flatMap(e=>Gk.map(([n,a])=>[e+n,a])).map(([e,n])=>[e,RegExp(`^mo\\.md\\(\\s*${Tg(e)}(.*)${Tg(n)}\\s*\\)$`,"s")]);function Tg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}let Lg,Fl;zu=class{constructor(){ve(this,"type","markdown");ve(this,"defaultCode",`mo.md(r"""
39
+ `).trim()}catch{return e}}function Fk(e){return wT.parse(e)}var Vk=new Set(["(","[","{",",",")","]","}"]);function Hk(e,n){return e.name==="ArgList"?{args:$k(e),kwargs:Wk(e,n)}:(console.warn(`Not an ArgList, name: ${e.name}`),{args:[],kwargs:[]})}function $k(e){var o;e.firstChild();let n=[],a=e.name;do if(a=e.name,!Vk.has(a)){if(a==="VariableName"&&((o=e.node.nextSibling)==null?void 0:o.name)==="AssignOp"){e.prev();break}n.push(e.node)}while(e.nextSibling());return n}function Wk(e,n){let a=[],o=e.name;do if(o=e.name,o==="VariableName"){let s=n.slice(e.from,e.to),c=e.node.nextSibling;if(!c||c.name!=="AssignOp")continue;let h=c.nextSibling;if(!h)continue;let p=n.slice(h.from,h.to).trim();a.push({key:s,value:p})}while(e.nextSibling());return a}function Uk(e,n){if(e.name==="String"){let a=n.slice(e.from,e.to);return a.startsWith('r"""')||a.startsWith("r'''")?a.slice(4,-3):a.startsWith('"""')||a.startsWith("'''")?a.slice(3,-3):a.startsWith('r"')||a.startsWith("r'")?a.slice(2,-1):a.slice(1,-1)}if(e.name==="FormatString"){let a=n.slice(e.from,e.to);return a.startsWith('f"""')||a.startsWith("f'''")?a.slice(4,-3):a.startsWith('rf"""')||a.startsWith("rf'''")||a.startsWith('fr"""')||a.startsWith("fr'''")?a.slice(5,-3):a.startsWith('r"""')||a.startsWith("r'''")?a.slice(4,-3):a.startsWith('f"')||a.startsWith("f'")?a.slice(2,-1):a.startsWith('rf"')||a.startsWith("rf'")||a.startsWith('fr"')||a.startsWith("fr'")?a.slice(3,-1):(a.startsWith('r"')||a.startsWith("r'"),a.slice(2,-1))}return null}function Kk(e){return e===""?0:e.startsWith('rf"""')||e.startsWith("rf'''")||e.startsWith('fr"""')||e.startsWith("fr'''")?5:e.startsWith('f"""')||e.startsWith("f'''")||e.startsWith('r"""')||e.startsWith("r'''")?4:e.startsWith('"""')||e.startsWith("'''")||e.startsWith("rf'")||e.startsWith('rf"')||e.startsWith("fr'")||e.startsWith('fr"')?3:e.startsWith("f'")||e.startsWith('f"')||e.startsWith("r'")||e.startsWith('r"')?2:e.startsWith("'")||e.startsWith('"')?1:0}function Qk(e){let n=[...Eg].sort((a,o)=>o.length-a.length);for(let a of n)if(e.startsWith(a))return[a,e.slice(a.length)];return["",e]}function Gk(e,n){return e.replaceAll(`\\${n}`,n)}var Jk=[['"""','"""'],["'''","'''"],['"','"'],["'","'"]],Xk=Eg.flatMap(e=>Jk.map(([n,a])=>[e+n,a])).map(([e,n])=>[e,RegExp(`^mo\\.md\\(\\s*${Tg(e)}(.*)${Tg(n)}\\s*\\)$`,"s")]);function Tg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}let Lg,Fl;zu=class{constructor(){ve(this,"type","markdown");ve(this,"defaultCode",`mo.md(r"""
40
40
  """)`);ve(this,"defaultMetadata",{quotePrefix:"r"})}static fromMarkdown(e){return`mo.md(r"""
41
41
  ${e}
42
- """)`}transformIn(e){e=e.trim();let n={...this.defaultMetadata};if(e==="")return{code:"",offset:0,metadata:n};for(let[a,o]of Jk){let s=e.match(o);if(s){let c=s[1],[h,p]=Kk(a);n.quotePrefix=h;let g=Qk(c,p),b=e.indexOf(c);return{code:El(`
42
+ """)`}transformIn(e){e=e.trim();let n={...this.defaultMetadata};if(e==="")return{code:"",offset:0,metadata:n};for(let[a,o]of Xk){let s=e.match(o);if(s){let c=s[1],[h,p]=Qk(a);n.quotePrefix=h;let g=Gk(c,p),b=e.indexOf(c);return{code:El(`
43
43
  ${g}
44
44
  `).trim(),offset:b,metadata:n}}}return{code:e,offset:0,metadata:n}}transformOut(e,n){e===""&&(e=" ");let{quotePrefix:a}=n,o=e.replaceAll('""',String.raw`"\"`),s=`mo.md(${a}"""
45
45
  `;return{code:s+o+`
@@ -52,10 +52,10 @@ ${a.sqlString}
52
52
  output=False`}${c===Fl?"":`,
53
53
  engine=${c}`}
54
54
  )`;return{code:[...o,p].join(`
55
- `)+Yk(g)+b,offset:p.length+1}}isSupported(e){return e.trim()===""?!0:!e.includes("mo.sql")||e.split("mo.sql").length>2?!1:Og(e)!==null}extractCommentLines(e){let n=e.split(`
56
- `),a=[];for(let o of n)if(o!=null&&o.startsWith("#"))a.push(o);else break;return a}};function Xk(e){do{if(e.name==="AssignStatement")return e.node;if(e.name!=="Comment")return null}while(e.next());return null}function Og(e){try{let n=Bk(e).cursor();n.name==="Script"&&n.next();let a=Xk(n);if(!a||e.slice(a.to).trim().length>0)return null;let o=null,s=null,c,h,p=0,g=a.cursor();if(g.firstChild(),g.name==="VariableName"&&(o=e.slice(g.from,g.to)),!o)return null;let b=!1,_=null;for(;g.nextSibling();)if(g.name==="AssignOp")b=!0;else if(b&&!_){_=g.node;break}if(!_||_.name==="ConditionalExpression"||_.name==="BinaryExpression"||_.name==="UnaryExpression")return null;let S=_.cursor(),C=null;if(S.name==="CallExpression")C=S.node;else{S.firstChild();do if(S.name==="CallExpression"){C=S.node;break}while(S.nextSibling())}if(C){let E=C.cursor(),O=!1;if(E.firstChild(),E.name==="MemberExpression"&&(O=e.slice(E.from,E.to)==="mo.sql"),O){for(;E.next();)if(E.name==="ArgList"){let{args:M,kwargs:V}=Vk(E.node.cursor(),e);M.length===1&&(s=Wk(M[0],e),p=M[0].from+Uk(e.slice(M[0].from,M[0].to)));for(let{key:H,value:$}of V)switch(H){case"engine":c=$;break;case"output":h=$==="True";break}if(s==="")return{dfName:o,sqlString:"",engine:c,output:h,startPosition:p};break}}}return!o||!s?null:{dfName:o,sqlString:qk(s),engine:c,output:h,startPosition:p}}catch(n){return console.warn("Failed to parse SQL statement",n),null}}function Yk(e){return e.split(`
55
+ `)+Zk(g)+b,offset:p.length+1}}isSupported(e){return e.trim()===""?!0:!e.includes("mo.sql")||e.split("mo.sql").length>2?!1:Og(e)!==null}extractCommentLines(e){let n=e.split(`
56
+ `),a=[];for(let o of n)if(o!=null&&o.startsWith("#"))a.push(o);else break;return a}};function Yk(e){do{if(e.name==="AssignStatement")return e.node;if(e.name!=="Comment")return null}while(e.next());return null}function Og(e){try{let n=Fk(e).cursor();n.name==="Script"&&n.next();let a=Yk(n);if(!a||e.slice(a.to).trim().length>0)return null;let o=null,s=null,c,h,p=0,g=a.cursor();if(g.firstChild(),g.name==="VariableName"&&(o=e.slice(g.from,g.to)),!o)return null;let b=!1,_=null;for(;g.nextSibling();)if(g.name==="AssignOp")b=!0;else if(b&&!_){_=g.node;break}if(!_||_.name==="ConditionalExpression"||_.name==="BinaryExpression"||_.name==="UnaryExpression")return null;let S=_.cursor(),C=null;if(S.name==="CallExpression")C=S.node;else{S.firstChild();do if(S.name==="CallExpression"){C=S.node;break}while(S.nextSibling())}if(C){let E=C.cursor(),O=!1;if(E.firstChild(),E.name==="MemberExpression"&&(O=e.slice(E.from,E.to)==="mo.sql"),O){for(;E.next();)if(E.name==="ArgList"){let{args:M,kwargs:V}=Hk(E.node.cursor(),e);M.length===1&&(s=Uk(M[0],e),p=M[0].from+Kk(e.slice(M[0].from,M[0].to)));for(let{key:H,value:$}of V)switch(H){case"engine":c=$;break;case"output":h=$==="True";break}if(s==="")return{dfName:o,sqlString:"",engine:c,output:h,startPosition:p};break}}}return!o||!s?null:{dfName:o,sqlString:Bk(s),engine:c,output:h,startPosition:p}}catch(n){return console.warn("Failed to parse SQL statement",n),null}}function Zk(e){return e.split(`
57
57
  `).map(n=>n!=null&&n.trim()?` ${n}`:n).join(`
58
- `)}function Zk(e,n){return{get:()=>n.get(e),sub:a=>n.sub(e,()=>a(n.get(e)))}}function eS(e,{offset:n,body:a=window,behavior:o="smooth"}){let s=(n==null?void 0:n.top)??0,c=(n==null?void 0:n.bottom)??0,h=e.getBoundingClientRect();if(h.top<s){a.scrollBy({top:h.top-s,behavior:o});return}if(h.bottom>window.innerHeight-c){a.scrollBy({top:h.bottom-window.innerHeight+c,behavior:o});return}}Cl=function(e){return e?e.state.field(rr).type:"python"};function tS(e,n){return!e||Cl(e)===n?!1:e.state.doc.toString().trim()===""?!0:Fn[n].isSupported(nr(e))}Fh=function(e,n,a={}){return!a.force&&!tS(e,n)?!1:(Fm(e,{language:n}),n)};function nS(e){return Ka.of([{key:e.getHotkey("cell.format").key,preventDefault:!0,run:n=>(Au({[n.state.facet(sa)]:n}),!0)},{key:e.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:n=>{let a=Fh(n,Cl(n)==="markdown"?"python":"markdown",{force:!0});return a==="markdown"&&n.state.facet(ct).afterToggleMarkdown(),a!==!1}}])}xw=function(){return Et.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(n=>n.effects.some(a=>a.is(us))))return;Ag(e.view,{behavior:"smooth"})}})};function Ag(e,n){let a=e.dom.getElementsByClassName("cm-activeLine cm-line");if(a.length===1){let o=a[0],s=document.getElementById("App");rn(s,"App not found"),eS(o,{offset:{top:30,bottom:150},body:s,behavior:n.behavior})}}function rS(){return{}}let aS,iS,Ig;({reducer:aS,createActions:iS,valueAtom:Ga,useActions:Ig}=yl(rS,{setVariables:(e,n)=>{let a={...e},o={};for(let s of n)o[s.name]={...a[s.name],...s};return o},addVariables:(e,n)=>{let a={...e};for(let o of n)a[o.name]={...a[o.name],...o};return a},setMetadata:(e,n)=>{let a={...e};for(let{name:o,value:s,dataType:c}of n)a[o]&&(a[o]={...a[o],value:s,dataType:c});return a}})),iw=()=>mn(Ga),u_=function(){return Ig()},Jh=function(e){let n=e.storage||as;return{getItem(a,o){try{let s=n.getItem(a);if(!s)return o;let c=JSON.parse(s);return e.fromSerializable(c)}catch(s){return be.warn(`Error getting ${a} from storage`,s),o}},setItem:(a,o)=>{n.setItem(a,JSON.stringify(e.toSerializable(o)))},removeItem:a=>{n.removeItem(a)}}},td=Ym(()=>as),jh=function(e,n){if(typeof window>"u")return;let a=`__marimo__${n}`;window[a]&&be.warn(`Overwriting existing debug object ${a}`),window[a]=e};var oS={markdown:!0,wasm_layouts:!1,rtc_v2:!1,cache_panel:!1,external_agents:!1,server_side_pdf_export:!0,storage_inspector:!1};Mu=function(e){var n,a;return((a=(n=R2())==null?void 0:n.experimental)==null?void 0:a[e])??oS[e]};function sS(e,n){oa().saveUserConfig({config:{experimental:{[e]:n}}})}jh(sS,"setFeatureFlag"),wl=[{type:"files",Icon:ag,label:"Files",tooltip:"View files",defaultSection:"sidebar"},{type:"variables",Icon:Im,label:"Variables",tooltip:"Explore variables and data sources",defaultSection:"sidebar"},{type:"packages",Icon:bm,label:"Packages",tooltip:"Manage packages",defaultSection:"sidebar"},{type:"ai",Icon:xm,label:"AI",tooltip:"Chat & Agents",defaultSection:"sidebar"},{type:"outline",Icon:fm,label:"Outline",tooltip:"View outline",defaultSection:"sidebar"},{type:"documentation",Icon:Uh,label:"Docs",tooltip:"View live docs",defaultSection:"sidebar"},{type:"dependencies",Icon:_m,label:"Dependencies",tooltip:"Explore dependencies",defaultSection:"sidebar"},{type:"errors",Icon:ym,label:"Errors",tooltip:"View errors",defaultSection:"developer-panel"},{type:"scratchpad",Icon:Ph,label:"Scratchpad",tooltip:"Scratchpad",defaultSection:"developer-panel"},{type:"tracing",Icon:Lm,label:"Tracing",tooltip:"View tracing",defaultSection:"developer-panel"},{type:"secrets",Icon:ig,label:"Secrets",tooltip:"Manage secrets",defaultSection:"developer-panel",hidden:vh()},{type:"logs",Icon:Rm,label:"Logs",tooltip:"View logs",defaultSection:"developer-panel"},{type:"terminal",Icon:om,label:"Terminal",tooltip:"Terminal",hidden:vh(),defaultSection:"developer-panel",requiredCapability:"terminal"},{type:"snippets",Icon:og,label:"Snippets",tooltip:"Snippets",defaultSection:"developer-panel"},{type:"cache",Icon:Eh,label:"Cache",tooltip:"View cache",defaultSection:"developer-panel",hidden:!Mu("cache_panel")}],z_=new Map(wl.map(e=>[e.type,e])),Nw=function(e,n){return!!(e.hidden||e.requiredCapability&&!n[e.requiredCapability])};var lS=Zn(),jd={sidebar:wl.filter(e=>!e.hidden&&e.defaultSection==="sidebar").map(e=>e.type),developerPanel:wl.filter(e=>!e.hidden&&e.defaultSection==="developer-panel").map(e=>e.type)};function cS(e){let n=new Set([...e.sidebar,...e.developerPanel]);return{sidebar:[...e.sidebar,...jd.sidebar.filter(a=>!n.has(a))],developerPanel:[...e.developerPanel,...jd.developerPanel.filter(a=>!n.has(a))]}}gm=Al("marimo:panel-layout",jd,Jh({toSerializable:e=>e,fromSerializable:e=>cS(e)}),{getOnInit:!0});function Rg(e){let n=Fe.get(gm);return n.sidebar.includes(e)?"sidebar":n.developerPanel.includes(e)?"developer-panel":null}var Mg="marimo:sidebar",Pg=new sd(E2({selectedPanel:T2().optional().transform(e=>e),isSidebarOpen:L2(),isDeveloperPanelOpen:L2().optional().default(!1),selectedDeveloperPanelTab:T2().optional().default("errors").transform(e=>e)}),uS);function uS(){return{selectedPanel:"variables",isSidebarOpen:!1,isDeveloperPanelOpen:!1,selectedDeveloperPanelTab:"errors"}}let dS,fS,Ng;({reducer:dS,createActions:fS,valueAtom:ud,useActions:Ng}=yl(()=>Pg.get(Mg),{openApplication:(e,n)=>{let a=Rg(n);return a==="sidebar"?{...e,selectedPanel:n,isSidebarOpen:!0}:a==="developer-panel"?{...e,selectedDeveloperPanelTab:n,isDeveloperPanelOpen:!0}:e},toggleApplication:(e,n)=>{let a=Rg(n);return a==="sidebar"?{...e,selectedPanel:n,isSidebarOpen:e.isSidebarOpen?e.selectedPanel!==n:!0}:a==="developer-panel"?{...e,selectedDeveloperPanelTab:n,isDeveloperPanelOpen:e.isDeveloperPanelOpen?e.selectedDeveloperPanelTab!==n:!0}:e},toggleSidebarPanel:e=>({...e,isSidebarOpen:!e.isSidebarOpen}),setIsSidebarOpen:(e,n)=>({...e,isSidebarOpen:n}),toggleDeveloperPanel:e=>({...e,isDeveloperPanelOpen:!e.isDeveloperPanelOpen}),setIsDeveloperPanelOpen:(e,n)=>({...e,isDeveloperPanelOpen:n})},[(e,n)=>Pg.set(Mg,n)])),Rw=()=>{let e=(0,lS.c)(2),n=mn(ud);if(n.isSidebarOpen)return n;let a;return e[0]===n?a=e[1]:(a={...n,selectedPanel:void 0},e[0]=n,e[1]=a),a},V_=function(){return Ng()},Bm=Ce({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1,pyrefly:!1});function ds(e){var n;return((n=Fe.get(Bm))==null?void 0:n[e])??!1}Wu=Ce({documentation:null});var Dg=new Set(["FunctionDefinition","LambdaExpression","ArrayComprehensionExpression","SetComprehension","DictionaryComprehensionExpression","ComprehensionExpression","ClassDefinition"]);function pS(e){let n=D2(e.state);if(!n||gS(n))return[];let a=new Set(Object.keys(e.variables).filter(E=>{let O=e.variables[E];return O.dataType!=="module"&&!O.declaredBy.includes("setup")&&!O.declaredBy.includes(e.cellId)}));if(a.size===0)return[];let o=[],s=new Map,c=new Map,h=new Map;function p(E,O){var ne,fe,R,j,F,se,ce,he,ye,xe,Qe;let M=E.cursor(),V=M.name,H=M.from,$=Dg.has(V),N=O;switch($&&(N=[...O,H],s.set(H,new Set),c.set(H,V)),V){case"FunctionDefinition":{let pe=E.cursor();pe.firstChild();do if(pe.name==="VariableName"){let ee=e.state.doc.sliceString(pe.from,pe.to),U=O[O.length-1]??-1;s.has(U)||s.set(U,new Set),(ne=s.get(U))==null||ne.add(ee);break}while(pe.nextSibling());let ie=E.cursor();ie.firstChild();do if(ie.name==="ParamList"){let ee=ie.node.cursor();ee.firstChild();do if(ee.name==="VariableName"){let U=e.state.doc.sliceString(ee.from,ee.to);(fe=s.get(H))==null||fe.add(U)}while(ee.nextSibling())}while(ie.nextSibling());break}case"LambdaExpression":{let pe=E.cursor();pe.firstChild();do if(pe.name==="ParamList"){let ie=pe.node.cursor();ie.firstChild();do if(ie.name==="VariableName"){let ee=e.state.doc.sliceString(ie.from,ie.to);(R=s.get(H))==null||R.add(ee)}while(ie.nextSibling())}while(pe.nextSibling());break}case"ArrayComprehensionExpression":case"DictionaryComprehensionExpression":case"SetComprehension":case"ComprehensionExpression":{let pe=E.cursor();pe.firstChild();let ie=!1;do if(pe.name==="for")ie=!0;else if(ie&&pe.name==="VariableName"){let ee=e.state.doc.sliceString(pe.from,pe.to);(j=s.get(H))==null||j.add(ee)}else if(ie&&pe.name==="TupleExpression"){let ee=pe.node.cursor();ee.firstChild();do if(ee.name==="VariableName"){let U=e.state.doc.sliceString(ee.from,ee.to);(F=s.get(H))==null||F.add(U)}while(ee.nextSibling())}else ie&&pe.name==="in"&&(ie=!1);while(pe.nextSibling());break}case"ClassDefinition":{let pe=E.cursor();pe.firstChild();do if(pe.name==="VariableName"){let ie=e.state.doc.sliceString(pe.from,pe.to),ee=O[O.length-1]??-1;s.has(ee)||s.set(ee,new Set),(se=s.get(ee))==null||se.add(ie);break}while(pe.nextSibling());h.set(H,[]);break}case"AssignStatement":{let pe=E.cursor(),ie=[];pe.firstChild();do pe.name==="AssignOp"&&ie.push(pe.from);while(pe.nextSibling());let ee=ie[ie.length-1],U=E.cursor();U.firstChild();let Ae=N[N.length-1]??-1;do U.from<ee&&zd(U,{currentScope:Ae,state:e.state,allDeclarations:s,scopeTypes:c,classLevelDeclarations:h,assignmentPosition:M.to});while(U.nextSibling());break}case"ForStatement":{let pe=E.cursor();pe.firstChild();let ie=!1;do if(pe.name==="for")ie=!0;else if(ie&&pe.name==="VariableName"){let ee=e.state.doc.sliceString(pe.from,pe.to),U=N[N.length-1]??-1;s.has(U)||s.set(U,new Set),(ce=s.get(U))==null||ce.add(ee)}else ie&&pe.name==="in"&&(ie=!1);while(pe.nextSibling());break}case"ImportStatement":{let pe=E.cursor();pe.firstChild();do if(pe.name==="VariableName"){let ie=e.state.doc.sliceString(pe.from,pe.to),ee=N[N.length-1]??-1;s.has(ee)||s.set(ee,new Set),(he=s.get(ee))==null||he.add(ie)}while(pe.nextSibling());break}case"ImportFromStatement":{let pe=E.cursor();pe.firstChild();let ie=!1;do if(pe.name==="import")ie=!0;else if(ie&&pe.name==="VariableName"){let ee=e.state.doc.sliceString(pe.from,pe.to),U=N[N.length-1]??-1;s.has(U)||s.set(U,new Set),(ye=s.get(U))==null||ye.add(ee)}while(pe.nextSibling());break}case"TryStatement":{let pe=E.cursor();pe.firstChild();let ie=!1;do if(pe.name==="as")ie=!0;else if(ie&&pe.name==="VariableName"){let ee=e.state.doc.sliceString(pe.from,pe.to),U=N[N.length-1]??-1;s.has(U)||s.set(U,new Set),(xe=s.get(U))==null||xe.add(ee),ie=!1}while(pe.nextSibling());break}case"WithStatement":{let pe=E.cursor();pe.firstChild();let ie=!1;do if(pe.name==="as")ie=!0;else if(ie&&pe.name==="VariableName"){let ee=e.state.doc.sliceString(pe.from,pe.to),U=N[N.length-1]??-1;s.has(U)||s.set(U,new Set),(Qe=s.get(U))==null||Qe.add(ee),ie=!1}while(pe.nextSibling());break}}C(M,pe=>{p(pe,N)})}function g(E,O,M){let V=h.get(O);return V?V.some(([H,$])=>H===E&&$<M):!1}function b(E,O,M){var V,H;for(let $ of O)if(c.get($)==="ClassDefinition"){if(g(E,$,M))return!0}else if((V=s.get($))!=null&&V.has(E))return!0;return((H=s.get(-1))==null?void 0:H.has(E))??!1}function _(E,O){let M=E.cursor(),V=M.name,H=M.from,$=Dg.has(V),N=O;if($&&(N=[...O,H]),V==="VariableName"){let ne=e.state.doc.sliceString(M.from,M.to);S(ne,M)&&(b(ne,N,M.from)||o.push({from:M.from,to:M.to,variableName:ne}))}C(M,ne=>{_(ne,N)})}function S(E,O){return a.has(E)&&!hS(O)&&!mS(O)}function C(E,O){if(E.firstChild())do O(E.node);while(E.nextSibling())}return p(n,[]),_(n,[]),o}function hS(e){let n=e.node.cursor();if(n.moveTo(e.from),n.parent()&&n.name==="CallExpression"&&n.firstChild())do if(n.name==="ArgList"&&n.firstChild()){do if(n.from===e.from&&n.to===e.to)return n.nextSibling()&&n.name==="AssignOp";while(n.nextSibling());break}while(n.nextSibling());return!1}function mS(e){let n=e.node.cursor();if(n.parent()&&n.name==="AssignStatement"){let a=n.node.cursor();a.firstChild();let o=-1;do if(a.name==="AssignOp"){o=a.from;break}while(a.nextSibling());return o!==-1&&e.from<o}return!1}function gS(e){let n=e.cursor();do if(n.name==="\u26A0"||n.type.isError)return!0;while(n.next());return!1}function zd(e,n){var a;switch(e.name){case"VariableName":{let o=n.state.doc.sliceString(e.from,e.to);if(n.currentScope!==-1&&n.scopeTypes.get(n.currentScope)==="ClassDefinition"){let s=n.classLevelDeclarations.get(n.currentScope);s&&s.push([o,n.assignmentPosition])}else n.allDeclarations.has(n.currentScope)||n.allDeclarations.set(n.currentScope,new Set),(a=n.allDeclarations.get(n.currentScope))==null||a.add(o);break}case"TupleExpression":{let o=e.node.cursor();o.firstChild();do zd(o,n);while(o.nextSibling());break}case"ArrayExpression":{let o=e.node.cursor();o.firstChild();do zd(o,n);while(o.nextSibling());break}}}var yS=ia.mark({class:"mo-cm-reactive-reference"});g_=ia.mark({class:"mo-cm-reactive-reference-hover"});var jg=aa.define(),vS=class{constructor(e,n){ve(this,"highlightDebounceMs",300);this.view=e,this.cellId=n,this.scheduleHighlighting=O2(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=Fe.sub(Ga,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=pS({state:this.view.state,cellId:this.cellId,variables:Fe.get(Ga)});e.length>0&&be.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:jg.of(e)})})}};Xu=Zo.define({create(){return{decorations:ia.none,ranges:[]}},update(e,n){let a={decorations:e.decorations.map(n.changes),ranges:e.ranges};for(let o of n.effects)o.is(jg)&&(a={decorations:ia.set(o.value.map(s=>yS.range(s.from,s.to))),ranges:o.value});return a},provide:e=>Et.decorations.from(e,n=>n.decorations)});function bS(e){return[Xu,ts.define(n=>new vS(n,e))]}o_=function(e,n){return n?bS(e):[]};function zg(e,n=!1){if(!e)return null;let a=document.createElement("span");if(a.classList.add("mo-cm-tooltip"),a.classList.add("docs-documentation"),n&&a.classList.add("cm-tooltip-section"),a.style.display="flex",a.style.flexDirection="column",a.style.gap=".8rem",a.innerHTML=e,n){let o=document.createElement("div");o.classList.add("text-xs","text-muted-foreground","font-medium","pt-1","-mt-2","border-t","border-border");let s=document.createElement("kbd");s.className="ml-1 rounded-md bg-muted/40 px-2 text-[0.75rem] font-prose center border border-foreground/20 text-muted-foreground inline whitespace-nowrap",s.textContent=p5()?"\u2318":"Ctrl",o.append(document.createTextNode("Jump to defining cell ")),o.append(s),o.append(document.createTextNode(" + Click")),a.append(o)}return a}id=new Ou("autocomplete-result",async(e,n)=>{let{sendCodeCompletionRequest:a}=oa();await a({id:e,...n})});var wS={param:3,property:2};const qd={asCompletionResult(e,n){return{from:e-n.prefix_length,options:n.options.map(a=>({label:a.name,type:a.type,boost:wS[a.type]??1,info:()=>zg(a.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:n,limitToType:a,excludeTypes:o,exactName:s,showGoToDefinitionHint:c=!1}){let h=_S(n.options,s);if(!h)return;let p=e-n.prefix_length,g=zg(h.completion_info,c);if(g&&!(a&&h.type!==a)&&!(o!=null&&o.includes(h.type)))return{pos:p,html:h.completion_info,end:p+h.name.length,above:!0,create:()=>({dom:g,resize:!1})}}};function _S(e,n){if(e.length!==0){if(e.length===1)return e[0];if(n)return e.find(a=>a.name===n)}}n_=function(e){var n;return[(n=e==null?void 0:e.pylsp)!=null&&n.enabled&&ds("pylsp")?[]:wh(async(a,o)=>{let s=await qg({view:a,pos:o,excludeTypes:["tooltip"]});return s===null||s==="cancelled"?null:s},{hideOnChange:!0}),SS]};async function qg({view:e,pos:n,excludeTypes:a}){var _;let o=En.findElement(e.dom);if(!o)return be.error("Failed to find active cell."),null;let s=En.parse(o.id),{startToken:c,endToken:h}=Bd(e.state.doc,n),p=((_=e.state.field(Xu,!1))==null?void 0:_.ranges.some(S=>n>=S.from&&n<=S.to))??!1,g=await id.request({document:e.state.doc.slice(0,h).toString(),cellId:s});if(!g)return"cancelled";let b=e.state.doc.slice(c,h).toString();return qd.asHoverTooltip({position:h,message:g,exactName:b,excludeTypes:a,showGoToDefinitionHint:p})??null}function Bd(e,n){let a=n,o=a>0?e.sliceString(a-1,a):"",s=a<e.length?e.sliceString(a,a+1):"";o==="("&&s===")"&&--a;let c=a,h=a;for(;c>0;){let p=e.sliceString(c-1,c);if(!/\w/.test(p))break;c--}for(;h<e.length;){let p=e.sliceString(h,h+1);if(!/\w/.test(p))break;h++}return{startToken:c,endToken:h}}function xS(e){let{head:n}=e.selection.main,a=e.doc.sliceString(n-1,n);return/\w/.test(a)}var kS=O2(async(e,n)=>{if(Fe.get(ud).selectedPanel!=="documentation")return;let a=await qg({view:e,pos:n});a!=="cancelled"&&Fe.set(Wu,{documentation:(a==null?void 0:a.html)??null})},300),SS=Et.updateListener.of(e=>{if(e.selectionSet&&xS(e.state)){let n=e.state.selection.main.head;kS(e.view,n)}});function Bg(e,n){e.focus(),requestAnimationFrame(()=>{e.dispatch({selection:{anchor:n,head:n},effects:Et.scrollIntoView(n,{y:"center"})})})}Gu=function(e,n){let{state:a}=e,o=D2(a),s=!1,c=0;return o.iterate({enter:h=>{if(s)return!1;if(h.name==="VariableName"&&a.doc.sliceString(h.from,h.to)===n)return c=h.from,s=!0,!1;if(h.name==="Comment"||h.name==="String")return!1}}),s?(Bg(e,c),!0):!1};function CS(e,n){return Bg(e,e.state.doc.line(n).from),!0}function ES(e){let{from:n,to:a}=e.selection.main;if(n===a){let{startToken:o,endToken:s}=Bd(e.doc,n);return e.doc.sliceString(o,s)}return e.doc.sliceString(n,a)}function TS(e,n){if(!n)return null;let a=e[n];return!a||a.declaredBy.length===0?null:a.declaredBy[0]}function LS(e){return e.startsWith("_")}zm=function(e){let{state:n}=e,a=ES(n);return a?(kh(e),e.dispatch({effects:P5}),Cm(e,a)):!1},Cm=function(e,n){let a=OS(e,n);return a?Gu(a,n):!1},Jw=function(e,n){let a=Fg(e);return a?CS(a,n):!1};function OS(e,n){if(LS(n))return e;let a=TS(Fe.get(Ga),n);return a?Fg(a):null}function Fg(e){var n;return((n=Fe.get(Ye).cellHandles[e].current)==null?void 0:n.editorView)??null}function AS(e){var n=e.Pos;function a(u,f,y){if(f.line===y.line&&f.ch>=y.ch-1){var v=u.getLine(f.line).charCodeAt(f.ch);55296<=v&&v<=55551&&(y.ch+=1)}return{start:f,end:y}}var o=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"g<Up>",type:"keyToKey",toKeys:"gk"},{keys:"g<Down>",type:"keyToKey",toKeys:"gj"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h"},{keys:"<Del>",type:"keyToKey",toKeys:"x"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"gq",type:"operator",operator:"hardWrap"},{keys:"gw",type:"operator",operator:"hardWrap",operatorArgs:{keepCursor:!0}},{keys:"g?",type:"operator",operator:"rot13"},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-u>",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<register>",type:"action",action:"replayMacro"},{keys:"q<register>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<register>",type:"action",action:"setMark"},{keys:'"<register>',type:"action",action:"setRegister"},{keys:"<C-r><register>",type:"action",action:"insertRegister",context:"insert",isEdit:!0},{keys:"<C-o>",type:"action",action:"oneNormalCommand",context:"insert"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<register>",type:"motion",motion:"textObjectManipulation"},{keys:"i<register>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],s=Object.create(null),c=o.length,h=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"omap",shortName:"om"},{name:"noremap",shortName:"no"},{name:"nnoremap",shortName:"nn"},{name:"vnoremap",shortName:"vn"},{name:"inoremap",shortName:"ino"},{name:"onoremap",shortName:"ono"},{name:"unmap"},{name:"mapclear",shortName:"mapc"},{name:"nmapclear",shortName:"nmapc"},{name:"vmapclear",shortName:"vmapc"},{name:"imapclear",shortName:"imapc"},{name:"omapclear",shortName:"omapc"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"startinsert",shortName:"start"},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"marks",excludeFromCommandHistory:!0},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"delete",shortName:"d"},{name:"join",shortName:"j"},{name:"normal",shortName:"norm"},{name:"global",shortName:"g"}],p=uo("");function g(u){u.setOption("disableInput",!0),u.setOption("showCursorWhenSelecting",!1),e.signal(u,"vim-mode-change",{mode:"normal"}),u.on("cursorActivity",wo),ee(u),e.on(u.getInputField(),"paste",_(u))}function b(u){u.setOption("disableInput",!1),u.off("cursorActivity",wo),e.off(u.getInputField(),"paste",_(u)),u.state.vim=null,Ea&&clearTimeout(Ea)}function _(u){var f=u.state.vim;return f.onPasteFn||(f.onPasteFn=function(){f.insertMode||(u.setCursor(kt(u.getCursor(),0,1)),Nr.enterInsertMode(u,{},f))}),f.onPasteFn}var S=/[\d]/,C=[e.isWordChar,function(u){return u&&!e.isWordChar(u)&&!/\s/.test(u)}],E=[function(u){return/\S/.test(u)}],O=["<",">"],M=["-",'"',".",":","_","/","+"],V=/^\w$/,H=/^[A-Z]$/;try{H=RegExp("^[\\p{Lu}]$","u")}catch{}function $(u,f){return f>=u.firstLine()&&f<=u.lastLine()}function N(u){return/^[a-z]$/.test(u)}function ne(u){return"()[]{}".indexOf(u)!=-1}function fe(u){return S.test(u)}function R(u){return H.test(u)}function j(u){return/^\s*$/.test(u)}function F(u){return".?!".indexOf(u)!=-1}function se(u,f){for(var y=0;y<f.length;y++)if(f[y]==u)return!0;return!1}var ce={};function he(u,f,y,v,w){if(f===void 0&&!w)throw Error("defaultValue is required unless callback is provided");if(y||(y="string"),ce[u]={type:y,defaultValue:f,callback:w},v)for(var x=0;x<v.length;x++)ce[v[x]]=ce[u];f&&ye(u,f)}function ye(u,f,y,v){var w=ce[u];v||(v={});var x=v.scope;if(!w)return Error("Unknown option: "+u);if(w.type=="boolean"){if(f&&f!==!0)return Error("Invalid argument: "+u+"="+f);f!==!1&&(f=!0)}w.callback?(x!=="local"&&w.callback(f,void 0),x!=="global"&&y&&w.callback(f,y)):(x!=="local"&&(w.value=w.type=="boolean"?!!f:f),x!=="global"&&y&&(y.state.vim.options[u]={value:f}))}function xe(u,f,y){var v=ce[u];y||(y={});var w=y.scope;if(!v)return Error("Unknown option: "+u);if(v.callback){let x=f&&v.callback(void 0,f);return w!=="global"&&x!==void 0?x:w==="local"?void 0:v.callback()}else return(w!=="global"&&f&&f.state.vim.options[u]||w!=="local"&&v||{}).value}he("filetype",void 0,"string",["ft"],function(u,f){if(f!==void 0)if(u===void 0){let y=f.getOption("mode");return y=="null"?"":y}else{let y=u==""?"null":u;f.setOption("mode",y)}}),he("textwidth",80,"number",["tw"],function(u,f){if(f!==void 0){if(u===void 0)return f.getOption("textwidth");var y=Math.round(u);y>1&&f.setOption("textwidth",y)}});var Qe=function(){var u=100,f=-1,y=0,v=0,w=Array(u);function x(I,D,P){var Z=w[f%u];function X(Q){var ge=++f%u,me=w[ge];me&&me.clear(),w[ge]=I.setBookmark(Q)}if(Z){var K=Z.find();K&&!mt(K,D)&&X(D)}else X(D);X(P),y=f,v=f-u+1,v<0&&(v=0)}function T(I,D){f+=D,f>y?f=y:f<v&&(f=v);var P=w[(u+f)%u];if(P&&!P.find()){var Z=D>0?1:-1,X,K=I.getCursor();do if(f+=Z,P=w[(u+f)%u],P&&(X=P.find())&&!mt(K,X))break;while(f<y&&f>v)}return P}function A(I,D){var P=f,Z=T(I,D);return f=P,Z&&Z.find()}return{cachedCursor:void 0,add:x,find:A,move:T}},pe=function(u){return u?{changes:u.changes,expectCursorActivityForChange:u.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class ie{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=pe()}exitMacroRecordMode(){var f=U.macroModeState;f.onRecordingDone&&f.onRecordingDone(),f.onRecordingDone=void 0,f.isRecording=!1}enterMacroRecordMode(f,y){var v=U.registerController.getRegister(y);if(v){if(v.clear(),this.latestRegister=y,f.openDialog){var w=sn("span",{class:"cm-vim-message"},"recording @"+y);this.onRecordingDone=f.openDialog(w,function(){},{bottom:!0})}this.isRecording=!0}}}function ee(u){return u.state.vim||(u.state.vim={inputState:new bs,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:void 0,sel:{anchor:new n(0,0),head:new n(0,0)},options:{},expectLiteralNext:!1,status:""}),u.state.vim}var U;function Ae(){for(var u in U={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:Qe(),macroModeState:new ie,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new tc({}),searchHistoryController:new fo,exCommandHistoryController:new fo},ce){var f=ce[u];f.value=f.defaultValue}}class Ve{constructor(f,y){this.keyName=f,this.key=y.key,this.ctrlKey=y.ctrlKey,this.altKey=y.altKey,this.metaKey=y.metaKey,this.shiftKey=y.shiftKey}}var nt,He={enterVimMode:g,leaveVimMode:b,buildKeyMap:function(){},getRegisterController:function(){return U.registerController},resetVimGlobalState_:Ae,getVimGlobalState_:function(){return U},maybeInitVimState_:ee,suppressErrorLogging:!1,InsertModeKey:Ve,map:function(u,f,y){Kt.map(u,f,y)},unmap:function(u,f){return Kt.unmap(u,f)},noremap:function(u,f,y){Kt.map(u,f,y,!0)},mapclear:function(u){var f=o.length,y=c,v=o.slice(0,f-y);if(o=o.slice(f-y),u)for(var w=v.length-1;w>=0;w--){var x=v[w];if(u!==x.context)if(x.context)this._mapCommand(x);else{var T=["normal","insert","visual"];for(var A in T)if(T[A]!==u){var I=Object.assign({},x);I.context=T[A],this._mapCommand(I)}}}},langmap:ci,vimKeyFromEvent:Pr,setOption:ye,getOption:xe,defineOption:he,defineEx:function(u,f,y){if(!f)f=u;else if(u.indexOf(f)!==0)throw Error('(Vim.defineEx) "'+f+'" is not a prefix of "'+u+'", command not registered');$n[u]=y,Kt.commandMap_[f]={name:u,shortName:f,type:"api"}},handleKey:function(u,f,y){var v=this.findKey(u,f,y);if(typeof v=="function")return v()},multiSelectHandleKey:Fr,findKey:function(u,f,y){var v=ee(u),w=u;function x(){var P=U.macroModeState;if(P.isRecording){if(f=="q")return P.exitMacroRecordMode(),ht(w),!0;y!="mapping"&&fr(P,f)}}function T(){if(f=="<Esc>"){if(v.visualMode)In(w);else if(v.insertMode)pn(w);else return;return ht(w),!0}}function A(){if(T())return!0;v.inputState.keyBuffer.push(f);var P=v.inputState.keyBuffer.join(""),Z=f.length==1,X=ur.matchCommand(P,o,v.inputState,"insert"),K=v.inputState.changeQueue;if(X.type=="none")return ht(w),!1;if(X.type=="partial"){if(X.expectLiteralNext&&(v.expectLiteralNext=!0),nt&&window.clearTimeout(nt),nt=Z&&window.setTimeout(function(){v.insertMode&&v.inputState.keyBuffer.length&&ht(w)},xe("insertModeEscKeysTimeout")),Z){var Q=w.listSelections();(!K||K.removed.length!=Q.length)&&(K=v.inputState.changeQueue=new ws),K.inserted+=f;for(var ge=0;ge<Q.length;ge++){var me=Xt(Q[ge].anchor,Q[ge].head),Oe=kr(Q[ge].anchor,Q[ge].head),we=w.getRange(me,w.state.overwrite?kt(Oe,0,1):Oe);K.removed[ge]=(K.removed[ge]||"")+we}}return!Z}else X.type=="full"&&(v.inputState.keyBuffer.length=0);if(v.expectLiteralNext=!1,nt&&window.clearTimeout(nt),X.command&&K){for(var Q=w.listSelections(),ge=0;ge<Q.length;ge++){var Ee=Q[ge].head;w.replaceRange(K.removed[ge]||"",kt(Ee,0,-K.inserted.length),Ee,"+input")}U.macroModeState.lastInsertModeChanges.changes.pop()}return X.command||ht(w),X.command}function I(){if(x()||T())return!0;v.inputState.keyBuffer.push(f);var P=v.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(P))return!0;var Z=/^(\d*)(.*)$/.exec(P);if(!Z)return ht(w),!1;var X=v.visualMode?"visual":"normal",K=Z[2]||Z[1];v.inputState.operatorShortcut&&v.inputState.operatorShortcut.slice(-1)==K&&(K=v.inputState.operatorShortcut);var Q=ur.matchCommand(K,o,v.inputState,X);return Q.type=="none"?(ht(w),!1):Q.type=="partial"?(Q.expectLiteralNext&&(v.expectLiteralNext=!0),!0):Q.type=="clear"?(ht(w),!0):(v.expectLiteralNext=!1,v.inputState.keyBuffer.length=0,Z=/^(\d*)(.*)$/.exec(P),Z&&Z[1]&&Z[1]!="0"&&v.inputState.pushRepeatDigit(Z[1]),Q.command)}var D=v.insertMode?A():I();if(D===!1)return!v.insertMode&&(f.length===1||e.isMac&&/<A-.>/.test(f))?function(){return!0}:void 0;if(D===!0)return function(){return!0};if(D)return function(){return w.operation(function(){w.curOp.isVimOp=!0;try{if(typeof D!="object")return;D.type=="keyToKey"?Mt(w,D.toKeys,D):ur.processCommand(w,v,D)}catch(P){throw w.state.vim=void 0,ee(w),He.suppressErrorLogging||console.log(P),P}return!0})}},handleEx:function(u,f){Kt.processCommand(u,f)},defineMotion:hf,defineAction:rc,defineOperator:mf,mapCommand:yc,_mapCommand:Er,defineRegister:pf,exitVisualMode:In,exitInsertMode:pn},ze=[],Le=!1,Re;function Tt(u){if(!Re)throw Error("No prompt to send key to");if(u[0]=="<"){var f=u.toLowerCase().slice(1,-1);if(f=f.split("-").pop()||"",f=="lt")u="<";else if(f=="space")u=" ";else if(f=="cr")u=`
58
+ `)}function eS(e,n){return{get:()=>n.get(e),sub:a=>n.sub(e,()=>a(n.get(e)))}}function tS(e,{offset:n,body:a=window,behavior:o="smooth"}){let s=(n==null?void 0:n.top)??0,c=(n==null?void 0:n.bottom)??0,h=e.getBoundingClientRect();if(h.top<s){a.scrollBy({top:h.top-s,behavior:o});return}if(h.bottom>window.innerHeight-c){a.scrollBy({top:h.bottom-window.innerHeight+c,behavior:o});return}}Cl=function(e){return e?e.state.field(rr).type:"python"};function nS(e,n){return!e||Cl(e)===n?!1:e.state.doc.toString().trim()===""?!0:Fn[n].isSupported(nr(e))}Vh=function(e,n,a={}){return!a.force&&!nS(e,n)?!1:(Fm(e,{language:n}),n)};function rS(e){return Ka.of([{key:e.getHotkey("cell.format").key,preventDefault:!0,run:n=>(Au({[n.state.facet(sa)]:n}),!0)},{key:e.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:n=>{let a=Vh(n,Cl(n)==="markdown"?"python":"markdown",{force:!0});return a==="markdown"&&n.state.facet(ct).afterToggleMarkdown(),a!==!1}}])}_w=function(){return Et.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(n=>n.effects.some(a=>a.is(us))))return;Ag(e.view,{behavior:"smooth"})}})};function Ag(e,n){let a=e.dom.getElementsByClassName("cm-activeLine cm-line");if(a.length===1){let o=a[0],s=document.getElementById("App");rn(s,"App not found"),tS(o,{offset:{top:30,bottom:150},body:s,behavior:n.behavior})}}function aS(){return{}}let iS,oS,Ig;({reducer:iS,createActions:oS,valueAtom:Ga,useActions:Ig}=yl(aS,{setVariables:(e,n)=>{let a={...e},o={};for(let s of n)o[s.name]={...a[s.name],...s};return o},addVariables:(e,n)=>{let a={...e};for(let o of n)a[o.name]={...a[o.name],...o};return a},setMetadata:(e,n)=>{let a={...e};for(let{name:o,value:s,dataType:c}of n)a[o]&&(a[o]={...a[o],value:s,dataType:c});return a}})),iw=()=>mn(Ga),c_=function(){return Ig()},Xh=function(e){let n=e.storage||as;return{getItem(a,o){try{let s=n.getItem(a);if(!s)return o;let c=JSON.parse(s);return e.fromSerializable(c)}catch(s){return be.warn(`Error getting ${a} from storage`,s),o}},setItem:(a,o)=>{n.setItem(a,JSON.stringify(e.toSerializable(o)))},removeItem:a=>{n.removeItem(a)}}},ed=Ym(()=>as),qh=function(e,n){if(typeof window>"u")return;let a=`__marimo__${n}`;window[a]&&be.warn(`Overwriting existing debug object ${a}`),window[a]=e};var sS={markdown:!0,wasm_layouts:!1,rtc_v2:!1,cache_panel:!1,external_agents:!1,server_side_pdf_export:!0,storage_inspector:!1};Mu=function(e){var n,a;return((a=(n=R2())==null?void 0:n.experimental)==null?void 0:a[e])??sS[e]};function lS(e,n){oa().saveUserConfig({config:{experimental:{[e]:n}}})}qh(lS,"setFeatureFlag"),wl=[{type:"files",Icon:ag,label:"Files",tooltip:"View files",defaultSection:"sidebar"},{type:"variables",Icon:Im,label:"Variables",tooltip:"Explore variables and data sources",defaultSection:"sidebar"},{type:"packages",Icon:bm,label:"Packages",tooltip:"Manage packages",defaultSection:"sidebar"},{type:"ai",Icon:xm,label:"AI",tooltip:"Chat & Agents",defaultSection:"sidebar"},{type:"outline",Icon:fm,label:"Outline",tooltip:"View outline",defaultSection:"sidebar"},{type:"documentation",Icon:Kh,label:"Docs",tooltip:"View live docs",defaultSection:"sidebar"},{type:"dependencies",Icon:_m,label:"Dependencies",tooltip:"Explore dependencies",defaultSection:"sidebar"},{type:"errors",Icon:ym,label:"Errors",tooltip:"View errors",defaultSection:"developer-panel"},{type:"scratchpad",Icon:Ph,label:"Scratchpad",tooltip:"Scratchpad",defaultSection:"developer-panel"},{type:"tracing",Icon:Lm,label:"Tracing",tooltip:"View tracing",defaultSection:"developer-panel"},{type:"secrets",Icon:ig,label:"Secrets",tooltip:"Manage secrets",defaultSection:"developer-panel",hidden:vh()},{type:"logs",Icon:Rm,label:"Logs",tooltip:"View logs",defaultSection:"developer-panel"},{type:"terminal",Icon:om,label:"Terminal",tooltip:"Terminal",hidden:vh(),defaultSection:"developer-panel",requiredCapability:"terminal"},{type:"snippets",Icon:og,label:"Snippets",tooltip:"Snippets",defaultSection:"developer-panel"},{type:"cache",Icon:Eh,label:"Cache",tooltip:"View cache",defaultSection:"developer-panel",hidden:!Mu("cache_panel")}],B_=new Map(wl.map(e=>[e.type,e])),Dw=function(e,n){return!!(e.hidden||e.requiredCapability&&!n[e.requiredCapability])};var cS=Zn(),jd={sidebar:wl.filter(e=>!e.hidden&&e.defaultSection==="sidebar").map(e=>e.type),developerPanel:wl.filter(e=>!e.hidden&&e.defaultSection==="developer-panel").map(e=>e.type)};function uS(e){let n=new Set([...e.sidebar,...e.developerPanel]);return{sidebar:[...e.sidebar,...jd.sidebar.filter(a=>!n.has(a))],developerPanel:[...e.developerPanel,...jd.developerPanel.filter(a=>!n.has(a))]}}gm=Rl("marimo:panel-layout",jd,Xh({toSerializable:e=>e,fromSerializable:e=>uS(e)}),{getOnInit:!0});function Rg(e){let n=Fe.get(gm);return n.sidebar.includes(e)?"sidebar":n.developerPanel.includes(e)?"developer-panel":null}var Mg="marimo:sidebar",Pg=new od(E2({selectedPanel:T2().optional().transform(e=>e),isSidebarOpen:L2(),isDeveloperPanelOpen:L2().optional().default(!1),selectedDeveloperPanelTab:T2().optional().default("errors").transform(e=>e)}),dS);function dS(){return{selectedPanel:"variables",isSidebarOpen:!1,isDeveloperPanelOpen:!1,selectedDeveloperPanelTab:"errors"}}let fS,pS,Ng;({reducer:fS,createActions:pS,valueAtom:ud,useActions:Ng}=yl(()=>Pg.get(Mg),{openApplication:(e,n)=>{let a=Rg(n);return a==="sidebar"?{...e,selectedPanel:n,isSidebarOpen:!0}:a==="developer-panel"?{...e,selectedDeveloperPanelTab:n,isDeveloperPanelOpen:!0}:e},toggleApplication:(e,n)=>{let a=Rg(n);return a==="sidebar"?{...e,selectedPanel:n,isSidebarOpen:e.isSidebarOpen?e.selectedPanel!==n:!0}:a==="developer-panel"?{...e,selectedDeveloperPanelTab:n,isDeveloperPanelOpen:e.isDeveloperPanelOpen?e.selectedDeveloperPanelTab!==n:!0}:e},toggleSidebarPanel:e=>({...e,isSidebarOpen:!e.isSidebarOpen}),setIsSidebarOpen:(e,n)=>({...e,isSidebarOpen:n}),toggleDeveloperPanel:e=>({...e,isDeveloperPanelOpen:!e.isDeveloperPanelOpen}),setIsDeveloperPanelOpen:(e,n)=>({...e,isDeveloperPanelOpen:n})},[(e,n)=>Pg.set(Mg,n)])),Rw=()=>{let e=(0,cS.c)(2),n=mn(ud);if(n.isSidebarOpen)return n;let a;return e[0]===n?a=e[1]:(a={...n,selectedPanel:void 0},e[0]=n,e[1]=a),a},H_=function(){return Ng()},Bm=Ce({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1,pyrefly:!1});function ds(e){var n;return((n=Fe.get(Bm))==null?void 0:n[e])??!1}Wu=Ce({documentation:null});var Dg=new Set(["FunctionDefinition","LambdaExpression","ArrayComprehensionExpression","SetComprehension","DictionaryComprehensionExpression","ComprehensionExpression","ClassDefinition"]);function hS(e){let n=D2(e.state);if(!n||yS(n))return[];let a=new Set(Object.keys(e.variables).filter(E=>{let O=e.variables[E];return O.dataType!=="module"&&!O.declaredBy.includes("setup")&&!O.declaredBy.includes(e.cellId)}));if(a.size===0)return[];let o=[],s=new Map,c=new Map,h=new Map;function p(E,O){var ne,fe,R,j,F,se,ce,he,ye,xe,Qe;let M=E.cursor(),V=M.name,H=M.from,$=Dg.has(V),N=O;switch($&&(N=[...O,H],s.set(H,new Set),c.set(H,V)),V){case"FunctionDefinition":{let pe=E.cursor();pe.firstChild();do if(pe.name==="VariableName"){let ee=e.state.doc.sliceString(pe.from,pe.to),U=O[O.length-1]??-1;s.has(U)||s.set(U,new Set),(ne=s.get(U))==null||ne.add(ee);break}while(pe.nextSibling());let ie=E.cursor();ie.firstChild();do if(ie.name==="ParamList"){let ee=ie.node.cursor();ee.firstChild();do if(ee.name==="VariableName"){let U=e.state.doc.sliceString(ee.from,ee.to);(fe=s.get(H))==null||fe.add(U)}while(ee.nextSibling())}while(ie.nextSibling());break}case"LambdaExpression":{let pe=E.cursor();pe.firstChild();do if(pe.name==="ParamList"){let ie=pe.node.cursor();ie.firstChild();do if(ie.name==="VariableName"){let ee=e.state.doc.sliceString(ie.from,ie.to);(R=s.get(H))==null||R.add(ee)}while(ie.nextSibling())}while(pe.nextSibling());break}case"ArrayComprehensionExpression":case"DictionaryComprehensionExpression":case"SetComprehension":case"ComprehensionExpression":{let pe=E.cursor();pe.firstChild();let ie=!1;do if(pe.name==="for")ie=!0;else if(ie&&pe.name==="VariableName"){let ee=e.state.doc.sliceString(pe.from,pe.to);(j=s.get(H))==null||j.add(ee)}else if(ie&&pe.name==="TupleExpression"){let ee=pe.node.cursor();ee.firstChild();do if(ee.name==="VariableName"){let U=e.state.doc.sliceString(ee.from,ee.to);(F=s.get(H))==null||F.add(U)}while(ee.nextSibling())}else ie&&pe.name==="in"&&(ie=!1);while(pe.nextSibling());break}case"ClassDefinition":{let pe=E.cursor();pe.firstChild();do if(pe.name==="VariableName"){let ie=e.state.doc.sliceString(pe.from,pe.to),ee=O[O.length-1]??-1;s.has(ee)||s.set(ee,new Set),(se=s.get(ee))==null||se.add(ie);break}while(pe.nextSibling());h.set(H,[]);break}case"AssignStatement":{let pe=E.cursor(),ie=[];pe.firstChild();do pe.name==="AssignOp"&&ie.push(pe.from);while(pe.nextSibling());let ee=ie[ie.length-1],U=E.cursor();U.firstChild();let Ae=N[N.length-1]??-1;do U.from<ee&&zd(U,{currentScope:Ae,state:e.state,allDeclarations:s,scopeTypes:c,classLevelDeclarations:h,assignmentPosition:M.to});while(U.nextSibling());break}case"ForStatement":{let pe=E.cursor();pe.firstChild();let ie=!1;do if(pe.name==="for")ie=!0;else if(ie&&pe.name==="VariableName"){let ee=e.state.doc.sliceString(pe.from,pe.to),U=N[N.length-1]??-1;s.has(U)||s.set(U,new Set),(ce=s.get(U))==null||ce.add(ee)}else ie&&pe.name==="in"&&(ie=!1);while(pe.nextSibling());break}case"ImportStatement":{let pe=E.cursor();pe.firstChild();do if(pe.name==="VariableName"){let ie=e.state.doc.sliceString(pe.from,pe.to),ee=N[N.length-1]??-1;s.has(ee)||s.set(ee,new Set),(he=s.get(ee))==null||he.add(ie)}while(pe.nextSibling());break}case"ImportFromStatement":{let pe=E.cursor();pe.firstChild();let ie=!1;do if(pe.name==="import")ie=!0;else if(ie&&pe.name==="VariableName"){let ee=e.state.doc.sliceString(pe.from,pe.to),U=N[N.length-1]??-1;s.has(U)||s.set(U,new Set),(ye=s.get(U))==null||ye.add(ee)}while(pe.nextSibling());break}case"TryStatement":{let pe=E.cursor();pe.firstChild();let ie=!1;do if(pe.name==="as")ie=!0;else if(ie&&pe.name==="VariableName"){let ee=e.state.doc.sliceString(pe.from,pe.to),U=N[N.length-1]??-1;s.has(U)||s.set(U,new Set),(xe=s.get(U))==null||xe.add(ee),ie=!1}while(pe.nextSibling());break}case"WithStatement":{let pe=E.cursor();pe.firstChild();let ie=!1;do if(pe.name==="as")ie=!0;else if(ie&&pe.name==="VariableName"){let ee=e.state.doc.sliceString(pe.from,pe.to),U=N[N.length-1]??-1;s.has(U)||s.set(U,new Set),(Qe=s.get(U))==null||Qe.add(ee),ie=!1}while(pe.nextSibling());break}}C(M,pe=>{p(pe,N)})}function g(E,O,M){let V=h.get(O);return V?V.some(([H,$])=>H===E&&$<M):!1}function b(E,O,M){var V,H;for(let $ of O)if(c.get($)==="ClassDefinition"){if(g(E,$,M))return!0}else if((V=s.get($))!=null&&V.has(E))return!0;return((H=s.get(-1))==null?void 0:H.has(E))??!1}function _(E,O){let M=E.cursor(),V=M.name,H=M.from,$=Dg.has(V),N=O;if($&&(N=[...O,H]),V==="VariableName"){let ne=e.state.doc.sliceString(M.from,M.to);S(ne,M)&&(b(ne,N,M.from)||o.push({from:M.from,to:M.to,variableName:ne}))}C(M,ne=>{_(ne,N)})}function S(E,O){return a.has(E)&&!mS(O)&&!gS(O)}function C(E,O){if(E.firstChild())do O(E.node);while(E.nextSibling())}return p(n,[]),_(n,[]),o}function mS(e){let n=e.node.cursor();if(n.moveTo(e.from),n.parent()&&n.name==="CallExpression"&&n.firstChild())do if(n.name==="ArgList"&&n.firstChild()){do if(n.from===e.from&&n.to===e.to)return n.nextSibling()&&n.name==="AssignOp";while(n.nextSibling());break}while(n.nextSibling());return!1}function gS(e){let n=e.node.cursor();if(n.parent()&&n.name==="AssignStatement"){let a=n.node.cursor();a.firstChild();let o=-1;do if(a.name==="AssignOp"){o=a.from;break}while(a.nextSibling());return o!==-1&&e.from<o}return!1}function yS(e){let n=e.cursor();do if(n.name==="\u26A0"||n.type.isError)return!0;while(n.next());return!1}function zd(e,n){var a;switch(e.name){case"VariableName":{let o=n.state.doc.sliceString(e.from,e.to);if(n.currentScope!==-1&&n.scopeTypes.get(n.currentScope)==="ClassDefinition"){let s=n.classLevelDeclarations.get(n.currentScope);s&&s.push([o,n.assignmentPosition])}else n.allDeclarations.has(n.currentScope)||n.allDeclarations.set(n.currentScope,new Set),(a=n.allDeclarations.get(n.currentScope))==null||a.add(o);break}case"TupleExpression":{let o=e.node.cursor();o.firstChild();do zd(o,n);while(o.nextSibling());break}case"ArrayExpression":{let o=e.node.cursor();o.firstChild();do zd(o,n);while(o.nextSibling());break}}}var vS=ia.mark({class:"mo-cm-reactive-reference"});y_=ia.mark({class:"mo-cm-reactive-reference-hover"});var jg=aa.define(),bS=class{constructor(e,n){ve(this,"highlightDebounceMs",300);this.view=e,this.cellId=n,this.scheduleHighlighting=O2(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=Fe.sub(Ga,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=hS({state:this.view.state,cellId:this.cellId,variables:Fe.get(Ga)});e.length>0&&be.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:jg.of(e)})})}};Ju=Zo.define({create(){return{decorations:ia.none,ranges:[]}},update(e,n){let a={decorations:e.decorations.map(n.changes),ranges:e.ranges};for(let o of n.effects)o.is(jg)&&(a={decorations:ia.set(o.value.map(s=>vS.range(s.from,s.to))),ranges:o.value});return a},provide:e=>Et.decorations.from(e,n=>n.decorations)});function wS(e){return[Ju,ts.define(n=>new bS(n,e))]}i_=function(e,n){return n?wS(e):[]};function zg(e,n=!1){if(!e)return null;let a=document.createElement("span");if(a.classList.add("mo-cm-tooltip"),a.classList.add("docs-documentation"),n&&a.classList.add("cm-tooltip-section"),a.style.display="flex",a.style.flexDirection="column",a.style.gap=".8rem",a.innerHTML=e,n){let o=document.createElement("div");o.classList.add("text-xs","text-muted-foreground","font-medium","pt-1","-mt-2","border-t","border-border");let s=document.createElement("kbd");s.className="ml-1 rounded-md bg-muted/40 px-2 text-[0.75rem] font-prose center border border-foreground/20 text-muted-foreground inline whitespace-nowrap",s.textContent=h5()?"\u2318":"Ctrl",o.append(document.createTextNode("Jump to defining cell ")),o.append(s),o.append(document.createTextNode(" + Click")),a.append(o)}return a}ad=new Ou("autocomplete-result",async(e,n)=>{let{sendCodeCompletionRequest:a}=oa();await a({id:e,...n})});var _S={param:3,property:2};const qd={asCompletionResult(e,n){return{from:e-n.prefix_length,options:n.options.map(a=>({label:a.name,type:a.type,boost:_S[a.type]??1,info:()=>zg(a.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:n,limitToType:a,excludeTypes:o,exactName:s,showGoToDefinitionHint:c=!1}){let h=xS(n.options,s);if(!h)return;let p=e-n.prefix_length,g=zg(h.completion_info,c);if(g&&!(a&&h.type!==a)&&!(o!=null&&o.includes(h.type)))return{pos:p,html:h.completion_info,end:p+h.name.length,above:!0,create:()=>({dom:g,resize:!1})}}};function xS(e,n){if(e.length!==0){if(e.length===1)return e[0];if(n)return e.find(a=>a.name===n)}}n_=function(e){var n;return[(n=e==null?void 0:e.pylsp)!=null&&n.enabled&&ds("pylsp")?[]:wh(async(a,o)=>{let s=await qg({view:a,pos:o,excludeTypes:["tooltip"]});return s===null||s==="cancelled"?null:s},{hideOnChange:!0}),CS]};async function qg({view:e,pos:n,excludeTypes:a}){var _;let o=En.findElement(e.dom);if(!o)return be.error("Failed to find active cell."),null;let s=En.parse(o.id),{startToken:c,endToken:h}=Bd(e.state.doc,n),p=((_=e.state.field(Ju,!1))==null?void 0:_.ranges.some(S=>n>=S.from&&n<=S.to))??!1,g=await ad.request({document:e.state.doc.slice(0,h).toString(),cellId:s});if(!g)return"cancelled";let b=e.state.doc.slice(c,h).toString();return qd.asHoverTooltip({position:h,message:g,exactName:b,excludeTypes:a,showGoToDefinitionHint:p})??null}function Bd(e,n){let a=n,o=a>0?e.sliceString(a-1,a):"",s=a<e.length?e.sliceString(a,a+1):"";o==="("&&s===")"&&--a;let c=a,h=a;for(;c>0;){let p=e.sliceString(c-1,c);if(!/\w/.test(p))break;c--}for(;h<e.length;){let p=e.sliceString(h,h+1);if(!/\w/.test(p))break;h++}return{startToken:c,endToken:h}}function kS(e){let{head:n}=e.selection.main,a=e.doc.sliceString(n-1,n);return/\w/.test(a)}var SS=O2(async(e,n)=>{if(Fe.get(ud).selectedPanel!=="documentation")return;let a=await qg({view:e,pos:n});a!=="cancelled"&&Fe.set(Wu,{documentation:(a==null?void 0:a.html)??null})},300),CS=Et.updateListener.of(e=>{if(e.selectionSet&&kS(e.state)){let n=e.state.selection.main.head;SS(e.view,n)}});function Bg(e,n){e.focus(),requestAnimationFrame(()=>{e.dispatch({selection:{anchor:n,head:n},effects:Et.scrollIntoView(n,{y:"center"})})})}Ku=function(e,n){let{state:a}=e,o=D2(a),s=!1,c=0;return o.iterate({enter:h=>{if(s)return!1;if(h.name==="VariableName"&&a.doc.sliceString(h.from,h.to)===n)return c=h.from,s=!0,!1;if(h.name==="Comment"||h.name==="String")return!1}}),s?(Bg(e,c),!0):!1};function ES(e,n){return Bg(e,e.state.doc.line(n).from),!0}function TS(e){let{from:n,to:a}=e.selection.main;if(n===a){let{startToken:o,endToken:s}=Bd(e.doc,n);return e.doc.sliceString(o,s)}return e.doc.sliceString(n,a)}function LS(e,n){if(!n)return null;let a=e[n];return!a||a.declaredBy.length===0?null:a.declaredBy[0]}function OS(e){return e.startsWith("_")}zm=function(e){let{state:n}=e,a=TS(n);return a?(kh(e),e.dispatch({effects:N5}),Em(e,a)):!1},Em=function(e,n){let a=AS(e,n);return a?Ku(a,n):!1},Xw=function(e,n){let a=Fg(e);return a?ES(a,n):!1};function AS(e,n){if(OS(n))return e;let a=LS(Fe.get(Ga),n);return a?Fg(a):null}function Fg(e){var n;return((n=Fe.get(Ye).cellHandles[e].current)==null?void 0:n.editorView)??null}function IS(e){var n=e.Pos;function a(u,f,y){if(f.line===y.line&&f.ch>=y.ch-1){var v=u.getLine(f.line).charCodeAt(f.ch);55296<=v&&v<=55551&&(y.ch+=1)}return{start:f,end:y}}var o=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"g<Up>",type:"keyToKey",toKeys:"gk"},{keys:"g<Down>",type:"keyToKey",toKeys:"gj"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h"},{keys:"<Del>",type:"keyToKey",toKeys:"x"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"gq",type:"operator",operator:"hardWrap"},{keys:"gw",type:"operator",operator:"hardWrap",operatorArgs:{keepCursor:!0}},{keys:"g?",type:"operator",operator:"rot13"},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-u>",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<register>",type:"action",action:"replayMacro"},{keys:"q<register>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<register>",type:"action",action:"setMark"},{keys:'"<register>',type:"action",action:"setRegister"},{keys:"<C-r><register>",type:"action",action:"insertRegister",context:"insert",isEdit:!0},{keys:"<C-o>",type:"action",action:"oneNormalCommand",context:"insert"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<register>",type:"motion",motion:"textObjectManipulation"},{keys:"i<register>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],s=Object.create(null),c=o.length,h=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"omap",shortName:"om"},{name:"noremap",shortName:"no"},{name:"nnoremap",shortName:"nn"},{name:"vnoremap",shortName:"vn"},{name:"inoremap",shortName:"ino"},{name:"onoremap",shortName:"ono"},{name:"unmap"},{name:"mapclear",shortName:"mapc"},{name:"nmapclear",shortName:"nmapc"},{name:"vmapclear",shortName:"vmapc"},{name:"imapclear",shortName:"imapc"},{name:"omapclear",shortName:"omapc"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"startinsert",shortName:"start"},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"marks",excludeFromCommandHistory:!0},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"delete",shortName:"d"},{name:"join",shortName:"j"},{name:"normal",shortName:"norm"},{name:"global",shortName:"g"}],p=uo("");function g(u){u.setOption("disableInput",!0),u.setOption("showCursorWhenSelecting",!1),e.signal(u,"vim-mode-change",{mode:"normal"}),u.on("cursorActivity",wo),ee(u),e.on(u.getInputField(),"paste",_(u))}function b(u){u.setOption("disableInput",!1),u.off("cursorActivity",wo),e.off(u.getInputField(),"paste",_(u)),u.state.vim=null,Ea&&clearTimeout(Ea)}function _(u){var f=u.state.vim;return f.onPasteFn||(f.onPasteFn=function(){f.insertMode||(u.setCursor(kt(u.getCursor(),0,1)),Nr.enterInsertMode(u,{},f))}),f.onPasteFn}var S=/[\d]/,C=[e.isWordChar,function(u){return u&&!e.isWordChar(u)&&!/\s/.test(u)}],E=[function(u){return/\S/.test(u)}],O=["<",">"],M=["-",'"',".",":","_","/","+"],V=/^\w$/,H=/^[A-Z]$/;try{H=RegExp("^[\\p{Lu}]$","u")}catch{}function $(u,f){return f>=u.firstLine()&&f<=u.lastLine()}function N(u){return/^[a-z]$/.test(u)}function ne(u){return"()[]{}".indexOf(u)!=-1}function fe(u){return S.test(u)}function R(u){return H.test(u)}function j(u){return/^\s*$/.test(u)}function F(u){return".?!".indexOf(u)!=-1}function se(u,f){for(var y=0;y<f.length;y++)if(f[y]==u)return!0;return!1}var ce={};function he(u,f,y,v,w){if(f===void 0&&!w)throw Error("defaultValue is required unless callback is provided");if(y||(y="string"),ce[u]={type:y,defaultValue:f,callback:w},v)for(var x=0;x<v.length;x++)ce[v[x]]=ce[u];f&&ye(u,f)}function ye(u,f,y,v){var w=ce[u];v||(v={});var x=v.scope;if(!w)return Error("Unknown option: "+u);if(w.type=="boolean"){if(f&&f!==!0)return Error("Invalid argument: "+u+"="+f);f!==!1&&(f=!0)}w.callback?(x!=="local"&&w.callback(f,void 0),x!=="global"&&y&&w.callback(f,y)):(x!=="local"&&(w.value=w.type=="boolean"?!!f:f),x!=="global"&&y&&(y.state.vim.options[u]={value:f}))}function xe(u,f,y){var v=ce[u];y||(y={});var w=y.scope;if(!v)return Error("Unknown option: "+u);if(v.callback){let x=f&&v.callback(void 0,f);return w!=="global"&&x!==void 0?x:w==="local"?void 0:v.callback()}else return(w!=="global"&&f&&f.state.vim.options[u]||w!=="local"&&v||{}).value}he("filetype",void 0,"string",["ft"],function(u,f){if(f!==void 0)if(u===void 0){let y=f.getOption("mode");return y=="null"?"":y}else{let y=u==""?"null":u;f.setOption("mode",y)}}),he("textwidth",80,"number",["tw"],function(u,f){if(f!==void 0){if(u===void 0)return f.getOption("textwidth");var y=Math.round(u);y>1&&f.setOption("textwidth",y)}});var Qe=function(){var u=100,f=-1,y=0,v=0,w=Array(u);function x(I,D,P){var Z=w[f%u];function X(Q){var ge=++f%u,me=w[ge];me&&me.clear(),w[ge]=I.setBookmark(Q)}if(Z){var K=Z.find();K&&!mt(K,D)&&X(D)}else X(D);X(P),y=f,v=f-u+1,v<0&&(v=0)}function T(I,D){f+=D,f>y?f=y:f<v&&(f=v);var P=w[(u+f)%u];if(P&&!P.find()){var Z=D>0?1:-1,X,K=I.getCursor();do if(f+=Z,P=w[(u+f)%u],P&&(X=P.find())&&!mt(K,X))break;while(f<y&&f>v)}return P}function A(I,D){var P=f,Z=T(I,D);return f=P,Z&&Z.find()}return{cachedCursor:void 0,add:x,find:A,move:T}},pe=function(u){return u?{changes:u.changes,expectCursorActivityForChange:u.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class ie{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=pe()}exitMacroRecordMode(){var f=U.macroModeState;f.onRecordingDone&&f.onRecordingDone(),f.onRecordingDone=void 0,f.isRecording=!1}enterMacroRecordMode(f,y){var v=U.registerController.getRegister(y);if(v){if(v.clear(),this.latestRegister=y,f.openDialog){var w=sn("span",{class:"cm-vim-message"},"recording @"+y);this.onRecordingDone=f.openDialog(w,function(){},{bottom:!0})}this.isRecording=!0}}}function ee(u){return u.state.vim||(u.state.vim={inputState:new bs,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:void 0,sel:{anchor:new n(0,0),head:new n(0,0)},options:{},expectLiteralNext:!1,status:""}),u.state.vim}var U;function Ae(){for(var u in U={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:Qe(),macroModeState:new ie,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new tc({}),searchHistoryController:new fo,exCommandHistoryController:new fo},ce){var f=ce[u];f.value=f.defaultValue}}class Ve{constructor(f,y){this.keyName=f,this.key=y.key,this.ctrlKey=y.ctrlKey,this.altKey=y.altKey,this.metaKey=y.metaKey,this.shiftKey=y.shiftKey}}var nt,He={enterVimMode:g,leaveVimMode:b,buildKeyMap:function(){},getRegisterController:function(){return U.registerController},resetVimGlobalState_:Ae,getVimGlobalState_:function(){return U},maybeInitVimState_:ee,suppressErrorLogging:!1,InsertModeKey:Ve,map:function(u,f,y){Kt.map(u,f,y)},unmap:function(u,f){return Kt.unmap(u,f)},noremap:function(u,f,y){Kt.map(u,f,y,!0)},mapclear:function(u){var f=o.length,y=c,v=o.slice(0,f-y);if(o=o.slice(f-y),u)for(var w=v.length-1;w>=0;w--){var x=v[w];if(u!==x.context)if(x.context)this._mapCommand(x);else{var T=["normal","insert","visual"];for(var A in T)if(T[A]!==u){var I=Object.assign({},x);I.context=T[A],this._mapCommand(I)}}}},langmap:ci,vimKeyFromEvent:Pr,setOption:ye,getOption:xe,defineOption:he,defineEx:function(u,f,y){if(!f)f=u;else if(u.indexOf(f)!==0)throw Error('(Vim.defineEx) "'+f+'" is not a prefix of "'+u+'", command not registered');$n[u]=y,Kt.commandMap_[f]={name:u,shortName:f,type:"api"}},handleKey:function(u,f,y){var v=this.findKey(u,f,y);if(typeof v=="function")return v()},multiSelectHandleKey:Fr,findKey:function(u,f,y){var v=ee(u),w=u;function x(){var P=U.macroModeState;if(P.isRecording){if(f=="q")return P.exitMacroRecordMode(),ht(w),!0;y!="mapping"&&fr(P,f)}}function T(){if(f=="<Esc>"){if(v.visualMode)In(w);else if(v.insertMode)pn(w);else return;return ht(w),!0}}function A(){if(T())return!0;v.inputState.keyBuffer.push(f);var P=v.inputState.keyBuffer.join(""),Z=f.length==1,X=ur.matchCommand(P,o,v.inputState,"insert"),K=v.inputState.changeQueue;if(X.type=="none")return ht(w),!1;if(X.type=="partial"){if(X.expectLiteralNext&&(v.expectLiteralNext=!0),nt&&window.clearTimeout(nt),nt=Z&&window.setTimeout(function(){v.insertMode&&v.inputState.keyBuffer.length&&ht(w)},xe("insertModeEscKeysTimeout")),Z){var Q=w.listSelections();(!K||K.removed.length!=Q.length)&&(K=v.inputState.changeQueue=new ws),K.inserted+=f;for(var ge=0;ge<Q.length;ge++){var me=Xt(Q[ge].anchor,Q[ge].head),Oe=kr(Q[ge].anchor,Q[ge].head),we=w.getRange(me,w.state.overwrite?kt(Oe,0,1):Oe);K.removed[ge]=(K.removed[ge]||"")+we}}return!Z}else X.type=="full"&&(v.inputState.keyBuffer.length=0);if(v.expectLiteralNext=!1,nt&&window.clearTimeout(nt),X.command&&K){for(var Q=w.listSelections(),ge=0;ge<Q.length;ge++){var Ee=Q[ge].head;w.replaceRange(K.removed[ge]||"",kt(Ee,0,-K.inserted.length),Ee,"+input")}U.macroModeState.lastInsertModeChanges.changes.pop()}return X.command||ht(w),X.command}function I(){if(x()||T())return!0;v.inputState.keyBuffer.push(f);var P=v.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(P))return!0;var Z=/^(\d*)(.*)$/.exec(P);if(!Z)return ht(w),!1;var X=v.visualMode?"visual":"normal",K=Z[2]||Z[1];v.inputState.operatorShortcut&&v.inputState.operatorShortcut.slice(-1)==K&&(K=v.inputState.operatorShortcut);var Q=ur.matchCommand(K,o,v.inputState,X);return Q.type=="none"?(ht(w),!1):Q.type=="partial"?(Q.expectLiteralNext&&(v.expectLiteralNext=!0),!0):Q.type=="clear"?(ht(w),!0):(v.expectLiteralNext=!1,v.inputState.keyBuffer.length=0,Z=/^(\d*)(.*)$/.exec(P),Z&&Z[1]&&Z[1]!="0"&&v.inputState.pushRepeatDigit(Z[1]),Q.command)}var D=v.insertMode?A():I();if(D===!1)return!v.insertMode&&(f.length===1||e.isMac&&/<A-.>/.test(f))?function(){return!0}:void 0;if(D===!0)return function(){return!0};if(D)return function(){return w.operation(function(){w.curOp.isVimOp=!0;try{if(typeof D!="object")return;D.type=="keyToKey"?Mt(w,D.toKeys,D):ur.processCommand(w,v,D)}catch(P){throw w.state.vim=void 0,ee(w),He.suppressErrorLogging||console.log(P),P}return!0})}},handleEx:function(u,f){Kt.processCommand(u,f)},defineMotion:hf,defineAction:rc,defineOperator:mf,mapCommand:yc,_mapCommand:Er,defineRegister:pf,exitVisualMode:In,exitInsertMode:pn},ze=[],Le=!1,Re;function Tt(u){if(!Re)throw Error("No prompt to send key to");if(u[0]=="<"){var f=u.toLowerCase().slice(1,-1);if(f=f.split("-").pop()||"",f=="lt")u="<";else if(f=="space")u=" ";else if(f=="cr")u=`
59
59
  `;else if(An[f]){var y=Re.value||"",v={key:An[f],target:{value:y,selectionEnd:y.length,selectionStart:y.length}};Re.onKeyDown&&Re.onKeyDown(v,Re.value,x),Re&&Re.onKeyUp&&Re.onKeyUp(v,Re.value,x);return}}if(u==`
60
60
  `){var w=Re;Re=null,w.onClose&&w.onClose(w.value)}else Re.value=(Re.value||"")+u;function x(T){Re&&(typeof T=="string"?Re.value=T:Re=null)}}function Mt(u,f,y){var v=Le;if(y){if(ze.indexOf(y)!=-1)return;ze.push(y),Le=y.noremap!=0}try{for(var w=ee(u),x=/<(?:[CSMA]-)*\w+>|./gi,T;T=x.exec(f);){var A=T[0],I=w.insertMode;if(Re){Tt(A);continue}if(!He.handleKey(u,A,"mapping")&&I&&w.insertMode){if(A[0]=="<"){var D=A.toLowerCase().slice(1,-1);if(D=D.split("-").pop()||"",D=="lt")A="<";else if(D=="space")A=" ";else if(D=="cr")A=`
61
61
  `;else if(An.hasOwnProperty(D)){A=An[D],_i(u,A);continue}else A=A[0],x.lastIndex=T.index+1}u.replaceSelection(A)}}}finally{if(ze.pop(),Le=ze.length?v:!1,!ze.length&&Re){var P=Re;Re=null,Sa(u,P)}}}var ya={Return:"CR",Backspace:"BS",Delete:"Del",Escape:"Esc",Insert:"Ins",ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"CR"," ":"Space"},co={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},An={};"Left|Right|Up|Down|End|Home".split("|").concat(Object.keys(ya)).forEach(function(u){An[(ya[u]||"").toLowerCase()]=An[u.toLowerCase()]=u});function Pr(u,f){var x;var y=u.key;if(!co[y]){y.length>1&&y[0]=="n"&&(y=y.replace("Numpad","")),y=ya[y]||y;var v="";if(u.ctrlKey&&(v+="C-"),u.altKey&&(v+="A-"),u.metaKey&&(v+="M-"),e.isMac&&v=="A-"&&y.length==1&&(v=v.slice(2)),(v||y.length>1)&&u.shiftKey&&(v+="S-"),f&&!f.expectLiteralNext&&y.length==1){if(p.keymap&&y in p.keymap)(p.remapCtrl!=0||!v)&&(y=p.keymap[y]);else if(y.charCodeAt(0)>128&&!s[y]){var w=((x=u.code)==null?void 0:x.slice(-1))||"";u.shiftKey||(w=w.toLowerCase()),w&&(y=w,!v&&u.altKey&&(v="A-"))}}return v+=y,v.length>1&&(v="<"+v+">"),v}}function ci(u,f){p.string!==u&&(p=uo(u)),p.remapCtrl=f}function uo(u){let f={};if(!u)return{keymap:f,string:""};function y(v){return v.split(/\\?(.)/).filter(Boolean)}return u.split(/((?:[^\\,]|\\.)+),/).map(v=>{if(!v)return;let w=v.split(/((?:[^\\;]|\\.)+);/);if(w.length==3){let x=y(w[1]),T=y(w[2]);if(x.length!==T.length)return;for(let A=0;A<x.length;++A)f[x[A]]=T[A]}else if(w.length==1){let x=y(v);if(x.length%2!=0)return;for(let T=0;T<x.length;T+=2)f[x[T]]=x[T+1]}}),{keymap:f,string:u}}he("langmap",void 0,"string",["lmap"],function(u,f){if(u===void 0)return p.string;ci(u)});class bs{constructor(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=void 0,this.changeQueue=null}pushRepeatDigit(f){this.operator?this.motionRepeat=this.motionRepeat.concat(f):this.prefixRepeat=this.prefixRepeat.concat(f)}getRepeat(){var f=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(f=1,this.prefixRepeat.length>0&&(f*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(f*=parseInt(this.motionRepeat.join(""),10))),f}}function ht(u,f){u.state.vim.inputState=new bs,u.state.vim.expectLiteralNext=!1,e.signal(u,"vim-command-done",f)}function ws(){this.removed=[],this.inserted=""}class vn{constructor(f,y,v){this.clear(),this.keyBuffer=[f||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!y,this.blockwise=!!v}setText(f,y,v){this.keyBuffer=[f||""],this.linewise=!!y,this.blockwise=!!v}pushText(f,y){y&&(this.linewise||this.keyBuffer.push(`
@@ -88,45 +88,45 @@ mark line col
88
88
  `),Q=x=="decimal"?/(-?)([\d]+)/:x=="hex"?/(-?)(?:0x)?([0-9a-f]+)/i:x=="octal"?/([0-7]+)/:null,ge=x=="decimal"?10:x=="hex"?16:x=="octal"?8:void 0,me=[],Oe=[];if(x||T)for(var we=0;we<K.length;we++){var Ee=T?K[we].match(T):null;Ee&&Ee[0]!=""?me.push(Ee):Q&&Q.exec(K[we])?me.push(K[we]):Oe.push(K[we])}else Oe=K;function Je(Me,Ie){if(y){var _t=Me;Me=Ie,Ie=_t}v&&(Me=Me.toLowerCase(),Ie=Ie.toLowerCase());var Nt=Q&&Q.exec(Me),Vt=Q&&Q.exec(Ie);return!Nt||!Vt?Me<Ie?-1:1:parseInt((Nt[1]+Nt[2]).toLowerCase(),ge)-parseInt((Vt[1]+Vt[2]).toLowerCase(),ge)}function De(Me,Ie){if(y){var _t=Me;Me=Ie,Ie=_t}return v&&(Me[0]=Me[0].toLowerCase(),Ie[0]=Ie[0].toLowerCase()),Me[0]<Ie[0]?-1:1}if(me.sort(T?De:Je),T)for(var we=0;we<me.length;we++)me[we]=me[we].input;else x||Oe.sort(Je);if(K=y?me.concat(Oe):Oe.concat(me),w){var ut=K,yt;K=[];for(var we=0;we<ut.length;we++)ut[we]!=yt&&K.push(ut[we]),yt=ut[we]}u.replaceRange(K.join(`
89
89
  `),Z,X)},vglobal:function(u,f){this.global(u,f)},normal:function(u,f){var y=!1,v=f.argString;if(v&&v[0]=="!"&&(v=v.slice(1),y=!0),v=v.trimStart(),!v){Ge(u,"Argument is required.");return}var w=f.line;if(typeof w=="number")for(var x=isNaN(f.lineEnd)?w:f.lineEnd,T=w;T<=x;T++)u.setCursor(T,0),Mt(u,f.argString.trimStart(),{noremap:y}),u.state.vim.insertMode&&pn(u,!0);else Mt(u,f.argString.trimStart(),{noremap:y}),u.state.vim.insertMode&&pn(u,!0)},global:function(u,f){var y=f.argString;if(!y){Ge(u,"Regular Expression missing from global");return}var v=f.commandName[0]==="v";y[0]==="!"&&f.commandName[0]==="g"&&(v=!0,y=y.slice(1));var w=f.line===void 0?u.firstLine():f.line,x=f.lineEnd||f.line||u.lastLine(),T=uc(y),A=y,I="";if(T&&T.length&&(A=T[0],I=T.slice(1,T.length).join("/")),A)try{zr(u,A,!0,!0)}catch{Ge(u,"Invalid regex: "+A);return}for(var D=wn(u).getQuery(),P=[],Z=w;Z<=x;Z++){var X=u.getLine(Z);D.test(X)!==v&&P.push(I?u.getLineHandle(Z):X)}if(!I){Ge(u,P.join(`
90
90
  `));return}var K=0,Q=function(){if(K<P.length){var ge=P[K++],me=u.getLineNumber(ge);if(me==null){Q();return}var Oe=me+1+I;Kt.processCommand(u,Oe,{callback:Q})}else u.releaseLineHandles&&u.releaseLineHandles()};Q()},substitute:function(u,f){if(!u.getSearchCursor)throw Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var y=f.argString,v=y?hi(y,y[0]):[],w="",x="",T,A,I,D=!1,P=!1;if(v&&v.length)w=v[0],xe("pcre")&&w!==""&&(w=new RegExp(w).source),x=v[1],x!==void 0&&(x=xe("pcre")?Es(x.replace(/([^\\])&/g,"$1$$&")):dc(x),U.lastSubstituteReplacePart=x),T=v[2]?v[2].split(" "):[];else if(y&&y.length){Ge(u,"Substitutions should be of the form :s/pattern/replace/");return}if(T&&(A=T[0],I=parseInt(T[1]),A&&(A.indexOf("c")!=-1&&(D=!0),A.indexOf("g")!=-1&&(P=!0),w=xe("pcre")?w+"/"+A:w.replace(/\//g,"\\/")+"/"+A)),w)try{zr(u,w,!0,!0)}catch{Ge(u,"Invalid regex: "+w);return}if(x||(x=U.lastSubstituteReplacePart),x===void 0){Ge(u,"No previous substitute regular expression");return}var Z=wn(u).getQuery(),X=f.line===void 0?u.getCursor().line:f.line,K=f.lineEnd||X;X==u.firstLine()&&K==u.lastLine()&&(K=1/0),I&&(X=K,K=X+I-1);var Q=Pt(u,new n(X,0)),ge=u.getSearchCursor(Z,Q);Ls(u,D,P,X,K,ge,Z,x,f.callback)},startinsert:function(u,f){Mt(u,f.argString=="!"?"A":"i",{})},redo:e.commands.redo,undo:e.commands.undo,write:function(u){e.commands.save?e.commands.save(u):u.save&&u.save()},nohlsearch:function(u){Br(u)},yank:function(u){var f=Ue(u.getCursor()).line,y=u.getLine(f);U.registerController.pushText("0","yank",y,!0,!0)},delete:function(u,f){var y=f.selectionLine,v=isNaN(f.selectionLineEnd)?y:f.selectionLineEnd;Jt.delete(u,{linewise:!0},[{anchor:new n(y,0),head:new n(v+1,0)}])},join:function(u,f){var y=f.selectionLine,v=isNaN(f.selectionLineEnd)?y:f.selectionLineEnd;u.setCursor(new n(y,0)),Nr.joinLines(u,{repeat:v-y},u.state.vim)},delmarks:function(u,f){if(!f.argString||!va(f.argString)){Ge(u,"Argument required");return}for(var y=u.state.vim,v=new e.StringStream(va(f.argString));!v.eol();){v.eatSpace();var w=v.pos;if(!v.match(/[a-zA-Z]/,!1)){Ge(u,"Invalid argument: "+f.argString.substring(w));return}var x=v.next();if(v.match("-",!0)){if(!v.match(/[a-zA-Z]/,!1)){Ge(u,"Invalid argument: "+f.argString.substring(w));return}var T=x,A=v.next();if(T&&A&&N(T)==N(A)){var I=T.charCodeAt(0),D=A.charCodeAt(0);if(I>=D){Ge(u,"Invalid argument: "+f.argString.substring(w));return}for(var P=0;P<=D-I;P++){var Z=String.fromCharCode(I+P);delete y.marks[Z]}}else{Ge(u,"Invalid argument: "+T+"-");return}}else x&&delete y.marks[x]}}},Kt=new bo;He.defineEx("version","ve",u=>{Ge(u,"Codemirror-vim version: 6.3.0")});function Ls(u,f,y,v,w,x,T,A,I){u.state.vim.exMode=!0;var D=!1,P=0,Z,X,K;function Q(){u.operation(function(){for(;!D;)ge(),Oe();we()})}function ge(){var Je="",De=x.match||x.pos&&x.pos.match;Je=De?A.replace(/\$(\d{1,3}|[$&])/g,function(yt,Me){if(Me=="$")return"$";if(Me=="&")return De[0];for(var Ie=Me;parseInt(Ie)>=De.length&&Ie.length>0;)Ie=Ie.slice(0,Ie.length-1);return Ie?De[Ie]+Me.slice(Ie.length,Me.length):yt}):u.getRange(x.from(),x.to()).replace(T,A);var ut=x.to().line;x.replace(Je),X=x.to().line,w+=X-ut,K=X<ut}function me(){var Je=Z&&Ue(x.to()),De=x.findNext();return De&&!De[0]&&Je&&mt(x.from(),Je)&&(De=x.findNext()),De&&P++,De}function Oe(){for(;me()&&hc(x.from(),v,w);)if(!(!y&&x.from().line==X&&!K)){u.scrollIntoView(x.from(),30),u.setSelection(x.from(),x.to()),Z=x.from(),D=!1;return}D=!0}function we(Je){if(Je&&Je(),u.focus(),Z){u.setCursor(Z);var De=u.state.vim;De.exMode=!1,De.lastHPos=De.lastHSPos=Z.ch}I?I():D&&Ge(u,(P?"Found "+P+" matches":"No matches found")+" for pattern: "+T+(xe("pcre")?" (set nopcre to use Vim regexps)":""))}function Ee(Je,De,ut){switch(e.e_stop(Je),Pr(Je)){case"y":ge(),Oe();break;case"n":Oe();break;case"a":var yt=I;I=void 0,u.operation(Q),I=yt;break;case"l":ge();case"q":case"<Esc>":case"<C-c>":case"<C-[>":we(ut);break}return D&&we(ut),!0}if(Oe(),D){Ge(u,"No matches for "+T+(xe("pcre")?" (set nopcre to use vim regexps)":""));return}if(!f){Q(),I&&I();return}Sa(u,{prefix:sn("span","replace with ",sn("strong",A)," (y/n/a/q/l)"),onKeyDown:Ee})}function pn(u,f){var y=u.state.vim,v=U.macroModeState,w=U.registerController.getRegister("."),x=v.isPlaying,T=v.lastInsertModeChanges;x||(u.off("change",pr),y.insertEnd&&y.insertEnd.clear(),y.insertEnd=void 0,e.off(u.getInputField(),"keydown",Is)),!x&&y.insertModeRepeat&&y.insertModeRepeat>1&&(wi(u,y,y.insertModeRepeat-1,!0),y.lastEditInputState.repeatOverride=y.insertModeRepeat),delete y.insertModeRepeat,y.insertMode=!1,f||u.setCursor(u.getCursor().line,u.getCursor().ch-1),u.setOption("keyMap","vim"),u.setOption("disableInput",!0),u.toggleOverwrite(!1),w.setText(T.changes.join("")),e.signal(u,"vim-mode-change",{mode:"normal"}),v.isRecording&&As(v)}function Er(u){o.unshift(u),u.keys&&gc(u.keys)}function gc(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(f){f&&(s[f]||(s[f]=0),s[f]++)})}function Os(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(f){s[f]&&s[f]--})}function yc(u,f,y,v,w){var x={keys:u,type:f};for(var T in x[f]=y,x[f+"Args"]=v,w)x[T]=w[T];Er(x)}he("insertModeEscKeysTimeout",200,"number");function yi(u,f,y,v){var w=U.registerController.getRegister(v);if(v==":"){w.keyBuffer[0]&&Kt.processCommand(u,w.keyBuffer[0]),y.isPlaying=!1;return}var x=w.keyBuffer,T=0;y.isPlaying=!0,y.replaySearchQueries=w.searchQueries.slice(0);for(var A=0;A<x.length;A++)for(var I=x[A],D,P,Z=/<(?:[CSMA]-)*\w+>|./gi;D=Z.exec(I);)if(P=D[0],He.handleKey(u,P,"macro"),f.insertMode){var X=w.insertModeChanges[T++].changes;U.macroModeState.lastInsertModeChanges.changes=X,Rs(u,X,1),pn(u)}y.isPlaying=!1}function fr(u,f){if(!u.isPlaying){var y=u.latestRegister,v=U.registerController.getRegister(y);v&&v.pushText(f)}}function As(u){if(!u.isPlaying){var f=u.latestRegister,y=U.registerController.getRegister(f);y&&y.pushInsertModeChanges&&y.pushInsertModeChanges(u.lastInsertModeChanges)}}function vi(u,f){if(!u.isPlaying){var y=u.latestRegister,v=U.registerController.getRegister(y);v&&v.pushSearchQuery&&v.pushSearchQuery(f)}}function pr(u,f){var y=U.macroModeState,v=y.lastInsertModeChanges;if(!y.isPlaying)for(var w=u.state.vim;f;){if(v.expectCursorActivityForChange=!0,v.ignoreCount>1)v.ignoreCount--;else if(f.origin=="+input"||f.origin=="paste"||f.origin===void 0){var x=u.listSelections().length;x>1&&(v.ignoreCount=x);var T=f.text.join(`
91
- `);if(v.maybeReset&&(v.maybeReset=(v.changes=[],!1)),T)if(u.state.overwrite&&!/\n/.test(T))v.changes.push([T]);else{if(T.length>1){var A=w&&w.insertEnd&&w.insertEnd.find(),I=u.getCursor();if(A&&A.line==I.line){var D=A.ch-I.ch;D>0&&D<T.length&&(v.changes.push([T,D]),T="")}}T&&v.changes.push(T)}}f=f.next}}function wo(u){var w;var f=u.state.vim;if(f.insertMode){var y=U.macroModeState;if(y.isPlaying)return;var v=y.lastInsertModeChanges;v.expectCursorActivityForChange?v.expectCursorActivityForChange=!1:(v.maybeReset=!0,f.insertEnd&&f.insertEnd.clear(),f.insertEnd=u.setBookmark(u.getCursor(),{insertLeft:!0}))}else(w=u.curOp)!=null&&w.isVimOp||bi(u,f)}function bi(u,f){var y=u.getCursor("anchor"),v=u.getCursor("head");if(f.visualMode&&!u.somethingSelected()?In(u,!1):!f.visualMode&&!f.insertMode&&u.somethingSelected()&&(f.visualMode=!0,f.visualLine=!1,e.signal(u,"vim-mode-change",{mode:"visual"})),f.visualMode){var w=wt(v,y)?0:-1,x=wt(v,y)?-1:0;v=kt(v,0,w),y=kt(y,0,x),f.sel={anchor:y,head:v},dn(u,f,"<",Xt(v,y)),dn(u,f,">",kr(v,y))}else f.insertMode||(f.lastHPos=u.getCursor().ch)}function Is(u){var f=U.macroModeState.lastInsertModeChanges,y=e.keyName?e.keyName(u):u.key;y&&(y.indexOf("Delete")!=-1||y.indexOf("Backspace")!=-1)&&(f.maybeReset&&(f.maybeReset=(f.changes=[],!1)),f.changes.push(new Ve(y,u)))}function wi(u,f,y,v){var w=U.macroModeState;w.isPlaying=!0;var x=f.lastEditActionCommand,T=f.inputState;function A(){x?ur.processAction(u,f,x):ur.evalInput(u,f)}function I(P){if(w.lastInsertModeChanges.changes.length>0){P=f.lastEditActionCommand?P:1;var Z=w.lastInsertModeChanges;Rs(u,Z.changes,P)}}if(f.inputState=f.lastEditInputState,x&&x.interlaceInsertRepeat)for(var D=0;D<y;D++)A(),I(1);else v||A(),I(y);f.inputState=T,f.insertMode&&!v&&pn(u),w.isPlaying=!1}function _i(u,f){e.lookupKey(f,"vim-insert",function(y){return typeof y=="string"?e.commands[y](u):y(u),!0})}function Rs(u,f,y){var v=u.getCursor("head"),w=U.macroModeState.lastInsertModeChanges.visualBlock;w&&(ac(u,v,w+1),y=u.listSelections().length,u.setCursor(v));for(var x=0;x<y;x++){w&&u.setCursor(kt(v,x,0));for(var T=0;T<f.length;T++){var A=f[T];if(A instanceof Ve)_i(u,A.keyName);else if(typeof A=="string")u.replaceSelection(A);else{var I=u.getCursor(),D=kt(I,0,A[0].length-(A[1]||0));u.replaceRange(A[0],I,A[1]?I:D),u.setCursor(D)}}}w&&u.setCursor(kt(v,0,1))}function Qt(u){var f=new u.constructor;return Object.keys(u).forEach(function(y){if(y!="insertEnd"){var v=u[y];Array.isArray(v)?v=v.slice():v&&typeof v=="object"&&v.constructor!=Object&&(v=Qt(v)),f[y]=v}}),u.sel&&(f.sel={head:u.sel.head&&Ue(u.sel.head),anchor:u.sel.anchor&&Ue(u.sel.anchor)}),f}function Fr(u,f,y){var x=ee(u),v=u,w=!1,x=He.maybeInitVimState_(v),T=x.visualBlock||x.wasInVisualBlock;if(v.state.closeVimNotification){var A=v.state.closeVimNotification;if(v.state.closeVimNotification=null,A(),f=="<CR>")return ht(v),!0}var I=v.isInMultiSelectMode();if(x.wasInVisualBlock&&!I?x.wasInVisualBlock=!1:I&&x.visualBlock&&(x.wasInVisualBlock=!0),f=="<Esc>"&&!x.insertMode&&!x.visualMode&&I&&x.status=="<Esc>")ht(v);else if(T||!I||v.inVirtualSelectionMode)w=He.handleKey(v,f,y);else{var D=Qt(x),P=x.inputState.changeQueueList||[];v.operation(function(){var X;v.curOp&&(v.curOp.isVimOp=!0);var Z=0;v.forEachSelection(function(){v.state.vim.inputState.changeQueue=P[Z];var K=v.getCursor("head"),Q=v.getCursor("anchor"),ge=wt(K,Q)?0:-1,me=wt(K,Q)?-1:0;K=kt(K,0,ge),Q=kt(Q,0,me),v.state.vim.sel.head=K,v.state.vim.sel.anchor=Q,w=He.handleKey(v,f,y),v.virtualSelection&&(P[Z]=v.state.vim.inputState.changeQueue,v.state.vim=Qt(D)),Z++}),(X=v.curOp)!=null&&X.cursorActivity&&!w&&(v.curOp.cursorActivity=!1),v.state.vim=x,x.inputState.changeQueueList=P,x.inputState.changeQueue=null},!0)}return w&&!x.visualMode&&!x.insertMode&&x.visualMode!=v.somethingSelected()&&bi(v,x),w}return Ae(),He}function On(e,n){var a=n.ch,o=n.line+1;o<1&&(o=1,a=0),o>e.lines&&(o=e.lines,a=Number.MAX_VALUE);var s=e.line(o);return Math.min(s.from+Math.max(0,a),s.to)}function sr(e,n){let a=e.lineAt(n);return{line:a.number-1,ch:n-a.from}}var xr=class{constructor(e,n){this.line=e,this.ch=n}};function Vg(e,n,a){if(e.addEventListener)e.addEventListener(n,a,!1);else{var o=e._handlers||(e._handlers={});o[n]=(o[n]||[]).concat(a)}}function Hg(e,n,a){if(e.removeEventListener)e.removeEventListener(n,a,!1);else{var o=e._handlers,s=o&&o[n];if(s){var c=s.indexOf(a);c>-1&&(o[n]=s.slice(0,c).concat(s.slice(c+1)))}}}function $g(e,n,...a){var c;var o=(c=e._handlers)==null?void 0:c[n];if(o)for(var s=0;s<o.length;++s)o[s](...a)}function Wg(e,...n){if(e)for(var a=0;a<e.length;++a)e[a](...n)}var Fd;try{Fd=RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch{Fd=/[\w]/}function fs(e,n){var a=e.cm6;if(!a.state.readOnly){var o="input.type.compose";if(e.curOp&&(e.curOp.lastChange||(o="input.type.compose.start")),n.annotations)try{n.annotations.some(function(s){s.value=="input"&&(s.value=o)})}catch(s){console.error(s)}else n.userEvent=o;return a.dispatch(n)}}function Ug(e,n){var o;e.curOp&&(e.curOp.$changeStart=void 0),(n?N5:D5)(e.cm6);let a=(o=e.curOp)==null?void 0:o.$changeStart;a!=null&&e.cm6.dispatch({selection:{anchor:a}})}var IS={Left:e=>Yo(e.cm6,{key:"Left"},"editor"),Right:e=>Yo(e.cm6,{key:"Right"},"editor"),Up:e=>Yo(e.cm6,{key:"Up"},"editor"),Down:e=>Yo(e.cm6,{key:"Down"},"editor"),Backspace:e=>Yo(e.cm6,{key:"Backspace"},"editor"),Delete:e=>Yo(e.cm6,{key:"Delete"},"editor")},je=class X_{openDialog(n,a,o){return MS(this,n,a,o)}openNotification(n,a){return RS(this,n,a)}constructor(n){this.state={},this.marks=Object.create(null),this.$mid=0,this.options={},this._handlers={},this.$lastChangeEndOffset=0,this.virtualSelection=null,this.cm6=n,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this)}on(n,a){Vg(this,n,a)}off(n,a){Hg(this,n,a)}signal(n,a,o){$g(this,n,a,o)}indexFromPos(n){return On(this.cm6.state.doc,n)}posFromIndex(n){return sr(this.cm6.state.doc,n)}foldCode(n){let a=this.cm6,o=a.state.selection.ranges,s=this.cm6.state.doc,c=On(s,n),h=$t.create([$t.range(c,c)],0).ranges;a.state.selection.ranges=h,b5(a),a.state.selection.ranges=o}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(n,a){typeof n=="object"&&(a=n.ch,n=n.line);var o=On(this.cm6.state.doc,{line:n,ch:a||0});this.cm6.dispatch({selection:{anchor:o}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(n){var a=this.cm6.state.selection.main,o=n=="head"||!n?a.head:n=="anchor"?a.anchor:n=="start"?a.from:n=="end"?a.to:null;if(o==null)throw Error("Invalid cursor type");return this.posFromIndex(o)}listSelections(){var n=this.cm6.state.doc;return this.cm6.state.selection.ranges.map(a=>({anchor:sr(n,a.anchor),head:sr(n,a.head)}))}setSelections(n,a){var o=this.cm6.state.doc,s=n.map(c=>{var h=On(o,c.head),p=On(o,c.anchor);return h==p?$t.cursor(h,1):$t.range(p,h)});this.cm6.dispatch({selection:$t.create(s,a)})}setSelection(n,a,o){this.setSelections([{anchor:n,head:a}],0),o&&o.origin=="*mouse"&&this.onBeforeEndOperation()}getLine(n){var a=this.cm6.state.doc;return n<0||n>=a.lines?"":this.cm6.state.doc.line(n+1).text}getLineHandle(n){return this.$lineHandleChanges||(this.$lineHandleChanges=[]),{row:n,index:this.indexFromPos(new xr(n,0))}}getLineNumber(n){var a=this.$lineHandleChanges;if(!a)return null;for(var o=n.index,s=0;s<a.length;s++)if(o=a[s].changes.mapPos(o,1,B2.TrackAfter),o==null)return null;var c=this.posFromIndex(o);return c.ch==0?c.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(n,a){var o=this.cm6.state.doc;return this.cm6.state.sliceDoc(On(o,n),On(o,a))}replaceRange(n,a,o,s){o||(o=a);var c=this.cm6.state.doc,h=On(c,a),p=On(c,o);fs(this,{changes:{from:h,to:p,insert:n}})}replaceSelection(n){fs(this,this.cm6.state.replaceSelection(n))}replaceSelections(n){var a=this.cm6.state.selection.ranges.map((o,s)=>({from:o.from,to:o.to,insert:n[s]||""}));fs(this,{changes:a})}getSelection(){return this.getSelections().join(`
92
- `)}getSelections(){var n=this.cm6;return n.state.selection.ranges.map(a=>n.state.sliceDoc(a.from,a.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(n=>!n.empty)}getInputField(){return this.cm6.contentDOM}clipPos(n){var a=this.cm6.state.doc,o=n.ch,s=n.line+1;s<1&&(s=1,o=0),s>a.lines&&(s=a.lines,o=Number.MAX_VALUE);var c=a.line(s);return o=Math.min(Math.max(0,o),c.to-c.from),new xr(s-1,o)}getValue(){return this.cm6.state.doc.toString()}setValue(n){var a=this.cm6;return a.dispatch({changes:{from:0,to:a.state.doc.length,insert:n},selection:$t.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(n,a){var o=this.cm6.state,s=On(o.doc,n),c=W2(o,s+1,-1);return c&&c.end||(c=W2(o,s,1),c&&c.end)?{to:sr(o.doc,c.end.from)}:{to:void 0}}scanForBracket(n,a,o,s){return DS(this,n,a,o,s)}indentLine(n,a){a?this.indentMore():this.indentLess()}indentMore(){X5(this.cm6)}indentLess(){B5(this.cm6)}execCommand(n){if(n=="indentAuto")X_.commands.indentAuto(this);else if(n=="goLineLeft")H5(this.cm6);else if(n=="goLineRight"){V5(this.cm6);let a=this.cm6.state,o=a.selection.main.head;o<a.doc.length&&a.sliceDoc(o,o+1)!==`
93
- `&&F5(this.cm6)}else console.log(n+" is not implemented")}setBookmark(n,a){var o=a!=null&&a.insertLeft?1:-1,s=this.indexFromPos(n);return new qS(this,s,o)}addOverlay({query:n}){let a=new $5({regexp:!0,search:n.source,caseSensitive:!/i/.test(n.flags)});if(a.valid){a.forVim=!0,this.cm6Query=a;let o=_h.of(a);return this.cm6.dispatch({effects:o}),a}}removeOverlay(n){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let a=_h.of(this.cm6Query);this.cm6.dispatch({effects:a})}getSearchCursor(n,a){var o=this,s=null,c=null,h=!1;a.ch??(a.ch=Number.MAX_VALUE);var p=On(o.cm6.state.doc,a),g=n.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(E,O){return O||"\\"+E});function b(E,O=0,M=E.length){return new K5(E,g,{ignoreCase:n.ignoreCase},O,M)}function _(E){var O=o.cm6.state.doc;if(E>O.length)return null;let M=b(O,E).next();return M.done?null:M.value}var S=1e4;function C(E,O){var M=o.cm6.state.doc;for(let V=1;;V++){let H=Math.max(E,O-V*S),$=b(M,H,O),N=null;for(;!$.next().done;)N=$.value;if(N&&(H==E||N.from>H+10))return N;if(H==E)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(E){var O=o.cm6.state.doc;return s=E?C(0,s?h?s.to-1:s.from:p):_(s?h?s.to+1:s.to:p),c=s&&{from:sr(O,s.from),to:sr(O,s.to),match:s.match},h=s?s.from==s.to:!1,s&&s.match},from:function(){return c==null?void 0:c.from},to:function(){return c==null?void 0:c.to},replace:function(E){s&&(fs(o,{changes:{from:s.from,to:s.to,insert:E}}),s.to=s.from+E.length,c&&(c.to=sr(o.cm6.state.doc,s.to)))},get match(){return c&&c.match}}}findPosV(n,a,o,s){let{cm6:c}=this,h=c.state.doc,p=o=="page"?c.dom.clientHeight:0,g=On(h,n),b=$t.cursor(g,1,void 0,s),_=Math.round(Math.abs(a));for(let C=0;C<_;C++)o=="page"?b=c.moveVertically(b,a>0,p):o=="line"&&(b=c.moveVertically(b,a>0));let S=sr(h,b.head);return(a<0&&b.head==0&&s!=0&&n.line==0&&n.ch!=0||a>0&&b.head==h.length&&S.ch!=s&&n.line==S.line)&&(S.hitSide=!0),S}charCoords(n,a){var o=this.cm6.contentDOM.getBoundingClientRect(),s=On(this.cm6.state.doc,n),c=this.cm6.coordsAtPos(s),h=-o.top;return{left:((c==null?void 0:c.left)||0)-o.left,top:((c==null?void 0:c.top)||0)+h,bottom:((c==null?void 0:c.bottom)||0)+h}}coordsChar(n,a){var o=this.cm6.contentDOM.getBoundingClientRect(),s=this.cm6.posAtCoords({x:n.left+o.left,y:n.top+o.top})||0;return sr(this.cm6.state.doc,s)}getScrollInfo(){var n=this.cm6.scrollDOM;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight,width:n.scrollWidth,clientHeight:n.clientHeight,clientWidth:n.clientWidth}}scrollTo(n,a){n!=null&&(this.cm6.scrollDOM.scrollLeft=n),a!=null&&(this.cm6.scrollDOM.scrollTop=a)}scrollIntoView(n,a){if(n){var o=this.indexFromPos(n);this.cm6.dispatch({effects:Et.scrollIntoView(o)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:"scroll"})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption("mode")}}setSize(n,a){this.cm6.dom.style.width=n+4+"px",this.cm6.dom.style.height=a+"px",this.refresh()}refresh(){this.cm6.measure()}destroy(){this.removeOverlay()}getLastEditEnd(){return this.posFromIndex(this.$lastChangeEndOffset)}onChange(n){for(let o in this.$lineHandleChanges&&this.$lineHandleChanges.push(n),this.marks)this.marks[o].update(n.changes);this.virtualSelection&&(this.virtualSelection.ranges=this.virtualSelection.ranges.map(o=>o.map(n.changes)));var a=this.curOp=this.curOp||{};n.changes.iterChanges((o,s,c,h,p)=>{(a.$changeStart==null||a.$changeStart>c)&&(a.$changeStart=c),this.$lastChangeEndOffset=h;var g={text:p.toJSON()};a.lastChange?a.lastChange.next=a.lastChange=g:a.lastChange=a.change=g},!0),a.changeHandlers||(a.changeHandlers=this._handlers.change&&this._handlers.change.slice())}onSelectionChange(){var n=this.curOp=this.curOp||{};n.cursorActivityHandlers||(n.cursorActivityHandlers=this._handlers.cursorActivity&&this._handlers.cursorActivity.slice()),this.curOp.cursorActivity=!0}operation(n,a){this.curOp||(this.curOp={$d:0}),this.curOp.$d++;try{var o=n()}finally{this.curOp&&(this.curOp.$d--,this.curOp.$d||this.onBeforeEndOperation())}return o}onBeforeEndOperation(){var n=this.curOp,a=!1;n&&(n.change&&Wg(n.changeHandlers,this,n.change),n&&n.cursorActivity&&(Wg(n.cursorActivityHandlers,this,null),n.isVimOp&&(a=!0)),this.curOp=null),a&&this.scrollIntoView()}moveH(n,a){if(a=="char"){var o=this.getCursor();this.setCursor(o.line,o.ch+n)}}setOption(n,a){switch(n){case"keyMap":this.state.keyMap=a;break;case"textwidth":this.state.textwidth=a;break}}getOption(n){switch(n){case"firstLineNumber":return 1;case"tabSize":return this.cm6.state.tabSize||4;case"readOnly":return this.cm6.state.readOnly;case"indentWithTabs":return this.cm6.state.facet(j2)==" ";case"indentUnit":return this.cm6.state.facet(j2).length||2;case"textwidth":return this.state.textwidth;case"keyMap":return this.state.keyMap||"vim"}}toggleOverwrite(n){this.state.overwrite=n}getTokenTypeAt(n){var s,c,h;var a=this.indexFromPos(n),o=((h=(c=(s=F2(this.cm6.state,a))==null?void 0:s.resolve(a))==null?void 0:c.type)==null?void 0:h.name)||"";return/comment/i.test(o)?"comment":/string/i.test(o)?"string":""}overWriteSelection(n){var a=this.cm6.state.doc,o=this.cm6.state.selection,s=o.ranges.map(c=>{if(c.empty){var h=c.to<a.length?a.sliceString(c.from,c.to+1):"";if(h&&!/\n/.test(h))return $t.range(c.from,c.to+1)}return c});this.cm6.dispatch({selection:$t.create(s,o.mainIndex)}),this.replaceSelection(n)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(n){var a=this.cm6.state.selection;this.virtualSelection=$t.create(a.ranges,a.mainIndex);for(var o=0;o<this.virtualSelection.ranges.length;o++){var s=this.virtualSelection.ranges[o];s&&(this.cm6.dispatch({selection:$t.create([s])}),n(),this.virtualSelection.ranges[o]=this.cm6.state.selection.ranges[0])}this.cm6.dispatch({selection:this.virtualSelection}),this.virtualSelection=null}hardWrap(n){return BS(this,n)}};je.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform),je.Pos=xr,je.StringStream=M5,je.commands={cursorCharLeft:function(e){W5(e.cm6)},redo:function(e){Ug(e,!1)},undo:function(e){Ug(e,!0)},newlineAndIndent:function(e){J5({state:e.cm6.state,dispatch:n=>fs(e,n)})},indentAuto:function(e){j5(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},je.isWordChar=function(e){return Fd.test(e)},je.keys=IS,je.addClass=function(e,n){},je.rmClass=function(e,n){},je.e_preventDefault=function(e){e.preventDefault()},je.e_stop=function(e){var n,a;(n=e==null?void 0:e.stopPropagation)==null||n.call(e),(a=e==null?void 0:e.preventDefault)==null||a.call(e)},je.lookupKey=function(e,n,a){var o=je.keys[e];!o&&/^Arrow/.test(e)&&(o=je.keys[e.slice(5)]),o&&a(o)},je.on=Vg,je.off=Hg,je.signal=$g,je.findMatchingTag=jS,je.findEnclosingTag=zS,je.keyName=void 0;function Kg(e,n,a){var o=document.createElement("div");return o.appendChild(n),o}function Qg(e,n){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=n}function RS(e,n,a){Qg(e,p);var o=Kg(e,n,a&&a.bottom),s=!1,c,h=a&&a.duration!==void 0?a.duration:5e3;function p(){s||(s=!0,clearTimeout(c),o.remove(),Jg(e,o))}return o.onclick=function(g){g.preventDefault(),p()},Gg(e,o),h&&(c=setTimeout(p,h)),p}function Gg(e,n){var a=e.state.dialog;e.state.dialog=n,n.style.flex="1",n&&a!==n&&(a&&a.contains(document.activeElement)&&e.focus(),a&&a.parentElement?a.parentElement.replaceChild(n,a):a&&a.remove(),je.signal(e,"dialog"))}function Jg(e,n){e.state.dialog==n&&(e.state.dialog=null,je.signal(e,"dialog"))}function MS(e,n,a,o){o||(o={}),Qg(e,void 0);var s=Kg(e,n,o.bottom),c=!1;Gg(e,s);function h(g){if(typeof g=="string")p.value=g;else{if(c)return;c=!0,Jg(e,s),e.state.dialog||e.focus(),o.onClose&&o.onClose(s)}}var p=s.getElementsByTagName("input")[0];return p&&(o.value&&(p.value=o.value,o.selectValueOnOpen!==!1&&p.select()),o.onInput&&je.on(p,"input",function(g){o.onInput(g,p.value,h)}),o.onKeyUp&&je.on(p,"keyup",function(g){o.onKeyUp(g,p.value,h)}),je.on(p,"keydown",function(g){o&&o.onKeyDown&&o.onKeyDown(g,p.value,h)||(g.keyCode==13&&a&&a(p.value),(g.keyCode==27||o.closeOnEnter!==!1&&g.keyCode==13)&&(p.blur(),je.e_stop(g),h()))}),o.closeOnBlur!==!1&&je.on(p,"blur",function(){setTimeout(function(){document.activeElement!==p&&h()})}),p.focus()),h}var PS={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function NS(e){return e&&e.bracketRegex||/[(){}[\]]/}function DS(e,n,a,o,s){for(var c=s&&s.maxScanLineLength||1e4,h=s&&s.maxScanLines||1e3,p=[],g=NS(s),b=a>0?Math.min(n.line+h,e.lastLine()+1):Math.max(e.firstLine()-1,n.line-h),_=n.line;_!=b;_+=a){var S=e.getLine(_);if(S){var C=a>0?0:S.length-1,E=a>0?S.length:-1;if(!(S.length>c))for(_==n.line&&(C=n.ch-(a<0?1:0));C!=E;C+=a){var O=S.charAt(C);if(g.test(O)){var M=PS[O];if(M&&M.charAt(1)==">"==a>0)p.push(O);else if(p.length)p.pop();else return{pos:new xr(_,C),ch:O}}}}}return _-a==(a>0?e.lastLine():e.firstLine())?!1:null}function jS(e,n){return null}function zS(e,n){var c,h,p;var a=e.cm6.state,o=e.indexFromPos(n);o<a.doc.length&&a.sliceDoc(o,o+1)=="<"&&o++;for(var s=((c=F2(a,o))==null?void 0:c.resolve(o))||null;s;){if(((h=s.firstChild)==null?void 0:h.type.name)=="OpenTag"&&((p=s.lastChild)==null?void 0:p.type.name)=="CloseTag")return{open:Xg(a.doc,s.firstChild),close:Xg(a.doc,s.lastChild)};s=s.parent}}function Xg(e,n){return{from:sr(e,n.from),to:sr(e,n.to)}}var qS=class{constructor(e,n,a){this.cm=e,this.id=e.$mid++,this.offset=n,this.assoc=a,e.marks[this.id]=this}clear(){delete this.cm.marks[this.id]}find(){return this.offset==null?null:this.cm.posFromIndex(this.offset)}update(e){this.offset!=null&&(this.offset=e.mapPos(this.offset,this.assoc,B2.TrackDel))}};function BS(e,n){var O;for(var a=n.column||e.getOption("textwidth")||80,o=n.allowMerge!=0,s=Math.min(n.from,n.to),c=Math.max(n.from,n.to);s<=c;){var h=e.getLine(s);if(h.length>a){var p=E(h,a,5);if(p){var g=(O=/^\s*/.exec(h))==null?void 0:O[0];e.replaceRange(`
94
- `+g,new xr(s,p.start),new xr(s,p.end))}c++}else if(o&&/\S/.test(h)&&s!=c){var b=e.getLine(s+1);if(b&&/\S/.test(b)){var _=h.replace(/\s+$/,""),S=b.replace(/^\s+/,""),C=_+" "+S,p=E(C,a,5);p&&p.start>_.length||C.length<a?(e.replaceRange(" ",new xr(s,_.length),new xr(s+1,b.length-S.length)),s--,c--):_.length<h.length&&e.replaceRange("",new xr(s,_.length),new xr(s,h.length))}}s++}return s;function E(M,V,H){if(!(M.length<V)){var $=M.slice(0,V),N=M.slice(V),ne=/^(?:(\s+)|(\S+)(\s+))/.exec(N),fe=/(?:(\s+)|(\s+)(\S+))$/.exec($),R=0,j=0;if(fe&&!fe[2]&&(R=V-fe[1].length,j=V),ne&&!ne[2]&&(R||(R=V),j=V+ne[1].length),R)return{start:R,end:j};if(fe&&fe[2]&&fe.index>H)return{start:fe.index,end:fe.index+fe[2].length};if(ne&&ne[2])return R=V+ne[2].length,{start:R,end:R+ne[3].length}}}}var Vd=I5||(function(){let e={cursorBlinkRate:1200};return function(){return e}})(),FS=class{constructor(e,n,a,o,s,c,h,p,g,b){this.left=e,this.top=n,this.height=a,this.fontFamily=o,this.fontSize=s,this.fontWeight=c,this.color=h,this.className=p,this.letter=g,this.partial=b}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",e.style.height=this.height+"px",e.style.lineHeight=this.height+"px",e.style.fontFamily=this.fontFamily,e.style.fontSize=this.fontSize,e.style.fontWeight=this.fontWeight,e.style.color=this.partial?"transparent":this.color,e.className=this.className,e.textContent=this.letter}eq(e){return this.left==e.left&&this.top==e.top&&this.height==e.height&&this.fontFamily==e.fontFamily&&this.fontSize==e.fontSize&&this.fontWeight==e.fontWeight&&this.color==e.color&&this.className==e.className&&this.letter==e.letter}},VS=class{constructor(e,n){this.view=e,this.rangePieces=[],this.cursors=[],this.cm=n,this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer cm-vimCursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){let e=Vd(this.cm.cm6.state).cursorBlinkRate;this.cursorLayer.style.animationDuration=e+"ms"}update(e){(e.selectionSet||e.geometryChanged||e.viewportChanged)&&(this.view.requestMeasure(this.measureReq),this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink"),HS(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,n=[];for(let a of e.selection.ranges){let o=a==e.selection.main,s=US(this.cm,this.view,a,o);s&&n.push(s)}return{cursors:n}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((n,a)=>!n.eq(this.cursors[a]))){let n=this.cursorLayer.children;if(n.length!==e.length){this.cursorLayer.textContent="";for(let a of e)this.cursorLayer.appendChild(a.draw())}else e.forEach((a,o)=>a.adjust(n[o]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function HS(e){return Vd(e.startState)!=Vd(e.state)}var $S=Eu.highest(Et.theme({".cm-vimMode .cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-fat-cursor":{position:"absolute",background:"#ff9696",border:"none",whiteSpace:"pre"},"&:not(.cm-focused) .cm-fat-cursor":{background:"none",outline:"solid 1px #ff9696",color:"transparent !important"}}));function WS(e){let n=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==L5.LTR?n.left:n.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:n.top-e.scrollDOM.scrollTop*e.scaleY}}function US(e,n,a,o){var _,S,C;var s;let c=a.head,h=!1,p=1,g=e.state.vim;if(g&&(!g.insertMode||e.state.overwrite)){if(h=!0,g.visualBlock&&!o)return null;a.anchor<a.head&&(c<n.state.doc.length&&n.state.sliceDoc(c,c+1))!=`
95
- `&&c--,e.state.overwrite?p=.2:g.status&&(p=.5)}if(h){let E=c<n.state.doc.length&&n.state.sliceDoc(c,c+1);E&&/[\uDC00-\uDFFF]/.test(E)&&c>1&&(c--,E=n.state.sliceDoc(c,c+1));let O=n.coordsAtPos(c,1);if(!O)return null;let M=WS(n),V=n.domAtPos(c),H=V?V.node:n.contentDOM;for(H instanceof Text&&V.offset>=H.data.length&&((_=H.parentElement)==null?void 0:_.nextSibling)&&(H=(S=H.parentElement)==null?void 0:S.nextSibling,V={node:H,offset:0});V&&V.node instanceof HTMLElement;)H=V.node,V={node:V.node.childNodes[V.offset],offset:0};if(!(H instanceof HTMLElement)){if(!H.parentNode)return null;H=H.parentNode}let $=getComputedStyle(H),N=O.left,ne=(C=(s=n).coordsForChar)==null?void 0:C.call(s,c);if(ne&&(N=ne.left),!E||E==`
96
- `||E=="\r")E="\xA0";else if(E==" "){E="\xA0";var b=n.coordsAtPos(c+1,-1);b&&(N=b.left-(b.left-O.left)/parseInt($.tabSize))}else/[\uD800-\uDBFF]/.test(E)&&c<n.state.doc.length-1&&(E+=n.state.sliceDoc(c+1,c+2));let fe=O.bottom-O.top;return new FS((N-M.left)/n.scaleX,(O.top-M.top+fe*(1-p))/n.scaleY,fe*p/n.scaleY,$.fontFamily,$.fontSize,$.fontWeight,$.color,o?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",E,p!=1)}else return null}let Yg,Zg,e1,t1;Yg=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),la=AS(je),Zg=250,e1=Et.baseTheme({".cm-vimMode .cm-cursorLayer:not(.cm-vimCursorLayer)":{display:"none"},".cm-vim-panel":{padding:"0px 10px",fontFamily:"monospace",minHeight:"1.3em",display:"flex"},".cm-vim-panel input":{border:"none",outline:"none",backgroundColor:"inherit"},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"}}),t1=ts.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=ia.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;let n=this.cm=new je(e);la.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new VS(e,n),this.updateClass(),this.cm.on("vim-command-done",()=>{n.state.vim&&(n.state.vim.status=""),this.blockCursor.scheduleRedraw(),this.updateStatus()}),this.cm.on("vim-mode-change",a=>{n.state.vim&&(n.state.vim.mode=a.mode,a.subMode&&(n.state.vim.mode+=" block"),n.state.vim.status="",this.blockCursor.scheduleRedraw(),this.updateClass(),this.updateStatus())}),this.cm.on("dialog",()=>{this.cm.state.statusbar?this.updateStatus():e.dispatch({effects:n1.of(!!this.cm.state.dialog)})}),this.dom=document.createElement("span"),this.spacer=document.createElement("span"),this.spacer.style.flex="1",this.statusButton=document.createElement("span"),this.statusButton.onclick=a=>{la.handleKey(this.cm,"<Esc>","user"),this.cm.focus()},this.statusButton.style.cssText="cursor: pointer"}update(e){var n;if((e.viewportChanged||e.docChanged)&&this.query&&this.highlight(this.query),e.docChanged&&this.cm.onChange(e),e.selectionSet&&this.cm.onSelectionChange(),e.viewportChanged,this.cm.curOp&&!this.cm.curOp.isVimOp&&this.cm.onBeforeEndOperation(),e.transactions){for(let a of e.transactions)for(let o of a.effects)if(o.is(_h))if(!((n=o.value)!=null&&n.forVim))this.highlight(null);else{let s=o.value.create();this.highlight(s)}}this.blockCursor.update(e)}updateClass(){let e=this.cm.state;!e.vim||e.vim.insertMode&&!e.overwrite?this.view.scrollDOM.classList.remove("cm-vimMode"):this.view.scrollDOM.classList.add("cm-vimMode")}updateStatus(){let e=this.cm.state.statusbar,n=this.cm.state.vim;if(!e||!n)return;let a=this.cm.state.dialog;if(a)a.parentElement!=e&&(e.textContent="",e.appendChild(a));else{e.textContent="";var o=(n.mode||"normal").toUpperCase();n.insertModeReturn&&(o+="(C-O)"),this.statusButton.textContent=`--${o}--`,e.appendChild(this.statusButton),e.appendChild(this.spacer)}this.dom.textContent=n.status,e.appendChild(this.dom)}destroy(){la.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=ia.none;let{view:n}=this,a=new z2;for(let o=0,s=n.visibleRanges,c=s.length;o<c;o++){let{from:h,to:p}=s[o];for(;o<c-1&&p>s[o+1].from-2*Zg;)p=s[++o].to;e.highlight(n.state,h,p,(g,b)=>{a.add(g,b,QS)})}return this.decorations=a.finish()}handleKey(e,n){let a=this.cm,o=a.state.vim;if(!o)return;let s=la.vimKeyFromEvent(e,o);if(je.signal(this.cm,"inputEvent",{type:"handleKey",key:s}),!s)return;if(s=="<Esc>"&&!o.insertMode&&!o.visualMode&&this.query){let h=o.searchState_;h&&(a.removeOverlay(h.getOverlay()),h.setOverlay(null))}if(s==="<C-c>"&&!je.isMac&&a.somethingSelected())return this.waitForCopy=!0,!0;o.status=(o.status||"")+s;let c=la.multiSelectHandleKey(a,s,"user");return o=la.maybeInitVimState_(a),!c&&o.insertMode&&a.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(c=!0,a.overWriteSelection(e.key)):e.key=="Backspace"&&(c=!0,je.commands.cursorCharLeft(a))),c&&(je.signal(this.cm,"vim-keypress",s),e.preventDefault(),e.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!c}},{eventHandlers:{copy:function(e,n){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var a=this.cm,o=a.state.vim;o&&(o.insertMode?a.setSelection(a.getCursor(),a.getCursor()):a.operation(()=>{a.curOp&&(a.curOp.isVimOp=!0),la.handleKey(a,"<Esc>","user")}))}))},compositionstart:function(e,n){this.useNextTextInput=!0,je.signal(this.cm,"inputEvent",e)},compositionupdate:function(e,n){je.signal(this.cm,"inputEvent",e)},compositionend:function(e,n){je.signal(this.cm,"inputEvent",e)},keypress:function(e,n){je.signal(this.cm,"inputEvent",e),this.lastKeydown=="Dead"&&this.handleKey(e,n)},keydown:function(e,n){je.signal(this.cm,"inputEvent",e),this.lastKeydown=e.key,this.lastKeydown=="Unidentified"||this.lastKeydown=="Process"||this.lastKeydown=="Dead"?this.useNextTextInput=!0:(this.useNextTextInput=!1,this.handleKey(e,n))}},provide:()=>[Et.inputHandler.of((e,n,a,o)=>{var _,S;var s=Il(e);if(!s)return!1;var c=(_=s.state)==null?void 0:_.vim,h=s.state.vimPlugin;if(c&&!c.insertMode&&!((S=s.curOp)!=null&&S.isVimOp)){if(o==="\0\0")return!0;if(je.signal(s,"inputEvent",{type:"text",text:o,from:n,to:a}),o.length==1&&h.useNextTextInput){if(c.expectLiteralNext&&e.composing)return h.compositionText=o,!1;if(h.compositionText){var p=h.compositionText;h.compositionText="";var g=e.state.selection.main.head;if(p===e.state.sliceDoc(g-p.length,g)){var b=s.getCursor();s.replaceRange("",s.posFromIndex(g-p.length),b)}}return h.handleKey({key:o,preventDefault:()=>{},stopPropagation:()=>{}}),KS(e),!0}}return!1})],decorations:e=>e.decorations});function KS(e){var n=e.scrollDOM.parentElement;if(n){if(Yg){e.contentDOM.textContent="\0\0",e.contentDOM.dispatchEvent(new CustomEvent("compositionend"));return}var a=e.scrollDOM.nextSibling,o=window.getSelection(),s=o&&{anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset};e.scrollDOM.remove(),n.insertBefore(e.scrollDOM,a);try{s&&o&&(o.setPosition(s.anchorNode,s.anchorOffset),s.focusNode&&o.extend(s.focusNode,s.focusOffset))}catch(c){console.error(c)}e.focus(),e.contentDOM.dispatchEvent(new CustomEvent("compositionend"))}}var QS=ia.mark({class:"cm-searchMatch"}),n1=aa.define(),GS=Zo.define({create:()=>!1,update(e,n){for(let a of n.effects)a.is(n1)&&(e=a.value);return e},provide:e=>bh.from(e,n=>n?JS:null)});function JS(e){let n=document.createElement("div");n.className="cm-vim-panel";let a=e.cm;return a.state.dialog&&n.appendChild(a.state.dialog),{top:!1,dom:n}}function XS(e){let n=document.createElement("div");n.className="cm-vim-panel";let a=e.cm;return a.state.statusbar=n,a.state.vimPlugin.updateStatus(),{dom:n}}A_=function(e={}){return[e1,t1,$S,e.status?bh.of(XS):GS]},Il=function(e){return e.cm||null},wm=function(e){let n=e.state.selection.main;return n.from===0&&n.to===0},Nh=function(e,n=!1){let a=e.state.selection.main,o=e.state.doc.length;return n&&a.from===o-1&&a.to===o-1?!0:a.from===o&&a.to===o},L_=function(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})},R_=function(e){var n;return((n=Il(e))==null?void 0:n.state.vim)!=null},b_=function(e){var a;let n=(a=Il(e))==null?void 0:a.state.vim;return n?!n.mode&&!n.insertMode&&!n.visualMode?!0:n.mode==="normal":!1},l_=function(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})};function r1(e,n){if(!(n!=null&&n.length))return ia.none;let a=new z2,o=e.facet(sa),s=n.filter(c=>c.kind==="cell"&&c.cellId===o).sort((c,h)=>c.lineNumber-h.lineNumber);for(let c of s)try{let h=e.doc.line(c.lineNumber),p=ia.line({class:"cm-error-line"});a.add(h.from,h.from,p)}catch(h){be.debug("Invalid line number in error decoration",{error:h})}return a.finish()}function a1(e,n){if(!(n!=null&&n.length))return;let a=e.state.facet(sa),o=n.filter(h=>h.kind==="cell"&&h.cellId===a);if(o.length===0)return;let s=A5(e.state),c=[];for(let h of o)try{let p=e.state.doc.line(h.lineNumber);s.between(p.from,p.to,(g,b)=>{c.push(E5.of({from:g,to:b}))})}catch(p){be.debug("Invalid line numbers",{error:p})}c.length>0&&e.dispatch({effects:c})}var YS=class{constructor(e,n){let a=n.get();this.decorations=r1(e.state,a),a1(e,a),this.unsubscribe=n.sub(o=>{let s=this.decorations.size;this.decorations=r1(e.state,o),a1(e,o),s!==this.decorations.size&&e.dispatch({userEvent:"marimo.error-decoration-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function ZS(e){return ts.define(n=>new YS(n,e),{decorations:n=>n.decorations})}function eC(e){return[ZS(e),Et.theme({".cm-error-line":{backgroundColor:"color-mix(in srgb, var(--red-4) 40%, transparent)"},"&.cm-focused .cm-error-line.cm-activeLine":{backgroundColor:"color-mix(in srgb, var(--red-6) 40%, transparent)"}})]}function tC({cellId:e,hotkeys:n}){let a=[];return a.push(...A2({key:n.getHotkey("cell.run").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).onRun(),!0)}),{key:n.getHotkey("cell.runAndNewBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(ct);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})),!0}},...A2({key:n.getHotkey("cell.runAndNewAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(ct);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!0})),!0}}),{key:n.getHotkey("cell.aiCompletion").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).aiCellCompletion()&&o.contentDOM.focus(),!0)}),e!=="__scratch__"&&a.push({key:n.getHotkey("cell.goToDefinition").key,preventDefault:!0,stopPropagation:!0,run:o=>(zm(o),!0)},{key:n.getHotkey("cell.delete").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.doc.length===0&&o.state.facet(ct).deleteCell(),!0)},{key:n.getHotkey("cell.moveUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).moveCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.moveDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).moveCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.moveLeft").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).moveCell({cellId:e,before:!0,direction:"left"}),!0)},{key:n.getHotkey("cell.moveRight").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).moveCell({cellId:e,before:!1,direction:"right"}),!0)},{key:"ArrowUp",preventDefault:!0,stopPropagation:!0,run:o=>J2(o.state)?!1:wm(o)?(o.state.facet(ct).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:"ArrowDown",preventDefault:!0,stopPropagation:!0,run:o=>J2(o.state)?!1:Nh(o)?(o.state.facet(ct).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0):!1},{key:n.getHotkey("cell.focusDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0)},{key:n.getHotkey("cell.focusUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},{key:n.getHotkey("cell.sendToBottom").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).sendToBottom({cellId:e}),!0)},{key:n.getHotkey("cell.sendToTop").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).sendToTop({cellId:e}),!0)},{key:n.getHotkey("cell.createAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(ct).createNewCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.createBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(ct).createNewCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.hideCode").key,preventDefault:!0,stopPropagation:!0,run:o=>{var c;let s=o.state.facet(ct).toggleHideCode();return kh(o),s?(o.contentDOM.blur(),(c=document.getElementById(En.create(e)))==null||c.focus()):o.contentDOM.focus(),!0}},{key:n.getHotkey("cell.splitCell").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(ct);return s.splitCell({cellId:e}),s.moveToNextCell&&requestAnimationFrame(()=>{o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})}),!0}}),[Eu.high(Ka.of(a))]}function nC(e){return[Et.updateListener.of(n=>{if(n.docChanged){let a=n.transactions.some(h=>h.effects.some(p=>p.is(us))),o=nr(n.view),s=n.view.state.facet(ct),c=n.view.state.facet(sa);s.updateCellCode({cellId:c,code:o,formattingChange:a})}}),nS(e)]}function rC({predicate:e}){return Et.updateListener.of(n=>{n.docChanged&&n.view.hasFocus&&e()&&(n.transactions.some(a=>a.effects.some(o=>o.is(us)))||n.view.state.facet(ct).onRun())})}Lw=function({cellId:e,hotkeys:n,cellActions:a}){return[ct.of(a),sa.of(e),tC({cellId:e,hotkeys:n}),nC(n),eC(Zk(s4(e),Fe))]};const i1=async e=>{let n=e.state.doc.sliceString(0,e.pos),a=document.activeElement,o=null;if(a!==null){let h=En.findElement(a);h!==null&&(o=En.parse(h.id))}if(o===null)return be.error("Failed to find active cell."),null;let s=await id.request({document:n,cellId:o});if(!s)return null;let c=qd.asHoverTooltip({position:e.pos,message:s,limitToType:"tooltip"});return c&&Fe.set(Wu,{documentation:c.html??null}),c?null:qd.asCompletionResult(e.pos,s)};function aC(e){return n=>e.predicate(n.state)?e.completion(n):null}var iC=async e=>{let n=e.matchBefore(/:\w*$/);if(!e.explicit&&!n)return null;let a=await oC();return{from:(n==null?void 0:n.from)??e.pos,options:a,validFor:/^[\w:]*$/}},oC=vr(async()=>{let e=await fetch("https://unpkg.com/emojilib@3.0.11/dist/emoji-en-US.json").then(n=>{if(!n.ok)throw Error("Failed to fetch emoji list");return n.json()}).catch(()=>({}));return Object.entries(e).map(([n,a])=>({shortcode:a[0],label:a.map(o=>`:${o}`).join(" "),emoji:n,displayLabel:`${n} ${a[0].replaceAll("_"," ")}`,apply:n,type:"emoji"}))}),sC=async e=>{let n=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!n)return null;let a=await lC();return{from:(n==null?void 0:n.from)??e.pos,options:a,validFor:/^[\w-:]*$/}},lC=vr(async()=>{let e=await fetch("https://unpkg.com/lucide-static@0.452.0/tags.json").then(a=>{if(!a.ok)throw Error("Failed to fetch Lucide icon list");return a.json()}).catch(()=>({})),n=a=>`https://cdn.jsdelivr.net/npm/lucide-static@0.452.0/icons/${a}.svg`;return Object.entries(e).map(([a,o])=>({label:`::${a}`,displayLabel:a,type:"lucide-icon",boost:10,apply:`::lucide:${a}::`,detail:o.join(", "),info:()=>{let s=document.createElement("img");return s.src=n(a),s.style.width="24px",s.style.height="24px",s}}))}),cC=e=>{let n=e.matchBefore(/\\\w*$/);return!e.explicit&&!n?null:{from:(n==null?void 0:n.from)??e.pos,options:uC(),validFor:/^[\w\\]*$/}},uC=vr(()=>[["alpha","\u03B1","Greek small letter alpha"],["beta","\u03B2","Greek small letter beta"],["gamma","\u03B3","Greek small letter gamma"],["delta","\u03B4","Greek small letter delta"],["epsilon","\u03B5","Greek small letter epsilon"],["zeta","\u03B6","Greek small letter zeta"],["eta","\u03B7","Greek small letter eta"],["theta","\u03B8","Greek small letter theta"],["iota","\u03B9","Greek small letter iota"],["kappa","\u03BA","Greek small letter kappa"],["lambda","\u03BB","Greek small letter lambda"],["mu","\u03BC","Greek small letter mu"],["nu","\u03BD","Greek small letter nu"],["xi","\u03BE","Greek small letter xi"],["omicron","\u03BF","Greek small letter omicron"],["pi","\u03C0","Greek small letter pi"],["rho","\u03C1","Greek small letter rho"],["sigma","\u03C3","Greek small letter sigma"],["tau","\u03C4","Greek small letter tau"],["upsilon","\u03C5","Greek small letter upsilon"],["phi","\u03C6","Greek small letter phi"],["chi","\u03C7","Greek small letter chi"],["psi","\u03C8","Greek small letter psi"],["omega","\u03C9","Greek small letter omega"],["Gamma","\u0393","Greek capital letter gamma"],["Delta","\u0394","Greek capital letter delta"],["Theta","\u0398","Greek capital letter theta"],["Lambda","\u039B","Greek capital letter lambda"],["Xi","\u039E","Greek capital letter xi"],["Pi","\u03A0","Greek capital letter pi"],["Sigma","\u03A3","Greek capital letter sigma"],["Phi","\u03A6","Greek capital letter phi"],["Psi","\u03A8","Greek capital letter psi"],["Omega","\u03A9","Greek capital letter omega"],["pm","\xB1","Plus-minus sign"],["mp","\u2213","Minus-plus sign"],["times","\xD7","Multiplication sign"],["div","\xF7","Division sign"],["cdot","\u22C5","Dot operator"],["ast","\u2217","Asterisk operator"],["star","\u22C6","Star operator"],["circ","\u2218","Ring operator"],["bullet","\u2022","Bullet"],["cap","\u2229","Intersection"],["cup","\u222A","Union"],["uplus","\u228E","Multiset union"],["sqcap","\u2293","Square cap"],["sqcup","\u2294","Square cup"],["vee","\u2228","Logical or"],["wedge","\u2227","Logical and"],["setminus","\u2216","Set minus"],["oplus","\u2295","Circled plus"],["ominus","\u2296","Circled minus"],["otimes","\u2297","Circled times"],["oslash","\u2298","Circled division slash"],["odot","\u2299","Circled dot operator"],["leq","\u2264","Less than or equal to"],["geq","\u2265","Greater than or equal to"],["equiv","\u2261","Identical to"],["prec","\u227A","Precedes"],["succ","\u227B","Succeeds"],["sim","\u223C","Tilde operator"],["perp","\u22A5","Up tack"],["mid","\u2223","Divides"],["parallel","\u2225","Parallel to"],["subset","\u2282","Subset of"],["supset","\u2283","Superset of"],["subseteq","\u2286","Subset of or equal to"],["supseteq","\u2287","Superset of or equal to"],["cong","\u2245","Approximately equal to"],["approx","\u2248","Almost equal to"],["neq","\u2260","Not equal to"],["ne","\u2260","Not equal to"],["propto","\u221D","Proportional to"],["leftarrow","\u2190","Leftward arrow"],["rightarrow","\u2192","Rightward arrow"],["Leftarrow","\u21D0","Leftward double arrow"],["Rightarrow","\u21D2","Rightward double arrow"],["leftrightarrow","\u2194","Left right arrow"],["Leftrightarrow","\u21D4","Left right double arrow"],["uparrow","\u2191","Upward arrow"],["downarrow","\u2193","Downward arrow"],["Uparrow","\u21D1","Upward double arrow"],["Downarrow","\u21D3","Downward double arrow"],["infty","\u221E","Infinity"],["nabla","\u2207","Nabla"],["partial","\u2202","Partial differential"],["forall","\u2200","For all"],["exists","\u2203","There exists"],["nexists","\u2204","There does not exist"],["emptyset","\u2205","Empty set"],["in","\u2208","Element of"],["notin","\u2209","Not an element of"],["sum","\u2211","N-ary summation"],["prod","\u220F","N-ary product"],["int","\u222B","Integral"],["oint","\u222E","Contour integral"],["sqrt","\u221A","Square root"],["hbar","\u210F","Planck constant over 2pi"],["ldots","\u2026","Horizontal ellipsis"],["cdots","\u22EF","Midline horizontal ellipsis"],["vdots","\u22EE","Vertical ellipsis"],["ddots","\u22F1","Down right diagonal ellipsis"]].map(([e,n,a])=>({label:`\\${e} ${a}`,displayLabel:e,type:"latex-symbol",boost:10,apply:`\\${e}`,info:()=>{let o=document.createElement("div");return o.textContent=`${n} ${a}`,o},detail:n})));const dC=[iC,sC,cC];var fC=100;function no(e){return!e.state.selection.main.empty}function Hd({view:e,selection:n,markup:a}){let o=[],s=!0;for(let c=n.from;c<=n.to;c++)if(!e.state.doc.lineAt(c).text.startsWith(a)){s=!1;break}for(let c=n.from;c<=n.to;){let h=e.state.doc.lineAt(c),p=h.text.startsWith(a);s?o.push({from:h.from,to:h.from+a.length,insert:Bi.of([""])}):(p&&o.push({from:h.from,to:h.from+a.length,insert:Bi.of([""])}),o.push({from:h.from,insert:Bi.of([a])})),c=h.to+1}return o}function $d({view:e,range:n,markupAfter:a,markupBefore:o}){if(n.empty){let b=e.state.wordAt(n.head);b&&(n=b)}let s=e.state.sliceDoc(n.from-o.length,n.from)===o,c=e.state.sliceDoc(n.to,n.to+a.length)===a,h=[];h.push(s?{from:n.from-o.length,to:n.from,insert:Bi.of([""])}:{from:n.from,insert:Bi.of(o.split(`
91
+ `);if(v.maybeReset&&(v.maybeReset=(v.changes=[],!1)),T)if(u.state.overwrite&&!/\n/.test(T))v.changes.push([T]);else{if(T.length>1){var A=w&&w.insertEnd&&w.insertEnd.find(),I=u.getCursor();if(A&&A.line==I.line){var D=A.ch-I.ch;D>0&&D<T.length&&(v.changes.push([T,D]),T="")}}T&&v.changes.push(T)}}f=f.next}}function wo(u){var w;var f=u.state.vim;if(f.insertMode){var y=U.macroModeState;if(y.isPlaying)return;var v=y.lastInsertModeChanges;v.expectCursorActivityForChange?v.expectCursorActivityForChange=!1:(v.maybeReset=!0,f.insertEnd&&f.insertEnd.clear(),f.insertEnd=u.setBookmark(u.getCursor(),{insertLeft:!0}))}else(w=u.curOp)!=null&&w.isVimOp||bi(u,f)}function bi(u,f){var y=u.getCursor("anchor"),v=u.getCursor("head");if(f.visualMode&&!u.somethingSelected()?In(u,!1):!f.visualMode&&!f.insertMode&&u.somethingSelected()&&(f.visualMode=!0,f.visualLine=!1,e.signal(u,"vim-mode-change",{mode:"visual"})),f.visualMode){var w=wt(v,y)?0:-1,x=wt(v,y)?-1:0;v=kt(v,0,w),y=kt(y,0,x),f.sel={anchor:y,head:v},dn(u,f,"<",Xt(v,y)),dn(u,f,">",kr(v,y))}else f.insertMode||(f.lastHPos=u.getCursor().ch)}function Is(u){var f=U.macroModeState.lastInsertModeChanges,y=e.keyName?e.keyName(u):u.key;y&&(y.indexOf("Delete")!=-1||y.indexOf("Backspace")!=-1)&&(f.maybeReset&&(f.maybeReset=(f.changes=[],!1)),f.changes.push(new Ve(y,u)))}function wi(u,f,y,v){var w=U.macroModeState;w.isPlaying=!0;var x=f.lastEditActionCommand,T=f.inputState;function A(){x?ur.processAction(u,f,x):ur.evalInput(u,f)}function I(P){if(w.lastInsertModeChanges.changes.length>0){P=f.lastEditActionCommand?P:1;var Z=w.lastInsertModeChanges;Rs(u,Z.changes,P)}}if(f.inputState=f.lastEditInputState,x&&x.interlaceInsertRepeat)for(var D=0;D<y;D++)A(),I(1);else v||A(),I(y);f.inputState=T,f.insertMode&&!v&&pn(u),w.isPlaying=!1}function _i(u,f){e.lookupKey(f,"vim-insert",function(y){return typeof y=="string"?e.commands[y](u):y(u),!0})}function Rs(u,f,y){var v=u.getCursor("head"),w=U.macroModeState.lastInsertModeChanges.visualBlock;w&&(ac(u,v,w+1),y=u.listSelections().length,u.setCursor(v));for(var x=0;x<y;x++){w&&u.setCursor(kt(v,x,0));for(var T=0;T<f.length;T++){var A=f[T];if(A instanceof Ve)_i(u,A.keyName);else if(typeof A=="string")u.replaceSelection(A);else{var I=u.getCursor(),D=kt(I,0,A[0].length-(A[1]||0));u.replaceRange(A[0],I,A[1]?I:D),u.setCursor(D)}}}w&&u.setCursor(kt(v,0,1))}function Qt(u){var f=new u.constructor;return Object.keys(u).forEach(function(y){if(y!="insertEnd"){var v=u[y];Array.isArray(v)?v=v.slice():v&&typeof v=="object"&&v.constructor!=Object&&(v=Qt(v)),f[y]=v}}),u.sel&&(f.sel={head:u.sel.head&&Ue(u.sel.head),anchor:u.sel.anchor&&Ue(u.sel.anchor)}),f}function Fr(u,f,y){var x=ee(u),v=u,w=!1,x=He.maybeInitVimState_(v),T=x.visualBlock||x.wasInVisualBlock;if(v.state.closeVimNotification){var A=v.state.closeVimNotification;if(v.state.closeVimNotification=null,A(),f=="<CR>")return ht(v),!0}var I=v.isInMultiSelectMode();if(x.wasInVisualBlock&&!I?x.wasInVisualBlock=!1:I&&x.visualBlock&&(x.wasInVisualBlock=!0),f=="<Esc>"&&!x.insertMode&&!x.visualMode&&I&&x.status=="<Esc>")ht(v);else if(T||!I||v.inVirtualSelectionMode)w=He.handleKey(v,f,y);else{var D=Qt(x),P=x.inputState.changeQueueList||[];v.operation(function(){var X;v.curOp&&(v.curOp.isVimOp=!0);var Z=0;v.forEachSelection(function(){v.state.vim.inputState.changeQueue=P[Z];var K=v.getCursor("head"),Q=v.getCursor("anchor"),ge=wt(K,Q)?0:-1,me=wt(K,Q)?-1:0;K=kt(K,0,ge),Q=kt(Q,0,me),v.state.vim.sel.head=K,v.state.vim.sel.anchor=Q,w=He.handleKey(v,f,y),v.virtualSelection&&(P[Z]=v.state.vim.inputState.changeQueue,v.state.vim=Qt(D)),Z++}),(X=v.curOp)!=null&&X.cursorActivity&&!w&&(v.curOp.cursorActivity=!1),v.state.vim=x,x.inputState.changeQueueList=P,x.inputState.changeQueue=null},!0)}return w&&!x.visualMode&&!x.insertMode&&x.visualMode!=v.somethingSelected()&&bi(v,x),w}return Ae(),He}function On(e,n){var a=n.ch,o=n.line+1;o<1&&(o=1,a=0),o>e.lines&&(o=e.lines,a=Number.MAX_VALUE);var s=e.line(o);return Math.min(s.from+Math.max(0,a),s.to)}function sr(e,n){let a=e.lineAt(n);return{line:a.number-1,ch:n-a.from}}var xr=class{constructor(e,n){this.line=e,this.ch=n}};function Vg(e,n,a){if(e.addEventListener)e.addEventListener(n,a,!1);else{var o=e._handlers||(e._handlers={});o[n]=(o[n]||[]).concat(a)}}function Hg(e,n,a){if(e.removeEventListener)e.removeEventListener(n,a,!1);else{var o=e._handlers,s=o&&o[n];if(s){var c=s.indexOf(a);c>-1&&(o[n]=s.slice(0,c).concat(s.slice(c+1)))}}}function $g(e,n,...a){var c;var o=(c=e._handlers)==null?void 0:c[n];if(o)for(var s=0;s<o.length;++s)o[s](...a)}function Wg(e,...n){if(e)for(var a=0;a<e.length;++a)e[a](...n)}var Fd;try{Fd=RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch{Fd=/[\w]/}function fs(e,n){var a=e.cm6;if(!a.state.readOnly){var o="input.type.compose";if(e.curOp&&(e.curOp.lastChange||(o="input.type.compose.start")),n.annotations)try{n.annotations.some(function(s){s.value=="input"&&(s.value=o)})}catch(s){console.error(s)}else n.userEvent=o;return a.dispatch(n)}}function Ug(e,n){var o;e.curOp&&(e.curOp.$changeStart=void 0),(n?D5:j5)(e.cm6);let a=(o=e.curOp)==null?void 0:o.$changeStart;a!=null&&e.cm6.dispatch({selection:{anchor:a}})}var RS={Left:e=>Yo(e.cm6,{key:"Left"},"editor"),Right:e=>Yo(e.cm6,{key:"Right"},"editor"),Up:e=>Yo(e.cm6,{key:"Up"},"editor"),Down:e=>Yo(e.cm6,{key:"Down"},"editor"),Backspace:e=>Yo(e.cm6,{key:"Backspace"},"editor"),Delete:e=>Yo(e.cm6,{key:"Delete"},"editor")},je=class Y_{openDialog(n,a,o){return PS(this,n,a,o)}openNotification(n,a){return MS(this,n,a)}constructor(n){this.state={},this.marks=Object.create(null),this.$mid=0,this.options={},this._handlers={},this.$lastChangeEndOffset=0,this.virtualSelection=null,this.cm6=n,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this)}on(n,a){Vg(this,n,a)}off(n,a){Hg(this,n,a)}signal(n,a,o){$g(this,n,a,o)}indexFromPos(n){return On(this.cm6.state.doc,n)}posFromIndex(n){return sr(this.cm6.state.doc,n)}foldCode(n){let a=this.cm6,o=a.state.selection.ranges,s=this.cm6.state.doc,c=On(s,n),h=$t.create([$t.range(c,c)],0).ranges;a.state.selection.ranges=h,w5(a),a.state.selection.ranges=o}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(n,a){typeof n=="object"&&(a=n.ch,n=n.line);var o=On(this.cm6.state.doc,{line:n,ch:a||0});this.cm6.dispatch({selection:{anchor:o}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(n){var a=this.cm6.state.selection.main,o=n=="head"||!n?a.head:n=="anchor"?a.anchor:n=="start"?a.from:n=="end"?a.to:null;if(o==null)throw Error("Invalid cursor type");return this.posFromIndex(o)}listSelections(){var n=this.cm6.state.doc;return this.cm6.state.selection.ranges.map(a=>({anchor:sr(n,a.anchor),head:sr(n,a.head)}))}setSelections(n,a){var o=this.cm6.state.doc,s=n.map(c=>{var h=On(o,c.head),p=On(o,c.anchor);return h==p?$t.cursor(h,1):$t.range(p,h)});this.cm6.dispatch({selection:$t.create(s,a)})}setSelection(n,a,o){this.setSelections([{anchor:n,head:a}],0),o&&o.origin=="*mouse"&&this.onBeforeEndOperation()}getLine(n){var a=this.cm6.state.doc;return n<0||n>=a.lines?"":this.cm6.state.doc.line(n+1).text}getLineHandle(n){return this.$lineHandleChanges||(this.$lineHandleChanges=[]),{row:n,index:this.indexFromPos(new xr(n,0))}}getLineNumber(n){var a=this.$lineHandleChanges;if(!a)return null;for(var o=n.index,s=0;s<a.length;s++)if(o=a[s].changes.mapPos(o,1,B2.TrackAfter),o==null)return null;var c=this.posFromIndex(o);return c.ch==0?c.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(n,a){var o=this.cm6.state.doc;return this.cm6.state.sliceDoc(On(o,n),On(o,a))}replaceRange(n,a,o,s){o||(o=a);var c=this.cm6.state.doc,h=On(c,a),p=On(c,o);fs(this,{changes:{from:h,to:p,insert:n}})}replaceSelection(n){fs(this,this.cm6.state.replaceSelection(n))}replaceSelections(n){var a=this.cm6.state.selection.ranges.map((o,s)=>({from:o.from,to:o.to,insert:n[s]||""}));fs(this,{changes:a})}getSelection(){return this.getSelections().join(`
92
+ `)}getSelections(){var n=this.cm6;return n.state.selection.ranges.map(a=>n.state.sliceDoc(a.from,a.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(n=>!n.empty)}getInputField(){return this.cm6.contentDOM}clipPos(n){var a=this.cm6.state.doc,o=n.ch,s=n.line+1;s<1&&(s=1,o=0),s>a.lines&&(s=a.lines,o=Number.MAX_VALUE);var c=a.line(s);return o=Math.min(Math.max(0,o),c.to-c.from),new xr(s-1,o)}getValue(){return this.cm6.state.doc.toString()}setValue(n){var a=this.cm6;return a.dispatch({changes:{from:0,to:a.state.doc.length,insert:n},selection:$t.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(n,a){var o=this.cm6.state,s=On(o.doc,n),c=W2(o,s+1,-1);return c&&c.end||(c=W2(o,s,1),c&&c.end)?{to:sr(o.doc,c.end.from)}:{to:void 0}}scanForBracket(n,a,o,s){return jS(this,n,a,o,s)}indentLine(n,a){a?this.indentMore():this.indentLess()}indentMore(){Y5(this.cm6)}indentLess(){F5(this.cm6)}execCommand(n){if(n=="indentAuto")Y_.commands.indentAuto(this);else if(n=="goLineLeft")$5(this.cm6);else if(n=="goLineRight"){H5(this.cm6);let a=this.cm6.state,o=a.selection.main.head;o<a.doc.length&&a.sliceDoc(o,o+1)!==`
93
+ `&&V5(this.cm6)}else console.log(n+" is not implemented")}setBookmark(n,a){var o=a!=null&&a.insertLeft?1:-1,s=this.indexFromPos(n);return new BS(this,s,o)}addOverlay({query:n}){let a=new W5({regexp:!0,search:n.source,caseSensitive:!/i/.test(n.flags)});if(a.valid){a.forVim=!0,this.cm6Query=a;let o=_h.of(a);return this.cm6.dispatch({effects:o}),a}}removeOverlay(n){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let a=_h.of(this.cm6Query);this.cm6.dispatch({effects:a})}getSearchCursor(n,a){var o=this,s=null,c=null,h=!1;a.ch??(a.ch=Number.MAX_VALUE);var p=On(o.cm6.state.doc,a),g=n.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(E,O){return O||"\\"+E});function b(E,O=0,M=E.length){return new Q5(E,g,{ignoreCase:n.ignoreCase},O,M)}function _(E){var O=o.cm6.state.doc;if(E>O.length)return null;let M=b(O,E).next();return M.done?null:M.value}var S=1e4;function C(E,O){var M=o.cm6.state.doc;for(let V=1;;V++){let H=Math.max(E,O-V*S),$=b(M,H,O),N=null;for(;!$.next().done;)N=$.value;if(N&&(H==E||N.from>H+10))return N;if(H==E)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(E){var O=o.cm6.state.doc;return s=E?C(0,s?h?s.to-1:s.from:p):_(s?h?s.to+1:s.to:p),c=s&&{from:sr(O,s.from),to:sr(O,s.to),match:s.match},h=s?s.from==s.to:!1,s&&s.match},from:function(){return c==null?void 0:c.from},to:function(){return c==null?void 0:c.to},replace:function(E){s&&(fs(o,{changes:{from:s.from,to:s.to,insert:E}}),s.to=s.from+E.length,c&&(c.to=sr(o.cm6.state.doc,s.to)))},get match(){return c&&c.match}}}findPosV(n,a,o,s){let{cm6:c}=this,h=c.state.doc,p=o=="page"?c.dom.clientHeight:0,g=On(h,n),b=$t.cursor(g,1,void 0,s),_=Math.round(Math.abs(a));for(let C=0;C<_;C++)o=="page"?b=c.moveVertically(b,a>0,p):o=="line"&&(b=c.moveVertically(b,a>0));let S=sr(h,b.head);return(a<0&&b.head==0&&s!=0&&n.line==0&&n.ch!=0||a>0&&b.head==h.length&&S.ch!=s&&n.line==S.line)&&(S.hitSide=!0),S}charCoords(n,a){var o=this.cm6.contentDOM.getBoundingClientRect(),s=On(this.cm6.state.doc,n),c=this.cm6.coordsAtPos(s),h=-o.top;return{left:((c==null?void 0:c.left)||0)-o.left,top:((c==null?void 0:c.top)||0)+h,bottom:((c==null?void 0:c.bottom)||0)+h}}coordsChar(n,a){var o=this.cm6.contentDOM.getBoundingClientRect(),s=this.cm6.posAtCoords({x:n.left+o.left,y:n.top+o.top})||0;return sr(this.cm6.state.doc,s)}getScrollInfo(){var n=this.cm6.scrollDOM;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight,width:n.scrollWidth,clientHeight:n.clientHeight,clientWidth:n.clientWidth}}scrollTo(n,a){n!=null&&(this.cm6.scrollDOM.scrollLeft=n),a!=null&&(this.cm6.scrollDOM.scrollTop=a)}scrollIntoView(n,a){if(n){var o=this.indexFromPos(n);this.cm6.dispatch({effects:Et.scrollIntoView(o)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:"scroll"})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption("mode")}}setSize(n,a){this.cm6.dom.style.width=n+4+"px",this.cm6.dom.style.height=a+"px",this.refresh()}refresh(){this.cm6.measure()}destroy(){this.removeOverlay()}getLastEditEnd(){return this.posFromIndex(this.$lastChangeEndOffset)}onChange(n){for(let o in this.$lineHandleChanges&&this.$lineHandleChanges.push(n),this.marks)this.marks[o].update(n.changes);this.virtualSelection&&(this.virtualSelection.ranges=this.virtualSelection.ranges.map(o=>o.map(n.changes)));var a=this.curOp=this.curOp||{};n.changes.iterChanges((o,s,c,h,p)=>{(a.$changeStart==null||a.$changeStart>c)&&(a.$changeStart=c),this.$lastChangeEndOffset=h;var g={text:p.toJSON()};a.lastChange?a.lastChange.next=a.lastChange=g:a.lastChange=a.change=g},!0),a.changeHandlers||(a.changeHandlers=this._handlers.change&&this._handlers.change.slice())}onSelectionChange(){var n=this.curOp=this.curOp||{};n.cursorActivityHandlers||(n.cursorActivityHandlers=this._handlers.cursorActivity&&this._handlers.cursorActivity.slice()),this.curOp.cursorActivity=!0}operation(n,a){this.curOp||(this.curOp={$d:0}),this.curOp.$d++;try{var o=n()}finally{this.curOp&&(this.curOp.$d--,this.curOp.$d||this.onBeforeEndOperation())}return o}onBeforeEndOperation(){var n=this.curOp,a=!1;n&&(n.change&&Wg(n.changeHandlers,this,n.change),n&&n.cursorActivity&&(Wg(n.cursorActivityHandlers,this,null),n.isVimOp&&(a=!0)),this.curOp=null),a&&this.scrollIntoView()}moveH(n,a){if(a=="char"){var o=this.getCursor();this.setCursor(o.line,o.ch+n)}}setOption(n,a){switch(n){case"keyMap":this.state.keyMap=a;break;case"textwidth":this.state.textwidth=a;break}}getOption(n){switch(n){case"firstLineNumber":return 1;case"tabSize":return this.cm6.state.tabSize||4;case"readOnly":return this.cm6.state.readOnly;case"indentWithTabs":return this.cm6.state.facet(j2)==" ";case"indentUnit":return this.cm6.state.facet(j2).length||2;case"textwidth":return this.state.textwidth;case"keyMap":return this.state.keyMap||"vim"}}toggleOverwrite(n){this.state.overwrite=n}getTokenTypeAt(n){var s,c,h;var a=this.indexFromPos(n),o=((h=(c=(s=F2(this.cm6.state,a))==null?void 0:s.resolve(a))==null?void 0:c.type)==null?void 0:h.name)||"";return/comment/i.test(o)?"comment":/string/i.test(o)?"string":""}overWriteSelection(n){var a=this.cm6.state.doc,o=this.cm6.state.selection,s=o.ranges.map(c=>{if(c.empty){var h=c.to<a.length?a.sliceString(c.from,c.to+1):"";if(h&&!/\n/.test(h))return $t.range(c.from,c.to+1)}return c});this.cm6.dispatch({selection:$t.create(s,o.mainIndex)}),this.replaceSelection(n)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(n){var a=this.cm6.state.selection;this.virtualSelection=$t.create(a.ranges,a.mainIndex);for(var o=0;o<this.virtualSelection.ranges.length;o++){var s=this.virtualSelection.ranges[o];s&&(this.cm6.dispatch({selection:$t.create([s])}),n(),this.virtualSelection.ranges[o]=this.cm6.state.selection.ranges[0])}this.cm6.dispatch({selection:this.virtualSelection}),this.virtualSelection=null}hardWrap(n){return FS(this,n)}};je.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform),je.Pos=xr,je.StringStream=P5,je.commands={cursorCharLeft:function(e){U5(e.cm6)},redo:function(e){Ug(e,!1)},undo:function(e){Ug(e,!0)},newlineAndIndent:function(e){X5({state:e.cm6.state,dispatch:n=>fs(e,n)})},indentAuto:function(e){z5(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},je.isWordChar=function(e){return Fd.test(e)},je.keys=RS,je.addClass=function(e,n){},je.rmClass=function(e,n){},je.e_preventDefault=function(e){e.preventDefault()},je.e_stop=function(e){var n,a;(n=e==null?void 0:e.stopPropagation)==null||n.call(e),(a=e==null?void 0:e.preventDefault)==null||a.call(e)},je.lookupKey=function(e,n,a){var o=je.keys[e];!o&&/^Arrow/.test(e)&&(o=je.keys[e.slice(5)]),o&&a(o)},je.on=Vg,je.off=Hg,je.signal=$g,je.findMatchingTag=zS,je.findEnclosingTag=qS,je.keyName=void 0;function Kg(e,n,a){var o=document.createElement("div");return o.appendChild(n),o}function Qg(e,n){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=n}function MS(e,n,a){Qg(e,p);var o=Kg(e,n,a&&a.bottom),s=!1,c,h=a&&a.duration!==void 0?a.duration:5e3;function p(){s||(s=!0,clearTimeout(c),o.remove(),Jg(e,o))}return o.onclick=function(g){g.preventDefault(),p()},Gg(e,o),h&&(c=setTimeout(p,h)),p}function Gg(e,n){var a=e.state.dialog;e.state.dialog=n,n.style.flex="1",n&&a!==n&&(a&&a.contains(document.activeElement)&&e.focus(),a&&a.parentElement?a.parentElement.replaceChild(n,a):a&&a.remove(),je.signal(e,"dialog"))}function Jg(e,n){e.state.dialog==n&&(e.state.dialog=null,je.signal(e,"dialog"))}function PS(e,n,a,o){o||(o={}),Qg(e,void 0);var s=Kg(e,n,o.bottom),c=!1;Gg(e,s);function h(g){if(typeof g=="string")p.value=g;else{if(c)return;c=!0,Jg(e,s),e.state.dialog||e.focus(),o.onClose&&o.onClose(s)}}var p=s.getElementsByTagName("input")[0];return p&&(o.value&&(p.value=o.value,o.selectValueOnOpen!==!1&&p.select()),o.onInput&&je.on(p,"input",function(g){o.onInput(g,p.value,h)}),o.onKeyUp&&je.on(p,"keyup",function(g){o.onKeyUp(g,p.value,h)}),je.on(p,"keydown",function(g){o&&o.onKeyDown&&o.onKeyDown(g,p.value,h)||(g.keyCode==13&&a&&a(p.value),(g.keyCode==27||o.closeOnEnter!==!1&&g.keyCode==13)&&(p.blur(),je.e_stop(g),h()))}),o.closeOnBlur!==!1&&je.on(p,"blur",function(){setTimeout(function(){document.activeElement!==p&&h()})}),p.focus()),h}var NS={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function DS(e){return e&&e.bracketRegex||/[(){}[\]]/}function jS(e,n,a,o,s){for(var c=s&&s.maxScanLineLength||1e4,h=s&&s.maxScanLines||1e3,p=[],g=DS(s),b=a>0?Math.min(n.line+h,e.lastLine()+1):Math.max(e.firstLine()-1,n.line-h),_=n.line;_!=b;_+=a){var S=e.getLine(_);if(S){var C=a>0?0:S.length-1,E=a>0?S.length:-1;if(!(S.length>c))for(_==n.line&&(C=n.ch-(a<0?1:0));C!=E;C+=a){var O=S.charAt(C);if(g.test(O)){var M=NS[O];if(M&&M.charAt(1)==">"==a>0)p.push(O);else if(p.length)p.pop();else return{pos:new xr(_,C),ch:O}}}}}return _-a==(a>0?e.lastLine():e.firstLine())?!1:null}function zS(e,n){return null}function qS(e,n){var c,h,p;var a=e.cm6.state,o=e.indexFromPos(n);o<a.doc.length&&a.sliceDoc(o,o+1)=="<"&&o++;for(var s=((c=F2(a,o))==null?void 0:c.resolve(o))||null;s;){if(((h=s.firstChild)==null?void 0:h.type.name)=="OpenTag"&&((p=s.lastChild)==null?void 0:p.type.name)=="CloseTag")return{open:Xg(a.doc,s.firstChild),close:Xg(a.doc,s.lastChild)};s=s.parent}}function Xg(e,n){return{from:sr(e,n.from),to:sr(e,n.to)}}var BS=class{constructor(e,n,a){this.cm=e,this.id=e.$mid++,this.offset=n,this.assoc=a,e.marks[this.id]=this}clear(){delete this.cm.marks[this.id]}find(){return this.offset==null?null:this.cm.posFromIndex(this.offset)}update(e){this.offset!=null&&(this.offset=e.mapPos(this.offset,this.assoc,B2.TrackDel))}};function FS(e,n){var O;for(var a=n.column||e.getOption("textwidth")||80,o=n.allowMerge!=0,s=Math.min(n.from,n.to),c=Math.max(n.from,n.to);s<=c;){var h=e.getLine(s);if(h.length>a){var p=E(h,a,5);if(p){var g=(O=/^\s*/.exec(h))==null?void 0:O[0];e.replaceRange(`
94
+ `+g,new xr(s,p.start),new xr(s,p.end))}c++}else if(o&&/\S/.test(h)&&s!=c){var b=e.getLine(s+1);if(b&&/\S/.test(b)){var _=h.replace(/\s+$/,""),S=b.replace(/^\s+/,""),C=_+" "+S,p=E(C,a,5);p&&p.start>_.length||C.length<a?(e.replaceRange(" ",new xr(s,_.length),new xr(s+1,b.length-S.length)),s--,c--):_.length<h.length&&e.replaceRange("",new xr(s,_.length),new xr(s,h.length))}}s++}return s;function E(M,V,H){if(!(M.length<V)){var $=M.slice(0,V),N=M.slice(V),ne=/^(?:(\s+)|(\S+)(\s+))/.exec(N),fe=/(?:(\s+)|(\s+)(\S+))$/.exec($),R=0,j=0;if(fe&&!fe[2]&&(R=V-fe[1].length,j=V),ne&&!ne[2]&&(R||(R=V),j=V+ne[1].length),R)return{start:R,end:j};if(fe&&fe[2]&&fe.index>H)return{start:fe.index,end:fe.index+fe[2].length};if(ne&&ne[2])return R=V+ne[2].length,{start:R,end:R+ne[3].length}}}}var Vd=R5||(function(){let e={cursorBlinkRate:1200};return function(){return e}})(),VS=class{constructor(e,n,a,o,s,c,h,p,g,b){this.left=e,this.top=n,this.height=a,this.fontFamily=o,this.fontSize=s,this.fontWeight=c,this.color=h,this.className=p,this.letter=g,this.partial=b}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",e.style.height=this.height+"px",e.style.lineHeight=this.height+"px",e.style.fontFamily=this.fontFamily,e.style.fontSize=this.fontSize,e.style.fontWeight=this.fontWeight,e.style.color=this.partial?"transparent":this.color,e.className=this.className,e.textContent=this.letter}eq(e){return this.left==e.left&&this.top==e.top&&this.height==e.height&&this.fontFamily==e.fontFamily&&this.fontSize==e.fontSize&&this.fontWeight==e.fontWeight&&this.color==e.color&&this.className==e.className&&this.letter==e.letter}},HS=class{constructor(e,n){this.view=e,this.rangePieces=[],this.cursors=[],this.cm=n,this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer cm-vimCursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){let e=Vd(this.cm.cm6.state).cursorBlinkRate;this.cursorLayer.style.animationDuration=e+"ms"}update(e){(e.selectionSet||e.geometryChanged||e.viewportChanged)&&(this.view.requestMeasure(this.measureReq),this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink"),$S(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,n=[];for(let a of e.selection.ranges){let o=a==e.selection.main,s=KS(this.cm,this.view,a,o);s&&n.push(s)}return{cursors:n}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((n,a)=>!n.eq(this.cursors[a]))){let n=this.cursorLayer.children;if(n.length!==e.length){this.cursorLayer.textContent="";for(let a of e)this.cursorLayer.appendChild(a.draw())}else e.forEach((a,o)=>a.adjust(n[o]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function $S(e){return Vd(e.startState)!=Vd(e.state)}var WS=Eu.highest(Et.theme({".cm-vimMode .cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-fat-cursor":{position:"absolute",background:"#ff9696",border:"none",whiteSpace:"pre"},"&:not(.cm-focused) .cm-fat-cursor":{background:"none",outline:"solid 1px #ff9696",color:"transparent !important"}}));function US(e){let n=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==O5.LTR?n.left:n.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:n.top-e.scrollDOM.scrollTop*e.scaleY}}function KS(e,n,a,o){var _,S,C;var s;let c=a.head,h=!1,p=1,g=e.state.vim;if(g&&(!g.insertMode||e.state.overwrite)){if(h=!0,g.visualBlock&&!o)return null;a.anchor<a.head&&(c<n.state.doc.length&&n.state.sliceDoc(c,c+1))!=`
95
+ `&&c--,e.state.overwrite?p=.2:g.status&&(p=.5)}if(h){let E=c<n.state.doc.length&&n.state.sliceDoc(c,c+1);E&&/[\uDC00-\uDFFF]/.test(E)&&c>1&&(c--,E=n.state.sliceDoc(c,c+1));let O=n.coordsAtPos(c,1);if(!O)return null;let M=US(n),V=n.domAtPos(c),H=V?V.node:n.contentDOM;for(H instanceof Text&&V.offset>=H.data.length&&((_=H.parentElement)==null?void 0:_.nextSibling)&&(H=(S=H.parentElement)==null?void 0:S.nextSibling,V={node:H,offset:0});V&&V.node instanceof HTMLElement;)H=V.node,V={node:V.node.childNodes[V.offset],offset:0};if(!(H instanceof HTMLElement)){if(!H.parentNode)return null;H=H.parentNode}let $=getComputedStyle(H),N=O.left,ne=(C=(s=n).coordsForChar)==null?void 0:C.call(s,c);if(ne&&(N=ne.left),!E||E==`
96
+ `||E=="\r")E="\xA0";else if(E==" "){E="\xA0";var b=n.coordsAtPos(c+1,-1);b&&(N=b.left-(b.left-O.left)/parseInt($.tabSize))}else/[\uD800-\uDBFF]/.test(E)&&c<n.state.doc.length-1&&(E+=n.state.sliceDoc(c+1,c+2));let fe=O.bottom-O.top;return new VS((N-M.left)/n.scaleX,(O.top-M.top+fe*(1-p))/n.scaleY,fe*p/n.scaleY,$.fontFamily,$.fontSize,$.fontWeight,$.color,o?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",E,p!=1)}else return null}let Yg,Zg,e1,t1;Yg=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),la=IS(je),Zg=250,e1=Et.baseTheme({".cm-vimMode .cm-cursorLayer:not(.cm-vimCursorLayer)":{display:"none"},".cm-vim-panel":{padding:"0px 10px",fontFamily:"monospace",minHeight:"1.3em",display:"flex"},".cm-vim-panel input":{border:"none",outline:"none",backgroundColor:"inherit"},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"}}),t1=ts.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=ia.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;let n=this.cm=new je(e);la.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new HS(e,n),this.updateClass(),this.cm.on("vim-command-done",()=>{n.state.vim&&(n.state.vim.status=""),this.blockCursor.scheduleRedraw(),this.updateStatus()}),this.cm.on("vim-mode-change",a=>{n.state.vim&&(n.state.vim.mode=a.mode,a.subMode&&(n.state.vim.mode+=" block"),n.state.vim.status="",this.blockCursor.scheduleRedraw(),this.updateClass(),this.updateStatus())}),this.cm.on("dialog",()=>{this.cm.state.statusbar?this.updateStatus():e.dispatch({effects:n1.of(!!this.cm.state.dialog)})}),this.dom=document.createElement("span"),this.spacer=document.createElement("span"),this.spacer.style.flex="1",this.statusButton=document.createElement("span"),this.statusButton.onclick=a=>{la.handleKey(this.cm,"<Esc>","user"),this.cm.focus()},this.statusButton.style.cssText="cursor: pointer"}update(e){var n;if((e.viewportChanged||e.docChanged)&&this.query&&this.highlight(this.query),e.docChanged&&this.cm.onChange(e),e.selectionSet&&this.cm.onSelectionChange(),e.viewportChanged,this.cm.curOp&&!this.cm.curOp.isVimOp&&this.cm.onBeforeEndOperation(),e.transactions){for(let a of e.transactions)for(let o of a.effects)if(o.is(_h))if(!((n=o.value)!=null&&n.forVim))this.highlight(null);else{let s=o.value.create();this.highlight(s)}}this.blockCursor.update(e)}updateClass(){let e=this.cm.state;!e.vim||e.vim.insertMode&&!e.overwrite?this.view.scrollDOM.classList.remove("cm-vimMode"):this.view.scrollDOM.classList.add("cm-vimMode")}updateStatus(){let e=this.cm.state.statusbar,n=this.cm.state.vim;if(!e||!n)return;let a=this.cm.state.dialog;if(a)a.parentElement!=e&&(e.textContent="",e.appendChild(a));else{e.textContent="";var o=(n.mode||"normal").toUpperCase();n.insertModeReturn&&(o+="(C-O)"),this.statusButton.textContent=`--${o}--`,e.appendChild(this.statusButton),e.appendChild(this.spacer)}this.dom.textContent=n.status,e.appendChild(this.dom)}destroy(){la.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=ia.none;let{view:n}=this,a=new z2;for(let o=0,s=n.visibleRanges,c=s.length;o<c;o++){let{from:h,to:p}=s[o];for(;o<c-1&&p>s[o+1].from-2*Zg;)p=s[++o].to;e.highlight(n.state,h,p,(g,b)=>{a.add(g,b,GS)})}return this.decorations=a.finish()}handleKey(e,n){let a=this.cm,o=a.state.vim;if(!o)return;let s=la.vimKeyFromEvent(e,o);if(je.signal(this.cm,"inputEvent",{type:"handleKey",key:s}),!s)return;if(s=="<Esc>"&&!o.insertMode&&!o.visualMode&&this.query){let h=o.searchState_;h&&(a.removeOverlay(h.getOverlay()),h.setOverlay(null))}if(s==="<C-c>"&&!je.isMac&&a.somethingSelected())return this.waitForCopy=!0,!0;o.status=(o.status||"")+s;let c=la.multiSelectHandleKey(a,s,"user");return o=la.maybeInitVimState_(a),!c&&o.insertMode&&a.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(c=!0,a.overWriteSelection(e.key)):e.key=="Backspace"&&(c=!0,je.commands.cursorCharLeft(a))),c&&(je.signal(this.cm,"vim-keypress",s),e.preventDefault(),e.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!c}},{eventHandlers:{copy:function(e,n){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var a=this.cm,o=a.state.vim;o&&(o.insertMode?a.setSelection(a.getCursor(),a.getCursor()):a.operation(()=>{a.curOp&&(a.curOp.isVimOp=!0),la.handleKey(a,"<Esc>","user")}))}))},compositionstart:function(e,n){this.useNextTextInput=!0,je.signal(this.cm,"inputEvent",e)},compositionupdate:function(e,n){je.signal(this.cm,"inputEvent",e)},compositionend:function(e,n){je.signal(this.cm,"inputEvent",e)},keypress:function(e,n){je.signal(this.cm,"inputEvent",e),this.lastKeydown=="Dead"&&this.handleKey(e,n)},keydown:function(e,n){je.signal(this.cm,"inputEvent",e),this.lastKeydown=e.key,this.lastKeydown=="Unidentified"||this.lastKeydown=="Process"||this.lastKeydown=="Dead"?this.useNextTextInput=!0:(this.useNextTextInput=!1,this.handleKey(e,n))}},provide:()=>[Et.inputHandler.of((e,n,a,o)=>{var _,S;var s=Il(e);if(!s)return!1;var c=(_=s.state)==null?void 0:_.vim,h=s.state.vimPlugin;if(c&&!c.insertMode&&!((S=s.curOp)!=null&&S.isVimOp)){if(o==="\0\0")return!0;if(je.signal(s,"inputEvent",{type:"text",text:o,from:n,to:a}),o.length==1&&h.useNextTextInput){if(c.expectLiteralNext&&e.composing)return h.compositionText=o,!1;if(h.compositionText){var p=h.compositionText;h.compositionText="";var g=e.state.selection.main.head;if(p===e.state.sliceDoc(g-p.length,g)){var b=s.getCursor();s.replaceRange("",s.posFromIndex(g-p.length),b)}}return h.handleKey({key:o,preventDefault:()=>{},stopPropagation:()=>{}}),QS(e),!0}}return!1})],decorations:e=>e.decorations});function QS(e){var n=e.scrollDOM.parentElement;if(n){if(Yg){e.contentDOM.textContent="\0\0",e.contentDOM.dispatchEvent(new CustomEvent("compositionend"));return}var a=e.scrollDOM.nextSibling,o=window.getSelection(),s=o&&{anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset};e.scrollDOM.remove(),n.insertBefore(e.scrollDOM,a);try{s&&o&&(o.setPosition(s.anchorNode,s.anchorOffset),s.focusNode&&o.extend(s.focusNode,s.focusOffset))}catch(c){console.error(c)}e.focus(),e.contentDOM.dispatchEvent(new CustomEvent("compositionend"))}}var GS=ia.mark({class:"cm-searchMatch"}),n1=aa.define(),JS=Zo.define({create:()=>!1,update(e,n){for(let a of n.effects)a.is(n1)&&(e=a.value);return e},provide:e=>bh.from(e,n=>n?XS:null)});function XS(e){let n=document.createElement("div");n.className="cm-vim-panel";let a=e.cm;return a.state.dialog&&n.appendChild(a.state.dialog),{top:!1,dom:n}}function YS(e){let n=document.createElement("div");n.className="cm-vim-panel";let a=e.cm;return a.state.statusbar=n,a.state.vimPlugin.updateStatus(),{dom:n}}R_=function(e={}){return[e1,t1,WS,e.status?bh.of(YS):JS]},Il=function(e){return e.cm||null},wm=function(e){let n=e.state.selection.main;return n.from===0&&n.to===0},Nh=function(e,n=!1){let a=e.state.selection.main,o=e.state.doc.length;return n&&a.from===o-1&&a.to===o-1?!0:a.from===o&&a.to===o},A_=function(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})},P_=function(e){var n;return((n=Il(e))==null?void 0:n.state.vim)!=null},w_=function(e){var a;let n=(a=Il(e))==null?void 0:a.state.vim;return n?!n.mode&&!n.insertMode&&!n.visualMode?!0:n.mode==="normal":!1},s_=function(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})};function r1(e,n){if(!(n!=null&&n.length))return ia.none;let a=new z2,o=e.facet(sa),s=n.filter(c=>c.kind==="cell"&&c.cellId===o).sort((c,h)=>c.lineNumber-h.lineNumber);for(let c of s)try{let h=e.doc.line(c.lineNumber),p=ia.line({class:"cm-error-line"});a.add(h.from,h.from,p)}catch(h){be.debug("Invalid line number in error decoration",{error:h})}return a.finish()}function a1(e,n){if(!(n!=null&&n.length))return;let a=e.state.facet(sa),o=n.filter(h=>h.kind==="cell"&&h.cellId===a);if(o.length===0)return;let s=I5(e.state),c=[];for(let h of o)try{let p=e.state.doc.line(h.lineNumber);s.between(p.from,p.to,(g,b)=>{c.push(T5.of({from:g,to:b}))})}catch(p){be.debug("Invalid line numbers",{error:p})}c.length>0&&e.dispatch({effects:c})}var ZS=class{constructor(e,n){let a=n.get();this.decorations=r1(e.state,a),a1(e,a),this.unsubscribe=n.sub(o=>{let s=this.decorations.size;this.decorations=r1(e.state,o),a1(e,o),s!==this.decorations.size&&e.dispatch({userEvent:"marimo.error-decoration-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function eC(e){return ts.define(n=>new ZS(n,e),{decorations:n=>n.decorations})}function tC(e){return[eC(e),Et.theme({".cm-error-line":{backgroundColor:"color-mix(in srgb, var(--red-4) 40%, transparent)"},"&.cm-focused .cm-error-line.cm-activeLine":{backgroundColor:"color-mix(in srgb, var(--red-6) 40%, transparent)"}})]}function nC({cellId:e,hotkeys:n}){let a=[];return a.push(...A2({key:n.getHotkey("cell.run").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).onRun(),!0)}),{key:n.getHotkey("cell.runAndNewBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(ct);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})),!0}},...A2({key:n.getHotkey("cell.runAndNewAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(ct);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!0})),!0}}),{key:n.getHotkey("cell.aiCompletion").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).aiCellCompletion()&&o.contentDOM.focus(),!0)}),e!=="__scratch__"&&a.push({key:n.getHotkey("cell.goToDefinition").key,preventDefault:!0,stopPropagation:!0,run:o=>(zm(o),!0)},{key:n.getHotkey("cell.delete").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.doc.length===0&&o.state.facet(ct).deleteCell(),!0)},{key:n.getHotkey("cell.moveUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).moveCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.moveDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).moveCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.moveLeft").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).moveCell({cellId:e,before:!0,direction:"left"}),!0)},{key:n.getHotkey("cell.moveRight").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).moveCell({cellId:e,before:!1,direction:"right"}),!0)},{key:"ArrowUp",preventDefault:!0,stopPropagation:!0,run:o=>J2(o.state)?!1:wm(o)?(o.state.facet(ct).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:"ArrowDown",preventDefault:!0,stopPropagation:!0,run:o=>J2(o.state)?!1:Nh(o)?(o.state.facet(ct).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0):!1},{key:n.getHotkey("cell.focusDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0)},{key:n.getHotkey("cell.focusUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},{key:n.getHotkey("cell.sendToBottom").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).sendToBottom({cellId:e}),!0)},{key:n.getHotkey("cell.sendToTop").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(ct).sendToTop({cellId:e}),!0)},{key:n.getHotkey("cell.createAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(ct).createNewCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.createBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(ct).createNewCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.hideCode").key,preventDefault:!0,stopPropagation:!0,run:o=>{var c;let s=o.state.facet(ct).toggleHideCode();return kh(o),s?(o.contentDOM.blur(),(c=document.getElementById(En.create(e)))==null||c.focus()):o.contentDOM.focus(),!0}},{key:n.getHotkey("cell.splitCell").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(ct);return s.splitCell({cellId:e}),s.moveToNextCell&&requestAnimationFrame(()=>{o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})}),!0}}),[Eu.high(Ka.of(a))]}function rC(e){return[Et.updateListener.of(n=>{if(n.docChanged){let a=n.transactions.some(h=>h.effects.some(p=>p.is(us))),o=nr(n.view),s=n.view.state.facet(ct),c=n.view.state.facet(sa);s.updateCellCode({cellId:c,code:o,formattingChange:a})}}),rS(e)]}function aC({predicate:e}){return Et.updateListener.of(n=>{n.docChanged&&n.view.hasFocus&&e()&&(n.transactions.some(a=>a.effects.some(o=>o.is(us)))||n.view.state.facet(ct).onRun())})}Tw=function({cellId:e,hotkeys:n,cellActions:a}){return[ct.of(a),sa.of(e),nC({cellId:e,hotkeys:n}),rC(n),tC(eS(l4(e),Fe))]};const i1=async e=>{let n=e.state.doc.sliceString(0,e.pos),a=document.activeElement,o=null;if(a!==null){let h=En.findElement(a);h!==null&&(o=En.parse(h.id))}if(o===null)return be.error("Failed to find active cell."),null;let s=await ad.request({document:n,cellId:o});if(!s)return null;let c=qd.asHoverTooltip({position:e.pos,message:s,limitToType:"tooltip"});return c&&Fe.set(Wu,{documentation:c.html??null}),c?null:qd.asCompletionResult(e.pos,s)};function iC(e){return n=>e.predicate(n.state)?e.completion(n):null}var oC=async e=>{let n=e.matchBefore(/:\w*$/);if(!e.explicit&&!n)return null;let a=await sC();return{from:(n==null?void 0:n.from)??e.pos,options:a,validFor:/^[\w:]*$/}},sC=vr(async()=>{let e=await fetch("https://unpkg.com/emojilib@3.0.11/dist/emoji-en-US.json").then(n=>{if(!n.ok)throw Error("Failed to fetch emoji list");return n.json()}).catch(()=>({}));return Object.entries(e).map(([n,a])=>({shortcode:a[0],label:a.map(o=>`:${o}`).join(" "),emoji:n,displayLabel:`${n} ${a[0].replaceAll("_"," ")}`,apply:n,type:"emoji"}))}),lC=async e=>{let n=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!n)return null;let a=await cC();return{from:(n==null?void 0:n.from)??e.pos,options:a,validFor:/^[\w-:]*$/}},cC=vr(async()=>{let e=await fetch("https://unpkg.com/lucide-static@0.452.0/tags.json").then(a=>{if(!a.ok)throw Error("Failed to fetch Lucide icon list");return a.json()}).catch(()=>({})),n=a=>`https://cdn.jsdelivr.net/npm/lucide-static@0.452.0/icons/${a}.svg`;return Object.entries(e).map(([a,o])=>({label:`::${a}`,displayLabel:a,type:"lucide-icon",boost:10,apply:`::lucide:${a}::`,detail:o.join(", "),info:()=>{let s=document.createElement("img");return s.src=n(a),s.style.width="24px",s.style.height="24px",s}}))}),uC=e=>{let n=e.matchBefore(/\\\w*$/);return!e.explicit&&!n?null:{from:(n==null?void 0:n.from)??e.pos,options:dC(),validFor:/^[\w\\]*$/}},dC=vr(()=>[["alpha","\u03B1","Greek small letter alpha"],["beta","\u03B2","Greek small letter beta"],["gamma","\u03B3","Greek small letter gamma"],["delta","\u03B4","Greek small letter delta"],["epsilon","\u03B5","Greek small letter epsilon"],["zeta","\u03B6","Greek small letter zeta"],["eta","\u03B7","Greek small letter eta"],["theta","\u03B8","Greek small letter theta"],["iota","\u03B9","Greek small letter iota"],["kappa","\u03BA","Greek small letter kappa"],["lambda","\u03BB","Greek small letter lambda"],["mu","\u03BC","Greek small letter mu"],["nu","\u03BD","Greek small letter nu"],["xi","\u03BE","Greek small letter xi"],["omicron","\u03BF","Greek small letter omicron"],["pi","\u03C0","Greek small letter pi"],["rho","\u03C1","Greek small letter rho"],["sigma","\u03C3","Greek small letter sigma"],["tau","\u03C4","Greek small letter tau"],["upsilon","\u03C5","Greek small letter upsilon"],["phi","\u03C6","Greek small letter phi"],["chi","\u03C7","Greek small letter chi"],["psi","\u03C8","Greek small letter psi"],["omega","\u03C9","Greek small letter omega"],["Gamma","\u0393","Greek capital letter gamma"],["Delta","\u0394","Greek capital letter delta"],["Theta","\u0398","Greek capital letter theta"],["Lambda","\u039B","Greek capital letter lambda"],["Xi","\u039E","Greek capital letter xi"],["Pi","\u03A0","Greek capital letter pi"],["Sigma","\u03A3","Greek capital letter sigma"],["Phi","\u03A6","Greek capital letter phi"],["Psi","\u03A8","Greek capital letter psi"],["Omega","\u03A9","Greek capital letter omega"],["pm","\xB1","Plus-minus sign"],["mp","\u2213","Minus-plus sign"],["times","\xD7","Multiplication sign"],["div","\xF7","Division sign"],["cdot","\u22C5","Dot operator"],["ast","\u2217","Asterisk operator"],["star","\u22C6","Star operator"],["circ","\u2218","Ring operator"],["bullet","\u2022","Bullet"],["cap","\u2229","Intersection"],["cup","\u222A","Union"],["uplus","\u228E","Multiset union"],["sqcap","\u2293","Square cap"],["sqcup","\u2294","Square cup"],["vee","\u2228","Logical or"],["wedge","\u2227","Logical and"],["setminus","\u2216","Set minus"],["oplus","\u2295","Circled plus"],["ominus","\u2296","Circled minus"],["otimes","\u2297","Circled times"],["oslash","\u2298","Circled division slash"],["odot","\u2299","Circled dot operator"],["leq","\u2264","Less than or equal to"],["geq","\u2265","Greater than or equal to"],["equiv","\u2261","Identical to"],["prec","\u227A","Precedes"],["succ","\u227B","Succeeds"],["sim","\u223C","Tilde operator"],["perp","\u22A5","Up tack"],["mid","\u2223","Divides"],["parallel","\u2225","Parallel to"],["subset","\u2282","Subset of"],["supset","\u2283","Superset of"],["subseteq","\u2286","Subset of or equal to"],["supseteq","\u2287","Superset of or equal to"],["cong","\u2245","Approximately equal to"],["approx","\u2248","Almost equal to"],["neq","\u2260","Not equal to"],["ne","\u2260","Not equal to"],["propto","\u221D","Proportional to"],["leftarrow","\u2190","Leftward arrow"],["rightarrow","\u2192","Rightward arrow"],["Leftarrow","\u21D0","Leftward double arrow"],["Rightarrow","\u21D2","Rightward double arrow"],["leftrightarrow","\u2194","Left right arrow"],["Leftrightarrow","\u21D4","Left right double arrow"],["uparrow","\u2191","Upward arrow"],["downarrow","\u2193","Downward arrow"],["Uparrow","\u21D1","Upward double arrow"],["Downarrow","\u21D3","Downward double arrow"],["infty","\u221E","Infinity"],["nabla","\u2207","Nabla"],["partial","\u2202","Partial differential"],["forall","\u2200","For all"],["exists","\u2203","There exists"],["nexists","\u2204","There does not exist"],["emptyset","\u2205","Empty set"],["in","\u2208","Element of"],["notin","\u2209","Not an element of"],["sum","\u2211","N-ary summation"],["prod","\u220F","N-ary product"],["int","\u222B","Integral"],["oint","\u222E","Contour integral"],["sqrt","\u221A","Square root"],["hbar","\u210F","Planck constant over 2pi"],["ldots","\u2026","Horizontal ellipsis"],["cdots","\u22EF","Midline horizontal ellipsis"],["vdots","\u22EE","Vertical ellipsis"],["ddots","\u22F1","Down right diagonal ellipsis"]].map(([e,n,a])=>({label:`\\${e} ${a}`,displayLabel:e,type:"latex-symbol",boost:10,apply:`\\${e}`,info:()=>{let o=document.createElement("div");return o.textContent=`${n} ${a}`,o},detail:n})));const fC=[oC,lC,uC];var pC=100;function no(e){return!e.state.selection.main.empty}function Hd({view:e,selection:n,markup:a}){let o=[],s=!0;for(let c=n.from;c<=n.to;c++)if(!e.state.doc.lineAt(c).text.startsWith(a)){s=!1;break}for(let c=n.from;c<=n.to;){let h=e.state.doc.lineAt(c),p=h.text.startsWith(a);s?o.push({from:h.from,to:h.from+a.length,insert:Bi.of([""])}):(p&&o.push({from:h.from,to:h.from+a.length,insert:Bi.of([""])}),o.push({from:h.from,insert:Bi.of([a])})),c=h.to+1}return o}function $d({view:e,range:n,markupAfter:a,markupBefore:o}){if(n.empty){let b=e.state.wordAt(n.head);b&&(n=b)}let s=e.state.sliceDoc(n.from-o.length,n.from)===o,c=e.state.sliceDoc(n.to,n.to+a.length)===a,h=[];h.push(s?{from:n.from-o.length,to:n.from,insert:Bi.of([""])}:{from:n.from,insert:Bi.of(o.split(`
97
97
  `))},c?{from:n.to,to:n.to+a.length,insert:Bi.of([""])}:{from:n.to,insert:Bi.of(a.split(`
98
- `))});let p=s?-o.length:o.length,g=c?-a.length:a.length;return{changes:h,range:$t.range(n.from+p,n.to+g)}}function pC(e){if(!no(e))return!1;let n=Hd({view:e,selection:e.state.selection.main,markup:"> "});return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function hC(e){if(!no(e))return!1;let n=e.state.changeByRange(a=>{if(a.empty){let o=e.state.wordAt(a.head);o&&(a=o)}return $d({view:e,range:a,markupBefore:"**",markupAfter:"**"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:es.userEvent.of("input")})),e.focus(),!0}function o1(e){if(!no(e))return!1;let n=e.state.changeByRange(a=>{if(a.empty){let s=e.state.wordAt(a.head);s&&(a=s)}let o=e.state.doc.lineAt(a.from).number!==e.state.doc.lineAt(a.to).number;return $d({view:e,range:a,markupBefore:o?"```\n":"`",markupAfter:o?"\n```":"`"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:es.userEvent.of("input")})),e.focus(),!0}function mC(e){let n=e.state.changeByRange(a=>{if(a.empty){let o=e.state.wordAt(a.head);o&&(a=o)}return $d({view:e,range:a,markupBefore:"_",markupAfter:"_"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:es.userEvent.of("input")})),e.focus(),!0}function s1(e,n="http://"){if(!no(e))return!1;let a=e.state.changeByRange(s=>{let c=e.state.sliceDoc(s.from,s.to);return{changes:[{from:s.from,to:s.to,insert:`[${c}](${n})`}],range:s}});e.dispatch(e.state.update(a,{scrollIntoView:!0,annotations:es.userEvent.of("input")}));let{to:o}=a.selection.main;try{e.dispatch({selection:$t.create([$t.range(o+3,o+3+n.length),$t.cursor(o+3+n.length)])})}catch{}return e.focus(),!0}lm=async function(e,n){var p;let a=new FileReader,o=await new Promise(g=>{a.onload=()=>g(a.result),a.readAsDataURL(n)}),s;try{if(o.startsWith("data:")){let g=o.split(",")[1],b=prompt("We can save your image as a file. Enter a filename.",n.name),_=n.type.split("/")[1];if(b===null){let S=Math.round(o.length/1024);if(S>fC){vl({title:"Content too large",description:`The content size is ${S} KB, which is too large to paste directly into the document.`});return}}else{b.trim()===""?b=n.name:b.endsWith(`.${_}`)||(b=`${b}.${_}`);let S=Fe.get(is),C=S?Lh.dirname(S):null,E=C?`${C}/public`:"public",O=await oa().sendCreateFileOrFolder({path:E,type:"file",name:b,contents:g});O.success?(s=(p=O.info)==null?void 0:p.path,s&&C&&s.startsWith(C)&&(s=Lh.rest(s,C)),vl({title:"Image uploaded successfully",description:`We've uploaded your image at ${s}`})):vl({title:"Failed to upload image. Using raw base64 string."})}}}catch{vl({title:"Failed to upload image. Using raw base64 string."})}let c=e.state.changeByRange(g=>{let b=e.state.sliceDoc(g.from,g.to);return b.trim()===""&&(b="alt"),{changes:[{from:g.from,to:g.to,insert:`![${b}](${s??o})`}],range:g}});e.dispatch(e.state.update(c,{scrollIntoView:!0,annotations:es.userEvent.of("input")}));let{to:h}=c.selection.main;try{e.dispatch({selection:$t.create([$t.range(h+4,h+4+o.length),$t.cursor(h+4+o.length)])})}catch{}return e.focus(),!0},hm=async function(e,n){let a=await n.text(),o=e.state.changeByRange(s=>({changes:[{from:s.from,to:s.from,insert:a}],range:s}));return e.dispatch(e.state.update(o,{scrollIntoView:!0,annotations:es.userEvent.of("input")})),e.focus(),!0};function gC(e){if(!no(e))return!1;let{changes:n}=e.state.changeByRange(a=>({range:a,changes:Hd({view:e,selection:a,markup:e.state.sliceDoc(a.from,a.to+2).startsWith("* ")?"* ":"- "})}));return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function yC(e){if(!no(e))return!1;let{changes:n}=e.state.changeByRange(a=>({range:a,changes:Hd({view:e,selection:a,markup:"1. "})}));return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function vC(e){return[Eu.highest(Ka.of([{key:e.getHotkey("markdown.bold").key,stopPropagation:!0,run:hC},{key:e.getHotkey("markdown.italic").key,stopPropagation:!0,run:mC},{key:e.getHotkey("markdown.link").key,stopPropagation:!0,run:n=>s1(n)},{key:e.getHotkey("markdown.orderedList").key,run:yC},{key:e.getHotkey("markdown.unorderedList").key,run:gC},{key:e.getHotkey("markdown.blockquote").key,run:pC},{key:e.getHotkey("markdown.code").key,run:o1},{key:"`",run:o1}])),Et.domEventHandlers({paste:(n,a)=>{var s;if(a.state.selection.main.empty)return!1;let o=(s=n.clipboardData)==null?void 0:s.getData("text/plain");o!=null&&o.startsWith("http")&&(n.preventDefault(),s1(a,o))}}),Et.domEventHandlers({paste:(n,a)=>{var s;let o=(s=n.clipboardData)==null?void 0:s.files[0];if(!o)return!1;if(o.type.startsWith("image/"))return n.preventDefault(),lm(a,o),!0;if(o.type.startsWith("text/"))return n.preventDefault(),hm(a,o),!0}})]}function bC(e,n,a=3,o=""){return Object.values(e).flatMap(s=>n.has(s.name)?[]:{label:`${o}${s.name}`,displayLabel:s.name,detail:s.dataType??"",boost:a,type:"variable",apply:`${o}${s.name}`,section:"Variable",info:()=>dm(s)})}dm=function(e){let n=document.createElement("div");n.classList.add("mo-cm-tooltip","docs-documentation","min-w-[200px]","flex","flex-col","gap-1","p-2");let a=document.createElement("div");a.classList.add("flex","items-center","gap-2");let o=document.createElement("span");if(o.classList.add("font-bold","text-base"),o.textContent=e.name,a.append(o),e.dataType){let s=document.createElement("span");s.classList.add("text-xs","px-1.5","py-0.5","rounded-full","bg-purple-100","text-purple-800","dark:bg-purple-900","dark:text-purple-200"),s.textContent=e.dataType,a.append(s)}if(n.append(a),e.value){let s=document.createElement("div");s.classList.add("flex","flex-col","gap-1");let c=document.createElement("div");c.classList.add("text-xs","text-muted-foreground"),c.textContent="Value:",s.append(c);let h=document.createElement("div");h.classList.add("text-xs","font-mono","bg-muted","p-2","rounded","overflow-auto","max-h-40"),h.textContent=e.value,s.append(h),n.append(s)}return n};var ro="Python",Wd=123,l1=125,Ud=1,wC={mark:`${ro}Mark`,resolve:ro};function _C(e,n){return{defineNodes:[{name:ro,style:Cu.emphasis},{name:`${ro}Mark`,style:Cu.processingInstruction}],parseInline:[{name:ro,parse(a,o,s){return!n()||o!==Wd&&o!==l1||o===Wd&&a.slice(s-1,s)==="{"?-1:a.addDelimiter(wC,s,s+Ud,o===Wd,o===l1)}}],wrap:H2(a=>{if(!n()||a.type.name!==ro)return null;let o=a.from+Ud,s=a.to-Ud;return o>=s||o<0||s<0?null:{parser:e,overlay:[{from:o,to:s}],extensions:[tw().support]}})}}const xC=e=>{let n=e.state.doc.sliceString(0,e.pos),a=n.lastIndexOf("{");if(n.at(a-1)==="{"||a===-1||n.indexOf("}",a)>a)return null;let o=e.matchBefore(/\w*$/);if(!o)return null;let s=bC(Fe.get(Ga),new Set,99);return{from:o.from,options:s,validFor:/^\w*$/}};var Vl="InlineMathDollar",ao="InlineMathBracket",Hl="BlockMathDollar",io="BlockMathBracket",ii={[Vl]:1,[ao]:3,[Hl]:2,[io]:3},ft={DOLLAR:36,BACKSLASH:92,OPEN_PAREN:40,CLOSE_PAREN:41,OPEN_BRACKET:91,CLOSE_BRACKET:93},oo=Object.keys(ii).reduce((e,n)=>(e[n]={mark:`${n}Mark`,resolve:n},e),{});function kC(e){let n=[];return Object.keys(ii).forEach(a=>{n.push({name:a,style:Cu.emphasis},{name:`${a}Mark`,style:Cu.processingInstruction})}),{defineNodes:n,parseInline:[{name:Hl,parse(a,o,s){return o!==ft.DOLLAR||a.char(s+1)!==ft.DOLLAR?-1:a.addDelimiter(oo[Hl],s,s+ii[Hl],!0,!0)}},{name:Vl,parse(a,o,s){return o!==ft.DOLLAR||a.char(s+1)===ft.DOLLAR?-1:a.addDelimiter(oo[Vl],s,s+ii[Vl],!0,!0)}},{name:ao,before:"Escape",parse(a,o,s){return o!==ft.BACKSLASH||a.char(s+1)!==ft.BACKSLASH||![ft.OPEN_PAREN,ft.CLOSE_PAREN].includes(a.char(s+2))?-1:a.addDelimiter(oo[ao],s,s+ii[ao],a.char(s+2)===ft.OPEN_PAREN,a.char(s+2)===ft.CLOSE_PAREN)}},{name:io,before:"Escape",parse(a,o,s){return o!==ft.BACKSLASH||a.char(s+1)!==ft.BACKSLASH||![ft.OPEN_BRACKET,ft.CLOSE_BRACKET].includes(a.char(s+2))?-1:a.addDelimiter(oo[io],s,s+ii[io],a.char(s+2)===ft.OPEN_BRACKET,a.char(s+2)===ft.CLOSE_BRACKET)}},{name:ao,before:"Escape",parse(a,o,s){return o!==ft.BACKSLASH||![ft.OPEN_PAREN,ft.CLOSE_PAREN].includes(a.char(s+1))?-1:a.addDelimiter(oo[ao],s,s+2,a.char(s+1)===ft.OPEN_PAREN,a.char(s+1)===ft.CLOSE_PAREN)}},{name:io,before:"Escape",parse(a,o,s){return o!==ft.BACKSLASH||![ft.OPEN_BRACKET,ft.CLOSE_BRACKET].includes(a.char(s+1))?-1:a.addDelimiter(oo[io],s,s+2,a.char(s+1)===ft.OPEN_BRACKET,a.char(s+1)===ft.CLOSE_BRACKET)}}],wrap:H2(a=>{let o=ii[a.type.name];if(o){let s=a.from+o,c=a.to-o;return s>=c||s<0||c<0?null:{parser:e,overlay:[{from:s,to:c}]}}return null})}}od=aa.define(),ju=aa.define(),Ir=Zo.define({create:()=>({}),update:(e,n)=>{for(let a of n.effects){if(a.is(od))return a.value;if(a.is(ju))return{...e,...a.value}}return e}}),Vw=!0,Pu=class{constructor(){ve(this,"parser",new zu);ve(this,"type","markdown");ve(this,"defaultCode",this.parser.defaultCode);ve(this,"defaultMetadata",this.parser.defaultMetadata)}static fromMarkdown(e){return zu.fromMarkdown(e)}transformIn(e){let n=this.parser.transformIn(e);return[n.code,n.offset,n.metadata]}transformOut(e,n){let a=this.parser.transformOut(e,n);return[a.code,a.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,a,o){let s=ew().language.data,c,h=()=>{var g;if(!c)return!0;let p=c==null?void 0:c.state.field(Ir);return p===void 0?!1:((g=p.quotePrefix)==null?void 0:g.includes("f"))??!1};return[ts.define(p=>(c=p,{})),ew({base:vT,codeLanguages:Ok,extensions:[kC(V2.define(xT).parser),_C(Th.parser,h)]}),vC(a),dC.map(p=>s.of({autocomplete:p})),tw().language.data.of({autocomplete:aC({completion:i1,predicate:h})}),Lu({defaultKeymap:!1,activateOnTyping:!0}),rC({predicate:()=>!h()})]}};function c1(){return`file://${Rl()??"/__marimo_notebook__.py"}`}function $l(){return`file://${Lh.dirname(Rl()??"/")}`}function SC(e){return Ar.filter(e,n=>n!==!1&&n!==null)}function u1(e){let n=e.map(SC);return Object.assign({},...n)}var CC=class{constructor(e){ve(this,"clients",[]);this.clients=e,this.documentUri=c1()}onNotification(e){let n=[];for(let a of this.clients)n.push(a.onNotification(e));return()=>{for(let a of n)a();return!0}}get clientCapabilities(){return u1(this.clients.map(e=>{if(e.clientCapabilities)return typeof e.clientCapabilities=="function"?e.clientCapabilities({}):e.clientCapabilities}).filter(e=>e!=null))}get ready(){return this.clients.some(e=>e.ready)}set ready(e){this.clients.forEach(n=>{n.ready=e})}get capabilities(){return u1(this.clients.map(e=>e.capabilities).filter(e=>e!==null))}set capabilities(e){this.clients.forEach(n=>{n.capabilities=e})}get initializePromise(){return this.clients[0].initializePromise}set initializePromise(e){this.clients.forEach(n=>{n.initializePromise=e})}firstWithCapability(e){return this.clients.find(n=>{var a;return(a=n.capabilities)==null?void 0:a[e]})}clientsWithCapability(e){return this.clients.filter(n=>{var a;return(a=n.capabilities)==null?void 0:a[e]})}async initialize(){await Promise.all(this.clients.map(e=>e.initialize()))}async close(){await Promise.all(this.clients.map(e=>e.close()))}async textDocumentDidChange(e){return await Promise.all(this.clients.map(n=>n.textDocumentDidChange(e))),e}async completionItemResolve(e){let n=this.firstWithCapability("completionProvider");return n?n.completionItemResolve(e):e}async textDocumentCodeAction(e){let n=this.firstWithCapability("codeActionProvider");return n?n.textDocumentCodeAction(e):null}async textDocumentRename(e){let n=this.firstWithCapability("renameProvider");return n?n.textDocumentRename(e):null}async textDocumentPrepareRename(e){let n=this.firstWithCapability("renameProvider");return n?n.textDocumentPrepareRename(e):null}async textDocumentSignatureHelp(e){let n=this.firstWithCapability("signatureHelpProvider");return n?n.textDocumentSignatureHelp(e):null}async textDocumentCompletion(e){let n=this.clientsWithCapability("completionProvider");return EC(await Promise.allSettled(n.map(a=>a.textDocumentCompletion(e))))}async textDocumentDefinition(e){let n=this.firstWithCapability("definitionProvider");return n?n.textDocumentDefinition(e):null}async textDocumentDidOpen(e){return await Promise.all(this.clients.map(n=>n.textDocumentDidOpen(e))),e}async textDocumentHover(e){var n;for(let a of this.clients){if(!((n=a.capabilities)!=null&&n.hoverProvider))continue;let o=await a.textDocumentHover(e);if(o)return o}return{contents:[]}}};function EC(e){let n=[],a=!1;for(let o of e)if(o.status==="fulfilled"){let s=o.value;if(s==null)continue;Array.isArray(s)&&n.push(...s),"items"in s&&(n.push(...s.items),a||(a=s.isIncomplete))}return{items:n,isIncomplete:a}}zw=function(e){return[...TC(e),e].join(`
99
- `)};function TC(e){return jm().map(n=>{let a=nr(n);return a===e?null:a}).filter(Boolean).sort((n,a)=>n.startsWith("import")&&!a.startsWith("import")?-1:!n.startsWith("import")&&a.startsWith("import")?1:0)}var LC=Ce(e=>{let n=e(Ye);return Ar.fromEntries(n.cellIds.inOrderIds.map(a=>{let o=n.cellHandles[a];return[a,o!=null&&o.current?nr(o.current.editorView):""]}))}),OC=Ce(e=>e(Ye).cellIds.inOrderIds),AC=Ce(e=>RC(e(OC),e(Ga)));const IC=Ce(e=>({cellIds:e(AC),codes:e(LC)}));function RC(e,n){var g,b;let a=new Map;e.forEach(_=>a.set(_,[]));let o=new Set(e),s=new Set(e);for(let{declaredBy:_,usedBy:S}of Object.values(n))for(let C of _){o.delete(C);for(let E of S)s.delete(E),E!==C&&((g=a.get(C))==null||g.push(E))}let c=new Map;e.forEach(_=>c.set(_,0)),a.forEach(_=>{_.forEach(S=>{c.set(S,(c.get(S)||0)+1)})});let h=[];c.forEach((_,S)=>{_===0&&h.push(S)});let p=[];for(;h.length>0;){let _=h.shift();if(!_)break;p.push(_),(b=a.get(_))==null||b.forEach(S=>{c.set(S,(c.get(S)||0)-1),c.get(S)===0&&h.push(S)})}return[...p.filter(_=>!o.has(_)),...o]}function MC(e,n){let a=new Map,o=0;e.forEach(h=>{a.set(h,o),o+=n[h].split(`
98
+ `))});let p=s?-o.length:o.length,g=c?-a.length:a.length;return{changes:h,range:$t.range(n.from+p,n.to+g)}}function hC(e){if(!no(e))return!1;let n=Hd({view:e,selection:e.state.selection.main,markup:"> "});return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function mC(e){if(!no(e))return!1;let n=e.state.changeByRange(a=>{if(a.empty){let o=e.state.wordAt(a.head);o&&(a=o)}return $d({view:e,range:a,markupBefore:"**",markupAfter:"**"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:es.userEvent.of("input")})),e.focus(),!0}function o1(e){if(!no(e))return!1;let n=e.state.changeByRange(a=>{if(a.empty){let s=e.state.wordAt(a.head);s&&(a=s)}let o=e.state.doc.lineAt(a.from).number!==e.state.doc.lineAt(a.to).number;return $d({view:e,range:a,markupBefore:o?"```\n":"`",markupAfter:o?"\n```":"`"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:es.userEvent.of("input")})),e.focus(),!0}function gC(e){let n=e.state.changeByRange(a=>{if(a.empty){let o=e.state.wordAt(a.head);o&&(a=o)}return $d({view:e,range:a,markupBefore:"_",markupAfter:"_"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:es.userEvent.of("input")})),e.focus(),!0}function s1(e,n="http://"){if(!no(e))return!1;let a=e.state.changeByRange(s=>{let c=e.state.sliceDoc(s.from,s.to);return{changes:[{from:s.from,to:s.to,insert:`[${c}](${n})`}],range:s}});e.dispatch(e.state.update(a,{scrollIntoView:!0,annotations:es.userEvent.of("input")}));let{to:o}=a.selection.main;try{e.dispatch({selection:$t.create([$t.range(o+3,o+3+n.length),$t.cursor(o+3+n.length)])})}catch{}return e.focus(),!0}lm=async function(e,n){var p;let a=new FileReader,o=await new Promise(g=>{a.onload=()=>g(a.result),a.readAsDataURL(n)}),s;try{if(o.startsWith("data:")){let g=o.split(",")[1],b=prompt("We can save your image as a file. Enter a filename.",n.name),_=n.type.split("/")[1];if(b===null){let S=Math.round(o.length/1024);if(S>pC){vl({title:"Content too large",description:`The content size is ${S} KB, which is too large to paste directly into the document.`});return}}else{b.trim()===""?b=n.name:b.endsWith(`.${_}`)||(b=`${b}.${_}`);let S=Fe.get(is),C=S?Lh.dirname(S):null,E=C?`${C}/public`:"public",O=await oa().sendCreateFileOrFolder({path:E,type:"file",name:b,contents:g});O.success?(s=(p=O.info)==null?void 0:p.path,s&&C&&s.startsWith(C)&&(s=Lh.rest(s,C)),vl({title:"Image uploaded successfully",description:`We've uploaded your image at ${s}`})):vl({title:"Failed to upload image. Using raw base64 string."})}}}catch{vl({title:"Failed to upload image. Using raw base64 string."})}let c=e.state.changeByRange(g=>{let b=e.state.sliceDoc(g.from,g.to);return b.trim()===""&&(b="alt"),{changes:[{from:g.from,to:g.to,insert:`![${b}](${s??o})`}],range:g}});e.dispatch(e.state.update(c,{scrollIntoView:!0,annotations:es.userEvent.of("input")}));let{to:h}=c.selection.main;try{e.dispatch({selection:$t.create([$t.range(h+4,h+4+o.length),$t.cursor(h+4+o.length)])})}catch{}return e.focus(),!0},hm=async function(e,n){let a=await n.text(),o=e.state.changeByRange(s=>({changes:[{from:s.from,to:s.from,insert:a}],range:s}));return e.dispatch(e.state.update(o,{scrollIntoView:!0,annotations:es.userEvent.of("input")})),e.focus(),!0};function yC(e){if(!no(e))return!1;let{changes:n}=e.state.changeByRange(a=>({range:a,changes:Hd({view:e,selection:a,markup:e.state.sliceDoc(a.from,a.to+2).startsWith("* ")?"* ":"- "})}));return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function vC(e){if(!no(e))return!1;let{changes:n}=e.state.changeByRange(a=>({range:a,changes:Hd({view:e,selection:a,markup:"1. "})}));return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function bC(e){return[Eu.highest(Ka.of([{key:e.getHotkey("markdown.bold").key,stopPropagation:!0,run:mC},{key:e.getHotkey("markdown.italic").key,stopPropagation:!0,run:gC},{key:e.getHotkey("markdown.link").key,stopPropagation:!0,run:n=>s1(n)},{key:e.getHotkey("markdown.orderedList").key,run:vC},{key:e.getHotkey("markdown.unorderedList").key,run:yC},{key:e.getHotkey("markdown.blockquote").key,run:hC},{key:e.getHotkey("markdown.code").key,run:o1},{key:"`",run:o1}])),Et.domEventHandlers({paste:(n,a)=>{var s;if(a.state.selection.main.empty)return!1;let o=(s=n.clipboardData)==null?void 0:s.getData("text/plain");o!=null&&o.startsWith("http")&&(n.preventDefault(),s1(a,o))}}),Et.domEventHandlers({paste:(n,a)=>{var s;let o=(s=n.clipboardData)==null?void 0:s.files[0];if(!o)return!1;if(o.type.startsWith("image/"))return n.preventDefault(),lm(a,o),!0;if(o.type.startsWith("text/"))return n.preventDefault(),hm(a,o),!0}})]}function wC(e,n,a=3,o=""){return Object.values(e).flatMap(s=>n.has(s.name)?[]:{label:`${o}${s.name}`,displayLabel:s.name,detail:s.dataType??"",boost:a,type:"variable",apply:`${o}${s.name}`,section:"Variable",info:()=>dm(s)})}dm=function(e){let n=document.createElement("div");n.classList.add("mo-cm-tooltip","docs-documentation","min-w-[200px]","flex","flex-col","gap-1","p-2");let a=document.createElement("div");a.classList.add("flex","items-center","gap-2");let o=document.createElement("span");if(o.classList.add("font-bold","text-base"),o.textContent=e.name,a.append(o),e.dataType){let s=document.createElement("span");s.classList.add("text-xs","px-1.5","py-0.5","rounded-full","bg-purple-100","text-purple-800","dark:bg-purple-900","dark:text-purple-200"),s.textContent=e.dataType,a.append(s)}if(n.append(a),e.value){let s=document.createElement("div");s.classList.add("flex","flex-col","gap-1");let c=document.createElement("div");c.classList.add("text-xs","text-muted-foreground"),c.textContent="Value:",s.append(c);let h=document.createElement("div");h.classList.add("text-xs","font-mono","bg-muted","p-2","rounded","overflow-auto","max-h-40"),h.textContent=e.value,s.append(h),n.append(s)}return n};var ro="Python",Wd=123,l1=125,Ud=1,_C={mark:`${ro}Mark`,resolve:ro};function xC(e,n){return{defineNodes:[{name:ro,style:Cu.emphasis},{name:`${ro}Mark`,style:Cu.processingInstruction}],parseInline:[{name:ro,parse(a,o,s){return!n()||o!==Wd&&o!==l1||o===Wd&&a.slice(s-1,s)==="{"?-1:a.addDelimiter(_C,s,s+Ud,o===Wd,o===l1)}}],wrap:H2(a=>{if(!n()||a.type.name!==ro)return null;let o=a.from+Ud,s=a.to-Ud;return o>=s||o<0||s<0?null:{parser:e,overlay:[{from:o,to:s}],extensions:[tw().support]}})}}const kC=e=>{let n=e.state.doc.sliceString(0,e.pos),a=n.lastIndexOf("{");if(n.at(a-1)==="{"||a===-1||n.indexOf("}",a)>a)return null;let o=e.matchBefore(/\w*$/);if(!o)return null;let s=wC(Fe.get(Ga),new Set,99);return{from:o.from,options:s,validFor:/^\w*$/}};var Vl="InlineMathDollar",ao="InlineMathBracket",Hl="BlockMathDollar",io="BlockMathBracket",ii={[Vl]:1,[ao]:3,[Hl]:2,[io]:3},ft={DOLLAR:36,BACKSLASH:92,OPEN_PAREN:40,CLOSE_PAREN:41,OPEN_BRACKET:91,CLOSE_BRACKET:93},oo=Object.keys(ii).reduce((e,n)=>(e[n]={mark:`${n}Mark`,resolve:n},e),{});function SC(e){let n=[];return Object.keys(ii).forEach(a=>{n.push({name:a,style:Cu.emphasis},{name:`${a}Mark`,style:Cu.processingInstruction})}),{defineNodes:n,parseInline:[{name:Hl,parse(a,o,s){return o!==ft.DOLLAR||a.char(s+1)!==ft.DOLLAR?-1:a.addDelimiter(oo[Hl],s,s+ii[Hl],!0,!0)}},{name:Vl,parse(a,o,s){return o!==ft.DOLLAR||a.char(s+1)===ft.DOLLAR?-1:a.addDelimiter(oo[Vl],s,s+ii[Vl],!0,!0)}},{name:ao,before:"Escape",parse(a,o,s){return o!==ft.BACKSLASH||a.char(s+1)!==ft.BACKSLASH||![ft.OPEN_PAREN,ft.CLOSE_PAREN].includes(a.char(s+2))?-1:a.addDelimiter(oo[ao],s,s+ii[ao],a.char(s+2)===ft.OPEN_PAREN,a.char(s+2)===ft.CLOSE_PAREN)}},{name:io,before:"Escape",parse(a,o,s){return o!==ft.BACKSLASH||a.char(s+1)!==ft.BACKSLASH||![ft.OPEN_BRACKET,ft.CLOSE_BRACKET].includes(a.char(s+2))?-1:a.addDelimiter(oo[io],s,s+ii[io],a.char(s+2)===ft.OPEN_BRACKET,a.char(s+2)===ft.CLOSE_BRACKET)}},{name:ao,before:"Escape",parse(a,o,s){return o!==ft.BACKSLASH||![ft.OPEN_PAREN,ft.CLOSE_PAREN].includes(a.char(s+1))?-1:a.addDelimiter(oo[ao],s,s+2,a.char(s+1)===ft.OPEN_PAREN,a.char(s+1)===ft.CLOSE_PAREN)}},{name:io,before:"Escape",parse(a,o,s){return o!==ft.BACKSLASH||![ft.OPEN_BRACKET,ft.CLOSE_BRACKET].includes(a.char(s+1))?-1:a.addDelimiter(oo[io],s,s+2,a.char(s+1)===ft.OPEN_BRACKET,a.char(s+1)===ft.CLOSE_BRACKET)}}],wrap:H2(a=>{let o=ii[a.type.name];if(o){let s=a.from+o,c=a.to-o;return s>=c||s<0||c<0?null:{parser:e,overlay:[{from:s,to:c}]}}return null})}}id=aa.define(),ju=aa.define(),Ir=Zo.define({create:()=>({}),update:(e,n)=>{for(let a of n.effects){if(a.is(id))return a.value;if(a.is(ju))return{...e,...a.value}}return e}}),Hw=!0,Pu=class{constructor(){ve(this,"parser",new zu);ve(this,"type","markdown");ve(this,"defaultCode",this.parser.defaultCode);ve(this,"defaultMetadata",this.parser.defaultMetadata)}static fromMarkdown(e){return zu.fromMarkdown(e)}transformIn(e){let n=this.parser.transformIn(e);return[n.code,n.offset,n.metadata]}transformOut(e,n){let a=this.parser.transformOut(e,n);return[a.code,a.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,a,o){let s=ew().language.data,c,h=()=>{var g;if(!c)return!0;let p=c==null?void 0:c.state.field(Ir);return p===void 0?!1:((g=p.quotePrefix)==null?void 0:g.includes("f"))??!1};return[ts.define(p=>(c=p,{})),ew({base:bT,codeLanguages:Ak,extensions:[SC(V2.define(kT).parser),xC(Th.parser,h)]}),bC(a),fC.map(p=>s.of({autocomplete:p})),tw().language.data.of({autocomplete:iC({completion:i1,predicate:h})}),Lu({defaultKeymap:!1,activateOnTyping:!0}),aC({predicate:()=>!h()})]}};function c1(){return`file://${Ol()??"/__marimo_notebook__.py"}`}function $l(){return`file://${Lh.dirname(Ol()??"/")}`}function CC(e){return Ar.filter(e,n=>n!==!1&&n!==null)}function u1(e){let n=e.map(CC);return Object.assign({},...n)}var EC=class{constructor(e){ve(this,"clients",[]);this.clients=e,this.documentUri=c1()}onNotification(e){let n=[];for(let a of this.clients)n.push(a.onNotification(e));return()=>{for(let a of n)a();return!0}}get clientCapabilities(){return u1(this.clients.map(e=>{if(e.clientCapabilities)return typeof e.clientCapabilities=="function"?e.clientCapabilities({}):e.clientCapabilities}).filter(e=>e!=null))}get ready(){return this.clients.some(e=>e.ready)}set ready(e){this.clients.forEach(n=>{n.ready=e})}get capabilities(){return u1(this.clients.map(e=>e.capabilities).filter(e=>e!==null))}set capabilities(e){this.clients.forEach(n=>{n.capabilities=e})}get initializePromise(){return this.clients[0].initializePromise}set initializePromise(e){this.clients.forEach(n=>{n.initializePromise=e})}firstWithCapability(e){return this.clients.find(n=>{var a;return(a=n.capabilities)==null?void 0:a[e]})}clientsWithCapability(e){return this.clients.filter(n=>{var a;return(a=n.capabilities)==null?void 0:a[e]})}async initialize(){await Promise.all(this.clients.map(e=>e.initialize()))}async close(){await Promise.all(this.clients.map(e=>e.close()))}async textDocumentDidChange(e){return await Promise.all(this.clients.map(n=>n.textDocumentDidChange(e))),e}async completionItemResolve(e){let n=this.firstWithCapability("completionProvider");return n?n.completionItemResolve(e):e}async textDocumentCodeAction(e){let n=this.firstWithCapability("codeActionProvider");return n?n.textDocumentCodeAction(e):null}async textDocumentRename(e){let n=this.firstWithCapability("renameProvider");return n?n.textDocumentRename(e):null}async textDocumentPrepareRename(e){let n=this.firstWithCapability("renameProvider");return n?n.textDocumentPrepareRename(e):null}async textDocumentSignatureHelp(e){let n=this.firstWithCapability("signatureHelpProvider");return n?n.textDocumentSignatureHelp(e):null}async textDocumentCompletion(e){let n=this.clientsWithCapability("completionProvider");return TC(await Promise.allSettled(n.map(a=>a.textDocumentCompletion(e))))}async textDocumentDefinition(e){let n=this.firstWithCapability("definitionProvider");return n?n.textDocumentDefinition(e):null}async textDocumentDidOpen(e){return await Promise.all(this.clients.map(n=>n.textDocumentDidOpen(e))),e}async textDocumentHover(e){var n;for(let a of this.clients){if(!((n=a.capabilities)!=null&&n.hoverProvider))continue;let o=await a.textDocumentHover(e);if(o)return o}return{contents:[]}}};function TC(e){let n=[],a=!1;for(let o of e)if(o.status==="fulfilled"){let s=o.value;if(s==null)continue;Array.isArray(s)&&n.push(...s),"items"in s&&(n.push(...s.items),a||(a=s.isIncomplete))}return{items:n,isIncomplete:a}}qw=function(e){return[...LC(e),e].join(`
99
+ `)};function LC(e){return jm().map(n=>{let a=nr(n);return a===e?null:a}).filter(Boolean).sort((n,a)=>n.startsWith("import")&&!a.startsWith("import")?-1:!n.startsWith("import")&&a.startsWith("import")?1:0)}var OC=Ce(e=>{let n=e(Ye);return Ar.fromEntries(n.cellIds.inOrderIds.map(a=>{let o=n.cellHandles[a];return[a,o!=null&&o.current?nr(o.current.editorView):""]}))}),AC=Ce(e=>e(Ye).cellIds.inOrderIds),IC=Ce(e=>MC(e(AC),e(Ga)));const RC=Ce(e=>({cellIds:e(IC),codes:e(OC)}));function MC(e,n){var g,b;let a=new Map;e.forEach(_=>a.set(_,[]));let o=new Set(e),s=new Set(e);for(let{declaredBy:_,usedBy:S}of Object.values(n))for(let C of _){o.delete(C);for(let E of S)s.delete(E),E!==C&&((g=a.get(C))==null||g.push(E))}let c=new Map;e.forEach(_=>c.set(_,0)),a.forEach(_=>{_.forEach(S=>{c.set(S,(c.get(S)||0)+1)})});let h=[];c.forEach((_,S)=>{_===0&&h.push(S)});let p=[];for(;h.length>0;){let _=h.shift();if(!_)break;p.push(_),(b=a.get(_))==null||b.forEach(S=>{c.set(S,(c.get(S)||0)-1),c.get(S)===0&&h.push(S)})}return[...p.filter(_=>!o.has(_)),...o]}function PC(e,n){let a=new Map,o=0;e.forEach(h=>{a.set(h,o),o+=n[h].split(`
100
100
  `).length});function s(h){return a.has(h)||be.warn("[lsp] no cell line offsets for",h),a.get(h)??0}let c=e.map(h=>n[h]).join(`
101
101
  `);return{cellIds:e,mergedText:c,transformRange:(h,p)=>d1(h,s(p)),reverseRange:(h,p)=>d1(h,-s(p)),isInRange:(h,p)=>{let g=n[p].split(`
102
102
  `).length,b=a.get(p)||0,_=h.start.line-b,S=h.end.line-b,C=_>=0&&_<g,E=S>=0&&S<g;return C&&!E&&be.warn("[lsp] Cross-cell diagnostic detected: range starts in cell but ends outside",{cellId:p,range:h,cellLines:g,offset:b}),C&&E},getEditsForNewText:h=>{let p=h.split(`
103
103
  `),g=c.split(`
104
104
  `);if(p.length!==g.length)throw be.warn("[lsp] cannot apply rename with new lines",p,g),Error("Cannot apply rename when there are new lines");let b=[];for(let[_,S]of Ar.entries(n)){if(!a.has(_))continue;let C=a.get(_)??0,E=S.split(`
105
105
  `).length,O=p.slice(C,C+E);b.push({cellId:_,text:O.join(`
106
- `)})}return b},transformPosition:(h,p)=>Wl(h,s(p)),reversePosition:(h,p)=>Wl(h,-s(p))}}function d1(e,n){return{start:Wl(e.start,n),end:Wl(e.end,n)}}function Wl(e,n){return{line:e.line+n,character:e.character}}var PC=new RegExp("(?<!`):math:`([^\\n`]+)`","g"),NC=/:math:\s*<code>(.+?)<\/code>/gs,DC=/\\\[(.+?)\\]/gs,jC=/\\\((.+?)\\\)/gs,zC=new RegExp("(?<!\\\\)\\$\\$(.+?)(?<!\\\\)\\$\\$","gs"),qC=new RegExp("(?<![$\\\\])\\$(?!\\$)([^\\n$]+?)(?<!\\\\)\\$(?!\\$)","g");function ps(e){return h1(e)?FC(e).map(n=>n.isFenced?n.text:VC(n.text.replaceAll(PC,(a,o)=>Ul(o)).replaceAll(NC,(a,o)=>Ul(o))).map(a=>a.isInlineCode?a.text:HC(a.text)).join("")).join(""):e}function f1(e){return e==null?e:Array.isArray(e)?e.map(n=>p1(n)):typeof e=="string"?ps(e):BC(e)?e.kind==="markdown"?{...e,value:ps(e.value)}:h1(e.value)?{kind:"markdown",value:ps(e.value)}:e:p1(e)}function p1(e){return typeof e=="string"?ps(e):e.language!=="markdown"&&e.language!=="md"?e:{...e,value:ps(e.value)}}function BC(e){return typeof e=="object"&&"kind"in e&&"value"in e}function h1(e){return e.includes(".. math::")||e.includes(":math:`")||/\\\[[\S\s]+?\\]/.test(e)||/\\\([\S\s]+?\\\)/.test(e)||new RegExp("(?<!\\\\)\\$\\$[\\S\\s]+?(?<!\\\\)\\$\\$").test(e)||new RegExp("(?<![$\\\\])\\$(?!\\$)[^\\n$]+?(?<!\\\\)\\$(?!\\$)").test(e)||/:math:\s*<code>[\S\s]+?<\/code>/.test(e)}function FC(e){let n=e.split(`
106
+ `)})}return b},transformPosition:(h,p)=>Wl(h,s(p)),reversePosition:(h,p)=>Wl(h,-s(p))}}function d1(e,n){return{start:Wl(e.start,n),end:Wl(e.end,n)}}function Wl(e,n){return{line:e.line+n,character:e.character}}var NC=new RegExp("(?<!`):math:`([^\\n`]+)`","g"),DC=/:math:\s*<code>(.+?)<\/code>/gs,jC=/\\\[(.+?)\\]/gs,zC=/\\\((.+?)\\\)/gs,qC=new RegExp("(?<!\\\\)\\$\\$(.+?)(?<!\\\\)\\$\\$","gs"),BC=new RegExp("(?<![$\\\\])\\$(?!\\$)([^\\n$]+?)(?<!\\\\)\\$(?!\\$)","g");function ps(e){return h1(e)?VC(e).map(n=>n.isFenced?n.text:HC(n.text.replaceAll(NC,(a,o)=>Ul(o)).replaceAll(DC,(a,o)=>Ul(o))).map(a=>a.isInlineCode?a.text:$C(a.text)).join("")).join(""):e}function f1(e){return e==null?e:Array.isArray(e)?e.map(n=>p1(n)):typeof e=="string"?ps(e):FC(e)?e.kind==="markdown"?{...e,value:ps(e.value)}:h1(e.value)?{kind:"markdown",value:ps(e.value)}:e:p1(e)}function p1(e){return typeof e=="string"?ps(e):e.language!=="markdown"&&e.language!=="md"?e:{...e,value:ps(e.value)}}function FC(e){return typeof e=="object"&&"kind"in e&&"value"in e}function h1(e){return e.includes(".. math::")||e.includes(":math:`")||/\\\[[\S\s]+?\\]/.test(e)||/\\\([\S\s]+?\\\)/.test(e)||new RegExp("(?<!\\\\)\\$\\$[\\S\\s]+?(?<!\\\\)\\$\\$").test(e)||new RegExp("(?<![$\\\\])\\$(?!\\$)[^\\n$]+?(?<!\\\\)\\$(?!\\$)").test(e)||/:math:\s*<code>[\S\s]+?<\/code>/.test(e)}function VC(e){let n=e.split(`
107
107
  `),a=[],o=[],s=!1,c="",h=0,p=g=>{o.length!==0&&(a.push({text:o.join(`
108
- `),isFenced:g}),o=[])};for(let g of n){let b=g.match(/^[\t ]*(`{3,}|~{3,})/);if(b){let _=b[1],S=_[0],C=_.length;if(!s){p(!1),s=!0,c=S,h=C,o.push(g);continue}if(S===c&&C>=h){o.push(g),p(!0),s=!1,c="",h=0;continue}}o.push(g)}return p(s),a}function VC(e){let n=[],a="",o=!1,s="",c=0;for(;c<e.length;){if(e[c]==="`"){let h=c;for(;h<e.length&&e[h]==="`";)h+=1;let p=e.slice(c,h);if(o&&p===s){a+=p,n.push({text:a,isInlineCode:!0}),a="",o=!1,s="",c=h;continue}if(!o){a&&(a=(n.push({text:a,isInlineCode:!1}),"")),o=!0,s=p,a+=p,c=h;continue}}a+=e[c],c+=1}return a&&n.push({text:a,isInlineCode:o}),n}function HC(e){let n=$C(e);return n=n.replaceAll(DC,(a,o)=>Kd(o)),n=n.replaceAll(jC,(a,o)=>Ul(o)),n=n.replaceAll(zC,(a,o)=>Kd(o)),n=n.replaceAll(qC,(a,o)=>Ul(o)),n}function so(e){var n;return((n=e.match(/^[\t ]*/))==null?void 0:n[0].replaceAll(" "," ").length)??0}function $C(e){var s;let n=e.split(`
108
+ `),isFenced:g}),o=[])};for(let g of n){let b=g.match(/^[\t ]*(`{3,}|~{3,})/);if(b){let _=b[1],S=_[0],C=_.length;if(!s){p(!1),s=!0,c=S,h=C,o.push(g);continue}if(S===c&&C>=h){o.push(g),p(!0),s=!1,c="",h=0;continue}}o.push(g)}return p(s),a}function HC(e){let n=[],a="",o=!1,s="",c=0;for(;c<e.length;){if(e[c]==="`"){let h=c;for(;h<e.length&&e[h]==="`";)h+=1;let p=e.slice(c,h);if(o&&p===s){a+=p,n.push({text:a,isInlineCode:!0}),a="",o=!1,s="",c=h;continue}if(!o){a&&(a=(n.push({text:a,isInlineCode:!1}),"")),o=!0,s=p,a+=p,c=h;continue}}a+=e[c],c+=1}return a&&n.push({text:a,isInlineCode:o}),n}function $C(e){let n=WC(e);return n=n.replaceAll(jC,(a,o)=>Kd(o)),n=n.replaceAll(zC,(a,o)=>Ul(o)),n=n.replaceAll(qC,(a,o)=>Kd(o)),n=n.replaceAll(BC,(a,o)=>Ul(o)),n}function so(e){var n;return((n=e.match(/^[\t ]*/))==null?void 0:n[0].replaceAll(" "," ").length)??0}function WC(e){var s;let n=e.split(`
109
109
  `);if(n.length===0)return e;let a=[],o=0;for(;o<n.length;){let c=n[o],h=c.match(/^[\t ]*\.\.\s+math::(.*)$/);if(!h){a.push(c),o+=1;continue}let p=((s=h[1])==null?void 0:s.trim())??"",g=so(c);o+=1;let b=[],_=p.includes("\\begin");if(p)b.push(p);else{for(;o<n.length;){let O=n[o];if(!O.trim()){o+=1;continue}if(!(so(O)>g&&O.trim().startsWith(":")))break;o+=1}if(o<n.length){let O=n[o];_=!!O.trim()&&so(O)<=g&&O.trimStart().startsWith("\\")}}if(_)for(;o<n.length&&n[o].trim();)b.push(n[o]),o+=1;else for(;o<n.length;){let O=n[o];if(!O.trim()){b.push(""),o+=1;continue}if(so(O)<=g)break;b.push(O),o+=1}let S=b.filter(O=>!!O.trim());if(S.length===0){a.push(c);continue}let C=Math.min(...S.map(O=>so(O))),E=b.map(O=>{if(!O)return"";let M=Math.min(C,so(O));return O.slice(M)}).join(`
110
110
  `).trim();a.push(Kd(E))}return a.join(`
111
- `)}function Ul(e){return`<marimo-tex class="arithmatex">||(${e.trim()}||)</marimo-tex>`}function Kd(e){return`<marimo-tex class="arithmatex">||[${e.trim()}||]</marimo-tex>`}const cn={PREFIX:"file:///",of(e){return`${this.PREFIX}${e}`},is(e){return e.startsWith(this.PREFIX)},parse(e){return rn(this.is(e),`Invalid cell document URI: ${e}`),e.slice(this.PREFIX.length)}};function m1(e){return"notify"in e}function WC(e){return e.startsWith("_")&&!e.startsWith("__")}var UC=class{constructor(e){ve(this,"documentVersion",0);ve(this,"lastSnapshot",null);this.getNotebookCode=e}snapshot(){var a;let e=this.getLens(),n=((a=this.lastSnapshot)==null?void 0:a.mergedText)!==e.mergedText;return n?(this.documentVersion++,this.lastSnapshot=e,{lens:e,didChange:n,version:this.documentVersion}):{lens:e,didChange:n,version:this.documentVersion}}getLatestSnapshot(){if(!this.lastSnapshot)throw Error("No snapshots");return{lens:this.lastSnapshot,version:this.documentVersion}}getLens(){let{cellIds:e,codes:n}=this.getNotebookCode();return MC(e,n)}},KC=()=>{let e=Wi().cellHandles;return Ar.mapValues(e,n=>{var a;return(a=n.current)==null?void 0:a.editorViewOrNull})};function Qd(e){let n=f1(e);return Array.isArray(n)?e:n}function Gd(e){return{...e,documentation:Qd(e.documentation)}}function QC(e){return e==null?null:Array.isArray(e)?e.map(n=>Gd(n)):{...e,items:e.items.map(n=>Gd(n))}}function GC(e){return{...e,signatures:e.signatures.map(n=>{var a;return{...n,documentation:Qd(n.documentation),parameters:(a=n.parameters)==null?void 0:a.map(o=>({...o,documentation:Qd(o.documentation)}))}})}}var Kl=(cr=class{constructor(n,a,o=KC){ve(this,"completionItemCache",new zl(10));this.documentUri=c1(),this.getNotebookEditors=o,this.initialSettings=a,this.client=n,this.patchProcessNotification(),this.initializePromise.then(()=>{rn(m1(this.client),"notify is not a method on the client"),this.client.notify("workspace/didChangeConfiguration",{settings:a})}),this.snapshotter=new UC(this.getNotebookCode.bind(this))}static pruneSeenCellUris(n){for(let a of cr.SEEN_CELL_DOCUMENT_URIS){let o=cn.parse(a);n.has(o)||cr.SEEN_CELL_DOCUMENT_URIS.delete(a)}}onNotification(n){return this.client.onNotification(n)}get ready(){return this.client.ready}set ready(n){this.client.ready=n}get capabilities(){return this.client.capabilities}set capabilities(n){this.client.capabilities=n}get initializePromise(){return this.client.initializePromise}set initializePromise(n){this.client.initializePromise=n}get clientCapabilities(){return this.client.clientCapabilities}async initialize(){await this.client.initialize()}close(){this.client.close()}async resyncAllDocuments(){rn(m1(this.client),"notify is not a method on the client"),await this.client.initialize(),this.client.notify("workspace/didChangeConfiguration",{settings:this.initialSettings});let{lens:n,version:a}=this.snapshotter.snapshot();await this.client.textDocumentDidOpen({textDocument:{languageId:"python",text:n.mergedText,uri:this.documentUri,version:a}}),be.log("[lsp] Document re-synchronization complete")}getNotebookCode(){return Fe.get(IC)}assertCellDocumentUri(n){rn(cn.is(n),"Execpted URI to be CellDocumentUri")}async textDocumentDidOpen(n){be.debug("[lsp] textDocumentDidOpen",n);let a=n.textDocument.uri;this.assertCellDocumentUri(a);let{lens:o,version:s}=this.snapshotter.snapshot();cr.SEEN_CELL_DOCUMENT_URIS.add(a);let c=await this.client.textDocumentDidOpen({textDocument:{languageId:n.textDocument.languageId,text:o.mergedText,uri:this.documentUri,version:s}});return c?{...c,textDocument:{...c.textDocument,text:o.mergedText}}:n}async sync(){let{lens:n,version:a,didChange:o}=this.snapshotter.snapshot(),s={textDocument:{uri:this.documentUri,version:a},contentChanges:[{text:n.mergedText}]};return o&&await this.client.textDocumentDidChange(s),{params:s,lens:n}}async textDocumentDidChange(n){if(be.debug("[lsp] textDocumentDidChange",n),n.contentChanges.length===1){let{params:a}=await this.sync();return a}return be.warn("[lsp] Unhandled textDocumentDidChange",n),this.client.textDocumentDidChange(n)}async textDocumentDefinition(n){let a=n.textDocument.uri;if(!cn.is(a))return be.warn("Invalid cell document URI",a),null;let{lens:o}=await this.sync(),s=cn.parse(a);return this.client.textDocumentDefinition({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentSignatureHelp(n){let a=n.textDocument.uri;if(!cn.is(a))return be.warn("Invalid cell document URI",a),null;let{lens:o}=await this.sync(),s=cn.parse(a),c=await this.client.textDocumentSignatureHelp({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)});return c?GC(c):null}textDocumentCodeAction(n){return Promise.resolve(null)}async textDocumentRename(n){var V;let a=n.textDocument.uri;if(!cn.is(a))return be.warn("Invalid cell document URI",a),null;let o=cn.parse(a),{lens:s}=await this.sync(),c=s.transformPosition(n.position,o),h=await this.client.textDocumentRename({...n,textDocument:{uri:this.documentUri},position:c});if(!h)return null;let p=(V=h.documentChanges)==null?void 0:V.flatMap(H=>"edits"in H?H.edits:[]);if(!p||p.length!==1)return be.warn("Expected exactly one edit",p),h;let g=p[0];if(!("newText"in g))return be.warn("Expected newText in edit",g),h;let b=s.getEditsForNewText(g.newText),_=new Map(b.map(H=>[H.cellId,H.text])),S=this.getNotebookEditors(),C=S[o],E=!1;if(C){let H=C.state.doc.line(n.position.line+1).from+n.position.character,{startToken:$,endToken:N}=Bd(C.state.doc,H),ne=C.state.doc.sliceString($,N);E=WC(ne),E&&be.debug("[lsp] Private variable rename detected, limiting to current cell",ne)}let O=[],M=0;for(let[H,$]of Ar.entries(S)){if(E&&H!==o)continue;let N=_.get(H);if(N==null){be.warn("[lsp] No new code for cell during rename",H),O.push(H);continue}if(!$){be.warn("[lsp] No editor view for cell during rename",H),O.push(H);continue}nr($)!==N&&(Ki($,N),M++)}return O.length>0&&be.error(`[lsp] Rename partially failed: could not update ${O.length} cell(s)`,O),be.debug(`[lsp] Rename completed: updated ${M} cell(s)`),{...h,documentChanges:[{edits:[],textDocument:{uri:a,version:0}}]}}async completionItemResolve(n){let a=JSON.stringify(n),o=this.completionItemCache.get(a);if(o)return o;let s=this.client.completionItemResolve(n).then(c=>Gd(c));return this.completionItemCache.set(a,s),s}async textDocumentPrepareRename(n){let a=n.textDocument.uri;if(!cn.is(a))return be.warn("Invalid cell document URI",a),null;let{lens:o}=await this.sync(),s=cn.parse(a);return this.client.textDocumentPrepareRename({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentHover(n){be.debug("[lsp] textDocumentHover",n);let{lens:a}=await this.sync(),o=cn.parse(n.textDocument.uri),s=await this.client.textDocumentHover({...n,textDocument:{uri:this.documentUri},position:a.transformPosition(n.position,o)});return s?(typeof s.contents=="object"&&"kind"in s.contents&&(s.contents={kind:"markdown",value:s.contents.value}),s.contents=f1(s.contents)??s.contents,s.contents===""?null:(s.range&&(s.range=a.reverseRange(s.range,o)),s)):(be.debug("[lsp] no hover result"),s)}async textDocumentCompletion(n){let{lens:a}=this.snapshotter.getLatestSnapshot();if(!cn.is(n.textDocument.uri))return be.error("[lsp] Invalid cell document URI in completion request",n.textDocument.uri),null;let o=cn.parse(n.textDocument.uri);if(!o||o==="undefined")return be.error("[lsp] Invalid cellId 'undefined' in completion request",{cellId:o,uri:n.textDocument.uri,availableCellIds:a.cellIds}),null;a.cellIds.includes(o)||be.warn("[lsp] CellId in completion request not found in current lens",{cellId:o,uri:n.textDocument.uri,availableCellIds:a.cellIds});let s=a.transformPosition(n.position,o);return QC(await this.client.textDocumentCompletion({...n,textDocument:{uri:this.documentUri},position:s}))}patchProcessNotification(){rn("processNotification"in this.client,"processNotification is not a method on the client");let n=this.client.processNotification.bind(this.client),a=o=>{if(o.method==="textDocument/publishDiagnostics"){be.debug("[lsp] handling diagnostics",o);let s=this.snapshotter.getLatestSnapshot(),c=o.params.diagnostics,{lens:h,version:p}=s,g=new Map;for(let S of c)for(let C of h.cellIds)if(h.isInRange(S.range,C)){g.has(C)||g.set(C,[]);let E={...S,range:h.reverseRange(S.range,C)};g.get(C).push(E);break}let b=new Set(h.cellIds);cr.pruneSeenCellUris(b);let _=new Set(cr.SEEN_CELL_DOCUMENT_URIS);for(let[S,C]of g.entries()){be.debug("[lsp] diagnostics for cell",S,C);let E=cn.of(S);_.delete(E),n({...o,params:{...o.params,uri:E,version:p,diagnostics:C}})}if(_.size>0){be.debug("[lsp] clearing diagnostics",_);for(let S of _)n({method:"textDocument/publishDiagnostics",params:{uri:S,diagnostics:[]}})}return}return n(o)};this.client.processNotification=a}},ve(cr,"SEEN_CELL_DOCUMENT_URIS",new Set),cr),JC=Sl(),XC=Ya(),YC=class extends XC.Transport{constructor(n){super();ve(this,"isClosed",!1);ve(this,"hasConnectedBefore",!1);ve(this,"pendingSubscriptions",[]);this.options=n,this.delegate=void 0}createDelegate(){if(this.delegate)try{this.delegate.close()}catch(n){be.warn("Error closing old WebSocket delegate",n)}this.delegate=new JC.WebSocketTransport(this.options.getWsUrl());for(let{event:n,handler:a}of this.pendingSubscriptions)this.delegate.subscribe(n,a);return this.delegate}isDelegateClosedOrClosing(){if(!this.delegate)return!0;let n=this.delegate.connection;return n?n.readyState===WebSocket.CLOSING||n.readyState===WebSocket.CLOSED:!0}async connect(){if(this.isClosed)throw Error("Transport is closed");return this.connectionPromise||(this.connectionPromise=(async()=>{try{this.options.waitForConnection&&await this.options.waitForConnection();let n=this.delegate;(!n||this.isDelegateClosedOrClosing())&&(n=this.createDelegate()),await n.connect(),be.log("WebSocket transport connected successfully");let a=this.hasConnectedBefore;this.hasConnectedBefore=!0,a&&this.options.onReconnect&&(be.log("Calling onReconnect callback to re-synchronize state"),await this.options.onReconnect())}catch(n){throw be.error("WebSocket transport connection failed",n),this.delegate=void 0,n}finally{this.connectionPromise=void 0}})()),this.connectionPromise}close(){var n;this.isClosed=!0,(n=this.delegate)==null||n.close(),this.delegate=void 0,this.connectionPromise=void 0}subscribe(...n){super.subscribe(...n);let[a,o]=n;this.pendingSubscriptions.push({event:a,handler:o}),this.delegate&&this.delegate.subscribe(a,o)}unsubscribe(...n){let a=super.unsubscribe(...n),[o,s]=n;return this.pendingSubscriptions=this.pendingSubscriptions.filter(c=>!(c.event===o&&c.handler===s)),this.delegate&&this.delegate.unsubscribe(o,s),a}async sendData(n,a){var o;if(this.isDelegateClosedOrClosing()){be.warn("WebSocket is closed or closing, attempting to reconnect");try{await this.connect()}catch(s){throw be.error("Failed to reconnect WebSocket",s),s}}return(o=this.delegate)==null?void 0:o.sendData(n,a)}};function Ql(e,n){let a=m5();return new YC({getWsUrl:()=>a.getLSPURL(e).toString(),waitForConnection:async()=>{await g5()},onReconnect:n})}aa.define(),new Tu;function ZC(e){return e.facet(C5.readOnly)}function e3(e){return[N2(e),Ka.of([{key:"ArrowRight",preventDefault:!0,run:n=>g1(n,e)},{key:"Tab",preventDefault:!0,run:n=>g1(n,e)}])]}function g1(e,n){if(ZC(e.state))return!1;let a=e.state.doc.length;return a===0?(e.dispatch({changes:{from:0,to:a,insert:n},selection:{head:n.length,anchor:n.length}}),!0):!1}function t3(e){let{beforeText:n,linkText:a,afterText:o,onClick:s}=e;return[N2(c=>{let h=document.createElement("span");h.append(document.createTextNode(n));let p=document.createElement("span");return p.textContent=a,p.classList.add("cm-clickable-placeholder"),p.onclick=g=>{g.stopPropagation(),s(c)},h.append(p),h.append(document.createTextNode(o)),h}),Et.theme({".cm-placeholder":{color:"var(--slate-8)"},".cm-clickable-placeholder":{cursor:"pointer !important",pointerEvents:"auto",color:"var(--slate-9)",textDecoration:"underline",textUnderlineOffset:"0.2em"},".cm-clickable-placeholder:hover":{color:"var(--sky-11)"}})]}var n3=vr(e=>{let n,a={transport:Ql("pylsp",async()=>{await(n==null?void 0:n())}),rootUri:$l(),workspaceFolders:[]},o=e==null?void 0:e.pylsp,s=["D100","D103"],c=["W292","E402"],h=["B018","I001"],p={pylsp:{plugins:{marimo_plugin:{enabled:!0},jedi:{auto_import_modules:["numpy"]},jedi_completion:{include_params:!0,resolve_at_most:50},flake8:{enabled:o==null?void 0:o.enable_flake8,extendIgnore:c},pydocstyle:{enabled:o==null?void 0:o.enable_pydocstyle,ignore:s},pylint:{enabled:o==null?void 0:o.enable_pylint},pyflakes:{enabled:o==null?void 0:o.enable_pyflakes},pylsp_mypy:{enabled:o==null?void 0:o.enable_mypy,live_mode:!0},ruff:{enabled:o==null?void 0:o.enable_ruff,extendIgnore:[...c,...s,...h]},signature:{formatter:o!=null&&o.enable_ruff?"ruff":"black",line_length:88}}}},g=new Kl(new ns({...a}),p);return n=()=>g.resyncAllDocuments(),g}),r3=vr(e=>{let n,a=new Kl(new ns({transport:Ql("ty",async()=>{await(n==null?void 0:n())}),rootUri:$l(),workspaceFolders:[],getWorkspaceConfiguration:o=>[{disableLanguageServices:!0}]}),{});return n=()=>a.resyncAllDocuments(),a}),a3=vr(e=>{var o;let n,a=new Kl(new ns({transport:Ql("pyrefly",async()=>{await(n==null?void 0:n())}),rootUri:$l(),workspaceFolders:[],initializationOptions:{pyrefly:{displayTypeErrors:((o=e.diagnostics)==null?void 0:o.enabled)??!1?"force-on":"force-off"}}}),{});return n=()=>a.resyncAllDocuments(),a}),i3=vr(e=>{let n,a=new Kl(new ns({transport:Ql("basedpyright",async()=>{await(n==null?void 0:n())}),rootUri:$l(),workspaceFolders:[]}),{});return n=()=>a.resyncAllDocuments(),a}),o3=class{constructor(){ve(this,"parser",new Lg);ve(this,"type","python");ve(this,"defaultCode",this.parser.defaultCode);ve(this,"defaultMetadata",this.parser.defaultMetadata)}transformIn(e){let n=this.parser.transformIn(e);return[n.code,n.offset,n.metadata]}transformOut(e,n){let a=this.parser.transformOut(e,n);return[a.code,a.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,a,o,s){return[(()=>{var _,S,C,E,O;let c={defaultKeymap:!1,activateOnTyping:n.activate_on_typing,closeOnBlur:!1},h={hideOnChange:!0},p=[];(_=s==null?void 0:s.pylsp)!=null&&_.enabled&&ds("pylsp")&&p.push(n3(s)),(S=s==null?void 0:s.ty)!=null&&S.enabled&&ds("ty")&&p.push(r3(s)),(C=s==null?void 0:s.pyrefly)!=null&&C.enabled&&ds("pyrefly")&&p.push(a3(s)),(E=s==null?void 0:s.basedpyright)!=null&&E.enabled&&ds("basedpyright")&&p.push(i3(s));let g=n.signature_hint_on_typing,b=g?/(\w+|\w+\.|\/)$/:/(\w+|\w+\.|\(|\/|,)$/;if(p.length>0){let M=p.length===1?p[0]:new CC(p);return[$h({client:M,languageId:"python",allowHTMLContent:!0,useSnippetOnCompletion:!0,hoverConfig:h,completionConfig:c,diagnosticsEnabled:((O=s.diagnostics)==null?void 0:O.enabled)??!1,sendIncrementalChanges:!1,signatureHelpEnabled:!0,signatureActivateOnTyping:g,signatureHelpOptions:{position:"above"},keyboardShortcuts:{signatureHelp:a.getHotkey("cell.signatureHelp").key,goToDefinition:a.getHotkey("cell.goToDefinition").key,rename:a.getHotkey("cell.renameSymbol").key},completionMatchBefore:b,onGoToDefinition:V=>{be.debug("onGoToDefinition",V),M.documentUri!==V.uri&&oa().openFile({path:V.uri.replace("file://","")})}}),W0.of(cn.of(e))]}return Lu({...c,override:[i1]})})(),Wh(),s3(o)]}};function s3(e){return e==="marimo-import"?Eu.highest(e3("import marimo as mo")):e==="ai"?t3({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:n=>{n.state.facet(ct).aiCellCompletion()}}):[]}var Jd=Th.configure({props:[w5.add({ParenthesizedExpression:q2,ArgList:q2})]});Wh=function(){return new $2(Jd,[Jd.data.of({autocomplete:wT}),Jd.data.of({autocomplete:_T})])};const l3=e=>{let n;return async()=>(n||(n=e()),await n)};var Gl=class{constructor(e={}){ve(this,"opts");ve(this,"parser",null);ve(this,"offsetRecord",{});ve(this,"getParser",l3(async()=>{if(this.parser)return this.parser;let e=await re(()=>import("./node-sql-parser-TdBo37ty.js").then(async a=>(await a.__tla,a)).then(W6(1)),__vite__mapDeps([213,1]),import.meta.url),{Parser:n}=e.default||e;return this.parser=new n,this.parser}));this.opts=e}async parse(e,n){var s,c;this.offsetRecord={};let a=(c=(s=this.opts).getParserOptions)==null?void 0:c.call(s,n.state),o=await this.sanitizeSql(e,a);try{let h=await this.getParser();return(a==null?void 0:a.database)==="DuckDB"?this.parseWithDuckDBSupport(o,a):{success:!0,errors:[],ast:h.astify(o,a)}}catch(h){return{success:!1,errors:[this.extractErrorInfo(h,o)]}}}async sanitizeSql(e,n){if(n!=null&&n.ignoreBrackets){let{sql:a,offsetRecord:o}=d3(e);return this.offsetRecord=o,a}return e}async parseWithDuckDBSupport(e,n){let a=await this.getParser(),o=c3(e).trimStart().toLowerCase();if(o.startsWith("from")||o.includes("macro"))return{success:!0,errors:[]};let s=e;o.includes("create or replace table")&&(this.offsetRecord[e.indexOf("create or replace table")]=-11,s=e.replace(/create or replace table/i,"create table"));try{let c={...n,database:"PostgreSQL"};return{success:!0,errors:[],ast:a.astify(s,c)}}catch(c){return{success:!1,errors:[this.extractErrorInfo(c,e)]}}}extractErrorInfo(e,n){var h,p,g;let a=1,o=1,s=(e==null?void 0:e.message)||"SQL parsing error",c=e;if(c!=null&&c.location)a=((h=c.location.start)==null?void 0:h.line)||1,o=((p=c.location.start)==null?void 0:p.column)||1;else if(c!=null&&c.hash)a=c.hash.line||1,o=((g=c.hash.loc)==null?void 0:g.first_column)||1;else{let b=s.match(/line (\d+)/i),_=s.match(/column (\d+)/i);b!=null&&b[1]&&(a=parseInt(b[1],10)),_!=null&&_[1]&&(o=parseInt(_[1],10))}for(let[b,_]of Object.entries(this.offsetRecord))o>parseInt(b,10)&&(o-=_);return o>n.length&&(o=n.length),{message:this.cleanErrorMessage(s),line:Math.max(1,a),column:o,severity:"error"}}cleanErrorMessage(e){return e.replace(/^Error: /,"").replace(/Expected .* but .* found\./i,n=>n.replace(/but .* found/,"found unexpected token")).trim()}async validateSql(e,n){return(await this.parse(e,n)).errors}async extractTableReferences(e,n){var o,s;let a=n?(s=(o=this.opts).getParserOptions)==null?void 0:s.call(o,n.state):void 0;try{return(await this.getParser()).tableList(e,a).map(c=>{let h=c.split("::");return h[h.length-1]||c})}catch{return[]}}async extractColumnReferences(e,n){var o,s;let a=n!=null&&n.state?(s=(o=this.opts).getParserOptions)==null?void 0:s.call(o,n.state):void 0;try{return(await this.getParser()).columnList(e,a).map(c=>{let h=c.split("::");return h[h.length-1]||c})}catch{return[]}}};function c3(e,n=["/*","--"]){let a=[];if(n.includes("/*")&&a.push("/\\*[\\s\\S]*?\\*/"),n.includes("--")&&a.push("--[^\\n]*"),a.length===0)return e;let o=RegExp(`^\\s*(${a.join("|")})\\s*`,""),s=e,c="";for(;s!==c;)c=s,s=s.replace(o,"");return s}var u3=2;function d3(e){let n={};return{sql:e.replace(/("(?:[^"\\]|\\.)*")|('(?:[^'\\]|\\.)*')|(\{[^}]*\})/g,(a,o,s,c,h)=>o||s?a:c?(n[h]=u3,`'${c}'`):a),offsetRecord:n}}var f3=750;function p3(e,n){let a=n.line(e.line).from+Math.max(0,e.column-1);return{from:a,to:a+1,severity:e.severity,message:e.message,source:"sql-parser"}}function h3(e={}){let n=e.parser||new Gl;return Q5(async a=>{let o=a.state.doc,s=o.toString();return s.trim()?(await n.validateSql(s,{state:a.state})).map(c=>p3(c,o)):[]},{delay:e.delay||f3})}function oi(e){return typeof e=="object"&&!Array.isArray(e)&&!("self"in e)}function Mr(e){return typeof e=="object"&&!Array.isArray(e)&&"self"in e&&"children"in e}function lr(e){return Array.isArray(e)}function un(e,n,a,o){let s=e.length;if(n==="string"||n==="completion"&&o&&lr(o))return"column";if(n==="namespace"&&a){if(lr(a))return"table";if(oi(a))return Object.values(a).some(c=>lr(c)||Mr(c)&&lr(c.children))?s<=1?"database":"schema":s===0?"database":"namespace"}if(n==="completion"&&a)return lr(a)?"table":(oi(a)&&Object.values(a).some(c=>lr(c)||Mr(c)&&lr(c.children)),s<=1?"database":"schema");switch(s){case 0:return"database";case 1:return"schema";default:return"namespace"}}function y1(e,n,a={}){let{maxDepth:o=10}=a;if(n===""&&Mr(e)){let c=un([],"completion",e.children);return{completion:e.self,path:[],type:"completion",semanticType:c,namespace:e.children}}let s=n.split(".").filter(c=>c.length>0);return s.length===0||s.length>o?null:Xd(e,s,[],a)}function Xd(e,n,a,o,s){if(n.length===0){if(Mr(e)){let g=un(a,"completion",e.children,s);return{completion:e.self,path:a,type:"completion",semanticType:g,namespace:e.children}}return{path:a,type:"namespace",semanticType:un(a,"namespace",e,s),namespace:e}}let[c,...h]=n,{caseSensitive:p=!1}=o;if(!c)return null;if(oi(e)){let g=p?Object.keys(e).find(b=>b===c):Object.keys(e).find(b=>b.toLowerCase()===c.toLowerCase());if(g){let b=e[g];if(b)return Xd(b,h,[...a,g],o,e)}}else{if(Mr(e))return Xd(e.children,n,a,o,e);if(lr(e)){for(let g of e)if(typeof g=="string"){if((p?g===c:g.toLowerCase()===c.toLowerCase())&&h.length===0){let b=un([...a,g],"string",void 0,e);return{value:g,path:[...a,g],type:"string",semanticType:b}}}else if((p?g.label===c:g.label.toLowerCase()===c.toLowerCase())&&h.length===0){let b=un([...a,g.label],"completion",void 0,e);return{completion:g,path:[...a,g.label],type:"completion",semanticType:b}}}}return null}function m3(e,n,a={}){let o=[];if(n.includes(".")){let s=n.lastIndexOf("."),c=n.substring(0,s),h=n.substring(s+1),p=y1(e,c,a);if(p!=null&&p.namespace)return Yd(p.namespace,h,p.path,a)}else return Yd(e,n,[],a);return o}function Yd(e,n,a,o){let s=[],{caseSensitive:c=!1,allowPartialMatch:h=!0}=o;if(oi(e)){for(let[p,g]of Object.entries(e))if(h?c?p.startsWith(n):p.toLowerCase().startsWith(n.toLowerCase()):c?p===n:p.toLowerCase()===n.toLowerCase())if(Mr(g)){let b=un([...a,p],"completion",g.children,e);s.push({completion:g.self,path:[...a,p],type:"completion",semanticType:b,namespace:g.children})}else{let b=un([...a,p],"namespace",g,e);s.push({path:[...a,p],type:"namespace",semanticType:b,namespace:g})}}else if(Mr(e)){if(h?c?e.self.label.startsWith(n):e.self.label.toLowerCase().startsWith(n.toLowerCase()):c?e.self.label===n:e.self.label.toLowerCase()===n.toLowerCase()){let p=un([...a,e.self.label],"completion",e.children);s.push({completion:e.self,path:[...a,e.self.label],type:"completion",semanticType:p,namespace:e.children})}s.push(...Yd(e.children,n,a,o))}else if(lr(e)){for(let p of e)if(typeof p=="string"){if(h?c?p.startsWith(n):p.toLowerCase().startsWith(n.toLowerCase()):c?p===n:p.toLowerCase()===n.toLowerCase()){let g=un([...a,p],"string",void 0,e);s.push({value:p,path:[...a,p],type:"string",semanticType:g})}}else if(h?c?p.label.startsWith(n):p.label.toLowerCase().startsWith(n.toLowerCase()):c?p.label===n:p.label.toLowerCase()===n.toLowerCase()){let g=un([...a,p.label],"completion",void 0,e);s.push({completion:p,path:[...a,p.label],type:"completion",semanticType:g})}}return s}function g3(e,n,a={}){let o=[],{maxDepth:s=10}=a;Jl(e,[],o,s);let{caseSensitive:c=!1}=a;return o.filter(h=>h.path.some(p=>c?p===n:p.toLowerCase()===n.toLowerCase())).sort((h,p)=>{var _,S;let g=c?h.path[h.path.length-1]===n:((_=h.path[h.path.length-1])==null?void 0:_.toLowerCase())===n.toLowerCase(),b=c?p.path[p.path.length-1]===n:((S=p.path[p.path.length-1])==null?void 0:S.toLowerCase())===n.toLowerCase();return g&&!b?-1:!g&&b?1:h.path.length-p.path.length})}function Jl(e,n,a,o){if(!(n.length>=o)){if(oi(e))for(let[s,c]of Object.entries(e)){let h=[...n,s];if(Mr(c)){let p=un(h,"completion",c.children,e);a.push({completion:c.self,path:h,type:"completion",semanticType:p,namespace:c.children}),Jl(c.children,h,a,o)}else{let p=un(h,"namespace",c,e);a.push({path:h,type:"namespace",semanticType:p,namespace:c}),Jl(c,h,a,o)}}else if(Mr(e)){let s=un(n,"completion",e.children);a.push({completion:e.self,path:n,type:"completion",semanticType:s,namespace:e.children}),Jl(e.children,n,a,o)}else if(lr(e))for(let s of e)if(typeof s=="string"){let c=un([...n,s],"string",void 0,e);a.push({value:s,path:[...n,s],type:"string",semanticType:c})}else{let c=un([...n,s.label],"completion",void 0,e);a.push({completion:s,path:[...n,s.label],type:"completion",semanticType:c})}}}function v1(e,n,a={}){let{enableFuzzySearch:o=!1}=a,s=y1(e,n,a);if(s)return s;let c=m3(e,n,a);if(c.length>0)return c[0]||null;if(o){let h=g3(e,n,a);if(h.length>0)return h[0]||null}return null}function b1(e,n){if(n.size===0)return{};if(oi(e)){let a={};for(let[o,s]of Object.entries(e))if(Array.from(n).some(c=>c.toLowerCase()===o.toLowerCase()))a[o]=s;else if(oi(s)){let c=b1(s,n);Object.keys(c).length>0&&(a[o]=c)}return a}return e}function y3(e={}){let{schema:n={},keywords:a={},hoverTime:o=300,enableKeywords:s=!0,enableTables:c=!0,enableColumns:h=!0,enableFuzzySearch:p=!0,parser:g=new Gl,tooltipRender:b,tooltipRenderers:_={}}=e,S=null;return wh(async(C,E,O)=>{let{from:M,to:V,text:H}=C.state.doc.lineAt(E),$=E,N=E;S===null&&(S=typeof a=="function"?a(C):Promise.resolve(a));let ne=await S;for(;$>M&&/[\w.]/.test(H[$-M-1]??"");)$--;for(;N<V&&/[\w.]/.test(H[N-M]??"");)N++;if($===E&&O<0||N===E&&O>0)return null;let fe=H.slice($-M,N-M).toLowerCase();if(!fe||fe.length===0)return null;let R=typeof n=="function"?n(C):n,j=null;if(`${fe}`,!j&&s&&ne[fe]&&(ne[fe],j={word:fe,view:C,pos:E,tooltipType:"keyword",keywordData:{keyword:fe,info:ne[fe]}}),!j&&(c||h)&&R){let F=C.state.doc.toString(),se=await g.extractTableReferences(F),ce=new Set(se.map(xe=>xe.toLowerCase())),he=b1(R,ce),ye=v1(he,fe,{enableFuzzySearch:p});!ye&&ce.size===0&&(ye=v1(R,fe,{enableFuzzySearch:p})),ye&&(Array.from(ce),j={word:fe,view:C,pos:E,tooltipType:"namespace",namespaceData:{item:ye,word:fe,resolvedSchema:ce.size>0?he:R}})}return j?{pos:$,end:N,above:!0,create(F){if(b){let he=b(fe,F,E);if(he)return{dom:he}}let se=null;if(j.tooltipType==="keyword"&&j.keywordData)se=_.keyword?_.keyword(j.keywordData):_1(j.keywordData);else if(j.tooltipType==="namespace"&&j.namespaceData){let he=j.namespaceData,{semanticType:ye}=he.item;se=ye==="table"&&_.table?_.table(he):ye==="column"&&_.column?_.column(he):(ye==="database"||ye==="schema"||ye==="namespace")&&_.namespace?_.namespace(he):w1(he.item)}if(!se)return{dom:document.createElement("div")};let ce=document.createElement("div");return ce.className="cm-sql-hover-tooltip",ce.innerHTML=se,{dom:ce}}}:null},{hoverTime:o})}function w1(e){var s,c,h,p,g,b,_;let n=e.path.join("."),a=((s=e.completion)==null?void 0:s.label)||e.value||e.path[e.path.length-1]||"unknown",o=`<div class="sql-hover-${e.semanticType}">`;switch(o+=`<div class="sql-hover-header"><strong>${a}</strong> <span class="sql-hover-type">${e.semanticType}</span></div>`,e.semanticType){case"database":if(o+=`<div class="sql-hover-description">Database${(c=e.completion)!=null&&c.detail?`: ${e.completion.detail}`:""}</div>`,e.namespace){let S=Xl(e.namespace);S>0&&(o+=`<div class="sql-hover-children">Contains ${S} schema${S===1?"":"s"}</div>`)}break;case"schema":if(o+=`<div class="sql-hover-description">Schema${(h=e.completion)!=null&&h.detail?`: ${e.completion.detail}`:""}</div>`,n&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let S=Xl(e.namespace);S>0&&(o+=`<div class="sql-hover-children">Contains ${S} table${S===1?"":"s"}</div>`)}break;case"table":if(o+=`<div class="sql-hover-description">Table${(p=e.completion)!=null&&p.detail?`: ${e.completion.detail}`:""}</div>`,n){let S=e.path;S.length>1&&(o+=`<div class="sql-hover-path"><strong>Schema:</strong> <code>${S.slice(0,-1).join(".")}</code></div>`)}if(e.namespace&&lr(e.namespace)){let S=e.namespace;if(S.length>0){o+=`<div class="sql-hover-columns"><strong>Columns (${S.length}):</strong><br>`;let C=S.slice(0,8).map(E=>typeof E=="string"?E:E.label);o+=C.map(E=>`<code>${E}</code>`).join(", "),S.length>8&&(o+=`, <em>and ${S.length-8} more...</em>`),o+="</div>"}}break;case"column":if(o+=`<div class="sql-hover-description">Column${(g=e.completion)!=null&&g.detail?`: ${e.completion.detail}`:""}</div>`,n){let S=e.path;S.length>1&&(o+=`<div class="sql-hover-path"><strong>Table:</strong> <code>${S.slice(0,-1).join(".")}</code></div>`)}break;default:if(o+=`<div class="sql-hover-description">Namespace${(b=e.completion)!=null&&b.detail?`: ${e.completion.detail}`:""}</div>`,n&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let S=Xl(e.namespace);S>0&&(o+=`<div class="sql-hover-children">Contains ${S} item${S===1?"":"s"}</div>`)}break}return(_=e.completion)!=null&&_.info&&typeof e.completion.info=="string"&&(o+=`<div class="sql-hover-info">${e.completion.info}</div>`),o+="</div>",o}function Xl(e){return Array.isArray(e)?e.length:typeof e=="object"&&e?"self"in e&&"children"in e?1+Xl(e.children):Object.keys(e).length:0}function _1(e){let{keyword:n,info:a}=e,o='<div class="sql-hover-keyword">';if(o+=`<div class="sql-hover-header"><strong>${n.toUpperCase()}</strong> <span class="sql-hover-type">keyword</span></div>`,o+=`<div class="sql-hover-description">${a.description}</div>`,a.syntax&&(o+=`<div class="sql-hover-syntax"><strong>Syntax:</strong> <code>${a.syntax}</code></div>`),a.example&&(o+=`<div class="sql-hover-example"><strong>Example:</strong><br><code>${a.example}</code></div>`),a.metadata&&typeof a.metadata=="object"&&Object.keys(a.metadata).length>0){o+='<div class="sql-hover-metadata">';for(let[s,c]of Object.entries(a.metadata))o+=`<span class="sql-hover-tag" title="${s}">${c}</span> `;o+="</div>"}return o+="</div>",o}function v3(e){let{tableName:n,columns:a,metadata:o}=e,s='<div class="sql-hover-table">';if(s+=`<div class="sql-hover-header"><strong>${n}</strong> <span class="sql-hover-type">table</span></div>`,s+=`<div class="sql-hover-description">Table with ${a.length} column${a.length===1?"":"s"}</div>`,a.length>0){s+='<div class="sql-hover-columns"><strong>Columns:</strong><br>';let c=a.slice(0,10);s+=c.map(h=>`<code>${h}</code>`).join(", "),a.length>10&&(s+=`, <em>and ${a.length-10} more...</em>`),s+="</div>"}if(o&&typeof o=="object"&&Object.keys(o).length>0){s+='<div class="sql-hover-metadata">';for(let[c,h]of Object.entries(o))s+=`<span class="sql-hover-tag" title="${c}">${h}</span> `;s+="</div>"}return s+="</div>",s}function b3(e){let{tableName:n,columnName:a,schema:o,metadata:s}=e,c='<div class="sql-hover-column">';c+=`<div class="sql-hover-header"><strong>${a}</strong> <span class="sql-hover-type">column</span></div>`,c+=`<div class="sql-hover-description">Column in table <code>${n}</code></div>`;let h=o[n];if(h&&h.length>1){let p=h.filter(g=>g!==a);if(p.length>0){c+=`<div class="sql-hover-related"><strong>Other columns in ${n}:</strong><br>`;let g=p.slice(0,8);c+=g.map(b=>`<code>${b}</code>`).join(", "),p.length>8&&(c+=`, <em>and ${p.length-8} more...</em>`),c+="</div>"}}if(s&&typeof s=="object"&&Object.keys(s).length>0){c+='<div class="sql-hover-metadata">';for(let[p,g]of Object.entries(s))c+=`<span class="sql-hover-tag" title="${p}">${g}</span> `;c+="</div>"}return c+="</div>",c}const w3={keyword:_1,table:v3,column:b3,namespace:w1},x1=(e="light")=>{let n=e==="dark"?{tooltipBg:"#1f2937",tooltipBorder:"#374151",tooltipText:"#f9fafb",tooltipTypeBg:"#374151",tooltipTypeText:"#9ca3af",tooltipChildren:"#9ca3af",codeBg:"#374151",codeText:"#f3f4f6",strong:"#ffffff",em:"#9ca3af",header:"#ffffff",info:"#d1d5db",related:"#d1d5db",path:"#d1d5db",example:"#d1d5db",columns:"#d1d5db",syntax:"#d1d5db"}:{tooltipBg:"#ffffff",tooltipBorder:"#e5e7eb",tooltipText:"#374151",tooltipTypeBg:"#f3f4f6",tooltipTypeText:"#6b7280",tooltipChildren:"#6b7280",codeBg:"#f9fafb",codeText:"#1f2937",strong:"#111827",em:"#6b7280",header:"#111827",info:"#374151",related:"#374151",path:"#374151",example:"#374151",columns:"#374151",syntax:"#374151"};return Et.theme({".cm-sql-hover-tooltip":{padding:"8px 12px",backgroundColor:n.tooltipBg,border:`1px solid ${n.tooltipBorder}`,borderRadius:"6px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",fontSize:"13px",lineHeight:"1.4",maxWidth:"320px",fontFamily:"system-ui, -apple-system, sans-serif",color:n.tooltipText},".cm-sql-hover-tooltip .sql-hover-header":{marginBottom:"6px",display:"flex",alignItems:"center",gap:"6px",color:n.header},".cm-sql-hover-tooltip .sql-hover-type":{fontSize:"11px",padding:"2px 6px",backgroundColor:n.tooltipTypeBg,color:n.tooltipTypeText,borderRadius:"4px",fontWeight:"500"},".cm-sql-hover-tooltip .sql-hover-description":{color:n.info,marginBottom:"8px"},".cm-sql-hover-tooltip .sql-hover-syntax":{marginBottom:"8px",color:n.syntax},".cm-sql-hover-tooltip .sql-hover-example":{marginBottom:"4px",color:n.example},".cm-sql-hover-tooltip .sql-hover-columns":{marginBottom:"4px",color:n.columns},".cm-sql-hover-tooltip .sql-hover-related":{marginBottom:"4px",color:n.related},".cm-sql-hover-tooltip .sql-hover-path":{marginBottom:"4px",color:n.path},".cm-sql-hover-tooltip .sql-hover-info":{marginBottom:"4px",color:n.info},".cm-sql-hover-tooltip .sql-hover-children":{marginBottom:"4px",color:n.tooltipChildren,fontSize:"12px"},".cm-sql-hover-tooltip code":{backgroundColor:n.codeBg,padding:"1px 4px",borderRadius:"3px",fontSize:"12px",fontFamily:"ui-monospace, 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace",color:n.codeText},".cm-sql-hover-tooltip strong":{fontWeight:"600",color:n.strong},".cm-sql-hover-tooltip em":{fontStyle:"italic",color:n.em}})};var _3=class{constructor(e){ve(this,"parser");ve(this,"cache",new Map);ve(this,"MAX_CACHE_SIZE",10);this.parser=e}async analyzeDocument(e){let n=e.doc.toString(),a=this.generateCacheKey(n),o=this.cache.get(a);if(o)return o;let s=await this.extractStatements(n,e);if(this.cache.set(a,s),this.cache.size>this.MAX_CACHE_SIZE){let c=this.cache.keys().next().value;c!==void 0&&this.cache.delete(c)}return s}async getStatementAtPosition(e,n){return(await this.analyzeDocument(e)).find(a=>n>=a.from&&n<=a.to)||null}async getStatementsInRange(e,n,a){return(await this.analyzeDocument(e)).filter(o=>o.from<=a&&o.to>=n)}async extractStatements(e,n){let a=[],o=this.splitByStatementSeparators(e),s=0;for(let c of o){let h=c.trim();if(h.length===0){s+=c.length;continue}let p=s+c.indexOf(h),g=p+h.length,b=n.doc.lineAt(p),_=n.doc.lineAt(g),S=this.stripComments(h);if(S.trim().length===0||S.trim()===";"){s+=c.length;continue}let C=await this.parser.parse(S,{state:n}),E=this.determineStatementType(S),O=S.endsWith(";")?S.slice(0,-1).trim():S.trim();a.push({from:p,to:g,lineFrom:b.number,lineTo:_.number,content:O,type:E,isValid:C.success}),s+=c.length}return a}splitByStatementSeparators(e){let n=[],a="",o=!1,s="",c=!1,h=!1,p=0;for(;p<e.length;){let g=e[p],b=e[p+1];if(!o&&!h&&g==="-"&&b==="-"){c=!0,a+=g+b,p+=2;continue}if(!o&&!c&&g==="/"&&b==="*"){h=!0,a+=g+b,p+=2;continue}if(h&&g==="*"&&b==="/"){h=!1,a+=g+b,p+=2;continue}if(c&&(g===`
111
+ `)}function Ul(e){return`<marimo-tex class="arithmatex">||(${e.trim()}||)</marimo-tex>`}function Kd(e){return`<marimo-tex class="arithmatex">||[${e.trim()}||]</marimo-tex>`}const cn={PREFIX:"file:///",of(e){return`${this.PREFIX}${e}`},is(e){return e.startsWith(this.PREFIX)},parse(e){return rn(this.is(e),`Invalid cell document URI: ${e}`),e.slice(this.PREFIX.length)}};function m1(e){return"notify"in e}function UC(e){return e.startsWith("_")&&!e.startsWith("__")}var KC=class{constructor(e){ve(this,"documentVersion",0);ve(this,"lastSnapshot",null);this.getNotebookCode=e}snapshot(){var a;let e=this.getLens(),n=((a=this.lastSnapshot)==null?void 0:a.mergedText)!==e.mergedText;return n?(this.documentVersion++,this.lastSnapshot=e,{lens:e,didChange:n,version:this.documentVersion}):{lens:e,didChange:n,version:this.documentVersion}}getLatestSnapshot(){if(!this.lastSnapshot)throw Error("No snapshots");return{lens:this.lastSnapshot,version:this.documentVersion}}getLens(){let{cellIds:e,codes:n}=this.getNotebookCode();return PC(e,n)}},QC=()=>{let e=Wi().cellHandles;return Ar.mapValues(e,n=>{var a;return(a=n.current)==null?void 0:a.editorViewOrNull})};function Qd(e){let n=f1(e);return Array.isArray(n)?e:n}function Gd(e){return{...e,documentation:Qd(e.documentation)}}function GC(e){return e==null?null:Array.isArray(e)?e.map(n=>Gd(n)):{...e,items:e.items.map(n=>Gd(n))}}function JC(e){return{...e,signatures:e.signatures.map(n=>{var a;return{...n,documentation:Qd(n.documentation),parameters:(a=n.parameters)==null?void 0:a.map(o=>({...o,documentation:Qd(o.documentation)}))}})}}var Kl=(cr=class{constructor(n,a,o=QC){ve(this,"completionItemCache",new zl(10));this.documentUri=c1(),this.getNotebookEditors=o,this.initialSettings=a,this.client=n,this.patchProcessNotification(),this.initializePromise.then(()=>{rn(m1(this.client),"notify is not a method on the client"),this.client.notify("workspace/didChangeConfiguration",{settings:a})}),this.snapshotter=new KC(this.getNotebookCode.bind(this))}static pruneSeenCellUris(n){for(let a of cr.SEEN_CELL_DOCUMENT_URIS){let o=cn.parse(a);n.has(o)||cr.SEEN_CELL_DOCUMENT_URIS.delete(a)}}onNotification(n){return this.client.onNotification(n)}get ready(){return this.client.ready}set ready(n){this.client.ready=n}get capabilities(){return this.client.capabilities}set capabilities(n){this.client.capabilities=n}get initializePromise(){return this.client.initializePromise}set initializePromise(n){this.client.initializePromise=n}get clientCapabilities(){return this.client.clientCapabilities}async initialize(){await this.client.initialize()}close(){this.client.close()}async resyncAllDocuments(){rn(m1(this.client),"notify is not a method on the client"),await this.client.initialize(),this.client.notify("workspace/didChangeConfiguration",{settings:this.initialSettings});let{lens:n,version:a}=this.snapshotter.snapshot();await this.client.textDocumentDidOpen({textDocument:{languageId:"python",text:n.mergedText,uri:this.documentUri,version:a}}),be.log("[lsp] Document re-synchronization complete")}getNotebookCode(){return Fe.get(RC)}assertCellDocumentUri(n){rn(cn.is(n),"Execpted URI to be CellDocumentUri")}async textDocumentDidOpen(n){be.debug("[lsp] textDocumentDidOpen",n);let a=n.textDocument.uri;this.assertCellDocumentUri(a);let{lens:o,version:s}=this.snapshotter.snapshot();cr.SEEN_CELL_DOCUMENT_URIS.add(a);let c=await this.client.textDocumentDidOpen({textDocument:{languageId:n.textDocument.languageId,text:o.mergedText,uri:this.documentUri,version:s}});return c?{...c,textDocument:{...c.textDocument,text:o.mergedText}}:n}async sync(){let{lens:n,version:a,didChange:o}=this.snapshotter.snapshot(),s={textDocument:{uri:this.documentUri,version:a},contentChanges:[{text:n.mergedText}]};return o&&await this.client.textDocumentDidChange(s),{params:s,lens:n}}async textDocumentDidChange(n){if(be.debug("[lsp] textDocumentDidChange",n),n.contentChanges.length===1){let{params:a}=await this.sync();return a}return be.warn("[lsp] Unhandled textDocumentDidChange",n),this.client.textDocumentDidChange(n)}async textDocumentDefinition(n){let a=n.textDocument.uri;if(!cn.is(a))return be.warn("Invalid cell document URI",a),null;let{lens:o}=await this.sync(),s=cn.parse(a);return this.client.textDocumentDefinition({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentSignatureHelp(n){let a=n.textDocument.uri;if(!cn.is(a))return be.warn("Invalid cell document URI",a),null;let{lens:o}=await this.sync(),s=cn.parse(a),c=await this.client.textDocumentSignatureHelp({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)});return c?JC(c):null}textDocumentCodeAction(n){return Promise.resolve(null)}async textDocumentRename(n){var V;let a=n.textDocument.uri;if(!cn.is(a))return be.warn("Invalid cell document URI",a),null;let o=cn.parse(a),{lens:s}=await this.sync(),c=s.transformPosition(n.position,o),h=await this.client.textDocumentRename({...n,textDocument:{uri:this.documentUri},position:c});if(!h)return null;let p=(V=h.documentChanges)==null?void 0:V.flatMap(H=>"edits"in H?H.edits:[]);if(!p||p.length!==1)return be.warn("Expected exactly one edit",p),h;let g=p[0];if(!("newText"in g))return be.warn("Expected newText in edit",g),h;let b=s.getEditsForNewText(g.newText),_=new Map(b.map(H=>[H.cellId,H.text])),S=this.getNotebookEditors(),C=S[o],E=!1;if(C){let H=C.state.doc.line(n.position.line+1).from+n.position.character,{startToken:$,endToken:N}=Bd(C.state.doc,H),ne=C.state.doc.sliceString($,N);E=UC(ne),E&&be.debug("[lsp] Private variable rename detected, limiting to current cell",ne)}let O=[],M=0;for(let[H,$]of Ar.entries(S)){if(E&&H!==o)continue;let N=_.get(H);if(N==null){be.warn("[lsp] No new code for cell during rename",H),O.push(H);continue}if(!$){be.warn("[lsp] No editor view for cell during rename",H),O.push(H);continue}nr($)!==N&&(Ki($,N),M++)}return O.length>0&&be.error(`[lsp] Rename partially failed: could not update ${O.length} cell(s)`,O),be.debug(`[lsp] Rename completed: updated ${M} cell(s)`),{...h,documentChanges:[{edits:[],textDocument:{uri:a,version:0}}]}}async completionItemResolve(n){let a=JSON.stringify(n),o=this.completionItemCache.get(a);if(o)return o;let s=this.client.completionItemResolve(n).then(c=>Gd(c));return this.completionItemCache.set(a,s),s}async textDocumentPrepareRename(n){let a=n.textDocument.uri;if(!cn.is(a))return be.warn("Invalid cell document URI",a),null;let{lens:o}=await this.sync(),s=cn.parse(a);return this.client.textDocumentPrepareRename({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentHover(n){be.debug("[lsp] textDocumentHover",n);let{lens:a}=await this.sync(),o=cn.parse(n.textDocument.uri),s=await this.client.textDocumentHover({...n,textDocument:{uri:this.documentUri},position:a.transformPosition(n.position,o)});return s?(typeof s.contents=="object"&&"kind"in s.contents&&(s.contents={kind:"markdown",value:s.contents.value}),s.contents=f1(s.contents)??s.contents,s.contents===""?null:(s.range&&(s.range=a.reverseRange(s.range,o)),s)):(be.debug("[lsp] no hover result"),s)}async textDocumentCompletion(n){let{lens:a}=this.snapshotter.getLatestSnapshot();if(!cn.is(n.textDocument.uri))return be.error("[lsp] Invalid cell document URI in completion request",n.textDocument.uri),null;let o=cn.parse(n.textDocument.uri);if(!o||o==="undefined")return be.error("[lsp] Invalid cellId 'undefined' in completion request",{cellId:o,uri:n.textDocument.uri,availableCellIds:a.cellIds}),null;a.cellIds.includes(o)||be.warn("[lsp] CellId in completion request not found in current lens",{cellId:o,uri:n.textDocument.uri,availableCellIds:a.cellIds});let s=a.transformPosition(n.position,o);return GC(await this.client.textDocumentCompletion({...n,textDocument:{uri:this.documentUri},position:s}))}patchProcessNotification(){rn("processNotification"in this.client,"processNotification is not a method on the client");let n=this.client.processNotification.bind(this.client),a=o=>{if(o.method==="textDocument/publishDiagnostics"){be.debug("[lsp] handling diagnostics",o);let s=this.snapshotter.getLatestSnapshot(),c=o.params.diagnostics,{lens:h,version:p}=s,g=new Map;for(let S of c)for(let C of h.cellIds)if(h.isInRange(S.range,C)){g.has(C)||g.set(C,[]);let E={...S,range:h.reverseRange(S.range,C)};g.get(C).push(E);break}let b=new Set(h.cellIds);cr.pruneSeenCellUris(b);let _=new Set(cr.SEEN_CELL_DOCUMENT_URIS);for(let[S,C]of g.entries()){be.debug("[lsp] diagnostics for cell",S,C);let E=cn.of(S);_.delete(E),n({...o,params:{...o.params,uri:E,version:p,diagnostics:C}})}if(_.size>0){be.debug("[lsp] clearing diagnostics",_);for(let S of _)n({method:"textDocument/publishDiagnostics",params:{uri:S,diagnostics:[]}})}return}return n(o)};this.client.processNotification=a}},ve(cr,"SEEN_CELL_DOCUMENT_URIS",new Set),cr),XC=Sl(),YC=Ya(),ZC=class extends YC.Transport{constructor(n){super();ve(this,"isClosed",!1);ve(this,"hasConnectedBefore",!1);ve(this,"pendingSubscriptions",[]);this.options=n,this.delegate=void 0}createDelegate(){if(this.delegate)try{this.delegate.close()}catch(n){be.warn("Error closing old WebSocket delegate",n)}this.delegate=new XC.WebSocketTransport(this.options.getWsUrl());for(let{event:n,handler:a}of this.pendingSubscriptions)this.delegate.subscribe(n,a);return this.delegate}isDelegateClosedOrClosing(){if(!this.delegate)return!0;let n=this.delegate.connection;return n?n.readyState===WebSocket.CLOSING||n.readyState===WebSocket.CLOSED:!0}async connect(){if(this.isClosed)throw Error("Transport is closed");return this.connectionPromise||(this.connectionPromise=(async()=>{try{this.options.waitForConnection&&await this.options.waitForConnection();let n=this.delegate;(!n||this.isDelegateClosedOrClosing())&&(n=this.createDelegate()),await n.connect(),be.log("WebSocket transport connected successfully");let a=this.hasConnectedBefore;this.hasConnectedBefore=!0,a&&this.options.onReconnect&&(be.log("Calling onReconnect callback to re-synchronize state"),await this.options.onReconnect())}catch(n){throw be.error("WebSocket transport connection failed",n),this.delegate=void 0,n}finally{this.connectionPromise=void 0}})()),this.connectionPromise}close(){var n;this.isClosed=!0,(n=this.delegate)==null||n.close(),this.delegate=void 0,this.connectionPromise=void 0}subscribe(...n){super.subscribe(...n);let[a,o]=n;this.pendingSubscriptions.push({event:a,handler:o}),this.delegate&&this.delegate.subscribe(a,o)}unsubscribe(...n){let a=super.unsubscribe(...n),[o,s]=n;return this.pendingSubscriptions=this.pendingSubscriptions.filter(c=>!(c.event===o&&c.handler===s)),this.delegate&&this.delegate.unsubscribe(o,s),a}async sendData(n,a){var o;if(this.isDelegateClosedOrClosing()){be.warn("WebSocket is closed or closing, attempting to reconnect");try{await this.connect()}catch(s){throw be.error("Failed to reconnect WebSocket",s),s}}return(o=this.delegate)==null?void 0:o.sendData(n,a)}};function Ql(e,n){let a=g5();return new ZC({getWsUrl:()=>a.getLSPURL(e).toString(),waitForConnection:async()=>{await y5()},onReconnect:n})}aa.define(),new Tu;function e3(e){return e.facet(E5.readOnly)}function t3(e){return[N2(e),Ka.of([{key:"ArrowRight",preventDefault:!0,run:n=>g1(n,e)},{key:"Tab",preventDefault:!0,run:n=>g1(n,e)}])]}function g1(e,n){if(e3(e.state))return!1;let a=e.state.doc.length;return a===0?(e.dispatch({changes:{from:0,to:a,insert:n},selection:{head:n.length,anchor:n.length}}),!0):!1}function n3(e){let{beforeText:n,linkText:a,afterText:o,onClick:s}=e;return[N2(c=>{let h=document.createElement("span");h.append(document.createTextNode(n));let p=document.createElement("span");return p.textContent=a,p.classList.add("cm-clickable-placeholder"),p.onclick=g=>{g.stopPropagation(),s(c)},h.append(p),h.append(document.createTextNode(o)),h}),Et.theme({".cm-placeholder":{color:"var(--slate-8)"},".cm-clickable-placeholder":{cursor:"pointer !important",pointerEvents:"auto",color:"var(--slate-9)",textDecoration:"underline",textUnderlineOffset:"0.2em"},".cm-clickable-placeholder:hover":{color:"var(--sky-11)"}})]}var r3=vr(e=>{let n,a={transport:Ql("pylsp",async()=>{await(n==null?void 0:n())}),rootUri:$l(),workspaceFolders:[]},o=e==null?void 0:e.pylsp,s=["D100","D103"],c=["W292","E402"],h=["B018","I001"],p={pylsp:{plugins:{marimo_plugin:{enabled:!0},jedi:{auto_import_modules:["numpy"]},jedi_completion:{include_params:!0,resolve_at_most:50},flake8:{enabled:o==null?void 0:o.enable_flake8,extendIgnore:c},pydocstyle:{enabled:o==null?void 0:o.enable_pydocstyle,ignore:s},pylint:{enabled:o==null?void 0:o.enable_pylint},pyflakes:{enabled:o==null?void 0:o.enable_pyflakes},pylsp_mypy:{enabled:o==null?void 0:o.enable_mypy,live_mode:!0},ruff:{enabled:o==null?void 0:o.enable_ruff,extendIgnore:[...c,...s,...h]},signature:{formatter:o!=null&&o.enable_ruff?"ruff":"black",line_length:88}}}},g=new Kl(new ns({...a}),p);return n=()=>g.resyncAllDocuments(),g}),a3=vr(e=>{let n,a=new Kl(new ns({transport:Ql("ty",async()=>{await(n==null?void 0:n())}),rootUri:$l(),workspaceFolders:[],getWorkspaceConfiguration:o=>[{disableLanguageServices:!0}]}),{});return n=()=>a.resyncAllDocuments(),a}),i3=vr(e=>{var o;let n,a=new Kl(new ns({transport:Ql("pyrefly",async()=>{await(n==null?void 0:n())}),rootUri:$l(),workspaceFolders:[],initializationOptions:{pyrefly:{displayTypeErrors:((o=e.diagnostics)==null?void 0:o.enabled)??!1?"force-on":"force-off"}}}),{});return n=()=>a.resyncAllDocuments(),a}),o3=vr(e=>{let n,a=new Kl(new ns({transport:Ql("basedpyright",async()=>{await(n==null?void 0:n())}),rootUri:$l(),workspaceFolders:[]}),{});return n=()=>a.resyncAllDocuments(),a}),s3=class{constructor(){ve(this,"parser",new Lg);ve(this,"type","python");ve(this,"defaultCode",this.parser.defaultCode);ve(this,"defaultMetadata",this.parser.defaultMetadata)}transformIn(e){let n=this.parser.transformIn(e);return[n.code,n.offset,n.metadata]}transformOut(e,n){let a=this.parser.transformOut(e,n);return[a.code,a.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,a,o,s){return[(()=>{var _,S,C,E,O;let c={defaultKeymap:!1,activateOnTyping:n.activate_on_typing,closeOnBlur:!1},h={hideOnChange:!0},p=[];(_=s==null?void 0:s.pylsp)!=null&&_.enabled&&ds("pylsp")&&p.push(r3(s)),(S=s==null?void 0:s.ty)!=null&&S.enabled&&ds("ty")&&p.push(a3(s)),(C=s==null?void 0:s.pyrefly)!=null&&C.enabled&&ds("pyrefly")&&p.push(i3(s)),(E=s==null?void 0:s.basedpyright)!=null&&E.enabled&&ds("basedpyright")&&p.push(o3(s));let g=n.signature_hint_on_typing,b=g?/(\w+|\w+\.|\/)$/:/(\w+|\w+\.|\(|\/|,)$/;if(p.length>0){let M=p.length===1?p[0]:new EC(p);return[Wh({client:M,languageId:"python",allowHTMLContent:!0,useSnippetOnCompletion:!0,hoverConfig:h,completionConfig:c,diagnosticsEnabled:((O=s.diagnostics)==null?void 0:O.enabled)??!1,sendIncrementalChanges:!1,signatureHelpEnabled:!0,signatureActivateOnTyping:g,signatureHelpOptions:{position:"above"},keyboardShortcuts:{signatureHelp:a.getHotkey("cell.signatureHelp").key,goToDefinition:a.getHotkey("cell.goToDefinition").key,rename:a.getHotkey("cell.renameSymbol").key},completionMatchBefore:b,onGoToDefinition:V=>{be.debug("onGoToDefinition",V),M.documentUri!==V.uri&&oa().openFile({path:V.uri.replace("file://","")})}}),W0.of(cn.of(e))]}return Lu({...c,override:[i1]})})(),Uh(),l3(o)]}};function l3(e){return e==="marimo-import"?Eu.highest(t3("import marimo as mo")):e==="ai"?n3({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:n=>{n.state.facet(ct).aiCellCompletion()}}):[]}var Jd=Th.configure({props:[_5.add({ParenthesizedExpression:q2,ArgList:q2})]});Uh=function(){return new $2(Jd,[Jd.data.of({autocomplete:_T}),Jd.data.of({autocomplete:xT})])};const c3=e=>{let n;return async()=>(n||(n=e()),await n)};var Gl=class{constructor(e={}){ve(this,"opts");ve(this,"parser",null);ve(this,"offsetRecord",{});ve(this,"getParser",c3(async()=>{if(this.parser)return this.parser;let e=await re(()=>import("./node-sql-parser-TdBo37ty.js").then(async a=>(await a.__tla,a)).then(U6(1)),__vite__mapDeps([213,1]),import.meta.url),{Parser:n}=e.default||e;return this.parser=new n,this.parser}));this.opts=e}async parse(e,n){var s,c;this.offsetRecord={};let a=(c=(s=this.opts).getParserOptions)==null?void 0:c.call(s,n.state),o=await this.sanitizeSql(e,a);try{let h=await this.getParser();return(a==null?void 0:a.database)==="DuckDB"?this.parseWithDuckDBSupport(o,a):{success:!0,errors:[],ast:h.astify(o,a)}}catch(h){return{success:!1,errors:[this.extractErrorInfo(h,o)]}}}async sanitizeSql(e,n){if(n!=null&&n.ignoreBrackets){let{sql:a,offsetRecord:o}=f3(e);return this.offsetRecord=o,a}return e}async parseWithDuckDBSupport(e,n){let a=await this.getParser(),o=u3(e).trimStart().toLowerCase();if(o.startsWith("from")||o.includes("macro"))return{success:!0,errors:[]};let s=e;o.includes("create or replace table")&&(this.offsetRecord[e.indexOf("create or replace table")]=-11,s=e.replace(/create or replace table/i,"create table"));try{let c={...n,database:"PostgreSQL"};return{success:!0,errors:[],ast:a.astify(s,c)}}catch(c){return{success:!1,errors:[this.extractErrorInfo(c,e)]}}}extractErrorInfo(e,n){var h,p,g;let a=1,o=1,s=(e==null?void 0:e.message)||"SQL parsing error",c=e;if(c!=null&&c.location)a=((h=c.location.start)==null?void 0:h.line)||1,o=((p=c.location.start)==null?void 0:p.column)||1;else if(c!=null&&c.hash)a=c.hash.line||1,o=((g=c.hash.loc)==null?void 0:g.first_column)||1;else{let b=s.match(/line (\d+)/i),_=s.match(/column (\d+)/i);b!=null&&b[1]&&(a=parseInt(b[1],10)),_!=null&&_[1]&&(o=parseInt(_[1],10))}for(let[b,_]of Object.entries(this.offsetRecord))o>parseInt(b,10)&&(o-=_);return o>n.length&&(o=n.length),{message:this.cleanErrorMessage(s),line:Math.max(1,a),column:o,severity:"error"}}cleanErrorMessage(e){return e.replace(/^Error: /,"").replace(/Expected .* but .* found\./i,n=>n.replace(/but .* found/,"found unexpected token")).trim()}async validateSql(e,n){return(await this.parse(e,n)).errors}async extractTableReferences(e,n){var o,s;let a=n?(s=(o=this.opts).getParserOptions)==null?void 0:s.call(o,n.state):void 0;try{return(await this.getParser()).tableList(e,a).map(c=>{let h=c.split("::");return h[h.length-1]||c})}catch{return[]}}async extractColumnReferences(e,n){var o,s;let a=n!=null&&n.state?(s=(o=this.opts).getParserOptions)==null?void 0:s.call(o,n.state):void 0;try{return(await this.getParser()).columnList(e,a).map(c=>{let h=c.split("::");return h[h.length-1]||c})}catch{return[]}}};function u3(e,n=["/*","--"]){let a=[];if(n.includes("/*")&&a.push("/\\*[\\s\\S]*?\\*/"),n.includes("--")&&a.push("--[^\\n]*"),a.length===0)return e;let o=RegExp(`^\\s*(${a.join("|")})\\s*`,""),s=e,c="";for(;s!==c;)c=s,s=s.replace(o,"");return s}var d3=2;function f3(e){let n={};return{sql:e.replace(/("(?:[^"\\]|\\.)*")|('(?:[^'\\]|\\.)*')|(\{[^}]*\})/g,(a,o,s,c,h)=>o||s?a:c?(n[h]=d3,`'${c}'`):a),offsetRecord:n}}var p3=750;function h3(e,n){let a=n.line(e.line).from+Math.max(0,e.column-1);return{from:a,to:a+1,severity:e.severity,message:e.message,source:"sql-parser"}}function m3(e={}){let n=e.parser||new Gl;return G5(async a=>{let o=a.state.doc,s=o.toString();return s.trim()?(await n.validateSql(s,{state:a.state})).map(c=>h3(c,o)):[]},{delay:e.delay||p3})}function oi(e){return typeof e=="object"&&!Array.isArray(e)&&!("self"in e)}function Mr(e){return typeof e=="object"&&!Array.isArray(e)&&"self"in e&&"children"in e}function lr(e){return Array.isArray(e)}function un(e,n,a,o){let s=e.length;if(n==="string"||n==="completion"&&o&&lr(o))return"column";if(n==="namespace"&&a){if(lr(a))return"table";if(oi(a))return Object.values(a).some(c=>lr(c)||Mr(c)&&lr(c.children))?s<=1?"database":"schema":s===0?"database":"namespace"}if(n==="completion"&&a)return lr(a)?"table":(oi(a)&&Object.values(a).some(c=>lr(c)||Mr(c)&&lr(c.children)),s<=1?"database":"schema");switch(s){case 0:return"database";case 1:return"schema";default:return"namespace"}}function y1(e,n,a={}){let{maxDepth:o=10}=a;if(n===""&&Mr(e)){let c=un([],"completion",e.children);return{completion:e.self,path:[],type:"completion",semanticType:c,namespace:e.children}}let s=n.split(".").filter(c=>c.length>0);return s.length===0||s.length>o?null:Xd(e,s,[],a)}function Xd(e,n,a,o,s){if(n.length===0){if(Mr(e)){let g=un(a,"completion",e.children,s);return{completion:e.self,path:a,type:"completion",semanticType:g,namespace:e.children}}return{path:a,type:"namespace",semanticType:un(a,"namespace",e,s),namespace:e}}let[c,...h]=n,{caseSensitive:p=!1}=o;if(!c)return null;if(oi(e)){let g=p?Object.keys(e).find(b=>b===c):Object.keys(e).find(b=>b.toLowerCase()===c.toLowerCase());if(g){let b=e[g];if(b)return Xd(b,h,[...a,g],o,e)}}else{if(Mr(e))return Xd(e.children,n,a,o,e);if(lr(e)){for(let g of e)if(typeof g=="string"){if((p?g===c:g.toLowerCase()===c.toLowerCase())&&h.length===0){let b=un([...a,g],"string",void 0,e);return{value:g,path:[...a,g],type:"string",semanticType:b}}}else if((p?g.label===c:g.label.toLowerCase()===c.toLowerCase())&&h.length===0){let b=un([...a,g.label],"completion",void 0,e);return{completion:g,path:[...a,g.label],type:"completion",semanticType:b}}}}return null}function g3(e,n,a={}){let o=[];if(n.includes(".")){let s=n.lastIndexOf("."),c=n.substring(0,s),h=n.substring(s+1),p=y1(e,c,a);if(p!=null&&p.namespace)return Yd(p.namespace,h,p.path,a)}else return Yd(e,n,[],a);return o}function Yd(e,n,a,o){let s=[],{caseSensitive:c=!1,allowPartialMatch:h=!0}=o;if(oi(e)){for(let[p,g]of Object.entries(e))if(h?c?p.startsWith(n):p.toLowerCase().startsWith(n.toLowerCase()):c?p===n:p.toLowerCase()===n.toLowerCase())if(Mr(g)){let b=un([...a,p],"completion",g.children,e);s.push({completion:g.self,path:[...a,p],type:"completion",semanticType:b,namespace:g.children})}else{let b=un([...a,p],"namespace",g,e);s.push({path:[...a,p],type:"namespace",semanticType:b,namespace:g})}}else if(Mr(e)){if(h?c?e.self.label.startsWith(n):e.self.label.toLowerCase().startsWith(n.toLowerCase()):c?e.self.label===n:e.self.label.toLowerCase()===n.toLowerCase()){let p=un([...a,e.self.label],"completion",e.children);s.push({completion:e.self,path:[...a,e.self.label],type:"completion",semanticType:p,namespace:e.children})}s.push(...Yd(e.children,n,a,o))}else if(lr(e)){for(let p of e)if(typeof p=="string"){if(h?c?p.startsWith(n):p.toLowerCase().startsWith(n.toLowerCase()):c?p===n:p.toLowerCase()===n.toLowerCase()){let g=un([...a,p],"string",void 0,e);s.push({value:p,path:[...a,p],type:"string",semanticType:g})}}else if(h?c?p.label.startsWith(n):p.label.toLowerCase().startsWith(n.toLowerCase()):c?p.label===n:p.label.toLowerCase()===n.toLowerCase()){let g=un([...a,p.label],"completion",void 0,e);s.push({completion:p,path:[...a,p.label],type:"completion",semanticType:g})}}return s}function y3(e,n,a={}){let o=[],{maxDepth:s=10}=a;Jl(e,[],o,s);let{caseSensitive:c=!1}=a;return o.filter(h=>h.path.some(p=>c?p===n:p.toLowerCase()===n.toLowerCase())).sort((h,p)=>{var _,S;let g=c?h.path[h.path.length-1]===n:((_=h.path[h.path.length-1])==null?void 0:_.toLowerCase())===n.toLowerCase(),b=c?p.path[p.path.length-1]===n:((S=p.path[p.path.length-1])==null?void 0:S.toLowerCase())===n.toLowerCase();return g&&!b?-1:!g&&b?1:h.path.length-p.path.length})}function Jl(e,n,a,o){if(!(n.length>=o)){if(oi(e))for(let[s,c]of Object.entries(e)){let h=[...n,s];if(Mr(c)){let p=un(h,"completion",c.children,e);a.push({completion:c.self,path:h,type:"completion",semanticType:p,namespace:c.children}),Jl(c.children,h,a,o)}else{let p=un(h,"namespace",c,e);a.push({path:h,type:"namespace",semanticType:p,namespace:c}),Jl(c,h,a,o)}}else if(Mr(e)){let s=un(n,"completion",e.children);a.push({completion:e.self,path:n,type:"completion",semanticType:s,namespace:e.children}),Jl(e.children,n,a,o)}else if(lr(e))for(let s of e)if(typeof s=="string"){let c=un([...n,s],"string",void 0,e);a.push({value:s,path:[...n,s],type:"string",semanticType:c})}else{let c=un([...n,s.label],"completion",void 0,e);a.push({completion:s,path:[...n,s.label],type:"completion",semanticType:c})}}}function v1(e,n,a={}){let{enableFuzzySearch:o=!1}=a,s=y1(e,n,a);if(s)return s;let c=g3(e,n,a);if(c.length>0)return c[0]||null;if(o){let h=y3(e,n,a);if(h.length>0)return h[0]||null}return null}function b1(e,n){if(n.size===0)return{};if(oi(e)){let a={};for(let[o,s]of Object.entries(e))if(Array.from(n).some(c=>c.toLowerCase()===o.toLowerCase()))a[o]=s;else if(oi(s)){let c=b1(s,n);Object.keys(c).length>0&&(a[o]=c)}return a}return e}function v3(e={}){let{schema:n={},keywords:a={},hoverTime:o=300,enableKeywords:s=!0,enableTables:c=!0,enableColumns:h=!0,enableFuzzySearch:p=!0,parser:g=new Gl,tooltipRender:b,tooltipRenderers:_={}}=e,S=null;return wh(async(C,E,O)=>{let{from:M,to:V,text:H}=C.state.doc.lineAt(E),$=E,N=E;S===null&&(S=typeof a=="function"?a(C):Promise.resolve(a));let ne=await S;for(;$>M&&/[\w.]/.test(H[$-M-1]??"");)$--;for(;N<V&&/[\w.]/.test(H[N-M]??"");)N++;if($===E&&O<0||N===E&&O>0)return null;let fe=H.slice($-M,N-M).toLowerCase();if(!fe||fe.length===0)return null;let R=typeof n=="function"?n(C):n,j=null;if(`${fe}`,!j&&s&&ne[fe]&&(ne[fe],j={word:fe,view:C,pos:E,tooltipType:"keyword",keywordData:{keyword:fe,info:ne[fe]}}),!j&&(c||h)&&R){let F=C.state.doc.toString(),se=await g.extractTableReferences(F),ce=new Set(se.map(xe=>xe.toLowerCase())),he=b1(R,ce),ye=v1(he,fe,{enableFuzzySearch:p});!ye&&ce.size===0&&(ye=v1(R,fe,{enableFuzzySearch:p})),ye&&(Array.from(ce),j={word:fe,view:C,pos:E,tooltipType:"namespace",namespaceData:{item:ye,word:fe,resolvedSchema:ce.size>0?he:R}})}return j?{pos:$,end:N,above:!0,create(F){if(b){let he=b(fe,F,E);if(he)return{dom:he}}let se=null;if(j.tooltipType==="keyword"&&j.keywordData)se=_.keyword?_.keyword(j.keywordData):_1(j.keywordData);else if(j.tooltipType==="namespace"&&j.namespaceData){let he=j.namespaceData,{semanticType:ye}=he.item;se=ye==="table"&&_.table?_.table(he):ye==="column"&&_.column?_.column(he):(ye==="database"||ye==="schema"||ye==="namespace")&&_.namespace?_.namespace(he):w1(he.item)}if(!se)return{dom:document.createElement("div")};let ce=document.createElement("div");return ce.className="cm-sql-hover-tooltip",ce.innerHTML=se,{dom:ce}}}:null},{hoverTime:o})}function w1(e){var s,c,h,p,g,b,_;let n=e.path.join("."),a=((s=e.completion)==null?void 0:s.label)||e.value||e.path[e.path.length-1]||"unknown",o=`<div class="sql-hover-${e.semanticType}">`;switch(o+=`<div class="sql-hover-header"><strong>${a}</strong> <span class="sql-hover-type">${e.semanticType}</span></div>`,e.semanticType){case"database":if(o+=`<div class="sql-hover-description">Database${(c=e.completion)!=null&&c.detail?`: ${e.completion.detail}`:""}</div>`,e.namespace){let S=Xl(e.namespace);S>0&&(o+=`<div class="sql-hover-children">Contains ${S} schema${S===1?"":"s"}</div>`)}break;case"schema":if(o+=`<div class="sql-hover-description">Schema${(h=e.completion)!=null&&h.detail?`: ${e.completion.detail}`:""}</div>`,n&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let S=Xl(e.namespace);S>0&&(o+=`<div class="sql-hover-children">Contains ${S} table${S===1?"":"s"}</div>`)}break;case"table":if(o+=`<div class="sql-hover-description">Table${(p=e.completion)!=null&&p.detail?`: ${e.completion.detail}`:""}</div>`,n){let S=e.path;S.length>1&&(o+=`<div class="sql-hover-path"><strong>Schema:</strong> <code>${S.slice(0,-1).join(".")}</code></div>`)}if(e.namespace&&lr(e.namespace)){let S=e.namespace;if(S.length>0){o+=`<div class="sql-hover-columns"><strong>Columns (${S.length}):</strong><br>`;let C=S.slice(0,8).map(E=>typeof E=="string"?E:E.label);o+=C.map(E=>`<code>${E}</code>`).join(", "),S.length>8&&(o+=`, <em>and ${S.length-8} more...</em>`),o+="</div>"}}break;case"column":if(o+=`<div class="sql-hover-description">Column${(g=e.completion)!=null&&g.detail?`: ${e.completion.detail}`:""}</div>`,n){let S=e.path;S.length>1&&(o+=`<div class="sql-hover-path"><strong>Table:</strong> <code>${S.slice(0,-1).join(".")}</code></div>`)}break;default:if(o+=`<div class="sql-hover-description">Namespace${(b=e.completion)!=null&&b.detail?`: ${e.completion.detail}`:""}</div>`,n&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let S=Xl(e.namespace);S>0&&(o+=`<div class="sql-hover-children">Contains ${S} item${S===1?"":"s"}</div>`)}break}return(_=e.completion)!=null&&_.info&&typeof e.completion.info=="string"&&(o+=`<div class="sql-hover-info">${e.completion.info}</div>`),o+="</div>",o}function Xl(e){return Array.isArray(e)?e.length:typeof e=="object"&&e?"self"in e&&"children"in e?1+Xl(e.children):Object.keys(e).length:0}function _1(e){let{keyword:n,info:a}=e,o='<div class="sql-hover-keyword">';if(o+=`<div class="sql-hover-header"><strong>${n.toUpperCase()}</strong> <span class="sql-hover-type">keyword</span></div>`,o+=`<div class="sql-hover-description">${a.description}</div>`,a.syntax&&(o+=`<div class="sql-hover-syntax"><strong>Syntax:</strong> <code>${a.syntax}</code></div>`),a.example&&(o+=`<div class="sql-hover-example"><strong>Example:</strong><br><code>${a.example}</code></div>`),a.metadata&&typeof a.metadata=="object"&&Object.keys(a.metadata).length>0){o+='<div class="sql-hover-metadata">';for(let[s,c]of Object.entries(a.metadata))o+=`<span class="sql-hover-tag" title="${s}">${c}</span> `;o+="</div>"}return o+="</div>",o}function b3(e){let{tableName:n,columns:a,metadata:o}=e,s='<div class="sql-hover-table">';if(s+=`<div class="sql-hover-header"><strong>${n}</strong> <span class="sql-hover-type">table</span></div>`,s+=`<div class="sql-hover-description">Table with ${a.length} column${a.length===1?"":"s"}</div>`,a.length>0){s+='<div class="sql-hover-columns"><strong>Columns:</strong><br>';let c=a.slice(0,10);s+=c.map(h=>`<code>${h}</code>`).join(", "),a.length>10&&(s+=`, <em>and ${a.length-10} more...</em>`),s+="</div>"}if(o&&typeof o=="object"&&Object.keys(o).length>0){s+='<div class="sql-hover-metadata">';for(let[c,h]of Object.entries(o))s+=`<span class="sql-hover-tag" title="${c}">${h}</span> `;s+="</div>"}return s+="</div>",s}function w3(e){let{tableName:n,columnName:a,schema:o,metadata:s}=e,c='<div class="sql-hover-column">';c+=`<div class="sql-hover-header"><strong>${a}</strong> <span class="sql-hover-type">column</span></div>`,c+=`<div class="sql-hover-description">Column in table <code>${n}</code></div>`;let h=o[n];if(h&&h.length>1){let p=h.filter(g=>g!==a);if(p.length>0){c+=`<div class="sql-hover-related"><strong>Other columns in ${n}:</strong><br>`;let g=p.slice(0,8);c+=g.map(b=>`<code>${b}</code>`).join(", "),p.length>8&&(c+=`, <em>and ${p.length-8} more...</em>`),c+="</div>"}}if(s&&typeof s=="object"&&Object.keys(s).length>0){c+='<div class="sql-hover-metadata">';for(let[p,g]of Object.entries(s))c+=`<span class="sql-hover-tag" title="${p}">${g}</span> `;c+="</div>"}return c+="</div>",c}const _3={keyword:_1,table:b3,column:w3,namespace:w1},x1=(e="light")=>{let n=e==="dark"?{tooltipBg:"#1f2937",tooltipBorder:"#374151",tooltipText:"#f9fafb",tooltipTypeBg:"#374151",tooltipTypeText:"#9ca3af",tooltipChildren:"#9ca3af",codeBg:"#374151",codeText:"#f3f4f6",strong:"#ffffff",em:"#9ca3af",header:"#ffffff",info:"#d1d5db",related:"#d1d5db",path:"#d1d5db",example:"#d1d5db",columns:"#d1d5db",syntax:"#d1d5db"}:{tooltipBg:"#ffffff",tooltipBorder:"#e5e7eb",tooltipText:"#374151",tooltipTypeBg:"#f3f4f6",tooltipTypeText:"#6b7280",tooltipChildren:"#6b7280",codeBg:"#f9fafb",codeText:"#1f2937",strong:"#111827",em:"#6b7280",header:"#111827",info:"#374151",related:"#374151",path:"#374151",example:"#374151",columns:"#374151",syntax:"#374151"};return Et.theme({".cm-sql-hover-tooltip":{padding:"8px 12px",backgroundColor:n.tooltipBg,border:`1px solid ${n.tooltipBorder}`,borderRadius:"6px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",fontSize:"13px",lineHeight:"1.4",maxWidth:"320px",fontFamily:"system-ui, -apple-system, sans-serif",color:n.tooltipText},".cm-sql-hover-tooltip .sql-hover-header":{marginBottom:"6px",display:"flex",alignItems:"center",gap:"6px",color:n.header},".cm-sql-hover-tooltip .sql-hover-type":{fontSize:"11px",padding:"2px 6px",backgroundColor:n.tooltipTypeBg,color:n.tooltipTypeText,borderRadius:"4px",fontWeight:"500"},".cm-sql-hover-tooltip .sql-hover-description":{color:n.info,marginBottom:"8px"},".cm-sql-hover-tooltip .sql-hover-syntax":{marginBottom:"8px",color:n.syntax},".cm-sql-hover-tooltip .sql-hover-example":{marginBottom:"4px",color:n.example},".cm-sql-hover-tooltip .sql-hover-columns":{marginBottom:"4px",color:n.columns},".cm-sql-hover-tooltip .sql-hover-related":{marginBottom:"4px",color:n.related},".cm-sql-hover-tooltip .sql-hover-path":{marginBottom:"4px",color:n.path},".cm-sql-hover-tooltip .sql-hover-info":{marginBottom:"4px",color:n.info},".cm-sql-hover-tooltip .sql-hover-children":{marginBottom:"4px",color:n.tooltipChildren,fontSize:"12px"},".cm-sql-hover-tooltip code":{backgroundColor:n.codeBg,padding:"1px 4px",borderRadius:"3px",fontSize:"12px",fontFamily:"ui-monospace, 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace",color:n.codeText},".cm-sql-hover-tooltip strong":{fontWeight:"600",color:n.strong},".cm-sql-hover-tooltip em":{fontStyle:"italic",color:n.em}})};var x3=class{constructor(e){ve(this,"parser");ve(this,"cache",new Map);ve(this,"MAX_CACHE_SIZE",10);this.parser=e}async analyzeDocument(e){let n=e.doc.toString(),a=this.generateCacheKey(n),o=this.cache.get(a);if(o)return o;let s=await this.extractStatements(n,e);if(this.cache.set(a,s),this.cache.size>this.MAX_CACHE_SIZE){let c=this.cache.keys().next().value;c!==void 0&&this.cache.delete(c)}return s}async getStatementAtPosition(e,n){return(await this.analyzeDocument(e)).find(a=>n>=a.from&&n<=a.to)||null}async getStatementsInRange(e,n,a){return(await this.analyzeDocument(e)).filter(o=>o.from<=a&&o.to>=n)}async extractStatements(e,n){let a=[],o=this.splitByStatementSeparators(e),s=0;for(let c of o){let h=c.trim();if(h.length===0){s+=c.length;continue}let p=s+c.indexOf(h),g=p+h.length,b=n.doc.lineAt(p),_=n.doc.lineAt(g),S=this.stripComments(h);if(S.trim().length===0||S.trim()===";"){s+=c.length;continue}let C=await this.parser.parse(S,{state:n}),E=this.determineStatementType(S),O=S.endsWith(";")?S.slice(0,-1).trim():S.trim();a.push({from:p,to:g,lineFrom:b.number,lineTo:_.number,content:O,type:E,isValid:C.success}),s+=c.length}return a}splitByStatementSeparators(e){let n=[],a="",o=!1,s="",c=!1,h=!1,p=0;for(;p<e.length;){let g=e[p],b=e[p+1];if(!o&&!h&&g==="-"&&b==="-"){c=!0,a+=g+b,p+=2;continue}if(!o&&!c&&g==="/"&&b==="*"){h=!0,a+=g+b,p+=2;continue}if(h&&g==="*"&&b==="/"){h=!1,a+=g+b,p+=2;continue}if(c&&(g===`
112
112
  `||g==="\r")){c=!1,a+=g,p++;continue}if(c||h){a+=g,p++;continue}if(!o&&(g==="'"||g==='"'||g==="`"))o=!0,s=g,a+=g;else if(o&&g===s){if(b===s){a+=g+b,p+=2;continue}o=!1,s="",a+=g}else!o&&g===";"?(a+=g,n.push(a),a=""):a+=g;p++}return a.trim()&&n.push(a),n}determineStatementType(e){let n=e.trim().toLowerCase();return n.startsWith("select")?"select":n.startsWith("insert")?"insert":n.startsWith("update")?"update":n.startsWith("delete")?"delete":n.startsWith("create")?"create":n.startsWith("drop")?"drop":n.startsWith("alter")?"alter":n.startsWith("use")?"use":"other"}stripComments(e){let n="",a=!1,o="",s=!1,c=!1,h=0;for(;h<e.length;){let p=e[h],g=e[h+1];if(!a&&!c&&p==="-"&&g==="-"){s=!0,h+=2;continue}if(!a&&!s&&p==="/"&&g==="*"){c=!0,h+=2;continue}if(c&&p==="*"&&g==="/"){c=!1,h+=2;continue}if(s&&(p===`
113
- `||p==="\r")){s=!1,n+=p,h++;continue}if(s||c){h++;continue}if(!a&&(p==="'"||p==='"'||p==="`"))a=!0,o=p,n+=p;else if(a&&p===o){if(g===o){n+=p+g,h+=2;continue}a=!1,o="",n+=p}else n+=p;h++}return n}generateCacheKey(e){let n=0;for(let a=0;a<e.length;a++){let o=e.charCodeAt(a);n=(n<<5)-n+o,n&=n}return n.toString()}clearCache(){this.cache.clear()}},k1=aa.define(),S1=Zo.define({create(){return{currentStatement:null,allStatements:[],cursorPosition:0,isFocused:!0}},update(e,n){for(let a of n.effects)if(a.is(k1))return a.value;return e}}),x3=class extends R5{constructor(n,a,o=!0,s=!0){super();ve(this,"config");ve(this,"isCurrent");ve(this,"isValid");ve(this,"isFocused");this.config=n,this.isCurrent=a,this.isValid=o,this.isFocused=s}toDOM(){let n=document.createElement("div");n.className="cm-sql-gutter-marker";let a=this.config.backgroundColor||"#3b82f6";!this.isValid&&this.config.showInvalid!==!1&&(a=this.config.errorBackgroundColor||"#ef4444");let o;return o=this.isFocused?this.isCurrent?"1":(this.config.inactiveOpacity||"0.3").toString():this.config.unfocusedOpacity===void 0?this.config.hideWhenNotFocused?"0":this.isCurrent?"1":(this.config.inactiveOpacity||"0.3").toString():this.config.unfocusedOpacity.toString(),n.style.cssText=`
113
+ `||p==="\r")){s=!1,n+=p,h++;continue}if(s||c){h++;continue}if(!a&&(p==="'"||p==='"'||p==="`"))a=!0,o=p,n+=p;else if(a&&p===o){if(g===o){n+=p+g,h+=2;continue}a=!1,o="",n+=p}else n+=p;h++}return n}generateCacheKey(e){let n=0;for(let a=0;a<e.length;a++){let o=e.charCodeAt(a);n=(n<<5)-n+o,n&=n}return n.toString()}clearCache(){this.cache.clear()}},k1=aa.define(),S1=Zo.define({create(){return{currentStatement:null,allStatements:[],cursorPosition:0,isFocused:!0}},update(e,n){for(let a of n.effects)if(a.is(k1))return a.value;return e}}),k3=class extends M5{constructor(n,a,o=!0,s=!0){super();ve(this,"config");ve(this,"isCurrent");ve(this,"isValid");ve(this,"isFocused");this.config=n,this.isCurrent=a,this.isValid=o,this.isFocused=s}toDOM(){let n=document.createElement("div");n.className="cm-sql-gutter-marker";let a=this.config.backgroundColor||"#3b82f6";!this.isValid&&this.config.showInvalid!==!1&&(a=this.config.errorBackgroundColor||"#ef4444");let o;return o=this.isFocused?this.isCurrent?"1":(this.config.inactiveOpacity||"0.3").toString():this.config.unfocusedOpacity===void 0?this.config.hideWhenNotFocused?"0":this.isCurrent?"1":(this.config.inactiveOpacity||"0.3").toString():this.config.unfocusedOpacity.toString(),n.style.cssText=`
114
114
  background: ${a};
115
115
  height: 100%;
116
116
  width: 100%;
117
117
  opacity: ${o};
118
118
  transition: opacity 150ms ease-in-out;
119
119
  border-radius: 1px;
120
- `,n}eq(n){return this.isCurrent===n.isCurrent&&this.isValid===n.isValid&&this.isFocused===n.isFocused&&this.config===n.config}};function k3(e,n){var p;let a=x5.empty;if((p=n.whenHide)!=null&&p.call(n,e))return a;let o=e.state.field(S1,!1);if(!o)return a;let{currentStatement:s,allStatements:c,isFocused:h}=o;try{for(let g of c){let b=(s==null?void 0:s.from)===g.from&&(s==null?void 0:s.to)===g.to;if(!g.isValid&&n.showInvalid===!1)continue;let _=new x3(n,b,g.isValid,h);for(let S=g.lineFrom;S<=g.lineTo;S++)try{if(S<1||S>e.state.doc.lines)continue;let C=e.state.doc.line(S);a=a.update({add:[_.range(C.from)]})}catch(C){console.warn("SqlGutter: Invalid line number",S,C)}}}catch(g){console.warn("SqlGutter: Error creating markers",g)}return a}function S3(e){return Et.updateListener.of(async n=>{if(!n.docChanged&&!n.selectionSet&&!n.focusChanged)return;let{state:a}=n.view,{main:o}=a.selection,s=o.head,c=await e.analyzeDocument(a),h={currentStatement:await e.getStatementAtPosition(a,s),allStatements:c,cursorPosition:s,isFocused:n.view.hasFocus};n.view.dispatch({effects:k1.of(h)})})}function C3(e){let n=e.width||3;return Et.baseTheme({".cm-sql-gutter":{width:`${n}px`,minWidth:`${n}px`},".cm-sql-gutter .cm-gutterElement":{width:`${n}px`,padding:"0",margin:"0"},".cm-sql-gutter-marker":{width:"100%",height:"100%",display:"block"},".cm-lineNumbers .cm-gutterElement":{paddingLeft:"8px",paddingRight:"8px"}})}function E3(e){return T5({class:`cm-sql-gutter ${e.className||""}`,markers:n=>k3(n,e)})}function T3(e={}){return[S1,S3(new _3(e.parser||new Gl)),C3(e),E3(e)]}function L3(e={}){let n=[],{enableLinting:a=!0,enableGutterMarkers:o=!0,enableHover:s=!0,linterConfig:c,gutterConfig:h,hoverConfig:p}=e;return a&&n.push(h3(c)),o&&n.push(T3(h)),s&&(n.push(y3(p)),p!=null&&p.theme?n.push(p.theme):n.push(x1())),n}var O3=class Y_{static jsonStringifySortKeys(){return n=>typeof n!="object"||!n?String(n):JSON.stringify(n,Object.keys(n).sort(),2)}constructor(n,a={}){this.delegate=n,this.toKey=a.toKey??Y_.jsonStringifySortKeys(),this.cache=new zl(a.maxSize??128)}request(n){let a=this.toKey(n),o=this.cache.get(a);if(o!==void 0)return o;let s=this.delegate.request(n);return this.cache.set(a,s),s.catch(c=>{throw this.cache.delete(a),c})}resolve(n,a){this.delegate.resolve(n,a)}reject(n,a){this.delegate.reject(n,a)}};G_=new Ou("sql-table-preview",async(e,n)=>{await oa().previewSQLTable({requestId:e,...n})}),sw=new Ou("sql-table-list-preview",async(e,n)=>{await oa().previewSQLTableList({requestId:e,...n})}),am=new O3(new Ou("validate-sql",async(e,n)=>{await oa().validateSQL({requestId:e,...n})}),{maxSize:3});var A3=Zn();let si;si=Ce(new Map),Aw=e=>{let n=(0,A3.c)(3),a=mn(si),o;return n[0]!==e||n[1]!==a?(o=a.get(e),n[0]=e,n[1]=a,n[2]=o):o=n[2],o};function Zd(e){let n=Fe.get(si),a=new Map(n);a.delete(e),Fe.set(si,a)}function I3(){Fe.set(si,new Map)}function R3({cellId:e,errorMessage:n,dialect:a}){let o=Fe.get(si),s=new Map(o),c=a==="DuckDB"?M3(n):C1(n);s.set(e,c),Fe.set(si,s)}function M3(e){let{errorType:n,errorMessage:a}=C1(e),o=a,s,c=a.indexOf("LINE ");return c!==-1&&(s=a.slice(Math.max(0,c)).trim(),o=a.slice(0,Math.max(0,c)).trim()),{errorType:n,errorMessage:o,codeblock:s}}function C1(e){return{errorType:e.split(":")[0].trim(),errorMessage:e.split(":").slice(1).join(":").trim()}}function E1(e){return e.field(Ir)}function P3(){return e=>{let n=E1(e.state).engine,a=ai.getCompletionSource(n);return a&&sT(a)(e)||null}}function N3(){return e=>{let n=E1(e.state).engine,a=ai.getDialect(n);return e.matchBefore(/\.\w*/)?null:pT(a,!0,(o,s)=>({label:o,type:s,info:async()=>{let c=(await D3())[o.toLocaleLowerCase()];if(!c)return null;let h=document.createElement("div");return h.innerHTML=w3.keyword({keyword:o,info:c}),h}}))(e)}}var D3=vr(async()=>{let e=await re(()=>import("./common-keywords-Bf68gXm2.js").then(async a=>(await a.__tla,a)),[],import.meta.url),n=await re(()=>import("./duckdb-keywords-BWKLsQSd.js").then(async a=>(await a.__tla,a)),[],import.meta.url);return{...e.default.keywords,...n.default.keywords}}),j3=Zn(),T1=Al("marimo:notebook-sql-mode","default",td);function z3(){let e=(0,j3.c)(3),[n,a]=C2(T1),o;return e[0]!==a||e[1]!==n?(o={sqlMode:n,setSQLMode:a},e[0]=a,e[1]=n,e[2]=o):o=e[2],o}function L1(){return Fe.get(T1)}var q3=Z0,B3="DuckDB",O1=new Tu;function ef(){return Fe.get($i).latestEngineSelected}let A1;Bu=(ff=class{constructor(){ve(this,"parser",new Nu);ve(this,"type","sql");this.sqlModeEnabled=!0}get defaultMetadata(){return{...this.parser.defaultMetadata,engine:ef()||"__marimo_duckdb"}}get defaultCode(){let e=ef();return e&&e!=="__marimo_duckdb"?`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`:this.parser.defaultCode}transformIn(e){this.parser.defaultMetadata.engine=ef()||"__marimo_duckdb";let n=this.parser.transformIn(e),a=n.metadata;return a.engine&&a.engine!=="__marimo_duckdb"&&ng(a.engine),[n.code,n.offset,a]}transformOut(e,n){let a=this.parser.transformOut(e,n);return[a.code,a.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,a,o,s){var h;let c=[O1.of(Z2({dialect:q3})),Ka.of([{key:"Tab",run:p=>tT(p)||z5(p),preventDefault:!0}]),Lu({defaultKeymap:!1,activateOnTyping:!0,override:[P3(),xC,N3()]})];if(((h=s==null?void 0:s.diagnostics)==null?void 0:h.sql_linter)??!1){let p=Fe.get(kT),g=new A1({getParserOptions:b=>({database:R1(b)??B3})});c.push(L3({enableLinting:!0,linterConfig:{delay:250,parser:g},enableGutterMarkers:!0,gutterConfig:{backgroundColor:"#3b82f6",errorBackgroundColor:"#ef4444",hideWhenNotFocused:!0,parser:g},hoverConfig:{schema:H3,hoverTime:300,enableKeywords:!0,enableTables:!0,enableColumns:!0,parser:g,theme:x1(p)}}),Et.updateListener.of(b=>{b.focusChanged&&g.setFocusState(b.view.hasFocus)}))}return this.sqlModeEnabled&&c.push(W3()),c}},ve(ff,"fromQuery",e=>Nu.fromQuery(e)),ff),A1=class extends Gl{constructor(){super(...arguments);ve(this,"validationTimeout",null);ve(this,"VALIDATION_DELAY_MS",300);ve(this,"isFocused",!1)}setFocusState(n){this.isFocused=n}async validateWithDelay(n,a,o){return this.validationTimeout&&window.clearTimeout(this.validationTimeout),new Promise(s=>{this.validationTimeout=window.setTimeout(async()=>{var c;if(!this.isFocused){s([]);return}try{let h=await P1(n,a,o,L1());if(h.error){be.error("Failed to validate SQL",{error:h.error}),s([]);return}s(((c=h.parse_result)==null?void 0:c.errors)??[])}catch(h){be.error("Failed to validate SQL",{error:h}),s([])}},this.VALIDATION_DELAY_MS)})}async validateSql(n,a){let o=lo(a.state);if(!this.isFocused)return[];if(!Fi.has(o.engine))return super.validateSql(n,a);let s=R1(a.state);return this.validateWithDelay(n,o.engine,s)}async parse(n,a){return lo(a.state).engine==="__marimo_duckdb"?{success:!0,errors:[]}:super.parse(n,a)}};function I1(e,n){e.dispatch({effects:O1.reconfigure(Z2({dialect:n}))})}function F3(e,n){I1(e,ai.getDialect(n))}function V3(e){let n=lo(e.state).engine;I1(e,ai.getDialect(n))}function lo(e){return e.field(Ir)}function H3(e){let n=lo(e.state).engine,a=ai.getCompletionSource(n);return a!=null&&a.schema?a.schema:{}}function R1(e){let n=lo(e).engine;return M1(n)}function M1(e){var a;let n=(a=ai.getInternalDialect(e))==null?void 0:a.toLowerCase();if(!n||!jl(n))return null;switch(n){case"postgresql":case"postgres":return"PostgreSQL";case"db2":case"db2i":return"DB2";case"mysql":return"MySQL";case"sqlite":return"Sqlite";case"mssql":case"sqlserver":case"microsoft sql server":return"TransactSQL";case"duckdb":return"DuckDB";case"mariadb":return"MariaDB";case"cassandra":return"Noql";case"athena":case"awsathena":return"Athena";case"bigquery":return"BigQuery";case"hive":return"Hive";case"redshift":return"Redshift";case"snowflake":return"Snowflake";case"flink":return"FlinkSQL";case"mongodb":case"noql":return"Noql";case"oracle":case"oracledb":case"timescaledb":case"couchbase":case"trino":case"tidb":case"singlestoredb":case"spark":case"databricks":case"datafusion":return be.debug("Unsupported dialect",{dialect:n}),null;default:return Xo(n),null}}var $3=300;function W3(){return ts.define(e=>{let n,a=null,o=e.state.facet(sa);return{update(s){if(!s.docChanged)return;let c=L1();if(c==="default")return;let h=lo(s.state).engine;if(!Fi.has(h))return;let p=s.state.doc.toString();n&&window.clearTimeout(n),n=window.setTimeout(async()=>{if(a!==p){if(a=p,p===""){Zd(o);return}try{let g=M1(h),b=(await P1(p,h,g,c)).validate_result;b!=null&&b.error_message?R3({cellId:o,errorMessage:b.error_message,dialect:g}):Zd(o)}catch(g){be.error("Failed to validate SQL",{error:g})}}},$3)},destroy(){n&&window.clearTimeout(n),Zd(o)}}})}async function P1(e,n,a,o){let s=await am.request({onlyParse:o==="default",engine:n,dialect:a,query:e});if(s.error)throw Error(s.error);return s}var U3=vr(()=>new o3),K3=vr(()=>new Pu),Q3=vr(()=>new Bu);Fn={get python(){return U3()},get markdown(){return K3()},get sql(){return Q3()}};function G3(){return Object.values(Fn)}var gt=gh(ku(),1),Yl="Checkbox",[J3,qT]=ST(Yl),[X3,tf]=J3(Yl);function Y3(e){let{__scopeCheckbox:n,checked:a,children:o,defaultChecked:s,disabled:c,form:h,name:p,onCheckedChange:g,required:b,value:_="on",internal_do_not_use_render:S}=e,[C,E]=CT({prop:a,defaultProp:s??!1,onChange:g,caller:Yl}),[O,M]=gt.useState(null),[V,H]=gt.useState(null),$=gt.useRef(!1),N=O?!!h||!!O.closest("form"):!0,ne={checked:C,disabled:c,setChecked:E,control:O,setControl:M,name:p,form:h,value:_,hasConsumerStoppedPropagationRef:$,required:b,defaultChecked:ga(s)?!1:s,isFormControl:N,bubbleInput:V,setBubbleInput:H};return(0,z.jsx)(X3,{scope:n,...ne,children:Z3(S)?S(ne):o})}var N1="CheckboxTrigger",D1=gt.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:a,...o},s)=>{let{control:c,value:h,disabled:p,checked:g,required:b,setControl:_,setChecked:S,hasConsumerStoppedPropagationRef:C,isFormControl:E,bubbleInput:O}=tf(N1,e),M=I2(s,_),V=gt.useRef(g);return gt.useEffect(()=>{let H=c==null?void 0:c.form;if(H){let $=()=>S(V.current);return H.addEventListener("reset",$),()=>H.removeEventListener("reset",$)}},[c,S]),(0,z.jsx)(Oh.button,{type:"button",role:"checkbox","aria-checked":ga(g)?"mixed":g,"aria-required":b,"data-state":F1(g),"data-disabled":p?"":void 0,disabled:p,value:h,...o,ref:M,onKeyDown:nw(n,H=>{H.key==="Enter"&&H.preventDefault()}),onClick:nw(a,H=>{S($=>ga($)?!0:!$),O&&E&&(C.current=H.isPropagationStopped(),C.current||H.stopPropagation())})})});D1.displayName=N1;var nf=gt.forwardRef((e,n)=>{let{__scopeCheckbox:a,name:o,checked:s,defaultChecked:c,required:h,disabled:p,value:g,onCheckedChange:b,form:_,...S}=e;return(0,z.jsx)(Y3,{__scopeCheckbox:a,checked:s,defaultChecked:c,disabled:p,required:h,onCheckedChange:b,name:o,form:_,value:g,internal_do_not_use_render:({isFormControl:C})=>(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(D1,{...S,ref:n,__scopeCheckbox:a}),C&&(0,z.jsx)(B1,{__scopeCheckbox:a})]})})});nf.displayName=Yl;var j1="CheckboxIndicator",z1=gt.forwardRef((e,n)=>{let{__scopeCheckbox:a,forceMount:o,...s}=e,c=tf(j1,a);return(0,z.jsx)(ET,{present:o||ga(c.checked)||c.checked===!0,children:(0,z.jsx)(Oh.span,{"data-state":F1(c.checked),"data-disabled":c.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})});z1.displayName=j1;var q1="CheckboxBubbleInput",B1=gt.forwardRef(({__scopeCheckbox:e,...n},a)=>{let{control:o,hasConsumerStoppedPropagationRef:s,checked:c,defaultChecked:h,required:p,disabled:g,name:b,value:_,form:S,bubbleInput:C,setBubbleInput:E}=tf(q1,e),O=I2(a,E),M=OT(c),V=PT(o);gt.useEffect(()=>{let $=C;if(!$)return;let N=window.HTMLInputElement.prototype,ne=Object.getOwnPropertyDescriptor(N,"checked").set,fe=!s.current;if(M!==c&&ne){let R=new Event("click",{bubbles:fe});$.indeterminate=ga(c),ne.call($,ga(c)?!1:c),$.dispatchEvent(R)}},[C,M,c,s]);let H=gt.useRef(ga(c)?!1:c);return(0,z.jsx)(Oh.input,{type:"checkbox","aria-hidden":!0,defaultChecked:h??H.current,required:p,disabled:g,name:b,value:_,form:S,...n,tabIndex:-1,ref:O,style:{...n.style,...V,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});B1.displayName=q1;function Z3(e){return typeof e=="function"}function ga(e){return e==="indeterminate"}function F1(e){return ga(e)?"indeterminate":e?"checked":"unchecked"}let V1;V1=Zn(),xl=gt.forwardRef((e,n)=>{let a=(0,V1.c)(10),o,s;a[0]===e?(o=a[1],s=a[2]):({className:o,...s}=e,a[0]=e,a[1]=o,a[2]=s);let c;a[3]===o?c=a[4]:(c=Su("flex items-center justify-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",o),a[3]=o,a[4]=c);let h;a[5]===Symbol.for("react.memo_cache_sentinel")?(h=(0,z.jsx)(z1,{className:Su("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),children:(0,z.jsx)(hT,{className:"h-4 w-4"})}),a[5]=h):h=a[5];let p;return a[6]!==s||a[7]!==n||a[8]!==c?(p=(0,z.jsx)(nf,{ref:n,className:c,...s,children:h}),a[6]=s,a[7]=n,a[8]=c,a[9]=p):p=a[9],p}),xl.displayName=nf.displayName,ow="_";var eE=new Set("__*.marimo.app.False.None.True.__peg_parser__.and.as.assert.async.await.break.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.nonlocal.not.or.pass.raise.return.try.while.with.yield.None.setup".split("."));Xh=function(e,n=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,"_"),n?e.toLowerCase():e):"_"},ww=function(e,n){let a=new Set(n),o=e,s=h=>!a.has(h)&&!eE.has(h);if(s(e))return e;let c=1;for(;!s(o);)o=`${e}_${c}`,c++;return o},d_=function(e,n){return Gh(e)?`cell-${n}`:e},Gh=function(e){return e?e==="_"||e==="__":!0};var tE=Zn();function nE(e){let n=(0,tE.c)(15),{minWidth:a,padding:o}=e,s=a===void 0?70:a,c=o===void 0?15:o,[h,p]=(0,gt.useState)(50),g=(0,gt.useRef)(null),b=(0,gt.useRef)(null),_;n[0]===c?_=n[1]:(_=R=>{if(b.current&&g.current){let j=b.current;j.style.fontSize=window.getComputedStyle(g.current).fontSize,j.style.fontFamily=window.getComputedStyle(g.current).fontFamily,j.textContent=R;let F=j.offsetWidth;p(F+c)}},n[0]=c,n[1]=_);let S=_,C;n[2]===S?C=n[3]:(C=()=>{var R;S(((R=g.current)==null?void 0:R.value)??"")},n[2]=S,n[3]=C),d5(C);let E;n[4]===S?E=n[5]:(E=R=>{S(R.target.value)},n[4]=S,n[5]=E);let O=`${h}px`,M=`${s}px`,V;n[6]!==O||n[7]!==M?(V={width:O,minWidth:M},n[6]=O,n[7]=M,n[8]=V):V=n[8];let H;n[9]!==E||n[10]!==V?(H={ref:g,type:"text",onChange:E,style:V},n[9]=E,n[10]=V,n[11]=H):H=n[11];let $=H,N;n[12]===Symbol.for("react.memo_cache_sentinel")?(N={ref:b,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},n[12]=N):N=n[12];let ne=N,fe;return n[13]===$?fe=n[14]:(fe={inputProps:$,spanProps:ne},n[13]=$,n[14]=fe),fe}var rE=Zn();function aE({currentQuotePrefix:e,checked:n,prefix:a}){let o=e;return n?e===""?o=a:e!=="rf"&&a!==e&&(o="rf"):e===a?o="":e==="rf"&&(o=a==="r"?"f":"r"),o}let H1;H1=()=>{let e=(0,rE.c)(2),n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,z.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,z.jsxs)("header",{className:"flex items-center gap-1",children:[(0,z.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"r"}),(0,z.jsx)("span",{className:"font-semibold",children:"Raw String"})]}),(0,z.jsx)("p",{className:"text-sm text-muted-foreground",children:"Write LaTeX without escaping special characters"}),(0,z.jsx)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:"\\alpha \\beta"})]}),e[0]=n):n=e[0];let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=(0,z.jsxs)("div",{className:"flex flex-col gap-3.5",children:[n,(0,z.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,z.jsxs)("header",{className:"flex items-center gap-1",children:[(0,z.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"f"}),(0,z.jsx)("span",{className:"font-semibold",children:"Format String"})]}),(0,z.jsx)("p",{className:"text-sm text-muted-foreground",children:"Interpolate Python values"}),(0,z.jsxs)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:["Hello ","{name}","! \u{1F601}"]})]})]}),e[1]=a):a=e[1],a},Bh="data-cell-id",Cw=function(e){return{[Bh]:e}},zh="data-for-cell-id",nd=function(e){return{[zh]:e}};var iE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClickHouse%3c/title%3e%3cpath%20d='M21.333%2010H24v4h-2.667ZM16%201.335h2.667v21.33H16Zm-5.333%200h2.666v21.33h-2.666ZM0%2022.665V1.335h2.667v21.33zm5.333-21.33H8v21.33H5.333Z'/%3e%3c/svg%3e",oE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDatabricks%3c/title%3e%3cpath%20d='M.95%2014.184L12%2020.403l9.919-5.55v2.21L12%2022.662l-10.484-5.96-.565.308v.77L12%2024l11.05-6.218v-4.317l-.515-.309L12%2019.118l-9.867-5.653v-2.21L12%2016.805l11.05-6.218V6.32l-.515-.308L12%2011.974%202.647%206.681%2012%201.388l7.76%204.368.668-.411v-.566L12%200%20.95%206.27v.72L12%2013.207l9.919-5.55v2.26L12%2015.52%201.516%209.56l-.565.308Z'/%3e%3c/svg%3e",sE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAGcElEQVR4nNxZa2wcVxU+99557M6+vLazj6xjO6+maWVTl0YpLU1DU9KARNqooQhFVYJUqUWgiocqIVRESPlRoEhIqYoqgSiCItqQPkAEKUWQtlGSJtAY00R5mTjZTfze94x3HvdedMdZnKgS6s7O2kk/a7R3xvY933fOd874yhhucCyYAIWA9IOH2r+35/HUnjU96sBC8fAERQLpj0+mXjdeXM6rzy/no88uK6zolHu97EX8p/f/IWHAv38i9bsH+kIPo/ozhAJBgpR9J419je437xb62Zc7n/tcf+gRsebADYQAxLW2N/ApL/vNq4AdA7Ht2/piT4q15fAp1wEYAGEALYA18TzT1TXQ09O75qPuKbWS8NW4Lan27/pM4gWrBIgFnaIDvKZIpPPKt+nlgpMTi0q5PKqoqvZR950XAREZaz/fmHmFOFijwGHkDDu5PKGs1SlQ5gAAQ+S9U9Y/xM+Wy+WxRvaeFwE770z+OBNQbmYWwPlp63BPh3q7XQaCxAi50gP7Tldf87J3ywVszEQ2bumOf5WZAAajeWoDJjYOMM5BCECEw9miefxwduaol/1b2sQdCon/8BOZX3ETYWYiODFhvrNUC6ylFgJqzl27DxV+xD3GaGkFnl6deS4G8mJqAmRrtaGkoqxiJnazPpt9gPNVa3DvqfKrXmO0rAJ3RSLrHojHd4jMMwvBSMn+d1pSVrv37oXdz50Hx79JOXgtQGsqIAEiT8V7djtVzEiQ4w+K+t9uCmn3uNmX5rL/l8ullw5c1g80E6slFXgkuuixJVKw3y5jxEzExnV7pB3k7rr3hZDBiZl3njk+9u1mY/legSgm0cfiXbtcTziYHJmovNEXC99PZzAV41KMzaLtXGBVmaQltWfCdPLNxPNdwFdii58KYykhXM2AO5MGvTSAgw9aLnUx8zlomCxTKdeHdP14s/F8tdAiIie2RpPfAPcPNYAjRumNOwLRLZwL2rPgHAGnCF6aHPuJ5869Cr5WYFs0/S0ZkTDns9SK1BltI/JicYcEcXAX8L5R+vOblanf+hHTNwFtWGr7QiT9BAPklnWoVt5/qxrZILQI7wvyjHPrjKkfeL0y9QID76Pzavhmoa3RzNdkLMcYEKCA4aJtncjIgVs4oFnbCCGASDtRVrw3Uz7sV1xfBKiAlc2RJV+vkz9vWYMZWesTa1ER5vYEgot27YPvjJ/dXGBOwY+44JeAdaHkQxpRU9QVQGDIrPz1FjV+f/3eFcaRFcdKosicsh8x6/ClBzaEu7YLoqJNDUonVKR0UCTuRT9w9wshpAzb+qmcY2b9iFlH0xVow0r81sCiz9azfdCY3rNWSzw8a5/ZZ2ItPv9UmfiFP7Tn0HQFPhlMbuKIyOKkhThjNc4rBCtRJl5jrvO5W4mSY+beMib/4A/tOTQtYCCY2kTdszmHE7X8/tWBTtf7s7S528IYELxcuviMycWZzF80baHVgdT6/00fu3oso7Tdwa5Ypt7Aw5Zx7M1K7pf+UL4WTVWgQwqnQ5LWLexTpfblEFaT7Jrsc3GMLDw7+a9tFDj1j/YcmqpAWkn06yhERaYP6ZdeHtC6tl6deYPx4q7xY5+/YFfP+kf5WniqQELp6J6hNaNdia8s4TCojkmrjOYVHGin7qsLQdYqvb976uijk455yX/ac/AkYNLKZx9Nb/kNQkAsLJNBW9+/Uk3eJzI/ZlUG36qcfv6MXf3nmtjtO/ZO/v27/tOeA/L6iyu0pfdu7/riATF93s0fffq+toGdM5zmJ+ziuRgJpWSEgy/mXlk/Zk2f8ZfytfDcxOeM828XHH04TAIJjOTgDAlIiPNEmgQTw9Xh146UBn/aavLgVUAmkLk5IkdXFh09l62NHloaWblZjFGMONjMrsTUjqV5qzjuP90Pw9MUmrKms/2x276U0pbcO2Hlh9qUzj6GMJiclk/q5/b+Ovfqg+P29LD/dD+MhnsgSMLhnlDvPQVrOrcmfufjF2cuvI0BqVlj5GDBKmQZsJbMe9+BAZP1yU3fF+tloVV3LzSfhtEbXrWhO7Ri3ULz8PwmzoRXfTqr/+ddf+k0Dk8CEGBMOWccmC8H82bgSUAmfNO6S/q5Bc8+eBUQDXWtz1VP36gCMC4xnfPrZFw2/I9uLZi6u2aXs7ZdGWkNpcbQcAU0LX2XYYxeF/YBLwIYs0twndjnY4H/BgAA//95CrBYRwImwgAAAABJRU5ErkJggg==",lE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDuckDB%3c/title%3e%3cpath%20d='M12%200C5.363%200%200%205.363%200%2012s5.363%2012%2012%2012%2012-5.363%2012-12S18.637%200%2012%200zM9.502%207.03a4.974%204.974%200%200%201%204.97%204.97%204.974%204.974%200%200%201-4.97%204.97A4.974%204.974%200%200%201%204.532%2012a4.974%204.974%200%200%201%204.97-4.97zm6.563%203.183h2.351c.98%200%201.787.782%201.787%201.762s-.807%201.789-1.787%201.789h-2.351v-3.551z'/%3e%3c/svg%3e",cE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogle%20BigQuery%3c/title%3e%3cpath%20d='M5.676%2010.595h2.052v5.244a5.892%205.892%200%200%201-2.052-2.088v-3.156zm18.179%2010.836a.504.504%200%200%201%200%20.708l-1.716%201.716a.504.504%200%200%201-.708%200l-4.248-4.248a.206.206%200%200%201-.007-.007c-.02-.02-.028-.045-.043-.066a10.736%2010.736%200%200%201-6.334%202.065C4.835%2021.599%200%2016.764%200%2010.799S4.835%200%2010.8%200s10.799%204.835%2010.799%2010.8c0%202.369-.772%204.553-2.066%206.333.025.017.052.028.074.05l4.248%204.248zm-5.028-10.632a8.015%208.015%200%201%200-8.028%208.028h.024a8.016%208.016%200%200%200%208.004-8.028zm-4.86%204.98a6.002%206.002%200%200%200%202.04-2.184v-1.764h-2.04v3.948zm-4.5.948c.442.057.887.08%201.332.072.4.025.8.025%201.2%200V7.692H9.468v9.035z'/%3e%3c/svg%3e",uE=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,dE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMotherDuck%3c/title%3e%3cg%20transform='scale(0.85)%20translate(0,%202)'%3e%3cpath%20fill='%23ff9538'%20d='M1.71%2015.86s7.45%205.32%207.89%205.59c.44.27%201.08.33%201.64.11.56-.22.98-.71%201.11-1.21s1.85-9.49%201.85-9.49c.02-.12.07-.48-.13-.83-.27-.47-.86-.71-1.38-.57-.42.12-.64.44-.7.55-.09.17-.26.45-.57.7-.24.19-.47.3-.58.34-.96.38-2.02.06-2.61-.72-.38-.48-1.04-.67-1.64-.43-.6.24-.94.84-.89%201.45.11.98-.44%201.94-1.4%202.32-.51.21-1.06.21-1.54.05-.12-.03-.51-.12-.89.09-.48.26-.74.84-.61%201.37.09.39.38.62.48.69z'%20/%3e%3cpath%20fill='%23ff9538'%20d='M14.12%204.21s2.65%208.76%202.83%209.24c.19.48.66.92%201.23%201.09.58.16%201.21.03%201.62-.28.41-.31%207.25-6.39%207.25-6.39.09-.08.35-.34.4-.74.07-.53-.25-1.09-.75-1.29-.4-.16-.78-.04-.89%200-.18.08-.48.2-.88.2-.3.01-.55-.05-.67-.08-.99-.28-1.64-1.18-1.63-2.16-.01-.61-.42-1.17-1.04-1.35-.62-.18-1.26.09-1.59.6-.51.84-1.53%201.27-2.52.99-.53-.15-.96-.48-1.25-.91-.07-.09-.33-.4-.76-.48-.54-.09-1.1.22-1.32.71-.16.37-.08.72-.04.84z'%20/%3e%3c/g%3e%3c/svg%3e",fE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMySQL%3c/title%3e%3cpath%20d='M16.405%205.501c-.115%200-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77%2018.695h-.927a50.854%2050.854%200%2000-.27-4.41h-.008l-1.41%204.41H2.45l-1.4-4.41h-.01a72.892%2072.892%200%2000-.195%204.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335%204.064h.008l1.347-4.064h1.095c.242%202.015.384%203.86.428%205.53zm4.017-4.08c-.378%202.045-.876%203.533-1.492%204.46-.482.716-1.01%201.073-1.583%201.073-.153%200-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268%200%20.483-.075.647-.222.197-.18.295-.382.295-.605%200-.155-.077-.47-.23-.944L6.23%2014.615h.91l.727%202.36c.164.536.233.91.205%201.123.4-1.064.678-2.227.835-3.483zm12.325%204.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253%200-1.83-.718-2.746-2.155-2.746-.704%200-1.254.232-1.65.697-.43.508-.646%201.256-.646%202.245%200%20.972.19%201.686.574%202.14.35.41.877.615%201.583.615.264%200%20.506-.033.725-.098l1.325.772.36-.622zM15.5%2017.588c-.225-.36-.337-.94-.337-1.736%200-1.393.424-2.09%201.27-2.09.443%200%20.77.167.977.5.224.362.336.936.336%201.723%200%201.404-.424%202.108-1.27%202.108-.445%200-.77-.167-.978-.5zm-1.658-.425c0%20.47-.172.856-.516%201.156-.344.3-.803.45-1.384.45-.543%200-1.064-.172-1.573-.515l.237-.476c.438.22.833.328%201.19.328.332%200%20.593-.073.783-.22a.754.754%200%2000.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177%200-.45.157-.81.47-1.085.315-.278.72-.415%201.22-.415.512%200%20.98.136%201.4.41l-.213.476a2.726%202.726%200%2000-1.064-.23c-.283%200-.502.068-.654.206a.685.685%200%2000-.248.524c0%20.328.234.61.666.85.393.215%201.187.67%201.187.67.433.305.648.63.648%201.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223%203.223%200%2000-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867%208.867%200%2000-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69%2017.69%200%2001-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422%201.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146%201.693.194%202.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445%203.445%200%2001-.35-.4%208.76%208.76%200%2001-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188%201.01-.027.007-.014%200-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478%202.478%200%2001-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953%205.953%200%20012.085%202.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z'/%3e%3c/svg%3e",$1=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,pE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAmazon%20Redshift%3c/title%3e%3cpath%20d='M16.639%209.932a.822.822%200%200%201-.822-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.823.82m-2.086%204.994a.823.823%200%200%201-.822-.822.822.822%200%200%201%201.645%200%20.822.822%200%200%201-.823.822m-5.004-.833a.822.822%200%201%201%20.002-1.644.822.822%200%200%201-.002%201.644m-2.083%204.578a.823.823%200%200%201-.823-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.822.82m9.173-11.236a1.68%201.68%200%200%200-1.68%201.676c0%20.566.285%201.066.718%201.37l-.782%201.982a1.674%201.674%200%200%200-1.923%201.104l-1.753-.398a1.675%201.675%200%200%200-3.348.103c0%20.432.169.823.438%201.12l-.764%201.79c-.028-.001-.053-.008-.08-.008a1.68%201.68%200%200%200-1.68%201.676%201.68%201.68%200%200%200%203.36%200c0-.593-.312-1.112-.778-1.41l.674-1.579c.161.052.33.088.508.088.661%200%201.228-.386%201.502-.94l1.856.42a1.68%201.68%200%200%200%203.327-.325c0-.5-.224-.943-.574-1.25l.822-2.083c.053.005.104.016.157.016a1.68%201.68%200%200%200%201.68-1.676%201.68%201.68%200%200%200-1.68-1.676M12%2023.145c-4.17%200-7.286-1.252-7.286-2.37V4.79C6.14%205.938%209.131%206.547%2012%206.547c2.869%200%205.86-.609%207.286-1.756v15.983c0%201.12-3.116%202.37-7.286%202.37M12%20.856c4.293%200%207.286%201.274%207.286%202.419%200%201.143-2.993%202.418-7.286%202.418-4.293%200-7.286-1.275-7.286-2.418C4.714%202.129%207.707.855%2012%20.855m8.143%202.419C20.143%201.147%2015.947%200%2012%200%208.052%200%203.857%201.147%203.857%203.274l.002.01h-.002v17.49C3.857%2022.87%208.052%2024%2012%2024c3.947%200%208.143-1.13%208.143-3.226V3.284h-.002l.002-.01'/%3e%3c/svg%3e",hE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSnowflake%3c/title%3e%3cpath%20d='M24%203.459c0%20.646-.418%201.18-1.141%201.18-.723%200-1.142-.534-1.142-1.18%200-.647.419-1.18%201.142-1.18.723%200%201.141.533%201.141%201.18zm-.228%200c0-.533-.38-.951-.913-.951s-.913.38-.913.95c0%20.533.38.952.913.952.57%200%20.913-.419.913-.951zm-1.37-.533h.495c.266%200%20.456.152.456.38%200%20.153-.076.229-.19.305l.19.266v.038h-.266l-.19-.266h-.229v.266h-.266zm.495.228h-.229v.267h.229c.114%200%20.152-.038.152-.114.038-.077-.038-.153-.152-.153zM7.602%2012.4c.038-.151.076-.304.076-.456%200-.114-.038-.228-.038-.342-.114-.343-.304-.647-.646-.838l-4.87-2.777c-.685-.38-1.56-.152-1.94.533-.381.685-.153%201.56.532%201.94l2.701%201.56-2.701%201.56c-.685.38-.913%201.256-.533%201.94.38.685%201.256.914%201.94.533l4.832-2.777c.343-.267.571-.533.647-.876zm1.332%202.626c-.266-.038-.57.038-.837.19l-4.832%202.777c-.685.38-.913%201.256-.532%201.94.38.686%201.255.914%201.94.533l2.701-1.56v3.12c0%20.8.647%201.408%201.446%201.408.799%200%201.407-.647%201.407-1.408v-5.592c0-.761-.57-1.37-1.293-1.408zm4.946-6.088c.266.038.57-.038.837-.19l4.832-2.777c.685-.38.913-1.256.532-1.94-.38-.686-1.255-.914-1.94-.533l-2.701%201.56V1.975c0-.799-.647-1.408-1.446-1.408-.799%200-1.446.609-1.446%201.408V7.53c0%20.76.609%201.37%201.332%201.407zM3.265%205.97l4.832%202.777c.266.152.533.19.837.19.723-.038%201.331-.684%201.331-1.407V1.975c0-.799-.646-1.408-1.407-1.408-.799%200-1.446.647-1.446%201.408v3.12l-2.701-1.56c-.685-.38-1.56-.152-1.94.533-.419.646-.19%201.521.494%201.902zm9.093%206.011a.412.412%200%2000-.114-.266l-.57-.571a.346.346%200%2000-.267-.114.412.412%200%2000-.266.114l-.571.57a.411.411%200%2000-.114.267c0%20.076.038.19.114.267l.57.57a.345.345%200%2000.267.114c.076%200%20.19-.038.266-.114l.571-.57a.412.412%200%2000.114-.267zm1.598.533L11.94%2014.53c-.039.038-.153.114-.229.114h-.608a.411.411%200%2001-.267-.114L8.82%2012.514a.408.408%200%2001-.076-.229v-.608c0-.076.038-.19.114-.267l2.016-2.016a.41.41%200%2001.267-.114h.608a.41.41%200%2001.267.114l2.016%202.016a.347.347%200%2001.114.267v.608c-.076.077-.114.19-.19.229zm5.593%205.44l-4.832-2.777c-.266-.152-.57-.19-.837-.152-.723.038-1.332.684-1.332%201.408v5.554c0%20.8.647%201.408%201.408%201.408.799%200%201.446-.647%201.446-1.408v-3.12l2.7%201.56c.686.38%201.561.152%201.941-.533.419-.646.19-1.521-.494-1.94zm2.549-7.533l-2.701%201.56%202.7%201.56c.686.38.914%201.256.533%201.94-.38.685-1.255.913-1.94.533l-4.832-2.778a1.644%201.644%200%2001-.647-.798c-.037-.153-.076-.305-.076-.457%200-.114.039-.228.039-.342.114-.343.342-.647.646-.837l4.832-2.778c.685-.38%201.56-.152%201.94.533.457.609.19%201.484-.494%201.864'/%3e%3c/svg%3e",mE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eApache%20Spark%3c/title%3e%3cpath%20d='M10.812%200c-.425.013-.845.215-1.196.605a3.593%203.593%200%2000-.493.722c-.355.667-.425%201.415-.556%202.143a551.9%20551.9%200%2000-.726%204.087c-.027.16-.096.227-.244.273C5.83%208.386%204.06%208.94%202.3%209.514c-.387.125-.773.289-1.114.506-1.042.665-1.196%201.753-.415%202.71.346.422.79.715%201.284.936%201.1.49%202.202.976%203.3%201.47.019.01.036.013.053.019h-.004l1.306.535c0%20.023.002.045%200%20.073-.2%202.03-.39%204.063-.58%206.095-.04.419-.012.831.134%201.23.317.87%201.065%201.148%201.881.701.372-.204.666-.497.937-.818%201.372-1.623%202.746-3.244%204.113-4.872.111-.133.205-.15.363-.098.349.117.697.231%201.045.347h.001c.02.012.045.02.073.03l.142.042c1.248.416%202.68.775%203.929%201.19.4.132.622.164%201.045.098.311-.048.592-.062.828-.236.602-.33.995-.957.988-1.682-.005-.427-.154-.813-.35-1.186-.82-1.556-1.637-3.113-2.461-4.666-.078-.148-.076-.243.037-.375%201.381-1.615%202.756-3.236%204.133-4.855.272-.32.513-.658.653-1.058.308-.878-.09-1.57-1-1.741a2.783%202.783%200%2000-1.235.069c-1.974.521-3.947%201.041-5.918%201.57-.175.047-.26.015-.355-.144a353.08%20353.08%200%2000-2.421-4.018%204.61%204.61%200%2000-.652-.849c-.371-.37-.802-.549-1.227-.536zm.172%203.703a.592.592%200%2001.189.211c.87%201.446%201.742%202.89%202.609%204.338.07.118.135.16.277.121%201.525-.41%203.052-.813%204.579-1.217.367-.098.735-.193%201.103-.289a.399.399%200%2001-.1.2c-1.259%201.48-2.516%202.962-3.779%204.438-.11.13-.12.22-.04.37.937%201.803%201.768%203.309%202.498%204.76l-3.696-1.019c-.538-.18-1.077-.358-1.615-.539-.163-.055-.25-.03-.36.1-1.248%201.488-2.504%202.97-3.759%204.454a.398.398%200%2001-.18.132c.035-.378.068-.757.104-1.136.149-1.572.297-3.144.451-4.716-.03-.318.117-.405-.322-.545-1.493-.593-3.346-1.321-4.816-1.905a.595.595%200%2001.24-.134c1.797-.57%203.595-1.14%205.394-1.705.127-.04.199-.092.211-.233.013-.148.05-.294.076-.441.241-1.363.483-2.726.726-4.088.068-.386.14-.771.21-1.157z'/%3e%3c/svg%3e",gE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSQLite%3c/title%3e%3cpath%20d='M21.678.521c-1.032-.92-2.28-.55-3.513.544a8.71%208.71%200%200%200-.547.535c-2.109%202.237-4.066%206.38-4.674%209.544.237.48.422%201.093.544%201.561a13.044%2013.044%200%200%201%20.164.703s-.019-.071-.096-.296l-.05-.146a1.689%201.689%200%200%200-.033-.08c-.138-.32-.518-.995-.686-1.289-.143.423-.27.818-.376%201.176.484.884.778%202.4.778%202.4s-.025-.099-.147-.442c-.107-.303-.644-1.244-.772-1.464-.217.804-.304%201.346-.226%201.478.152.256.296.698.422%201.186.286%201.1.485%202.44.485%202.44l.017.224a22.41%2022.41%200%200%200%20.056%202.748c.095%201.146.273%202.13.5%202.657l.155-.084c-.334-1.038-.47-2.399-.41-3.967.09-2.398.642-5.29%201.661-8.304%201.723-4.55%204.113-8.201%206.3-9.945-1.993%201.8-4.692%207.63-5.5%209.788-.904%202.416-1.545%204.684-1.931%206.857.666-2.037%202.821-2.912%202.821-2.912s1.057-1.304%202.292-3.166c-.74.169-1.955.458-2.362.629-.6.251-.762.337-.762.337s1.945-1.184%203.613-1.72C21.695%207.9%2024.195%202.767%2021.678.521m-18.573.543A1.842%201.842%200%200%200%201.27%202.9v16.608a1.84%201.84%200%200%200%201.835%201.834h9.418a22.953%2022.953%200%200%201-.052-2.707c-.006-.062-.011-.141-.016-.2a27.01%2027.01%200%200%200-.473-2.378c-.121-.47-.275-.898-.369-1.057-.116-.197-.098-.31-.097-.432%200-.12.015-.245.037-.386a9.98%209.98%200%200%201%20.234-1.045l.217-.028c-.017-.035-.014-.065-.031-.097l-.041-.381a32.8%2032.8%200%200%201%20.382-1.194l.2-.019c-.008-.016-.01-.038-.018-.053l-.043-.316c.63-3.28%202.587-7.443%204.8-9.791.066-.069.133-.128.198-.194Z'/%3e%3c/svg%3e",yE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSupabase%3c/title%3e%3cpath%20d='M11.9%201.036c-.015-.986-1.26-1.41-1.874-.637L.764%2012.05C-.33%2013.427.65%2015.455%202.409%2015.455h9.579l.113%207.51c.014.985%201.259%201.408%201.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z'/%3e%3c/svg%3e",vE="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3c!--%20Generated%20by%20Pixelmator%20Pro%203.6.17%20--%3e%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Option2SymbolB'%3e%3cg%20id='Layer1-2'%3e%3cg%20id='Group'%20opacity='0.4'%3e%3cpath%20id='Path'%20fill='%23d53c97'%20stroke='none'%20d='M%2017.016802%2012.188573%20C%2017.016802%209.607646%2015.86018%207.293022%2014.039526%205.731081%20C%2013.942595%205.70038%2013.844628%205.671406%2013.745972%205.645189%20C%2013.131133%205.809095%2012.54265%206.059378%2011.998103%206.388559%20C%2013.964327%207.575191%2015.281006%209.730104%2015.281006%2012.188573%20C%2015.279476%2014.563734%2014.033739%2016.764488%2011.998103%2017.988243%20C%2012.542634%2018.317537%2013.131119%2018.567936%2013.745972%2018.731958%20C%2013.844628%2018.705742%2013.942595%2018.67642%2014.039526%2018.645721%20C%2015.86018%2017.084126%2017.016802%2014.769501%2017.016802%2012.188573%20Z'/%3e%3cpath%20id='path1'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.897406%205.609659%20L%2013.894991%205.60759%20C%2013.844973%205.619663%2013.7953%205.631737%2013.745972%205.645189%20C%2013.79599%205.631737%2013.847043%205.622078%2013.897406%205.609659%20Z'/%3e%3cpath%20id='path2'%20fill='%23d53c97'%20stroke='none'%20d='M%201.735796%2012.188573%20C%201.735796%209.164728%203.728925%206.59622%206.470945%205.729357%20C%207.554634%204.797861%208.856011%204.155121%2010.254373%203.860756%20C%209.680216%203.740549%209.095179%203.679977%208.508574%203.68%20C%203.816888%203.68%20-0%207.496887%20-0%2012.188573%20C%20-0%2016.880259%203.816888%2020.697147%208.508574%2020.697147%20C%209.0952%2020.697229%209.680255%2020.636539%2010.254373%2020.516048%20C%208.855971%2020.221794%207.554568%2019.579041%206.470945%2018.647446%20C%203.728925%2017.780582%201.735796%2015.213453%201.735796%2012.188573%20Z'/%3e%3cpath%20id='path3'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.745972%2018.731958%20C%2013.7953%2018.745068%2013.844973%2018.757484%2013.894991%2018.769558%20C%2013.894991%2018.769558%2013.896715%2018.769558%2013.897406%2018.767488%20C%2013.847043%2018.754379%2013.79599%2018.745411%2013.745972%2018.731958%20Z'/%3e%3c/g%3e%3cpath%20id='path4'%20fill='%23ff3b65'%20stroke='none'%20d='M%2020.508402%2012.188573%20C%2020.508402%209.606611%2019.351088%207.290262%2017.5294%205.729357%20C%2016.301817%205.342468%2014.989366%205.313629%2013.745972%205.646223%20C%2016.636665%206.418224%2018.772606%209.058484%2018.772606%2012.189609%20C%2018.772606%2015.320732%2016.636665%2017.960991%2013.745972%2018.731958%20C%2014.98947%2019.064316%2016.301983%2019.034998%2017.5294%2018.647446%20C%2019.419907%2017.034296%2020.508638%2014.673781%2020.508402%2012.188573%20Z'/%3e%3cpath%20id='path5'%20fill='%23ff3b65'%20stroke='none'%20d='M%209.962543%2018.647446%20C%207.220525%2017.780582%205.227395%2015.213453%205.227395%2012.188573%20C%205.227395%209.163693%207.220525%206.59622%209.962543%205.729357%20C%2011.046233%204.797861%2012.34761%204.155121%2013.745972%203.860756%20C%2013.171818%203.74053%2012.586779%203.679956%2012.000173%203.68%20C%207.308832%203.68%203.491599%207.496887%203.491599%2012.188573%20C%203.491599%2016.880259%207.308487%2020.697147%2012.000173%2020.697147%20C%2012.586799%2020.697247%2013.171857%2020.636557%2013.745972%2020.516048%20C%2012.34757%2020.221794%2011.046167%2019.579041%209.962543%2018.647446%20Z'/%3e%3cpath%20id='path6'%20fill='%23383838'%20stroke='none'%20d='M%2015.491772%203.68%20C%2010.800431%203.68%206.983198%207.496887%206.983198%2012.188573%20C%206.983198%2016.880259%2010.800086%2020.697147%2015.491772%2020.697147%20C%2020.183456%2020.697147%2024%2016.880259%2024%2012.188573%20C%2024%207.496887%2020.183456%203.68%2015.491772%203.68%20Z%20M%2022.264549%2012.188573%20C%2022.264549%2015.923018%2019.226215%2018.961351%2015.491772%2018.961351%20C%2011.757326%2018.961351%208.718994%2015.923018%208.718994%2012.188573%20C%208.718994%208.454128%2011.757326%205.415796%2015.491772%205.415796%20C%2019.226215%205.415796%2022.264549%208.454128%2022.264549%2012.188573%20Z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",bE=""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,wE=Zn(),_E={sqlite:gE,duckdb:lE,motherduck:dE,postgres:$1,postgresql:$1,mysql:fE,snowflake:hE,databricks:oE,clickhouse:iE,timeplus:vE,bigquery:cE,trino:bE,iceberg:uE,datafusion:sE,pyspark:mE,redshift:pE,supabase:yE};nm=e=>{let n=(0,wE.c)(11),{name:a,className:o}=e,s=_E[a.toLowerCase()];if(!s){let p;n[0]===o?p=n[1]:(p=Su("mt-0.5",o),n[0]=o,n[1]=p);let g;return n[2]===p?g=n[3]:(g=(0,z.jsx)(rs,{className:p}),n[2]=p,n[3]=g),g}let c;n[4]!==o||n[5]!==s?(c=Su("invert-[.5] dark:invert-[.7]",o,s.endsWith(".png")&&"brightness-100 dark:brightness-100 invert-0 dark:invert-0"),n[4]=o,n[5]=s,n[6]=c):c=n[6];let h;return n[7]!==a||n[8]!==c||n[9]!==s?(h=(0,z.jsx)("img",{src:s,alt:a,className:c}),n[7]=a,n[8]=c,n[9]=s,n[10]=h):h=n[10],h};var rf=Zn();const xE=e=>{let n=(0,rf.c)(34),{selectedEngine:a,onChange:o,cellId:s}=e,c=mn(Yu),h=[],p=[];for(let[Qe,pe]of c.entries())Fi.has(Qe)?h.push(pe):p.push(pe);let g=rT(),b=a&&!c.has(a),_;n[0]!==c||n[1]!==o||n[2]!==g?(_=Qe=>{if(Qe===W1){window.open(U1,"_blank");return}let pe=c.get(Qe);pe&&(g(),o(pe.name),ng(pe.name))},n[0]=c,n[1]=o,n[2]=g,n[3]=_):_=n[3];let S=_,C=TE,E=MT,O;n[4]===s?O=n[5]:(O=nd(s),n[4]=s,n[5]=O);let M;n[6]===Symbol.for("react.memo_cache_sentinel")?(M=(0,z.jsx)(LT,{placeholder:"Select an engine"}),n[6]=M):M=n[6];let V;n[7]===O?V=n[8]:(V=(0,z.jsx)(SE,{...O,children:M}),n[7]=O,n[8]=V);let H=AT,$;n[9]===s?$=n[10]:($=nd(s),n[9]=s,n[10]=$);let N=IT,ne;n[11]===Symbol.for("react.memo_cache_sentinel")?(ne=(0,z.jsx)(TT,{children:"Database connections"}),n[11]=ne):ne=n[11];let fe;n[12]!==b||n[13]!==a?(fe=b&&(0,z.jsx)(Ah,{value:a,children:(0,z.jsxs)("div",{className:"flex items-center gap-1 opacity-50",children:[(0,z.jsx)(Em,{className:"h-3 w-3"}),(0,z.jsx)("span",{className:"truncate",children:sg(a)})]})},a),n[12]=b,n[13]=a,n[14]=fe):fe=n[14];let R=C(p),j=p.length>0&&(0,z.jsx)(rw,{}),F=C(h),se;n[15]===Symbol.for("react.memo_cache_sentinel")?(se=(0,z.jsx)(rw,{}),n[15]=se):se=n[15];let ce;n[16]===Symbol.for("react.memo_cache_sentinel")?(ce=(0,z.jsx)(Ah,{className:"text-muted-foreground",value:W1,children:(0,z.jsxs)("a",{className:"flex items-center gap-1",href:U1,target:"_blank",rel:"noreferrer",children:[(0,z.jsx)(gT,{className:"h-3 w-3"}),(0,z.jsx)("span",{children:"How to add a database connection"})]})}),n[16]=ce):ce=n[16];let he;n[17]!==N||n[18]!==j||n[19]!==F||n[20]!==ne||n[21]!==fe||n[22]!==R?(he=(0,z.jsxs)(N,{children:[ne,fe,R,j,F,se,ce]}),n[17]=N,n[18]=j,n[19]=F,n[20]=ne,n[21]=fe,n[22]=R,n[23]=he):he=n[23];let ye;n[24]!==H||n[25]!==he||n[26]!==$?(ye=(0,z.jsx)(H,{...$,children:he}),n[24]=H,n[25]=he,n[26]=$,n[27]=ye):ye=n[27];let xe;return n[28]!==E||n[29]!==S||n[30]!==a||n[31]!==ye||n[32]!==V?(xe=(0,z.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,z.jsxs)(E,{value:a,onValueChange:S,children:[V,ye]})}),n[28]=E,n[29]=S,n[30]=a,n[31]=ye,n[32]=V,n[33]=xe):xe=n[33],xe};var W1="__help__",U1="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";const kE=()=>{let e=(0,rf.c)(16),{sqlMode:n,setSQLMode:a}=z3(),o;e[0]!==a||e[1]!==n?(o=()=>{let E=n==="validate"?"default":"validate";E==="default"&&I3(),a(E)},e[0]=a,e[1]=n,e[2]=o):o=e[2];let s=o,c=LE,h=OE,p;e[3]===n?p=e[4]:(p=h(n),e[3]=n,e[4]=p);let g;e[5]===n?g=e[6]:(g=c(n),e[5]=n,e[6]=g);let b=n==="validate"?"Validate":"Default",_;e[7]===b?_=e[8]:(_=(0,z.jsx)("span",{className:"ml-1",children:b}),e[7]=b,e[8]=_);let S;e[9]!==s||e[10]!==g||e[11]!==_?(S=(0,z.jsxs)(P2,{variant:"ghost",size:"sm",onClick:s,className:"h-5 px-1.5 text-xs border-border shadow-none hover:bg-accent",children:[g,_]}),e[9]=s,e[10]=g,e[11]=_,e[12]=S):S=e[12];let C;return e[13]!==p||e[14]!==S?(C=(0,z.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,z.jsx)(Ih,{delayDuration:300,content:p,children:S})}),e[13]=p,e[14]=S,e[15]=C):C=e[15],C};var SE=e=>{let n=(0,rf.c)(6),a,o;n[0]===e?(a=n[1],o=n[2]):({children:a,...o}=e,n[0]=e,n[1]=a,n[2]=o);let s;return n[3]!==a||n[4]!==o?(s=(0,z.jsx)(RT,{className:"text-xs border-border shadow-none! ring-0! h-5 px-1.5 hover:bg-accent transition-colors",...o,children:a}),n[3]=a,n[4]=o,n[5]=s):s=n[5],s};function CE(e){return e.source!=="iceberg"}function EE(e){return(0,z.jsx)(Ah,{value:e.name,children:(0,z.jsxs)("div",{className:"flex items-center gap-1",children:[(0,z.jsx)(nm,{className:"h-3 w-3",name:e.dialect}),(0,z.jsx)("span",{className:"truncate ml-0.5",children:sg(e.display_name)})]})},e.name)}function TE(e){return e=e.filter(CE),e.map(EE)}function LE(e){return e==="validate"?(0,z.jsx)(Rd,{className:"h-3 w-3"}):(0,z.jsx)(Eh,{className:"h-3 w-3"})}function OE(e){return e==="validate"?(0,z.jsxs)("div",{className:"text-xs",children:[(0,z.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,z.jsx)(Rd,{className:"h-3 w-3"}),"Validate Mode"]}),(0,z.jsx)("p",{children:"Queries are validated as you write them"})]}):(0,z.jsxs)("div",{className:"text-xs",children:[(0,z.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,z.jsx)(Eh,{className:"h-3 w-3"}),"Default Mode"]}),(0,z.jsx)("p",{children:"Standard editing"})]})}var K1=Zn(),Q1=()=>{let e=(0,K1.c)(1),n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,z.jsx)("div",{className:"h-4 border-r border-border"}),e[0]=n):n=e[0],n};const AE=e=>{let n=(0,K1.c)(102),{view:a}=e,o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o={minWidth:50},n[0]=o):o=n[0];let{spanProps:s,inputProps:c}=nE(o),h;n[1]===a.state?h=n[2]:(h=a.state.field(rr),n[1]=a.state,n[2]=h);let p=h,g;n[3]===a.state?g=n[4]:(g=a.state.facet(sa),n[3]=a.state,n[4]=g);let b=g,_;n[5]===Symbol.for("react.memo_cache_sentinel")?(_=(0,z.jsx)("div",{}),n[5]=_):_=n[5];let S=_,C=!1,E;n[6]===a?E=n[7]:(E=H=>{a.dispatch({effects:ju.of(H),changes:{from:0,to:a.state.doc.length,insert:a.state.doc.toString()}})},n[6]=a,n[7]=E);let O=E;if(p instanceof Bu){let H;n[8]===a.state?H=n[9]:(H=a.state.field(Ir),n[8]=a.state,n[9]=H);let $=H;C=!0;let N;n[10]===O?N=n[11]:(N=Tt=>{let Mt=Xh(Tt.currentTarget.value,!1);Tt.currentTarget.value=Mt,O({dataframeName:Mt})},n[10]=O,n[11]=N);let ne=N,fe;n[12]!==O||n[13]!==a?(fe=Tt=>{O({engine:Tt}),F3(a,Tt)},n[12]=O,n[13]=a,n[14]=fe):fe=n[14];let R=fe,j;n[15]===Symbol.for("react.memo_cache_sentinel")?(j=(0,z.jsx)("span",{className:"select-none",children:"Output variable: "}),n[15]=j):j=n[15];let F;n[16]===c?F=n[17]:(F=Tt=>{var Mt;(Mt=c.onChange)==null||Mt.call(c,Tt)},n[16]=c,n[17]=F);let se;n[18]===ne?se=n[19]:(se=Tt=>{Tt.key==="Enter"&&Tt.shiftKey&&ne(Tt)},n[18]=ne,n[19]=se);let ce;n[20]!==c||n[21]!==$.dataframeName||n[22]!==ne||n[23]!==F||n[24]!==se?(ce=(0,z.jsx)("input",{...c,defaultValue:$.dataframeName,onChange:F,onBlur:ne,onKeyDown:se,className:"min-w-14 w-auto border border-border rounded px-1 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring"}),n[20]=c,n[21]=$.dataframeName,n[22]=ne,n[23]=F,n[24]=se,n[25]=ce):ce=n[25];let he;n[26]===s?he=n[27]:(he=(0,z.jsx)("span",{...s}),n[26]=s,n[27]=he);let ye;n[28]!==ce||n[29]!==he?(ye=(0,z.jsxs)("label",{className:"flex gap-2 items-center",children:[j,ce,he]}),n[28]=ce,n[29]=he,n[30]=ye):ye=n[30];let xe;n[31]!==b||n[32]!==$.engine||n[33]!==R?(xe=(0,z.jsx)(xE,{selectedEngine:$.engine,onChange:R,cellId:b}),n[31]=b,n[32]=$.engine,n[33]=R,n[34]=xe):xe=n[34];let Qe;n[35]===$.engine?Qe=n[36]:(Qe=$.engine==="__marimo_duckdb"&&(0,z.jsx)(kE,{}),n[35]=$.engine,n[36]=Qe);let pe;n[37]!==$.engine||n[38]!==a?(pe=async()=>{await Ck(a,$.engine)},n[37]=$.engine,n[38]=a,n[39]=pe):pe=n[39];let ie;n[40]===Symbol.for("react.memo_cache_sentinel")?(ie=(0,z.jsx)(Zh,{className:"h-3 w-3"}),n[40]=ie):ie=n[40];let ee;n[41]===pe?ee=n[42]:(ee=(0,z.jsx)(Ih,{content:"Format SQL",children:(0,z.jsx)(P2,{variant:"text",size:"icon",onClick:pe,children:ie})}),n[41]=pe,n[42]=ee);let U;n[43]===Symbol.for("react.memo_cache_sentinel")?(U=(0,z.jsx)(Q1,{}),n[43]=U):U=n[43];let Ae;n[44]===O?Ae=n[45]:(Ae=Tt=>{O({showOutput:!Tt.target.checked})},n[44]=O,n[45]=Ae);let Ve=!$.showOutput,nt;n[46]!==Ae||n[47]!==Ve?(nt=(0,z.jsx)("input",{type:"checkbox",onChange:Ae,checked:Ve}),n[46]=Ae,n[47]=Ve,n[48]=nt):nt=n[48];let He;n[49]===Symbol.for("react.memo_cache_sentinel")?(He=(0,z.jsx)("span",{className:"select-none",children:"Hide output"}),n[49]=He):He=n[49];let ze;n[50]===nt?ze=n[51]:(ze=(0,z.jsxs)("label",{className:"flex items-center gap-2",children:[nt,He]}),n[50]=nt,n[51]=ze);let Le;n[52]!==Qe||n[53]!==ee||n[54]!==ze?(Le=(0,z.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[Qe,ee,U,ze]}),n[52]=Qe,n[53]=ee,n[54]=ze,n[55]=Le):Le=n[55];let Re;n[56]!==ye||n[57]!==xe||n[58]!==Le?(Re=(0,z.jsxs)("div",{className:"flex flex-1 gap-2 items-center",children:[ye,xe,Le]}),n[56]=ye,n[57]=xe,n[58]=Le,n[59]=Re):Re=n[59],S=Re}if(p instanceof Pu){C=!0;let H,$,N,ne,fe,R,j,F,se,ce;if(n[60]!==O||n[61]!==a.state){let{quotePrefix:Ae}=a.state.field(Ir);$=Ae,$===void 0&&($="r",O({quotePrefix:$})),ce=(Ve,nt)=>{typeof nt=="boolean"&&O({quotePrefix:aE({currentQuotePrefix:$,checked:nt,prefix:Ve})})},ne="flex flex-row w-full justify-end gap-1.5 items-center",se="flex items-center gap-1.5",n[72]===Symbol.for("react.memo_cache_sentinel")?(N=(0,z.jsx)("span",{children:"r"}),n[72]=N):N=n[72],H=xl,R="Toggle raw string",j="w-3 h-3",F=$.includes("r"),fe=Ve=>{ce("r",Ve)},n[60]=O,n[61]=a.state,n[62]=H,n[63]=$,n[64]=N,n[65]=ne,n[66]=fe,n[67]=R,n[68]=j,n[69]=F,n[70]=se,n[71]=ce}else H=n[62],$=n[63],N=n[64],ne=n[65],fe=n[66],R=n[67],j=n[68],F=n[69],se=n[70],ce=n[71];let he;n[73]!==H||n[74]!==fe||n[75]!==R||n[76]!==j||n[77]!==F?(he=(0,z.jsx)(H,{"aria-label":R,className:j,checked:F,onCheckedChange:fe}),n[73]=H,n[74]=fe,n[75]=R,n[76]=j,n[77]=F,n[78]=he):he=n[78];let ye;n[79]!==N||n[80]!==he||n[81]!==se?(ye=(0,z.jsxs)("div",{className:se,children:[N,he]}),n[79]=N,n[80]=he,n[81]=se,n[82]=ye):ye=n[82];let xe;n[83]===Symbol.for("react.memo_cache_sentinel")?(xe=(0,z.jsx)("span",{children:"f"}),n[83]=xe):xe=n[83];let Qe;n[84]===$?Qe=n[85]:(Qe=$.includes("f"),n[84]=$,n[85]=Qe);let pe;n[86]===ce?pe=n[87]:(pe=Ae=>{ce("f",Ae)},n[86]=ce,n[87]=pe);let ie;n[88]!==Qe||n[89]!==pe?(ie=(0,z.jsxs)("div",{className:"flex items-center gap-1.5",children:[xe,(0,z.jsx)(xl,{"aria-label":"Toggle f-string",className:"w-3 h-3",checked:Qe,onCheckedChange:pe})]}),n[88]=Qe,n[89]=pe,n[90]=ie):ie=n[90];let ee;n[91]===Symbol.for("react.memo_cache_sentinel")?(ee=(0,z.jsx)(Ih,{content:(0,z.jsx)(H1,{}),children:(0,z.jsx)(ad,{className:"w-3 h-3"})}),n[91]=ee):ee=n[91];let U;n[92]!==ne||n[93]!==ye||n[94]!==ie?(U=(0,z.jsxs)("div",{className:ne,children:[ye,ie,ee]}),n[92]=ne,n[93]=ye,n[94]=ie,n[95]=U):U=n[95],S=U}let M;n[96]===C?M=n[97]:(M=C&&(0,z.jsx)(Q1,{}),n[96]=C,n[97]=M);let V;return n[98]!==S||n[99]!==p.type||n[100]!==M?(V=(0,z.jsx)(NT,{children:(0,z.jsxs)("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[S,M,p.type]})}),n[98]=S,n[99]=p.type,n[100]=M,n[101]=V):V=n[101],V};var af=new Tu;Iu=aa.define(),rr=Zo.define({create(){return Fn.python},update(e,n){for(let a of n.effects)if(a.is(Iu))return a.value;return e},provide:e=>bh.from(e,n=>n.type==="python"?null:a=>Lk(a,AE))});function IE(){let e=G3(),n=(a,o)=>{let s=e[o%e.length];return s.isSupported(a)?s:n(a,o+1)};return[Ka.of([{key:"F4",preventDefault:!0,run:a=>{let o=a.state.field(rr),s=e.findIndex(h=>h.type===o.type),c=n(a.state.doc.toString(),s+1);return o===c?!1:(G1({view:a,nextLanguage:c,opts:{keepCodeAsIs:!1}}),!0)}}])]}function G1({view:e,nextLanguage:n,opts:a}){let o=e.state.field(rr),s=e.state.doc.toString(),c=e.state.facet(Q0),h=e.state.facet(G0),p=e.state.facet(Ad),g=e.state.facet(Dl),b=e.state.facet(J0),_=e.state.field(Ir),S=e.state.selection.main.head,C;if(a.keepCodeAsIs)C=s,o.type!==n.type&&(_={...n.defaultMetadata});else{let[E,O]=o.transformOut(s,_),[M,V,H]=n.transformIn(E);S+=O,S-=V,S=xh(S,0,M.length),C=M,_=H}e.dispatch({effects:[Iu.of(n),od.of(_),af.reconfigure(n.getExtension(g,c,h,p,b)),Fu.reconfigure([]),us.of(!0)],changes:a.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:C},selection:a.keepCodeAsIs?void 0:$t.cursor(S)}),e.dispatch({effects:[Fu.reconfigure([q5()])]}),n.type==="sql"&&V3(e)}W_=function(e){let{placeholderType:n,completionConfig:a,hotkeys:o,cellId:s,lspConfig:c}=e;return[IE(),af.of(Fn.python.getExtension(s,a,o,n,c)),rr,Ir]},Kw=function(e){return RE(nr({state:e}).trim())};function RE(e){return e?Fn.markdown.isSupported(e)?Fn.markdown:Fn.sql.isSupported(e)?Fn.sql:Fn.python:Fn.python}Fm=function(e,n){e.state.field(rr).type!==n.language&&G1({view:e,nextLanguage:Fn[n.language],opts:{keepCodeAsIs:n.keepCodeAsIs??!1}})},Pw=function(e,{completionConfig:n,hotkeysProvider:a,lspConfig:o}){let s=e.state.field(rr),c=e.state.facet(Ad),h=e.state.facet(Dl);return h===void 0&&be.error("Cell ID is undefined in reconfigureLanguageEffect"),c===void 0&&be.error("Placeholder type is undefined in reconfigureLanguageEffect"),n===void 0&&be.error("Completion config is undefined in reconfigureLanguageEffect"),af.reconfigure(s.getExtension(h,n,a,c,o))},nr=function(e,n,a){let o=e.state.field(rr),s=e.state.field(Ir),c=e.state.doc.toString();return n===void 0?o.transformOut(c,s)[0]:o.transformOut(c.slice(n,a),s)[0]},Ki=function(e,n){let[a]=e.state.field(rr).transformIn(n);return Hu(e,a),a};function ME(e){let n=e.state.selection.main.head,a=e.state.doc.toString(),o=a.length>0&&a[n-1]===`
120
+ `,n}eq(n){return this.isCurrent===n.isCurrent&&this.isValid===n.isValid&&this.isFocused===n.isFocused&&this.config===n.config}};function S3(e,n){var p;let a=k5.empty;if((p=n.whenHide)!=null&&p.call(n,e))return a;let o=e.state.field(S1,!1);if(!o)return a;let{currentStatement:s,allStatements:c,isFocused:h}=o;try{for(let g of c){let b=(s==null?void 0:s.from)===g.from&&(s==null?void 0:s.to)===g.to;if(!g.isValid&&n.showInvalid===!1)continue;let _=new k3(n,b,g.isValid,h);for(let S=g.lineFrom;S<=g.lineTo;S++)try{if(S<1||S>e.state.doc.lines)continue;let C=e.state.doc.line(S);a=a.update({add:[_.range(C.from)]})}catch(C){console.warn("SqlGutter: Invalid line number",S,C)}}}catch(g){console.warn("SqlGutter: Error creating markers",g)}return a}function C3(e){return Et.updateListener.of(async n=>{if(!n.docChanged&&!n.selectionSet&&!n.focusChanged)return;let{state:a}=n.view,{main:o}=a.selection,s=o.head,c=await e.analyzeDocument(a),h={currentStatement:await e.getStatementAtPosition(a,s),allStatements:c,cursorPosition:s,isFocused:n.view.hasFocus};n.view.dispatch({effects:k1.of(h)})})}function E3(e){let n=e.width||3;return Et.baseTheme({".cm-sql-gutter":{width:`${n}px`,minWidth:`${n}px`},".cm-sql-gutter .cm-gutterElement":{width:`${n}px`,padding:"0",margin:"0"},".cm-sql-gutter-marker":{width:"100%",height:"100%",display:"block"},".cm-lineNumbers .cm-gutterElement":{paddingLeft:"8px",paddingRight:"8px"}})}function T3(e){return L5({class:`cm-sql-gutter ${e.className||""}`,markers:n=>S3(n,e)})}function L3(e={}){return[S1,C3(new x3(e.parser||new Gl)),E3(e),T3(e)]}function O3(e={}){let n=[],{enableLinting:a=!0,enableGutterMarkers:o=!0,enableHover:s=!0,linterConfig:c,gutterConfig:h,hoverConfig:p}=e;return a&&n.push(m3(c)),o&&n.push(L3(h)),s&&(n.push(v3(p)),p!=null&&p.theme?n.push(p.theme):n.push(x1())),n}var A3=class Z_{static jsonStringifySortKeys(){return n=>typeof n!="object"||!n?String(n):JSON.stringify(n,Object.keys(n).sort(),2)}constructor(n,a={}){this.delegate=n,this.toKey=a.toKey??Z_.jsonStringifySortKeys(),this.cache=new zl(a.maxSize??128)}request(n){let a=this.toKey(n),o=this.cache.get(a);if(o!==void 0)return o;let s=this.delegate.request(n);return this.cache.set(a,s),s.catch(c=>{throw this.cache.delete(a),c})}resolve(n,a){this.delegate.resolve(n,a)}reject(n,a){this.delegate.reject(n,a)}};J_=new Ou("sql-table-preview",async(e,n)=>{await oa().previewSQLTable({requestId:e,...n})}),sw=new Ou("sql-table-list-preview",async(e,n)=>{await oa().previewSQLTableList({requestId:e,...n})}),am=new A3(new Ou("validate-sql",async(e,n)=>{await oa().validateSQL({requestId:e,...n})}),{maxSize:3});var I3=Zn();let si;si=Ce(new Map),Ow=e=>{let n=(0,I3.c)(3),a=mn(si),o;return n[0]!==e||n[1]!==a?(o=a.get(e),n[0]=e,n[1]=a,n[2]=o):o=n[2],o};function Zd(e){let n=Fe.get(si),a=new Map(n);a.delete(e),Fe.set(si,a)}function R3(){Fe.set(si,new Map)}function M3({cellId:e,errorMessage:n,dialect:a}){let o=Fe.get(si),s=new Map(o),c=a==="DuckDB"?P3(n):C1(n);s.set(e,c),Fe.set(si,s)}function P3(e){let{errorType:n,errorMessage:a}=C1(e),o=a,s,c=a.indexOf("LINE ");return c!==-1&&(s=a.slice(Math.max(0,c)).trim(),o=a.slice(0,Math.max(0,c)).trim()),{errorType:n,errorMessage:o,codeblock:s}}function C1(e){return{errorType:e.split(":")[0].trim(),errorMessage:e.split(":").slice(1).join(":").trim()}}function E1(e){return e.field(Ir)}function N3(){return e=>{let n=E1(e.state).engine,a=ai.getCompletionSource(n);return a&&lT(a)(e)||null}}function D3(){return e=>{let n=E1(e.state).engine,a=ai.getDialect(n);return e.matchBefore(/\.\w*/)?null:hT(a,!0,(o,s)=>({label:o,type:s,info:async()=>{let c=(await j3())[o.toLocaleLowerCase()];if(!c)return null;let h=document.createElement("div");return h.innerHTML=_3.keyword({keyword:o,info:c}),h}}))(e)}}var j3=vr(async()=>{let e=await re(()=>import("./common-keywords-Bf68gXm2.js").then(async a=>(await a.__tla,a)),[],import.meta.url),n=await re(()=>import("./duckdb-keywords-BWKLsQSd.js").then(async a=>(await a.__tla,a)),[],import.meta.url);return{...e.default.keywords,...n.default.keywords}}),z3=Zn(),T1=Rl("marimo:notebook-sql-mode","default",ed);function q3(){let e=(0,z3.c)(3),[n,a]=C2(T1),o;return e[0]!==a||e[1]!==n?(o={sqlMode:n,setSQLMode:a},e[0]=a,e[1]=n,e[2]=o):o=e[2],o}function L1(){return Fe.get(T1)}var B3=Z0,F3="DuckDB",O1=new Tu;function ef(){return Fe.get($i).latestEngineSelected}let A1;Bu=(ff=class{constructor(){ve(this,"parser",new Nu);ve(this,"type","sql");this.sqlModeEnabled=!0}get defaultMetadata(){return{...this.parser.defaultMetadata,engine:ef()||"__marimo_duckdb"}}get defaultCode(){let e=ef();return e&&e!=="__marimo_duckdb"?`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`:this.parser.defaultCode}transformIn(e){this.parser.defaultMetadata.engine=ef()||"__marimo_duckdb";let n=this.parser.transformIn(e),a=n.metadata;return a.engine&&a.engine!=="__marimo_duckdb"&&ng(a.engine),[n.code,n.offset,a]}transformOut(e,n){let a=this.parser.transformOut(e,n);return[a.code,a.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,a,o,s){var h;let c=[O1.of(Z2({dialect:B3})),Ka.of([{key:"Tab",run:p=>nT(p)||q5(p),preventDefault:!0}]),Lu({defaultKeymap:!1,activateOnTyping:!0,override:[N3(),kC,D3()]})];if(((h=s==null?void 0:s.diagnostics)==null?void 0:h.sql_linter)??!1){let p=Fe.get(ST),g=new A1({getParserOptions:b=>({database:R1(b)??F3})});c.push(O3({enableLinting:!0,linterConfig:{delay:250,parser:g},enableGutterMarkers:!0,gutterConfig:{backgroundColor:"#3b82f6",errorBackgroundColor:"#ef4444",hideWhenNotFocused:!0,parser:g},hoverConfig:{schema:$3,hoverTime:300,enableKeywords:!0,enableTables:!0,enableColumns:!0,parser:g,theme:x1(p)}}),Et.updateListener.of(b=>{b.focusChanged&&g.setFocusState(b.view.hasFocus)}))}return this.sqlModeEnabled&&c.push(U3()),c}},ve(ff,"fromQuery",e=>Nu.fromQuery(e)),ff),A1=class extends Gl{constructor(){super(...arguments);ve(this,"validationTimeout",null);ve(this,"VALIDATION_DELAY_MS",300);ve(this,"isFocused",!1)}setFocusState(n){this.isFocused=n}async validateWithDelay(n,a,o){return this.validationTimeout&&window.clearTimeout(this.validationTimeout),new Promise(s=>{this.validationTimeout=window.setTimeout(async()=>{var c;if(!this.isFocused){s([]);return}try{let h=await P1(n,a,o,L1());if(h.error){be.error("Failed to validate SQL",{error:h.error}),s([]);return}s(((c=h.parse_result)==null?void 0:c.errors)??[])}catch(h){be.error("Failed to validate SQL",{error:h}),s([])}},this.VALIDATION_DELAY_MS)})}async validateSql(n,a){let o=lo(a.state);if(!this.isFocused)return[];if(!Fi.has(o.engine))return super.validateSql(n,a);let s=R1(a.state);return this.validateWithDelay(n,o.engine,s)}async parse(n,a){return lo(a.state).engine==="__marimo_duckdb"?{success:!0,errors:[]}:super.parse(n,a)}};function I1(e,n){e.dispatch({effects:O1.reconfigure(Z2({dialect:n}))})}function V3(e,n){I1(e,ai.getDialect(n))}function H3(e){let n=lo(e.state).engine;I1(e,ai.getDialect(n))}function lo(e){return e.field(Ir)}function $3(e){let n=lo(e.state).engine,a=ai.getCompletionSource(n);return a!=null&&a.schema?a.schema:{}}function R1(e){let n=lo(e).engine;return M1(n)}function M1(e){var a;let n=(a=ai.getInternalDialect(e))==null?void 0:a.toLowerCase();if(!n||!jl(n))return null;switch(n){case"postgresql":case"postgres":return"PostgreSQL";case"db2":case"db2i":return"DB2";case"mysql":return"MySQL";case"sqlite":return"Sqlite";case"mssql":case"sqlserver":case"microsoft sql server":return"TransactSQL";case"duckdb":return"DuckDB";case"mariadb":return"MariaDB";case"cassandra":return"Noql";case"athena":case"awsathena":return"Athena";case"bigquery":return"BigQuery";case"hive":return"Hive";case"redshift":return"Redshift";case"snowflake":return"Snowflake";case"flink":return"FlinkSQL";case"mongodb":case"noql":return"Noql";case"oracle":case"oracledb":case"timescaledb":case"couchbase":case"trino":case"tidb":case"singlestoredb":case"spark":case"databricks":case"datafusion":return be.debug("Unsupported dialect",{dialect:n}),null;default:return Xo(n),null}}var W3=300;function U3(){return ts.define(e=>{let n,a=null,o=e.state.facet(sa);return{update(s){if(!s.docChanged)return;let c=L1();if(c==="default")return;let h=lo(s.state).engine;if(!Fi.has(h))return;let p=s.state.doc.toString();n&&window.clearTimeout(n),n=window.setTimeout(async()=>{if(a!==p){if(a=p,p===""){Zd(o);return}try{let g=M1(h),b=(await P1(p,h,g,c)).validate_result;b!=null&&b.error_message?M3({cellId:o,errorMessage:b.error_message,dialect:g}):Zd(o)}catch(g){be.error("Failed to validate SQL",{error:g})}}},W3)},destroy(){n&&window.clearTimeout(n),Zd(o)}}})}async function P1(e,n,a,o){let s=await am.request({onlyParse:o==="default",engine:n,dialect:a,query:e});if(s.error)throw Error(s.error);return s}var K3=vr(()=>new s3),Q3=vr(()=>new Pu),G3=vr(()=>new Bu);Fn={get python(){return K3()},get markdown(){return Q3()},get sql(){return G3()}};function J3(){return Object.values(Fn)}var gt=gh(ku(),1),Yl="Checkbox",[X3,BT]=CT(Yl),[Y3,tf]=X3(Yl);function Z3(e){let{__scopeCheckbox:n,checked:a,children:o,defaultChecked:s,disabled:c,form:h,name:p,onCheckedChange:g,required:b,value:_="on",internal_do_not_use_render:S}=e,[C,E]=ET({prop:a,defaultProp:s??!1,onChange:g,caller:Yl}),[O,M]=gt.useState(null),[V,H]=gt.useState(null),$=gt.useRef(!1),N=O?!!h||!!O.closest("form"):!0,ne={checked:C,disabled:c,setChecked:E,control:O,setControl:M,name:p,form:h,value:_,hasConsumerStoppedPropagationRef:$,required:b,defaultChecked:ga(s)?!1:s,isFormControl:N,bubbleInput:V,setBubbleInput:H};return(0,z.jsx)(Y3,{scope:n,...ne,children:eE(S)?S(ne):o})}var N1="CheckboxTrigger",D1=gt.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:a,...o},s)=>{let{control:c,value:h,disabled:p,checked:g,required:b,setControl:_,setChecked:S,hasConsumerStoppedPropagationRef:C,isFormControl:E,bubbleInput:O}=tf(N1,e),M=I2(s,_),V=gt.useRef(g);return gt.useEffect(()=>{let H=c==null?void 0:c.form;if(H){let $=()=>S(V.current);return H.addEventListener("reset",$),()=>H.removeEventListener("reset",$)}},[c,S]),(0,z.jsx)(Oh.button,{type:"button",role:"checkbox","aria-checked":ga(g)?"mixed":g,"aria-required":b,"data-state":F1(g),"data-disabled":p?"":void 0,disabled:p,value:h,...o,ref:M,onKeyDown:nw(n,H=>{H.key==="Enter"&&H.preventDefault()}),onClick:nw(a,H=>{S($=>ga($)?!0:!$),O&&E&&(C.current=H.isPropagationStopped(),C.current||H.stopPropagation())})})});D1.displayName=N1;var nf=gt.forwardRef((e,n)=>{let{__scopeCheckbox:a,name:o,checked:s,defaultChecked:c,required:h,disabled:p,value:g,onCheckedChange:b,form:_,...S}=e;return(0,z.jsx)(Z3,{__scopeCheckbox:a,checked:s,defaultChecked:c,disabled:p,required:h,onCheckedChange:b,name:o,form:_,value:g,internal_do_not_use_render:({isFormControl:C})=>(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(D1,{...S,ref:n,__scopeCheckbox:a}),C&&(0,z.jsx)(B1,{__scopeCheckbox:a})]})})});nf.displayName=Yl;var j1="CheckboxIndicator",z1=gt.forwardRef((e,n)=>{let{__scopeCheckbox:a,forceMount:o,...s}=e,c=tf(j1,a);return(0,z.jsx)(TT,{present:o||ga(c.checked)||c.checked===!0,children:(0,z.jsx)(Oh.span,{"data-state":F1(c.checked),"data-disabled":c.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})});z1.displayName=j1;var q1="CheckboxBubbleInput",B1=gt.forwardRef(({__scopeCheckbox:e,...n},a)=>{let{control:o,hasConsumerStoppedPropagationRef:s,checked:c,defaultChecked:h,required:p,disabled:g,name:b,value:_,form:S,bubbleInput:C,setBubbleInput:E}=tf(q1,e),O=I2(a,E),M=AT(c),V=NT(o);gt.useEffect(()=>{let $=C;if(!$)return;let N=window.HTMLInputElement.prototype,ne=Object.getOwnPropertyDescriptor(N,"checked").set,fe=!s.current;if(M!==c&&ne){let R=new Event("click",{bubbles:fe});$.indeterminate=ga(c),ne.call($,ga(c)?!1:c),$.dispatchEvent(R)}},[C,M,c,s]);let H=gt.useRef(ga(c)?!1:c);return(0,z.jsx)(Oh.input,{type:"checkbox","aria-hidden":!0,defaultChecked:h??H.current,required:p,disabled:g,name:b,value:_,form:S,...n,tabIndex:-1,ref:O,style:{...n.style,...V,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});B1.displayName=q1;function eE(e){return typeof e=="function"}function ga(e){return e==="indeterminate"}function F1(e){return ga(e)?"indeterminate":e?"checked":"unchecked"}let V1;V1=Zn(),xl=gt.forwardRef((e,n)=>{let a=(0,V1.c)(10),o,s;a[0]===e?(o=a[1],s=a[2]):({className:o,...s}=e,a[0]=e,a[1]=o,a[2]=s);let c;a[3]===o?c=a[4]:(c=Su("flex items-center justify-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",o),a[3]=o,a[4]=c);let h;a[5]===Symbol.for("react.memo_cache_sentinel")?(h=(0,z.jsx)(z1,{className:Su("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),children:(0,z.jsx)(mT,{className:"h-4 w-4"})}),a[5]=h):h=a[5];let p;return a[6]!==s||a[7]!==n||a[8]!==c?(p=(0,z.jsx)(nf,{ref:n,className:c,...s,children:h}),a[6]=s,a[7]=n,a[8]=c,a[9]=p):p=a[9],p}),xl.displayName=nf.displayName,ow="_";var tE=new Set("__*.marimo.app.False.None.True.__peg_parser__.and.as.assert.async.await.break.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.nonlocal.not.or.pass.raise.return.try.while.with.yield.None.setup".split("."));Yh=function(e,n=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,"_"),n?e.toLowerCase():e):"_"},bw=function(e,n){let a=new Set(n),o=e,s=h=>!a.has(h)&&!tE.has(h);if(s(e))return e;let c=1;for(;!s(o);)o=`${e}_${c}`,c++;return o},u_=function(e,n){return Jh(e)?`cell-${n}`:e},Jh=function(e){return e?e==="_"||e==="__":!0};var nE=Zn();function rE(e){let n=(0,nE.c)(15),{minWidth:a,padding:o}=e,s=a===void 0?70:a,c=o===void 0?15:o,[h,p]=(0,gt.useState)(50),g=(0,gt.useRef)(null),b=(0,gt.useRef)(null),_;n[0]===c?_=n[1]:(_=R=>{if(b.current&&g.current){let j=b.current;j.style.fontSize=window.getComputedStyle(g.current).fontSize,j.style.fontFamily=window.getComputedStyle(g.current).fontFamily,j.textContent=R;let F=j.offsetWidth;p(F+c)}},n[0]=c,n[1]=_);let S=_,C;n[2]===S?C=n[3]:(C=()=>{var R;S(((R=g.current)==null?void 0:R.value)??"")},n[2]=S,n[3]=C),f5(C);let E;n[4]===S?E=n[5]:(E=R=>{S(R.target.value)},n[4]=S,n[5]=E);let O=`${h}px`,M=`${s}px`,V;n[6]!==O||n[7]!==M?(V={width:O,minWidth:M},n[6]=O,n[7]=M,n[8]=V):V=n[8];let H;n[9]!==E||n[10]!==V?(H={ref:g,type:"text",onChange:E,style:V},n[9]=E,n[10]=V,n[11]=H):H=n[11];let $=H,N;n[12]===Symbol.for("react.memo_cache_sentinel")?(N={ref:b,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},n[12]=N):N=n[12];let ne=N,fe;return n[13]===$?fe=n[14]:(fe={inputProps:$,spanProps:ne},n[13]=$,n[14]=fe),fe}var aE=Zn();function iE({currentQuotePrefix:e,checked:n,prefix:a}){let o=e;return n?e===""?o=a:e!=="rf"&&a!==e&&(o="rf"):e===a?o="":e==="rf"&&(o=a==="r"?"f":"r"),o}let H1;H1=()=>{let e=(0,aE.c)(2),n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,z.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,z.jsxs)("header",{className:"flex items-center gap-1",children:[(0,z.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"r"}),(0,z.jsx)("span",{className:"font-semibold",children:"Raw String"})]}),(0,z.jsx)("p",{className:"text-sm text-muted-foreground",children:"Write LaTeX without escaping special characters"}),(0,z.jsx)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:"\\alpha \\beta"})]}),e[0]=n):n=e[0];let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=(0,z.jsxs)("div",{className:"flex flex-col gap-3.5",children:[n,(0,z.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,z.jsxs)("header",{className:"flex items-center gap-1",children:[(0,z.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"f"}),(0,z.jsx)("span",{className:"font-semibold",children:"Format String"})]}),(0,z.jsx)("p",{className:"text-sm text-muted-foreground",children:"Interpolate Python values"}),(0,z.jsxs)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:["Hello ","{name}","! \u{1F601}"]})]})]}),e[1]=a):a=e[1],a},Fh="data-cell-id",Sw=function(e){return{[Fh]:e}},Bh="data-for-cell-id",td=function(e){return{[Bh]:e}};var oE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClickHouse%3c/title%3e%3cpath%20d='M21.333%2010H24v4h-2.667ZM16%201.335h2.667v21.33H16Zm-5.333%200h2.666v21.33h-2.666ZM0%2022.665V1.335h2.667v21.33zm5.333-21.33H8v21.33H5.333Z'/%3e%3c/svg%3e",sE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDatabricks%3c/title%3e%3cpath%20d='M.95%2014.184L12%2020.403l9.919-5.55v2.21L12%2022.662l-10.484-5.96-.565.308v.77L12%2024l11.05-6.218v-4.317l-.515-.309L12%2019.118l-9.867-5.653v-2.21L12%2016.805l11.05-6.218V6.32l-.515-.308L12%2011.974%202.647%206.681%2012%201.388l7.76%204.368.668-.411v-.566L12%200%20.95%206.27v.72L12%2013.207l9.919-5.55v2.26L12%2015.52%201.516%209.56l-.565.308Z'/%3e%3c/svg%3e",lE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAGcElEQVR4nNxZa2wcVxU+99557M6+vLazj6xjO6+maWVTl0YpLU1DU9KARNqooQhFVYJUqUWgiocqIVRESPlRoEhIqYoqgSiCItqQPkAEKUWQtlGSJtAY00R5mTjZTfze94x3HvdedMdZnKgS6s7O2kk/a7R3xvY933fOd874yhhucCyYAIWA9IOH2r+35/HUnjU96sBC8fAERQLpj0+mXjdeXM6rzy/no88uK6zolHu97EX8p/f/IWHAv38i9bsH+kIPo/ozhAJBgpR9J419je437xb62Zc7n/tcf+gRsebADYQAxLW2N/ApL/vNq4AdA7Ht2/piT4q15fAp1wEYAGEALYA18TzT1TXQ09O75qPuKbWS8NW4Lan27/pM4gWrBIgFnaIDvKZIpPPKt+nlgpMTi0q5PKqoqvZR950XAREZaz/fmHmFOFijwGHkDDu5PKGs1SlQ5gAAQ+S9U9Y/xM+Wy+WxRvaeFwE770z+OBNQbmYWwPlp63BPh3q7XQaCxAi50gP7Tldf87J3ywVszEQ2bumOf5WZAAajeWoDJjYOMM5BCECEw9miefxwduaol/1b2sQdCon/8BOZX3ETYWYiODFhvrNUC6ylFgJqzl27DxV+xD3GaGkFnl6deS4G8mJqAmRrtaGkoqxiJnazPpt9gPNVa3DvqfKrXmO0rAJ3RSLrHojHd4jMMwvBSMn+d1pSVrv37oXdz50Hx79JOXgtQGsqIAEiT8V7djtVzEiQ4w+K+t9uCmn3uNmX5rL/l8ullw5c1g80E6slFXgkuuixJVKw3y5jxEzExnV7pB3k7rr3hZDBiZl3njk+9u1mY/legSgm0cfiXbtcTziYHJmovNEXC99PZzAV41KMzaLtXGBVmaQltWfCdPLNxPNdwFdii58KYykhXM2AO5MGvTSAgw9aLnUx8zlomCxTKdeHdP14s/F8tdAiIie2RpPfAPcPNYAjRumNOwLRLZwL2rPgHAGnCF6aHPuJ5869Cr5WYFs0/S0ZkTDns9SK1BltI/JicYcEcXAX8L5R+vOblanf+hHTNwFtWGr7QiT9BAPklnWoVt5/qxrZILQI7wvyjHPrjKkfeL0y9QID76Pzavhmoa3RzNdkLMcYEKCA4aJtncjIgVs4oFnbCCGASDtRVrw3Uz7sV1xfBKiAlc2RJV+vkz9vWYMZWesTa1ER5vYEgot27YPvjJ/dXGBOwY+44JeAdaHkQxpRU9QVQGDIrPz1FjV+f/3eFcaRFcdKosicsh8x6/ClBzaEu7YLoqJNDUonVKR0UCTuRT9w9wshpAzb+qmcY2b9iFlH0xVow0r81sCiz9azfdCY3rNWSzw8a5/ZZ2ItPv9UmfiFP7Tn0HQFPhlMbuKIyOKkhThjNc4rBCtRJl5jrvO5W4mSY+beMib/4A/tOTQtYCCY2kTdszmHE7X8/tWBTtf7s7S528IYELxcuviMycWZzF80baHVgdT6/00fu3oso7Tdwa5Ypt7Aw5Zx7M1K7pf+UL4WTVWgQwqnQ5LWLexTpfblEFaT7Jrsc3GMLDw7+a9tFDj1j/YcmqpAWkn06yhERaYP6ZdeHtC6tl6deYPx4q7xY5+/YFfP+kf5WniqQELp6J6hNaNdia8s4TCojkmrjOYVHGin7qsLQdYqvb976uijk455yX/ac/AkYNLKZx9Nb/kNQkAsLJNBW9+/Uk3eJzI/ZlUG36qcfv6MXf3nmtjtO/ZO/v27/tOeA/L6iyu0pfdu7/riATF93s0fffq+toGdM5zmJ+ziuRgJpWSEgy/mXlk/Zk2f8ZfytfDcxOeM828XHH04TAIJjOTgDAlIiPNEmgQTw9Xh146UBn/aavLgVUAmkLk5IkdXFh09l62NHloaWblZjFGMONjMrsTUjqV5qzjuP90Pw9MUmrKms/2x276U0pbcO2Hlh9qUzj6GMJiclk/q5/b+Ovfqg+P29LD/dD+MhnsgSMLhnlDvPQVrOrcmfufjF2cuvI0BqVlj5GDBKmQZsJbMe9+BAZP1yU3fF+tloVV3LzSfhtEbXrWhO7Ri3ULz8PwmzoRXfTqr/+ddf+k0Dk8CEGBMOWccmC8H82bgSUAmfNO6S/q5Bc8+eBUQDXWtz1VP36gCMC4xnfPrZFw2/I9uLZi6u2aXs7ZdGWkNpcbQcAU0LX2XYYxeF/YBLwIYs0twndjnY4H/BgAA//95CrBYRwImwgAAAABJRU5ErkJggg==",cE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDuckDB%3c/title%3e%3cpath%20d='M12%200C5.363%200%200%205.363%200%2012s5.363%2012%2012%2012%2012-5.363%2012-12S18.637%200%2012%200zM9.502%207.03a4.974%204.974%200%200%201%204.97%204.97%204.974%204.974%200%200%201-4.97%204.97A4.974%204.974%200%200%201%204.532%2012a4.974%204.974%200%200%201%204.97-4.97zm6.563%203.183h2.351c.98%200%201.787.782%201.787%201.762s-.807%201.789-1.787%201.789h-2.351v-3.551z'/%3e%3c/svg%3e",uE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogle%20BigQuery%3c/title%3e%3cpath%20d='M5.676%2010.595h2.052v5.244a5.892%205.892%200%200%201-2.052-2.088v-3.156zm18.179%2010.836a.504.504%200%200%201%200%20.708l-1.716%201.716a.504.504%200%200%201-.708%200l-4.248-4.248a.206.206%200%200%201-.007-.007c-.02-.02-.028-.045-.043-.066a10.736%2010.736%200%200%201-6.334%202.065C4.835%2021.599%200%2016.764%200%2010.799S4.835%200%2010.8%200s10.799%204.835%2010.799%2010.8c0%202.369-.772%204.553-2.066%206.333.025.017.052.028.074.05l4.248%204.248zm-5.028-10.632a8.015%208.015%200%201%200-8.028%208.028h.024a8.016%208.016%200%200%200%208.004-8.028zm-4.86%204.98a6.002%206.002%200%200%200%202.04-2.184v-1.764h-2.04v3.948zm-4.5.948c.442.057.887.08%201.332.072.4.025.8.025%201.2%200V7.692H9.468v9.035z'/%3e%3c/svg%3e",dE=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,fE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMotherDuck%3c/title%3e%3cg%20transform='scale(0.85)%20translate(0,%202)'%3e%3cpath%20fill='%23ff9538'%20d='M1.71%2015.86s7.45%205.32%207.89%205.59c.44.27%201.08.33%201.64.11.56-.22.98-.71%201.11-1.21s1.85-9.49%201.85-9.49c.02-.12.07-.48-.13-.83-.27-.47-.86-.71-1.38-.57-.42.12-.64.44-.7.55-.09.17-.26.45-.57.7-.24.19-.47.3-.58.34-.96.38-2.02.06-2.61-.72-.38-.48-1.04-.67-1.64-.43-.6.24-.94.84-.89%201.45.11.98-.44%201.94-1.4%202.32-.51.21-1.06.21-1.54.05-.12-.03-.51-.12-.89.09-.48.26-.74.84-.61%201.37.09.39.38.62.48.69z'%20/%3e%3cpath%20fill='%23ff9538'%20d='M14.12%204.21s2.65%208.76%202.83%209.24c.19.48.66.92%201.23%201.09.58.16%201.21.03%201.62-.28.41-.31%207.25-6.39%207.25-6.39.09-.08.35-.34.4-.74.07-.53-.25-1.09-.75-1.29-.4-.16-.78-.04-.89%200-.18.08-.48.2-.88.2-.3.01-.55-.05-.67-.08-.99-.28-1.64-1.18-1.63-2.16-.01-.61-.42-1.17-1.04-1.35-.62-.18-1.26.09-1.59.6-.51.84-1.53%201.27-2.52.99-.53-.15-.96-.48-1.25-.91-.07-.09-.33-.4-.76-.48-.54-.09-1.1.22-1.32.71-.16.37-.08.72-.04.84z'%20/%3e%3c/g%3e%3c/svg%3e",pE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMySQL%3c/title%3e%3cpath%20d='M16.405%205.501c-.115%200-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77%2018.695h-.927a50.854%2050.854%200%2000-.27-4.41h-.008l-1.41%204.41H2.45l-1.4-4.41h-.01a72.892%2072.892%200%2000-.195%204.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335%204.064h.008l1.347-4.064h1.095c.242%202.015.384%203.86.428%205.53zm4.017-4.08c-.378%202.045-.876%203.533-1.492%204.46-.482.716-1.01%201.073-1.583%201.073-.153%200-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268%200%20.483-.075.647-.222.197-.18.295-.382.295-.605%200-.155-.077-.47-.23-.944L6.23%2014.615h.91l.727%202.36c.164.536.233.91.205%201.123.4-1.064.678-2.227.835-3.483zm12.325%204.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253%200-1.83-.718-2.746-2.155-2.746-.704%200-1.254.232-1.65.697-.43.508-.646%201.256-.646%202.245%200%20.972.19%201.686.574%202.14.35.41.877.615%201.583.615.264%200%20.506-.033.725-.098l1.325.772.36-.622zM15.5%2017.588c-.225-.36-.337-.94-.337-1.736%200-1.393.424-2.09%201.27-2.09.443%200%20.77.167.977.5.224.362.336.936.336%201.723%200%201.404-.424%202.108-1.27%202.108-.445%200-.77-.167-.978-.5zm-1.658-.425c0%20.47-.172.856-.516%201.156-.344.3-.803.45-1.384.45-.543%200-1.064-.172-1.573-.515l.237-.476c.438.22.833.328%201.19.328.332%200%20.593-.073.783-.22a.754.754%200%2000.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177%200-.45.157-.81.47-1.085.315-.278.72-.415%201.22-.415.512%200%20.98.136%201.4.41l-.213.476a2.726%202.726%200%2000-1.064-.23c-.283%200-.502.068-.654.206a.685.685%200%2000-.248.524c0%20.328.234.61.666.85.393.215%201.187.67%201.187.67.433.305.648.63.648%201.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223%203.223%200%2000-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867%208.867%200%2000-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69%2017.69%200%2001-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422%201.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146%201.693.194%202.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445%203.445%200%2001-.35-.4%208.76%208.76%200%2001-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188%201.01-.027.007-.014%200-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478%202.478%200%2001-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953%205.953%200%20012.085%202.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z'/%3e%3c/svg%3e",$1=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,hE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAmazon%20Redshift%3c/title%3e%3cpath%20d='M16.639%209.932a.822.822%200%200%201-.822-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.823.82m-2.086%204.994a.823.823%200%200%201-.822-.822.822.822%200%200%201%201.645%200%20.822.822%200%200%201-.823.822m-5.004-.833a.822.822%200%201%201%20.002-1.644.822.822%200%200%201-.002%201.644m-2.083%204.578a.823.823%200%200%201-.823-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.822.82m9.173-11.236a1.68%201.68%200%200%200-1.68%201.676c0%20.566.285%201.066.718%201.37l-.782%201.982a1.674%201.674%200%200%200-1.923%201.104l-1.753-.398a1.675%201.675%200%200%200-3.348.103c0%20.432.169.823.438%201.12l-.764%201.79c-.028-.001-.053-.008-.08-.008a1.68%201.68%200%200%200-1.68%201.676%201.68%201.68%200%200%200%203.36%200c0-.593-.312-1.112-.778-1.41l.674-1.579c.161.052.33.088.508.088.661%200%201.228-.386%201.502-.94l1.856.42a1.68%201.68%200%200%200%203.327-.325c0-.5-.224-.943-.574-1.25l.822-2.083c.053.005.104.016.157.016a1.68%201.68%200%200%200%201.68-1.676%201.68%201.68%200%200%200-1.68-1.676M12%2023.145c-4.17%200-7.286-1.252-7.286-2.37V4.79C6.14%205.938%209.131%206.547%2012%206.547c2.869%200%205.86-.609%207.286-1.756v15.983c0%201.12-3.116%202.37-7.286%202.37M12%20.856c4.293%200%207.286%201.274%207.286%202.419%200%201.143-2.993%202.418-7.286%202.418-4.293%200-7.286-1.275-7.286-2.418C4.714%202.129%207.707.855%2012%20.855m8.143%202.419C20.143%201.147%2015.947%200%2012%200%208.052%200%203.857%201.147%203.857%203.274l.002.01h-.002v17.49C3.857%2022.87%208.052%2024%2012%2024c3.947%200%208.143-1.13%208.143-3.226V3.284h-.002l.002-.01'/%3e%3c/svg%3e",mE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSnowflake%3c/title%3e%3cpath%20d='M24%203.459c0%20.646-.418%201.18-1.141%201.18-.723%200-1.142-.534-1.142-1.18%200-.647.419-1.18%201.142-1.18.723%200%201.141.533%201.141%201.18zm-.228%200c0-.533-.38-.951-.913-.951s-.913.38-.913.95c0%20.533.38.952.913.952.57%200%20.913-.419.913-.951zm-1.37-.533h.495c.266%200%20.456.152.456.38%200%20.153-.076.229-.19.305l.19.266v.038h-.266l-.19-.266h-.229v.266h-.266zm.495.228h-.229v.267h.229c.114%200%20.152-.038.152-.114.038-.077-.038-.153-.152-.153zM7.602%2012.4c.038-.151.076-.304.076-.456%200-.114-.038-.228-.038-.342-.114-.343-.304-.647-.646-.838l-4.87-2.777c-.685-.38-1.56-.152-1.94.533-.381.685-.153%201.56.532%201.94l2.701%201.56-2.701%201.56c-.685.38-.913%201.256-.533%201.94.38.685%201.256.914%201.94.533l4.832-2.777c.343-.267.571-.533.647-.876zm1.332%202.626c-.266-.038-.57.038-.837.19l-4.832%202.777c-.685.38-.913%201.256-.532%201.94.38.686%201.255.914%201.94.533l2.701-1.56v3.12c0%20.8.647%201.408%201.446%201.408.799%200%201.407-.647%201.407-1.408v-5.592c0-.761-.57-1.37-1.293-1.408zm4.946-6.088c.266.038.57-.038.837-.19l4.832-2.777c.685-.38.913-1.256.532-1.94-.38-.686-1.255-.914-1.94-.533l-2.701%201.56V1.975c0-.799-.647-1.408-1.446-1.408-.799%200-1.446.609-1.446%201.408V7.53c0%20.76.609%201.37%201.332%201.407zM3.265%205.97l4.832%202.777c.266.152.533.19.837.19.723-.038%201.331-.684%201.331-1.407V1.975c0-.799-.646-1.408-1.407-1.408-.799%200-1.446.647-1.446%201.408v3.12l-2.701-1.56c-.685-.38-1.56-.152-1.94.533-.419.646-.19%201.521.494%201.902zm9.093%206.011a.412.412%200%2000-.114-.266l-.57-.571a.346.346%200%2000-.267-.114.412.412%200%2000-.266.114l-.571.57a.411.411%200%2000-.114.267c0%20.076.038.19.114.267l.57.57a.345.345%200%2000.267.114c.076%200%20.19-.038.266-.114l.571-.57a.412.412%200%2000.114-.267zm1.598.533L11.94%2014.53c-.039.038-.153.114-.229.114h-.608a.411.411%200%2001-.267-.114L8.82%2012.514a.408.408%200%2001-.076-.229v-.608c0-.076.038-.19.114-.267l2.016-2.016a.41.41%200%2001.267-.114h.608a.41.41%200%2001.267.114l2.016%202.016a.347.347%200%2001.114.267v.608c-.076.077-.114.19-.19.229zm5.593%205.44l-4.832-2.777c-.266-.152-.57-.19-.837-.152-.723.038-1.332.684-1.332%201.408v5.554c0%20.8.647%201.408%201.408%201.408.799%200%201.446-.647%201.446-1.408v-3.12l2.7%201.56c.686.38%201.561.152%201.941-.533.419-.646.19-1.521-.494-1.94zm2.549-7.533l-2.701%201.56%202.7%201.56c.686.38.914%201.256.533%201.94-.38.685-1.255.913-1.94.533l-4.832-2.778a1.644%201.644%200%2001-.647-.798c-.037-.153-.076-.305-.076-.457%200-.114.039-.228.039-.342.114-.343.342-.647.646-.837l4.832-2.778c.685-.38%201.56-.152%201.94.533.457.609.19%201.484-.494%201.864'/%3e%3c/svg%3e",gE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eApache%20Spark%3c/title%3e%3cpath%20d='M10.812%200c-.425.013-.845.215-1.196.605a3.593%203.593%200%2000-.493.722c-.355.667-.425%201.415-.556%202.143a551.9%20551.9%200%2000-.726%204.087c-.027.16-.096.227-.244.273C5.83%208.386%204.06%208.94%202.3%209.514c-.387.125-.773.289-1.114.506-1.042.665-1.196%201.753-.415%202.71.346.422.79.715%201.284.936%201.1.49%202.202.976%203.3%201.47.019.01.036.013.053.019h-.004l1.306.535c0%20.023.002.045%200%20.073-.2%202.03-.39%204.063-.58%206.095-.04.419-.012.831.134%201.23.317.87%201.065%201.148%201.881.701.372-.204.666-.497.937-.818%201.372-1.623%202.746-3.244%204.113-4.872.111-.133.205-.15.363-.098.349.117.697.231%201.045.347h.001c.02.012.045.02.073.03l.142.042c1.248.416%202.68.775%203.929%201.19.4.132.622.164%201.045.098.311-.048.592-.062.828-.236.602-.33.995-.957.988-1.682-.005-.427-.154-.813-.35-1.186-.82-1.556-1.637-3.113-2.461-4.666-.078-.148-.076-.243.037-.375%201.381-1.615%202.756-3.236%204.133-4.855.272-.32.513-.658.653-1.058.308-.878-.09-1.57-1-1.741a2.783%202.783%200%2000-1.235.069c-1.974.521-3.947%201.041-5.918%201.57-.175.047-.26.015-.355-.144a353.08%20353.08%200%2000-2.421-4.018%204.61%204.61%200%2000-.652-.849c-.371-.37-.802-.549-1.227-.536zm.172%203.703a.592.592%200%2001.189.211c.87%201.446%201.742%202.89%202.609%204.338.07.118.135.16.277.121%201.525-.41%203.052-.813%204.579-1.217.367-.098.735-.193%201.103-.289a.399.399%200%2001-.1.2c-1.259%201.48-2.516%202.962-3.779%204.438-.11.13-.12.22-.04.37.937%201.803%201.768%203.309%202.498%204.76l-3.696-1.019c-.538-.18-1.077-.358-1.615-.539-.163-.055-.25-.03-.36.1-1.248%201.488-2.504%202.97-3.759%204.454a.398.398%200%2001-.18.132c.035-.378.068-.757.104-1.136.149-1.572.297-3.144.451-4.716-.03-.318.117-.405-.322-.545-1.493-.593-3.346-1.321-4.816-1.905a.595.595%200%2001.24-.134c1.797-.57%203.595-1.14%205.394-1.705.127-.04.199-.092.211-.233.013-.148.05-.294.076-.441.241-1.363.483-2.726.726-4.088.068-.386.14-.771.21-1.157z'/%3e%3c/svg%3e",yE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSQLite%3c/title%3e%3cpath%20d='M21.678.521c-1.032-.92-2.28-.55-3.513.544a8.71%208.71%200%200%200-.547.535c-2.109%202.237-4.066%206.38-4.674%209.544.237.48.422%201.093.544%201.561a13.044%2013.044%200%200%201%20.164.703s-.019-.071-.096-.296l-.05-.146a1.689%201.689%200%200%200-.033-.08c-.138-.32-.518-.995-.686-1.289-.143.423-.27.818-.376%201.176.484.884.778%202.4.778%202.4s-.025-.099-.147-.442c-.107-.303-.644-1.244-.772-1.464-.217.804-.304%201.346-.226%201.478.152.256.296.698.422%201.186.286%201.1.485%202.44.485%202.44l.017.224a22.41%2022.41%200%200%200%20.056%202.748c.095%201.146.273%202.13.5%202.657l.155-.084c-.334-1.038-.47-2.399-.41-3.967.09-2.398.642-5.29%201.661-8.304%201.723-4.55%204.113-8.201%206.3-9.945-1.993%201.8-4.692%207.63-5.5%209.788-.904%202.416-1.545%204.684-1.931%206.857.666-2.037%202.821-2.912%202.821-2.912s1.057-1.304%202.292-3.166c-.74.169-1.955.458-2.362.629-.6.251-.762.337-.762.337s1.945-1.184%203.613-1.72C21.695%207.9%2024.195%202.767%2021.678.521m-18.573.543A1.842%201.842%200%200%200%201.27%202.9v16.608a1.84%201.84%200%200%200%201.835%201.834h9.418a22.953%2022.953%200%200%201-.052-2.707c-.006-.062-.011-.141-.016-.2a27.01%2027.01%200%200%200-.473-2.378c-.121-.47-.275-.898-.369-1.057-.116-.197-.098-.31-.097-.432%200-.12.015-.245.037-.386a9.98%209.98%200%200%201%20.234-1.045l.217-.028c-.017-.035-.014-.065-.031-.097l-.041-.381a32.8%2032.8%200%200%201%20.382-1.194l.2-.019c-.008-.016-.01-.038-.018-.053l-.043-.316c.63-3.28%202.587-7.443%204.8-9.791.066-.069.133-.128.198-.194Z'/%3e%3c/svg%3e",vE="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSupabase%3c/title%3e%3cpath%20d='M11.9%201.036c-.015-.986-1.26-1.41-1.874-.637L.764%2012.05C-.33%2013.427.65%2015.455%202.409%2015.455h9.579l.113%207.51c.014.985%201.259%201.408%201.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z'/%3e%3c/svg%3e",bE="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3c!--%20Generated%20by%20Pixelmator%20Pro%203.6.17%20--%3e%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Option2SymbolB'%3e%3cg%20id='Layer1-2'%3e%3cg%20id='Group'%20opacity='0.4'%3e%3cpath%20id='Path'%20fill='%23d53c97'%20stroke='none'%20d='M%2017.016802%2012.188573%20C%2017.016802%209.607646%2015.86018%207.293022%2014.039526%205.731081%20C%2013.942595%205.70038%2013.844628%205.671406%2013.745972%205.645189%20C%2013.131133%205.809095%2012.54265%206.059378%2011.998103%206.388559%20C%2013.964327%207.575191%2015.281006%209.730104%2015.281006%2012.188573%20C%2015.279476%2014.563734%2014.033739%2016.764488%2011.998103%2017.988243%20C%2012.542634%2018.317537%2013.131119%2018.567936%2013.745972%2018.731958%20C%2013.844628%2018.705742%2013.942595%2018.67642%2014.039526%2018.645721%20C%2015.86018%2017.084126%2017.016802%2014.769501%2017.016802%2012.188573%20Z'/%3e%3cpath%20id='path1'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.897406%205.609659%20L%2013.894991%205.60759%20C%2013.844973%205.619663%2013.7953%205.631737%2013.745972%205.645189%20C%2013.79599%205.631737%2013.847043%205.622078%2013.897406%205.609659%20Z'/%3e%3cpath%20id='path2'%20fill='%23d53c97'%20stroke='none'%20d='M%201.735796%2012.188573%20C%201.735796%209.164728%203.728925%206.59622%206.470945%205.729357%20C%207.554634%204.797861%208.856011%204.155121%2010.254373%203.860756%20C%209.680216%203.740549%209.095179%203.679977%208.508574%203.68%20C%203.816888%203.68%20-0%207.496887%20-0%2012.188573%20C%20-0%2016.880259%203.816888%2020.697147%208.508574%2020.697147%20C%209.0952%2020.697229%209.680255%2020.636539%2010.254373%2020.516048%20C%208.855971%2020.221794%207.554568%2019.579041%206.470945%2018.647446%20C%203.728925%2017.780582%201.735796%2015.213453%201.735796%2012.188573%20Z'/%3e%3cpath%20id='path3'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.745972%2018.731958%20C%2013.7953%2018.745068%2013.844973%2018.757484%2013.894991%2018.769558%20C%2013.894991%2018.769558%2013.896715%2018.769558%2013.897406%2018.767488%20C%2013.847043%2018.754379%2013.79599%2018.745411%2013.745972%2018.731958%20Z'/%3e%3c/g%3e%3cpath%20id='path4'%20fill='%23ff3b65'%20stroke='none'%20d='M%2020.508402%2012.188573%20C%2020.508402%209.606611%2019.351088%207.290262%2017.5294%205.729357%20C%2016.301817%205.342468%2014.989366%205.313629%2013.745972%205.646223%20C%2016.636665%206.418224%2018.772606%209.058484%2018.772606%2012.189609%20C%2018.772606%2015.320732%2016.636665%2017.960991%2013.745972%2018.731958%20C%2014.98947%2019.064316%2016.301983%2019.034998%2017.5294%2018.647446%20C%2019.419907%2017.034296%2020.508638%2014.673781%2020.508402%2012.188573%20Z'/%3e%3cpath%20id='path5'%20fill='%23ff3b65'%20stroke='none'%20d='M%209.962543%2018.647446%20C%207.220525%2017.780582%205.227395%2015.213453%205.227395%2012.188573%20C%205.227395%209.163693%207.220525%206.59622%209.962543%205.729357%20C%2011.046233%204.797861%2012.34761%204.155121%2013.745972%203.860756%20C%2013.171818%203.74053%2012.586779%203.679956%2012.000173%203.68%20C%207.308832%203.68%203.491599%207.496887%203.491599%2012.188573%20C%203.491599%2016.880259%207.308487%2020.697147%2012.000173%2020.697147%20C%2012.586799%2020.697247%2013.171857%2020.636557%2013.745972%2020.516048%20C%2012.34757%2020.221794%2011.046167%2019.579041%209.962543%2018.647446%20Z'/%3e%3cpath%20id='path6'%20fill='%23383838'%20stroke='none'%20d='M%2015.491772%203.68%20C%2010.800431%203.68%206.983198%207.496887%206.983198%2012.188573%20C%206.983198%2016.880259%2010.800086%2020.697147%2015.491772%2020.697147%20C%2020.183456%2020.697147%2024%2016.880259%2024%2012.188573%20C%2024%207.496887%2020.183456%203.68%2015.491772%203.68%20Z%20M%2022.264549%2012.188573%20C%2022.264549%2015.923018%2019.226215%2018.961351%2015.491772%2018.961351%20C%2011.757326%2018.961351%208.718994%2015.923018%208.718994%2012.188573%20C%208.718994%208.454128%2011.757326%205.415796%2015.491772%205.415796%20C%2019.226215%205.415796%2022.264549%208.454128%2022.264549%2012.188573%20Z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",wE=""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,_E=Zn(),xE={sqlite:yE,duckdb:cE,motherduck:fE,postgres:$1,postgresql:$1,mysql:pE,snowflake:mE,databricks:sE,clickhouse:oE,timeplus:bE,bigquery:uE,trino:wE,iceberg:dE,datafusion:lE,pyspark:gE,redshift:hE,supabase:vE};nm=e=>{let n=(0,_E.c)(11),{name:a,className:o}=e,s=xE[a.toLowerCase()];if(!s){let p;n[0]===o?p=n[1]:(p=Su("mt-0.5",o),n[0]=o,n[1]=p);let g;return n[2]===p?g=n[3]:(g=(0,z.jsx)(rs,{className:p}),n[2]=p,n[3]=g),g}let c;n[4]!==o||n[5]!==s?(c=Su("invert-[.5] dark:invert-[.7]",o,s.endsWith(".png")&&"brightness-100 dark:brightness-100 invert-0 dark:invert-0"),n[4]=o,n[5]=s,n[6]=c):c=n[6];let h;return n[7]!==a||n[8]!==c||n[9]!==s?(h=(0,z.jsx)("img",{src:s,alt:a,className:c}),n[7]=a,n[8]=c,n[9]=s,n[10]=h):h=n[10],h};var rf=Zn();const kE=e=>{let n=(0,rf.c)(34),{selectedEngine:a,onChange:o,cellId:s}=e,c=mn(Xu),h=[],p=[];for(let[Qe,pe]of c.entries())Fi.has(Qe)?h.push(pe):p.push(pe);let g=aT(),b=a&&!c.has(a),_;n[0]!==c||n[1]!==o||n[2]!==g?(_=Qe=>{if(Qe===W1){window.open(U1,"_blank");return}let pe=c.get(Qe);pe&&(g(),o(pe.name),ng(pe.name))},n[0]=c,n[1]=o,n[2]=g,n[3]=_):_=n[3];let S=_,C=LE,E=PT,O;n[4]===s?O=n[5]:(O=td(s),n[4]=s,n[5]=O);let M;n[6]===Symbol.for("react.memo_cache_sentinel")?(M=(0,z.jsx)(OT,{placeholder:"Select an engine"}),n[6]=M):M=n[6];let V;n[7]===O?V=n[8]:(V=(0,z.jsx)(CE,{...O,children:M}),n[7]=O,n[8]=V);let H=IT,$;n[9]===s?$=n[10]:($=td(s),n[9]=s,n[10]=$);let N=RT,ne;n[11]===Symbol.for("react.memo_cache_sentinel")?(ne=(0,z.jsx)(LT,{children:"Database connections"}),n[11]=ne):ne=n[11];let fe;n[12]!==b||n[13]!==a?(fe=b&&(0,z.jsx)(Ah,{value:a,children:(0,z.jsxs)("div",{className:"flex items-center gap-1 opacity-50",children:[(0,z.jsx)(Tm,{className:"h-3 w-3"}),(0,z.jsx)("span",{className:"truncate",children:sg(a)})]})},a),n[12]=b,n[13]=a,n[14]=fe):fe=n[14];let R=C(p),j=p.length>0&&(0,z.jsx)(rw,{}),F=C(h),se;n[15]===Symbol.for("react.memo_cache_sentinel")?(se=(0,z.jsx)(rw,{}),n[15]=se):se=n[15];let ce;n[16]===Symbol.for("react.memo_cache_sentinel")?(ce=(0,z.jsx)(Ah,{className:"text-muted-foreground",value:W1,children:(0,z.jsxs)("a",{className:"flex items-center gap-1",href:U1,target:"_blank",rel:"noreferrer",children:[(0,z.jsx)(yT,{className:"h-3 w-3"}),(0,z.jsx)("span",{children:"How to add a database connection"})]})}),n[16]=ce):ce=n[16];let he;n[17]!==N||n[18]!==j||n[19]!==F||n[20]!==ne||n[21]!==fe||n[22]!==R?(he=(0,z.jsxs)(N,{children:[ne,fe,R,j,F,se,ce]}),n[17]=N,n[18]=j,n[19]=F,n[20]=ne,n[21]=fe,n[22]=R,n[23]=he):he=n[23];let ye;n[24]!==H||n[25]!==he||n[26]!==$?(ye=(0,z.jsx)(H,{...$,children:he}),n[24]=H,n[25]=he,n[26]=$,n[27]=ye):ye=n[27];let xe;return n[28]!==E||n[29]!==S||n[30]!==a||n[31]!==ye||n[32]!==V?(xe=(0,z.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,z.jsxs)(E,{value:a,onValueChange:S,children:[V,ye]})}),n[28]=E,n[29]=S,n[30]=a,n[31]=ye,n[32]=V,n[33]=xe):xe=n[33],xe};var W1="__help__",U1="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";const SE=()=>{let e=(0,rf.c)(16),{sqlMode:n,setSQLMode:a}=q3(),o;e[0]!==a||e[1]!==n?(o=()=>{let E=n==="validate"?"default":"validate";E==="default"&&R3(),a(E)},e[0]=a,e[1]=n,e[2]=o):o=e[2];let s=o,c=OE,h=AE,p;e[3]===n?p=e[4]:(p=h(n),e[3]=n,e[4]=p);let g;e[5]===n?g=e[6]:(g=c(n),e[5]=n,e[6]=g);let b=n==="validate"?"Validate":"Default",_;e[7]===b?_=e[8]:(_=(0,z.jsx)("span",{className:"ml-1",children:b}),e[7]=b,e[8]=_);let S;e[9]!==s||e[10]!==g||e[11]!==_?(S=(0,z.jsxs)(P2,{variant:"ghost",size:"sm",onClick:s,className:"h-5 px-1.5 text-xs border-border shadow-none hover:bg-accent",children:[g,_]}),e[9]=s,e[10]=g,e[11]=_,e[12]=S):S=e[12];let C;return e[13]!==p||e[14]!==S?(C=(0,z.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,z.jsx)(Ih,{delayDuration:300,content:p,children:S})}),e[13]=p,e[14]=S,e[15]=C):C=e[15],C};var CE=e=>{let n=(0,rf.c)(6),a,o;n[0]===e?(a=n[1],o=n[2]):({children:a,...o}=e,n[0]=e,n[1]=a,n[2]=o);let s;return n[3]!==a||n[4]!==o?(s=(0,z.jsx)(MT,{className:"text-xs border-border shadow-none! ring-0! h-5 px-1.5 hover:bg-accent transition-colors",...o,children:a}),n[3]=a,n[4]=o,n[5]=s):s=n[5],s};function EE(e){return e.source!=="iceberg"}function TE(e){return(0,z.jsx)(Ah,{value:e.name,children:(0,z.jsxs)("div",{className:"flex items-center gap-1",children:[(0,z.jsx)(nm,{className:"h-3 w-3",name:e.dialect}),(0,z.jsx)("span",{className:"truncate ml-0.5",children:sg(e.display_name)})]})},e.name)}function LE(e){return e=e.filter(EE),e.map(TE)}function OE(e){return e==="validate"?(0,z.jsx)(Rd,{className:"h-3 w-3"}):(0,z.jsx)(Eh,{className:"h-3 w-3"})}function AE(e){return e==="validate"?(0,z.jsxs)("div",{className:"text-xs",children:[(0,z.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,z.jsx)(Rd,{className:"h-3 w-3"}),"Validate Mode"]}),(0,z.jsx)("p",{children:"Queries are validated as you write them"})]}):(0,z.jsxs)("div",{className:"text-xs",children:[(0,z.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,z.jsx)(Eh,{className:"h-3 w-3"}),"Default Mode"]}),(0,z.jsx)("p",{children:"Standard editing"})]})}var K1=Zn(),Q1=()=>{let e=(0,K1.c)(1),n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,z.jsx)("div",{className:"h-4 border-r border-border"}),e[0]=n):n=e[0],n};const IE=e=>{let n=(0,K1.c)(102),{view:a}=e,o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o={minWidth:50},n[0]=o):o=n[0];let{spanProps:s,inputProps:c}=rE(o),h;n[1]===a.state?h=n[2]:(h=a.state.field(rr),n[1]=a.state,n[2]=h);let p=h,g;n[3]===a.state?g=n[4]:(g=a.state.facet(sa),n[3]=a.state,n[4]=g);let b=g,_;n[5]===Symbol.for("react.memo_cache_sentinel")?(_=(0,z.jsx)("div",{}),n[5]=_):_=n[5];let S=_,C=!1,E;n[6]===a?E=n[7]:(E=H=>{a.dispatch({effects:ju.of(H),changes:{from:0,to:a.state.doc.length,insert:a.state.doc.toString()}})},n[6]=a,n[7]=E);let O=E;if(p instanceof Bu){let H;n[8]===a.state?H=n[9]:(H=a.state.field(Ir),n[8]=a.state,n[9]=H);let $=H;C=!0;let N;n[10]===O?N=n[11]:(N=Tt=>{let Mt=Yh(Tt.currentTarget.value,!1);Tt.currentTarget.value=Mt,O({dataframeName:Mt})},n[10]=O,n[11]=N);let ne=N,fe;n[12]!==O||n[13]!==a?(fe=Tt=>{O({engine:Tt}),V3(a,Tt)},n[12]=O,n[13]=a,n[14]=fe):fe=n[14];let R=fe,j;n[15]===Symbol.for("react.memo_cache_sentinel")?(j=(0,z.jsx)("span",{className:"select-none",children:"Output variable: "}),n[15]=j):j=n[15];let F;n[16]===c?F=n[17]:(F=Tt=>{var Mt;(Mt=c.onChange)==null||Mt.call(c,Tt)},n[16]=c,n[17]=F);let se;n[18]===ne?se=n[19]:(se=Tt=>{Tt.key==="Enter"&&Tt.shiftKey&&ne(Tt)},n[18]=ne,n[19]=se);let ce;n[20]!==c||n[21]!==$.dataframeName||n[22]!==ne||n[23]!==F||n[24]!==se?(ce=(0,z.jsx)("input",{...c,defaultValue:$.dataframeName,onChange:F,onBlur:ne,onKeyDown:se,className:"min-w-14 w-auto border border-border rounded px-1 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring"}),n[20]=c,n[21]=$.dataframeName,n[22]=ne,n[23]=F,n[24]=se,n[25]=ce):ce=n[25];let he;n[26]===s?he=n[27]:(he=(0,z.jsx)("span",{...s}),n[26]=s,n[27]=he);let ye;n[28]!==ce||n[29]!==he?(ye=(0,z.jsxs)("label",{className:"flex gap-2 items-center",children:[j,ce,he]}),n[28]=ce,n[29]=he,n[30]=ye):ye=n[30];let xe;n[31]!==b||n[32]!==$.engine||n[33]!==R?(xe=(0,z.jsx)(kE,{selectedEngine:$.engine,onChange:R,cellId:b}),n[31]=b,n[32]=$.engine,n[33]=R,n[34]=xe):xe=n[34];let Qe;n[35]===$.engine?Qe=n[36]:(Qe=$.engine==="__marimo_duckdb"&&(0,z.jsx)(SE,{}),n[35]=$.engine,n[36]=Qe);let pe;n[37]!==$.engine||n[38]!==a?(pe=async()=>{await Ek(a,$.engine)},n[37]=$.engine,n[38]=a,n[39]=pe):pe=n[39];let ie;n[40]===Symbol.for("react.memo_cache_sentinel")?(ie=(0,z.jsx)(em,{className:"h-3 w-3"}),n[40]=ie):ie=n[40];let ee;n[41]===pe?ee=n[42]:(ee=(0,z.jsx)(Ih,{content:"Format SQL",children:(0,z.jsx)(P2,{variant:"text",size:"icon",onClick:pe,children:ie})}),n[41]=pe,n[42]=ee);let U;n[43]===Symbol.for("react.memo_cache_sentinel")?(U=(0,z.jsx)(Q1,{}),n[43]=U):U=n[43];let Ae;n[44]===O?Ae=n[45]:(Ae=Tt=>{O({showOutput:!Tt.target.checked})},n[44]=O,n[45]=Ae);let Ve=!$.showOutput,nt;n[46]!==Ae||n[47]!==Ve?(nt=(0,z.jsx)("input",{type:"checkbox",onChange:Ae,checked:Ve}),n[46]=Ae,n[47]=Ve,n[48]=nt):nt=n[48];let He;n[49]===Symbol.for("react.memo_cache_sentinel")?(He=(0,z.jsx)("span",{className:"select-none",children:"Hide output"}),n[49]=He):He=n[49];let ze;n[50]===nt?ze=n[51]:(ze=(0,z.jsxs)("label",{className:"flex items-center gap-2",children:[nt,He]}),n[50]=nt,n[51]=ze);let Le;n[52]!==Qe||n[53]!==ee||n[54]!==ze?(Le=(0,z.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[Qe,ee,U,ze]}),n[52]=Qe,n[53]=ee,n[54]=ze,n[55]=Le):Le=n[55];let Re;n[56]!==ye||n[57]!==xe||n[58]!==Le?(Re=(0,z.jsxs)("div",{className:"flex flex-1 gap-2 items-center",children:[ye,xe,Le]}),n[56]=ye,n[57]=xe,n[58]=Le,n[59]=Re):Re=n[59],S=Re}if(p instanceof Pu){C=!0;let H,$,N,ne,fe,R,j,F,se,ce;if(n[60]!==O||n[61]!==a.state){let{quotePrefix:Ae}=a.state.field(Ir);$=Ae,$===void 0&&($="r",O({quotePrefix:$})),ce=(Ve,nt)=>{typeof nt=="boolean"&&O({quotePrefix:iE({currentQuotePrefix:$,checked:nt,prefix:Ve})})},ne="flex flex-row w-full justify-end gap-1.5 items-center",se="flex items-center gap-1.5",n[72]===Symbol.for("react.memo_cache_sentinel")?(N=(0,z.jsx)("span",{children:"r"}),n[72]=N):N=n[72],H=xl,R="Toggle raw string",j="w-3 h-3",F=$.includes("r"),fe=Ve=>{ce("r",Ve)},n[60]=O,n[61]=a.state,n[62]=H,n[63]=$,n[64]=N,n[65]=ne,n[66]=fe,n[67]=R,n[68]=j,n[69]=F,n[70]=se,n[71]=ce}else H=n[62],$=n[63],N=n[64],ne=n[65],fe=n[66],R=n[67],j=n[68],F=n[69],se=n[70],ce=n[71];let he;n[73]!==H||n[74]!==fe||n[75]!==R||n[76]!==j||n[77]!==F?(he=(0,z.jsx)(H,{"aria-label":R,className:j,checked:F,onCheckedChange:fe}),n[73]=H,n[74]=fe,n[75]=R,n[76]=j,n[77]=F,n[78]=he):he=n[78];let ye;n[79]!==N||n[80]!==he||n[81]!==se?(ye=(0,z.jsxs)("div",{className:se,children:[N,he]}),n[79]=N,n[80]=he,n[81]=se,n[82]=ye):ye=n[82];let xe;n[83]===Symbol.for("react.memo_cache_sentinel")?(xe=(0,z.jsx)("span",{children:"f"}),n[83]=xe):xe=n[83];let Qe;n[84]===$?Qe=n[85]:(Qe=$.includes("f"),n[84]=$,n[85]=Qe);let pe;n[86]===ce?pe=n[87]:(pe=Ae=>{ce("f",Ae)},n[86]=ce,n[87]=pe);let ie;n[88]!==Qe||n[89]!==pe?(ie=(0,z.jsxs)("div",{className:"flex items-center gap-1.5",children:[xe,(0,z.jsx)(xl,{"aria-label":"Toggle f-string",className:"w-3 h-3",checked:Qe,onCheckedChange:pe})]}),n[88]=Qe,n[89]=pe,n[90]=ie):ie=n[90];let ee;n[91]===Symbol.for("react.memo_cache_sentinel")?(ee=(0,z.jsx)(Ih,{content:(0,z.jsx)(H1,{}),children:(0,z.jsx)(rd,{className:"w-3 h-3"})}),n[91]=ee):ee=n[91];let U;n[92]!==ne||n[93]!==ye||n[94]!==ie?(U=(0,z.jsxs)("div",{className:ne,children:[ye,ie,ee]}),n[92]=ne,n[93]=ye,n[94]=ie,n[95]=U):U=n[95],S=U}let M;n[96]===C?M=n[97]:(M=C&&(0,z.jsx)(Q1,{}),n[96]=C,n[97]=M);let V;return n[98]!==S||n[99]!==p.type||n[100]!==M?(V=(0,z.jsx)(DT,{children:(0,z.jsxs)("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[S,M,p.type]})}),n[98]=S,n[99]=p.type,n[100]=M,n[101]=V):V=n[101],V};var af=new Tu;Iu=aa.define(),rr=Zo.define({create(){return Fn.python},update(e,n){for(let a of n.effects)if(a.is(Iu))return a.value;return e},provide:e=>bh.from(e,n=>n.type==="python"?null:a=>Ok(a,IE))});function RE(){let e=J3(),n=(a,o)=>{let s=e[o%e.length];return s.isSupported(a)?s:n(a,o+1)};return[Ka.of([{key:"F4",preventDefault:!0,run:a=>{let o=a.state.field(rr),s=e.findIndex(h=>h.type===o.type),c=n(a.state.doc.toString(),s+1);return o===c?!1:(G1({view:a,nextLanguage:c,opts:{keepCodeAsIs:!1}}),!0)}}])]}function G1({view:e,nextLanguage:n,opts:a}){let o=e.state.field(rr),s=e.state.doc.toString(),c=e.state.facet(Q0),h=e.state.facet(G0),p=e.state.facet(Ad),g=e.state.facet(Dl),b=e.state.facet(J0),_=e.state.field(Ir),S=e.state.selection.main.head,C;if(a.keepCodeAsIs)C=s,o.type!==n.type&&(_={...n.defaultMetadata});else{let[E,O]=o.transformOut(s,_),[M,V,H]=n.transformIn(E);S+=O,S-=V,S=xh(S,0,M.length),C=M,_=H}e.dispatch({effects:[Iu.of(n),id.of(_),af.reconfigure(n.getExtension(g,c,h,p,b)),Vu.reconfigure([]),us.of(!0)],changes:a.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:C},selection:a.keepCodeAsIs?void 0:$t.cursor(S)}),e.dispatch({effects:[Vu.reconfigure([B5()])]}),n.type==="sql"&&H3(e)}U_=function(e){let{placeholderType:n,completionConfig:a,hotkeys:o,cellId:s,lspConfig:c}=e;return[RE(),af.of(Fn.python.getExtension(s,a,o,n,c)),rr,Ir]},Gw=function(e){return ME(nr({state:e}).trim())};function ME(e){return e?Fn.markdown.isSupported(e)?Fn.markdown:Fn.sql.isSupported(e)?Fn.sql:Fn.python:Fn.python}Fm=function(e,n){e.state.field(rr).type!==n.language&&G1({view:e,nextLanguage:Fn[n.language],opts:{keepCodeAsIs:n.keepCodeAsIs??!1}})},Pw=function(e,{completionConfig:n,hotkeysProvider:a,lspConfig:o}){let s=e.state.field(rr),c=e.state.facet(Ad),h=e.state.facet(Dl);return h===void 0&&be.error("Cell ID is undefined in reconfigureLanguageEffect"),c===void 0&&be.error("Placeholder type is undefined in reconfigureLanguageEffect"),n===void 0&&be.error("Completion config is undefined in reconfigureLanguageEffect"),af.reconfigure(s.getExtension(h,n,a,c,o))},nr=function(e,n,a){let o=e.state.field(rr),s=e.state.field(Ir),c=e.state.doc.toString();return n===void 0?o.transformOut(c,s)[0]:o.transformOut(c.slice(n,a),s)[0]},Ki=function(e,n){let[a]=e.state.field(rr).transformIn(n);return Hu(e,a),a};function PE(e){let n=e.state.selection.main.head,a=e.state.doc.toString(),o=a.length>0&&a[n-1]===`
121
121
  `,s=a.length>0&&a[n]===`
122
- `,c=o?n-1:n,h=s?n+1:n;return{beforeCursorCode:nr(e,0,c),afterCursorCode:nr(e,h)}}var Zl=Zn();const J1=Ce(!1);i_=function(){let e=(0,Zl.c)(2),n=Ol(),a;return e[0]===n?a=e[1]:(a=()=>n(qu(Wi())),e[0]=n,e[1]=a),xu(a)},y_=function(e){let n=(0,Zl.c)(3),a=Ol(),o;return n[0]!==e||n[1]!==a?(o=()=>{e!==void 0&&a([e])},n[0]=e,n[1]=a,n[2]=o):o=n[2],xu(o)},C_=function(){let e=(0,Zl.c)(2),n=Ol(),a;return e[0]===n?a=e[1]:(a=()=>n(X0(Wi())),e[0]=n,e[1]=a),xu(a)},Ol=function(){let e=(0,Zl.c)(4),{prepareForRun:n}=tm(),{sendRun:a}=aT(),o=K6(J1),s;return e[0]!==n||e[1]!==a||e[2]!==o?(s=async c=>{if(c.length===0)return;let h=Wi();return o(!0),km({cellIds:c,sendRun:a,prepareForRun:n,notebook:h})},e[0]=n,e[1]=a,e[2]=o,e[3]=s):s=e[3],xu(s)},km=async function({cellIds:e,sendRun:n,prepareForRun:a,notebook:o}){var p,g,b;if(e.length===0)return;let{cellHandles:s,cellData:c}=o,h=[];for(let _ of e){let S=(g=(p=s[_])==null?void 0:p.current)==null?void 0:g.editorView,C;S?(Cl(S)!=="markdown"&&kh(S),C=nr(S)):C=((b=c[_])==null?void 0:b.code)||"",h.push(C),a({cellId:_})}await n({cellIds:e,codes:h}).catch(_=>{be.error(_)})},Nm=function(){let e=Fe.get(vm);return Vu(e,"internal-error: initial mode not found"),rn(e!=="present","internal-error: initial mode cannot be 'present'"),e},M_=function(e){return e==="read"||e==="home"||e==="gallery"?e:e==="edit"?"present":"edit"},Yw=Ce({mode:M2()?"read":"not-set",cellAnchor:null}),vm=Ce(void 0),h_=Ce(!1);var PE=Ce(e=>{let n=e(J1),a=e(h5);if(n||a)return!1;let o=!0;try{o=Nm()==="read"}catch{return!0}return!o});x_=function(){return mn(PE)};var ec="data-temp-href-target";Rh.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&(e.hasAttribute("target")||e.setAttribute("target","_self"),e.hasAttribute("target")&&e.setAttribute(ec,e.getAttribute("target")||""))}),Rh.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(ec)&&(e.setAttribute("target",e.getAttribute(ec)||""),e.removeAttribute(ec),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener noreferrer"))}),mm=function(e){let n={USE_PROFILES:{html:!0,svg:!0,mathMl:!0},ADD_TAGS:["use"],ADD_ATTR:["href","xlink:href"],FORCE_BODY:!0,CUSTOM_ELEMENT_HANDLING:{tagNameCheck:/^(marimo-[A-Za-z][\w-]*|iconify-icon)$/,attributeNameCheck:/^[A-Za-z][\w-]*$/},SAFE_FOR_XML:!e.includes("marimo-mermaid")};return Rh.sanitize(e,n)};var NE=["marimo-carousel","marimo-tabs","marimo-accordion","marimo-sidebar"],DE="h1, h2, h3, h4, h5, h6";function jE(e){if(typeof DOMParser>"u")return null;let n=[],a=new DOMParser().parseFromString(e,"text/html").querySelectorAll(DE);for(let o of Array.from(a)){let s=o.textContent;if(NE.some(g=>o.closest(g))||!s)continue;let c=Number.parseInt(o.tagName[1],10),h=o.innerHTML,p={name:s,level:c,by:Mm(o)};h!==s&&(p.html=mm(h)),n.push(p)}return{items:n}}Mm=function(e){let n=e.id;if(n)return{id:n};let a=e.textContent;return{path:`//${e.tagName}[contains(., "${a}")]`}};function zE(e){return{items:e.filter(Boolean).flatMap(n=>n.items)}}Sm=function(e){if(e==null||e.mimetype!=="text/html"&&e.mimetype!=="text/markdown"||e.data==null)return null;try{return rn(typeof e.data=="string","expected string"),jE(e.data)}catch{return be.error("Failed to parse outline"),null}},w_=function(e){return e==null?!1:e.items.some(n=>n.level<=3)};function X1(e,n){let a=h=>h.items.length===0?7:Math.min(...h.items.map(p=>p.level)),o=n[e];if(o==null||o.items.length===0)return be.warn("Failed to find a starting outline"),null;let s=a(o),c=e+1;for(;c<n.length;){let h=n[c];if(h&&a(h)<=s)return[e,c-1];c++}return[e,n.length-1]}ld=function(e){return e==="application/vnd.marimo+error"||e==="application/vnd.marimo+traceback"},e_=Al("marimo:rtc:username","",td),Mh=qh(()=>Mu("rtc_v2"));let of,Y1,sf,hs;Yh=class dd{static fromMilliseconds(n){return n==null?null:new dd(n)}static fromSeconds(n){return n==null?null:new dd(n*1e3)}static now(){return new dd(Date.now())}constructor(n){this.ms=n}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}},of=(li=class{constructor(){ve(this,"lines",[""]);ve(this,"cursor",{row:0,col:0})}ensureLine(n){for(;this.lines.length<=n;)this.lines.push("")}moveCursor(n,a){let o=this.cursor.row;this.cursor.row=Math.max(0,this.cursor.row+n),this.cursor.col=Math.max(0,this.cursor.col+a),this.ensureLine(this.cursor.row),n<0&&this.cursor.row<o&&this.lines.splice(this.cursor.row+1)}setCursor(n,a){this.cursor.row=Math.max(0,n),this.cursor.col=Math.max(0,a),this.ensureLine(this.cursor.row)}writeChar(n){this.ensureLine(this.cursor.row);let a=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=a.slice(0,this.cursor.col)+n+a.slice(this.cursor.col+1),this.cursor.col++}writeString(n){if(n.length===0)return;this.ensureLine(this.cursor.row);let a=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=a.slice(0,this.cursor.col)+n+a.slice(this.cursor.col+n.length),this.cursor.col+=n.length}control(n){switch(n){case`
122
+ `,c=o?n-1:n,h=s?n+1:n;return{beforeCursorCode:nr(e,0,c),afterCursorCode:nr(e,h)}}var Zl=Zn();const J1=Ce(!1);a_=function(){let e=(0,Zl.c)(2),n=Al(),a;return e[0]===n?a=e[1]:(a=()=>n(qu(Wi())),e[0]=n,e[1]=a),xu(a)},v_=function(e){let n=(0,Zl.c)(3),a=Al(),o;return n[0]!==e||n[1]!==a?(o=()=>{e!==void 0&&a([e])},n[0]=e,n[1]=a,n[2]=o):o=n[2],xu(o)},T_=function(){let e=(0,Zl.c)(2),n=Al(),a;return e[0]===n?a=e[1]:(a=()=>n(X0(Wi())),e[0]=n,e[1]=a),xu(a)},Al=function(){let e=(0,Zl.c)(4),{prepareForRun:n}=tm(),{sendRun:a}=iT(),o=Q6(J1),s;return e[0]!==n||e[1]!==a||e[2]!==o?(s=async c=>{if(c.length===0)return;let h=Wi();return o(!0),km({cellIds:c,sendRun:a,prepareForRun:n,notebook:h})},e[0]=n,e[1]=a,e[2]=o,e[3]=s):s=e[3],xu(s)},km=async function({cellIds:e,sendRun:n,prepareForRun:a,notebook:o}){var p,g,b;if(e.length===0)return;let{cellHandles:s,cellData:c}=o,h=[];for(let _ of e){let S=(g=(p=s[_])==null?void 0:p.current)==null?void 0:g.editorView,C;S?(Cl(S)!=="markdown"&&kh(S),C=nr(S)):C=((b=c[_])==null?void 0:b.code)||"",h.push(C),a({cellId:_})}await n({cellIds:e,codes:h}).catch(_=>{be.error(_)})},Nm=function(){let e=Fe.get(vm);return Ru(e,"internal-error: initial mode not found"),rn(e!=="present","internal-error: initial mode cannot be 'present'"),e},N_=function(e){return e==="read"||e==="home"||e==="gallery"?e:e==="edit"?"present":"edit"},Zw=Ce({mode:M2()?"read":"not-set",cellAnchor:null}),vm=Ce(void 0),h_=Ce(!1);var NE=Ce(e=>{let n=e(J1),a=e(m5);if(n||a)return!1;let o=!0;try{o=Nm()==="read"}catch{return!0}return!o});S_=function(){return mn(NE)};var ec="data-temp-href-target";Rh.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&(e.hasAttribute("target")||e.setAttribute("target","_self"),e.hasAttribute("target")&&e.setAttribute(ec,e.getAttribute("target")||""))}),Rh.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(ec)&&(e.setAttribute("target",e.getAttribute(ec)||""),e.removeAttribute(ec),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener noreferrer"))}),mm=function(e){let n={USE_PROFILES:{html:!0,svg:!0,mathMl:!0},ADD_TAGS:["use"],ADD_ATTR:["href","xlink:href"],FORCE_BODY:!0,CUSTOM_ELEMENT_HANDLING:{tagNameCheck:/^(marimo-[A-Za-z][\w-]*|iconify-icon)$/,attributeNameCheck:/^[A-Za-z][\w-]*$/},SAFE_FOR_XML:!e.includes("marimo-mermaid")};return Rh.sanitize(e,n)};var DE=["marimo-carousel","marimo-tabs","marimo-accordion","marimo-sidebar"],jE="h1, h2, h3, h4, h5, h6";function zE(e){if(typeof DOMParser>"u")return null;let n=[],a=new DOMParser().parseFromString(e,"text/html").querySelectorAll(jE);for(let o of Array.from(a)){let s=o.textContent;if(DE.some(g=>o.closest(g))||!s)continue;let c=Number.parseInt(o.tagName[1],10),h=o.innerHTML,p={name:s,level:c,by:Mm(o)};h!==s&&(p.html=mm(h)),n.push(p)}return{items:n}}Mm=function(e){let n=e.id;if(n)return{id:n};let a=e.textContent;return{path:`//${e.tagName}[contains(., "${a}")]`}};function qE(e){return{items:e.filter(Boolean).flatMap(n=>n.items)}}Cm=function(e){if(e==null||e.mimetype!=="text/html"&&e.mimetype!=="text/markdown"||e.data==null)return null;try{return rn(typeof e.data=="string","expected string"),zE(e.data)}catch{return be.error("Failed to parse outline"),null}},__=function(e){return e==null?!1:e.items.some(n=>n.level<=3)};function X1(e,n){let a=h=>h.items.length===0?7:Math.min(...h.items.map(p=>p.level)),o=n[e];if(o==null||o.items.length===0)return be.warn("Failed to find a starting outline"),null;let s=a(o),c=e+1;for(;c<n.length;){let h=n[c];if(h&&a(h)<=s)return[e,c-1];c++}return[e,n.length-1]}sd=function(e){return e==="application/vnd.marimo+error"||e==="application/vnd.marimo+traceback"},t_=Rl("marimo:rtc:username","",ed),Mh=zh(()=>Mu("rtc_v2"));let of,Y1,sf,hs;Zh=class dd{static fromMilliseconds(n){return n==null?null:new dd(n)}static fromSeconds(n){return n==null?null:new dd(n*1e3)}static now(){return new dd(Date.now())}constructor(n){this.ms=n}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}},of=(li=class{constructor(){ve(this,"lines",[""]);ve(this,"cursor",{row:0,col:0})}ensureLine(n){for(;this.lines.length<=n;)this.lines.push("")}moveCursor(n,a){let o=this.cursor.row;this.cursor.row=Math.max(0,this.cursor.row+n),this.cursor.col=Math.max(0,this.cursor.col+a),this.ensureLine(this.cursor.row),n<0&&this.cursor.row<o&&this.lines.splice(this.cursor.row+1)}setCursor(n,a){this.cursor.row=Math.max(0,n),this.cursor.col=Math.max(0,a),this.ensureLine(this.cursor.row)}writeChar(n){this.ensureLine(this.cursor.row);let a=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=a.slice(0,this.cursor.col)+n+a.slice(this.cursor.col+1),this.cursor.col++}writeString(n){if(n.length===0)return;this.ensureLine(this.cursor.row);let a=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=a.slice(0,this.cursor.col)+n+a.slice(this.cursor.col+n.length),this.cursor.col+=n.length}control(n){switch(n){case`
123
123
  `:this.cursor.row++,this.cursor.col=0,this.ensureLine(this.cursor.row);break;case"\r":this.cursor.col=0;break;case" ":this.writeChar(" ");break;case"\b":this.cursor.col=Math.max(0,this.cursor.col-1);break;case"\v":this.cursor.row++,this.ensureLine(this.cursor.row);break}}handleEscape(n){let a=li.ESCAPE_REGEX.exec(n);if(!a){this.writeString(n);return}let o=a[1].split(";").map(s=>s===""?1:Number.parseInt(s,10));switch(a[2]){case"A":this.moveCursor(-o[0],0);break;case"B":this.moveCursor(o[0],0);break;case"C":this.moveCursor(0,o[0]);break;case"D":this.moveCursor(0,-o[0]);break;case"H":this.setCursor(o[0]-1||0,o[1]-1||0);break;case"J":o[0]===2&&(this.lines=[""],this.setCursor(0,0));break;case"K":switch(this.ensureLine(this.cursor.row),o[0]){case 0:this.lines[this.cursor.row]=this.lines[this.cursor.row].slice(0,this.cursor.col);break;case 1:{let s=this.lines[this.cursor.row].length;this.lines[this.cursor.row]=" ".repeat(this.cursor.col)+this.lines[this.cursor.row].slice(this.cursor.col,s);break}case 2:this.lines[this.cursor.row]="";break}break;default:this.writeString(n);break}}render(){return this.lines.join(`
124
124
  `)}},ve(li,"ESCAPE_REGEX",/\u001B\[([0-9;]*)([A-DJKH])/u),li),Y1=class{constructor(){ve(this,"ESC_REGEX",/\u001B(?:\[[0-9;]*[A-Za-z]|\([0-9A-Za-z])/gu)}parse(e){let n=[],a=0;for(let o of e.matchAll(this.ESC_REGEX)){let s=o.index??0;s>a&&n.push({type:"text",value:e.slice(a,s)}),n.push({type:"escape",value:o[0]}),a=s+o[0].length}return a<e.length&&n.push({type:"text",value:e.slice(a)}),n}},sf=class{constructor(){ve(this,"parser",new Y1);ve(this,"buffer",new of)}reduce(e){return this.reset(),this.append(e),this.render()}append(e){let n=this.parser.parse(e);if(n.length===1&&n[0].type==="text"){let a=n[0].value;if(!this.hasControlChars(a)){this.buffer.writeString(a);return}}for(let a of n)a.type==="text"?this.processText(a.value):this.buffer.handleEscape(a.value)}reset(){this.buffer=new of}render(){return this.buffer.render()}hasControlChars(e){for(let n of e)if(n<" ")return!0;return!1}processText(e){let n=0,a=e.length;for(let o=0;o<a;o++){let s=e[o];if(s===`
125
- `||s==="\r"||s===" "||s==="\b"||s==="\v"){if(o>n){let c=e.slice(n,o),h=this.filterControlChars(c);h.length>0&&this.buffer.writeString(h)}this.buffer.control(s),n=o+1}else if(s<" "){if(o>n){let c=e.slice(n,o);c.length>0&&this.buffer.writeString(c)}n=o+1}}if(n<a){let o=e.slice(n),s=this.filterControlChars(o);s.length>0&&this.buffer.writeString(s)}}filterControlChars(e){let n=!1;for(let o of e)if(o<" "){n=!0;break}if(!n)return e;let a="";for(let o of e)o>=" "&&(a+=o);return a}},hs=class Vm{constructor(n,a,o,s){ve(this,"ansiReducer",new sf);this.mimetype=n,this.channel=a,this.timestamp=o,this.ansiReducer=s,this._data=this.ansiReducer.render()}get data(){return this._data}static create(n){let a=new sf;return a.append(n.data),new Vm(n.mimetype,n.channel,n.timestamp,a)}appendData(n){return this.ansiReducer.append(n),new Vm(this.mimetype,this.channel,this.timestamp,this.ansiReducer)}toJSON(){return{mimetype:this.mimetype,channel:this.channel,timestamp:this.timestamp,data:this.data}}};function qE(e,n=5e3){let a=[...e];if(a.length<2)return ey(a.map(FE),n);let o=a[a.length-1],s=a[a.length-2];return BE(o,s)&&(Z1(o),Z1(s),a[a.length-2]=VE(s,o),a.pop()),ey(a,n)}function BE(e,n){let a=e.mimetype==="text/plain"&&n.mimetype==="text/plain";if(!a)return!1;let o=e.channel===n.channel,s=e.channel!=="stdin";return a&&o&&s}function FE(e){return e instanceof hs?e:typeof e.data=="string"?hs.create(e):e}function VE(e,n){return e instanceof hs?e.appendData(n.data):hs.create(e).appendData(n.data)}function Z1(e){rn(typeof e.data=="string","expected string output")}function ey(e,n){let a=0,o;for(o=e.length-1;o>=0&&a<n;o--){let p=e[o];p.mimetype==="text/plain"?(rn(typeof p.data=="string","expected string"),a+=p.data.split(`
125
+ `||s==="\r"||s===" "||s==="\b"||s==="\v"){if(o>n){let c=e.slice(n,o),h=this.filterControlChars(c);h.length>0&&this.buffer.writeString(h)}this.buffer.control(s),n=o+1}else if(s<" "){if(o>n){let c=e.slice(n,o);c.length>0&&this.buffer.writeString(c)}n=o+1}}if(n<a){let o=e.slice(n),s=this.filterControlChars(o);s.length>0&&this.buffer.writeString(s)}}filterControlChars(e){let n=!1;for(let o of e)if(o<" "){n=!0;break}if(!n)return e;let a="";for(let o of e)o>=" "&&(a+=o);return a}},hs=class Vm{constructor(n,a,o,s){ve(this,"ansiReducer",new sf);this.mimetype=n,this.channel=a,this.timestamp=o,this.ansiReducer=s,this._data=this.ansiReducer.render()}get data(){return this._data}static create(n){let a=new sf;return a.append(n.data),new Vm(n.mimetype,n.channel,n.timestamp,a)}appendData(n){return this.ansiReducer.append(n),new Vm(this.mimetype,this.channel,this.timestamp,this.ansiReducer)}toJSON(){return{mimetype:this.mimetype,channel:this.channel,timestamp:this.timestamp,data:this.data}}};function BE(e,n=5e3){let a=[...e];if(a.length<2)return ey(a.map(VE),n);let o=a[a.length-1],s=a[a.length-2];return FE(o,s)&&(Z1(o),Z1(s),a[a.length-2]=HE(s,o),a.pop()),ey(a,n)}function FE(e,n){let a=e.mimetype==="text/plain"&&n.mimetype==="text/plain";if(!a)return!1;let o=e.channel===n.channel,s=e.channel!=="stdin";return a&&o&&s}function VE(e){return e instanceof hs?e:typeof e.data=="string"?hs.create(e):e}function HE(e,n){return e instanceof hs?e.appendData(n.data):hs.create(e).appendData(n.data)}function Z1(e){rn(typeof e.data=="string","expected string output")}function ey(e,n){let a=0,o;for(o=e.length-1;o>=0&&a<n;o--){let p=e[o];p.mimetype==="text/plain"?(rn(typeof p.data=="string","expected string"),a+=p.data.split(`
126
126
  `).length):a++}if(a<n)return e;let s=o+1,c={channel:"stderr",mimetype:"text/html",data:`<pre>Streaming output truncated to last ${n} lines.
127
127
  </pre>`,timestamp:-1},h=e[s];if(h.mimetype==="text/plain"){rn(typeof h.data=="string","expected string");let p=h.data.split(`
128
128
  `),g=n-(a-p.length);return[c,{...h,data:p.slice(-g).join(`
129
- `)},...e.slice(s+1)]}return[c,...e.slice(s+1)]}function HE(e,n){let a={...e};switch(n.status){case"queued":a.interrupted=!1,a.errored=!1,a.runElapsedTimeMs=null,a.debuggerActive=!1;break;case"running":a.interrupted=!1,e.stopped&&(a.output=null),a.status==="queued"&&(a.consoleOutputs=[]),a.stopped=!1,a.runStartTimestamp=n.timestamp,a.lastRunStartTimestamp=n.timestamp;break;case"idle":e.runStartTimestamp&&(a.runElapsedTimeMs=Yh.fromSeconds((n.timestamp??0)-e.runStartTimestamp).toMilliseconds(),a.runStartTimestamp=null,a.staleInputs=!1),!e.lastRunStartTimestamp&&n.timestamp&&(a.lastRunStartTimestamp=n.timestamp),a.debuggerActive=!1;break;case null:break;case"disabled-transitively":break;case void 0:break;default:Xo(n.status)}a.output=n.output??a.output,a.staleInputs=n.stale_inputs??a.staleInputs,a.status=n.status??a.status,a.serialization=n.serialization;let o=!1;n.output!=null&&n.output.mimetype==="application/vnd.marimo+error"&&((a.status==="queued"||a.status==="running")&&(a.status="idle"),rn(Array.isArray(n.output.data),"Expected error output data to be an array"),n.output.data.some(p=>p.type==="interruption")?(a.interrupted=!0,o=!0):n.output.data.some(p=>p.type.includes("ancestor"))?a.stopped=!0:a.errored=!0);let s=e.consoleOutputs;o&&(a.debuggerActive=!1,s=s.map(p=>p.channel==="stdin"?{...p,response:p.response??""}:p));let c=n.console;c!=null&&(s=qE(Array.isArray(c)?c:[...s,c])),a.consoleOutputs=s,a.outline=Sm(a.output);let h=[n.console].flat().filter(Boolean).filter(p=>p.channel==="pdb");return h.length>0&&h.some(p=>p.data==="start")&&(a.debuggerActive=!0),a}function $E(e){let n={...e};return e.status!=="disabled-transitively"&&(n.status="queued"),n.interrupted=!1,n.errored=!1,n.runElapsedTimeMs=null,n.debuggerActive=!1,n}im=function(e){return e==="running"||e==="queued"},Hw=function(e,n){let{status:a,output:o,runStartTimestamp:s,interrupted:c,staleInputs:h}=e;if(c)return!1;if(n)return!0;let p=im(a),g=a==="running"&&o!==null&&s!==null&&(o.timestamp??0)>s;return p&&!g?!0:h};function WE(e,n){return mT(e*1e3,n==null?void 0:n.in)}var lf=function(e,n){return Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,e},pt;(function(e){e[e.EOS=0]="EOS",e[e.Text=1]="Text",e[e.Incomplete=2]="Incomplete",e[e.ESC=3]="ESC",e[e.Unknown=4]="Unknown",e[e.SGR=5]="SGR",e[e.OSCURL=6]="OSCURL"})(pt||(pt={})),cm=class{constructor(){this.VERSION="6.0.6",this.setup_palettes(),this._use_classes=!1,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1,this.fg=this.bg=null,this._buffer="",this._url_allowlist={http:1,https:1},this._escape_html=!0,this.boldStyle="font-weight:bold",this.faintStyle="opacity:0.7",this.italicStyle="font-style:italic",this.underlineStyle="text-decoration:underline"}set use_classes(e){this._use_classes=e}get use_classes(){return this._use_classes}set url_allowlist(e){this._url_allowlist=e}get url_allowlist(){return this._url_allowlist}set escape_html(e){this._escape_html=e}get escape_html(){return this._escape_html}set boldStyle(e){this._boldStyle=e}get boldStyle(){return this._boldStyle}set faintStyle(e){this._faintStyle=e}get faintStyle(){return this._faintStyle}set italicStyle(e){this._italicStyle=e}get italicStyle(){return this._italicStyle}set underlineStyle(e){this._underlineStyle=e}get underlineStyle(){return this._underlineStyle}setup_palettes(){this.ansi_colors=[[{rgb:[0,0,0],class_name:"ansi-black"},{rgb:[187,0,0],class_name:"ansi-red"},{rgb:[0,187,0],class_name:"ansi-green"},{rgb:[187,187,0],class_name:"ansi-yellow"},{rgb:[0,0,187],class_name:"ansi-blue"},{rgb:[187,0,187],class_name:"ansi-magenta"},{rgb:[0,187,187],class_name:"ansi-cyan"},{rgb:[255,255,255],class_name:"ansi-white"}],[{rgb:[85,85,85],class_name:"ansi-bright-black"},{rgb:[255,85,85],class_name:"ansi-bright-red"},{rgb:[0,255,0],class_name:"ansi-bright-green"},{rgb:[255,255,85],class_name:"ansi-bright-yellow"},{rgb:[85,85,255],class_name:"ansi-bright-blue"},{rgb:[255,85,255],class_name:"ansi-bright-magenta"},{rgb:[85,255,255],class_name:"ansi-bright-cyan"},{rgb:[255,255,255],class_name:"ansi-bright-white"}]],this.palette_256=[],this.ansi_colors.forEach(a=>{a.forEach(o=>{this.palette_256.push(o)})});let e=[0,95,135,175,215,255];for(let a=0;a<6;++a)for(let o=0;o<6;++o)for(let s=0;s<6;++s){let c={rgb:[e[a],e[o],e[s]],class_name:"truecolor"};this.palette_256.push(c)}let n=8;for(let a=0;a<24;++a,n+=10){let o={rgb:[n,n,n],class_name:"truecolor"};this.palette_256.push(o)}}escape_txt_for_html(e){return this._escape_html?e.replace(/[&<>"']/gm,n=>{if(n==="&")return"&amp;";if(n==="<")return"&lt;";if(n===">")return"&gt;";if(n==='"')return"&quot;";if(n==="'")return"&#x27;"}):e}append_buffer(e){this._buffer+=e}get_next_packet(){var e={kind:pt.EOS,text:"",url:""},n=this._buffer.length;if(n==0)return e;var a=this._buffer.indexOf("\x1B");if(a==-1)return e.kind=pt.Text,e.text=this._buffer,this._buffer="",e;if(a>0)return e.kind=pt.Text,e.text=this._buffer.slice(0,a),this._buffer=this._buffer.slice(a),e;if(a==0){if(n<3)return e.kind=pt.Incomplete,e;var o=this._buffer.charAt(1);if(o!="["&&o!="]"&&o!="(")return e.kind=pt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;if(o=="["){this._csi_regex||(this._csi_regex=ty(KE||(KE=lf([`
129
+ `)},...e.slice(s+1)]}return[c,...e.slice(s+1)]}function $E(e,n){let a={...e};switch(n.status){case"queued":a.interrupted=!1,a.errored=!1,a.runElapsedTimeMs=null,a.debuggerActive=!1;break;case"running":a.interrupted=!1,e.stopped&&(a.output=null),a.status==="queued"&&(a.consoleOutputs=[]),a.stopped=!1,a.runStartTimestamp=n.timestamp,a.lastRunStartTimestamp=n.timestamp;break;case"idle":e.runStartTimestamp&&(a.runElapsedTimeMs=Zh.fromSeconds((n.timestamp??0)-e.runStartTimestamp).toMilliseconds(),a.runStartTimestamp=null,a.staleInputs=!1),!e.lastRunStartTimestamp&&n.timestamp&&(a.lastRunStartTimestamp=n.timestamp),a.debuggerActive=!1;break;case null:break;case"disabled-transitively":break;case void 0:break;default:Xo(n.status)}a.output=n.output??a.output,a.staleInputs=n.stale_inputs??a.staleInputs,a.status=n.status??a.status,a.serialization=n.serialization;let o=!1;n.output!=null&&n.output.mimetype==="application/vnd.marimo+error"&&((a.status==="queued"||a.status==="running")&&(a.status="idle"),rn(Array.isArray(n.output.data),"Expected error output data to be an array"),n.output.data.some(p=>p.type==="interruption")?(a.interrupted=!0,o=!0):n.output.data.some(p=>p.type.includes("ancestor"))?a.stopped=!0:a.errored=!0);let s=e.consoleOutputs;o&&(a.debuggerActive=!1,s=s.map(p=>p.channel==="stdin"?{...p,response:p.response??""}:p));let c=n.console;c!=null&&(s=BE(Array.isArray(c)?c:[...s,c])),a.consoleOutputs=s,a.outline=Cm(a.output);let h=[n.console].flat().filter(Boolean).filter(p=>p.channel==="pdb");return h.length>0&&h.some(p=>p.data==="start")&&(a.debuggerActive=!0),a}function WE(e){let n={...e};return e.status!=="disabled-transitively"&&(n.status="queued"),n.interrupted=!1,n.errored=!1,n.runElapsedTimeMs=null,n.debuggerActive=!1,n}im=function(e){return e==="running"||e==="queued"},$w=function(e,n){let{status:a,output:o,runStartTimestamp:s,interrupted:c,staleInputs:h}=e;if(c)return!1;if(n)return!0;let p=im(a),g=a==="running"&&o!==null&&s!==null&&(o.timestamp??0)>s;return p&&!g?!0:h};function UE(e,n){return gT(e*1e3,n==null?void 0:n.in)}var lf=function(e,n){return Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,e},pt;(function(e){e[e.EOS=0]="EOS",e[e.Text=1]="Text",e[e.Incomplete=2]="Incomplete",e[e.ESC=3]="ESC",e[e.Unknown=4]="Unknown",e[e.SGR=5]="SGR",e[e.OSCURL=6]="OSCURL"})(pt||(pt={})),cm=class{constructor(){this.VERSION="6.0.6",this.setup_palettes(),this._use_classes=!1,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1,this.fg=this.bg=null,this._buffer="",this._url_allowlist={http:1,https:1},this._escape_html=!0,this.boldStyle="font-weight:bold",this.faintStyle="opacity:0.7",this.italicStyle="font-style:italic",this.underlineStyle="text-decoration:underline"}set use_classes(e){this._use_classes=e}get use_classes(){return this._use_classes}set url_allowlist(e){this._url_allowlist=e}get url_allowlist(){return this._url_allowlist}set escape_html(e){this._escape_html=e}get escape_html(){return this._escape_html}set boldStyle(e){this._boldStyle=e}get boldStyle(){return this._boldStyle}set faintStyle(e){this._faintStyle=e}get faintStyle(){return this._faintStyle}set italicStyle(e){this._italicStyle=e}get italicStyle(){return this._italicStyle}set underlineStyle(e){this._underlineStyle=e}get underlineStyle(){return this._underlineStyle}setup_palettes(){this.ansi_colors=[[{rgb:[0,0,0],class_name:"ansi-black"},{rgb:[187,0,0],class_name:"ansi-red"},{rgb:[0,187,0],class_name:"ansi-green"},{rgb:[187,187,0],class_name:"ansi-yellow"},{rgb:[0,0,187],class_name:"ansi-blue"},{rgb:[187,0,187],class_name:"ansi-magenta"},{rgb:[0,187,187],class_name:"ansi-cyan"},{rgb:[255,255,255],class_name:"ansi-white"}],[{rgb:[85,85,85],class_name:"ansi-bright-black"},{rgb:[255,85,85],class_name:"ansi-bright-red"},{rgb:[0,255,0],class_name:"ansi-bright-green"},{rgb:[255,255,85],class_name:"ansi-bright-yellow"},{rgb:[85,85,255],class_name:"ansi-bright-blue"},{rgb:[255,85,255],class_name:"ansi-bright-magenta"},{rgb:[85,255,255],class_name:"ansi-bright-cyan"},{rgb:[255,255,255],class_name:"ansi-bright-white"}]],this.palette_256=[],this.ansi_colors.forEach(a=>{a.forEach(o=>{this.palette_256.push(o)})});let e=[0,95,135,175,215,255];for(let a=0;a<6;++a)for(let o=0;o<6;++o)for(let s=0;s<6;++s){let c={rgb:[e[a],e[o],e[s]],class_name:"truecolor"};this.palette_256.push(c)}let n=8;for(let a=0;a<24;++a,n+=10){let o={rgb:[n,n,n],class_name:"truecolor"};this.palette_256.push(o)}}escape_txt_for_html(e){return this._escape_html?e.replace(/[&<>"']/gm,n=>{if(n==="&")return"&amp;";if(n==="<")return"&lt;";if(n===">")return"&gt;";if(n==='"')return"&quot;";if(n==="'")return"&#x27;"}):e}append_buffer(e){this._buffer+=e}get_next_packet(){var e={kind:pt.EOS,text:"",url:""},n=this._buffer.length;if(n==0)return e;var a=this._buffer.indexOf("\x1B");if(a==-1)return e.kind=pt.Text,e.text=this._buffer,this._buffer="",e;if(a>0)return e.kind=pt.Text,e.text=this._buffer.slice(0,a),this._buffer=this._buffer.slice(a),e;if(a==0){if(n<3)return e.kind=pt.Incomplete,e;var o=this._buffer.charAt(1);if(o!="["&&o!="]"&&o!="(")return e.kind=pt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;if(o=="["){this._csi_regex||(this._csi_regex=ty(QE||(QE=lf([`
130
130
  ^ # beginning of line
131
131
  #
132
132
  # First attempt
@@ -160,7 +160,7 @@ mark line col
160
160
  [\\x20-\\x7e]* # anything legal
161
161
  ([\\x00-\\x1f:]) # anything illegal
162
162
  )
163
- `]))));let c=this._buffer.match(this._csi_regex);if(c===null)return e.kind=pt.Incomplete,e;if(c[4])return e.kind=pt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;c[1]!=""||c[3]!="m"?e.kind=pt.Unknown:e.kind=pt.SGR,e.text=c[2];var s=c[0].length;return this._buffer=this._buffer.slice(s),e}else if(o=="]"){if(n<4)return e.kind=pt.Incomplete,e;if(this._buffer.charAt(2)!="8"||this._buffer.charAt(3)!=";")return e.kind=pt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;this._osc_st||(this._osc_st=UE(QE||(QE=lf([`
163
+ `]))));let c=this._buffer.match(this._csi_regex);if(c===null)return e.kind=pt.Incomplete,e;if(c[4])return e.kind=pt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;c[1]!=""||c[3]!="m"?e.kind=pt.Unknown:e.kind=pt.SGR,e.text=c[2];var s=c[0].length;return this._buffer=this._buffer.slice(s),e}else if(o=="]"){if(n<4)return e.kind=pt.Incomplete,e;if(this._buffer.charAt(2)!="8"||this._buffer.charAt(3)!=";")return e.kind=pt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;this._osc_st||(this._osc_st=KE(GE||(GE=lf([`
164
164
  (?: # legal sequence
165
165
  (\x1B) # ESC | # alternate
166
166
  (\x07) # BEL (what xterm did)
@@ -187,7 +187,7 @@ mark line col
187
187
  | # alternate
188
188
  [\\x1c-\\x1f] # anything illegal
189
189
  )
190
- `])))),this._osc_st.lastIndex=0;{let p=this._osc_st.exec(this._buffer);if(p===null)return e.kind=pt.Incomplete,e;if(p[3])return e.kind=pt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e}{let p=this._osc_st.exec(this._buffer);if(p===null)return e.kind=pt.Incomplete,e;if(p[3])return e.kind=pt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e}this._osc_regex||(this._osc_regex=ty(GE||(GE=lf([`
190
+ `])))),this._osc_st.lastIndex=0;{let p=this._osc_st.exec(this._buffer);if(p===null)return e.kind=pt.Incomplete,e;if(p[3])return e.kind=pt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e}{let p=this._osc_st.exec(this._buffer);if(p===null)return e.kind=pt.Incomplete,e;if(p[3])return e.kind=pt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e}this._osc_regex||(this._osc_regex=ty(JE||(JE=lf([`
191
191
  ^ # beginning of line
192
192
  #
193
193
  \x1B]8; # OSC Hyperlink
@@ -223,7 +223,7 @@ mark line col
223
223
  | # alternate
224
224
  (?:\\x07) # BEL (what xterm did)
225
225
  )
226
- `]))));let c=this._buffer.match(this._osc_regex);if(c===null)return e.kind=pt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;e.kind=pt.OSCURL,e.url=c[1],e.text=c[2];var s=c[0].length;return this._buffer=this._buffer.slice(s),e}else if(o=="(")return e.kind=pt.Unknown,this._buffer=this._buffer.slice(3),e}}ansi_to_html(e){this.append_buffer(e);for(var n=[];;){var a=this.get_next_packet();if(a.kind==pt.EOS||a.kind==pt.Incomplete)break;a.kind==pt.ESC||a.kind==pt.Unknown||(a.kind==pt.Text?n.push(this.transform_to_html(this.with_state(a))):a.kind==pt.SGR?this.process_ansi(a):a.kind==pt.OSCURL&&n.push(this.process_hyperlink(a)))}return n.join("")}with_state(e){return{bold:this.bold,faint:this.faint,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:e.text}}process_ansi(e){let n=e.text.split(";");for(;n.length>0;){let a=n.shift(),o=parseInt(a,10);if(isNaN(o)||o===0)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(o===1)this.bold=!0;else if(o===2)this.faint=!0;else if(o===3)this.italic=!0;else if(o===4)this.underline=!0;else if(o===21)this.bold=!1;else if(o===22)this.faint=!1,this.bold=!1;else if(o===23)this.italic=!1;else if(o===24)this.underline=!1;else if(o===39)this.fg=null;else if(o===49)this.bg=null;else if(o>=30&&o<38)this.fg=this.ansi_colors[0][o-30];else if(o>=40&&o<48)this.bg=this.ansi_colors[0][o-40];else if(o>=90&&o<98)this.fg=this.ansi_colors[1][o-90];else if(o>=100&&o<108)this.bg=this.ansi_colors[1][o-100];else if((o===38||o===48)&&n.length>0){let s=o===38,c=n.shift();if(c==="5"&&n.length>0){let h=parseInt(n.shift(),10);h>=0&&h<=255&&(s?this.fg=this.palette_256[h]:this.bg=this.palette_256[h])}if(c==="2"&&n.length>2){let h=parseInt(n.shift(),10),p=parseInt(n.shift(),10),g=parseInt(n.shift(),10);if(h>=0&&h<=255&&p>=0&&p<=255&&g>=0&&g<=255){let b={rgb:[h,p,g],class_name:"truecolor"};s?this.fg=b:this.bg=b}}}}}transform_to_html(e){let n=e.text;if(n.length===0||(n=this.escape_txt_for_html(n),!e.bold&&!e.italic&&!e.faint&&!e.underline&&e.fg===null&&e.bg===null))return n;let a=[],o=[],s=e.fg,c=e.bg;e.bold&&a.push(this._boldStyle),e.faint&&a.push(this._faintStyle),e.italic&&a.push(this._italicStyle),e.underline&&a.push(this._underlineStyle),this._use_classes?(s&&(s.class_name==="truecolor"?a.push(`color:rgb(${s.rgb.join(",")})`):o.push(`${s.class_name}-fg`)),c&&(c.class_name==="truecolor"?a.push(`background-color:rgb(${c.rgb.join(",")})`):o.push(`${c.class_name}-bg`))):(s&&a.push(`color:rgb(${s.rgb.join(",")})`),c&&a.push(`background-color:rgb(${c.rgb})`));let h="",p="";return o.length&&(h=` class="${o.join(" ")}"`),a.length&&(p=` style="${a.join(";")}"`),`<span${p}${h}>${n}</span>`}process_hyperlink(e){let n=e.url.split(":");return n.length<1||!this._url_allowlist[n[0]]?"":`<a href="${this.escape_txt_for_html(e.url)}">${this.escape_txt_for_html(e.text)}</a>`}};function ty(e,...n){let a=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(a)}function UE(e,...n){let a=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(a,"g")}var KE,QE,GE,JE=new cm;Du=function(e){try{let n=document.createElement("div");return n.innerHTML=e,(n.textContent||n.innerText||"").split(`
226
+ `]))));let c=this._buffer.match(this._osc_regex);if(c===null)return e.kind=pt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;e.kind=pt.OSCURL,e.url=c[1],e.text=c[2];var s=c[0].length;return this._buffer=this._buffer.slice(s),e}else if(o=="(")return e.kind=pt.Unknown,this._buffer=this._buffer.slice(3),e}}ansi_to_html(e){this.append_buffer(e);for(var n=[];;){var a=this.get_next_packet();if(a.kind==pt.EOS||a.kind==pt.Incomplete)break;a.kind==pt.ESC||a.kind==pt.Unknown||(a.kind==pt.Text?n.push(this.transform_to_html(this.with_state(a))):a.kind==pt.SGR?this.process_ansi(a):a.kind==pt.OSCURL&&n.push(this.process_hyperlink(a)))}return n.join("")}with_state(e){return{bold:this.bold,faint:this.faint,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:e.text}}process_ansi(e){let n=e.text.split(";");for(;n.length>0;){let a=n.shift(),o=parseInt(a,10);if(isNaN(o)||o===0)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(o===1)this.bold=!0;else if(o===2)this.faint=!0;else if(o===3)this.italic=!0;else if(o===4)this.underline=!0;else if(o===21)this.bold=!1;else if(o===22)this.faint=!1,this.bold=!1;else if(o===23)this.italic=!1;else if(o===24)this.underline=!1;else if(o===39)this.fg=null;else if(o===49)this.bg=null;else if(o>=30&&o<38)this.fg=this.ansi_colors[0][o-30];else if(o>=40&&o<48)this.bg=this.ansi_colors[0][o-40];else if(o>=90&&o<98)this.fg=this.ansi_colors[1][o-90];else if(o>=100&&o<108)this.bg=this.ansi_colors[1][o-100];else if((o===38||o===48)&&n.length>0){let s=o===38,c=n.shift();if(c==="5"&&n.length>0){let h=parseInt(n.shift(),10);h>=0&&h<=255&&(s?this.fg=this.palette_256[h]:this.bg=this.palette_256[h])}if(c==="2"&&n.length>2){let h=parseInt(n.shift(),10),p=parseInt(n.shift(),10),g=parseInt(n.shift(),10);if(h>=0&&h<=255&&p>=0&&p<=255&&g>=0&&g<=255){let b={rgb:[h,p,g],class_name:"truecolor"};s?this.fg=b:this.bg=b}}}}}transform_to_html(e){let n=e.text;if(n.length===0||(n=this.escape_txt_for_html(n),!e.bold&&!e.italic&&!e.faint&&!e.underline&&e.fg===null&&e.bg===null))return n;let a=[],o=[],s=e.fg,c=e.bg;e.bold&&a.push(this._boldStyle),e.faint&&a.push(this._faintStyle),e.italic&&a.push(this._italicStyle),e.underline&&a.push(this._underlineStyle),this._use_classes?(s&&(s.class_name==="truecolor"?a.push(`color:rgb(${s.rgb.join(",")})`):o.push(`${s.class_name}-fg`)),c&&(c.class_name==="truecolor"?a.push(`background-color:rgb(${c.rgb.join(",")})`):o.push(`${c.class_name}-bg`))):(s&&a.push(`color:rgb(${s.rgb.join(",")})`),c&&a.push(`background-color:rgb(${c.rgb})`));let h="",p="";return o.length&&(h=` class="${o.join(" ")}"`),a.length&&(p=` style="${a.join(";")}"`),`<span${p}${h}>${n}</span>`}process_hyperlink(e){let n=e.url.split(":");return n.length<1||!this._url_allowlist[n[0]]?"":`<a href="${this.escape_txt_for_html(e.url)}">${this.escape_txt_for_html(e.text)}</a>`}};function ty(e,...n){let a=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(a)}function KE(e,...n){let a=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(a,"g")}var QE,GE,JE,XE=new cm;Du=function(e){try{let n=document.createElement("div");return n.innerHTML=e,(n.textContent||n.innerText||"").split(`
227
227
  `).map(a=>a.trimEnd()).join(`
228
- `)}catch(n){return be.error("Error parsing HTML content:",n),e}},E_=function(e){if(!e)return"";try{return Du(JE.ansi_to_html(e))}catch(n){return be.error("Error converting ANSI to plain text:",n),e}},Kh={startCase:e=>{if(!e)return"";if(typeof e!="string")throw be.error(e),TypeError(`Expected string, got ${typeof e}`);return/[A-Za-z]/.test(e)?u5(e):e},htmlEscape:e=>e&&e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;").replaceAll(`
229
- `," "),withTrailingSlash(e){return e.endsWith("/")?e:`${e}/`},withoutTrailingSlash(e){return e.endsWith("/")?e.slice(0,-1):e},withoutLeadingSlash(e){return e.startsWith("/")?e.slice(1):e},asString:e=>{if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}};var ny=!1;function XE(e){var o;let n=[],a=[e.console].filter(Boolean).flat();for(let s of a){let c=s.mimetype==="text/plain",h=s.mimetype==="text/html"||s.mimetype==="application/vnd.marimo+traceback";if(c||h){let p=s.channel==="stderr"||s.channel==="marimo-error";switch(s.channel){case"stdout":case"stderr":case"marimo-error":{let g=Kh.asString(s.data),b=h?Du(g):g;n.push({timestamp:s.timestamp||Date.now(),level:p?"stderr":"stdout",message:b,cellId:e.cell_id});break}default:break}}}if(n.forEach(ry.log),a.length===0&&ld((o=e.output)==null?void 0:o.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(c=>{ry.log({level:"stderr",cellId:e.cell_id,timestamp:e.timestamp??0,message:JSON.stringify(c)})});let s=e.output.data.some(c=>c.type==="internal");!ny&&s&&(ny=!0,vl({title:"An internal error occurred",description:"See console for details.",className:"text-xs text-background bg-(--red-10) py-2 pl-3 *:flex *:gap-3"}))}return n}var ry={log:e=>{let n=e.level==="stdout"?"gray":e.level==="stderr"?"red":"orange",a=e.level.toUpperCase();console.log(`%c[${a}]`,`color:${n}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${Hh(e.timestamp)}]`,`(${e.cellId}) ${e.message}`)}};Hh=function(e){try{return WE(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},gw=function(e,n){let a=Ju(n);a?a.focus():be.warn(`[CellFocusManager] focusCellEditor: element not found: ${n}`)},qw=function(e){let n=document.getElementById(En.create(e));n?cf(n):be.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},Fw=function(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})},rm=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function cf(e){try{e.focus()}catch{be.warn("[CellFocusManager] element may not be focusable",e)}}Dh=function(e,n){let{retries:a,delay:o,initialDelay:s=0}=n,c=0,h=()=>{if(c<a){try{if(e())return}catch(p){be.error(`Error executing function on attempt ${c+1}, retrying`,{error:p})}c++,setTimeout(h,o)}};s>0?setTimeout(h,s):h()};function ms({cellId:e,cell:n,isCodeHidden:a,codeFocus:o,variableName:s}){var h;if(!n)return;let c=document.getElementById(En.create(e));if(!c){be.warn("scrollCellIntoView: element not found");return}if(rm()){cf(c);return}if(a)cf(c);else{let p=(h=n.current)==null?void 0:h.editorView;if(!p){be.warn("scrollCellIntoView: editor not found",e);return}if(p.hasFocus||!document.hasFocus())return;if(Dh(()=>(p.focus(),p.hasFocus),{retries:5,delay:20}),o==="top")p.dispatch({selection:{anchor:0,head:0}});else if(o==="bottom"){let g=p.state.doc.line(p.state.doc.lines);p.dispatch({selection:{anchor:g.from,head:g.from}})}else s&&Gu(p,s)}c.scrollIntoView({behavior:"smooth",block:"nearest"})}Ow=function(e){let n=document.getElementById(En.create(e));if(!n){be.warn("scrollCellIntoView: element not found");return}n.classList.add("focus-outline"),setTimeout(()=>{n.classList.remove("focus-outline")},2e3),n.scrollIntoView({behavior:"smooth",block:"center"})};function YE(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function ZE(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}U_=function(e){let n=Ju(e);if(n!=null&&n.hasFocus){Ag(n,{behavior:"instant"});return}let a=document.getElementById(En.create(e));a?a.scrollIntoView({behavior:"instant",block:"nearest"}):be.warn(`[CellFocusManager] scrollCellIntoView: element not found: ${e}`)},er=function({id:e,name:n="_",code:a="",lastCodeRun:o=null,lastExecutionTime:s=null,edited:c=!1,config:h,serializedEditorState:p=null}){return{id:e,config:h||{hide_code:!1,disabled:!1,column:null},name:n,code:a,edited:c,lastCodeRun:o,lastExecutionTime:s,serializedEditorState:p}};function e4(e){return{hide_code:!1,disabled:!1,column:null,...e}}tr=function(e){return{outline:null,output:null,consoleOutputs:[],status:"idle",staleInputs:!1,interrupted:!1,errored:!1,stopped:!1,runElapsedTimeMs:null,runStartTimestamp:null,lastRunStartTimestamp:null,debuggerActive:!1,...e}};var uf=Zn();function ay(e){let n={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[os]:er({id:os,config:n}),...e.cellData},cellRuntime:{[os]:tr(),...e.cellRuntime},cellHandles:{[os]:(0,gt.createRef)(),...e.cellHandles}}}function t4(){return ay({cellIds:bl.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let n4,r4,iy;({reducer:n4,createActions:r4,useActions:iy,valueAtom:Ye}=yl(t4,{createNewCell:(e,n)=>{var O;let{cellId:a,before:o,code:s,lastCodeRun:c=null,lastExecutionTime:h=null,autoFocus:p=!0,skipIfCodeExists:g=!1,hideCode:b=!1}=n,_,S;if(g){for(let M of e.cellIds.inOrderIds)if(((O=e.cellData[M])==null?void 0:O.code)===s)return e}if(a==="__end__"){let M=e.cellIds.atOrThrow(0);_=M.id,S=M.length}else if(typeof a=="string"){let M=e.cellIds.findWithId(a);_=M.id,S=M.topLevelIds.indexOf(a)}else if(a.type==="__end__"){let M=e.cellIds.get(a.columnId)||e.cellIds.atOrThrow(0);_=M.id,S=M.length}else throw Error("Invalid cellId");let C=n.newCellId||Xa.create(),E=o?S:S+1;return{...e,cellIds:e.cellIds.insertId(C,_,E),cellData:{...e.cellData,[C]:er({id:C,code:s,lastCodeRun:c,config:e4({hide_code:b}),lastExecutionTime:h,edited:!!s&&s!==c})},cellRuntime:{...e.cellRuntime,[C]:tr()},cellHandles:{...e.cellHandles,[C]:(0,gt.createRef)()},scrollKey:p?C:null,untouchedNewCells:b?new Set([...e.untouchedNewCells,C]):e.untouchedNewCells}},moveCell:(e,n)=>{let{cellId:a,before:o,direction:s}=n;if(o!==void 0&&s!==void 0&&be.warn("Both before and direction specified for moveCell. Ignoring one."),s){let p=e.cellIds.findWithId(a),g=e.cellIds.indexOf(p),b=s==="left"?g-1:g+1,_=e.cellIds.at(b);return _?{...e,cellIds:e.cellIds.moveAcrossColumns(p.id,a,_.id,void 0),scrollKey:a}:e}let c=e.cellIds.findWithId(a),h=c.indexOfOrThrow(a);return o&&h===0?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,h,0),scrollKey:a}:!o&&h===c.length-1?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,h,c.length-1),scrollKey:a}:o?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,h,h-1),scrollKey:a}:{...e,cellIds:e.cellIds.moveWithinColumn(c.id,h,h+1),scrollKey:a}},dropCellOverCell:(e,n)=>{let{cellId:a,overCellId:o}=n,s=e.cellIds.findWithId(a),c=e.cellIds.findWithId(o),h=s.indexOfOrThrow(a),p=c.indexOfOrThrow(o);return s.id===c.id?h===p?e:{...e,cellIds:e.cellIds.moveWithinColumn(s.id,h,p),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,a,c.id,o),scrollKey:null}},dropCellOverColumn:(e,n)=>{let{cellId:a,columnId:o}=n,s=e.cellIds.findWithId(a);return{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,a,o,void 0)}},dropOverNewColumn:(e,n)=>{let{cellId:a}=n;return{...e,cellIds:e.cellIds.moveToNewColumn(a)}},moveColumn:(e,n)=>n.column===n.overColumn?e:{...e,cellIds:e.cellIds.moveColumn(n.column,n.overColumn)},focusCell:(e,n)=>{let a=e.cellIds.findWithId(n.cellId);if(a.length===0)return e;let{cellId:o,where:s}=n,c=a.indexOfOrThrow(o),h;h=s==="before"?xh(c-1,0,a.length-1):s==="after"?xh(c+1,0,a.length-1):c;let p=a.atOrThrow(h);return ms({cellId:p,cell:e.cellHandles[p],isCodeHidden:gs(e,p),codeFocus:s==="after"?"top":"bottom",variableName:void 0}),e},focusTopCell:e=>{let n=e.cellIds.getColumns().at(0);if(n===void 0||n.length===0)return e;let a=n.first();return ms({cellId:a,cell:e.cellHandles[a],isCodeHidden:gs(e,a),codeFocus:void 0,variableName:void 0}),ZE(),e},focusBottomCell:e=>{let n=e.cellIds.getColumns().at(-1);if(n===void 0||n.length===0)return e;let a=n.last();return ms({cellId:a,cell:e.cellHandles[a],isCodeHidden:gs(e,a),codeFocus:void 0,variableName:void 0}),YE(),e},sendToTop:(e,n)=>{let a=e.cellIds.findWithId(n.cellId);if(a.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=a.indexOfOrThrow(o);return c===0?e:{...e,cellIds:e.cellIds.moveWithinColumn(a.id,c,0),scrollKey:s?o:null}},sendToBottom:(e,n)=>{let a=e.cellIds.findWithId(n.cellId);if(a.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=a.indexOfOrThrow(o),h=a.length-1;return c===h?e:{...e,cellIds:e.cellIds.moveWithinColumn(a.id,c,h),scrollKey:s?o:null}},addColumn:(e,n)=>{let a=Xa.create();return{...e,cellIds:e.cellIds.addColumn(n.columnId,[a]),cellData:{...e.cellData,[a]:er({id:a})},cellRuntime:{...e.cellRuntime,[a]:tr()},cellHandles:{...e.cellHandles,[a]:(0,gt.createRef)()},scrollKey:a}},addColumnBreakpoint:(e,n)=>{let{cellId:a}=n;return e.cellIds.getColumns()[0].inOrderIds[0]===a?e:{...e,cellIds:e.cellIds.insertBreakpoint(a)}},deleteColumn:(e,n)=>{let{columnId:a}=n;return{...e,cellIds:e.cellIds.delete(a)}},mergeAllColumns:e=>({...e,cellIds:e.cellIds.mergeAllColumns()}),compactColumns:e=>({...e,cellIds:e.cellIds.compact()}),deleteCell:(e,n)=>{var b,_;let a=n.cellId;if(e.cellIds.hasOnlyOneId())return e;let o=e.cellIds.findWithId(a),s=o.indexOfOrThrow(a),c=s===0?1:s-1,h=null;o.length>1&&(h=o.atOrThrow(c));let p=(_=(b=e.cellHandles[a].current)==null?void 0:b.editorView)==null?void 0:_.state.toJSON({history:G5});p.doc=e.cellData[a].code,o4(a);let g=e.cellData[a];return{...e,cellIds:e.cellIds.deleteById(a),history:[...e.history,{name:g.name,serializedEditorState:p,column:o.id,index:s,isSetupCell:a===Vn,config:g.config}],scrollKey:h}},undoDeleteCell:e=>{if(e.history.length===0)return e;let{name:n,serializedEditorState:a={doc:""},column:o,index:s,isSetupCell:c,config:h}=e.history[e.history.length-1],p=c?Vn:Xa.create(),g=er({id:p,name:n,code:a.doc,edited:a.doc.trim().length>0,serializedEditorState:a,config:h});return{...e,cellIds:e.cellIds.insertId(p,o,s),cellData:{...e.cellData,[p]:g},cellRuntime:{...e.cellRuntime,[p]:tr()},cellHandles:{...e.cellHandles,[p]:(0,gt.createRef)()},history:e.history.slice(0,-1),scrollKey:p}},clearSerializedEditorState:(e,n)=>{let{cellId:a}=n;return vs({state:e,cellId:a,cellReducer:o=>({...o,serializedEditorState:null})})},updateCellCode:(e,n)=>{let{cellId:a,code:o,formattingChange:s}=n;return e.cellData[a]?vs({state:e,cellId:a,cellReducer:c=>s?{...c,code:o,lastCodeRun:c.edited?c.lastCodeRun:o}:{...c,code:o,edited:o.trim()!==c.lastCodeRun}}):e},updateCellName:(e,n)=>{let{cellId:a,name:o}=n;return vs({state:e,cellId:a,cellReducer:s=>({...s,name:o})})},updateCellConfig:(e,n)=>{let{cellId:a,config:o}=n;return vs({state:e,cellId:a,cellReducer:s=>({...s,config:{...s.config,...o}})})},prepareForRun:(e,n)=>vs({state:ys({state:e,cellId:n.cellId,cellReducer:a=>$E(a)}),cellId:n.cellId,cellReducer:a=>({...a,edited:!1,lastCodeRun:a.code.trim()})}),handleCellMessage:(e,n)=>{let a=n.cell_id,o=ys({state:e,cellId:a,cellReducer:s=>HE(s,n)});return{...o,cellLogs:[...o.cellLogs,...XE(n)]}},setCellIds:(e,n)=>{if(G6(e.cellIds.inOrderIds,n.cellIds))return e;let a={...e.cellData},o={...e.cellRuntime},s={...e.cellHandles};for(let c of n.cellIds)c in e.cellData||(a[c]=er({id:c})),c in e.cellRuntime||(o[c]=tr()),c in e.cellHandles||(s[c]=(0,gt.createRef)());return{...e,cellIds:bl.fromWithPreviousShape(n.cellIds,e.cellIds),cellData:a,cellRuntime:o,cellHandles:s}},setCellCodes:(e,n)=>{rn(n.codes.length===n.ids.length,"Expected codes and ids to have the same length");let a={...e},o=({cell:s,code:c,cellId:h})=>{if(!s)return er({id:h,code:c,lastCodeRun:n.codeIsStale?null:c,edited:n.codeIsStale&&c.trim().length>0});let p=n.codeIsStale?s.lastCodeRun:c,g=p?p.trim()!==c.trim():!!c;if(s.code.trim()===c.trim())return{...s,code:c,edited:g,lastCodeRun:p};if(!Mh()){let b=a.cellHandles[h].current;b!=null&&b.editorViewOrNull&&Ki(b.editorViewOrNull,c)}return{...s,code:c,edited:g,lastCodeRun:p}};for(let[s,c]of rx(n.ids,n.codes))s===void 0||c===void 0||(a={...a,cellData:{...a.cellData,[s]:o({cell:a.cellData[s],code:c,cellId:s})}});return a},setStdinResponse:(e,n)=>{let{cellId:a,response:o,outputIndex:s}=n;return ys({state:e,cellId:a,cellReducer:c=>{let h=[...c.consoleOutputs],p=h[s];return p.channel==="stdin"?(h[s]={channel:"stdin",mimetype:p.mimetype,data:p.data,timestamp:p.timestamp,response:o},{...c,interrupted:!1,consoleOutputs:h}):(be.warn("Expected stdin output"),c)}})},setCells:(e,n)=>{let a=Object.fromEntries(n.map(s=>[s.id,s])),o=Object.fromEntries(n.map(s=>[s.id,tr()]));return ay({...e,cellIds:bl.fromIdsAndColumns(n.map(s=>[s.id,s.config.column])),cellData:a,cellRuntime:o,cellHandles:Object.fromEntries(n.map(s=>[s.id,(0,gt.createRef)()]))})},moveToNextCell:(e,n)=>{let{cellId:a,before:o,noCreate:s=!1}=n;if(a==="__scratch__")return e;let c=e.cellIds.findWithId(a),h=c.indexOfOrThrow(a),p=o?h-1:h+1,g=p===c.length,b=p===-1;if(g&&!s){let _=Xa.create();return{...e,cellIds:e.cellIds.insertId(_,c.id,p),cellData:{...e.cellData,[_]:er({id:_})},cellRuntime:{...e.cellRuntime,[_]:tr()},cellHandles:{...e.cellHandles,[_]:(0,gt.createRef)()},scrollKey:_}}if(b&&!s){let _=Xa.create();return{...e,cellIds:e.cellIds.insertId(_,c.id,0),cellData:{...e.cellData,[_]:er({id:_})},cellRuntime:{...e.cellRuntime,[_]:tr()},cellHandles:{...e.cellHandles,[_]:(0,gt.createRef)()},scrollKey:_}}if((g||b)&&s)return e;if(p>=0&&p<c.length){let _=c.atOrThrow(p);ms({cellId:_,cell:e.cellHandles[_],isCodeHidden:gs(e,_),codeFocus:o?"bottom":"top",variableName:void 0})}return e},markTouched:(e,n)=>{let{cellId:a}=n;if(e.untouchedNewCells.has(a)){let o=new Set(e.untouchedNewCells);return o.delete(a),{...e,untouchedNewCells:o}}return e},markUntouched:(e,n)=>{let{cellId:a}=n;if(!e.untouchedNewCells.has(a)){let o=new Set(e.untouchedNewCells);return o.add(a),{...e,untouchedNewCells:o}}return e},scrollToTarget:e=>{let n=e.scrollKey;if(n===null)return e;let a=e.cellIds.findWithId(n),o=a.indexOfOrThrow(n),s=o===a.length-1?a.last():a.atOrThrow(o);return ms({cellId:s,cell:e.cellHandles[s],isCodeHidden:gs(e,s),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(_x(Object.values(e.cellHandles).map(n=>{var a;return(a=n.current)==null?void 0:a.editorView})),e),unfoldAll:e=>(xx(Object.values(e.cellHandles).map(n=>{var a;return(a=n.current)==null?void 0:a.editorView})),e),clearLogs:e=>({...e,cellLogs:[]}),collapseCell:(e,n)=>{let{cellId:a}=n,o=e.cellIds.findWithId(a),s=o.topLevelIds.map(p=>e.cellRuntime[p].outline),c=X1(o.indexOfOrThrow(a),s);if(!c)return e;let h=o.atOrThrow(c[1]);return{...e,cellIds:e.cellIds.transformWithCellId(a,p=>p.collapse(a,h)),scrollKey:a}},expandCell:(e,n)=>{let{cellId:a}=n;return{...e,cellIds:e.cellIds.transformWithCellId(a,o=>o.expand(a)),scrollKey:a}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>{let a=n.topLevelIds.map(g=>e.cellRuntime[g].outline),o=[...n.nodes],s=[],c=[],h=o.length-1;for(;h>=0;){let g=X1(h,a);if(g){let b=h,_=g[1],S=s.find(O=>O.start<=_&&O.end===_);S&&(_=S.start),s.push({start:b,end:_});let C=n.atOrThrow(b),E=n.atOrThrow(_);c.push({id:C,until:E})}else c.push(null);h--}let p=c.reverse();return n.collapseAll(p)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>n.expandAll())}),showCellIfHidden:(e,n)=>{let{cellId:a}=n,o=e.cellIds.findWithId(a),s=o,c=o.findAndExpandDeep(a);return c.equals(s)?e:{...e,cellIds:e.cellIds.transformWithCellId(a,()=>c)}},splitCell:(e,n)=>{var _;let{cellId:a}=n,o=e.cellIds.findWithId(a),s=o.indexOfOrThrow(a),c=e.cellData[a],h=e.cellHandles[a].current;if((h==null?void 0:h.editorView)==null)return e;let{beforeCursorCode:p,afterCursorCode:g}=ME(h.editorView);Ki(h.editorView,p);let b=Xa.create();return{...e,cellIds:e.cellIds.insertId(b,o.id,s+1),cellData:{...e.cellData,[a]:{...c,code:p,edited:!!p&&p.trim()!==((_=c.lastCodeRun)==null?void 0:_.trim())},[b]:er({id:b,code:g,edited:!!g})},cellRuntime:{...e.cellRuntime,[a]:{...e.cellRuntime[a],output:null,consoleOutputs:[]},[b]:tr()},cellHandles:{...e.cellHandles,[b]:(0,gt.createRef)()},scrollKey:b}},undoSplitCell:(e,n)=>{var h;let{cellId:a,snapshot:o}=n,s=e.cellData[a],c=e.cellHandles[a].current;return(c==null?void 0:c.editorView)==null?e:(Ki(c.editorView,o),{...e,cellIds:e.cellIds.transformWithCellId(a,p=>{let g=p.indexOfOrThrow(a)+1;return p.deleteAtIndex(g)}),cellData:{...e.cellData,[a]:{...s,code:o,edited:!!o&&(o==null?void 0:o.trim())!==((h=s.lastCodeRun)==null?void 0:h.trim())}},cellRuntime:{...e.cellRuntime,[a]:{...e.cellRuntime[a],output:null,consoleOutputs:[]}},cellHandles:{...e.cellHandles}})},clearCellOutput:(e,n)=>{let{cellId:a}=n;return ys({state:e,cellId:a,cellReducer:o=>({...o,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,n)=>{let{cellId:a}=n;return ys({state:e,cellId:a,cellReducer:o=>({...o,consoleOutputs:o.consoleOutputs.filter(s=>s.channel==="stdin"&&s.response==null)})})},clearAllCellOutputs:e=>{let n={...e.cellRuntime};for(let a of e.cellIds.inOrderIds)n[a]={...n[a],output:null,consoleOutputs:[]};return{...e,cellRuntime:n}},addSetupCellIfDoesntExist:(e,n)=>{let{code:a}=n;return e.cellIds.setupCellExists()?{...e,scrollKey:Vn}:{...e,cellIds:e.cellIds.insertId(Vn,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[Vn]:er({id:Vn,name:Vn,code:a,edited:!!a})},cellRuntime:{...e.cellRuntime,[Vn]:tr()},cellHandles:{...e.cellHandles,[Vn]:(0,gt.createRef)()},scrollKey:Vn}}}));function gs(e,n){return!!e.cellData[n].config.hide_code&&!e.untouchedNewCells.has(n)}function ys({state:e,cellId:n,cellReducer:a}){return n in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[n]:a(e.cellRuntime[n])}}:(be.warn(`Cell ${n} not found in state`),e)}function vs({state:e,cellId:n,cellReducer:a}){return n in e.cellData?{...e,cellData:{...e.cellData,[n]:a(e.cellData[n])}}:(be.warn(`Cell ${n} not found in state`),e)}Xw=function(e){let n=e.cellData,a={column:null};return e.cellIds.getColumns().length>1?e.cellIds.getColumns().flatMap((o,s)=>o.inOrderIds.map((c,h)=>{let p={...a};return h===0&&(p.column=s),{...n[c].config,...p}})):e.cellIds.getColumns().flatMap(o=>o.inOrderIds.map(s=>({...n[s].config,...a})))},Uu=Ce(e=>e(Ye).cellIds),P_=Ce(e=>e(Uu).hasOnlyOneId()),$w=Ce(e=>Qh(e(Ye)).length>0),Ce(e=>X0(e(Ye)).length>0);let oy;I_=Ce(e=>nk(e(Ye))),H_=Ce(e=>ek(e(Ye))),Zu=Ce(e=>{let{cellIds:n,cellRuntime:a,cellData:o}=e(Ye);return n.inOrderIds.map(s=>{var p;let c=a[s],{name:h}=o[s];if(ld((p=c.output)==null?void 0:p.mimetype)){rn(Array.isArray(c.output.data),"Expected array data");let g=c.output.data.filter(b=>!b.type.includes("ancestor"));if(g.length>0)return{output:{...c.output,data:g},cellId:s,cellName:h}}return null}).filter(Boolean)}),Iw=Ce(e=>{let{cellIds:n,cellRuntime:a}=e(Ye);return zE(n.inOrderIds.map(o=>a[o].outline))}),T_=Ce(e=>e(Zu).length),oy=Q6(Ce(e=>{let{cellIds:n,cellData:a}=e(Ye);return Ar.fromEntries(n.inOrderIds.map(o=>{var s;return[o,(s=a[o])==null?void 0:s.name]}))}));var a4=Ce(e=>e(Ye).scrollKey);Ew=()=>mn(Ye),aw=()=>mn(Uu),bw=()=>mn(oy),kw=()=>mn(Zu),c_=()=>mn(Ye).cellLogs,hw=()=>mn(a4),Wi=()=>Fe.get(Ye),m_=()=>Fe.get(Ye).cellIds,k_=()=>{let{cellIds:e,cellData:n}=Fe.get(Ye);return e.inOrderIds.map(a=>{var o;return(o=n[a])==null?void 0:o.name}).filter(Boolean)};var i4=hx(cx(Ye,e=>e.cellIds.inOrderIds.map(n=>e.cellData[n])));dw=()=>C2(i4),__=Ce(e=>e(Ye).cellRuntime),B_=Ce(e=>Yx(e(Ye))),lw=Ce(e=>Zx(e(Ye))),D_=Ce(e=>e(Ye).cellIds.colLength),r_=Ce(e=>e(Ye).cellIds.idLength>0),O_=Ce(e=>e(Ye).cellIds.getColumnIds()),rd=pd(e=>Ce(n=>n(Ye).cellData[e]));var df=pd(e=>Ce(n=>n(Ye).cellRuntime[e]));const sy=pd(e=>Ce(n=>n(Ye).cellHandles[e]));function o4(e){rd.remove(e),df.remove(e),sy.remove(e)}pw=e=>{let n=(0,uf.c)(2),a;return n[0]===e?a=n[1]:(a=rd(e),n[0]=e,n[1]=a),mn(a)},_w=e=>{let n=(0,uf.c)(2),a;return n[0]===e?a=n[1]:(a=df(e),n[0]=e,n[1]=a),mn(a)},f_=e=>{let n=(0,uf.c)(2),a;return n[0]===e?a=n[1]:(a=sy(e),n[0]=e,n[1]=a),mn(a)},jm=()=>{let{cellIds:e,cellHandles:n}=Fe.get(Ye);return e.inOrderIds.map(a=>{var o,s;return(s=(o=n[a])==null?void 0:o.current)==null?void 0:s.editorViewOrNull}).filter(Boolean)},Ju=e=>{var a;let{cellHandles:n}=Fe.get(Ye);return(a=n[e].current)==null?void 0:a.editorView},p_=function(e){let{cellIds:n,cellData:a,cellRuntime:o}=e;return n.getColumns().flatMap(s=>s.topLevelIds.map(c=>({...a[c],...o[c]})))},Qw=function(e){return Ce(n=>n(Ye).untouchedNewCells.has(e))};function s4(e){let n=df(e);return Ce(a=>{let o=a(n);if(!o||o.status==="queued"||o.status==="running")return;let s=[],c=o.consoleOutputs;if(c&&c.length>0){let p=c.find(g=>g.mimetype==="application/vnd.marimo+traceback");if(p){let g=p.data;s.push(...um(g))}}let h=o.output;if((h==null?void 0:h.mimetype)==="application/vnd.marimo+error"){let p=h.data;if(Array.isArray(p))for(let g of p)g.type==="syntax"&&g.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:g.lineno}),g.type==="import-star"&&g.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:g.lineno})}return s.length>0?s:void 0})}tm=function(){return iy()}})();export{Mh as $,Ph as $n,bl as $r,Nh as $t,aw as A,iw as An,Fi as Ar,ow as At,Dh as B,Au as Bn,Vi as Br,sw as Bt,lw as C,cw as Ci,wl as Cn,uw as Cr,Iu as Ct,dw as D,Ru as Di,jh as Dn,fw as Dr,zh as Dt,pw as E,qh as Ei,Mu as En,_l as Er,Bh as Et,hw as F,Fh as Fn,Vh as Fr,xl as Ft,Hh as G,mw as Gn,ns as Gr,Pu as Gt,gw as H,Qa as Hn,$h as Hr,Wh as Ht,er as I,Nu as In,yw as Ir,Fn as It,Du as J,Uh as Jn,vw as Jr,ju as Jt,Kh as K,kl as Kn,Sl as Kr,Ir as Kt,tr as L,zu as Ln,qu as Lr,Bu as Lt,bw as M,Ga as Mn,sa as Mr,ww as Mt,_w as N,xw as Nn,Qh as Nr,Gh as Nt,kw as O,Jh as On,Sw as Or,Cw as Ot,Ew as P,Cl as Pn,Tw as Pr,Xh as Pt,Yh as Q,Zh as Qn,Ja as Qr,Lw as Qt,Ow as R,El as Rn,Fu as Rr,Aw as Rt,Iw as S,em as Si,Rw as Sn,Mw as Sr,Pw as St,tm as T,Vu as Ti,Nw as Tn,Dw as Tr,nm as Tt,rm as U,jw as Un,Tl as Ur,zw as Ut,qw as V,Bw as Vn,Hu as Vr,am as Vt,Fw as W,$u as Wn,Ll as Wr,Vw as Wt,im as X,om as Xn,sm as Xr,lm as Xt,cm as Y,Hi as Yn,um as Yr,dm as Yt,Hw as Z,fm as Zn,pm as Zr,hm as Zt,$w as _,DT as __tla,En as _i,Wu as _n,$i as _r,nr as _t,Uu as a,Ww as ai,la as an,rs as ar,mm as at,Ye as b,Ku as bi,gm as bn,Uw as br,Kw as bt,Qw as c,Gw as ci,Jw as cn,ym as cr,vm as ct,Xw as d,Qu as di,Gu as dn,bm as dr,Yw as dt,Zw as ei,wm as en,_m as er,e_ as et,Ju as f,t_ as fi,n_ as fn,xm as fr,km as ft,r_ as g,a_ as gi,Xu as gn,Yu as gr,i_ as gt,Wi as h,Xa as hi,o_ as hn,s_ as hr,Ol as ht,Zu as i,as as ii,l_ as in,ed as ir,Sm as it,c_ as j,u_ as jn,ct as jr,d_ as jt,f_ as k,td as kn,ca as kr,nd as kt,p_ as l,Al as li,Cm as ln,Em as lr,h_ as lt,m_ as m,Tm as mi,g_ as mn,Lm as mr,y_ as mt,rd as n,v_ as ni,b_ as nn,ad as nr,w_ as nt,__ as o,is as oi,Il as on,Om as or,x_ as ot,k_ as p,S_ as pi,id as pn,Am as pr,C_ as pt,E_ as q,Im as qn,Ya as qr,od as qt,T_ as r,sd as ri,L_ as rn,Rm as rr,Mm as rt,O_ as s,gn as si,A_ as sn,Pm as sr,Nm as st,I_ as t,Dm as ti,R_ as tn,Ui as tr,ld as tt,jm as u,Rl as ui,zm as un,qm as ur,M_ as ut,P_ as v,os as vi,Bm as vn,N_ as vr,Ki as vt,D_ as w,j_ as wi,z_ as wn,q_ as wr,Fm as wt,B_ as x,F_ as xi,V_ as xn,cd as xr,rr as xt,H_ as y,Vn as yi,ud as yn,$_ as yr,W_ as yt,U_ as z,K_ as zn,Q_ as zr,G_ as zt};
228
+ `)}catch(n){return be.error("Error parsing HTML content:",n),e}},L_=function(e){if(!e)return"";try{return Du(XE.ansi_to_html(e))}catch(n){return be.error("Error converting ANSI to plain text:",n),e}},Qh={startCase:e=>{if(!e)return"";if(typeof e!="string")throw be.error(e),TypeError(`Expected string, got ${typeof e}`);return/[A-Za-z]/.test(e)?d5(e):e},htmlEscape:e=>e&&e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;").replaceAll(`
229
+ `," "),withTrailingSlash(e){return e.endsWith("/")?e:`${e}/`},withoutTrailingSlash(e){return e.endsWith("/")?e.slice(0,-1):e},withoutLeadingSlash(e){return e.startsWith("/")?e.slice(1):e},asString:e=>{if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}};var ny=!1;function YE(e){var o;let n=[],a=[e.console].filter(Boolean).flat();for(let s of a){let c=s.mimetype==="text/plain",h=s.mimetype==="text/html"||s.mimetype==="application/vnd.marimo+traceback";if(c||h){let p=s.channel==="stderr"||s.channel==="marimo-error";switch(s.channel){case"stdout":case"stderr":case"marimo-error":{let g=Qh.asString(s.data),b=h?Du(g):g;n.push({timestamp:s.timestamp||Date.now(),level:p?"stderr":"stdout",message:b,cellId:e.cell_id});break}default:break}}}if(n.forEach(ry.log),a.length===0&&sd((o=e.output)==null?void 0:o.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(c=>{ry.log({level:"stderr",cellId:e.cell_id,timestamp:e.timestamp??0,message:JSON.stringify(c)})});let s=e.output.data.some(c=>c.type==="internal");!ny&&s&&(ny=!0,vl({title:"An internal error occurred",description:"See console for details.",className:"text-xs text-background bg-(--red-10) py-2 pl-3 *:flex *:gap-3"}))}return n}var ry={log:e=>{let n=e.level==="stdout"?"gray":e.level==="stderr"?"red":"orange",a=e.level.toUpperCase();console.log(`%c[${a}]`,`color:${n}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${$h(e.timestamp)}]`,`(${e.cellId}) ${e.message}`)}};$h=function(e){try{return UE(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},mw=function(e,n){let a=Qu(n);a?a.focus():be.warn(`[CellFocusManager] focusCellEditor: element not found: ${n}`)},Bw=function(e){let n=document.getElementById(En.create(e));n?cf(n):be.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},Vw=function(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})},rm=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function cf(e){try{e.focus()}catch{be.warn("[CellFocusManager] element may not be focusable",e)}}Dh=function(e,n){let{retries:a,delay:o,initialDelay:s=0}=n,c=0,h=()=>{if(c<a){try{if(e())return}catch(p){be.error(`Error executing function on attempt ${c+1}, retrying`,{error:p})}c++,setTimeout(h,o)}};s>0?setTimeout(h,s):h()};function ms({cellId:e,cell:n,isCodeHidden:a,codeFocus:o,variableName:s}){var h;if(!n)return;let c=document.getElementById(En.create(e));if(!c){be.warn("scrollCellIntoView: element not found");return}if(rm()){cf(c);return}if(a)cf(c);else{let p=(h=n.current)==null?void 0:h.editorView;if(!p){be.warn("scrollCellIntoView: editor not found",e);return}if(p.hasFocus||!document.hasFocus())return;if(Dh(()=>(p.focus(),p.hasFocus),{retries:5,delay:20}),o==="top")p.dispatch({selection:{anchor:0,head:0}});else if(o==="bottom"){let g=p.state.doc.line(p.state.doc.lines);p.dispatch({selection:{anchor:g.from,head:g.from}})}else s&&Ku(p,s)}c.scrollIntoView({behavior:"smooth",block:"nearest"})}Lw=function(e){let n=document.getElementById(En.create(e));if(!n){be.warn("scrollCellIntoView: element not found");return}n.classList.add("focus-outline"),setTimeout(()=>{n.classList.remove("focus-outline")},2e3),n.scrollIntoView({behavior:"smooth",block:"center"})};function ZE(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function e4(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}K_=function(e){let n=Qu(e);if(n!=null&&n.hasFocus){Ag(n,{behavior:"instant"});return}let a=document.getElementById(En.create(e));a?a.scrollIntoView({behavior:"instant",block:"nearest"}):be.warn(`[CellFocusManager] scrollCellIntoView: element not found: ${e}`)},er=function({id:e,name:n="_",code:a="",lastCodeRun:o=null,lastExecutionTime:s=null,edited:c=!1,config:h,serializedEditorState:p=null}){return{id:e,config:h||{hide_code:!1,disabled:!1,column:null},name:n,code:a,edited:c,lastCodeRun:o,lastExecutionTime:s,serializedEditorState:p}};function t4(e){return{hide_code:!1,disabled:!1,column:null,...e}}tr=function(e){return{outline:null,output:null,consoleOutputs:[],status:"idle",staleInputs:!1,interrupted:!1,errored:!1,stopped:!1,runElapsedTimeMs:null,runStartTimestamp:null,lastRunStartTimestamp:null,debuggerActive:!1,...e}};var uf=Zn();function ay(e){let n={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[os]:er({id:os,config:n}),...e.cellData},cellRuntime:{[os]:tr(),...e.cellRuntime},cellHandles:{[os]:(0,gt.createRef)(),...e.cellHandles}}}function n4(){return ay({cellIds:bl.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let r4,a4,iy;({reducer:r4,createActions:a4,useActions:iy,valueAtom:Ye}=yl(n4,{createNewCell:(e,n)=>{var O;let{cellId:a,before:o,code:s,lastCodeRun:c=null,lastExecutionTime:h=null,autoFocus:p=!0,skipIfCodeExists:g=!1,hideCode:b=!1}=n,_,S;if(g){for(let M of e.cellIds.inOrderIds)if(((O=e.cellData[M])==null?void 0:O.code)===s)return e}if(a==="__end__"){let M=e.cellIds.atOrThrow(0);_=M.id,S=M.length}else if(typeof a=="string"){let M=e.cellIds.findWithId(a);_=M.id,S=M.topLevelIds.indexOf(a)}else if(a.type==="__end__"){let M=e.cellIds.get(a.columnId)||e.cellIds.atOrThrow(0);_=M.id,S=M.length}else throw Error("Invalid cellId");let C=n.newCellId||Xa.create(),E=o?S:S+1;return{...e,cellIds:e.cellIds.insertId(C,_,E),cellData:{...e.cellData,[C]:er({id:C,code:s,lastCodeRun:c,config:t4({hide_code:b}),lastExecutionTime:h,edited:!!s&&s!==c})},cellRuntime:{...e.cellRuntime,[C]:tr()},cellHandles:{...e.cellHandles,[C]:(0,gt.createRef)()},scrollKey:p?C:null,untouchedNewCells:b?new Set([...e.untouchedNewCells,C]):e.untouchedNewCells}},moveCell:(e,n)=>{let{cellId:a,before:o,direction:s}=n;if(o!==void 0&&s!==void 0&&be.warn("Both before and direction specified for moveCell. Ignoring one."),s){let p=e.cellIds.findWithId(a),g=e.cellIds.indexOf(p),b=s==="left"?g-1:g+1,_=e.cellIds.at(b);return _?{...e,cellIds:e.cellIds.moveAcrossColumns(p.id,a,_.id,void 0),scrollKey:a}:e}let c=e.cellIds.findWithId(a),h=c.indexOfOrThrow(a);return o&&h===0?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,h,0),scrollKey:a}:!o&&h===c.length-1?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,h,c.length-1),scrollKey:a}:o?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,h,h-1),scrollKey:a}:{...e,cellIds:e.cellIds.moveWithinColumn(c.id,h,h+1),scrollKey:a}},dropCellOverCell:(e,n)=>{let{cellId:a,overCellId:o}=n,s=e.cellIds.findWithId(a),c=e.cellIds.findWithId(o),h=s.indexOfOrThrow(a),p=c.indexOfOrThrow(o);return s.id===c.id?h===p?e:{...e,cellIds:e.cellIds.moveWithinColumn(s.id,h,p),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,a,c.id,o),scrollKey:null}},dropCellOverColumn:(e,n)=>{let{cellId:a,columnId:o}=n,s=e.cellIds.findWithId(a);return{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,a,o,void 0)}},dropOverNewColumn:(e,n)=>{let{cellId:a}=n;return{...e,cellIds:e.cellIds.moveToNewColumn(a)}},moveColumn:(e,n)=>n.column===n.overColumn?e:{...e,cellIds:e.cellIds.moveColumn(n.column,n.overColumn)},focusCell:(e,n)=>{let a=e.cellIds.findWithId(n.cellId);if(a.length===0)return e;let{cellId:o,where:s}=n,c=a.indexOfOrThrow(o),h;h=s==="before"?xh(c-1,0,a.length-1):s==="after"?xh(c+1,0,a.length-1):c;let p=a.atOrThrow(h);return ms({cellId:p,cell:e.cellHandles[p],isCodeHidden:gs(e,p),codeFocus:s==="after"?"top":"bottom",variableName:void 0}),e},focusTopCell:e=>{let n=e.cellIds.getColumns().at(0);if(n===void 0||n.length===0)return e;let a=n.first();return ms({cellId:a,cell:e.cellHandles[a],isCodeHidden:gs(e,a),codeFocus:void 0,variableName:void 0}),e4(),e},focusBottomCell:e=>{let n=e.cellIds.getColumns().at(-1);if(n===void 0||n.length===0)return e;let a=n.last();return ms({cellId:a,cell:e.cellHandles[a],isCodeHidden:gs(e,a),codeFocus:void 0,variableName:void 0}),ZE(),e},sendToTop:(e,n)=>{let a=e.cellIds.findWithId(n.cellId);if(a.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=a.indexOfOrThrow(o);return c===0?e:{...e,cellIds:e.cellIds.moveWithinColumn(a.id,c,0),scrollKey:s?o:null}},sendToBottom:(e,n)=>{let a=e.cellIds.findWithId(n.cellId);if(a.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=a.indexOfOrThrow(o),h=a.length-1;return c===h?e:{...e,cellIds:e.cellIds.moveWithinColumn(a.id,c,h),scrollKey:s?o:null}},addColumn:(e,n)=>{let a=Xa.create();return{...e,cellIds:e.cellIds.addColumn(n.columnId,[a]),cellData:{...e.cellData,[a]:er({id:a})},cellRuntime:{...e.cellRuntime,[a]:tr()},cellHandles:{...e.cellHandles,[a]:(0,gt.createRef)()},scrollKey:a}},addColumnBreakpoint:(e,n)=>{let{cellId:a}=n;return e.cellIds.getColumns()[0].inOrderIds[0]===a?e:{...e,cellIds:e.cellIds.insertBreakpoint(a)}},deleteColumn:(e,n)=>{let{columnId:a}=n;return{...e,cellIds:e.cellIds.delete(a)}},mergeAllColumns:e=>({...e,cellIds:e.cellIds.mergeAllColumns()}),compactColumns:e=>({...e,cellIds:e.cellIds.compact()}),deleteCell:(e,n)=>{var b,_;let a=n.cellId;if(e.cellIds.hasOnlyOneId())return e;let o=e.cellIds.findWithId(a),s=o.indexOfOrThrow(a),c=s===0?1:s-1,h=null;o.length>1&&(h=o.atOrThrow(c));let p=(_=(b=e.cellHandles[a].current)==null?void 0:b.editorView)==null?void 0:_.state.toJSON({history:J5});p.doc=e.cellData[a].code,s4(a);let g=e.cellData[a];return{...e,cellIds:e.cellIds.deleteById(a),history:[...e.history,{name:g.name,serializedEditorState:p,column:o.id,index:s,isSetupCell:a===Vn,config:g.config}],scrollKey:h}},undoDeleteCell:e=>{if(e.history.length===0)return e;let{name:n,serializedEditorState:a={doc:""},column:o,index:s,isSetupCell:c,config:h}=e.history[e.history.length-1],p=c?Vn:Xa.create(),g=er({id:p,name:n,code:a.doc,edited:a.doc.trim().length>0,serializedEditorState:a,config:h});return{...e,cellIds:e.cellIds.insertId(p,o,s),cellData:{...e.cellData,[p]:g},cellRuntime:{...e.cellRuntime,[p]:tr()},cellHandles:{...e.cellHandles,[p]:(0,gt.createRef)()},history:e.history.slice(0,-1),scrollKey:p}},clearSerializedEditorState:(e,n)=>{let{cellId:a}=n;return vs({state:e,cellId:a,cellReducer:o=>({...o,serializedEditorState:null})})},updateCellCode:(e,n)=>{let{cellId:a,code:o,formattingChange:s}=n;return e.cellData[a]?vs({state:e,cellId:a,cellReducer:c=>s?{...c,code:o,lastCodeRun:c.edited?c.lastCodeRun:o}:{...c,code:o,edited:o.trim()!==c.lastCodeRun}}):e},updateCellName:(e,n)=>{let{cellId:a,name:o}=n;return vs({state:e,cellId:a,cellReducer:s=>({...s,name:o})})},updateCellConfig:(e,n)=>{let{cellId:a,config:o}=n;return vs({state:e,cellId:a,cellReducer:s=>({...s,config:{...s.config,...o}})})},prepareForRun:(e,n)=>vs({state:ys({state:e,cellId:n.cellId,cellReducer:a=>WE(a)}),cellId:n.cellId,cellReducer:a=>({...a,edited:!1,lastCodeRun:a.code.trim()})}),handleCellMessage:(e,n)=>{let a=n.cell_id,o=ys({state:e,cellId:a,cellReducer:s=>$E(s,n)});return{...o,cellLogs:[...o.cellLogs,...YE(n)]}},setCellIds:(e,n)=>{if(J6(e.cellIds.inOrderIds,n.cellIds))return e;let a={...e.cellData},o={...e.cellRuntime},s={...e.cellHandles};for(let c of n.cellIds)c in e.cellData||(a[c]=er({id:c})),c in e.cellRuntime||(o[c]=tr()),c in e.cellHandles||(s[c]=(0,gt.createRef)());return{...e,cellIds:bl.fromWithPreviousShape(n.cellIds,e.cellIds),cellData:a,cellRuntime:o,cellHandles:s}},setCellCodes:(e,n)=>{rn(n.codes.length===n.ids.length,"Expected codes and ids to have the same length");let a={...e},o=({cell:s,code:c,cellId:h})=>{if(!s)return er({id:h,code:c,lastCodeRun:n.codeIsStale?null:c,edited:n.codeIsStale&&c.trim().length>0});let p=n.codeIsStale?s.lastCodeRun:c,g=p?p.trim()!==c.trim():!!c;if(s.code.trim()===c.trim())return{...s,code:c,edited:g,lastCodeRun:p};if(!Mh()){let b=a.cellHandles[h].current;b!=null&&b.editorViewOrNull&&Ki(b.editorViewOrNull,c)}return{...s,code:c,edited:g,lastCodeRun:p}};for(let[s,c]of ax(n.ids,n.codes))s===void 0||c===void 0||(a={...a,cellData:{...a.cellData,[s]:o({cell:a.cellData[s],code:c,cellId:s})}});return a},setStdinResponse:(e,n)=>{let{cellId:a,response:o,outputIndex:s}=n;return ys({state:e,cellId:a,cellReducer:c=>{let h=[...c.consoleOutputs],p=h[s];return p.channel==="stdin"?(h[s]={channel:"stdin",mimetype:p.mimetype,data:p.data,timestamp:p.timestamp,response:o},{...c,interrupted:!1,consoleOutputs:h}):(be.warn("Expected stdin output"),c)}})},setCells:(e,n)=>{let a=Object.fromEntries(n.map(s=>[s.id,s])),o=Object.fromEntries(n.map(s=>[s.id,tr()]));return ay({...e,cellIds:bl.fromIdsAndColumns(n.map(s=>[s.id,s.config.column])),cellData:a,cellRuntime:o,cellHandles:Object.fromEntries(n.map(s=>[s.id,(0,gt.createRef)()]))})},moveToNextCell:(e,n)=>{let{cellId:a,before:o,noCreate:s=!1}=n;if(a==="__scratch__")return e;let c=e.cellIds.findWithId(a),h=c.indexOfOrThrow(a),p=o?h-1:h+1,g=p===c.length,b=p===-1;if(g&&!s){let _=Xa.create();return{...e,cellIds:e.cellIds.insertId(_,c.id,p),cellData:{...e.cellData,[_]:er({id:_})},cellRuntime:{...e.cellRuntime,[_]:tr()},cellHandles:{...e.cellHandles,[_]:(0,gt.createRef)()},scrollKey:_}}if(b&&!s){let _=Xa.create();return{...e,cellIds:e.cellIds.insertId(_,c.id,0),cellData:{...e.cellData,[_]:er({id:_})},cellRuntime:{...e.cellRuntime,[_]:tr()},cellHandles:{...e.cellHandles,[_]:(0,gt.createRef)()},scrollKey:_}}if((g||b)&&s)return e;if(p>=0&&p<c.length){let _=c.atOrThrow(p);ms({cellId:_,cell:e.cellHandles[_],isCodeHidden:gs(e,_),codeFocus:o?"bottom":"top",variableName:void 0})}return e},markTouched:(e,n)=>{let{cellId:a}=n;if(e.untouchedNewCells.has(a)){let o=new Set(e.untouchedNewCells);return o.delete(a),{...e,untouchedNewCells:o}}return e},markUntouched:(e,n)=>{let{cellId:a}=n;if(!e.untouchedNewCells.has(a)){let o=new Set(e.untouchedNewCells);return o.add(a),{...e,untouchedNewCells:o}}return e},scrollToTarget:e=>{let n=e.scrollKey;if(n===null)return e;let a=e.cellIds.findWithId(n),o=a.indexOfOrThrow(n),s=o===a.length-1?a.last():a.atOrThrow(o);return ms({cellId:s,cell:e.cellHandles[s],isCodeHidden:gs(e,s),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(xx(Object.values(e.cellHandles).map(n=>{var a;return(a=n.current)==null?void 0:a.editorView})),e),unfoldAll:e=>(kx(Object.values(e.cellHandles).map(n=>{var a;return(a=n.current)==null?void 0:a.editorView})),e),clearLogs:e=>({...e,cellLogs:[]}),collapseCell:(e,n)=>{let{cellId:a}=n,o=e.cellIds.findWithId(a),s=o.topLevelIds.map(p=>e.cellRuntime[p].outline),c=X1(o.indexOfOrThrow(a),s);if(!c)return e;let h=o.atOrThrow(c[1]);return{...e,cellIds:e.cellIds.transformWithCellId(a,p=>p.collapse(a,h)),scrollKey:a}},expandCell:(e,n)=>{let{cellId:a}=n;return{...e,cellIds:e.cellIds.transformWithCellId(a,o=>o.expand(a)),scrollKey:a}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>{let a=n.topLevelIds.map(g=>e.cellRuntime[g].outline),o=[...n.nodes],s=[],c=[],h=o.length-1;for(;h>=0;){let g=X1(h,a);if(g){let b=h,_=g[1],S=s.find(O=>O.start<=_&&O.end===_);S&&(_=S.start),s.push({start:b,end:_});let C=n.atOrThrow(b),E=n.atOrThrow(_);c.push({id:C,until:E})}else c.push(null);h--}let p=c.reverse();return n.collapseAll(p)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>n.expandAll())}),showCellIfHidden:(e,n)=>{let{cellId:a}=n,o=e.cellIds.findWithId(a),s=o,c=o.findAndExpandDeep(a);return c.equals(s)?e:{...e,cellIds:e.cellIds.transformWithCellId(a,()=>c)}},splitCell:(e,n)=>{var _;let{cellId:a}=n,o=e.cellIds.findWithId(a),s=o.indexOfOrThrow(a),c=e.cellData[a],h=e.cellHandles[a].current;if((h==null?void 0:h.editorView)==null)return e;let{beforeCursorCode:p,afterCursorCode:g}=PE(h.editorView);Ki(h.editorView,p);let b=Xa.create();return{...e,cellIds:e.cellIds.insertId(b,o.id,s+1),cellData:{...e.cellData,[a]:{...c,code:p,edited:!!p&&p.trim()!==((_=c.lastCodeRun)==null?void 0:_.trim())},[b]:er({id:b,code:g,edited:!!g})},cellRuntime:{...e.cellRuntime,[a]:{...e.cellRuntime[a],output:null,consoleOutputs:[]},[b]:tr()},cellHandles:{...e.cellHandles,[b]:(0,gt.createRef)()},scrollKey:b}},undoSplitCell:(e,n)=>{var h;let{cellId:a,snapshot:o}=n,s=e.cellData[a],c=e.cellHandles[a].current;return(c==null?void 0:c.editorView)==null?e:(Ki(c.editorView,o),{...e,cellIds:e.cellIds.transformWithCellId(a,p=>{let g=p.indexOfOrThrow(a)+1;return p.deleteAtIndex(g)}),cellData:{...e.cellData,[a]:{...s,code:o,edited:!!o&&(o==null?void 0:o.trim())!==((h=s.lastCodeRun)==null?void 0:h.trim())}},cellRuntime:{...e.cellRuntime,[a]:{...e.cellRuntime[a],output:null,consoleOutputs:[]}},cellHandles:{...e.cellHandles}})},clearCellOutput:(e,n)=>{let{cellId:a}=n;return ys({state:e,cellId:a,cellReducer:o=>({...o,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,n)=>{let{cellId:a}=n;return ys({state:e,cellId:a,cellReducer:o=>({...o,consoleOutputs:o.consoleOutputs.filter(s=>s.channel==="stdin"&&s.response==null)})})},clearAllCellOutputs:e=>{let n={...e.cellRuntime};for(let a of e.cellIds.inOrderIds)n[a]={...n[a],output:null,consoleOutputs:[]};return{...e,cellRuntime:n}},addSetupCellIfDoesntExist:(e,n)=>{let{code:a}=n;return e.cellIds.setupCellExists()?{...e,scrollKey:Vn}:{...e,cellIds:e.cellIds.insertId(Vn,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[Vn]:er({id:Vn,name:Vn,code:a,edited:!!a})},cellRuntime:{...e.cellRuntime,[Vn]:tr()},cellHandles:{...e.cellHandles,[Vn]:(0,gt.createRef)()},scrollKey:Vn}}}));function gs(e,n){return!!e.cellData[n].config.hide_code&&!e.untouchedNewCells.has(n)}function ys({state:e,cellId:n,cellReducer:a}){return n in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[n]:a(e.cellRuntime[n])}}:(be.warn(`Cell ${n} not found in state`),e)}function vs({state:e,cellId:n,cellReducer:a}){return n in e.cellData?{...e,cellData:{...e.cellData,[n]:a(e.cellData[n])}}:(be.warn(`Cell ${n} not found in state`),e)}Yw=function(e){let n=e.cellData,a={column:null};return e.cellIds.getColumns().length>1?e.cellIds.getColumns().flatMap((o,s)=>o.inOrderIds.map((c,h)=>{let p={...a};return h===0&&(p.column=s),{...n[c].config,...p}})):e.cellIds.getColumns().flatMap(o=>o.inOrderIds.map(s=>({...n[s].config,...a})))},Uu=Ce(e=>e(Ye).cellIds),D_=Ce(e=>e(Uu).hasOnlyOneId()),Ww=Ce(e=>Gh(e(Ye)).length>0),Ce(e=>X0(e(Ye)).length>0);let oy;M_=Ce(e=>rk(e(Ye))),$_=Ce(e=>tk(e(Ye))),Yu=Ce(e=>{let{cellIds:n,cellRuntime:a,cellData:o}=e(Ye);return n.inOrderIds.map(s=>{var p;let c=a[s],{name:h}=o[s];if(sd((p=c.output)==null?void 0:p.mimetype)){rn(Array.isArray(c.output.data),"Expected array data");let g=c.output.data.filter(b=>!b.type.includes("ancestor"));if(g.length>0)return{output:{...c.output,data:g},cellId:s,cellName:h}}return null}).filter(Boolean)}),Aw=Ce(e=>{let{cellIds:n,cellRuntime:a}=e(Ye);return qE(n.inOrderIds.map(o=>a[o].outline))}),O_=Ce(e=>e(Yu).length),oy=G6(Ce(e=>{let{cellIds:n,cellData:a}=e(Ye);return Ar.fromEntries(n.inOrderIds.map(o=>{var s;return[o,(s=a[o])==null?void 0:s.name]}))}));var i4=Ce(e=>e(Ye).scrollKey);Cw=()=>mn(Ye),aw=()=>mn(Uu),vw=()=>mn(oy),xw=()=>mn(Yu),l_=()=>mn(Ye).cellLogs,pw=()=>mn(i4),Wi=()=>Fe.get(Ye),m_=()=>Fe.get(Ye).cellIds,C_=()=>{let{cellIds:e,cellData:n}=Fe.get(Ye);return e.inOrderIds.map(a=>{var o;return(o=n[a])==null?void 0:o.name}).filter(Boolean)};var o4=mx(ux(Ye,e=>e.cellIds.inOrderIds.map(n=>e.cellData[n])));uw=()=>C2(o4),x_=Ce(e=>e(Ye).cellRuntime),V_=Ce(e=>Zx(e(Ye))),lw=Ce(e=>ek(e(Ye))),z_=Ce(e=>e(Ye).cellIds.colLength),r_=Ce(e=>e(Ye).cellIds.idLength>0),I_=Ce(e=>e(Ye).cellIds.getColumnIds()),nd=pd(e=>Ce(n=>n(Ye).cellData[e]));var df=pd(e=>Ce(n=>n(Ye).cellRuntime[e]));const sy=pd(e=>Ce(n=>n(Ye).cellHandles[e]));function s4(e){nd.remove(e),df.remove(e),sy.remove(e)}fw=e=>{let n=(0,uf.c)(2),a;return n[0]===e?a=n[1]:(a=nd(e),n[0]=e,n[1]=a),mn(a)},ww=e=>{let n=(0,uf.c)(2),a;return n[0]===e?a=n[1]:(a=df(e),n[0]=e,n[1]=a),mn(a)},d_=e=>{let n=(0,uf.c)(2),a;return n[0]===e?a=n[1]:(a=sy(e),n[0]=e,n[1]=a),mn(a)},jm=()=>{let{cellIds:e,cellHandles:n}=Fe.get(Ye);return e.inOrderIds.map(a=>{var o,s;return(s=(o=n[a])==null?void 0:o.current)==null?void 0:s.editorViewOrNull}).filter(Boolean)},Qu=e=>{var a;let{cellHandles:n}=Fe.get(Ye);return(a=n[e].current)==null?void 0:a.editorView},f_=function(e){let{cellIds:n,cellData:a,cellRuntime:o}=e;return n.getColumns().flatMap(s=>s.topLevelIds.map(c=>({...a[c],...o[c]})))},Jw=function(e){return Ce(n=>n(Ye).untouchedNewCells.has(e))};function l4(e){let n=df(e);return Ce(a=>{let o=a(n);if(!o||o.status==="queued"||o.status==="running")return;let s=[],c=o.consoleOutputs;if(c&&c.length>0){let p=c.find(g=>g.mimetype==="application/vnd.marimo+traceback");if(p){let g=p.data;s.push(...um(g))}}let h=o.output;if((h==null?void 0:h.mimetype)==="application/vnd.marimo+error"){let p=h.data;if(Array.isArray(p))for(let g of p)g.type==="syntax"&&g.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:g.lineno}),g.type==="import-star"&&g.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:g.lineno})}return s.length>0?s:void 0})}tm=function(){return iy()}})();export{Mh as $,Ph as $n,bl as $r,Nh as $t,aw as A,iw as An,Fi as Ar,ow as At,Dh as B,Au as Bn,Vi as Br,sw as Bt,lw as C,jh as Ci,wl as Cn,cw as Cr,Iu as Ct,uw as D,zh as Di,qh as Dn,dw as Dr,Bh as Dt,fw as E,Ru as Ei,Mu as En,_l as Er,Fh as Et,pw as F,Vh as Fn,Hh as Fr,xl as Ft,$h as G,hw as Gn,ns as Gr,Pu as Gt,mw as H,Qa as Hn,Wh as Hr,Uh as Ht,er as I,Nu as In,gw as Ir,Fn as It,Du as J,Kh as Jn,yw as Jr,ju as Jt,Qh as K,kl as Kn,Sl as Kr,Ir as Kt,tr as L,zu as Ln,qu as Lr,Bu as Lt,vw as M,Ga as Mn,sa as Mr,bw as Mt,ww as N,_w as Nn,Gh as Nr,Jh as Nt,xw as O,Fu as Oi,Xh as On,kw as Or,Sw as Ot,Cw as P,Cl as Pn,Ew as Pr,Yh as Pt,Zh as Q,em as Qn,Ja as Qr,Tw as Qt,Lw as R,El as Rn,Vu as Rr,Ow as Rt,Aw as S,Iw as Si,Rw as Sn,Mw as Sr,Pw as St,tm as T,Nw as Ti,Dw as Tn,jw as Tr,nm as Tt,rm as U,zw as Un,Tl as Ur,qw as Ut,Bw as V,Fw as Vn,Hu as Vr,am as Vt,Vw as W,$u as Wn,Ll as Wr,Hw as Wt,im as X,om as Xn,sm as Xr,lm as Xt,cm as Y,Hi as Yn,um as Yr,dm as Yt,$w as Z,fm as Zn,pm as Zr,hm as Zt,Ww as _,jT as __tla,Uw as _i,Wu as _n,$i as _r,nr as _t,Uu as a,Kw as ai,la as an,rs as ar,mm as at,Ye as b,Vn as bi,gm as bn,Qw as br,Gw as bt,Jw as c,gn as ci,Xw as cn,ym as cr,vm as ct,Yw as d,Ol as di,Ku as dn,bm as dr,Zw as dt,e_ as ei,wm as en,_m as er,t_ as et,Qu as f,Gu as fi,n_ as fn,xm as fr,km as ft,r_ as g,Xa as gi,Ju as gn,Xu as gr,a_ as gt,Wi as h,Sm as hi,i_ as hn,o_ as hr,Al as ht,Yu as i,as as ii,s_ as in,Zu as ir,Cm as it,l_ as j,c_ as jn,ct as jr,u_ as jt,d_ as k,ed as kn,ca as kr,td as kt,f_ as l,p_ as li,Em as ln,Tm as lr,h_ as lt,m_ as m,g_ as mi,y_ as mn,Lm as mr,v_ as mt,nd as n,b_ as ni,w_ as nn,rd as nr,__ as nt,x_ as o,k_ as oi,Il as on,Om as or,S_ as ot,C_ as p,E_ as pi,ad as pn,Am as pr,T_ as pt,L_ as q,Im as qn,Ya as qr,id as qt,O_ as r,od as ri,A_ as rn,Rm as rr,Mm as rt,I_ as s,is as si,R_ as sn,Pm as sr,Nm as st,M_ as t,Dm as ti,P_ as tn,Ui as tr,sd as tt,jm as u,Rl as ui,zm as un,qm as ur,N_ as ut,D_ as v,En as vi,Bm as vn,j_ as vr,Ki as vt,z_ as w,q_ as wi,B_ as wn,F_ as wr,Fm as wt,V_ as x,ld as xi,H_ as xn,cd as xr,rr as xt,$_ as y,os as yi,ud as yn,W_ as yr,U_ as yt,K_ as z,Q_ as zn,G_ as zr,J_ as zt};