@marimo-team/frontend 0.19.7-dev45 → 0.19.7-dev47

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-BFim6YKS.js → CellStatus-C5UGkPn6.js} +1 -1
  2. package/dist/assets/{JsonOutput-DkVhF91W.js → JsonOutput-CknFTI_u.js} +1 -1
  3. package/dist/assets/{MarimoErrorOutput-DWQ55i9r.js → MarimoErrorOutput-5rudBbo3.js} +1 -1
  4. package/dist/assets/{RenderHTML-a-roMXlk.js → RenderHTML-CQZqVk1Z.js} +1 -1
  5. package/dist/assets/{add-cell-with-ai-BR7IVCSW.js → add-cell-with-ai-pVFp5LZG.js} +1 -1
  6. package/dist/assets/{add-database-form-ClfjsEtC.js → add-database-form-3g4nuZN1.js} +1 -1
  7. package/dist/assets/{agent-panel-DSORiKrx.js → agent-panel-DboxNcTk.js} +1 -1
  8. package/dist/assets/{ai-model-dropdown-JY5c7nJK.js → ai-model-dropdown-71lgLrLy.js} +1 -1
  9. package/dist/assets/{app-config-button-Jz087HD-.js → app-config-button-d7RvqO40.js} +1 -1
  10. package/dist/assets/{cell-editor-B6FY0jdx.js → cell-editor-CeBmoryT.js} +1 -1
  11. package/dist/assets/{cell-link-D2K7clF4.js → cell-link-Bw5bzt4a.js} +1 -1
  12. package/dist/assets/{cells-Dxpbusw1.js → cells-BpZ7g6ok.js} +40 -40
  13. package/dist/assets/{chat-components-B6qBxIzc.js → chat-components-CGlO4yUw.js} +1 -1
  14. package/dist/assets/{chat-display-CPulKLCm.js → chat-display-B4mGvJ0X.js} +1 -1
  15. package/dist/assets/{chat-panel-COGD6xs1.js → chat-panel-CrWYAGFe.js} +1 -1
  16. package/dist/assets/{column-preview-D3y9pwSu.js → column-preview-CxMrs0B_.js} +1 -1
  17. package/dist/assets/{command-BqcYTnlg.js → command-DhzFN2CJ.js} +1 -1
  18. package/dist/assets/{command-palette-BaR-SOA3.js → command-palette-CK_YtcI5.js} +1 -1
  19. package/dist/assets/{common-DuZx4dBP.js → common-dAEMv5ry.js} +1 -1
  20. package/dist/assets/{datasource-BA7iQQaN.js → datasource-B0OJBphG.js} +1 -1
  21. package/dist/assets/{dependency-graph-panel-C27DHbPF.js → dependency-graph-panel-BxuHF8Tr.js} +1 -1
  22. package/dist/assets/{documentation-panel-COvuCjB2.js → documentation-panel-DLCX-Vvr.js} +1 -1
  23. package/dist/assets/{download-DZGL4UAN.js → download-BhCZMKuQ.js} +1 -1
  24. package/dist/assets/{edit-page-CoNmmXUy.js → edit-page-D3Eg7nUs.js} +3 -3
  25. package/dist/assets/{error-panel-BHPn8JVQ.js → error-panel-CZ-XjEWh.js} +1 -1
  26. package/dist/assets/{file-explorer-panel-CozR65iO.js → file-explorer-panel-DUA58FLp.js} +1 -1
  27. package/dist/assets/{floating-outline-CY6lTY5s.js → floating-outline-DcxjrFFt.js} +1 -1
  28. package/dist/assets/{focus-BLcChWyg.js → focus-D51fcwZX.js} +1 -1
  29. package/dist/assets/{form-CKnYm6ml.js → form-DUA_Rz_a.js} +1 -1
  30. package/dist/assets/{globals-Dd-Dr3p2.js → globals-DKH14XH0.js} +1 -1
  31. package/dist/assets/{home-page-Ds6etoNv.js → home-page-B7vvwjUd.js} +1 -1
  32. package/dist/assets/{hooks-B1vW9UPB.js → hooks-CotXIFzV.js} +1 -1
  33. package/dist/assets/{html-to-image-DSMiAoU4.js → html-to-image-DjukyIj4.js} +1 -1
  34. package/dist/assets/{index-B_qRlPME.js → index-DGasP9Lh.js} +3 -3
  35. package/dist/assets/{kiosk-mode-x5QGVyC6.js → kiosk-mode-B5u1Ptdj.js} +1 -1
  36. package/dist/assets/{layout-BVZJ0wNL.js → layout-B1RE_FQ4.js} +1 -1
  37. package/dist/assets/{logs-panel-W6lnhN9B.js → logs-panel-1gpGfzHV.js} +1 -1
  38. package/dist/assets/{markdown-renderer-Bx2DfaSd.js → markdown-renderer-DhMlG2dP.js} +1 -1
  39. package/dist/assets/{mode-BQL1qb7F.js → mode-DX8pdI-l.js} +1 -1
  40. package/dist/assets/{name-cell-input-B3FIAxBj.js → name-cell-input-FC1vzor8.js} +1 -1
  41. package/dist/assets/{outline-panel-AJlQUjZ_.js → outline-panel-e_rdB4-A.js} +1 -1
  42. package/dist/assets/{packages-panel-BJsvZ-68.js → packages-panel-CWeSsfWc.js} +1 -1
  43. package/dist/assets/{panels-CZFKs6IJ.js → panels-DdW0Mr43.js} +1 -1
  44. package/dist/assets/{process-output-DK8a3ADA.js → process-output-CagdHMzs.js} +1 -1
  45. package/dist/assets/{readonly-python-code-tAbt2ya8.js → readonly-python-code-DyP9LVLc.js} +1 -1
  46. package/dist/assets/{run-page-BpOFopIQ.js → run-page-4ks5Ng3f.js} +1 -1
  47. package/dist/assets/{scratchpad-panel-DfCsTT2f.js → scratchpad-panel-BKlpCchw.js} +1 -1
  48. package/dist/assets/{session-panel-Dd73AAIv.js → session-panel-Bsntt1Wf.js} +1 -1
  49. package/dist/assets/{snippets-panel-HEdYHO0z.js → snippets-panel-BgCAYJln.js} +1 -1
  50. package/dist/assets/{state-BMdr2nMy.js → state-BfXVTTtD.js} +1 -1
  51. package/dist/assets/{switch-uE7-SGTN.js → switch-8sn_4qbh.js} +1 -1
  52. package/dist/assets/{textarea-Dnc9oNCJ.js → textarea-DBO30D7K.js} +1 -1
  53. package/dist/assets/{tracing-CsZXkSMG.js → tracing-DcLhmYc2.js} +1 -1
  54. package/dist/assets/{tracing-panel-DzL1Eutt.js → tracing-panel-CLF67O54.js} +2 -2
  55. package/dist/assets/{types-BjS1POBx.js → types-DuQOSW7G.js} +1 -1
  56. package/dist/assets/{useAddCell-fK8ZFPPQ.js → useAddCell-BmeZUK02.js} +1 -1
  57. package/dist/assets/{useCellActionButton-BBXD0ZNf.js → useCellActionButton-DNI-LzxR.js} +1 -1
  58. package/dist/assets/{useDeleteCell-BFvljUOH.js → useDeleteCell-5uYlTcQZ.js} +1 -1
  59. package/dist/assets/{useDependencyPanelTab-4_zo1zmo.js → useDependencyPanelTab-P4LD32r5.js} +1 -1
  60. package/dist/assets/{useNotebookActions---KuaMmt.js → useNotebookActions-BkFpDvzl.js} +1 -1
  61. package/dist/assets/{useRunCells-ChluEx0W.js → useRunCells-24p6hn99.js} +1 -1
  62. package/dist/assets/{useSplitCell-BYSgH1JP.js → useSplitCell-C8MYZz7z.js} +1 -1
  63. package/dist/assets/{utilities.esm-CgPvBw6L.js → utilities.esm-CIPARd6-.js} +1 -1
  64. package/dist/index.html +31 -31
  65. package/package.json +2 -2
  66. package/src/core/codemirror/language/languages/python.ts +1 -1
  67. package/src/core/codemirror/lsp/notebook-lsp.ts +36 -16
@@ -1,25 +1,25 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./esm-BHwEmOw7.js","./chunk-LvLJmgfZ.js","./dist-Z4EybR_c.js","./dist-Gqv0jSNr.js","./dist-ChS0Dc_R.js","./dist-DBwNzi3C.js","./dist-BhtRbLYO.js","./dist-C9XNJlLJ.js","./dist-B407S7D_.js","./dist-BIKFl48f.js","./dist-CIhvkX-u.js","./dist-fsvXrTzp.js","./dist-BSxIk2Vq.js","./dist-TiFCI16_.js","./dist-B0VqT_4z.js","./dist-CyLRJKkZ.js","./dist-6cIjG-FS.js","./dist-SpkGM8op.js","./dist-Dnr44J-w.js","./dist-kdxmhWbv.js","./dist-B_YgElQP.js","./dist-CldbmzwA.js","./dist-BYEzs7zM.js","./dist-BtWo0SNF.js","./dist-0C6YCYyu.js","./dist-BVyBw1BD.js","./dist-DstaRs6N.js","./dist-Cayq-K1c.js","./dist-Ad37Z4TC.js","./dist-OM63llNV.js","./dist-Cip4Ndtd.js","./dist-BYyu59D8.js","./dist-DiFit-1W.js","./dist-BmvOPdv_.js","./dist-CYdfU9am.js","./dist-DDGPBuw4.js","./dist-w6kOVH_r.js","./dist-CS67iP1P.js","./dist-Chrniyxe.js","./dist-C4h-1T2Q.js","./dist-fX0SBNCK.js","./dist-D_XLVesh.js","./apl-Dkj9Qe7k.js","./apl-DVWF09P_.js","./asciiarmor-BtQZNUPe.js","./asciiarmor-l0ikukqg.js","./asn1-Df2Lrqg5.js","./asn1-CsdiW8T7.js","./brainfuck-BKWhJvy5.js","./brainfuck-C66TQVgP.js","./cobol-D0Y9QJHH.js","./cobol-BrIP6mPV.js","./clike-Db5sDcCN.js","./clike-Cc3gZvM_.js","./clojure-CktH9n5q.js","./clojure-kT8c8jnq.js","./css-DPSOOi60.js","./css-CU1K_XUx.js","./cmake-BwTN0lwz.js","./cmake-B3S-FpMv.js","./coffeescript-CL84ZPXU.js","./coffeescript-ByxLkrBT.js","./commonlisp-CukhuKqj.js","./commonlisp-BjIOT_KK.js","./cypher-DTLWn8Gw.js","./cypher-An7BGqKu.js","./python-BAh1L3Ue.js","./python-GCb3koKb.js","./crystal-DjLRzuWS.js","./crystal-CQtLRTna.js","./d-DWjY1SxT.js","./d-fbf-n02o.js","./diff-CBkFqCNH.js","./diff-DbzsqZEz.js","./dockerfile-pmRcusjN.js","./simple-mode-BVXe8Gj5.js","./dtd-BuqGL9hz.js","./dtd-DnQAYfYi.js","./dylan-WTW5QtBM.js","./dylan-DeXj1TAN.js","./ecl-DBVSQs77.js","./ecl-B8-j0xrP.js","./eiffel-C3Tl80Mr.js","./eiffel-DdiJ6Uyn.js","./elm-BzK6589w.js","./elm-CAmK9rmL.js","./erlang-DMCyf1S1.js","./erlang-hqy6gURy.js","./factor-Y7W4xwTs.js","./factor-Di_n0Vcb.js","./forth-a7Ame17q.js","./forth-CsaVBHm8.js","./fortran-D8W1t7ql.js","./fortran-DGNsp41i.js","./mllike-Dy0V9wt1.js","./mllike-eEM7KiC0.js","./gas-CPCP4r6U.js","./gas-BX8xjNNw.js","./gherkin-dyINaGjD.js","./gherkin--u9ojH5d.js","./groovy-yBYyWQAY.js","./groovy-Drg0Cp0-.js","./haskell-DOSr8Xuo.js","./haskell-D96A8Bg_.js","./haxe-JqSUWIxe.js","./haxe-B_4sGLdj.js","./idl-D2Ag6F2o.js","./idl-CA47OCO3.js","./javascript-3AO8kHoR.js","./javascript-i8I6A_gg.js","./julia-DB4UbzHR.js","./julia-DYuDt1xN.js","./livescript-DReeORQ9.js","./livescript-C72Fe_WX.js","./lua-ybhkw42a.js","./lua-CrUucAvm.js","./mirc-BeRjyZ00.js","./mirc-Dpq184o1.js","./mathematica-DknPFJHQ.js","./mathematica-GLtAlQgr.js","./modelica--iMtH0NO.js","./modelica-BKRVU7Ex.js","./mumps-DXhR5sNO.js","./mumps-46YgImgy.js","./mbox-CvGrdGLO.js","./mbox-DsldZPOv.js","./nsis-FfqfUShs.js","./nsis-Bh7CNuij.js","./ntriples-C3Y5YwlO.js","./ntriples-CABx3n6p.js","./octave-Dn-U4f-O.js","./octave-ChjrzDtA.js","./oz-Dx3Usekg.js","./oz-BZ0G7oQI.js","./pascal-Bhoas9O4.js","./pascal-BDWWzmkf.js","./perl-uQVtdMdg.js","./perl-C1twkBDg.js","./pig-DDagqkh7.js","./pig-CKZ-JUXx.js","./powershell-WeyQqZtK.js","./powershell-BmnkAUC8.js","./properties-MEyUmkzm.js","./properties-B3qF4Ofl.js","./protobuf-DrUQLGvH.js","./protobuf-CdWFIAi_.js","./pug-YYu0lKKy.js","./pug-DEhrk7ZA.js","./puppet-C9UhEtzi.js","./puppet-oVG7sgNi.js","./q-CoA1I94V.js","./q-CylRV6ad.js","./r-CnPeMCLv.js","./r-BV8FQxo8.js","./rpm-DOBsrwns.js","./rpm-0QmIraaR.js","./ruby-DphmqCS4.js","./ruby-h-bI2J_W.js","./sas-DqX-D0mu.js","./sas-BvwZbLPG.js","./scheme-BDPqQOec.js","./scheme-BPuaxh6y.js","./shell-BbHQ-2DS.js","./shell-DmziZNbR.js","./sieve-AQvCITfE.js","./sieve-DT4D9aeW.js","./smalltalk-C_EFh1kg.js","./smalltalk-lAY6r45k.js","./sparql-BlXg3dFR.js","./sparql-nFvL3z3l.js","./stylus-Dvm1D-Up.js","./stylus-BawZsgUJ.js","./swift-BYNffoE5.js","./swift-CdaDqiGL.js","./stex-D6sqtveI.js","./stex-CtmkcLz7.js","./verilog-CtASbUB4.js","./verilog-DmcGbw8B.js","./tcl-BXf8cJq0.js","./tcl-D5FopUjH.js","./textile-BYQcpBSz.js","./textile-Cum4VLew.js","./toml-DRBRsKy_.js","./toml-5si8PWt8.js","./troff-DrvwLjLq.js","./troff-qCd7sECP.js","./ttcn-DP5EbkJT.js","./ttcn-BZC1oJG1.js","./ttcn-cfg-BRAAKR13.js","./ttcn-cfg-BlUyan1P.js","./turtle-Dfy5N6iI.js","./turtle-BGa4pyfx.js","./webidl-CHQTLbOi.js","./webidl-DHu7cr9_.js","./vb-DzPnQ7Kn.js","./vb-G28CZ46r.js","./vbscript-Dsr7xm0B.js","./vbscript-DOr4ZYtx.js","./velocity-BP08r0ZT.js","./velocity-DRewaasJ.js","./vhdl-BNXpaYPc.js","./vhdl-C6ktucee.js","./xquery-BysgHIf7.js","./xquery-BuvyHzVJ.js","./yacas-jKltHvRl.js","./yacas-C_HpkPlV.js","./z80-DVuK3CCU.js","./z80-BDlRltlF.js","./mscgen-CqR_OhJF.js","./mscgen-LPWHVNeM.js","./dist-rTuWF9u4.js","./dist-BZY_uvFb.js","./dist-DeazQ1Kh.js","./node-sql-parser-DYAIp20j.js"])))=>i.map(i=>d[i]);
2
- var JR=Object.defineProperty;var XR=(Ki,Yr,Na)=>Yr in Ki?JR(Ki,Yr,{enumerable:!0,configurable:!0,writable:!0,value:Na}):Ki[Yr]=Na;var ke=(Ki,Yr,Na)=>XR(Ki,typeof Yr!="symbol"?Yr+"":Yr,Na);import{a as Du,n as J2,o as YR,r as ZR,s as vh,t as Ce}from"./chunk-LvLJmgfZ.js";import{c as X2,i as lt,l as Y2,p as ze,r as e4,s as t4,u as Zn}from"./useEvent-DO6uJBas.js";import{t as Ou}from"./react-BGmjiNul.js";import{t as n4}from"./react-dom-C9fstfnp.js";import{B as r4,N as i4,P as Z2,R as ew,T as tw,k as a4,w as o4}from"./zod-Cg4WLWh2.js";import{t as Jr}from"./compiler-runtime-DeeZ7FnK.js";import{f as s4}from"./_Uint8Array-BGESiCQL.js";import{n as l4}from"./toString-DlRqgfqz.js";import{t as c4}from"./toInteger-CDcO32Gx.js";import{d as u4}from"./_baseIsEqual-B9N9Mw_N.js";import{n as d4,u as f4}from"./merge-BBX6ug-N.js";import{n as _s}from"./assertNever-CBU83Y6o.js";import{a as bh,i as p4,o as h4,r as m4,s as g4,t as y4}from"./useLifecycle-D35CBukS.js";import{t as v4}from"./_baseProperty-NKyJO2oh.js";import{t as nw}from"./debounce-B3mjKxHe.js";import{a as ui,d as Ee,o as rw,s as b4}from"./hotkeys-BHHWjLlp.js";import{t as In}from"./invariant-CAG_dYON.js";import{f as iw,t as w4}from"./utils-DXvhzCGS.js";import{O as _4,j as wh,r as x4}from"./config-CIrPQIbt.js";import{r as aw}from"./useEventListener-DIUKKfEy.js";import{t as k4}from"./jsx-runtime-ZmTK25f3.js";import{t as ow}from"./button-YC1gW_kJ.js";import{t as Pu}from"./cn-BKtXLv3a.js";import{A as S4,At as C4,Bt as E4,C as T4,D as R4,Et as sw,Gt as lw,H as cw,Ht as uw,I as dw,J as Mu,Jt as xs,Ot as ks,Pt as D4,Rt as Lu,S as O4,St as Ra,T as fw,U as P4,Ut as Nu,Vt as Ol,W as M4,Wt as L4,Xt as Ss,Yt as vo,_t as N4,at as Kt,b as pw,ct as Pl,f as hw,it as I4,k as A4,kt as _h,l as le,mt as q4,nt as mw,ot as j4,p as z4,qt as Bi,rt as Hi,u as gw,ut as F4,xt as xh,z as yw,zt as mn}from"./dist-DBwNzi3C.js";import{A as B4,E as H4,S as V4,T as $4,_ as W4,b as U4,d as vw,f as K4,h as Q4,m as G4,n as J4,o as kh,p as X4,s as Y4,t as Z4,u as eD,v as tD,w as nD,x as rD}from"./dist-CtsanegT.js";import{a as bw,i as iD,n as di,o as ww,p as Sh,s as Ml}from"./once-Bul8mtFs.js";import{t as aD}from"./capabilities-MM7JYRxj.js";import{t as oD}from"./cjs-CH5Rj0g8.js";import{t as Ll}from"./createReducer-Dnna-AUO.js";import{d as _w,l as xw,n as sD,o as kw,p as lD,r as Iu}from"./dist-ChS0Dc_R.js";import{i as Ch,r as Eh}from"./main-U5Goe76G.js";import{n as Sw,t as cD}from"./useNonce-_Aax6sXd.js";import{t as Vi}from"./requests-BsVD4CdD.js";import{a as uD,c as dD,d as fD,f as Cw,i as pD,l as hD,n as mD,o as Th,r as gD,s as Rh,t as yD,u as vD}from"./dist-Gqv0jSNr.js";import{t as Tt}from"./createLucideIcon-CnW3RofX.js";import{t as bD}from"./check-DdfN0k2d.js";import{a as wD,c as _D,i as Dh,m as xD,n as kD,o as Ew,r as SD,s as CD,t as ED}from"./select-V5IdpNiR.js";import{t as TD,u as RD}from"./toDate-CgbKQM5E.js";import{t as DD}from"./database-zap-B9y7063w.js";import{n as OD,t as Au}from"./DeferredRequestRegistry-CO2AyNfd.js";import{t as mr}from"./badge-Ce8wRjuQ.js";import{t as ce}from"./preload-helper-DItdS47A.js";import{a as Tw,s as PD}from"./dist-Cayq-K1c.js";import{a as MD,i as Oh,n as LD,r as Rw,t as ND}from"./dist-BYyu59D8.js";import{n as ID}from"./stex-CtmkcLz7.js";import{t as Nl}from"./use-toast-rmUWldD_.js";import{n as AD}from"./useTheme-DUdVAZI8.js";import{E as qD,S as jD,_ as Ph,w as Dw,x as zD}from"./Combination-CMPwuAmi.js";import{l as FD}from"./dist-uzvC4uAK.js";import{i as BD,t as Mh}from"./tooltip-CEc2ajau.js";let Ow,Lh,qu,ju,Pw,zu,Il,Mw,Lw,Nh,Da,Nw,Iw,Ih,Aw,gr,qw,jw,bo,zw,Fw,Fu,Bw,Hw,Pr,wo,Oa,Ah,qh,Cs,Bu,Vw,jh,Hu,$w,zh,Mr,Fh,Ww,Bh,Hh,Vh,Es,Al,Uw,$h,Ts,Kw,Qw,Wh,Uh,Kh,Gw,ql,jl,fi,Jw,Qh,Vu,$u,Xw,Pa,Wu,Gh,Yw,Jh,zl,Uu,Xh,Yh,Fl,Zh,Zw,em,tm,Bl,e_,Ku,nm,Hl,t_,n_,Qu,r_,i_,rm,im,a_,o_,_o,Vl,am,om,Gu,s_,l_,c_,sm,u_,d_,lm,cm,$n,f_,um,dm,$l,fm,p_,Wl,Pt,h_,Ju,er,Xu,m_,xo,g_,Ma,pm,hm,y_,Yu,mm,v_,Lr,b_,w_,Ul,__,gm,x_,k_,ym,Zu,ed,S_,C_,Kl,vm,E_,T_,ko,td,R_,nd,Ql,$i,D_,rd,O_,id,P_,Xr,M_,L_,Gl,ad,N_,I_,bm,wm,A_,q_,j_,z_,F_,od,_m,B_,H_,xm,sd,km,V_,ld,Sm,$_,Rs,Cm,W_,U_,K_,Em,Q_,G_,Tm,cd,Rm,J_,Wi,X_,La,Y_,So,Dm,Z_,yr,ud,dd,ex,tx,nx,fd,rx,ix,Om,Pm,ax,ox,pd,sx,lx,Ui,cx,ux,Jl,Mm,hd,dx,fx,px,Lm,bt,hx,Nm,mx,Im,Am,qm,Xl,HD=(async()=>{var zr,_f,$a;let Ki,Yr,Na,Fm;Ki=Ce((e=>{function n(re,se){var Q=re.length;re.push(se);e:for(;0<Q;){var Le=Q-1>>>1,Fe=re[Le];if(0<s(Fe,se))re[Le]=se,re[Q]=Fe,Q=Le;else break e}}function i(re){return re.length===0?null:re[0]}function o(re){if(re.length===0)return null;var se=re[0],Q=re.pop();if(Q!==se){re[0]=Q;e:for(var Le=0,Fe=re.length,et=Fe>>>1;Le<et;){var Be=2*(Le+1)-1,je=re[Be],Pe=Be+1,Ae=re[Pe];if(0>s(je,Q))Pe<Fe&&0>s(Ae,je)?(re[Le]=Ae,re[Pe]=Q,Le=Pe):(re[Le]=je,re[Be]=Q,Le=Be);else if(Pe<Fe&&0>s(Ae,Q))re[Le]=Ae,re[Pe]=Q,Le=Pe;else break e}}return se}function s(re,se){var Q=re.sortIndex-se.sortIndex;return Q===0?re.id-se.id:Q}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 d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var p=[],y=[],w=1,_=null,C=3,E=!1,T=!1,I=!1,$=!1,V=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function K(re){for(var se=i(y);se!==null;){if(se.callback===null)o(y);else if(se.startTime<=re)o(y),se.sortIndex=se.expirationTime,n(p,se);else break;se=i(y)}}function pe(re){if(I=!1,K(re),!T)if(i(p)!==null)T=!0,P||(P=!0,J());else{var se=i(y);se!==null&&Z(pe,se.startTime-re)}}var P=!1,A=-1,W=5,de=-1;function fe(){return $?!0:!(e.unstable_now()-de<W)}function we(){if($=!1,P){var re=e.unstable_now();de=re;var se=!0;try{e:{T=!1,I&&(I=!1,F(A),A=-1),E=!0;var Q=C;try{t:{for(K(re),_=i(p);_!==null&&!(_.expirationTime>re&&fe());){var Le=_.callback;if(typeof Le=="function"){_.callback=null,C=_.priorityLevel;var Fe=Le(_.expirationTime<=re);if(re=e.unstable_now(),typeof Fe=="function"){_.callback=Fe,K(re),se=!0;break t}_===i(p)&&o(p),K(re)}else o(p);_=i(p)}if(_!==null)se=!0;else{var et=i(y);et!==null&&Z(pe,et.startTime-re),se=!1}}break e}finally{_=null,C=Q,E=!1}se=void 0}}finally{se?J():P=!1}}}var J;if(typeof N=="function")J=function(){N(we)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,Se=be.port2;be.port1.onmessage=we,J=function(){Se.postMessage(null)}}else J=function(){V(we,0)};function Z(re,se){A=V(function(){re(e.unstable_now())},se)}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(re){re.callback=null},e.unstable_forceFrameRate=function(re){0>re||125<re?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<re?Math.floor(1e3/re):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(re){switch(C){case 1:case 2:case 3:var se=3;break;default:se=C}var Q=C;C=se;try{return re()}finally{C=Q}},e.unstable_requestPaint=function(){$=!0},e.unstable_runWithPriority=function(re,se){switch(re){case 1:case 2:case 3:case 4:case 5:break;default:re=3}var Q=C;C=re;try{return se()}finally{C=Q}},e.unstable_scheduleCallback=function(re,se,Q){var Le=e.unstable_now();switch(typeof Q=="object"&&Q?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?Le+Q:Le):Q=Le,re){case 1:var Fe=-1;break;case 2:Fe=250;break;case 5:Fe=1073741823;break;case 4:Fe=1e4;break;default:Fe=5e3}return Fe=Q+Fe,re={id:w++,callback:se,priorityLevel:re,startTime:Q,expirationTime:Fe,sortIndex:-1},Q>Le?(re.sortIndex=Q,n(y,re),i(p)===null&&re===i(y)&&(I?(F(A),A=-1):I=!0,Z(pe,Q-Le))):(re.sortIndex=Fe,n(p,re),T||E||(T=!0,P||(P=!0,J()))),re},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(re){var se=C;return function(){var Q=C;C=se;try{return re.apply(this,arguments)}finally{C=Q}}}})),Yr=Ce(((e,n)=>{n.exports=Ki()})),Na=Ce((e=>{var n=Yr(),i=Ou(),o=n4();function s(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}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 d(t){var r=t,a=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,r.flags&4098&&(a=r.return),t=r.return;while(t)}return r.tag===3?a:null}function f(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 p(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 y(t){if(d(t)!==t)throw Error(s(188))}function w(t){var r=t.alternate;if(!r){if(r=d(t),r===null)throw Error(s(188));return r===t?t:null}for(var a=t,l=r;;){var h=a.return;if(h===null)break;var g=h.alternate;if(g===null){if(l=h.return,l!==null){a=l;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===a)return y(h),t;if(g===l)return y(h),r;g=g.sibling}throw Error(s(188))}if(a.return!==l.return)a=h,l=g;else{for(var S=!1,D=h.child;D;){if(D===a){S=!0,a=h,l=g;break}if(D===l){S=!0,l=h,a=g;break}D=D.sibling}if(!S){for(D=g.child;D;){if(D===a){S=!0,a=g,l=h;break}if(D===l){S=!0,l=g,a=h;break}D=D.sibling}if(!S)throw Error(s(189))}}if(a.alternate!==l)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?t:r}function _(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=_(t),r!==null)return r;t=t.sibling}return null}var C=Object.assign,E=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),K=Symbol.for("react.context"),pe=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),de=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),we=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function be(t){return typeof t!="object"||!t?null:(t=J&&t[J]||t["@@iterator"],typeof t=="function"?t:null)}var Se=Symbol.for("react.client.reference");function Z(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Se?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case $:return"Fragment";case F:return"Profiler";case V:return"StrictMode";case P:return"Suspense";case A:return"SuspenseList";case fe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case I:return"Portal";case K:return t.displayName||"Context";case N:return(t._context.displayName||"Context")+".Consumer";case pe:var r=t.render;return t=t.displayName,t||(t=(t=r.displayName||r.name||"",t===""?"ForwardRef":"ForwardRef("+t+")")),t;case W:return r=t.displayName||null,r===null?Z(t.type)||"Memo":r;case de:r=t._payload,t=t._init;try{return Z(t(r))}catch{}}return null}var re=Array.isArray,se=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Le={pending:!1,data:null,method:null,action:null},Fe=[],et=-1;function Be(t){return{current:t}}function je(t){0>et||(t.current=Fe[et],Fe[et]=null,et--)}function Pe(t,r){et++,Fe[et]=t.current,t.current=r}var Ae=Be(null),ft=Be(null),mt=Be(null),Dn=Be(null);function un(t,r){switch(Pe(mt,r),Pe(ft,t),Pe(Ae,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?x2(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=x2(r),t=k2(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}je(Ae),Pe(Ae,t)}function We(){je(Ae),je(ft),je(mt)}function tn(t){t.memoizedState!==null&&Pe(Dn,t);var r=Ae.current,a=k2(r,t.type);r!==a&&(Pe(ft,t),Pe(Ae,a))}function wt(t){ft.current===t&&(je(Ae),je(ft)),Dn.current===t&&(je(Dn),El._currentValue=Le)}var vn,vr;function pt(t){if(vn===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);vn=r&&r[1]||"",vr=-1<a.stack.indexOf(`
2
+ var JR=Object.defineProperty;var XR=(Ki,Yr,Na)=>Yr in Ki?JR(Ki,Yr,{enumerable:!0,configurable:!0,writable:!0,value:Na}):Ki[Yr]=Na;var ke=(Ki,Yr,Na)=>XR(Ki,typeof Yr!="symbol"?Yr+"":Yr,Na);import{a as Du,n as J2,o as YR,r as ZR,s as vh,t as Ee}from"./chunk-LvLJmgfZ.js";import{c as X2,i as lt,l as Y2,p as ze,r as e4,s as t4,u as Zn}from"./useEvent-DO6uJBas.js";import{t as Ou}from"./react-BGmjiNul.js";import{t as n4}from"./react-dom-C9fstfnp.js";import{B as r4,N as i4,P as Z2,R as ew,T as tw,k as a4,w as o4}from"./zod-Cg4WLWh2.js";import{t as Jr}from"./compiler-runtime-DeeZ7FnK.js";import{f as s4}from"./_Uint8Array-BGESiCQL.js";import{n as l4}from"./toString-DlRqgfqz.js";import{t as c4}from"./toInteger-CDcO32Gx.js";import{d as u4}from"./_baseIsEqual-B9N9Mw_N.js";import{n as d4,u as f4}from"./merge-BBX6ug-N.js";import{n as _s}from"./assertNever-CBU83Y6o.js";import{a as bh,i as p4,o as h4,r as m4,s as g4,t as y4}from"./useLifecycle-D35CBukS.js";import{t as v4}from"./_baseProperty-NKyJO2oh.js";import{t as nw}from"./debounce-B3mjKxHe.js";import{a as ui,d as Se,o as rw,s as b4}from"./hotkeys-BHHWjLlp.js";import{t as In}from"./invariant-CAG_dYON.js";import{f as iw,t as w4}from"./utils-DXvhzCGS.js";import{O as _4,j as wh,r as x4}from"./config-CIrPQIbt.js";import{r as aw}from"./useEventListener-DIUKKfEy.js";import{t as k4}from"./jsx-runtime-ZmTK25f3.js";import{t as ow}from"./button-YC1gW_kJ.js";import{t as Pu}from"./cn-BKtXLv3a.js";import{A as S4,At as C4,Bt as E4,C as T4,D as R4,Et as sw,Gt as lw,H as cw,Ht as uw,I as dw,J as Mu,Jt as xs,Ot as ks,Pt as D4,Rt as Lu,S as O4,St as Ra,T as fw,U as P4,Ut as Nu,Vt as Dl,W as M4,Wt as L4,Xt as Ss,Yt as vo,_t as N4,at as Kt,b as pw,ct as Ol,f as hw,it as I4,k as A4,kt as _h,l as le,mt as q4,nt as mw,ot as j4,p as z4,qt as Bi,rt as Hi,u as gw,ut as F4,xt as xh,z as yw,zt as mn}from"./dist-DBwNzi3C.js";import{A as B4,E as H4,S as V4,T as $4,_ as W4,b as U4,d as vw,f as K4,h as Q4,m as G4,n as J4,o as kh,p as X4,s as Y4,t as Z4,u as eD,v as tD,w as nD,x as rD}from"./dist-CtsanegT.js";import{a as bw,i as iD,n as di,o as ww,p as Sh,s as Pl}from"./once-Bul8mtFs.js";import{t as aD}from"./capabilities-MM7JYRxj.js";import{t as oD}from"./cjs-CH5Rj0g8.js";import{t as Ml}from"./createReducer-Dnna-AUO.js";import{d as _w,l as xw,n as sD,o as kw,p as lD,r as Iu}from"./dist-ChS0Dc_R.js";import{i as Ch,r as Eh}from"./main-U5Goe76G.js";import{n as Sw,t as cD}from"./useNonce-_Aax6sXd.js";import{t as Vi}from"./requests-BsVD4CdD.js";import{a as uD,c as dD,d as fD,f as Cw,i as pD,l as hD,n as mD,o as Th,r as gD,s as Rh,t as yD,u as vD}from"./dist-Gqv0jSNr.js";import{t as Tt}from"./createLucideIcon-CnW3RofX.js";import{t as bD}from"./check-DdfN0k2d.js";import{a as wD,c as _D,i as Dh,m as xD,n as kD,o as Ew,r as SD,s as CD,t as ED}from"./select-V5IdpNiR.js";import{t as TD,u as RD}from"./toDate-CgbKQM5E.js";import{t as DD}from"./database-zap-B9y7063w.js";import{n as OD,t as Au}from"./DeferredRequestRegistry-CO2AyNfd.js";import{t as mr}from"./badge-Ce8wRjuQ.js";import{t as ce}from"./preload-helper-DItdS47A.js";import{a as Tw,s as PD}from"./dist-Cayq-K1c.js";import{a as MD,i as Oh,n as LD,r as Rw,t as ND}from"./dist-BYyu59D8.js";import{n as ID}from"./stex-CtmkcLz7.js";import{t as Ll}from"./use-toast-rmUWldD_.js";import{n as AD}from"./useTheme-DUdVAZI8.js";import{E as qD,S as jD,_ as Ph,w as Dw,x as zD}from"./Combination-CMPwuAmi.js";import{l as FD}from"./dist-uzvC4uAK.js";import{i as BD,t as Mh}from"./tooltip-CEc2ajau.js";let Ow,Lh,qu,ju,Pw,zu,Nl,Mw,Lw,Nh,Da,Nw,Iw,Ih,Aw,gr,qw,jw,bo,zw,Fw,Fu,Bw,Hw,Pr,wo,Oa,Ah,qh,Cs,Bu,Vw,jh,Hu,$w,zh,Mr,Fh,Ww,Bh,Hh,Vh,Es,Il,Uw,$h,Ts,Kw,Qw,Wh,Uh,Kh,Gw,Al,ql,fi,Jw,Qh,Vu,$u,Xw,Pa,Wu,Gh,Yw,Jh,jl,Uu,Xh,Yh,zl,Zh,Zw,em,tm,Fl,e_,Ku,nm,Bl,t_,n_,Qu,r_,i_,rm,im,a_,o_,_o,Hl,am,om,Gu,s_,l_,c_,sm,u_,d_,lm,cm,Wn,f_,um,dm,Vl,fm,p_,$l,Pt,h_,Ju,er,Xu,m_,xo,g_,Ma,pm,hm,y_,Yu,mm,v_,Lr,b_,w_,Wl,__,gm,x_,k_,ym,Zu,ed,S_,C_,Ul,vm,E_,T_,ko,td,R_,nd,Kl,$i,D_,rd,O_,id,P_,Xr,M_,L_,Ql,ad,N_,I_,bm,wm,A_,q_,j_,z_,F_,od,_m,B_,H_,xm,sd,km,V_,ld,Sm,$_,Rs,Cm,W_,U_,K_,Em,Q_,G_,Tm,cd,Rm,J_,Wi,X_,La,Y_,So,Dm,Z_,yr,ud,dd,ex,tx,nx,fd,rx,ix,Om,Pm,ax,ox,pd,sx,lx,Ui,cx,ux,Gl,Mm,hd,dx,fx,px,Lm,bt,hx,Nm,mx,Im,Am,qm,Jl,HD=(async()=>{var zr,_f,$a;let Ki,Yr,Na,Fm;Ki=Ee((e=>{function n(re,se){var Q=re.length;re.push(se);e:for(;0<Q;){var Le=Q-1>>>1,Fe=re[Le];if(0<s(Fe,se))re[Le]=se,re[Q]=Fe,Q=Le;else break e}}function i(re){return re.length===0?null:re[0]}function o(re){if(re.length===0)return null;var se=re[0],Q=re.pop();if(Q!==se){re[0]=Q;e:for(var Le=0,Fe=re.length,et=Fe>>>1;Le<et;){var Be=2*(Le+1)-1,je=re[Be],Pe=Be+1,Ae=re[Pe];if(0>s(je,Q))Pe<Fe&&0>s(Ae,je)?(re[Le]=Ae,re[Pe]=Q,Le=Pe):(re[Le]=je,re[Be]=Q,Le=Be);else if(Pe<Fe&&0>s(Ae,Q))re[Le]=Ae,re[Pe]=Q,Le=Pe;else break e}}return se}function s(re,se){var Q=re.sortIndex-se.sortIndex;return Q===0?re.id-se.id:Q}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 d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var p=[],y=[],w=1,_=null,C=3,E=!1,T=!1,I=!1,$=!1,V=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function K(re){for(var se=i(y);se!==null;){if(se.callback===null)o(y);else if(se.startTime<=re)o(y),se.sortIndex=se.expirationTime,n(p,se);else break;se=i(y)}}function pe(re){if(I=!1,K(re),!T)if(i(p)!==null)T=!0,P||(P=!0,J());else{var se=i(y);se!==null&&Z(pe,se.startTime-re)}}var P=!1,A=-1,W=5,de=-1;function fe(){return $?!0:!(e.unstable_now()-de<W)}function we(){if($=!1,P){var re=e.unstable_now();de=re;var se=!0;try{e:{T=!1,I&&(I=!1,F(A),A=-1),E=!0;var Q=C;try{t:{for(K(re),_=i(p);_!==null&&!(_.expirationTime>re&&fe());){var Le=_.callback;if(typeof Le=="function"){_.callback=null,C=_.priorityLevel;var Fe=Le(_.expirationTime<=re);if(re=e.unstable_now(),typeof Fe=="function"){_.callback=Fe,K(re),se=!0;break t}_===i(p)&&o(p),K(re)}else o(p);_=i(p)}if(_!==null)se=!0;else{var et=i(y);et!==null&&Z(pe,et.startTime-re),se=!1}}break e}finally{_=null,C=Q,E=!1}se=void 0}}finally{se?J():P=!1}}}var J;if(typeof N=="function")J=function(){N(we)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,Ce=be.port2;be.port1.onmessage=we,J=function(){Ce.postMessage(null)}}else J=function(){V(we,0)};function Z(re,se){A=V(function(){re(e.unstable_now())},se)}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(re){re.callback=null},e.unstable_forceFrameRate=function(re){0>re||125<re?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<re?Math.floor(1e3/re):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(re){switch(C){case 1:case 2:case 3:var se=3;break;default:se=C}var Q=C;C=se;try{return re()}finally{C=Q}},e.unstable_requestPaint=function(){$=!0},e.unstable_runWithPriority=function(re,se){switch(re){case 1:case 2:case 3:case 4:case 5:break;default:re=3}var Q=C;C=re;try{return se()}finally{C=Q}},e.unstable_scheduleCallback=function(re,se,Q){var Le=e.unstable_now();switch(typeof Q=="object"&&Q?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?Le+Q:Le):Q=Le,re){case 1:var Fe=-1;break;case 2:Fe=250;break;case 5:Fe=1073741823;break;case 4:Fe=1e4;break;default:Fe=5e3}return Fe=Q+Fe,re={id:w++,callback:se,priorityLevel:re,startTime:Q,expirationTime:Fe,sortIndex:-1},Q>Le?(re.sortIndex=Q,n(y,re),i(p)===null&&re===i(y)&&(I?(F(A),A=-1):I=!0,Z(pe,Q-Le))):(re.sortIndex=Fe,n(p,re),T||E||(T=!0,P||(P=!0,J()))),re},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(re){var se=C;return function(){var Q=C;C=se;try{return re.apply(this,arguments)}finally{C=Q}}}})),Yr=Ee(((e,n)=>{n.exports=Ki()})),Na=Ee((e=>{var n=Yr(),i=Ou(),o=n4();function s(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}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 d(t){var r=t,a=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,r.flags&4098&&(a=r.return),t=r.return;while(t)}return r.tag===3?a:null}function f(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 p(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 y(t){if(d(t)!==t)throw Error(s(188))}function w(t){var r=t.alternate;if(!r){if(r=d(t),r===null)throw Error(s(188));return r===t?t:null}for(var a=t,l=r;;){var h=a.return;if(h===null)break;var g=h.alternate;if(g===null){if(l=h.return,l!==null){a=l;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===a)return y(h),t;if(g===l)return y(h),r;g=g.sibling}throw Error(s(188))}if(a.return!==l.return)a=h,l=g;else{for(var S=!1,D=h.child;D;){if(D===a){S=!0,a=h,l=g;break}if(D===l){S=!0,l=h,a=g;break}D=D.sibling}if(!S){for(D=g.child;D;){if(D===a){S=!0,a=g,l=h;break}if(D===l){S=!0,l=g,a=h;break}D=D.sibling}if(!S)throw Error(s(189))}}if(a.alternate!==l)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?t:r}function _(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=_(t),r!==null)return r;t=t.sibling}return null}var C=Object.assign,E=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),K=Symbol.for("react.context"),pe=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),de=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),we=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function be(t){return typeof t!="object"||!t?null:(t=J&&t[J]||t["@@iterator"],typeof t=="function"?t:null)}var Ce=Symbol.for("react.client.reference");function Z(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ce?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case $:return"Fragment";case F:return"Profiler";case V:return"StrictMode";case P:return"Suspense";case A:return"SuspenseList";case fe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case I:return"Portal";case K:return t.displayName||"Context";case N:return(t._context.displayName||"Context")+".Consumer";case pe:var r=t.render;return t=t.displayName,t||(t=(t=r.displayName||r.name||"",t===""?"ForwardRef":"ForwardRef("+t+")")),t;case W:return r=t.displayName||null,r===null?Z(t.type)||"Memo":r;case de:r=t._payload,t=t._init;try{return Z(t(r))}catch{}}return null}var re=Array.isArray,se=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Le={pending:!1,data:null,method:null,action:null},Fe=[],et=-1;function Be(t){return{current:t}}function je(t){0>et||(t.current=Fe[et],Fe[et]=null,et--)}function Pe(t,r){et++,Fe[et]=t.current,t.current=r}var Ae=Be(null),ft=Be(null),mt=Be(null),Dn=Be(null);function un(t,r){switch(Pe(mt,r),Pe(ft,t),Pe(Ae,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?x2(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=x2(r),t=k2(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}je(Ae),Pe(Ae,t)}function We(){je(Ae),je(ft),je(mt)}function tn(t){t.memoizedState!==null&&Pe(Dn,t);var r=Ae.current,a=k2(r,t.type);r!==a&&(Pe(ft,t),Pe(Ae,a))}function wt(t){ft.current===t&&(je(Ae),je(ft)),Dn.current===t&&(je(Dn),Cl._currentValue=Le)}var vn,vr;function pt(t){if(vn===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);vn=r&&r[1]||"",vr=-1<a.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+vn+t+vr}var Fr=!1;function nn(t,r){if(!t||Fr)return"";Fr=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(ue){var ae=ue}Reflect.construct(t,[],ge)}else{try{ge.call()}catch(ue){ae=ue}t.call(ge.prototype)}}else{try{throw Error()}catch(ue){ae=ue}(ge=t())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(ue){if(ue&&ae&&typeof ue.stack=="string")return[ue.stack,ae.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=l.DetermineComponentFrameRoot(),S=g[0],D=g[1];if(S&&D){var H=S.split(`
5
5
  `),ne=D.split(`
6
6
  `);for(h=l=0;l<H.length&&!H[l].includes("DetermineComponentFrameRoot");)l++;for(;h<ne.length&&!ne[h].includes("DetermineComponentFrameRoot");)h++;if(l===H.length||h===ne.length)for(l=H.length-1,h=ne.length-1;1<=l&&0<=h&&H[l]!==ne[h];)h--;for(;1<=l&&0<=h;l--,h--)if(H[l]!==ne[h]){if(l!==1||h!==1)do if(l--,h--,0>h||H[l]!==ne[h]){var he=`
7
7
  `+H[l].replace(" at new "," at ");return t.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",t.displayName)),he}while(1<=l&&0<=h);break}}}finally{Fr=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?pt(a):""}function mi(t,r){switch(t.tag){case 26:case 27:case 5:return pt(t.type);case 16:return pt("Lazy");case 13:return t.child!==r&&r!==null?pt("Suspense Fallback"):pt("Suspense");case 19:return pt("SuspenseList");case 0:case 15:return nn(t.type,!1);case 11:return nn(t.type.render,!1);case 1:return nn(t.type,!0);case 31:return pt("Activity");default:return""}}function On(t){try{var r="",a=null;do r+=mi(t,a),a=t,t=t.return;while(t);return r}catch(l){return`
8
8
  Error generating stack: `+l.message+`
9
- `+l.stack}}var br=Object.prototype.hasOwnProperty,Pn=n.unstable_scheduleCallback,dn=n.unstable_cancelCallback,ta=n.unstable_shouldYield,gi=n.unstable_requestPaint,Ut=n.unstable_now,yi=n.unstable_getCurrentPriorityLevel,fn=n.unstable_ImmediatePriority,ni=n.unstable_UserBlockingPriority,zt=n.unstable_NormalPriority,Br=n.unstable_LowPriority,_t=n.unstable_IdlePriority,vi=n.log,na=n.unstable_setDisableYieldValue,wr=null,Jt=null;function Ge(t){if(typeof vi=="function"&&na(t),Jt&&typeof Jt.setStrictMode=="function")try{Jt.setStrictMode(wr,t)}catch{}}var gt=Math.clz32?Math.clz32:jn,xt=Math.log,kt=Math.LN2;function jn(t){return t>>>=0,t===0?32:31-(xt(t)/kt|0)|0}var _r=256,St=262144,ir=4194304;function Mn(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 Hr(t,r,a){var l=t.pendingLanes;if(l===0)return 0;var h=0,g=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var D=l&134217727;return D===0?(D=l&~g,D===0?S===0?a||(a=l&~t,a!==0&&(h=Mn(a))):h=Mn(S):h=Mn(D)):(l=D&~g,l===0?(S&=D,S===0?a||(a=D&~t,a!==0&&(h=Mn(a))):h=Mn(S)):h=Mn(l)),h===0?0:r!==0&&r!==h&&(r&g)===0&&(g=h&-h,a=r&-r,g>=a||g===32&&a&4194048)?r:h}function bn(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function ar(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 bi(){var t=ir;return ir<<=1,!(ir&62914560)&&(ir=4194304),t}function ri(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function Ln(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function wi(t,r,a,l,h,g){var S=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var D=t.entanglements,H=t.expirationTimes,ne=t.hiddenUpdates;for(a=S&~a;0<a;){var he=31-gt(a),ge=1<<he;D[he]=0,H[he]=-1;var ae=ne[he];if(ae!==null)for(ne[he]=null,he=0;he<ae.length;he++){var ue=ae[he];ue!==null&&(ue.lane&=-536870913)}a&=~ge}l!==0&&zn(t,l,0),g!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=g&~(S&~r))}function zn(t,r,a){t.pendingLanes|=r,t.suspendedLanes&=~r;var l=31-gt(r);t.entangledLanes|=r,t.entanglements[l]=t.entanglements[l]|1073741824|a&261930}function or(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var l=31-gt(a),h=1<<l;h&r|t[l]&r&&(t[l]|=r),a&=~h}}function M(t,r){var a=r&-r;return a=a&42?1:Ye(a),(a&(t.suspendedLanes|r))===0?a:0}function Ye(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 j(t){return t&=-t,2<t?8<t?t&134217727?32:268435456:8:2}function te(){var t=Q.p;return t===0?(t=window.event,t===void 0?32:$2(t.type)):t}function ve(t,r){var a=Q.p;try{return Q.p=t,r()}finally{Q.p=a}}var Te=Math.random().toString(36).slice(2),He="__reactFiber$"+Te,Ve="__reactProps$"+Te,ot="__reactContainer$"+Te,Mt="__reactEvents$"+Te,Ze="__reactListeners$"+Te,Lt="__reactHandles$"+Te,rt="__reactResources$"+Te,ut="__reactMarker$"+Te;function wn(t){delete t[He],delete t[Ve],delete t[Mt],delete t[Ze],delete t[Lt]}function sr(t){var r=t[He];if(r)return r;for(var a=t.parentNode;a;){if(r=a[ot]||a[He]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=O2(t);t!==null;){if(a=t[He])return a;t=O2(t)}return r}t=a,a=t.parentNode}return null}function ii(t){if(t=t[He]||t[ot]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Fn(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function ra(t){var r=t[rt];return r||(r=t[rt]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Xt(t){t[ut]=!0}var Fs=new Set,gc={};function ai(t,r){ia(t,r),ia(t+"Capture",r)}function ia(t,r){for(gc[t]=r,t=0;t<r.length;t++)Fs.add(r[t])}var xf=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]*$"),Kn={},yc={};function kf(t){return br.call(yc,t)?!0:br.call(Kn,t)?!1:xf.test(t)?yc[t]=!0:(Kn[t]=!0,!1)}function Wa(t,r,a){if(kf(r))if(a===null)t.removeAttribute(r);else{switch(typeof a){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,""+a)}}function Ua(t,r,a){if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+a)}}function Vr(t,r,a,l){if(l===null)t.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(r,a,""+l)}}function Bn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function vc(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function bc(t,r,a){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&l!==void 0&&typeof l.get=="function"&&typeof l.set=="function"){var h=l.get,g=l.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return h.call(this)},set:function(S){a=""+S,g.call(this,S)}}),Object.defineProperty(t,r,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(S){a=""+S},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Bs(t){if(!t._valueTracker){var r=vc(t)?"checked":"value";t._valueTracker=bc(t,r,""+t[r])}}function Hs(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),l="";return t&&(l=vc(t)?t.checked?"true":"false":t.value),t=l,t===a?!1:(r.setValue(t),!0)}function Nn(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 ct=/[\n"\\]/g;function lr(t){return t.replace(ct,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function aa(t,r,a,l,h,g,S,D){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),r==null?S!=="submit"&&S!=="reset"||t.removeAttribute("value"):S==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Bn(r)):t.value!==""+Bn(r)&&(t.value=""+Bn(r)),r==null?a==null?l!=null&&t.removeAttribute("value"):_i(t,S,Bn(a)):_i(t,S,Bn(r)),h==null&&g!=null&&(t.defaultChecked=!!g),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?t.name=""+Bn(D):t.removeAttribute("name")}function wc(t,r,a,l,h,g,S,D){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.type=g),r!=null||a!=null){if(!(g!=="submit"&&g!=="reset"||r!=null)){Bs(t);return}a=a==null?"":""+Bn(a),r=r==null?a:""+Bn(r),D||r===t.value||(t.value=r),t.defaultValue=r}l??(l=h),l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=D?t.checked:!!l,t.defaultChecked=!!l,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S),Bs(t)}function _i(t,r,a){r==="number"&&Nn(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function oa(t,r,a,l){if(t=t.options,r){r={};for(var h=0;h<a.length;h++)r["$"+a[h]]=!0;for(a=0;a<t.length;a++)h=r.hasOwnProperty("$"+t[a].value),t[a].selected!==h&&(t[a].selected=h),h&&l&&(t[a].defaultSelected=!0)}else{for(a=""+Bn(a),r=null,h=0;h<t.length;h++){if(t[h].value===a){t[h].selected=!0,l&&(t[h].defaultSelected=!0);return}r!==null||t[h].disabled||(r=t[h])}r!==null&&(r.selected=!0)}}function sa(t,r,a){if(r!=null&&(r=""+Bn(r),r!==t.value&&(t.value=r),a==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=a==null?"":""+Bn(a)}function Bo(t,r,a,l){if(r==null){if(l!=null){if(a!=null)throw Error(s(92));if(re(l)){if(1<l.length)throw Error(s(93));l=l[0]}a=l}a??(a=""),r=a}a=Bn(r),t.defaultValue=a,l=t.textContent,l===a&&l!==""&&l!==null&&(t.value=l),Bs(t)}function xi(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var Sf=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 ki(t,r,a){var l=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":l?t.setProperty(r,a):typeof a!="number"||a===0||Sf.has(r)?r==="float"?t.cssFloat=a:t[r]=(""+a).trim():t[r]=a+"px"}function _c(t,r,a){if(r!=null&&typeof r!="object")throw Error(s(62));if(t=t.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var h in r)l=r[h],r.hasOwnProperty(h)&&a[h]!==l&&ki(t,h,l)}else for(var g in r)r.hasOwnProperty(g)&&ki(t,g,r[g])}function Ka(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 Ho=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"]]),xc=/^[\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 Vo(t){return xc.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function xr(){}var _n=null;function Vs(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Hn=null,oi=null;function kc(t){var r=ii(t);if(r&&(t=r.stateNode)){var a=t[Ve]||null;e:switch(t=r.stateNode,r.type){case"input":if(aa(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+lr(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var l=a[r];if(l!==t&&l.form===t.form){var h=l[Ve]||null;if(!h)throw Error(s(90));aa(l,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(r=0;r<a.length;r++)l=a[r],l.form===t.form&&Hs(l)}break e;case"textarea":sa(t,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&oa(t,!!a.multiple,r,!1)}}}var $s=!1;function Sc(t,r,a){if($s)return t(r,a);$s=!0;try{return t(r)}finally{if($s=!1,(Hn!==null||oi!==null)&&(lu(),Hn&&(r=Hn,t=oi,oi=Hn=null,kc(r),t)))for(r=0;r<t.length;r++)kc(t[r])}}function Qa(t,r){var a=t.stateNode;if(a===null)return null;var l=a[Ve]||null;if(l===null)return null;a=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(a&&typeof a!="function")throw Error(s(231,r,typeof a));return a}var $r=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0),Ws=!1;if($r)try{var Ga={};Object.defineProperty(Ga,"passive",{get:function(){Ws=!0}}),window.addEventListener("test",Ga,Ga),window.removeEventListener("test",Ga,Ga)}catch{Ws=!1}var Wr=null,$o=null,Ja=null;function Us(){if(Ja)return Ja;var t,r=$o,a=r.length,l,h="value"in Wr?Wr.value:Wr.textContent,g=h.length;for(t=0;t<a&&r[t]===h[t];t++);var S=a-t;for(l=1;l<=S&&r[a-l]===h[g-l];l++);return Ja=h.slice(t,1<l?1-l:void 0)}function Xa(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 Ya(){return!0}function Ks(){return!1}function xn(t){function r(a,l,h,g,S){for(var D in this._reactName=a,this._targetInst=h,this.type=l,this.nativeEvent=g,this.target=S,this.currentTarget=null,t)t.hasOwnProperty(D)&&(a=t[D],this[D]=a?a(g):g[D]);return this.isDefaultPrevented=(g.defaultPrevented==null?g.returnValue===!1:g.defaultPrevented)?Ya:Ks,this.isPropagationStopped=Ks,this}return C(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Ya)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ya)},persist:function(){},isPersistent:Ya}),r}var Si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},u=xn(Si),m=C({},Si,{view:0,detail:0}),v=xn(m),b,x,k,R=C({},m,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qe,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!==k&&(k&&t.type==="mousemove"?(b=t.screenX-k.screenX,x=t.screenY-k.screenY):x=b=0,k=t),b)},movementY:function(t){return"movementY"in t?t.movementY:x}}),O=xn(R),L=xn(C({},R,{dataTransfer:0})),z=xn(C({},m,{relatedTarget:0})),q=xn(C({},Si,{animationName:0,elapsedTime:0,pseudoElement:0})),oe=xn(C({},Si,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}})),ie=xn(C({},Si,{data:0})),X={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Y={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"},xe={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _e(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=xe[t])?!!r[t]:!1}function qe(){return _e}var Re=xn(C({},m,{key:function(t){if(t.key){var r=X[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Xa(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Y[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qe,charCode:function(t){return t.type==="keypress"?Xa(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Xa(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}})),Ne=xn(C({},R,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),dt=xn(C({},m,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qe})),Je=xn(C({},Si,{propertyName:0,elapsedTime:0,pseudoElement:0})),Nt=xn(C({},R,{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})),Ft=xn(C({},Si,{newState:0,oldState:0})),Ue=[9,13,27,32],$e=$r&&"CompositionEvent"in window,$t=null;$r&&"documentMode"in document&&($t=document.documentMode);var rn=$r&&"TextEvent"in window&&!$t,pn=$r&&(!$e||$t&&8<$t&&11>=$t),Za=" ",Cc=!1;function Ec(t,r){switch(t){case"keyup":return Ue.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wo(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Uo=!1;function gT(t,r){switch(t){case"compositionend":return Wo(r);case"keypress":return r.which===32?(Cc=!0,Za):null;case"textInput":return t=r.data,t===Za&&Cc?null:t;default:return null}}function yT(t,r){if(Uo)return t==="compositionend"||!$e&&Ec(t,r)?(t=Us(),Ja=$o=Wr=null,Uo=!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 pn&&r.locale!=="ko"?null:r.data;default:return null}}var vT={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 Iv(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!vT[t.type]:r==="textarea"}function Av(t,r,a,l){Hn?oi?oi.push(l):oi=[l]:Hn=l,r=mu(r,"onChange"),0<r.length&&(a=new u("onChange","change",null,a,l),t.push({event:a,listeners:r}))}var Qs=null,Gs=null;function bT(t){m2(t,0)}function Tc(t){if(Hs(Fn(t)))return t}function qv(t,r){if(t==="change")return r}var jv=!1;if($r){var Cf;if($r){var Ef="oninput"in document;if(!Ef){var zv=document.createElement("div");zv.setAttribute("oninput","return;"),Ef=typeof zv.oninput=="function"}Cf=Ef}else Cf=!1;jv=Cf&&(!document.documentMode||9<document.documentMode)}function Fv(){Qs&&(Qs.detachEvent("onpropertychange",Bv),Gs=Qs=null)}function Bv(t){if(t.propertyName==="value"&&Tc(Gs)){var r=[];Av(r,Gs,t,Vs(t)),Sc(bT,r)}}function wT(t,r,a){t==="focusin"?(Fv(),Qs=r,Gs=a,Qs.attachEvent("onpropertychange",Bv)):t==="focusout"&&Fv()}function _T(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Tc(Gs)}function xT(t,r){if(t==="click")return Tc(r)}function kT(t,r){if(t==="input"||t==="change")return Tc(r)}function ST(t,r){return t===r&&(t!==0||1/t==1/r)||t!==t&&r!==r}var cr=typeof Object.is=="function"?Object.is:ST;function Js(t,r){if(cr(t,r))return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var a=Object.keys(t),l=Object.keys(r);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var h=a[l];if(!br.call(r,h)||!cr(t[h],r[h]))return!1}return!0}function Hv(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Vv(t,r){var a=Hv(t);t=0;for(var l;a;){if(a.nodeType===3){if(l=t+a.textContent.length,t<=r&&l>=r)return{node:a,offset:r-t};t=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Hv(a)}}function $v(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?$v(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Wv(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Nn(t.document);r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=Nn(t.document)}return r}function Tf(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 CT=$r&&"documentMode"in document&&11>=document.documentMode,Ko=null,Rf=null,Xs=null,Df=!1;function Uv(t,r,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Df||Ko==null||Ko!==Nn(l)||(l=Ko,"selectionStart"in l&&Tf(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}),Xs&&Js(Xs,l)||(Xs=l,l=mu(Rf,"onSelect"),0<l.length&&(r=new u("onSelect","select",null,r,a),t.push({event:r,listeners:l}),r.target=Ko)))}function eo(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var Qo={animationend:eo("Animation","AnimationEnd"),animationiteration:eo("Animation","AnimationIteration"),animationstart:eo("Animation","AnimationStart"),transitionrun:eo("Transition","TransitionRun"),transitionstart:eo("Transition","TransitionStart"),transitioncancel:eo("Transition","TransitionCancel"),transitionend:eo("Transition","TransitionEnd")},Of={},Kv={};$r&&(Kv=document.createElement("div").style,"AnimationEvent"in window||(delete Qo.animationend.animation,delete Qo.animationiteration.animation,delete Qo.animationstart.animation),"TransitionEvent"in window||delete Qo.transitionend.transition);function to(t){if(Of[t])return Of[t];if(!Qo[t])return t;var r=Qo[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in Kv)return Of[t]=r[a];return t}var Qv=to("animationend"),Gv=to("animationiteration"),Jv=to("animationstart"),ET=to("transitionrun"),TT=to("transitionstart"),RT=to("transitioncancel"),Xv=to("transitionend"),Yv=new Map,Pf="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(" ");Pf.push("scrollEnd");function Ur(t,r){Yv.set(t,r),ai(r,[t])}var Rc=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)},kr=[],Go=0,Mf=0;function Dc(){for(var t=Go,r=Mf=Go=0;r<t;){var a=kr[r];kr[r++]=null;var l=kr[r];kr[r++]=null;var h=kr[r];kr[r++]=null;var g=kr[r];if(kr[r++]=null,l!==null&&h!==null){var S=l.pending;S===null?h.next=h:(h.next=S.next,S.next=h),l.pending=h}g!==0&&Zv(a,h,g)}}function Oc(t,r,a,l){kr[Go++]=t,kr[Go++]=r,kr[Go++]=a,kr[Go++]=l,Mf|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Lf(t,r,a,l){return Oc(t,r,a,l),Pc(t)}function no(t,r){return Oc(t,null,null,r),Pc(t)}function Zv(t,r,a){t.lanes|=a;var l=t.alternate;l!==null&&(l.lanes|=a);for(var h=!1,g=t.return;g!==null;)g.childLanes|=a,l=g.alternate,l!==null&&(l.childLanes|=a),g.tag===22&&(t=g.stateNode,t===null||t._visibility&1||(h=!0)),t=g,g=g.return;return t.tag===3?(g=t.stateNode,h&&r!==null&&(h=31-gt(a),t=g.hiddenUpdates,l=t[h],l===null?t[h]=[r]:l.push(r),r.lane=a|536870912),g):null}function Pc(t){if(50<bl)throw bl=0,Hp=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Jo={};function DT(t,r,a,l){this.tag=t,this.key=a,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 ur(t,r,a,l){return new DT(t,r,a,l)}function Nf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ci(t,r){var a=t.alternate;return a===null?(a=ur(t.tag,r,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=r,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,r=t.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function e1(t,r){t.flags&=65011714;var a=t.alternate;return a===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=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,r=a.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function Mc(t,r,a,l,h,g){var S=0;if(l=t,typeof t=="function")Nf(t)&&(S=1);else if(typeof t=="string")S=IR(t,a,Ae.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case fe:return t=ur(31,a,r,h),t.elementType=fe,t.lanes=g,t;case $:return ro(a.children,h,g,r);case V:S=8,h|=24;break;case F:return t=ur(12,a,r,h|2),t.elementType=F,t.lanes=g,t;case P:return t=ur(13,a,r,h),t.elementType=P,t.lanes=g,t;case A:return t=ur(19,a,r,h),t.elementType=A,t.lanes=g,t;default:if(typeof t=="object"&&t)switch(t.$$typeof){case K:S=10;break e;case N:S=9;break e;case pe:S=11;break e;case W:S=14;break e;case de:S=16,l=null;break e}S=29,a=Error(s(130,t===null?"null":typeof t,"")),l=null}return r=ur(S,a,r,h),r.elementType=t,r.type=l,r.lanes=g,r}function ro(t,r,a,l){return t=ur(7,t,l,r),t.lanes=a,t}function If(t,r,a){return t=ur(6,t,null,r),t.lanes=a,t}function t1(t){var r=ur(18,null,null,0);return r.stateNode=t,r}function Af(t,r,a){return r=ur(4,t.children===null?[]:t.children,t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var n1=new WeakMap;function Sr(t,r){if(typeof t=="object"&&t){var a=n1.get(t);return a===void 0?(r={value:t,source:r,stack:On(r)},n1.set(t,r),r):a}return{value:t,source:r,stack:On(r)}}var Xo=[],Yo=0,Lc=null,Ys=0,Cr=[],Er=0,la=null,si=1,li="";function Ei(t,r){Xo[Yo++]=Ys,Xo[Yo++]=Lc,Lc=t,Ys=r}function r1(t,r,a){Cr[Er++]=si,Cr[Er++]=li,Cr[Er++]=la,la=t;var l=si;t=li;var h=32-gt(l)-1;l&=~(1<<h),a+=1;var g=32-gt(r)+h;if(30<g){var S=h-h%5;g=(l&(1<<S)-1).toString(32),l>>=S,h-=S,si=1<<32-gt(r)+h|a<<h|l,li=g+t}else si=1<<g|a<<h|l,li=t}function qf(t){t.return!==null&&(Ei(t,1),r1(t,1,0))}function jf(t){for(;t===Lc;)Lc=Xo[--Yo],Xo[Yo]=null,Ys=Xo[--Yo],Xo[Yo]=null;for(;t===la;)la=Cr[--Er],Cr[Er]=null,li=Cr[--Er],Cr[Er]=null,si=Cr[--Er],Cr[Er]=null}function i1(t,r){Cr[Er++]=si,Cr[Er++]=li,Cr[Er++]=la,si=r.id,li=r.overflow,la=t}var Sn=null,Bt=null,st=!1,ca=null,Tr=!1,zf=Error(s(519));function ua(t){throw Zs(Sr(Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML","")),t)),zf}function a1(t){var r=t.stateNode,a=t.type,l=t.memoizedProps;switch(r[He]=t,r[Ve]=l,a){case"dialog":nt("cancel",r),nt("close",r);break;case"iframe":case"object":case"embed":nt("load",r);break;case"video":case"audio":for(a=0;a<_l.length;a++)nt(_l[a],r);break;case"source":nt("error",r);break;case"img":case"image":case"link":nt("error",r),nt("load",r);break;case"details":nt("toggle",r);break;case"input":nt("invalid",r),wc(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":nt("invalid",r);break;case"textarea":nt("invalid",r),Bo(r,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||l.suppressHydrationWarning===!0||w2(r.textContent,a)?(l.popover!=null&&(nt("beforetoggle",r),nt("toggle",r)),l.onScroll!=null&&nt("scroll",r),l.onScrollEnd!=null&&nt("scrollend",r),l.onClick!=null&&(r.onclick=xr),r=!0):r=!1,r||ua(t,!0)}function o1(t){for(Sn=t.return;Sn;)switch(Sn.tag){case 5:case 31:case 13:Tr=!1;return;case 27:case 3:Tr=!0;return;default:Sn=Sn.return}}function Zo(t){if(t!==Sn)return!1;if(!st)return o1(t),st=!0,!1;var r=t.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||nh(t.type,t.memoizedProps)),a=!a),a&&Bt&&ua(t),o1(t),r===13){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));Bt=D2(t)}else if(r===31){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));Bt=D2(t)}else r===27?(r=Bt,xa(t.type)?(t=sh,sh=null,Bt=t):Bt=r):Bt=Sn?Dr(t.stateNode.nextSibling):null;return!0}function io(){Bt=Sn=null,st=!1}function Ff(){var t=ca;return t!==null&&(Xn===null?Xn=t:Xn.push.apply(Xn,t),ca=null),t}function Zs(t){ca===null?ca=[t]:ca.push(t)}var Bf=Be(null),ao=null,Ti=null;function da(t,r,a){Pe(Bf,r._currentValue),r._currentValue=a}function Ri(t){t._currentValue=Bf.current,je(Bf)}function Hf(t,r,a){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===a)break;t=t.return}}function Vf(t,r,a,l){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var g=h.dependencies;if(g!==null){var S=h.child;g=g.firstContext;e:for(;g!==null;){var D=g;g=h;for(var H=0;H<r.length;H++)if(D.context===r[H]){g.lanes|=a,D=g.alternate,D!==null&&(D.lanes|=a),Hf(g.return,a,t),l||(S=null);break e}g=D.next}}else if(h.tag===18){if(S=h.return,S===null)throw Error(s(341));S.lanes|=a,g=S.alternate,g!==null&&(g.lanes|=a),Hf(S,a,t),S=null}else S=h.child;if(S!==null)S.return=h;else for(S=h;S!==null;){if(S===t){S=null;break}if(h=S.sibling,h!==null){h.return=S.return,S=h;break}S=S.return}h=S}}function es(t,r,a,l){t=null;for(var h=r,g=!1;h!==null;){if(!g){if(h.flags&524288)g=!0;else if(h.flags&262144)break}if(h.tag===10){var S=h.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var D=h.type;cr(h.pendingProps.value,S.value)||(t===null?t=[D]:t.push(D))}}else if(h===Dn.current){if(S=h.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t===null?t=[El]:t.push(El))}h=h.return}t!==null&&Vf(r,t,a,l),r.flags|=262144}function Nc(t){for(t=t.firstContext;t!==null;){if(!cr(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function oo(t){ao=t,Ti=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Cn(t){return s1(ao,t)}function Ic(t,r){return ao===null&&oo(t),s1(t,r)}function s1(t,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},Ti===null){if(t===null)throw Error(s(308));Ti=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else Ti=Ti.next=r;return a}var OT=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(a,l){t.push(l)}};this.abort=function(){r.aborted=!0,t.forEach(function(a){return a()})}},PT=n.unstable_scheduleCallback,MT=n.unstable_NormalPriority,an={$$typeof:K,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $f(){return{controller:new OT,data:new Map,refCount:0}}function el(t){t.refCount--,t.refCount===0&&PT(MT,function(){t.controller.abort()})}var tl=null,Wf=0,ts=0,ns=null;function LT(t,r){if(tl===null){var a=tl=[];Wf=0,ts=Qp(),ns={status:"pending",value:void 0,then:function(l){a.push(l)}}}return Wf++,r.then(l1,l1),r}function l1(){if(--Wf===0&&tl!==null){ns!==null&&(ns.status="fulfilled");var t=tl;tl=null,ts=0,ns=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function NT(t,r){var a=[],l={status:"pending",value:null,reason:null,then:function(h){a.push(h)}};return t.then(function(){l.status="fulfilled",l.value=r;for(var h=0;h<a.length;h++)(0,a[h])(r)},function(h){for(l.status="rejected",l.reason=h,h=0;h<a.length;h++)(0,a[h])(void 0)}),l}var c1=se.S;se.S=function(t,r){Vb=Ut(),typeof r=="object"&&r&&typeof r.then=="function"&&LT(t,r),c1!==null&&c1(t,r)};var so=Be(null);function Uf(){var t=so.current;return t===null?It.pooledCache:t}function Ac(t,r){r===null?Pe(so,so.current):Pe(so,r.pool)}function u1(){var t=Uf();return t===null?null:{parent:an._currentValue,pool:t}}var rs=Error(s(460)),Kf=Error(s(474)),qc=Error(s(542)),jc={then:function(){}};function d1(t){return t=t.status,t==="fulfilled"||t==="rejected"}function f1(t,r,a){switch(a=t[a],a===void 0?t.push(r):a!==r&&(r.then(xr,xr),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,h1(t),t;default:if(typeof r.status=="string")r.then(xr,xr);else{if(t=It,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(l){if(r.status==="pending"){var h=r;h.status="fulfilled",h.value=l}},function(l){if(r.status==="pending"){var h=r;h.status="rejected",h.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,h1(t),t}throw co=r,rs}}function lo(t){try{var r=t._init;return r(t._payload)}catch(a){throw typeof a=="object"&&a&&typeof a.then=="function"?(co=a,rs):a}}var co=null;function p1(){if(co===null)throw Error(s(459));var t=co;return co=null,t}function h1(t){if(t===rs||t===qc)throw Error(s(483))}var is=null,nl=0;function zc(t){var r=nl;return nl+=1,is===null&&(is=[]),f1(is,t,r)}function rl(t,r){r=r.props.ref,t.ref=r===void 0?null:r}function Fc(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 m1(t){function r(G,U){if(t){var ee=G.deletions;ee===null?(G.deletions=[U],G.flags|=16):ee.push(U)}}function a(G,U){if(!t)return null;for(;U!==null;)r(G,U),U=U.sibling;return null}function l(G){for(var U=new Map;G!==null;)G.key===null?U.set(G.index,G):U.set(G.key,G),G=G.sibling;return U}function h(G,U){return G=Ci(G,U),G.index=0,G.sibling=null,G}function g(G,U,ee){return G.index=ee,t?(ee=G.alternate,ee===null?(G.flags|=67108866,U):(ee=ee.index,ee<U?(G.flags|=67108866,U):ee)):(G.flags|=1048576,U)}function S(G){return t&&G.alternate===null&&(G.flags|=67108866),G}function D(G,U,ee,me){return U===null||U.tag!==6?(U=If(ee,G.mode,me),U.return=G,U):(U=h(U,ee),U.return=G,U)}function H(G,U,ee,me){var Me=ee.type;return Me===$?he(G,U,ee.props.children,me,ee.key):U!==null&&(U.elementType===Me||typeof Me=="object"&&Me&&Me.$$typeof===de&&lo(Me)===U.type)?(U=h(U,ee.props),rl(U,ee),U.return=G,U):(U=Mc(ee.type,ee.key,ee.props,null,G.mode,me),rl(U,ee),U.return=G,U)}function ne(G,U,ee,me){return U===null||U.tag!==4||U.stateNode.containerInfo!==ee.containerInfo||U.stateNode.implementation!==ee.implementation?(U=Af(ee,G.mode,me),U.return=G,U):(U=h(U,ee.children||[]),U.return=G,U)}function he(G,U,ee,me,Me){return U===null||U.tag!==7?(U=ro(ee,G.mode,me,Me),U.return=G,U):(U=h(U,ee),U.return=G,U)}function ge(G,U,ee){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=If(""+U,G.mode,ee),U.return=G,U;if(typeof U=="object"&&U){switch(U.$$typeof){case T:return ee=Mc(U.type,U.key,U.props,null,G.mode,ee),rl(ee,U),ee.return=G,ee;case I:return U=Af(U,G.mode,ee),U.return=G,U;case de:return U=lo(U),ge(G,U,ee)}if(re(U)||be(U))return U=ro(U,G.mode,ee,null),U.return=G,U;if(typeof U.then=="function")return ge(G,zc(U),ee);if(U.$$typeof===K)return ge(G,Ic(G,U),ee);Fc(G,U)}return null}function ae(G,U,ee,me){var Me=U===null?null:U.key;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Me===null?D(G,U,""+ee,me):null;if(typeof ee=="object"&&ee){switch(ee.$$typeof){case T:return ee.key===Me?H(G,U,ee,me):null;case I:return ee.key===Me?ne(G,U,ee,me):null;case de:return ee=lo(ee),ae(G,U,ee,me)}if(re(ee)||be(ee))return Me===null?he(G,U,ee,me,null):null;if(typeof ee.then=="function")return ae(G,U,zc(ee),me);if(ee.$$typeof===K)return ae(G,U,Ic(G,ee),me);Fc(G,ee)}return null}function ue(G,U,ee,me,Me){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return G=G.get(ee)||null,D(U,G,""+me,Me);if(typeof me=="object"&&me){switch(me.$$typeof){case T:return G=G.get(me.key===null?ee:me.key)||null,H(U,G,me,Me);case I:return G=G.get(me.key===null?ee:me.key)||null,ne(U,G,me,Me);case de:return me=lo(me),ue(G,U,ee,me,Me)}if(re(me)||be(me))return G=G.get(ee)||null,he(U,G,me,Me,null);if(typeof me.then=="function")return ue(G,U,ee,zc(me),Me);if(me.$$typeof===K)return ue(G,U,ee,Ic(U,me),Me);Fc(U,me)}return null}function De(G,U,ee,me){for(var Me=null,vt=null,Oe=U,Qe=U=0,at=null;Oe!==null&&Qe<ee.length;Qe++){Oe.index>Qe?(at=Oe,Oe=null):at=Oe.sibling;var ht=ae(G,Oe,ee[Qe],me);if(ht===null){Oe===null&&(Oe=at);break}t&&Oe&&ht.alternate===null&&r(G,Oe),U=g(ht,U,Qe),vt===null?Me=ht:vt.sibling=ht,vt=ht,Oe=at}if(Qe===ee.length)return a(G,Oe),st&&Ei(G,Qe),Me;if(Oe===null){for(;Qe<ee.length;Qe++)Oe=ge(G,ee[Qe],me),Oe!==null&&(U=g(Oe,U,Qe),vt===null?Me=Oe:vt.sibling=Oe,vt=Oe);return st&&Ei(G,Qe),Me}for(Oe=l(Oe);Qe<ee.length;Qe++)at=ue(Oe,G,Qe,ee[Qe],me),at!==null&&(t&&at.alternate!==null&&Oe.delete(at.key===null?Qe:at.key),U=g(at,U,Qe),vt===null?Me=at:vt.sibling=at,vt=at);return t&&Oe.forEach(function(Ta){return r(G,Ta)}),st&&Ei(G,Qe),Me}function Ie(G,U,ee,me){if(ee==null)throw Error(s(151));for(var Me=null,vt=null,Oe=U,Qe=U=0,at=null,ht=ee.next();Oe!==null&&!ht.done;Qe++,ht=ee.next()){Oe.index>Qe?(at=Oe,Oe=null):at=Oe.sibling;var Ta=ae(G,Oe,ht.value,me);if(Ta===null){Oe===null&&(Oe=at);break}t&&Oe&&Ta.alternate===null&&r(G,Oe),U=g(Ta,U,Qe),vt===null?Me=Ta:vt.sibling=Ta,vt=Ta,Oe=at}if(ht.done)return a(G,Oe),st&&Ei(G,Qe),Me;if(Oe===null){for(;!ht.done;Qe++,ht=ee.next())ht=ge(G,ht.value,me),ht!==null&&(U=g(ht,U,Qe),vt===null?Me=ht:vt.sibling=ht,vt=ht);return st&&Ei(G,Qe),Me}for(Oe=l(Oe);!ht.done;Qe++,ht=ee.next())ht=ue(Oe,G,Qe,ht.value,me),ht!==null&&(t&&ht.alternate!==null&&Oe.delete(ht.key===null?Qe:ht.key),U=g(ht,U,Qe),vt===null?Me=ht:vt.sibling=ht,vt=ht);return t&&Oe.forEach(function(GR){return r(G,GR)}),st&&Ei(G,Qe),Me}function Ot(G,U,ee,me){if(typeof ee=="object"&&ee&&ee.type===$&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee){switch(ee.$$typeof){case T:e:{for(var Me=ee.key;U!==null;){if(U.key===Me){if(Me=ee.type,Me===$){if(U.tag===7){a(G,U.sibling),me=h(U,ee.props.children),me.return=G,G=me;break e}}else if(U.elementType===Me||typeof Me=="object"&&Me&&Me.$$typeof===de&&lo(Me)===U.type){a(G,U.sibling),me=h(U,ee.props),rl(me,ee),me.return=G,G=me;break e}a(G,U);break}else r(G,U);U=U.sibling}ee.type===$?(me=ro(ee.props.children,G.mode,me,ee.key),me.return=G,G=me):(me=Mc(ee.type,ee.key,ee.props,null,G.mode,me),rl(me,ee),me.return=G,G=me)}return S(G);case I:e:{for(Me=ee.key;U!==null;){if(U.key===Me)if(U.tag===4&&U.stateNode.containerInfo===ee.containerInfo&&U.stateNode.implementation===ee.implementation){a(G,U.sibling),me=h(U,ee.children||[]),me.return=G,G=me;break e}else{a(G,U);break}else r(G,U);U=U.sibling}me=Af(ee,G.mode,me),me.return=G,G=me}return S(G);case de:return ee=lo(ee),Ot(G,U,ee,me)}if(re(ee))return De(G,U,ee,me);if(be(ee)){if(Me=be(ee),typeof Me!="function")throw Error(s(150));return ee=Me.call(ee),Ie(G,U,ee,me)}if(typeof ee.then=="function")return Ot(G,U,zc(ee),me);if(ee.$$typeof===K)return Ot(G,U,Ic(G,ee),me);Fc(G,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,U!==null&&U.tag===6?(a(G,U.sibling),me=h(U,ee),me.return=G,G=me):(a(G,U),me=If(ee,G.mode,me),me.return=G,G=me),S(G)):a(G,U)}return function(G,U,ee,me){try{nl=0;var Me=Ot(G,U,ee,me);return is=null,Me}catch(Oe){if(Oe===rs||Oe===qc)throw Oe;var vt=ur(29,Oe,null,G.mode);return vt.lanes=me,vt.return=G,vt}}}var uo=m1(!0),g1=m1(!1),fa=!1;function Qf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gf(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 fo(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function po(t,r,a){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,yt&2){var h=l.pending;return h===null?r.next=r:(r.next=h.next,h.next=r),l.pending=r,r=Pc(t),Zv(t,null,a),r}return Oc(t,l,r,a),Pc(t)}function il(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,a&4194048)){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,or(t,a)}}function Jf(t,r){var a=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var h=null,g=null;if(a=a.firstBaseUpdate,a!==null){do{var S={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};g===null?h=g=S:g=g.next=S,a=a.next}while(a!==null);g===null?h=g=r:g=g.next=r}else h=g=r;a={baseState:l.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:l.shared,callbacks:l.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}var Xf=!1;function al(){if(Xf){var t=ns;if(t!==null)throw t}}function ol(t,r,a,l){Xf=!1;var h=t.updateQueue;fa=!1;var g=h.firstBaseUpdate,S=h.lastBaseUpdate,D=h.shared.pending;if(D!==null){h.shared.pending=null;var H=D,ne=H.next;H.next=null,S===null?g=ne:S.next=ne,S=H;var he=t.alternate;he!==null&&(he=he.updateQueue,D=he.lastBaseUpdate,D!==S&&(D===null?he.firstBaseUpdate=ne:D.next=ne,he.lastBaseUpdate=H))}if(g!==null){var ge=h.baseState;S=0,he=ne=H=null,D=g;do{var ae=D.lane&-536870913,ue=ae!==D.lane;if(ue?(it&ae)===ae:(l&ae)===ae){ae!==0&&ae===ts&&(Xf=!0),he!==null&&(he=he.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var De=t,Ie=D;ae=r;var Ot=a;switch(Ie.tag){case 1:if(De=Ie.payload,typeof De=="function"){ge=De.call(Ot,ge,ae);break e}ge=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Ie.payload,ae=typeof De=="function"?De.call(Ot,ge,ae):De,ae==null)break e;ge=C({},ge,ae);break e;case 2:fa=!0}}ae=D.callback,ae!==null&&(t.flags|=64,ue&&(t.flags|=8192),ue=h.callbacks,ue===null?h.callbacks=[ae]:ue.push(ae))}else ue={lane:ae,tag:D.tag,payload:D.payload,callback:D.callback,next:null},he===null?(ne=he=ue,H=ge):he=he.next=ue,S|=ae;if(D=D.next,D===null){if(D=h.shared.pending,D===null)break;ue=D,D=ue.next,ue.next=null,h.lastBaseUpdate=ue,h.shared.pending=null}}while(!0);he===null&&(H=ge),h.baseState=H,h.firstBaseUpdate=ne,h.lastBaseUpdate=he,g===null&&(h.shared.lanes=0),ya|=S,t.lanes=S,t.memoizedState=ge}}function y1(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function v1(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)y1(a[t],r)}var as=Be(null),Bc=Be(0);function b1(t,r){t=qi,Pe(Bc,t),Pe(as,r),qi=t|r.baseLanes}function Yf(){Pe(Bc,qi),Pe(as,as.current)}function Zf(){qi=Bc.current,je(as),je(Bc)}var dr=Be(null),Kr=null;function pa(t){var r=t.alternate;Pe(Yt,Yt.current&1),Pe(dr,t),Kr===null&&(r===null||as.current!==null||r.memoizedState!==null)&&(Kr=t)}function ep(t){Pe(Yt,Yt.current),Pe(dr,t),Kr===null&&(Kr=t)}function w1(t){t.tag===22?(Pe(Yt,Yt.current),Pe(dr,t),Kr===null&&(Kr=t)):ha(t)}function ha(){Pe(Yt,Yt.current),Pe(dr,dr.current)}function fr(t){je(dr),Kr===t&&(Kr=null),je(Yt)}var Yt=Be(0);function Hc(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||ah(a)||oh(a)))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 Di=0,Ke=null,Rt=null,on=null,Vc=!1,os=!1,ho=!1,$c=0,sl=0,ss=null,IT=0;function Qt(){throw Error(s(321))}function tp(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!cr(t[a],r[a]))return!1;return!0}function np(t,r,a,l,h,g){return Di=g,Ke=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,se.H=t===null||t.memoizedState===null?rb:yp,ho=!1,g=a(l,h),ho=!1,os&&(g=x1(r,a,l,h)),_1(t),g}function _1(t){se.H=ul;var r=Rt!==null&&Rt.next!==null;if(Di=0,on=Rt=Ke=null,Vc=!1,sl=0,ss=null,r)throw Error(s(300));t===null||sn||(t=t.dependencies,t!==null&&Nc(t)&&(sn=!0))}function x1(t,r,a,l){Ke=t;var h=0;do{if(os&&(ss=null),sl=0,os=!1,25<=h)throw Error(s(301));if(h+=1,on=Rt=null,t.updateQueue!=null){var g=t.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}se.H=ib,g=r(a,l)}while(os);return g}function AT(){var t=se.H,r=t.useState()[0];return r=typeof r.then=="function"?ll(r):r,t=t.useState()[0],(Rt===null?null:Rt.memoizedState)!==t&&(Ke.flags|=1024),r}function rp(){var t=$c!==0;return $c=0,t}function ip(t,r,a){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~a}function ap(t){if(Vc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Vc=!1}Di=0,on=Rt=Ke=null,os=!1,sl=$c=0,ss=null}function Vn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?Ke.memoizedState=on=t:on=on.next=t,on}function Zt(){if(Rt===null){var t=Ke.alternate;t=t===null?null:t.memoizedState}else t=Rt.next;var r=on===null?Ke.memoizedState:on.next;if(r!==null)on=r,Rt=t;else{if(t===null)throw Ke.alternate===null?Error(s(467)):Error(s(310));Rt=t,t={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},on===null?Ke.memoizedState=on=t:on=on.next=t}return on}function Wc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ll(t){var r=sl;return sl+=1,ss===null&&(ss=[]),t=f1(ss,t,r),r=Ke,(on===null?r.memoizedState:on.next)===null&&(r=r.alternate,se.H=r===null||r.memoizedState===null?rb:yp),t}function Uc(t){if(typeof t=="object"&&t){if(typeof t.then=="function")return ll(t);if(t.$$typeof===K)return Cn(t)}throw Error(s(438,String(t)))}function op(t){var r=null,a=Ke.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var l=Ke.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(h){return h.slice()}),index:0})))}if(r??(r={data:[],index:0}),a===null&&(a=Wc(),Ke.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(t),l=0;l<t;l++)a[l]=we;return r.index++,a}function Oi(t,r){return typeof r=="function"?r(t):r}function Kc(t){return sp(Zt(),Rt,t)}function sp(t,r,a){var l=t.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=a;var h=t.baseQueue,g=l.pending;if(g!==null){if(h!==null){var S=h.next;h.next=g.next,g.next=S}r.baseQueue=h=g,l.pending=null}if(g=t.baseState,h===null)t.memoizedState=g;else{r=h.next;var D=S=null,H=null,ne=r,he=!1;do{var ge=ne.lane&-536870913;if(ge===ne.lane?(Di&ge)===ge:(it&ge)===ge){var ae=ne.revertLane;if(ae===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),ge===ts&&(he=!0);else if((Di&ae)===ae){ne=ne.next,ae===ts&&(he=!0);continue}else ge={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},H===null?(D=H=ge,S=g):H=H.next=ge,Ke.lanes|=ae,ya|=ae;ge=ne.action,ho&&a(g,ge),g=ne.hasEagerState?ne.eagerState:a(g,ge)}else ae={lane:ge,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},H===null?(D=H=ae,S=g):H=H.next=ae,Ke.lanes|=ge,ya|=ge;ne=ne.next}while(ne!==null&&ne!==r);if(H===null?S=g:H.next=D,!cr(g,t.memoizedState)&&(sn=!0,he&&(a=ns,a!==null)))throw a;t.memoizedState=g,t.baseState=S,t.baseQueue=H,l.lastRenderedState=g}return h===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function lp(t){var r=Zt(),a=r.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=t;var l=a.dispatch,h=a.pending,g=r.memoizedState;if(h!==null){a.pending=null;var S=h=h.next;do g=t(g,S.action),S=S.next;while(S!==h);cr(g,r.memoizedState)||(sn=!0),r.memoizedState=g,r.baseQueue===null&&(r.baseState=g),a.lastRenderedState=g}return[g,l]}function k1(t,r,a){var l=Ke,h=Zt(),g=st;if(g){if(a===void 0)throw Error(s(407));a=a()}else a=r();var S=!cr((Rt||h).memoizedState,a);if(S&&(h.memoizedState=a,sn=!0),h=h.queue,dp(E1.bind(null,l,h,t),[t]),h.getSnapshot!==r||S||on!==null&&on.memoizedState.tag&1){if(l.flags|=2048,ls(9,{destroy:void 0},C1.bind(null,l,h,a,r),null),It===null)throw Error(s(349));g||Di&127||S1(l,r,a)}return a}function S1(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=Ke.updateQueue,r===null?(r=Wc(),Ke.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function C1(t,r,a,l){r.value=a,r.getSnapshot=l,T1(r)&&R1(t)}function E1(t,r,a){return a(function(){T1(r)&&R1(t)})}function T1(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!cr(t,a)}catch{return!0}}function R1(t){var r=no(t,2);r!==null&&Yn(r,t,2)}function cp(t){var r=Vn();if(typeof t=="function"){var a=t;if(t=a(),ho){Ge(!0);try{a()}finally{Ge(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:t},r}function D1(t,r,a,l){return t.baseState=a,sp(t,Rt,typeof l=="function"?l:Oi)}function qT(t,r,a,l,h){if(Jc(t))throw Error(s(485));if(t=r.action,t!==null){var g={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){g.listeners.push(S)}};se.T===null?g.isTransition=!1:a(!0),l(g),a=r.pending,a===null?(g.next=r.pending=g,O1(r,g)):(g.next=a.next,r.pending=a.next=g)}}function O1(t,r){var a=r.action,l=r.payload,h=t.state;if(r.isTransition){var g=se.T,S={};se.T=S;try{var D=a(h,l),H=se.S;H!==null&&H(S,D),P1(t,r,D)}catch(ne){up(t,r,ne)}finally{g!==null&&S.types!==null&&(g.types=S.types),se.T=g}}else try{g=a(h,l),P1(t,r,g)}catch(ne){up(t,r,ne)}}function P1(t,r,a){typeof a=="object"&&a&&typeof a.then=="function"?a.then(function(l){M1(t,r,l)},function(l){return up(t,r,l)}):M1(t,r,a)}function M1(t,r,a){r.status="fulfilled",r.value=a,L1(r),t.state=a,r=t.pending,r!==null&&(a=r.next,a===r?t.pending=null:(a=a.next,r.next=a,O1(t,a)))}function up(t,r,a){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=a,L1(r),r=r.next;while(r!==l)}t.action=null}function L1(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function N1(t,r){return r}function I1(t,r){if(st){var a=It.formState;if(a!==null){e:{var l=Ke;if(st){if(Bt){t:{for(var h=Bt,g=Tr;h.nodeType!==8;){if(!g){h=null;break t}if(h=Dr(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){Bt=Dr(h.nextSibling),l=h.data==="F!";break e}}ua(l)}l=!1}l&&(r=a[0])}}return a=Vn(),a.memoizedState=a.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:N1,lastRenderedState:r},a.queue=l,a=eb.bind(null,Ke,l),l.dispatch=a,l=cp(!1),g=gp.bind(null,Ke,!1,l.queue),l=Vn(),h={state:r,dispatch:null,action:t,pending:null},l.queue=h,a=qT.bind(null,Ke,h,g,a),h.dispatch=a,l.memoizedState=t,[r,a,!1]}function A1(t){return q1(Zt(),Rt,t)}function q1(t,r,a){if(r=sp(t,r,N1)[0],t=Kc(Oi)[0],typeof r=="object"&&r&&typeof r.then=="function")try{var l=ll(r)}catch(S){throw S===rs?qc:S}else l=r;r=Zt();var h=r.queue,g=h.dispatch;return a!==r.memoizedState&&(Ke.flags|=2048,ls(9,{destroy:void 0},jT.bind(null,h,a),null)),[l,g,t]}function jT(t,r){t.action=r}function j1(t){var r=Zt(),a=Rt;if(a!==null)return q1(r,a,t);Zt(),r=r.memoizedState,a=Zt();var l=a.queue.dispatch;return a.memoizedState=t,[r,l,!1]}function ls(t,r,a,l){return t={tag:t,create:a,deps:l,inst:r,next:null},r=Ke.updateQueue,r===null&&(r=Wc(),Ke.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=t.next=t:(l=a.next,a.next=t,t.next=l,r.lastEffect=t),t}function z1(){return Zt().memoizedState}function Qc(t,r,a,l){var h=Vn();Ke.flags|=t,h.memoizedState=ls(1|r,{destroy:void 0},a,l===void 0?null:l)}function Gc(t,r,a,l){var h=Zt();l=l===void 0?null:l;var g=h.memoizedState.inst;Rt!==null&&l!==null&&tp(l,Rt.memoizedState.deps)?h.memoizedState=ls(r,g,a,l):(Ke.flags|=t,h.memoizedState=ls(1|r,g,a,l))}function F1(t,r){Qc(8390656,8,t,r)}function dp(t,r){Gc(2048,8,t,r)}function zT(t){Ke.flags|=4;var r=Ke.updateQueue;if(r===null)r=Wc(),Ke.updateQueue=r,r.events=[t];else{var a=r.events;a===null?r.events=[t]:a.push(t)}}function B1(t){var r=Zt().memoizedState;return zT({ref:r,nextImpl:t}),function(){if(yt&2)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function H1(t,r){return Gc(4,2,t,r)}function V1(t,r){return Gc(4,4,t,r)}function $1(t,r){if(typeof r=="function"){t=t();var a=r(t);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function W1(t,r,a){a=a==null?null:a.concat([t]),Gc(4,4,$1.bind(null,r,t),a)}function fp(){}function U1(t,r){var a=Zt();r=r===void 0?null:r;var l=a.memoizedState;return r!==null&&tp(r,l[1])?l[0]:(a.memoizedState=[t,r],t)}function K1(t,r){var a=Zt();r=r===void 0?null:r;var l=a.memoizedState;if(r!==null&&tp(r,l[1]))return l[0];if(l=t(),ho){Ge(!0);try{t()}finally{Ge(!1)}}return a.memoizedState=[l,r],l}function pp(t,r,a){return a===void 0||Di&1073741824&&!(it&261930)?t.memoizedState=r:(t.memoizedState=a,t=Wb(),Ke.lanes|=t,ya|=t,a)}function Q1(t,r,a,l){return cr(a,r)?a:as.current===null?!(Di&42)||Di&1073741824&&!(it&261930)?(sn=!0,t.memoizedState=a):(t=Wb(),Ke.lanes|=t,ya|=t,r):(t=pp(t,a,l),cr(t,r)||(sn=!0),t)}function G1(t,r,a,l,h){var g=Q.p;Q.p=g!==0&&8>g?g:8;var S=se.T,D={};se.T=D,gp(t,!1,r,a);try{var H=h(),ne=se.S;ne!==null&&ne(D,H),typeof H=="object"&&H&&typeof H.then=="function"?cl(t,r,NT(H,l),Rr(t)):cl(t,r,l,Rr(t))}catch(he){cl(t,r,{then:function(){},status:"rejected",reason:he},Rr())}finally{Q.p=g,S!==null&&D.types!==null&&(S.types=D.types),se.T=S}}function FT(){}function hp(t,r,a,l){if(t.tag!==5)throw Error(s(476));var h=J1(t).queue;G1(t,h,r,Le,a===null?FT:function(){return X1(t),a(l)})}function J1(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Le,baseState:Le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:Le},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function X1(t){var r=J1(t);r.next===null&&(r=t.alternate.memoizedState),cl(t,r.next.queue,{},Rr())}function mp(){return Cn(El)}function Y1(){return Zt().memoizedState}function Z1(){return Zt().memoizedState}function BT(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var a=Rr();t=fo(a);var l=po(r,t,a);l!==null&&(Yn(l,r,a),il(l,r,a)),r={cache:$f()},t.payload=r;return}r=r.return}}function HT(t,r,a){var l=Rr();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Jc(t)?tb(r,a):(a=Lf(t,r,a,l),a!==null&&(Yn(a,t,l),nb(a,r,l)))}function eb(t,r,a){cl(t,r,a,Rr())}function cl(t,r,a,l){var h={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Jc(t))tb(r,h);else{var g=t.alternate;if(t.lanes===0&&(g===null||g.lanes===0)&&(g=r.lastRenderedReducer,g!==null))try{var S=r.lastRenderedState,D=g(S,a);if(h.hasEagerState=!0,h.eagerState=D,cr(D,S))return Oc(t,r,h,0),It===null&&Dc(),!1}catch{}if(a=Lf(t,r,h,l),a!==null)return Yn(a,t,l),nb(a,r,l),!0}return!1}function gp(t,r,a,l){if(l={lane:2,revertLane:Qp(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Jc(t)){if(r)throw Error(s(479))}else r=Lf(t,a,l,2),r!==null&&Yn(r,t,2)}function Jc(t){var r=t.alternate;return t===Ke||r!==null&&r===Ke}function tb(t,r){os=Vc=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function nb(t,r,a){if(a&4194048){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,or(t,a)}}var ul={readContext:Cn,use:Uc,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useLayoutEffect:Qt,useInsertionEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useSyncExternalStore:Qt,useId:Qt,useHostTransitionStatus:Qt,useFormState:Qt,useActionState:Qt,useOptimistic:Qt,useMemoCache:Qt,useCacheRefresh:Qt};ul.useEffectEvent=Qt;var rb={readContext:Cn,use:Uc,useCallback:function(t,r){return Vn().memoizedState=[t,r===void 0?null:r],t},useContext:Cn,useEffect:F1,useImperativeHandle:function(t,r,a){a=a==null?null:a.concat([t]),Qc(4194308,4,$1.bind(null,r,t),a)},useLayoutEffect:function(t,r){return Qc(4194308,4,t,r)},useInsertionEffect:function(t,r){Qc(4,2,t,r)},useMemo:function(t,r){var a=Vn();r=r===void 0?null:r;var l=t();if(ho){Ge(!0);try{t()}finally{Ge(!1)}}return a.memoizedState=[l,r],l},useReducer:function(t,r,a){var l=Vn();if(a!==void 0){var h=a(r);if(ho){Ge(!0);try{a(r)}finally{Ge(!1)}}}else h=r;return l.memoizedState=l.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},l.queue=t,t=t.dispatch=HT.bind(null,Ke,t),[l.memoizedState,t]},useRef:function(t){var r=Vn();return t={current:t},r.memoizedState=t},useState:function(t){t=cp(t);var r=t.queue,a=eb.bind(null,Ke,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:fp,useDeferredValue:function(t,r){return pp(Vn(),t,r)},useTransition:function(){var t=cp(!1);return t=G1.bind(null,Ke,t.queue,!0,!1),Vn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var l=Ke,h=Vn();if(st){if(a===void 0)throw Error(s(407));a=a()}else{if(a=r(),It===null)throw Error(s(349));it&127||S1(l,r,a)}h.memoizedState=a;var g={value:a,getSnapshot:r};return h.queue=g,F1(E1.bind(null,l,g,t),[t]),l.flags|=2048,ls(9,{destroy:void 0},C1.bind(null,l,g,a,r),null),a},useId:function(){var t=Vn(),r=It.identifierPrefix;if(st){var a=li,l=si;a=(l&~(1<<32-gt(l)-1)).toString(32)+a,r="_"+r+"R_"+a,a=$c++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=IT++,r="_"+r+"r_"+a.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:mp,useFormState:I1,useActionState:I1,useOptimistic:function(t){var r=Vn();r.memoizedState=r.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=gp.bind(null,Ke,!0,a),a.dispatch=r,[t,r]},useMemoCache:op,useCacheRefresh:function(){return Vn().memoizedState=BT.bind(null,Ke)},useEffectEvent:function(t){var r=Vn(),a={impl:t};return r.memoizedState=a,function(){if(yt&2)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},yp={readContext:Cn,use:Uc,useCallback:U1,useContext:Cn,useEffect:dp,useImperativeHandle:W1,useInsertionEffect:H1,useLayoutEffect:V1,useMemo:K1,useReducer:Kc,useRef:z1,useState:function(){return Kc(Oi)},useDebugValue:fp,useDeferredValue:function(t,r){return Q1(Zt(),Rt.memoizedState,t,r)},useTransition:function(){var t=Kc(Oi)[0],r=Zt().memoizedState;return[typeof t=="boolean"?t:ll(t),r]},useSyncExternalStore:k1,useId:Y1,useHostTransitionStatus:mp,useFormState:A1,useActionState:A1,useOptimistic:function(t,r){return D1(Zt(),Rt,t,r)},useMemoCache:op,useCacheRefresh:Z1};yp.useEffectEvent=B1;var ib={readContext:Cn,use:Uc,useCallback:U1,useContext:Cn,useEffect:dp,useImperativeHandle:W1,useInsertionEffect:H1,useLayoutEffect:V1,useMemo:K1,useReducer:lp,useRef:z1,useState:function(){return lp(Oi)},useDebugValue:fp,useDeferredValue:function(t,r){var a=Zt();return Rt===null?pp(a,t,r):Q1(a,Rt.memoizedState,t,r)},useTransition:function(){var t=lp(Oi)[0],r=Zt().memoizedState;return[typeof t=="boolean"?t:ll(t),r]},useSyncExternalStore:k1,useId:Y1,useHostTransitionStatus:mp,useFormState:j1,useActionState:j1,useOptimistic:function(t,r){var a=Zt();return Rt===null?(a.baseState=t,[t,a.queue.dispatch]):D1(a,Rt,t,r)},useMemoCache:op,useCacheRefresh:Z1};ib.useEffectEvent=B1;function vp(t,r,a,l){r=t.memoizedState,a=a(l,r),a=a==null?r:C({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var bp={enqueueSetState:function(t,r,a){t=t._reactInternals;var l=Rr(),h=fo(l);h.payload=r,a!=null&&(h.callback=a),r=po(t,h,l),r!==null&&(Yn(r,t,l),il(r,t,l))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var l=Rr(),h=fo(l);h.tag=1,h.payload=r,a!=null&&(h.callback=a),r=po(t,h,l),r!==null&&(Yn(r,t,l),il(r,t,l))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=Rr(),l=fo(a);l.tag=2,r!=null&&(l.callback=r),r=po(t,l,a),r!==null&&(Yn(r,t,a),il(r,t,a))}};function ab(t,r,a,l,h,g,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,g,S):r.prototype&&r.prototype.isPureReactComponent?!Js(a,l)||!Js(h,g):!0}function ob(t,r,a,l){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,l),r.state!==t&&bp.enqueueReplaceState(r,r.state,null)}function mo(t,r){var a=r;if("ref"in r)for(var l in a={},r)l!=="ref"&&(a[l]=r[l]);if(t=t.defaultProps)for(var h in a===r&&(a=C({},a)),t)a[h]===void 0&&(a[h]=t[h]);return a}function VT(t){Rc(t)}function $T(t){console.error(t)}function WT(t){Rc(t)}function Xc(t,r){try{var a=t.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function sb(t,r,a){try{var l=t.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function wp(t,r,a){return a=fo(a),a.tag=3,a.payload={element:null},a.callback=function(){Xc(t,r)},a}function lb(t){return t=fo(t),t.tag=3,t}function cb(t,r,a,l){var h=a.type.getDerivedStateFromError;if(typeof h=="function"){var g=l.value;t.payload=function(){return h(g)},t.callback=function(){sb(r,a,l)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){sb(r,a,l),typeof h!="function"&&(va===null?va=new Set([this]):va.add(this));var D=l.stack;this.componentDidCatch(l.value,{componentStack:D===null?"":D})})}function UT(t,r,a,l,h){if(a.flags|=32768,typeof l=="object"&&l&&typeof l.then=="function"){if(r=a.alternate,r!==null&&es(r,a,h,!0),a=dr.current,a!==null){switch(a.tag){case 31:case 13:return Kr===null?cu():a.alternate===null&&Gt===0&&(Gt=3),a.flags&=-257,a.flags|=65536,a.lanes=h,l===jc?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([l]):r.add(l),Wp(t,l,h)),!1;case 22:return a.flags|=65536,l===jc?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([l]):a.add(l)),Wp(t,l,h)),!1}throw Error(s(435,a.tag))}return Wp(t,l,h),cu(),!1}if(st)return r=dr.current,r===null?(l!==zf&&(r=Error(s(423),{cause:l}),Zs(Sr(r,a))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,l=Sr(l,a),h=wp(t.stateNode,l,h),Jf(t,h),Gt!==4&&(Gt=2)):(!(r.flags&65536)&&(r.flags|=256),r.flags|=65536,r.lanes=h,l!==zf&&(t=Error(s(422),{cause:l}),Zs(Sr(t,a)))),!1;var g=Error(s(520),{cause:l});if(g=Sr(g,a),vl===null?vl=[g]:vl.push(g),Gt!==4&&(Gt=2),r===null)return!0;l=Sr(l,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,t=h&-h,a.lanes|=t,t=wp(a.stateNode,l,t),Jf(a,t),!1;case 1:if(r=a.type,g=a.stateNode,!(a.flags&128)&&(typeof r.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(va===null||!va.has(g))))return a.flags|=65536,h&=-h,a.lanes|=h,h=lb(h),cb(h,t,a,l),Jf(a,h),!1}a=a.return}while(a!==null);return!1}var _p=Error(s(461)),sn=!1;function En(t,r,a,l){r.child=t===null?g1(r,null,a,l):uo(r,t.child,a,l)}function ub(t,r,a,l,h){a=a.render;var g=r.ref;if("ref"in l){var S={};for(var D in l)D!=="ref"&&(S[D]=l[D])}else S=l;return oo(r),l=np(t,r,a,S,g,h),D=rp(),t!==null&&!sn?(ip(t,r,h),Pi(t,r,h)):(st&&D&&qf(r),r.flags|=1,En(t,r,l,h),r.child)}function db(t,r,a,l,h){if(t===null){var g=a.type;return typeof g=="function"&&!Nf(g)&&g.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=g,fb(t,r,g,l,h)):(t=Mc(a.type,null,l,r,r.mode,h),t.ref=r.ref,t.return=r,r.child=t)}if(g=t.child,!Dp(t,h)){var S=g.memoizedProps;if(a=a.compare,a=a===null?Js:a,a(S,l)&&t.ref===r.ref)return Pi(t,r,h)}return r.flags|=1,t=Ci(g,l),t.ref=r.ref,t.return=r,r.child=t}function fb(t,r,a,l,h){if(t!==null){var g=t.memoizedProps;if(Js(g,l)&&t.ref===r.ref)if(sn=!1,r.pendingProps=l=g,Dp(t,h))t.flags&131072&&(sn=!0);else return r.lanes=t.lanes,Pi(t,r,h)}return xp(t,r,a,l,h)}function pb(t,r,a,l){var h=l.children,g=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(g=g===null?a:g.baseLanes|a,t!==null){for(l=r.child=t.child,h=0;l!==null;)h=h|l.lanes|l.childLanes,l=l.sibling;l=h&~g}else l=0,r.child=null;return hb(t,r,g,a,l)}if(a&536870912)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ac(r,g===null?null:g.cachePool),g===null?Yf():b1(r,g),w1(r);else return l=r.lanes=536870912,hb(t,r,g===null?a:g.baseLanes|a,a,l)}else g===null?(t!==null&&Ac(r,null),Yf(),ha(r)):(Ac(r,g.cachePool),b1(r,g),ha(r),r.memoizedState=null);return En(t,r,h,a),r.child}function dl(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function hb(t,r,a,l,h){var g=Uf();return g=g===null?null:{parent:an._currentValue,pool:g},r.memoizedState={baseLanes:a,cachePool:g},t!==null&&Ac(r,null),Yf(),w1(r),t!==null&&es(t,r,l,!0),r.childLanes=h,null}function Yc(t,r){return r=eu({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function mb(t,r,a){return uo(r,t.child,null,a),t=Yc(r,r.pendingProps),t.flags|=2,fr(r),r.memoizedState=null,t}function KT(t,r,a){var l=r.pendingProps,h=(r.flags&128)!=0;if(r.flags&=-129,t===null){if(st){if(l.mode==="hidden")return t=Yc(r,l),r.lanes=536870912,dl(null,t);if(ep(r),(t=Bt)?(t=R2(t,Tr),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:la===null?null:{id:si,overflow:li},retryLane:536870912,hydrationErrors:null},a=t1(t),a.return=r,r.child=a,Sn=r,Bt=null)):t=null,t===null)throw ua(r);return r.lanes=536870912,null}return Yc(r,l)}var g=t.memoizedState;if(g!==null){var S=g.dehydrated;if(ep(r),h)if(r.flags&256)r.flags&=-257,r=mb(t,r,a);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(s(558));else if(sn||es(t,r,a,!1),h=(a&t.childLanes)!==0,sn||h){if(l=It,l!==null&&(S=M(l,a),S!==0&&S!==g.retryLane))throw g.retryLane=S,no(t,S),Yn(l,t,S),_p;cu(),r=mb(t,r,a)}else t=g.treeContext,Bt=Dr(S.nextSibling),Sn=r,st=!0,ca=null,Tr=!1,t!==null&&i1(r,t),r=Yc(r,l),r.flags|=4096;return r}return t=Ci(t.child,{mode:l.mode,children:l.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Zc(t,r){var a=r.ref;if(a===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(r.flags|=4194816)}}function xp(t,r,a,l,h){return oo(r),a=np(t,r,a,l,void 0,h),l=rp(),t!==null&&!sn?(ip(t,r,h),Pi(t,r,h)):(st&&l&&qf(r),r.flags|=1,En(t,r,a,h),r.child)}function gb(t,r,a,l,h,g){return oo(r),r.updateQueue=null,a=x1(r,l,a,h),_1(t),l=rp(),t!==null&&!sn?(ip(t,r,g),Pi(t,r,g)):(st&&l&&qf(r),r.flags|=1,En(t,r,a,g),r.child)}function yb(t,r,a,l,h){if(oo(r),r.stateNode===null){var g=Jo,S=a.contextType;typeof S=="object"&&S&&(g=Cn(S)),g=new a(l,g),r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=bp,r.stateNode=g,g._reactInternals=r,g=r.stateNode,g.props=l,g.state=r.memoizedState,g.refs={},Qf(r),S=a.contextType,g.context=typeof S=="object"&&S?Cn(S):Jo,g.state=r.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(vp(r,a,S,l),g.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(S=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),S!==g.state&&bp.enqueueReplaceState(g,g.state,null),ol(r,l,g,h),al(),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(t===null){g=r.stateNode;var D=r.memoizedProps,H=mo(a,D);g.props=H;var ne=g.context,he=a.contextType;S=Jo,typeof he=="object"&&he&&(S=Cn(he));var ge=a.getDerivedStateFromProps;he=typeof ge=="function"||typeof g.getSnapshotBeforeUpdate=="function",D=r.pendingProps!==D,he||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(D||ne!==S)&&ob(r,g,l,S),fa=!1;var ae=r.memoizedState;g.state=ae,ol(r,l,g,h),al(),ne=r.memoizedState,D||ae!==ne||fa?(typeof ge=="function"&&(vp(r,a,ge,l),ne=r.memoizedState),(H=fa||ab(r,a,H,l,ae,ne,S))?(he||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(r.flags|=4194308)):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=ne),g.props=l,g.state=ne,g.context=S,l=H):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{g=r.stateNode,Gf(t,r),S=r.memoizedProps,he=mo(a,S),g.props=he,ge=r.pendingProps,ae=g.context,ne=a.contextType,H=Jo,typeof ne=="object"&&ne&&(H=Cn(ne)),D=a.getDerivedStateFromProps,(ne=typeof D=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S!==ge||ae!==H)&&ob(r,g,l,H),fa=!1,ae=r.memoizedState,g.state=ae,ol(r,l,g,h),al();var ue=r.memoizedState;S!==ge||ae!==ue||fa||t!==null&&t.dependencies!==null&&Nc(t.dependencies)?(typeof D=="function"&&(vp(r,a,D,l),ue=r.memoizedState),(he=fa||ab(r,a,he,l,ae,ue,H)||t!==null&&t.dependencies!==null&&Nc(t.dependencies))?(ne||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(l,ue,H),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(l,ue,H)),typeof g.componentDidUpdate=="function"&&(r.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof g.componentDidUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=ue),g.props=l,g.state=ue,g.context=H,l=he):(typeof g.componentDidUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=1024),l=!1)}return g=l,Zc(t,r),l=(r.flags&128)!=0,g||l?(g=r.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:g.render(),r.flags|=1,t!==null&&l?(r.child=uo(r,t.child,null,h),r.child=uo(r,null,a,h)):En(t,r,a,h),r.memoizedState=g.state,t=r.child):t=Pi(t,r,h),t}function vb(t,r,a,l){return io(),r.flags|=256,En(t,r,a,l),r.child}var kp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sp(t){return{baseLanes:t,cachePool:u1()}}function Cp(t,r,a){return t=t===null?0:t.childLanes&~a,r&&(t|=hr),t}function bb(t,r,a){var l=r.pendingProps,h=!1,g=(r.flags&128)!=0,S;if((S=g)||(S=t!==null&&t.memoizedState===null?!1:(Yt.current&2)!=0),S&&(h=!0,r.flags&=-129),S=(r.flags&32)!=0,r.flags&=-33,t===null){if(st){if(h?pa(r):ha(r),(t=Bt)?(t=R2(t,Tr),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:la===null?null:{id:si,overflow:li},retryLane:536870912,hydrationErrors:null},a=t1(t),a.return=r,r.child=a,Sn=r,Bt=null)):t=null,t===null)throw ua(r);return oh(t)?r.lanes=32:r.lanes=536870912,null}var D=l.children;return l=l.fallback,h?(ha(r),h=r.mode,D=eu({mode:"hidden",children:D},h),l=ro(l,h,a,null),D.return=r,l.return=r,D.sibling=l,r.child=D,l=r.child,l.memoizedState=Sp(a),l.childLanes=Cp(t,S,a),r.memoizedState=kp,dl(null,l)):(pa(r),Ep(r,D))}var H=t.memoizedState;if(H!==null&&(D=H.dehydrated,D!==null)){if(g)r.flags&256?(pa(r),r.flags&=-257,r=Tp(t,r,a)):r.memoizedState===null?(ha(r),D=l.fallback,h=r.mode,l=eu({mode:"visible",children:l.children},h),D=ro(D,h,a,null),D.flags|=2,l.return=r,D.return=r,l.sibling=D,r.child=l,uo(r,t.child,null,a),l=r.child,l.memoizedState=Sp(a),l.childLanes=Cp(t,S,a),r.memoizedState=kp,r=dl(null,l)):(ha(r),r.child=t.child,r.flags|=128,r=null);else if(pa(r),oh(D)){if(S=D.nextSibling&&D.nextSibling.dataset,S)var ne=S.dgst;S=ne,l=Error(s(419)),l.stack="",l.digest=S,Zs({value:l,source:null,stack:null}),r=Tp(t,r,a)}else if(sn||es(t,r,a,!1),S=(a&t.childLanes)!==0,sn||S){if(S=It,S!==null&&(l=M(S,a),l!==0&&l!==H.retryLane))throw H.retryLane=l,no(t,l),Yn(S,t,l),_p;ah(D)||cu(),r=Tp(t,r,a)}else ah(D)?(r.flags|=192,r.child=t.child,r=null):(t=H.treeContext,Bt=Dr(D.nextSibling),Sn=r,st=!0,ca=null,Tr=!1,t!==null&&i1(r,t),r=Ep(r,l.children),r.flags|=4096);return r}return h?(ha(r),D=l.fallback,h=r.mode,H=t.child,ne=H.sibling,l=Ci(H,{mode:"hidden",children:l.children}),l.subtreeFlags=H.subtreeFlags&65011712,ne===null?(D=ro(D,h,a,null),D.flags|=2):D=Ci(ne,D),D.return=r,l.return=r,l.sibling=D,r.child=l,dl(null,l),l=r.child,D=t.child.memoizedState,D===null?D=Sp(a):(h=D.cachePool,h===null?h=u1():(H=an._currentValue,h=h.parent===H?h:{parent:H,pool:H}),D={baseLanes:D.baseLanes|a,cachePool:h}),l.memoizedState=D,l.childLanes=Cp(t,S,a),r.memoizedState=kp,dl(t.child,l)):(pa(r),a=t.child,t=a.sibling,a=Ci(a,{mode:"visible",children:l.children}),a.return=r,a.sibling=null,t!==null&&(S=r.deletions,S===null?(r.deletions=[t],r.flags|=16):S.push(t)),r.child=a,r.memoizedState=null,a)}function Ep(t,r){return r=eu({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function eu(t,r){return t=ur(22,t,null,r),t.lanes=0,t}function Tp(t,r,a){return uo(r,t.child,null,a),t=Ep(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function wb(t,r,a){t.lanes|=r;var l=t.alternate;l!==null&&(l.lanes|=r),Hf(t.return,r,a)}function Rp(t,r,a,l,h,g){var S=t.memoizedState;S===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:h,treeForkCount:g}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=l,S.tail=a,S.tailMode=h,S.treeForkCount=g)}function _b(t,r,a){var l=r.pendingProps,h=l.revealOrder,g=l.tail;l=l.children;var S=Yt.current,D=(S&2)!=0;if(D?(S=S&1|2,r.flags|=128):S&=1,Pe(Yt,S),En(t,r,l,a),l=st?Ys:0,!D&&t!==null&&t.flags&128)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&wb(t,a,r);else if(t.tag===19)wb(t,a,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(h){case"forwards":for(a=r.child,h=null;a!==null;)t=a.alternate,t!==null&&Hc(t)===null&&(h=a),a=a.sibling;a=h,a===null?(h=r.child,r.child=null):(h=a.sibling,a.sibling=null),Rp(r,!1,h,a,g,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,h=r.child,r.child=null;h!==null;){if(t=h.alternate,t!==null&&Hc(t)===null){r.child=h;break}t=h.sibling,h.sibling=a,a=h,h=t}Rp(r,!0,a,null,g,l);break;case"together":Rp(r,!1,null,null,void 0,l);break;default:r.memoizedState=null}return r.child}function Pi(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),ya|=r.lanes,(a&r.childLanes)===0)if(t!==null){if(es(t,r,a,!1),(a&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,a=Ci(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=Ci(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function Dp(t,r){return(t.lanes&r)===0?(t=t.dependencies,!!(t!==null&&Nc(t))):!0}function QT(t,r,a){switch(r.tag){case 3:un(r,r.stateNode.containerInfo),da(r,an,t.memoizedState.cache),io();break;case 27:case 5:tn(r);break;case 4:un(r,r.stateNode.containerInfo);break;case 10:da(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,ep(r),null;break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated===null?(a&r.child.childLanes)===0?(pa(r),t=Pi(t,r,a),t===null?null:t.sibling):bb(t,r,a):(pa(r),r.flags|=128,null);pa(r);break;case 19:var h=(t.flags&128)!=0;if(l=(a&r.childLanes)!==0,l||(l=(es(t,r,a,!1),(a&r.childLanes)!==0)),h){if(l)return _b(t,r,a);r.flags|=128}if(h=r.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Pe(Yt,Yt.current),l)break;return null;case 22:return r.lanes=0,pb(t,r,a,r.pendingProps);case 24:da(r,an,t.memoizedState.cache)}return Pi(t,r,a)}function xb(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps)sn=!0;else{if(!Dp(t,a)&&!(r.flags&128))return sn=!1,QT(t,r,a);sn=!!(t.flags&131072)}else sn=!1,st&&r.flags&1048576&&r1(r,Ys,r.index);switch(r.lanes=0,r.tag){case 16:e:{var l=r.pendingProps;if(t=lo(r.elementType),r.type=t,typeof t=="function")Nf(t)?(l=mo(t,l),r.tag=1,r=yb(null,r,t,l,a)):(r.tag=0,r=xp(null,r,t,l,a));else{if(t!=null){var h=t.$$typeof;if(h===pe){r.tag=11,r=ub(null,r,t,l,a);break e}else if(h===W){r.tag=14,r=db(null,r,t,l,a);break e}}throw r=Z(t)||t,Error(s(306,r,""))}}return r;case 0:return xp(t,r,r.type,r.pendingProps,a);case 1:return l=r.type,h=mo(l,r.pendingProps),yb(t,r,l,h,a);case 3:e:{if(un(r,r.stateNode.containerInfo),t===null)throw Error(s(387));l=r.pendingProps;var g=r.memoizedState;h=g.element,Gf(t,r),ol(r,l,null,a);var S=r.memoizedState;if(l=S.cache,da(r,an,l),l!==g.cache&&Vf(r,[an],a,!0),al(),l=S.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=g,r.memoizedState=g,r.flags&256){r=vb(t,r,l,a);break e}else if(l!==h){h=Sr(Error(s(424)),r),Zs(h),r=vb(t,r,l,a);break e}else for((t=r.stateNode.containerInfo,t.nodeType)===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Bt=Dr(t.firstChild),Sn=r,st=!0,ca=null,Tr=!0,a=g1(r,null,l,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(io(),l===h){r=Pi(t,r,a);break e}En(t,r,l,a)}r=r.child}return r;case 26:return Zc(t,r),t===null?(a=N2(r.type,null,r.pendingProps,null))?r.memoizedState=a:st||(a=r.type,t=r.pendingProps,l=gu(mt.current).createElement(a),l[He]=r,l[Ve]=t,Tn(l,a,t),Xt(l),r.stateNode=l):r.memoizedState=N2(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return tn(r),t===null&&st&&(l=r.stateNode=P2(r.type,r.pendingProps,mt.current),Sn=r,Tr=!0,h=Bt,xa(r.type)?(sh=h,Bt=Dr(l.firstChild)):Bt=h),En(t,r,r.pendingProps.children,a),Zc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&st&&((h=l=Bt)&&(l=xR(l,r.type,r.pendingProps,Tr),l===null?h=!1:(r.stateNode=l,Sn=r,Bt=Dr(l.firstChild),Tr=!1,h=!0)),h||ua(r)),tn(r),h=r.type,g=r.pendingProps,S=t===null?null:t.memoizedProps,l=g.children,nh(h,g)?l=null:S!==null&&nh(h,S)&&(r.flags|=32),r.memoizedState!==null&&(h=np(t,r,AT,null,null,a),El._currentValue=h),Zc(t,r),En(t,r,l,a),r.child;case 6:return t===null&&st&&((t=a=Bt)&&(a=kR(a,r.pendingProps,Tr),a===null?t=!1:(r.stateNode=a,Sn=r,Bt=null,t=!0)),t||ua(r)),null;case 13:return bb(t,r,a);case 4:return un(r,r.stateNode.containerInfo),l=r.pendingProps,t===null?r.child=uo(r,null,l,a):En(t,r,l,a),r.child;case 11:return ub(t,r,r.type,r.pendingProps,a);case 7:return En(t,r,r.pendingProps,a),r.child;case 8:return En(t,r,r.pendingProps.children,a),r.child;case 12:return En(t,r,r.pendingProps.children,a),r.child;case 10:return l=r.pendingProps,da(r,r.type,l.value),En(t,r,l.children,a),r.child;case 9:return h=r.type._context,l=r.pendingProps.children,oo(r),h=Cn(h),l=l(h),r.flags|=1,En(t,r,l,a),r.child;case 14:return db(t,r,r.type,r.pendingProps,a);case 15:return fb(t,r,r.type,r.pendingProps,a);case 19:return _b(t,r,a);case 31:return KT(t,r,a);case 22:return pb(t,r,a,r.pendingProps);case 24:return oo(r),l=Cn(an),t===null?(h=Uf(),h===null&&(h=It,g=$f(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=a),h=g),r.memoizedState={parent:l,cache:h},Qf(r),da(r,an,h)):((t.lanes&a)!==0&&(Gf(t,r),ol(r,null,null,a),al()),h=t.memoizedState,g=r.memoizedState,h.parent===l?(l=g.cache,da(r,an,l),l!==h.cache&&Vf(r,[an],a,!0)):(h={parent:l,cache:l},r.memoizedState=h,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=h),da(r,an,l))),En(t,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Mi(t){t.flags|=4}function Op(t,r,a,l,h){if((r=(t.mode&32)!=0)&&(r=!1),r){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if(Gb())t.flags|=8192;else throw co=jc,Kf}else t.flags&=-16777217}function kb(t,r){if(r.type!=="stylesheet"||r.state.loading&4)t.flags&=-16777217;else if(t.flags|=16777216,!z2(r))if(Gb())t.flags|=8192;else throw co=jc,Kf}function tu(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag===22?536870912:bi(),t.lanes|=r,fs|=r)}function fl(t,r){if(!st)switch(t.tailMode){case"hidden":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function Ht(t){var r=t.alternate!==null&&t.alternate.child===t.child,a=0,l=0;if(r)for(var h=t.child;h!==null;)a|=h.lanes|h.childLanes,l|=h.subtreeFlags&65011712,l|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)a|=h.lanes|h.childLanes,l|=h.subtreeFlags,l|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=l,t.childLanes=a,r}function GT(t,r,a){var l=r.pendingProps;switch(jf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ht(r),null;case 1:return Ht(r),null;case 3:return a=r.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),Ri(an),We(),a.pendingContext&&(a.pendingContext=(a.context=a.pendingContext,null)),(t===null||t.child===null)&&(Zo(r)?Mi(r):t===null||t.memoizedState.isDehydrated&&!(r.flags&256)||(r.flags|=1024,Ff())),Ht(r),null;case 26:var h=r.type,g=r.memoizedState;return t===null?(Mi(r),g===null?(Ht(r),Op(r,h,null,l,a)):(Ht(r),kb(r,g))):g?g===t.memoizedState?(Ht(r),r.flags&=-16777217):(Mi(r),Ht(r),kb(r,g)):(t=t.memoizedProps,t!==l&&Mi(r),Ht(r),Op(r,h,t,l,a)),null;case 27:if(wt(r),a=mt.current,h=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Mi(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Ht(r),null}t=Ae.current,Zo(r)?a1(r,t):(t=P2(h,l,a),r.stateNode=t,Mi(r))}return Ht(r),null;case 5:if(wt(r),h=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Mi(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Ht(r),null}if(g=Ae.current,Zo(r))a1(r,g);else{var S=gu(mt.current);switch(g){case 1:g=S.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=S.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=S.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=S.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=S.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof l.is=="string"?S.createElement("select",{is:l.is}):S.createElement("select"),l.multiple?g.multiple=!0:l.size&&(g.size=l.size);break;default:g=typeof l.is=="string"?S.createElement(h,{is:l.is}):S.createElement(h)}}g[He]=r,g[Ve]=l;e:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)g.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===r)break e;for(;S.sibling===null;){if(S.return===null||S.return===r)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}r.stateNode=g;e:switch(Tn(g,h,l),h){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Mi(r)}}return Ht(r),Op(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,a),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==l&&Mi(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(t=mt.current,Zo(r)){if(t=r.stateNode,a=r.memoizedProps,l=null,h=Sn,h!==null)switch(h.tag){case 27:case 5:l=h.memoizedProps}t[He]=r,t=!!(t.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||w2(t.nodeValue,a)),t||ua(r,!0)}else t=gu(t).createTextNode(l),t[He]=r,r.stateNode=t}return Ht(r),null;case 31:if(a=r.memoizedState,t===null||t.memoizedState!==null){if(l=Zo(r),a!==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[He]=r}else io(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Ht(r),t=!1}else a=Ff(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return r.flags&256?(fr(r),r):(fr(r),null);if(r.flags&128)throw Error(s(558))}return Ht(r),null;case 13:if(l=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Zo(r),l!==null&&l.dehydrated!==null){if(t===null){if(!h)throw Error(s(318));if(h=r.memoizedState,h=h===null?null:h.dehydrated,!h)throw Error(s(317));h[He]=r}else io(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Ht(r),h=!1}else h=Ff(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return r.flags&256?(fr(r),r):(fr(r),null)}return fr(r),r.flags&128?(r.lanes=a,r):(a=l!==null,t=t!==null&&t.memoizedState!==null,a&&(l=r.child,h=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(h=l.alternate.memoizedState.cachePool.pool),g=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==h&&(l.flags|=2048)),a!==t&&a&&(r.child.flags|=8192),tu(r,r.updateQueue),Ht(r),null);case 4:return We(),t===null&&g2(r.stateNode.containerInfo),Ht(r),null;case 10:return Ri(r.type),Ht(r),null;case 19:if(je(Yt),l=r.memoizedState,l===null)return Ht(r),null;if(h=(r.flags&128)!=0,g=l.rendering,g===null)if(h)fl(l,!1);else{if(Gt!==0||t!==null&&t.flags&128)for(t=r.child;t!==null;){if(g=Hc(t),g!==null){for(r.flags|=128,fl(l,!1),t=g.updateQueue,r.updateQueue=t,tu(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)e1(a,t),a=a.sibling;return Pe(Yt,Yt.current&1|2),st&&Ei(r,l.treeForkCount),r.child}t=t.sibling}l.tail!==null&&Ut()>ou&&(r.flags|=128,h=!0,fl(l,!1),r.lanes=4194304)}else{if(!h)if(t=Hc(g),t!==null){if(r.flags|=128,h=!0,t=t.updateQueue,r.updateQueue=t,tu(r,t),fl(l,!0),l.tail===null&&l.tailMode==="hidden"&&!g.alternate&&!st)return Ht(r),null}else 2*Ut()-l.renderingStartTime>ou&&a!==536870912&&(r.flags|=128,h=!0,fl(l,!1),r.lanes=4194304);l.isBackwards?(g.sibling=r.child,r.child=g):(t=l.last,t===null?r.child=g:t.sibling=g,l.last=g)}return l.tail===null?(Ht(r),null):(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Ut(),t.sibling=null,a=Yt.current,Pe(Yt,h?a&1|2:a&1),st&&Ei(r,l.treeForkCount),t);case 22:case 23:return fr(r),Zf(),l=r.memoizedState!==null,t===null?l&&(r.flags|=8192):t.memoizedState!==null!==l&&(r.flags|=8192),l?a&536870912&&!(r.flags&128)&&(Ht(r),r.subtreeFlags&6&&(r.flags|=8192)):Ht(r),a=r.updateQueue,a!==null&&tu(r,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==a&&(r.flags|=2048),t!==null&&je(so),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Ri(an),Ht(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function JT(t,r){switch(jf(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Ri(an),We(),t=r.flags,t&65536&&!(t&128)?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return wt(r),null;case 31:if(r.memoizedState!==null){if(fr(r),r.alternate===null)throw Error(s(340));io()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(fr(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));io()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return je(Yt),null;case 4:return We(),null;case 10:return Ri(r.type),null;case 22:case 23:return fr(r),Zf(),t!==null&&je(so),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Ri(an),null;case 25:return null;default:return null}}function Sb(t,r){switch(jf(r),r.tag){case 3:Ri(an),We();break;case 26:case 27:case 5:wt(r);break;case 4:We();break;case 31:r.memoizedState!==null&&fr(r);break;case 13:fr(r);break;case 19:je(Yt);break;case 10:Ri(r.type);break;case 22:case 23:fr(r),Zf(),t!==null&&je(so);break;case 24:Ri(an)}}function pl(t,r){try{var a=r.updateQueue,l=a===null?null:a.lastEffect;if(l!==null){var h=l.next;a=h;do{if((a.tag&t)===t){l=void 0;var g=a.create,S=a.inst;l=g(),S.destroy=l}a=a.next}while(a!==h)}}catch(D){Et(r,r.return,D)}}function ma(t,r,a){try{var l=r.updateQueue,h=l===null?null:l.lastEffect;if(h!==null){var g=h.next;l=g;do{if((l.tag&t)===t){var S=l.inst,D=S.destroy;if(D!==void 0){S.destroy=void 0,h=r;var H=a,ne=D;try{ne()}catch(he){Et(h,H,he)}}}l=l.next}while(l!==g)}}catch(he){Et(r,r.return,he)}}function Cb(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{v1(r,a)}catch(l){Et(t,t.return,l)}}}function Eb(t,r,a){a.props=mo(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(l){Et(t,r,l)}}function hl(t,r){try{var a=t.ref;if(a!==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 a=="function"?t.refCleanup=a(l):a.current=l}}catch(h){Et(t,r,h)}}function ci(t,r){var a=t.ref,l=t.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(h){Et(t,r,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(h){Et(t,r,h)}else a.current=null}function Tb(t){var r=t.type,a=t.memoizedProps,l=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(h){Et(t,t.return,h)}}function Pp(t,r,a){try{var l=t.stateNode;gR(l,t.type,a,r),l[Ve]=r}catch(h){Et(t,t.return,h)}}function Rb(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&xa(t.type)||t.tag===4}function Mp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Rb(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&&xa(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 Lp(t,r,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(t),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=xr));else if(l!==4&&(l===27&&xa(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(Lp(t,r,a),t=t.sibling;t!==null;)Lp(t,r,a),t=t.sibling}function nu(t,r,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?a.insertBefore(t,r):a.appendChild(t);else if(l!==4&&(l===27&&xa(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(nu(t,r,a),t=t.sibling;t!==null;)nu(t,r,a),t=t.sibling}function Db(t){var r=t.stateNode,a=t.memoizedProps;try{for(var l=t.type,h=r.attributes;h.length;)r.removeAttributeNode(h[0]);Tn(r,l,a),r[He]=t,r[Ve]=a}catch(g){Et(t,t.return,g)}}var Li=!1,ln=!1,Np=!1,Ob=typeof WeakSet=="function"?WeakSet:Set,kn=null;function XT(t,r){if(t=t.containerInfo,eh=ku,t=Wv(t),Tf(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var h=l.anchorOffset,g=l.focusNode;l=l.focusOffset;try{a.nodeType,g.nodeType}catch{a=null;break e}var S=0,D=-1,H=-1,ne=0,he=0,ge=t,ae=null;t:for(;;){for(var ue;ge!==a||h!==0&&ge.nodeType!==3||(D=S+h),ge!==g||l!==0&&ge.nodeType!==3||(H=S+l),ge.nodeType===3&&(S+=ge.nodeValue.length),(ue=ge.firstChild)!==null;)ae=ge,ge=ue;for(;;){if(ge===t)break t;if(ae===a&&++ne===h&&(D=S),ae===g&&++he===l&&(H=S),(ue=ge.nextSibling)!==null)break;ge=ae,ae=ge.parentNode}ge=ue}a=D===-1||H===-1?null:{start:D,end:H}}else a=null}a||(a={start:0,end:0})}else a=null;for(th={focusedElem:t,selectionRange:a},ku=!1,kn=r;kn!==null;)if(r=kn,t=r.child,r.subtreeFlags&1028&&t!==null)t.return=r,kn=t;else for(;kn!==null;){switch(r=kn,g=r.alternate,t=r.flags,r.tag){case 0:if(t&4&&(t=r.updateQueue,t=t===null?null:t.events,t!==null))for(a=0;a<t.length;a++)h=t[a],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if(t&1024&&g!==null){t=void 0,a=r,h=g.memoizedProps,g=g.memoizedState,l=a.stateNode;try{var De=mo(a.type,h);t=l.getSnapshotBeforeUpdate(De,g),l.__reactInternalSnapshotBeforeUpdate=t}catch(Ie){Et(a,a.return,Ie)}}break;case 3:if(t&1024){if(t=r.stateNode.containerInfo,a=t.nodeType,a===9)ih(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":ih(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,kn=t;break}kn=r.return}}function Pb(t,r,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Ii(t,a),l&4&&pl(5,a);break;case 1:if(Ii(t,a),l&4)if(t=a.stateNode,r===null)try{t.componentDidMount()}catch(S){Et(a,a.return,S)}else{var h=mo(a.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(h,r,t.__reactInternalSnapshotBeforeUpdate)}catch(S){Et(a,a.return,S)}}l&64&&Cb(a),l&512&&hl(a,a.return);break;case 3:if(Ii(t,a),l&64&&(t=a.updateQueue,t!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{v1(t,r)}catch(S){Et(a,a.return,S)}}break;case 27:r===null&&l&4&&Db(a);case 26:case 5:Ii(t,a),r===null&&l&4&&Tb(a),l&512&&hl(a,a.return);break;case 12:Ii(t,a);break;case 31:Ii(t,a),l&4&&Nb(t,a);break;case 13:Ii(t,a),l&4&&Ib(t,a),l&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=oR.bind(null,a),SR(t,a))));break;case 22:if(l=a.memoizedState!==null||Li,!l){r=r!==null&&r.memoizedState!==null||ln,h=Li;var g=ln;Li=l,(ln=r)&&!g?Ai(t,a,(a.subtreeFlags&8772)!=0):Ii(t,a),Li=h,ln=g}break;case 30:break;default:Ii(t,a)}}function Mb(t){var r=t.alternate;r!==null&&(t.alternate=null,Mb(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&wn(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 Wt=null,Qn=!1;function Ni(t,r,a){for(a=a.child;a!==null;)Lb(t,r,a),a=a.sibling}function Lb(t,r,a){if(Jt&&typeof Jt.onCommitFiberUnmount=="function")try{Jt.onCommitFiberUnmount(wr,a)}catch{}switch(a.tag){case 26:ln||ci(a,r),Ni(t,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ln||ci(a,r);var l=Wt,h=Qn;xa(a.type)&&(Wt=a.stateNode,Qn=!1),Ni(t,r,a),kl(a.stateNode),Wt=l,Qn=h;break;case 5:ln||ci(a,r);case 6:if(l=Wt,h=Qn,Wt=null,Ni(t,r,a),Wt=l,Qn=h,Wt!==null)if(Qn)try{(Wt.nodeType===9?Wt.body:Wt.nodeName==="HTML"?Wt.ownerDocument.body:Wt).removeChild(a.stateNode)}catch(g){Et(a,r,g)}else try{Wt.removeChild(a.stateNode)}catch(g){Et(a,r,g)}break;case 18:Wt!==null&&(Qn?(t=Wt,E2(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ws(t)):E2(Wt,a.stateNode));break;case 4:l=Wt,h=Qn,Wt=a.stateNode.containerInfo,Qn=!0,Ni(t,r,a),Wt=l,Qn=h;break;case 0:case 11:case 14:case 15:ma(2,a,r),ln||ma(4,a,r),Ni(t,r,a);break;case 1:ln||(ci(a,r),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Eb(a,r,l)),Ni(t,r,a);break;case 21:Ni(t,r,a);break;case 22:ln=(l=ln)||a.memoizedState!==null,Ni(t,r,a),ln=l;break;default:Ni(t,r,a)}}function Nb(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ws(t)}catch(a){Et(r,r.return,a)}}}function Ib(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ws(t)}catch(a){Et(r,r.return,a)}}function YT(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new Ob),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new Ob),r;default:throw Error(s(435,t.tag))}}function ru(t,r){var a=YT(t);r.forEach(function(l){if(!a.has(l)){a.add(l);var h=sR.bind(null,t,l);l.then(h,h)}})}function Gn(t,r){var a=r.deletions;if(a!==null)for(var l=0;l<a.length;l++){var h=a[l],g=t,S=r,D=S;e:for(;D!==null;){switch(D.tag){case 27:if(xa(D.type)){Wt=D.stateNode,Qn=!1;break e}break;case 5:Wt=D.stateNode,Qn=!1;break e;case 3:case 4:Wt=D.stateNode.containerInfo,Qn=!0;break e}D=D.return}if(Wt===null)throw Error(s(160));Lb(g,S,h),Wt=null,Qn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Ab(r,t),r=r.sibling}var Qr=null;function Ab(t,r){var a=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Gn(r,t),Jn(t),l&4&&(ma(3,t,t.return),pl(3,t),ma(5,t,t.return));break;case 1:Gn(r,t),Jn(t),l&512&&(ln||a===null||ci(a,a.return)),l&64&&Li&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var h=Qr;if(Gn(r,t),Jn(t),l&512&&(ln||a===null||ci(a,a.return)),l&4){var g=a===null?null:a.memoizedState;if(l=t.memoizedState,a===null)if(l===null)if(t.stateNode===null){e:{l=t.type,a=t.memoizedProps,h=h.ownerDocument||h;t:switch(l){case"title":g=h.getElementsByTagName("title")[0],(!g||g[ut]||g[He]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=h.createElement(l),h.head.insertBefore(g,h.querySelector("head > title"))),Tn(g,l,a),g[He]=t,Xt(g),l=g;break e;case"link":var S=q2("link","href",h).get(l+(a.href||""));if(S){for(var D=0;D<S.length;D++)if(g=S[D],g.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&g.getAttribute("rel")===(a.rel==null?null:a.rel)&&g.getAttribute("title")===(a.title==null?null:a.title)&&g.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){S.splice(D,1);break t}}g=h.createElement(l),Tn(g,l,a),h.head.appendChild(g);break;case"meta":if(S=q2("meta","content",h).get(l+(a.content||""))){for(D=0;D<S.length;D++)if(g=S[D],g.getAttribute("content")===(a.content==null?null:""+a.content)&&g.getAttribute("name")===(a.name==null?null:a.name)&&g.getAttribute("property")===(a.property==null?null:a.property)&&g.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&g.getAttribute("charset")===(a.charSet==null?null:a.charSet)){S.splice(D,1);break t}}g=h.createElement(l),Tn(g,l,a),h.head.appendChild(g);break;default:throw Error(s(468,l))}g[He]=t,Xt(g),l=g}t.stateNode=l}else j2(h,t.type,t.stateNode);else t.stateNode=A2(h,l,t.memoizedProps);else g===l?l===null&&t.stateNode!==null&&Pp(t,t.memoizedProps,a.memoizedProps):(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,l===null?j2(h,t.type,t.stateNode):A2(h,l,t.memoizedProps))}break;case 27:Gn(r,t),Jn(t),l&512&&(ln||a===null||ci(a,a.return)),a!==null&&l&4&&Pp(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Gn(r,t),Jn(t),l&512&&(ln||a===null||ci(a,a.return)),t.flags&32){h=t.stateNode;try{xi(h,"")}catch(De){Et(t,t.return,De)}}l&4&&t.stateNode!=null&&(h=t.memoizedProps,Pp(t,h,a===null?h:a.memoizedProps)),l&1024&&(Np=!0);break;case 6:if(Gn(r,t),Jn(t),l&4){if(t.stateNode===null)throw Error(s(162));l=t.memoizedProps,a=t.stateNode;try{a.nodeValue=l}catch(De){Et(t,t.return,De)}}break;case 3:if(bu=null,h=Qr,Qr=yu(r.containerInfo),Gn(r,t),Qr=h,Jn(t),l&4&&a!==null&&a.memoizedState.isDehydrated)try{ws(r.containerInfo)}catch(De){Et(t,t.return,De)}Np&&(Np=!1,qb(t));break;case 4:l=Qr,Qr=yu(t.stateNode.containerInfo),Gn(r,t),Jn(t),Qr=l;break;case 12:Gn(r,t),Jn(t);break;case 31:Gn(r,t),Jn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,ru(t,l)));break;case 13:Gn(r,t),Jn(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(au=Ut()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,ru(t,l)));break;case 22:h=t.memoizedState!==null;var H=a!==null&&a.memoizedState!==null,ne=Li,he=ln;if(Li=ne||h,ln=he||H,Gn(r,t),ln=he,Li=ne,Jn(t),l&8192)e:for(r=t.stateNode,r._visibility=h?r._visibility&-2:r._visibility|1,h&&(a===null||H||Li||ln||go(t)),a=null,r=t;;){if(r.tag===5||r.tag===26){if(a===null){H=a=r;try{if(g=H.stateNode,h)S=g.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{D=H.stateNode;var ge=H.memoizedProps.style,ae=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;D.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(De){Et(H,H.return,De)}}}else if(r.tag===6){if(a===null){H=r;try{H.stateNode.nodeValue=h?"":H.memoizedProps}catch(De){Et(H,H.return,De)}}}else if(r.tag===18){if(a===null){H=r;try{var ue=H.stateNode;h?T2(ue,!0):T2(H.stateNode,!1)}catch(De){Et(H,H.return,De)}}}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;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=t.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,ru(t,a))));break;case 19:Gn(r,t),Jn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,ru(t,l)));break;case 30:break;case 21:break;default:Gn(r,t),Jn(t)}}function Jn(t){var r=t.flags;if(r&2){try{for(var a,l=t.return;l!==null;){if(Rb(l)){a=l;break}l=l.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var h=a.stateNode;nu(t,Mp(t),h);break;case 5:var g=a.stateNode;a.flags&32&&(xi(g,""),a.flags&=-33),nu(t,Mp(t),g);break;case 3:case 4:var S=a.stateNode.containerInfo;Lp(t,Mp(t),S);break;default:throw Error(s(161))}}catch(D){Et(t,t.return,D)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function qb(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;qb(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Ii(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Pb(t,r.alternate,r),r=r.sibling}function go(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:ma(4,r,r.return),go(r);break;case 1:ci(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&Eb(r,r.return,a),go(r);break;case 27:kl(r.stateNode);case 26:case 5:ci(r,r.return),go(r);break;case 22:r.memoizedState===null&&go(r);break;case 30:go(r);break;default:go(r)}t=t.sibling}}function Ai(t,r,a){for(a&&(a=(r.subtreeFlags&8772)!=0),r=r.child;r!==null;){var l=r.alternate,h=t,g=r,S=g.flags;switch(g.tag){case 0:case 11:case 15:Ai(h,g,a),pl(4,g);break;case 1:if(Ai(h,g,a),l=g,h=l.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(ne){Et(l,l.return,ne)}if(l=g,h=l.updateQueue,h!==null){var D=l.stateNode;try{var H=h.shared.hiddenCallbacks;if(H!==null)for(h.shared.hiddenCallbacks=null,h=0;h<H.length;h++)y1(H[h],D)}catch(ne){Et(l,l.return,ne)}}a&&S&64&&Cb(g),hl(g,g.return);break;case 27:Db(g);case 26:case 5:Ai(h,g,a),a&&l===null&&S&4&&Tb(g),hl(g,g.return);break;case 12:Ai(h,g,a);break;case 31:Ai(h,g,a),a&&S&4&&Nb(h,g);break;case 13:Ai(h,g,a),a&&S&4&&Ib(h,g);break;case 22:g.memoizedState===null&&Ai(h,g,a),hl(g,g.return);break;case 30:break;default:Ai(h,g,a)}r=r.sibling}}function Ip(t,r){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&el(a))}function Ap(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&el(t))}function Gr(t,r,a,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)jb(t,r,a,l),r=r.sibling}function jb(t,r,a,l){var h=r.flags;switch(r.tag){case 0:case 11:case 15:Gr(t,r,a,l),h&2048&&pl(9,r);break;case 1:Gr(t,r,a,l);break;case 3:Gr(t,r,a,l),h&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&el(t)));break;case 12:if(h&2048){Gr(t,r,a,l),t=r.stateNode;try{var g=r.memoizedProps,S=g.id,D=g.onPostCommit;typeof D=="function"&&D(S,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(H){Et(r,r.return,H)}}else Gr(t,r,a,l);break;case 31:Gr(t,r,a,l);break;case 13:Gr(t,r,a,l);break;case 23:break;case 22:g=r.stateNode,S=r.alternate,r.memoizedState===null?g._visibility&2?Gr(t,r,a,l):(g._visibility|=2,cs(t,r,a,l,(r.subtreeFlags&10256)!=0||!1)):g._visibility&2?Gr(t,r,a,l):ml(t,r),h&2048&&Ip(S,r);break;case 24:Gr(t,r,a,l),h&2048&&Ap(r.alternate,r);break;default:Gr(t,r,a,l)}}function cs(t,r,a,l,h){for(h&&(h=(r.subtreeFlags&10256)!=0||!1),r=r.child;r!==null;){var g=t,S=r,D=a,H=l,ne=S.flags;switch(S.tag){case 0:case 11:case 15:cs(g,S,D,H,h),pl(8,S);break;case 23:break;case 22:var he=S.stateNode;S.memoizedState===null?(he._visibility|=2,cs(g,S,D,H,h)):he._visibility&2?cs(g,S,D,H,h):ml(g,S),h&&ne&2048&&Ip(S.alternate,S);break;case 24:cs(g,S,D,H,h),h&&ne&2048&&Ap(S.alternate,S);break;default:cs(g,S,D,H,h)}r=r.sibling}}function ml(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=t,l=r,h=l.flags;switch(l.tag){case 22:ml(a,l),h&2048&&Ip(l.alternate,l);break;case 24:ml(a,l),h&2048&&Ap(l.alternate,l);break;default:ml(a,l)}r=r.sibling}}var gl=8192;function us(t,r,a){if(t.subtreeFlags&gl)for(t=t.child;t!==null;)zb(t,r,a),t=t.sibling}function zb(t,r,a){switch(t.tag){case 26:us(t,r,a),t.flags&gl&&t.memoizedState!==null&&AR(a,Qr,t.memoizedState,t.memoizedProps);break;case 5:us(t,r,a);break;case 3:case 4:var l=Qr;Qr=yu(t.stateNode.containerInfo),us(t,r,a),Qr=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=gl,gl=16777216,us(t,r,a),gl=l):us(t,r,a));break;default:us(t,r,a)}}function Fb(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 yl(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];kn=l,Hb(l,t)}Fb(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Bb(t),t=t.sibling}function Bb(t){switch(t.tag){case 0:case 11:case 15:yl(t),t.flags&2048&&ma(9,t,t.return);break;case 3:yl(t);break;case 12:yl(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,iu(t)):yl(t);break;default:yl(t)}}function iu(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];kn=l,Hb(l,t)}Fb(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:ma(8,r,r.return),iu(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,iu(r));break;default:iu(r)}t=t.sibling}}function Hb(t,r){for(;kn!==null;){var a=kn;switch(a.tag){case 0:case 11:case 15:ma(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:el(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,kn=l;else e:for(a=t;kn!==null;){l=kn;var h=l.sibling,g=l.return;if(Mb(l),l===a){kn=null;break e}if(h!==null){h.return=g,kn=h;break e}kn=g}}}var ZT={getCacheForType:function(t){var r=Cn(an),a=r.data.get(t);return a===void 0&&(a=t(),r.data.set(t,a)),a},cacheSignal:function(){return Cn(an).controller.signal}},eR=typeof WeakMap=="function"?WeakMap:Map,yt=0,It=null,tt=null,it=0,Ct=0,pr=null,ga=!1,ds=!1,qp=!1,qi=0,Gt=0,ya=0,yo=0,jp=0,hr=0,fs=0,vl=null,Xn=null,zp=!1,au=0,Vb=0,ou=1/0,su=null,va=null,hn=0,ba=null,ps=null,ji=0,Fp=0,Bp=null,$b=null,bl=0,Hp=null;function Rr(){return yt&2&&it!==0?it&-it:se.T===null?te():Qp()}function Wb(){if(hr===0)if(!(it&536870912)||st){var t=St;St<<=1,!(St&3932160)&&(St=262144),hr=t}else hr=536870912;return t=dr.current,t!==null&&(t.flags|=32),hr}function Yn(t,r,a){(t===It&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)&&(hs(t,0),wa(t,it,hr,!1)),Ln(t,a),(!(yt&2)||t!==It)&&(t===It&&(!(yt&2)&&(yo|=a),Gt===4&&wa(t,it,hr,!1)),zi(t))}function Ub(t,r,a){if(yt&6)throw Error(s(327));var l=!a&&(r&127)==0&&(r&t.expiredLanes)===0||bn(t,r),h=l?rR(t,r):$p(t,r,!0),g=l;do{if(h===0){ds&&!l&&wa(t,r,0,!1);break}else{if(a=t.current.alternate,g&&!tR(a)){h=$p(t,r,!1),g=!1;continue}if(h===2){if(g=r,t.errorRecoveryDisabledLanes&g)var S=0;else S=t.pendingLanes&-536870913,S=S===0?S&536870912?536870912:0:S;if(S!==0){r=S;e:{var D=t;h=vl;var H=D.current.memoizedState.isDehydrated;if(H&&(hs(D,S).flags|=256),S=$p(D,S,!1),S!==2){if(qp&&!H){D.errorRecoveryDisabledLanes|=g,yo|=g,h=4;break e}g=Xn,Xn=h,g!==null&&(Xn===null?Xn=g:Xn.push.apply(Xn,g))}h=S}if(g=!1,h!==2)continue}}if(h===1){hs(t,0),wa(t,r,0,!0);break}e:{switch(l=t,g=h,g){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:wa(l,r,hr,!ga);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(h=au+300-Ut(),10<h)){if(wa(l,r,hr,!ga),Hr(l,0,!0)!==0)break e;ji=r,l.timeoutHandle=S2(Kb.bind(null,l,a,Xn,su,zp,r,hr,yo,fs,ga,g,"Throttled",-0,0),h);break e}Kb(l,a,Xn,su,zp,r,hr,yo,fs,ga,g,null,-0,0)}}break}while(!0);zi(t)}function Kb(t,r,a,l,h,g,S,D,H,ne,he,ge,ae,ue){if(t.timeoutHandle=-1,ge=r.subtreeFlags,ge&8192||(ge&16785408)==16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xr},zb(r,g,ge);var De=(g&62914560)===g?au-Ut():(g&4194048)===g?Vb-Ut():0;if(De=qR(ge,De),De!==null){ji=g,t.cancelPendingCommit=De(t2.bind(null,t,r,g,a,l,h,S,D,H,he,ge,null,ae,ue)),wa(t,g,S,!ne);return}}t2(t,r,g,a,l,h,S,D,H)}function tR(t){for(var r=t;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var h=a[l],g=h.getSnapshot;h=h.value;try{if(!cr(g(),h))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;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 wa(t,r,a,l){r&=~jp,r&=~yo,t.suspendedLanes|=r,t.pingedLanes&=~r,l&&(t.warmLanes|=r),l=t.expirationTimes;for(var h=r;0<h;){var g=31-gt(h),S=1<<g;l[g]=-1,h&=~S}a!==0&&zn(t,a,r)}function lu(){return yt&6?!0:(wl(0,!1),!1)}function Vp(){if(tt!==null){if(Ct===0)var t=tt.return;else t=tt,Ti=ao=null,ap(t),is=null,nl=0,t=tt;for(;t!==null;)Sb(t.alternate,t),t=t.return;tt=null}}function hs(t,r){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,bR(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),ji=0,Vp(),It=t,tt=a=Ci(t.current,null),it=r,Ct=0,pr=null,ga=!1,ds=bn(t,r),qp=!1,fs=hr=jp=yo=ya=Gt=0,Xn=vl=null,zp=!1,r&8&&(r|=r&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=r;0<l;){var h=31-gt(l),g=1<<h;r|=t[h],l&=~g}return qi=r,Dc(),a}function Qb(t,r){Ke=null,se.H=ul,r===rs||r===qc?(r=p1(),Ct=3):r===Kf?(r=p1(),Ct=4):Ct=r===_p?8:typeof r=="object"&&r&&typeof r.then=="function"?6:1,pr=r,tt===null&&(Gt=1,Xc(t,Sr(r,t.current)))}function Gb(){var t=dr.current;return t===null?!0:(it&4194048)===it?Kr===null:(it&62914560)===it||it&536870912?t===Kr:!1}function Jb(){var t=se.H;return se.H=ul,t===null?ul:t}function Xb(){var t=se.A;return se.A=ZT,t}function cu(){Gt=4,ga||(it&4194048)!==it&&dr.current!==null||(ds=!0),!(ya&134217727)&&!(yo&134217727)||It===null||wa(It,it,hr,!1)}function $p(t,r,a){var l=yt;yt|=2;var h=Jb(),g=Xb();(It!==t||it!==r)&&(su=null,hs(t,r)),r=!1;var S=Gt;e:do try{if(Ct!==0&&tt!==null){var D=tt,H=pr;switch(Ct){case 8:Vp(),S=6;break e;case 3:case 2:case 9:case 6:dr.current===null&&(r=!0);var ne=Ct;if(Ct=0,pr=null,ms(t,D,H,ne),a&&ds){S=0;break e}break;default:ne=Ct,Ct=0,pr=null,ms(t,D,H,ne)}}nR(),S=Gt;break}catch(he){Qb(t,he)}while(!0);return r&&t.shellSuspendCounter++,Ti=ao=null,yt=l,se.H=h,se.A=g,tt===null&&(It=null,it=0,Dc()),S}function nR(){for(;tt!==null;)Yb(tt)}function rR(t,r){var a=yt;yt|=2;var l=Jb(),h=Xb();It!==t||it!==r?(su=null,ou=Ut()+500,hs(t,r)):ds=bn(t,r);e:do try{if(Ct!==0&&tt!==null){r=tt;var g=pr;t:switch(Ct){case 1:Ct=0,pr=null,ms(t,r,g,1);break;case 2:case 9:if(d1(g)){Ct=0,pr=null,Zb(r);break}r=function(){Ct!==2&&Ct!==9||It!==t||(Ct=7),zi(t)},g.then(r,r);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:d1(g)?(Ct=0,pr=null,Zb(r)):(Ct=0,pr=null,ms(t,r,g,7));break;case 5:var S=null;switch(tt.tag){case 26:S=tt.memoizedState;case 5:case 27:var D=tt;if(S?z2(S):D.stateNode.complete){Ct=0,pr=null;var H=D.sibling;if(H!==null)tt=H;else{var ne=D.return;ne===null?tt=null:(tt=ne,uu(ne))}break t}}Ct=0,pr=null,ms(t,r,g,5);break;case 6:Ct=0,pr=null,ms(t,r,g,6);break;case 8:Vp(),Gt=6;break e;default:throw Error(s(462))}}iR();break}catch(he){Qb(t,he)}while(!0);return Ti=ao=null,se.H=l,se.A=h,yt=a,tt===null?(It=null,it=0,Dc(),Gt):0}function iR(){for(;tt!==null&&!ta();)Yb(tt)}function Yb(t){var r=xb(t.alternate,t,qi);t.memoizedProps=t.pendingProps,r===null?uu(t):tt=r}function Zb(t){var r=t,a=r.alternate;switch(r.tag){case 15:case 0:r=gb(a,r,r.pendingProps,r.type,void 0,it);break;case 11:r=gb(a,r,r.pendingProps,r.type.render,r.ref,it);break;case 5:ap(r);default:Sb(a,r),r=tt=e1(r,qi),r=xb(a,r,qi)}t.memoizedProps=t.pendingProps,r===null?uu(t):tt=r}function ms(t,r,a,l){Ti=ao=null,ap(r),is=null,nl=0;var h=r.return;try{if(UT(t,h,r,a,it)){Gt=1,Xc(t,Sr(a,t.current)),tt=null;return}}catch(g){if(h!==null)throw tt=h,g;Gt=1,Xc(t,Sr(a,t.current)),tt=null;return}r.flags&32768?(st||l===1?t=!0:ds||it&536870912?t=!1:(ga=t=!0,(l===2||l===9||l===3||l===6)&&(l=dr.current,l!==null&&l.tag===13&&(l.flags|=16384))),e2(r,t)):uu(r)}function uu(t){var r=t;do{if(r.flags&32768){e2(r,ga);return}t=r.return;var a=GT(r.alternate,r,qi);if(a!==null){tt=a;return}if(r=r.sibling,r!==null){tt=r;return}tt=r=t}while(r!==null);Gt===0&&(Gt=5)}function e2(t,r){do{var a=JT(t.alternate,t);if(a!==null){a.flags&=32767,tt=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(t=t.sibling,t!==null)){tt=t;return}tt=t=a}while(t!==null);Gt=6,tt=null}function t2(t,r,a,l,h,g,S,D,H){t.cancelPendingCommit=null;do du();while(hn!==0);if(yt&6)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(g=r.lanes|r.childLanes,g|=Mf,wi(t,a,g,S,D,H),t===It&&(tt=It=null,it=0),ps=r,ba=t,ji=a,Fp=g,Bp=h,$b=l,r.subtreeFlags&10256||r.flags&10256?(t.callbackNode=null,t.callbackPriority=0,lR(zt,function(){return o2(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(r.flags&13878)!=0,r.subtreeFlags&13878||l){l=se.T,se.T=null,h=Q.p,Q.p=2,S=yt,yt|=4;try{XT(t,r,a)}finally{yt=S,Q.p=h,se.T=l}}hn=1,n2(),r2(),i2()}}function n2(){if(hn===1){hn=0;var t=ba,r=ps,a=(r.flags&13878)!=0;if(r.subtreeFlags&13878||a){a=se.T,se.T=null;var l=Q.p;Q.p=2;var h=yt;yt|=4;try{Ab(r,t);var g=th,S=Wv(t.containerInfo),D=g.focusedElem,H=g.selectionRange;if(S!==D&&D&&D.ownerDocument&&$v(D.ownerDocument.documentElement,D)){if(H!==null&&Tf(D)){var ne=H.start,he=H.end;if(he===void 0&&(he=ne),"selectionStart"in D)D.selectionStart=ne,D.selectionEnd=Math.min(he,D.value.length);else{var ge=D.ownerDocument||document,ae=ge&&ge.defaultView||window;if(ae.getSelection){var ue=ae.getSelection(),De=D.textContent.length,Ie=Math.min(H.start,De),Ot=H.end===void 0?Ie:Math.min(H.end,De);!ue.extend&&Ie>Ot&&(S=Ot,Ot=Ie,Ie=S);var G=Vv(D,Ie),U=Vv(D,Ot);if(G&&U&&(ue.rangeCount!==1||ue.anchorNode!==G.node||ue.anchorOffset!==G.offset||ue.focusNode!==U.node||ue.focusOffset!==U.offset)){var ee=ge.createRange();ee.setStart(G.node,G.offset),ue.removeAllRanges(),Ie>Ot?(ue.addRange(ee),ue.extend(U.node,U.offset)):(ee.setEnd(U.node,U.offset),ue.addRange(ee))}}}}for(ge=[],ue=D;ue=ue.parentNode;)ue.nodeType===1&&ge.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<ge.length;D++){var me=ge[D];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}ku=!!eh,th=eh=null}finally{yt=h,Q.p=l,se.T=a}}t.current=r,hn=2}}function r2(){if(hn===2){hn=0;var t=ba,r=ps,a=(r.flags&8772)!=0;if(r.subtreeFlags&8772||a){a=se.T,se.T=null;var l=Q.p;Q.p=2;var h=yt;yt|=4;try{Pb(t,r.alternate,r)}finally{yt=h,Q.p=l,se.T=a}}hn=3}}function i2(){if(hn===4||hn===3){hn=0,gi();var t=ba,r=ps,a=ji,l=$b;r.subtreeFlags&10256||r.flags&10256?hn=5:(hn=0,ps=ba=null,a2(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(va=null),j(a),r=r.stateNode,Jt&&typeof Jt.onCommitFiberRoot=="function")try{Jt.onCommitFiberRoot(wr,r,void 0,(r.current.flags&128)==128)}catch{}if(l!==null){r=se.T,h=Q.p,Q.p=2,se.T=null;try{for(var g=t.onRecoverableError,S=0;S<l.length;S++){var D=l[S];g(D.value,{componentStack:D.stack})}}finally{se.T=r,Q.p=h}}ji&3&&du(),zi(t),h=t.pendingLanes,a&261930&&h&42?t===Hp?bl++:(bl=0,Hp=t):bl=0,wl(0,!1)}}function a2(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,el(r)))}function du(){return n2(),r2(),i2(),o2()}function o2(){if(hn!==5)return!1;var t=ba,r=Fp;Fp=0;var a=j(ji),l=se.T,h=Q.p;try{Q.p=32>a?32:a,se.T=null,a=Bp,Bp=null;var g=ba,S=ji;if(hn=0,ps=ba=null,ji=0,yt&6)throw Error(s(331));var D=yt;if(yt|=4,Bb(g.current),jb(g,g.current,S,a),yt=D,wl(0,!1),Jt&&typeof Jt.onPostCommitFiberRoot=="function")try{Jt.onPostCommitFiberRoot(wr,g)}catch{}return!0}finally{Q.p=h,se.T=l,a2(t,r)}}function s2(t,r,a){r=Sr(a,r),r=wp(t.stateNode,r,2),t=po(t,r,2),t!==null&&(Ln(t,2),zi(t))}function Et(t,r,a){if(t.tag===3)s2(t,t,a);else for(;r!==null;){if(r.tag===3){s2(r,t,a);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(va===null||!va.has(l))){t=Sr(a,t),a=lb(2),l=po(r,a,2),l!==null&&(cb(a,l,r,t),Ln(l,2),zi(l));break}}r=r.return}}function Wp(t,r,a){var l=t.pingCache;if(l===null){l=t.pingCache=new eR;var h=new Set;l.set(r,h)}else h=l.get(r),h===void 0&&(h=new Set,l.set(r,h));h.has(a)||(qp=!0,h.add(a),t=aR.bind(null,t,r,a),r.then(t,t))}function aR(t,r,a){var l=t.pingCache;l!==null&&l.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,It===t&&(it&a)===a&&(Gt===4||Gt===3&&(it&62914560)===it&&300>Ut()-au?!(yt&2)&&hs(t,0):jp|=a,fs===it&&(fs=0)),zi(t)}function l2(t,r){r===0&&(r=bi()),t=no(t,r),t!==null&&(Ln(t,r),zi(t))}function oR(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),l2(t,a)}function sR(t,r){var a=0;switch(t.tag){case 31:case 13:var l=t.stateNode,h=t.memoizedState;h!==null&&(a=h.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),l2(t,a)}function lR(t,r){return Pn(t,r)}var fu=null,gs=null,Up=!1,pu=!1,Kp=!1,_a=0;function zi(t){t!==gs&&t.next===null&&(gs===null?fu=gs=t:gs=gs.next=t),pu=!0,Up||(Up=!0,uR())}function wl(t,r){if(!Kp&&pu){Kp=!0;do for(var a=!1,l=fu;l!==null;){if(!r)if(t!==0){var h=l.pendingLanes;if(h===0)var g=0;else{var S=l.suspendedLanes,D=l.pingedLanes;g=(1<<31-gt(42|t)+1)-1,g&=h&~(S&~D),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,f2(l,g))}else g=it,g=Hr(l,l===It?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),!(g&3)||bn(l,g)||(a=!0,f2(l,g));l=l.next}while(a);Kp=!1}}function cR(){c2()}function c2(){pu=Up=!1;var t=0;_a!==0&&vR()&&(t=_a);for(var r=Ut(),a=null,l=fu;l!==null;){var h=l.next,g=u2(l,r);g===0?(l.next=null,a===null?fu=h:a.next=h,h===null&&(gs=a)):(a=l,(t!==0||g&3)&&(pu=!0)),l=h}hn!==0&&hn!==5||wl(t,!1),_a!==0&&(_a=0)}function u2(t,r){for(var a=t.suspendedLanes,l=t.pingedLanes,h=t.expirationTimes,g=t.pendingLanes&-62914561;0<g;){var S=31-gt(g),D=1<<S,H=h[S];H===-1?((D&a)===0||(D&l)!==0)&&(h[S]=ar(D,r)):H<=r&&(t.expiredLanes|=D),g&=~D}if(r=It,a=it,a=Hr(t,t===r?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,a===0||t===r&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&dn(l),t.callbackNode=null,t.callbackPriority=0;if(!(a&3)||bn(t,a)){if(r=a&-a,r===t.callbackPriority)return r;switch(l!==null&&dn(l),j(a)){case 2:case 8:a=ni;break;case 32:a=zt;break;case 268435456:a=_t;break;default:a=zt}return l=d2.bind(null,t),a=Pn(a,l),t.callbackPriority=r,t.callbackNode=a,r}return l!==null&&l!==null&&dn(l),t.callbackPriority=2,t.callbackNode=null,2}function d2(t,r){if(hn!==0&&hn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(du()&&t.callbackNode!==a)return null;var l=it;return l=Hr(t,t===It?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(Ub(t,l,r),u2(t,Ut()),t.callbackNode!=null&&t.callbackNode===a?d2.bind(null,t):null)}function f2(t,r){if(du())return null;Ub(t,r,!0)}function uR(){wR(function(){yt&6?Pn(fn,cR):c2()})}function Qp(){if(_a===0){var t=ts;t===0&&(t=_r,_r<<=1,!(_r&261888)&&(_r=256)),_a=t}return _a}function p2(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Vo(""+t)}function h2(t,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,t.id&&a.setAttribute("form",t.id),r.parentNode.insertBefore(a,r),t=new FormData(t),a.parentNode.removeChild(a),t}function dR(t,r,a,l,h){if(r==="submit"&&a&&a.stateNode===h){var g=p2((h[Ve]||null).action),S=l.submitter;S&&(r=(r=S[Ve]||null)?p2(r.formAction):S.getAttribute("formAction"),r!==null&&(g=r,S=null));var D=new u("action","action",null,l,h);t.push({event:D,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(_a!==0){var H=S?h2(h,S):new FormData(h);hp(a,{pending:!0,data:H,method:h.method,action:g},null,H)}}else typeof g=="function"&&(D.preventDefault(),H=S?h2(h,S):new FormData(h),hp(a,{pending:!0,data:H,method:h.method,action:g},g,H))},currentTarget:h}]})}}for(var Gp=0;Gp<Pf.length;Gp++){var Jp=Pf[Gp];Ur(Jp.toLowerCase(),"on"+(Jp[0].toUpperCase()+Jp.slice(1)))}Ur(Qv,"onAnimationEnd"),Ur(Gv,"onAnimationIteration"),Ur(Jv,"onAnimationStart"),Ur("dblclick","onDoubleClick"),Ur("focusin","onFocus"),Ur("focusout","onBlur"),Ur(ET,"onTransitionRun"),Ur(TT,"onTransitionStart"),Ur(RT,"onTransitionCancel"),Ur(Xv,"onTransitionEnd"),ia("onMouseEnter",["mouseout","mouseover"]),ia("onMouseLeave",["mouseout","mouseover"]),ia("onPointerEnter",["pointerout","pointerover"]),ia("onPointerLeave",["pointerout","pointerover"]),ai("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ai("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ai("onBeforeInput",["compositionend","keypress","textInput","paste"]),ai("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ai("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ai("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _l="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(" "),fR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_l));function m2(t,r){r=(r&4)!=0;for(var a=0;a<t.length;a++){var l=t[a],h=l.event;l=l.listeners;e:{var g=void 0;if(r)for(var S=l.length-1;0<=S;S--){var D=l[S],H=D.instance,ne=D.currentTarget;if(D=D.listener,H!==g&&h.isPropagationStopped())break e;g=D,h.currentTarget=ne;try{g(h)}catch(he){Rc(he)}h.currentTarget=null,g=H}else for(S=0;S<l.length;S++){if(D=l[S],H=D.instance,ne=D.currentTarget,D=D.listener,H!==g&&h.isPropagationStopped())break e;g=D,h.currentTarget=ne;try{g(h)}catch(he){Rc(he)}h.currentTarget=null,g=H}}}}function nt(t,r){var a=r[Mt];a===void 0&&(a=r[Mt]=new Set);var l=t+"__bubble";a.has(l)||(y2(r,t,2,!1),a.add(l))}function Xp(t,r,a){var l=0;r&&(l|=4),y2(a,t,l,r)}var hu="_reactListening"+Math.random().toString(36).slice(2);function g2(t){if(!t[hu]){t[hu]=!0,Fs.forEach(function(a){a!=="selectionchange"&&(fR.has(a)||Xp(a,!1,t),Xp(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[hu]||(r[hu]=!0,Xp("selectionchange",!1,r))}}function y2(t,r,a,l){switch($2(r)){case 2:var h=HR;break;case 8:h=VR;break;default:h=fh}a=h.bind(null,r,a,t),h=void 0,!Ws||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(h=!0),l?h===void 0?t.addEventListener(r,a,!0):t.addEventListener(r,a,{capture:!0,passive:h}):h===void 0?t.addEventListener(r,a,!1):t.addEventListener(r,a,{passive:h})}function Yp(t,r,a,l,h){var g=l;if(!(r&1)&&!(r&2)&&l!==null)e:for(;;){if(l===null)return;var S=l.tag;if(S===3||S===4){var D=l.stateNode.containerInfo;if(D===h)break;if(S===4)for(S=l.return;S!==null;){var H=S.tag;if((H===3||H===4)&&S.stateNode.containerInfo===h)return;S=S.return}for(;D!==null;){if(S=sr(D),S===null)return;if(H=S.tag,H===5||H===6||H===26||H===27){l=g=S;continue e}D=D.parentNode}}l=l.return}Sc(function(){var ne=g,he=Vs(a),ge=[];e:{var ae=Yv.get(t);if(ae!==void 0){var ue=u,De=t;switch(t){case"keypress":if(Xa(a)===0)break e;case"keydown":case"keyup":ue=Re;break;case"focusin":De="focus",ue=z;break;case"focusout":De="blur",ue=z;break;case"beforeblur":case"afterblur":ue=z;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=O;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=L;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=dt;break;case Qv:case Gv:case Jv:ue=q;break;case Xv:ue=Je;break;case"scroll":case"scrollend":ue=v;break;case"wheel":ue=Nt;break;case"copy":case"cut":case"paste":ue=oe;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=Ne;break;case"toggle":case"beforetoggle":ue=Ft}var Ie=(r&4)!=0,Ot=!Ie&&(t==="scroll"||t==="scrollend"),G=Ie?ae===null?null:ae+"Capture":ae;Ie=[];for(var U=ne,ee;U!==null;){var me=U;if(ee=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ee===null||G===null||(me=Qa(U,G),me!=null&&Ie.push(xl(U,me,ee))),Ot)break;U=U.return}0<Ie.length&&(ae=new ue(ae,De,null,a,he),ge.push({event:ae,listeners:Ie}))}}if(!(r&7)){e:{if(ae=t==="mouseover"||t==="pointerover",ue=t==="mouseout"||t==="pointerout",ae&&a!==_n&&(De=a.relatedTarget||a.fromElement)&&(sr(De)||De[ot]))break e;if((ue||ae)&&(ae=he.window===he?he:(ae=he.ownerDocument)?ae.defaultView||ae.parentWindow:window,ue?(De=a.relatedTarget||a.toElement,ue=ne,De=De?sr(De):null,De!==null&&(Ot=d(De),Ie=De.tag,De!==Ot||Ie!==5&&Ie!==27&&Ie!==6)&&(De=null)):(ue=null,De=ne),ue!==De)){if(Ie=O,me="onMouseLeave",G="onMouseEnter",U="mouse",(t==="pointerout"||t==="pointerover")&&(Ie=Ne,me="onPointerLeave",G="onPointerEnter",U="pointer"),Ot=ue==null?ae:Fn(ue),ee=De==null?ae:Fn(De),ae=new Ie(me,U+"leave",ue,a,he),ae.target=Ot,ae.relatedTarget=ee,me=null,sr(he)===ne&&(Ie=new Ie(G,U+"enter",De,a,he),Ie.target=ee,Ie.relatedTarget=Ot,me=Ie),Ot=me,ue&&De)t:{for(Ie=pR,G=ue,U=De,ee=0,me=G;me;me=Ie(me))ee++;me=0;for(var Me=U;Me;Me=Ie(Me))me++;for(;0<ee-me;)G=Ie(G),ee--;for(;0<me-ee;)U=Ie(U),me--;for(;ee--;){if(G===U||U!==null&&G===U.alternate){Ie=G;break t}G=Ie(G),U=Ie(U)}Ie=null}else Ie=null;ue!==null&&v2(ge,ae,ue,Ie,!1),De!==null&&Ot!==null&&v2(ge,Ot,De,Ie,!0)}}e:{if(ae=ne?Fn(ne):window,ue=ae.nodeName&&ae.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ae.type==="file")var vt=qv;else if(Iv(ae))if(jv)vt=kT;else{vt=_T;var Oe=wT}else ue=ae.nodeName,!ue||ue.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?ne&&Ka(ne.elementType)&&(vt=qv):vt=xT;if(vt&&(vt=vt(t,ne))){Av(ge,vt,a,he);break e}Oe&&Oe(t,ae,ne),t==="focusout"&&ne&&ae.type==="number"&&ne.memoizedProps.value!=null&&_i(ae,"number",ae.value)}switch(Oe=ne?Fn(ne):window,t){case"focusin":(Iv(Oe)||Oe.contentEditable==="true")&&(Ko=Oe,Rf=ne,Xs=null);break;case"focusout":Xs=Rf=Ko=null;break;case"mousedown":Df=!0;break;case"contextmenu":case"mouseup":case"dragend":Df=!1,Uv(ge,a,he);break;case"selectionchange":if(CT)break;case"keydown":case"keyup":Uv(ge,a,he)}var Qe;if($e)e:{switch(t){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else Uo?Ec(t,a)&&(at="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(at="onCompositionStart");at&&(pn&&a.locale!=="ko"&&(Uo||at!=="onCompositionStart"?at==="onCompositionEnd"&&Uo&&(Qe=Us()):(Wr=he,$o="value"in Wr?Wr.value:Wr.textContent,Uo=!0)),Oe=mu(ne,at),0<Oe.length&&(at=new ie(at,t,null,a,he),ge.push({event:at,listeners:Oe}),Qe?at.data=Qe:(Qe=Wo(a),Qe!==null&&(at.data=Qe)))),(Qe=rn?gT(t,a):yT(t,a))&&(at=mu(ne,"onBeforeInput"),0<at.length&&(Oe=new ie("onBeforeInput","beforeinput",null,a,he),ge.push({event:Oe,listeners:at}),Oe.data=Qe)),dR(ge,t,ne,a,he)}m2(ge,r)})}function xl(t,r,a){return{instance:t,listener:r,currentTarget:a}}function mu(t,r){for(var a=r+"Capture",l=[];t!==null;){var h=t,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=Qa(t,a),h!=null&&l.unshift(xl(t,h,g)),h=Qa(t,r),h!=null&&l.push(xl(t,h,g))),t.tag===3)return l;t=t.return}return[]}function pR(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function v2(t,r,a,l,h){for(var g=r._reactName,S=[];a!==null&&a!==l;){var D=a,H=D.alternate,ne=D.stateNode;if(D=D.tag,H!==null&&H===l)break;D!==5&&D!==26&&D!==27||ne===null||(H=ne,h?(ne=Qa(a,g),ne!=null&&S.unshift(xl(a,ne,H))):h||(ne=Qa(a,g),ne!=null&&S.push(xl(a,ne,H)))),a=a.return}S.length!==0&&t.push({event:r,listeners:S})}var hR=/\r\n?/g,mR=/\u0000|\uFFFD/g;function b2(t){return(typeof t=="string"?t:""+t).replace(hR,`
10
- `).replace(mR,"")}function w2(t,r){return r=b2(r),b2(t)===r}function Dt(t,r,a,l,h,g){switch(a){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||xi(t,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&xi(t,""+l);break;case"className":Ua(t,"class",l);break;case"tabIndex":Ua(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Ua(t,a,l);break;case"style":_c(t,l,g);break;case"data":if(r!=="object"){Ua(t,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||a!=="href")){t.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=Vo(""+l),t.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(a,"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 g=="function"&&(a==="formAction"?(r!=="input"&&Dt(t,r,"name",h.name,h,null),Dt(t,r,"formEncType",h.formEncType,h,null),Dt(t,r,"formMethod",h.formMethod,h,null),Dt(t,r,"formTarget",h.formTarget,h,null)):(Dt(t,r,"encType",h.encType,h,null),Dt(t,r,"method",h.method,h,null),Dt(t,r,"target",h.target,h,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=Vo(""+l),t.setAttribute(a,l);break;case"onClick":l!=null&&(t.onclick=xr);break;case"onScroll":l!=null&&nt("scroll",t);break;case"onScrollEnd":l!=null&&nt("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(h.children!=null)throw Error(s(60));t.innerHTML=a}}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}a=Vo(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);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(a,""+l):t.removeAttribute(a);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(a,""):t.removeAttribute(a);break;case"capture":case"download":l===!0?t.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,l):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(a,l):t.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(a):t.setAttribute(a,l);break;case"popover":nt("beforetoggle",t),nt("toggle",t),Wa(t,"popover",l);break;case"xlinkActuate":Vr(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Vr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Vr(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Vr(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Vr(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Vr(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Vr(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Vr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Vr(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Wa(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Ho.get(a)||a,Wa(t,a,l))}}function Zp(t,r,a,l,h,g){switch(a){case"style":_c(t,l,g);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(h.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"children":typeof l=="string"?xi(t,l):(typeof l=="number"||typeof l=="bigint")&&xi(t,""+l);break;case"onScroll":l!=null&&nt("scroll",t);break;case"onScrollEnd":l!=null&&nt("scrollend",t);break;case"onClick":l!=null&&(t.onclick=xr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!gc.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(h=a.endsWith("Capture"),r=a.slice(2,h?a.length-7:void 0),g=t[Ve]||null,g=g==null?null:g[a],typeof g=="function"&&t.removeEventListener(r,g,h),typeof l=="function")){typeof g!="function"&&g!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(r,l,h);break e}a in t?t[a]=l:l===!0?t.setAttribute(a,""):Wa(t,a,l)}}}function Tn(t,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":nt("error",t),nt("load",t);var l=!1,h=!1,g;for(g in a)if(a.hasOwnProperty(g)){var S=a[g];if(S!=null)switch(g){case"src":l=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Dt(t,r,g,S,a,null)}}h&&Dt(t,r,"srcSet",a.srcSet,a,null),l&&Dt(t,r,"src",a.src,a,null);return;case"input":nt("invalid",t);var D=g=S=h=null,H=null,ne=null;for(l in a)if(a.hasOwnProperty(l)){var he=a[l];if(he!=null)switch(l){case"name":h=he;break;case"type":S=he;break;case"checked":H=he;break;case"defaultChecked":ne=he;break;case"value":g=he;break;case"defaultValue":D=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(s(137,r));break;default:Dt(t,r,l,he,a,null)}}wc(t,g,D,H,ne,S,h,!1);return;case"select":for(h in nt("invalid",t),l=S=g=null,a)if(a.hasOwnProperty(h)&&(D=a[h],D!=null))switch(h){case"value":g=D;break;case"defaultValue":S=D;break;case"multiple":l=D;default:Dt(t,r,h,D,a,null)}r=g,a=S,t.multiple=!!l,r==null?a!=null&&oa(t,!!l,a,!0):oa(t,!!l,r,!1);return;case"textarea":for(S in nt("invalid",t),g=h=l=null,a)if(a.hasOwnProperty(S)&&(D=a[S],D!=null))switch(S){case"value":l=D;break;case"defaultValue":h=D;break;case"children":g=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(s(91));break;default:Dt(t,r,S,D,a,null)}Bo(t,l,h,g);return;case"option":for(H in a)a.hasOwnProperty(H)&&(l=a[H],l!=null)&&(H==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":Dt(t,r,H,l,a,null));return;case"dialog":nt("beforetoggle",t),nt("toggle",t),nt("cancel",t),nt("close",t);break;case"iframe":case"object":nt("load",t);break;case"video":case"audio":for(l=0;l<_l.length;l++)nt(_l[l],t);break;case"image":nt("error",t),nt("load",t);break;case"details":nt("toggle",t);break;case"embed":case"source":case"link":nt("error",t),nt("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(ne in a)if(a.hasOwnProperty(ne)&&(l=a[ne],l!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Dt(t,r,ne,l,a,null)}return;default:if(Ka(r)){for(he in a)a.hasOwnProperty(he)&&(l=a[he],l!==void 0&&Zp(t,r,he,l,a,void 0));return}}for(D in a)a.hasOwnProperty(D)&&(l=a[D],l!=null&&Dt(t,r,D,l,a,null))}function gR(t,r,a,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,g=null,S=null,D=null,H=null,ne=null,he=null;for(ue in a){var ge=a[ue];if(a.hasOwnProperty(ue)&&ge!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":H=ge;default:l.hasOwnProperty(ue)||Dt(t,r,ue,null,l,ge)}}for(var ae in l){var ue=l[ae];if(ge=a[ae],l.hasOwnProperty(ae)&&(ue!=null||ge!=null))switch(ae){case"type":g=ue;break;case"name":h=ue;break;case"checked":ne=ue;break;case"defaultChecked":he=ue;break;case"value":S=ue;break;case"defaultValue":D=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(s(137,r));break;default:ue!==ge&&Dt(t,r,ae,ue,l,ge)}}aa(t,S,D,H,ne,he,g,h);return;case"select":for(g in ue=S=D=ae=null,a)if(H=a[g],a.hasOwnProperty(g)&&H!=null)switch(g){case"value":break;case"multiple":ue=H;default:l.hasOwnProperty(g)||Dt(t,r,g,null,l,H)}for(h in l)if(g=l[h],H=a[h],l.hasOwnProperty(h)&&(g!=null||H!=null))switch(h){case"value":ae=g;break;case"defaultValue":D=g;break;case"multiple":S=g;default:g!==H&&Dt(t,r,h,g,l,H)}r=D,a=S,l=ue,ae==null?!!l!=!!a&&(r==null?oa(t,!!a,a?[]:"",!1):oa(t,!!a,r,!0)):oa(t,!!a,ae,!1);return;case"textarea":for(D in ue=ae=null,a)if(h=a[D],a.hasOwnProperty(D)&&h!=null&&!l.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:Dt(t,r,D,null,l,h)}for(S in l)if(h=l[S],g=a[S],l.hasOwnProperty(S)&&(h!=null||g!=null))switch(S){case"value":ae=h;break;case"defaultValue":ue=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(s(91));break;default:h!==g&&Dt(t,r,S,h,l,g)}sa(t,ae,ue);return;case"option":for(var De in a)ae=a[De],a.hasOwnProperty(De)&&ae!=null&&!l.hasOwnProperty(De)&&(De==="selected"?t.selected=!1:Dt(t,r,De,null,l,ae));for(H in l)ae=l[H],ue=a[H],l.hasOwnProperty(H)&&ae!==ue&&(ae!=null||ue!=null)&&(H==="selected"?t.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":Dt(t,r,H,ae,l,ue));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 Ie in a)ae=a[Ie],a.hasOwnProperty(Ie)&&ae!=null&&!l.hasOwnProperty(Ie)&&Dt(t,r,Ie,null,l,ae);for(ne in l)if(ae=l[ne],ue=a[ne],l.hasOwnProperty(ne)&&ae!==ue&&(ae!=null||ue!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(s(137,r));break;default:Dt(t,r,ne,ae,l,ue)}return;default:if(Ka(r)){for(var Ot in a)ae=a[Ot],a.hasOwnProperty(Ot)&&ae!==void 0&&!l.hasOwnProperty(Ot)&&Zp(t,r,Ot,void 0,l,ae);for(he in l)ae=l[he],ue=a[he],!l.hasOwnProperty(he)||ae===ue||ae===void 0&&ue===void 0||Zp(t,r,he,ae,l,ue);return}}for(var G in a)ae=a[G],a.hasOwnProperty(G)&&ae!=null&&!l.hasOwnProperty(G)&&Dt(t,r,G,null,l,ae);for(ge in l)ae=l[ge],ue=a[ge],!l.hasOwnProperty(ge)||ae===ue||ae==null&&ue==null||Dt(t,r,ge,ae,l,ue)}function _2(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function yR(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var h=a[l],g=h.transferSize,S=h.initiatorType,D=h.duration;if(g&&D&&_2(S)){for(S=0,D=h.responseEnd,l+=1;l<a.length;l++){var H=a[l],ne=H.startTime;if(ne>D)break;var he=H.transferSize,ge=H.initiatorType;he&&_2(ge)&&(H=H.responseEnd,S+=he*(H<D?1:(D-ne)/(H-ne)))}if(--l,r+=8*(g+S)/(h.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 eh=null,th=null;function gu(t){return t.nodeType===9?t:t.ownerDocument}function x2(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 k2(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 nh(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 rh=null;function vR(){var t=window.event;return t&&t.type==="popstate"?t===rh?!1:(rh=t,!0):(rh=null,!1)}var S2=typeof setTimeout=="function"?setTimeout:void 0,bR=typeof clearTimeout=="function"?clearTimeout:void 0,C2=typeof Promise=="function"?Promise:void 0,wR=typeof queueMicrotask=="function"?queueMicrotask:C2===void 0?S2:function(t){return C2.resolve(null).then(t).catch(_R)};function _R(t){setTimeout(function(){throw t})}function xa(t){return t==="head"}function E2(t,r){var a=r,l=0;do{var h=a.nextSibling;if(t.removeChild(a),h&&h.nodeType===8)if(a=h.data,a==="/$"||a==="/&"){if(l===0){t.removeChild(h),ws(r);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")kl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,kl(a);for(var g=a.firstChild;g;){var S=g.nextSibling,D=g.nodeName;g[ut]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&g.rel.toLowerCase()==="stylesheet"||a.removeChild(g),g=S}}else a==="body"&&kl(t.ownerDocument.body);a=h}while(a);ws(r)}function T2(t,r){var a=t;t=0;do{var l=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=l}while(a)}function ih(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":ih(a),wn(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function xR(t,r,a,l){for(;t.nodeType===1;){var h=a;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[ut])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(g=t.getAttribute("rel"),g==="stylesheet"&&t.hasAttribute("data-precedence")||g!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(g=t.getAttribute("src"),(g!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&g&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var g=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===g)return t}else return t;if(t=Dr(t.nextSibling),t===null)break}return null}function kR(t,r,a){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Dr(t.nextSibling),t===null))return null;return t}function R2(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Dr(t.nextSibling),t===null))return null;return t}function ah(t){return t.data==="$?"||t.data==="$~"}function oh(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function SR(t,r){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||a.readyState!=="loading")r();else{var l=function(){r(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function Dr(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 sh=null;function D2(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(r===0)return Dr(t.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}t=t.nextSibling}return null}function O2(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return t;r--}else a!=="/$"&&a!=="/&"||r++}t=t.previousSibling}return null}function P2(t,r,a){switch(r=gu(a),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 kl(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);wn(t)}var Or=new Map,M2=new Set;function yu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Fi=Q.d;Q.d={f:CR,r:ER,D:TR,C:RR,L:DR,m:OR,X:MR,S:PR,M:LR};function CR(){var t=Fi.f(),r=lu();return t||r}function ER(t){var r=ii(t);r!==null&&r.tag===5&&r.type==="form"?X1(r):Fi.r(t)}var ys=typeof document>"u"?null:document;function L2(t,r,a){var l=ys;if(l&&typeof r=="string"&&r){var h=lr(r);h='link[rel="'+t+'"][href="'+h+'"]',typeof a=="string"&&(h+='[crossorigin="'+a+'"]'),M2.has(h)||(M2.add(h),t={rel:t,crossOrigin:a,href:r},l.querySelector(h)===null&&(r=l.createElement("link"),Tn(r,"link",t),Xt(r),l.head.appendChild(r)))}}function TR(t){Fi.D(t),L2("dns-prefetch",t,null)}function RR(t,r){Fi.C(t,r),L2("preconnect",t,r)}function DR(t,r,a){Fi.L(t,r,a);var l=ys;if(l&&t&&r){var h='link[rel="preload"][as="'+lr(r)+'"]';r==="image"&&a&&a.imageSrcSet?(h+='[imagesrcset="'+lr(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(h+='[imagesizes="'+lr(a.imageSizes)+'"]')):h+='[href="'+lr(t)+'"]';var g=h;switch(r){case"style":g=vs(t);break;case"script":g=bs(t)}Or.has(g)||(t=C({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:t,as:r},a),Or.set(g,t),l.querySelector(h)!==null||r==="style"&&l.querySelector(Sl(g))||r==="script"&&l.querySelector(Cl(g))||(r=l.createElement("link"),Tn(r,"link",t),Xt(r),l.head.appendChild(r)))}}function OR(t,r){Fi.m(t,r);var a=ys;if(a&&t){var l=r&&typeof r.as=="string"?r.as:"script",h='link[rel="modulepreload"][as="'+lr(l)+'"][href="'+lr(t)+'"]',g=h;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=bs(t)}if(!Or.has(g)&&(t=C({rel:"modulepreload",href:t},r),Or.set(g,t),a.querySelector(h)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Cl(g)))return}l=a.createElement("link"),Tn(l,"link",t),Xt(l),a.head.appendChild(l)}}}function PR(t,r,a){Fi.S(t,r,a);var l=ys;if(l&&t){var h=ra(l).hoistableStyles,g=vs(t);r||(r="default");var S=h.get(g);if(!S){var D={loading:0,preload:null};if(S=l.querySelector(Sl(g)))D.loading=5;else{t=C({rel:"stylesheet",href:t,"data-precedence":r},a),(a=Or.get(g))&&lh(t,a);var H=S=l.createElement("link");Xt(H),Tn(H,"link",t),H._p=new Promise(function(ne,he){H.onload=ne,H.onerror=he}),H.addEventListener("load",function(){D.loading|=1}),H.addEventListener("error",function(){D.loading|=2}),D.loading|=4,vu(S,r,l)}S={type:"stylesheet",instance:S,count:1,state:D},h.set(g,S)}}}function MR(t,r){Fi.X(t,r);var a=ys;if(a&&t){var l=ra(a).hoistableScripts,h=bs(t),g=l.get(h);g||(g=a.querySelector(Cl(h)),g||(t=C({src:t,async:!0},r),(r=Or.get(h))&&ch(t,r),g=a.createElement("script"),Xt(g),Tn(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(h,g))}}function LR(t,r){Fi.M(t,r);var a=ys;if(a&&t){var l=ra(a).hoistableScripts,h=bs(t),g=l.get(h);g||(g=a.querySelector(Cl(h)),g||(t=C({src:t,async:!0,type:"module"},r),(r=Or.get(h))&&ch(t,r),g=a.createElement("script"),Xt(g),Tn(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(h,g))}}function N2(t,r,a,l){var h=(h=mt.current)?yu(h):null;if(!h)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=vs(a.href),a=ra(h).hoistableStyles,l=a.get(r),l||(l={type:"style",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=vs(a.href);var g=ra(h).hoistableStyles,S=g.get(t);if(S||(h=h.ownerDocument||h,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(t,S),(g=h.querySelector(Sl(t)))&&!g._p&&(S.instance=g,S.state.loading=5),Or.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Or.set(t,a),g||NR(h,t,a,S.state))),r&&l===null)throw Error(s(528,""));return S}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=bs(a),a=ra(h).hoistableScripts,l=a.get(r),l||(l={type:"script",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function vs(t){return'href="'+lr(t)+'"'}function Sl(t){return'link[rel="stylesheet"]['+t+"]"}function I2(t){return C({},t,{"data-precedence":t.precedence,precedence:null})}function NR(t,r,a,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}),Tn(r,"link",a),Xt(r),t.head.appendChild(r))}function bs(t){return'[src="'+lr(t)+'"]'}function Cl(t){return"script[async]"+t}function A2(t,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var l=t.querySelector('style[data-href~="'+lr(a.href)+'"]');if(l)return r.instance=l,Xt(l),l;var h=C({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Xt(l),Tn(l,"style",h),vu(l,a.precedence,t),r.instance=l;case"stylesheet":h=vs(a.href);var g=t.querySelector(Sl(h));if(g)return r.state.loading|=4,r.instance=g,Xt(g),g;l=I2(a),(h=Or.get(h))&&lh(l,h),g=(t.ownerDocument||t).createElement("link"),Xt(g);var S=g;return S._p=new Promise(function(D,H){S.onload=D,S.onerror=H}),Tn(g,"link",l),r.state.loading|=4,vu(g,a.precedence,t),r.instance=g;case"script":return g=bs(a.src),(h=t.querySelector(Cl(g)))?(r.instance=h,Xt(h),h):(l=a,(h=Or.get(g))&&(l=C({},a),ch(l,h)),t=t.ownerDocument||t,h=t.createElement("script"),Xt(h),Tn(h,"link",l),t.head.appendChild(h),r.instance=h);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,vu(l,a.precedence,t));return r.instance}function vu(t,r,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=l.length?l[l.length-1]:null,g=h,S=0;S<l.length;S++){var D=l[S];if(D.dataset.precedence===r)g=D;else if(g!==h)break}g?g.parentNode.insertBefore(t,g.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(t,r.firstChild))}function lh(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.title??(t.title=r.title)}function ch(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.integrity??(t.integrity=r.integrity)}var bu=null;function q2(t,r,a){if(bu===null){var l=new Map,h=bu=new Map;h.set(a,l)}else h=bu,l=h.get(a),l||(l=new Map,h.set(a,l));if(l.has(t))return l;for(l.set(t,null),a=a.getElementsByTagName(t),h=0;h<a.length;h++){var g=a[h];if(!(g[ut]||g[He]||t==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var S=g.getAttribute(r)||"";S=t+S;var D=l.get(S);D?D.push(g):l.set(S,[g])}}return l}function j2(t,r,a){t=t.ownerDocument||t,t.head.insertBefore(a,r==="title"?t.querySelector("head > title"):null)}function IR(t,r,a){if(a===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 z2(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function AR(t,r,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&!(a.state.loading&4)){if(a.instance===null){var h=vs(l.href),g=r.querySelector(Sl(h));if(g){r=g._p,typeof r=="object"&&r&&typeof r.then=="function"&&(t.count++,t=wu.bind(t),r.then(t,t)),a.state.loading|=4,a.instance=g,Xt(g);return}g=r.ownerDocument||r,l=I2(l),(h=Or.get(h))&&lh(l,h),g=g.createElement("link"),Xt(g);var S=g;S._p=new Promise(function(D,H){S.onload=D,S.onerror=H}),Tn(g,"link",l),a.instance=g}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,r),(r=a.state.preload)&&!(a.state.loading&3)&&(t.count++,a=wu.bind(t),r.addEventListener("load",a),r.addEventListener("error",a))}}var uh=0;function qR(t,r){return t.stylesheets&&t.count===0&&xu(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var l=setTimeout(function(){if(t.stylesheets&&xu(t,t.stylesheets),t.unsuspend){var g=t.unsuspend;t.unsuspend=null,g()}},6e4+r);0<t.imgBytes&&uh===0&&(uh=62500*yR());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&xu(t,t.stylesheets),t.unsuspend)){var g=t.unsuspend;t.unsuspend=null,g()}},(t.imgBytes>uh?50:800)+r);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(h)}}:null}function wu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var _u=null;function xu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,_u=new Map,r.forEach(jR,t),_u=null,wu.call(t))}function jR(t,r){if(!(r.state.loading&4)){var a=_u.get(t);if(a)var l=a.get(null);else{a=new Map,_u.set(t,a);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var S=h[g];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(a.set(S.dataset.precedence,S),l=S)}l&&a.set(null,l)}h=r.instance,S=h.getAttribute("data-precedence"),g=a.get(S)||l,g===l&&a.set(null,h),a.set(S,h),this.count++,l=wu.bind(this),h.addEventListener("load",l),h.addEventListener("error",l),g?g.parentNode.insertBefore(h,g.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),r.state.loading|=4}}var El={$$typeof:K,Provider:null,Consumer:null,_currentValue:Le,_currentValue2:Le,_threadCount:0};function zR(t,r,a,l,h,g,S,D,H){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=ri(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ri(0),this.hiddenUpdates=ri(null),this.identifierPrefix=l,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function FR(t,r,a,l,h,g,S,D,H,ne,he,ge){return t=new zR(t,r,a,S,H,ne,he,ge,D),r=1,g===!0&&(r|=24),g=ur(3,null,null,r),t.current=g,g.stateNode=t,r=$f(),r.refCount++,t.pooledCache=r,r.refCount++,g.memoizedState={element:l,isDehydrated:a,cache:r},Qf(g),t}function BR(t){return t?(t=Jo,t):Jo}function F2(t,r,a,l,h,g){h=BR(h),l.context===null?l.context=h:l.pendingContext=h,l=fo(r),l.payload={element:a},g=g===void 0?null:g,g!==null&&(l.callback=g),a=po(t,l,r),a!==null&&(Yn(a,t,r),il(a,t,r))}function B2(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function dh(t,r){B2(t,r),(t=t.alternate)&&B2(t,r)}function H2(t){if(t.tag===13||t.tag===31){var r=no(t,67108864);r!==null&&Yn(r,t,67108864),dh(t,67108864)}}function V2(t){if(t.tag===13||t.tag===31){var r=Rr();r=Ye(r);var a=no(t,r);a!==null&&Yn(a,t,r),dh(t,r)}}var ku=!0;function HR(t,r,a,l){var h=se.T;se.T=null;var g=Q.p;try{Q.p=2,fh(t,r,a,l)}finally{Q.p=g,se.T=h}}function VR(t,r,a,l){var h=se.T;se.T=null;var g=Q.p;try{Q.p=8,fh(t,r,a,l)}finally{Q.p=g,se.T=h}}function fh(t,r,a,l){if(ku){var h=ph(l);if(h===null)Yp(t,r,l,Su,a),W2(t,l);else if(WR(h,t,r,a,l))l.stopPropagation();else if(W2(t,l),r&4&&-1<$R.indexOf(t)){for(;h!==null;){var g=ii(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var S=Mn(g.pendingLanes);if(S!==0){var D=g;for(D.pendingLanes|=2,D.entangledLanes|=2;S;){var H=1<<31-gt(S);D.entanglements[1]|=H,S&=~H}zi(g),!(yt&6)&&(ou=Ut()+500,wl(0,!1))}}break;case 31:case 13:D=no(g,2),D!==null&&Yn(D,g,2),lu(),dh(g,2)}if(g=ph(l),g===null&&Yp(t,r,l,Su,a),g===h)break;h=g}h!==null&&l.stopPropagation()}else Yp(t,r,l,null,a)}}function ph(t){return t=Vs(t),hh(t)}var Su=null;function hh(t){if(Su=null,t=sr(t),t!==null){var r=d(t);if(r===null)t=null;else{var a=r.tag;if(a===13){if(t=f(r),t!==null)return t;t=null}else if(a===31){if(t=p(r),t!==null)return t;t=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return Su=t,null}function $2(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(yi()){case fn:return 2;case ni:return 8;case zt:case Br:return 32;case _t:return 268435456;default:return 32}default:return 32}}var mh=!1,ka=null,Sa=null,Ca=null,Tl=new Map,Rl=new Map,Ea=[],$R="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 W2(t,r){switch(t){case"focusin":case"focusout":ka=null;break;case"dragenter":case"dragleave":Sa=null;break;case"mouseover":case"mouseout":Ca=null;break;case"pointerover":case"pointerout":Tl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rl.delete(r.pointerId)}}function Dl(t,r,a,l,h,g){return t===null||t.nativeEvent!==g?(t={blockedOn:r,domEventName:a,eventSystemFlags:l,nativeEvent:g,targetContainers:[h]},r!==null&&(r=ii(r),r!==null&&H2(r)),t):(t.eventSystemFlags|=l,r=t.targetContainers,h!==null&&r.indexOf(h)===-1&&r.push(h),t)}function WR(t,r,a,l,h){switch(r){case"focusin":return ka=Dl(ka,t,r,a,l,h),!0;case"dragenter":return Sa=Dl(Sa,t,r,a,l,h),!0;case"mouseover":return Ca=Dl(Ca,t,r,a,l,h),!0;case"pointerover":var g=h.pointerId;return Tl.set(g,Dl(Tl.get(g)||null,t,r,a,l,h)),!0;case"gotpointercapture":return g=h.pointerId,Rl.set(g,Dl(Rl.get(g)||null,t,r,a,l,h)),!0}return!1}function U2(t){var r=sr(t.target);if(r!==null){var a=d(r);if(a!==null){if(r=a.tag,r===13){if(r=f(a),r!==null){t.blockedOn=r,ve(t.priority,function(){V2(a)});return}}else if(r===31){if(r=p(a),r!==null){t.blockedOn=r,ve(t.priority,function(){V2(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Cu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=ph(t.nativeEvent);if(a===null){a=t.nativeEvent;var l=new a.constructor(a.type,a);_n=l,a.target.dispatchEvent(l),_n=null}else return r=ii(a),r!==null&&H2(r),t.blockedOn=a,!1;r.shift()}return!0}function K2(t,r,a){Cu(t)&&a.delete(r)}function UR(){mh=!1,ka!==null&&Cu(ka)&&(ka=null),Sa!==null&&Cu(Sa)&&(Sa=null),Ca!==null&&Cu(Ca)&&(Ca=null),Tl.forEach(K2),Rl.forEach(K2)}function Eu(t,r){t.blockedOn===r&&(t.blockedOn=null,mh||(mh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,UR)))}var Tu=null;function Q2(t){Tu!==t&&(Tu=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Tu===t&&(Tu=null);for(var r=0;r<t.length;r+=3){var a=t[r],l=t[r+1],h=t[r+2];if(typeof l!="function"){if(hh(l||a)===null)continue;break}var g=ii(a);g!==null&&(t.splice(r,3),r-=3,hp(g,{pending:!0,data:h,method:a.method,action:l},l,h))}}))}function ws(t){function r(H){return Eu(H,t)}ka!==null&&Eu(ka,t),Sa!==null&&Eu(Sa,t),Ca!==null&&Eu(Ca,t),Tl.forEach(r),Rl.forEach(r);for(var a=0;a<Ea.length;a++){var l=Ea[a];l.blockedOn===t&&(l.blockedOn=null)}for(;0<Ea.length&&(a=Ea[0],a.blockedOn===null);)U2(a),a.blockedOn===null&&Ea.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var h=a[l],g=a[l+1],S=h[Ve]||null;if(typeof g=="function")S||Q2(a);else if(S){var D=null;if(g&&g.hasAttribute("formAction")){if(h=g,S=g[Ve]||null)D=S.formAction;else if(hh(h)!==null)continue}else D=S.action;typeof D=="function"?a[l+1]=D:(a.splice(l,3),l-=3),Q2(a)}}}function KR(){function t(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(S){return h=S})},focusReset:"manual",scroll:"manual"})}function r(){h!==null&&(h(),h=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),h!==null&&(h(),h=null)}}}function gh(t){this._internalRoot=t}yh.prototype.render=gh.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var a=r.current;F2(a,Rr(),t,r,null,null)},yh.prototype.unmount=gh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;F2(t.current,2,null,t,null,null),lu(),r[ot]=null}};function yh(t){this._internalRoot=t}yh.prototype.unstable_scheduleHydration=function(t){if(t){var r=te();t={blockedOn:null,target:t,priority:r};for(var a=0;a<Ea.length&&r!==0&&r<Ea[a].priority;a++);Ea.splice(a,0,t),a===0&&U2(t)}};var G2=i.version;if(G2!=="19.2.3")throw Error(s(527,G2,"19.2.3"));Q.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=w(r),t=t===null?null:_(t),t=t===null?null:t.stateNode,t};var QR={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:se,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ru=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ru.isDisabled&&Ru.supportsFiber)try{wr=Ru.inject(QR),Jt=Ru}catch{}}e.createRoot=function(t,r){if(!c(t))throw Error(s(299));var a=!1,l="",h=VT,g=$T,S=WT;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=FR(t,1,!1,null,null,a,l,null,h,g,S,KR),t[ot]=r.current,g2(t),new gh(r)}})),nd=Ce(((e,n)=>{function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(o){console.error(o)}}i(),n.exports=Na()})),Fm="Expected a function";function kx(e,n){var i;if(typeof n!="function")throw TypeError(Fm);return e=c4(e),function(){return--e>0&&(i=n.apply(this,arguments)),e<=1&&(n=void 0),i}}var Sx=kx;function Cx(e){return Sx(2,e)}let Bm;_m=Cx,Bm=Math.max;function Ex(e){if(!(e&&e.length))return[];var n=0;return e=u4(e,function(i){if(d4(i))return n=Bm(i.length,n),!0}),s4(n,function(i){return l4(e,v4(i))})}var Tx=f4(Ex);Em=function(e,n){if(e==null)throw Error(n||`Expected value but got ${e}`)},BigInt.prototype.toJSON=function(){return JSON.rawJSON(this.toString())},Pm=function(e){try{return JSON.parse(e,(n,i)=>yd(i))}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,i)=>typeof i=="string"?i==="\u25D0NaN\u25D0"?NaN:i==="\u25D0Infinity\u25D0"?1/0:i==="\u25D0-Infinity\u25D0"?-1/0:yd(i):yd(i))}catch{return{}}};function Rx(e,n){return e==null?"":typeof e=="number"&&!Number.isNaN(e)?e.toLocaleString(n,{useGrouping:!1,maximumFractionDigits:20}):String(e)}S_=function(e,n){if(e.length===0)return"";let i=Object.keys(e[0]),o=e.map(s=>i.map(c=>Rx(s[c],n)).join(" "));return`${i.join(" ")}
9
+ `+l.stack}}var br=Object.prototype.hasOwnProperty,Pn=n.unstable_scheduleCallback,dn=n.unstable_cancelCallback,ta=n.unstable_shouldYield,gi=n.unstable_requestPaint,Ut=n.unstable_now,yi=n.unstable_getCurrentPriorityLevel,fn=n.unstable_ImmediatePriority,ni=n.unstable_UserBlockingPriority,zt=n.unstable_NormalPriority,Br=n.unstable_LowPriority,_t=n.unstable_IdlePriority,vi=n.log,na=n.unstable_setDisableYieldValue,wr=null,Jt=null;function Ge(t){if(typeof vi=="function"&&na(t),Jt&&typeof Jt.setStrictMode=="function")try{Jt.setStrictMode(wr,t)}catch{}}var gt=Math.clz32?Math.clz32:zn,xt=Math.log,kt=Math.LN2;function zn(t){return t>>>=0,t===0?32:31-(xt(t)/kt|0)|0}var _r=256,St=262144,ir=4194304;function Mn(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 Hr(t,r,a){var l=t.pendingLanes;if(l===0)return 0;var h=0,g=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var D=l&134217727;return D===0?(D=l&~g,D===0?S===0?a||(a=l&~t,a!==0&&(h=Mn(a))):h=Mn(S):h=Mn(D)):(l=D&~g,l===0?(S&=D,S===0?a||(a=D&~t,a!==0&&(h=Mn(a))):h=Mn(S)):h=Mn(l)),h===0?0:r!==0&&r!==h&&(r&g)===0&&(g=h&-h,a=r&-r,g>=a||g===32&&a&4194048)?r:h}function bn(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function ar(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 bi(){var t=ir;return ir<<=1,!(ir&62914560)&&(ir=4194304),t}function ri(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function Ln(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function wi(t,r,a,l,h,g){var S=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var D=t.entanglements,H=t.expirationTimes,ne=t.hiddenUpdates;for(a=S&~a;0<a;){var he=31-gt(a),ge=1<<he;D[he]=0,H[he]=-1;var ae=ne[he];if(ae!==null)for(ne[he]=null,he=0;he<ae.length;he++){var ue=ae[he];ue!==null&&(ue.lane&=-536870913)}a&=~ge}l!==0&&Fn(t,l,0),g!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=g&~(S&~r))}function Fn(t,r,a){t.pendingLanes|=r,t.suspendedLanes&=~r;var l=31-gt(r);t.entangledLanes|=r,t.entanglements[l]=t.entanglements[l]|1073741824|a&261930}function or(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var l=31-gt(a),h=1<<l;h&r|t[l]&r&&(t[l]|=r),a&=~h}}function M(t,r){var a=r&-r;return a=a&42?1:Ye(a),(a&(t.suspendedLanes|r))===0?a:0}function Ye(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 j(t){return t&=-t,2<t?8<t?t&134217727?32:268435456:8:2}function te(){var t=Q.p;return t===0?(t=window.event,t===void 0?32:$2(t.type)):t}function ve(t,r){var a=Q.p;try{return Q.p=t,r()}finally{Q.p=a}}var Te=Math.random().toString(36).slice(2),He="__reactFiber$"+Te,Ve="__reactProps$"+Te,ot="__reactContainer$"+Te,Mt="__reactEvents$"+Te,Ze="__reactListeners$"+Te,Lt="__reactHandles$"+Te,rt="__reactResources$"+Te,ut="__reactMarker$"+Te;function wn(t){delete t[He],delete t[Ve],delete t[Mt],delete t[Ze],delete t[Lt]}function sr(t){var r=t[He];if(r)return r;for(var a=t.parentNode;a;){if(r=a[ot]||a[He]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=O2(t);t!==null;){if(a=t[He])return a;t=O2(t)}return r}t=a,a=t.parentNode}return null}function ii(t){if(t=t[He]||t[ot]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Bn(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function ra(t){var r=t[rt];return r||(r=t[rt]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Xt(t){t[ut]=!0}var zs=new Set,gc={};function ai(t,r){ia(t,r),ia(t+"Capture",r)}function ia(t,r){for(gc[t]=r,t=0;t<r.length;t++)zs.add(r[t])}var xf=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]*$"),Kn={},yc={};function kf(t){return br.call(yc,t)?!0:br.call(Kn,t)?!1:xf.test(t)?yc[t]=!0:(Kn[t]=!0,!1)}function Wa(t,r,a){if(kf(r))if(a===null)t.removeAttribute(r);else{switch(typeof a){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,""+a)}}function Ua(t,r,a){if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+a)}}function Vr(t,r,a,l){if(l===null)t.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(r,a,""+l)}}function Hn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function vc(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function bc(t,r,a){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&l!==void 0&&typeof l.get=="function"&&typeof l.set=="function"){var h=l.get,g=l.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return h.call(this)},set:function(S){a=""+S,g.call(this,S)}}),Object.defineProperty(t,r,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(S){a=""+S},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Fs(t){if(!t._valueTracker){var r=vc(t)?"checked":"value";t._valueTracker=bc(t,r,""+t[r])}}function Bs(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),l="";return t&&(l=vc(t)?t.checked?"true":"false":t.value),t=l,t===a?!1:(r.setValue(t),!0)}function Nn(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 ct=/[\n"\\]/g;function lr(t){return t.replace(ct,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function aa(t,r,a,l,h,g,S,D){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),r==null?S!=="submit"&&S!=="reset"||t.removeAttribute("value"):S==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Hn(r)):t.value!==""+Hn(r)&&(t.value=""+Hn(r)),r==null?a==null?l!=null&&t.removeAttribute("value"):_i(t,S,Hn(a)):_i(t,S,Hn(r)),h==null&&g!=null&&(t.defaultChecked=!!g),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?t.name=""+Hn(D):t.removeAttribute("name")}function wc(t,r,a,l,h,g,S,D){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.type=g),r!=null||a!=null){if(!(g!=="submit"&&g!=="reset"||r!=null)){Fs(t);return}a=a==null?"":""+Hn(a),r=r==null?a:""+Hn(r),D||r===t.value||(t.value=r),t.defaultValue=r}l??(l=h),l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=D?t.checked:!!l,t.defaultChecked=!!l,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S),Fs(t)}function _i(t,r,a){r==="number"&&Nn(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function oa(t,r,a,l){if(t=t.options,r){r={};for(var h=0;h<a.length;h++)r["$"+a[h]]=!0;for(a=0;a<t.length;a++)h=r.hasOwnProperty("$"+t[a].value),t[a].selected!==h&&(t[a].selected=h),h&&l&&(t[a].defaultSelected=!0)}else{for(a=""+Hn(a),r=null,h=0;h<t.length;h++){if(t[h].value===a){t[h].selected=!0,l&&(t[h].defaultSelected=!0);return}r!==null||t[h].disabled||(r=t[h])}r!==null&&(r.selected=!0)}}function sa(t,r,a){if(r!=null&&(r=""+Hn(r),r!==t.value&&(t.value=r),a==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=a==null?"":""+Hn(a)}function Bo(t,r,a,l){if(r==null){if(l!=null){if(a!=null)throw Error(s(92));if(re(l)){if(1<l.length)throw Error(s(93));l=l[0]}a=l}a??(a=""),r=a}a=Hn(r),t.defaultValue=a,l=t.textContent,l===a&&l!==""&&l!==null&&(t.value=l),Fs(t)}function xi(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var Sf=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 ki(t,r,a){var l=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":l?t.setProperty(r,a):typeof a!="number"||a===0||Sf.has(r)?r==="float"?t.cssFloat=a:t[r]=(""+a).trim():t[r]=a+"px"}function _c(t,r,a){if(r!=null&&typeof r!="object")throw Error(s(62));if(t=t.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var h in r)l=r[h],r.hasOwnProperty(h)&&a[h]!==l&&ki(t,h,l)}else for(var g in r)r.hasOwnProperty(g)&&ki(t,g,r[g])}function Ka(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 Ho=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"]]),xc=/^[\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 Vo(t){return xc.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function xr(){}var _n=null;function Hs(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Vn=null,oi=null;function kc(t){var r=ii(t);if(r&&(t=r.stateNode)){var a=t[Ve]||null;e:switch(t=r.stateNode,r.type){case"input":if(aa(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+lr(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var l=a[r];if(l!==t&&l.form===t.form){var h=l[Ve]||null;if(!h)throw Error(s(90));aa(l,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(r=0;r<a.length;r++)l=a[r],l.form===t.form&&Bs(l)}break e;case"textarea":sa(t,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&oa(t,!!a.multiple,r,!1)}}}var Vs=!1;function Sc(t,r,a){if(Vs)return t(r,a);Vs=!0;try{return t(r)}finally{if(Vs=!1,(Vn!==null||oi!==null)&&(lu(),Vn&&(r=Vn,t=oi,oi=Vn=null,kc(r),t)))for(r=0;r<t.length;r++)kc(t[r])}}function Qa(t,r){var a=t.stateNode;if(a===null)return null;var l=a[Ve]||null;if(l===null)return null;a=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(a&&typeof a!="function")throw Error(s(231,r,typeof a));return a}var $r=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0),$s=!1;if($r)try{var Ga={};Object.defineProperty(Ga,"passive",{get:function(){$s=!0}}),window.addEventListener("test",Ga,Ga),window.removeEventListener("test",Ga,Ga)}catch{$s=!1}var Wr=null,$o=null,Ja=null;function Ws(){if(Ja)return Ja;var t,r=$o,a=r.length,l,h="value"in Wr?Wr.value:Wr.textContent,g=h.length;for(t=0;t<a&&r[t]===h[t];t++);var S=a-t;for(l=1;l<=S&&r[a-l]===h[g-l];l++);return Ja=h.slice(t,1<l?1-l:void 0)}function Xa(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 Ya(){return!0}function Us(){return!1}function xn(t){function r(a,l,h,g,S){for(var D in this._reactName=a,this._targetInst=h,this.type=l,this.nativeEvent=g,this.target=S,this.currentTarget=null,t)t.hasOwnProperty(D)&&(a=t[D],this[D]=a?a(g):g[D]);return this.isDefaultPrevented=(g.defaultPrevented==null?g.returnValue===!1:g.defaultPrevented)?Ya:Us,this.isPropagationStopped=Us,this}return C(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Ya)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ya)},persist:function(){},isPersistent:Ya}),r}var Si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},u=xn(Si),m=C({},Si,{view:0,detail:0}),v=xn(m),b,x,k,R=C({},m,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qe,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!==k&&(k&&t.type==="mousemove"?(b=t.screenX-k.screenX,x=t.screenY-k.screenY):x=b=0,k=t),b)},movementY:function(t){return"movementY"in t?t.movementY:x}}),O=xn(R),L=xn(C({},R,{dataTransfer:0})),z=xn(C({},m,{relatedTarget:0})),q=xn(C({},Si,{animationName:0,elapsedTime:0,pseudoElement:0})),oe=xn(C({},Si,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}})),ie=xn(C({},Si,{data:0})),X={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Y={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"},xe={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _e(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=xe[t])?!!r[t]:!1}function qe(){return _e}var Re=xn(C({},m,{key:function(t){if(t.key){var r=X[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Xa(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Y[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qe,charCode:function(t){return t.type==="keypress"?Xa(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Xa(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}})),Ne=xn(C({},R,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),dt=xn(C({},m,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qe})),Je=xn(C({},Si,{propertyName:0,elapsedTime:0,pseudoElement:0})),Nt=xn(C({},R,{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})),Ft=xn(C({},Si,{newState:0,oldState:0})),Ue=[9,13,27,32],$e=$r&&"CompositionEvent"in window,$t=null;$r&&"documentMode"in document&&($t=document.documentMode);var rn=$r&&"TextEvent"in window&&!$t,pn=$r&&(!$e||$t&&8<$t&&11>=$t),Za=" ",Cc=!1;function Ec(t,r){switch(t){case"keyup":return Ue.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wo(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Uo=!1;function gT(t,r){switch(t){case"compositionend":return Wo(r);case"keypress":return r.which===32?(Cc=!0,Za):null;case"textInput":return t=r.data,t===Za&&Cc?null:t;default:return null}}function yT(t,r){if(Uo)return t==="compositionend"||!$e&&Ec(t,r)?(t=Ws(),Ja=$o=Wr=null,Uo=!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 pn&&r.locale!=="ko"?null:r.data;default:return null}}var vT={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 Iv(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!vT[t.type]:r==="textarea"}function Av(t,r,a,l){Vn?oi?oi.push(l):oi=[l]:Vn=l,r=mu(r,"onChange"),0<r.length&&(a=new u("onChange","change",null,a,l),t.push({event:a,listeners:r}))}var Ks=null,Qs=null;function bT(t){m2(t,0)}function Tc(t){if(Bs(Bn(t)))return t}function qv(t,r){if(t==="change")return r}var jv=!1;if($r){var Cf;if($r){var Ef="oninput"in document;if(!Ef){var zv=document.createElement("div");zv.setAttribute("oninput","return;"),Ef=typeof zv.oninput=="function"}Cf=Ef}else Cf=!1;jv=Cf&&(!document.documentMode||9<document.documentMode)}function Fv(){Ks&&(Ks.detachEvent("onpropertychange",Bv),Qs=Ks=null)}function Bv(t){if(t.propertyName==="value"&&Tc(Qs)){var r=[];Av(r,Qs,t,Hs(t)),Sc(bT,r)}}function wT(t,r,a){t==="focusin"?(Fv(),Ks=r,Qs=a,Ks.attachEvent("onpropertychange",Bv)):t==="focusout"&&Fv()}function _T(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Tc(Qs)}function xT(t,r){if(t==="click")return Tc(r)}function kT(t,r){if(t==="input"||t==="change")return Tc(r)}function ST(t,r){return t===r&&(t!==0||1/t==1/r)||t!==t&&r!==r}var cr=typeof Object.is=="function"?Object.is:ST;function Gs(t,r){if(cr(t,r))return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var a=Object.keys(t),l=Object.keys(r);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var h=a[l];if(!br.call(r,h)||!cr(t[h],r[h]))return!1}return!0}function Hv(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Vv(t,r){var a=Hv(t);t=0;for(var l;a;){if(a.nodeType===3){if(l=t+a.textContent.length,t<=r&&l>=r)return{node:a,offset:r-t};t=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Hv(a)}}function $v(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?$v(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Wv(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Nn(t.document);r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=Nn(t.document)}return r}function Tf(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 CT=$r&&"documentMode"in document&&11>=document.documentMode,Ko=null,Rf=null,Js=null,Df=!1;function Uv(t,r,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Df||Ko==null||Ko!==Nn(l)||(l=Ko,"selectionStart"in l&&Tf(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}),Js&&Gs(Js,l)||(Js=l,l=mu(Rf,"onSelect"),0<l.length&&(r=new u("onSelect","select",null,r,a),t.push({event:r,listeners:l}),r.target=Ko)))}function eo(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var Qo={animationend:eo("Animation","AnimationEnd"),animationiteration:eo("Animation","AnimationIteration"),animationstart:eo("Animation","AnimationStart"),transitionrun:eo("Transition","TransitionRun"),transitionstart:eo("Transition","TransitionStart"),transitioncancel:eo("Transition","TransitionCancel"),transitionend:eo("Transition","TransitionEnd")},Of={},Kv={};$r&&(Kv=document.createElement("div").style,"AnimationEvent"in window||(delete Qo.animationend.animation,delete Qo.animationiteration.animation,delete Qo.animationstart.animation),"TransitionEvent"in window||delete Qo.transitionend.transition);function to(t){if(Of[t])return Of[t];if(!Qo[t])return t;var r=Qo[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in Kv)return Of[t]=r[a];return t}var Qv=to("animationend"),Gv=to("animationiteration"),Jv=to("animationstart"),ET=to("transitionrun"),TT=to("transitionstart"),RT=to("transitioncancel"),Xv=to("transitionend"),Yv=new Map,Pf="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(" ");Pf.push("scrollEnd");function Ur(t,r){Yv.set(t,r),ai(r,[t])}var Rc=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)},kr=[],Go=0,Mf=0;function Dc(){for(var t=Go,r=Mf=Go=0;r<t;){var a=kr[r];kr[r++]=null;var l=kr[r];kr[r++]=null;var h=kr[r];kr[r++]=null;var g=kr[r];if(kr[r++]=null,l!==null&&h!==null){var S=l.pending;S===null?h.next=h:(h.next=S.next,S.next=h),l.pending=h}g!==0&&Zv(a,h,g)}}function Oc(t,r,a,l){kr[Go++]=t,kr[Go++]=r,kr[Go++]=a,kr[Go++]=l,Mf|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Lf(t,r,a,l){return Oc(t,r,a,l),Pc(t)}function no(t,r){return Oc(t,null,null,r),Pc(t)}function Zv(t,r,a){t.lanes|=a;var l=t.alternate;l!==null&&(l.lanes|=a);for(var h=!1,g=t.return;g!==null;)g.childLanes|=a,l=g.alternate,l!==null&&(l.childLanes|=a),g.tag===22&&(t=g.stateNode,t===null||t._visibility&1||(h=!0)),t=g,g=g.return;return t.tag===3?(g=t.stateNode,h&&r!==null&&(h=31-gt(a),t=g.hiddenUpdates,l=t[h],l===null?t[h]=[r]:l.push(r),r.lane=a|536870912),g):null}function Pc(t){if(50<vl)throw vl=0,Hp=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Jo={};function DT(t,r,a,l){this.tag=t,this.key=a,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 ur(t,r,a,l){return new DT(t,r,a,l)}function Nf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ci(t,r){var a=t.alternate;return a===null?(a=ur(t.tag,r,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=r,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,r=t.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function e1(t,r){t.flags&=65011714;var a=t.alternate;return a===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=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,r=a.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function Mc(t,r,a,l,h,g){var S=0;if(l=t,typeof t=="function")Nf(t)&&(S=1);else if(typeof t=="string")S=IR(t,a,Ae.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case fe:return t=ur(31,a,r,h),t.elementType=fe,t.lanes=g,t;case $:return ro(a.children,h,g,r);case V:S=8,h|=24;break;case F:return t=ur(12,a,r,h|2),t.elementType=F,t.lanes=g,t;case P:return t=ur(13,a,r,h),t.elementType=P,t.lanes=g,t;case A:return t=ur(19,a,r,h),t.elementType=A,t.lanes=g,t;default:if(typeof t=="object"&&t)switch(t.$$typeof){case K:S=10;break e;case N:S=9;break e;case pe:S=11;break e;case W:S=14;break e;case de:S=16,l=null;break e}S=29,a=Error(s(130,t===null?"null":typeof t,"")),l=null}return r=ur(S,a,r,h),r.elementType=t,r.type=l,r.lanes=g,r}function ro(t,r,a,l){return t=ur(7,t,l,r),t.lanes=a,t}function If(t,r,a){return t=ur(6,t,null,r),t.lanes=a,t}function t1(t){var r=ur(18,null,null,0);return r.stateNode=t,r}function Af(t,r,a){return r=ur(4,t.children===null?[]:t.children,t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var n1=new WeakMap;function Sr(t,r){if(typeof t=="object"&&t){var a=n1.get(t);return a===void 0?(r={value:t,source:r,stack:On(r)},n1.set(t,r),r):a}return{value:t,source:r,stack:On(r)}}var Xo=[],Yo=0,Lc=null,Xs=0,Cr=[],Er=0,la=null,si=1,li="";function Ei(t,r){Xo[Yo++]=Xs,Xo[Yo++]=Lc,Lc=t,Xs=r}function r1(t,r,a){Cr[Er++]=si,Cr[Er++]=li,Cr[Er++]=la,la=t;var l=si;t=li;var h=32-gt(l)-1;l&=~(1<<h),a+=1;var g=32-gt(r)+h;if(30<g){var S=h-h%5;g=(l&(1<<S)-1).toString(32),l>>=S,h-=S,si=1<<32-gt(r)+h|a<<h|l,li=g+t}else si=1<<g|a<<h|l,li=t}function qf(t){t.return!==null&&(Ei(t,1),r1(t,1,0))}function jf(t){for(;t===Lc;)Lc=Xo[--Yo],Xo[Yo]=null,Xs=Xo[--Yo],Xo[Yo]=null;for(;t===la;)la=Cr[--Er],Cr[Er]=null,li=Cr[--Er],Cr[Er]=null,si=Cr[--Er],Cr[Er]=null}function i1(t,r){Cr[Er++]=si,Cr[Er++]=li,Cr[Er++]=la,si=r.id,li=r.overflow,la=t}var Sn=null,Bt=null,st=!1,ca=null,Tr=!1,zf=Error(s(519));function ua(t){throw Ys(Sr(Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML","")),t)),zf}function a1(t){var r=t.stateNode,a=t.type,l=t.memoizedProps;switch(r[He]=t,r[Ve]=l,a){case"dialog":nt("cancel",r),nt("close",r);break;case"iframe":case"object":case"embed":nt("load",r);break;case"video":case"audio":for(a=0;a<wl.length;a++)nt(wl[a],r);break;case"source":nt("error",r);break;case"img":case"image":case"link":nt("error",r),nt("load",r);break;case"details":nt("toggle",r);break;case"input":nt("invalid",r),wc(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":nt("invalid",r);break;case"textarea":nt("invalid",r),Bo(r,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||l.suppressHydrationWarning===!0||w2(r.textContent,a)?(l.popover!=null&&(nt("beforetoggle",r),nt("toggle",r)),l.onScroll!=null&&nt("scroll",r),l.onScrollEnd!=null&&nt("scrollend",r),l.onClick!=null&&(r.onclick=xr),r=!0):r=!1,r||ua(t,!0)}function o1(t){for(Sn=t.return;Sn;)switch(Sn.tag){case 5:case 31:case 13:Tr=!1;return;case 27:case 3:Tr=!0;return;default:Sn=Sn.return}}function Zo(t){if(t!==Sn)return!1;if(!st)return o1(t),st=!0,!1;var r=t.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||nh(t.type,t.memoizedProps)),a=!a),a&&Bt&&ua(t),o1(t),r===13){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));Bt=D2(t)}else if(r===31){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));Bt=D2(t)}else r===27?(r=Bt,xa(t.type)?(t=sh,sh=null,Bt=t):Bt=r):Bt=Sn?Dr(t.stateNode.nextSibling):null;return!0}function io(){Bt=Sn=null,st=!1}function Ff(){var t=ca;return t!==null&&(Xn===null?Xn=t:Xn.push.apply(Xn,t),ca=null),t}function Ys(t){ca===null?ca=[t]:ca.push(t)}var Bf=Be(null),ao=null,Ti=null;function da(t,r,a){Pe(Bf,r._currentValue),r._currentValue=a}function Ri(t){t._currentValue=Bf.current,je(Bf)}function Hf(t,r,a){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===a)break;t=t.return}}function Vf(t,r,a,l){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var g=h.dependencies;if(g!==null){var S=h.child;g=g.firstContext;e:for(;g!==null;){var D=g;g=h;for(var H=0;H<r.length;H++)if(D.context===r[H]){g.lanes|=a,D=g.alternate,D!==null&&(D.lanes|=a),Hf(g.return,a,t),l||(S=null);break e}g=D.next}}else if(h.tag===18){if(S=h.return,S===null)throw Error(s(341));S.lanes|=a,g=S.alternate,g!==null&&(g.lanes|=a),Hf(S,a,t),S=null}else S=h.child;if(S!==null)S.return=h;else for(S=h;S!==null;){if(S===t){S=null;break}if(h=S.sibling,h!==null){h.return=S.return,S=h;break}S=S.return}h=S}}function es(t,r,a,l){t=null;for(var h=r,g=!1;h!==null;){if(!g){if(h.flags&524288)g=!0;else if(h.flags&262144)break}if(h.tag===10){var S=h.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var D=h.type;cr(h.pendingProps.value,S.value)||(t===null?t=[D]:t.push(D))}}else if(h===Dn.current){if(S=h.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t===null?t=[Cl]:t.push(Cl))}h=h.return}t!==null&&Vf(r,t,a,l),r.flags|=262144}function Nc(t){for(t=t.firstContext;t!==null;){if(!cr(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function oo(t){ao=t,Ti=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Cn(t){return s1(ao,t)}function Ic(t,r){return ao===null&&oo(t),s1(t,r)}function s1(t,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},Ti===null){if(t===null)throw Error(s(308));Ti=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else Ti=Ti.next=r;return a}var OT=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(a,l){t.push(l)}};this.abort=function(){r.aborted=!0,t.forEach(function(a){return a()})}},PT=n.unstable_scheduleCallback,MT=n.unstable_NormalPriority,an={$$typeof:K,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $f(){return{controller:new OT,data:new Map,refCount:0}}function Zs(t){t.refCount--,t.refCount===0&&PT(MT,function(){t.controller.abort()})}var el=null,Wf=0,ts=0,ns=null;function LT(t,r){if(el===null){var a=el=[];Wf=0,ts=Qp(),ns={status:"pending",value:void 0,then:function(l){a.push(l)}}}return Wf++,r.then(l1,l1),r}function l1(){if(--Wf===0&&el!==null){ns!==null&&(ns.status="fulfilled");var t=el;el=null,ts=0,ns=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function NT(t,r){var a=[],l={status:"pending",value:null,reason:null,then:function(h){a.push(h)}};return t.then(function(){l.status="fulfilled",l.value=r;for(var h=0;h<a.length;h++)(0,a[h])(r)},function(h){for(l.status="rejected",l.reason=h,h=0;h<a.length;h++)(0,a[h])(void 0)}),l}var c1=se.S;se.S=function(t,r){Vb=Ut(),typeof r=="object"&&r&&typeof r.then=="function"&&LT(t,r),c1!==null&&c1(t,r)};var so=Be(null);function Uf(){var t=so.current;return t===null?It.pooledCache:t}function Ac(t,r){r===null?Pe(so,so.current):Pe(so,r.pool)}function u1(){var t=Uf();return t===null?null:{parent:an._currentValue,pool:t}}var rs=Error(s(460)),Kf=Error(s(474)),qc=Error(s(542)),jc={then:function(){}};function d1(t){return t=t.status,t==="fulfilled"||t==="rejected"}function f1(t,r,a){switch(a=t[a],a===void 0?t.push(r):a!==r&&(r.then(xr,xr),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,h1(t),t;default:if(typeof r.status=="string")r.then(xr,xr);else{if(t=It,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(l){if(r.status==="pending"){var h=r;h.status="fulfilled",h.value=l}},function(l){if(r.status==="pending"){var h=r;h.status="rejected",h.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,h1(t),t}throw co=r,rs}}function lo(t){try{var r=t._init;return r(t._payload)}catch(a){throw typeof a=="object"&&a&&typeof a.then=="function"?(co=a,rs):a}}var co=null;function p1(){if(co===null)throw Error(s(459));var t=co;return co=null,t}function h1(t){if(t===rs||t===qc)throw Error(s(483))}var is=null,tl=0;function zc(t){var r=tl;return tl+=1,is===null&&(is=[]),f1(is,t,r)}function nl(t,r){r=r.props.ref,t.ref=r===void 0?null:r}function Fc(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 m1(t){function r(G,U){if(t){var ee=G.deletions;ee===null?(G.deletions=[U],G.flags|=16):ee.push(U)}}function a(G,U){if(!t)return null;for(;U!==null;)r(G,U),U=U.sibling;return null}function l(G){for(var U=new Map;G!==null;)G.key===null?U.set(G.index,G):U.set(G.key,G),G=G.sibling;return U}function h(G,U){return G=Ci(G,U),G.index=0,G.sibling=null,G}function g(G,U,ee){return G.index=ee,t?(ee=G.alternate,ee===null?(G.flags|=67108866,U):(ee=ee.index,ee<U?(G.flags|=67108866,U):ee)):(G.flags|=1048576,U)}function S(G){return t&&G.alternate===null&&(G.flags|=67108866),G}function D(G,U,ee,me){return U===null||U.tag!==6?(U=If(ee,G.mode,me),U.return=G,U):(U=h(U,ee),U.return=G,U)}function H(G,U,ee,me){var Me=ee.type;return Me===$?he(G,U,ee.props.children,me,ee.key):U!==null&&(U.elementType===Me||typeof Me=="object"&&Me&&Me.$$typeof===de&&lo(Me)===U.type)?(U=h(U,ee.props),nl(U,ee),U.return=G,U):(U=Mc(ee.type,ee.key,ee.props,null,G.mode,me),nl(U,ee),U.return=G,U)}function ne(G,U,ee,me){return U===null||U.tag!==4||U.stateNode.containerInfo!==ee.containerInfo||U.stateNode.implementation!==ee.implementation?(U=Af(ee,G.mode,me),U.return=G,U):(U=h(U,ee.children||[]),U.return=G,U)}function he(G,U,ee,me,Me){return U===null||U.tag!==7?(U=ro(ee,G.mode,me,Me),U.return=G,U):(U=h(U,ee),U.return=G,U)}function ge(G,U,ee){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=If(""+U,G.mode,ee),U.return=G,U;if(typeof U=="object"&&U){switch(U.$$typeof){case T:return ee=Mc(U.type,U.key,U.props,null,G.mode,ee),nl(ee,U),ee.return=G,ee;case I:return U=Af(U,G.mode,ee),U.return=G,U;case de:return U=lo(U),ge(G,U,ee)}if(re(U)||be(U))return U=ro(U,G.mode,ee,null),U.return=G,U;if(typeof U.then=="function")return ge(G,zc(U),ee);if(U.$$typeof===K)return ge(G,Ic(G,U),ee);Fc(G,U)}return null}function ae(G,U,ee,me){var Me=U===null?null:U.key;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Me===null?D(G,U,""+ee,me):null;if(typeof ee=="object"&&ee){switch(ee.$$typeof){case T:return ee.key===Me?H(G,U,ee,me):null;case I:return ee.key===Me?ne(G,U,ee,me):null;case de:return ee=lo(ee),ae(G,U,ee,me)}if(re(ee)||be(ee))return Me===null?he(G,U,ee,me,null):null;if(typeof ee.then=="function")return ae(G,U,zc(ee),me);if(ee.$$typeof===K)return ae(G,U,Ic(G,ee),me);Fc(G,ee)}return null}function ue(G,U,ee,me,Me){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return G=G.get(ee)||null,D(U,G,""+me,Me);if(typeof me=="object"&&me){switch(me.$$typeof){case T:return G=G.get(me.key===null?ee:me.key)||null,H(U,G,me,Me);case I:return G=G.get(me.key===null?ee:me.key)||null,ne(U,G,me,Me);case de:return me=lo(me),ue(G,U,ee,me,Me)}if(re(me)||be(me))return G=G.get(ee)||null,he(U,G,me,Me,null);if(typeof me.then=="function")return ue(G,U,ee,zc(me),Me);if(me.$$typeof===K)return ue(G,U,ee,Ic(U,me),Me);Fc(U,me)}return null}function De(G,U,ee,me){for(var Me=null,vt=null,Oe=U,Qe=U=0,at=null;Oe!==null&&Qe<ee.length;Qe++){Oe.index>Qe?(at=Oe,Oe=null):at=Oe.sibling;var ht=ae(G,Oe,ee[Qe],me);if(ht===null){Oe===null&&(Oe=at);break}t&&Oe&&ht.alternate===null&&r(G,Oe),U=g(ht,U,Qe),vt===null?Me=ht:vt.sibling=ht,vt=ht,Oe=at}if(Qe===ee.length)return a(G,Oe),st&&Ei(G,Qe),Me;if(Oe===null){for(;Qe<ee.length;Qe++)Oe=ge(G,ee[Qe],me),Oe!==null&&(U=g(Oe,U,Qe),vt===null?Me=Oe:vt.sibling=Oe,vt=Oe);return st&&Ei(G,Qe),Me}for(Oe=l(Oe);Qe<ee.length;Qe++)at=ue(Oe,G,Qe,ee[Qe],me),at!==null&&(t&&at.alternate!==null&&Oe.delete(at.key===null?Qe:at.key),U=g(at,U,Qe),vt===null?Me=at:vt.sibling=at,vt=at);return t&&Oe.forEach(function(Ta){return r(G,Ta)}),st&&Ei(G,Qe),Me}function Ie(G,U,ee,me){if(ee==null)throw Error(s(151));for(var Me=null,vt=null,Oe=U,Qe=U=0,at=null,ht=ee.next();Oe!==null&&!ht.done;Qe++,ht=ee.next()){Oe.index>Qe?(at=Oe,Oe=null):at=Oe.sibling;var Ta=ae(G,Oe,ht.value,me);if(Ta===null){Oe===null&&(Oe=at);break}t&&Oe&&Ta.alternate===null&&r(G,Oe),U=g(Ta,U,Qe),vt===null?Me=Ta:vt.sibling=Ta,vt=Ta,Oe=at}if(ht.done)return a(G,Oe),st&&Ei(G,Qe),Me;if(Oe===null){for(;!ht.done;Qe++,ht=ee.next())ht=ge(G,ht.value,me),ht!==null&&(U=g(ht,U,Qe),vt===null?Me=ht:vt.sibling=ht,vt=ht);return st&&Ei(G,Qe),Me}for(Oe=l(Oe);!ht.done;Qe++,ht=ee.next())ht=ue(Oe,G,Qe,ht.value,me),ht!==null&&(t&&ht.alternate!==null&&Oe.delete(ht.key===null?Qe:ht.key),U=g(ht,U,Qe),vt===null?Me=ht:vt.sibling=ht,vt=ht);return t&&Oe.forEach(function(GR){return r(G,GR)}),st&&Ei(G,Qe),Me}function Ot(G,U,ee,me){if(typeof ee=="object"&&ee&&ee.type===$&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee){switch(ee.$$typeof){case T:e:{for(var Me=ee.key;U!==null;){if(U.key===Me){if(Me=ee.type,Me===$){if(U.tag===7){a(G,U.sibling),me=h(U,ee.props.children),me.return=G,G=me;break e}}else if(U.elementType===Me||typeof Me=="object"&&Me&&Me.$$typeof===de&&lo(Me)===U.type){a(G,U.sibling),me=h(U,ee.props),nl(me,ee),me.return=G,G=me;break e}a(G,U);break}else r(G,U);U=U.sibling}ee.type===$?(me=ro(ee.props.children,G.mode,me,ee.key),me.return=G,G=me):(me=Mc(ee.type,ee.key,ee.props,null,G.mode,me),nl(me,ee),me.return=G,G=me)}return S(G);case I:e:{for(Me=ee.key;U!==null;){if(U.key===Me)if(U.tag===4&&U.stateNode.containerInfo===ee.containerInfo&&U.stateNode.implementation===ee.implementation){a(G,U.sibling),me=h(U,ee.children||[]),me.return=G,G=me;break e}else{a(G,U);break}else r(G,U);U=U.sibling}me=Af(ee,G.mode,me),me.return=G,G=me}return S(G);case de:return ee=lo(ee),Ot(G,U,ee,me)}if(re(ee))return De(G,U,ee,me);if(be(ee)){if(Me=be(ee),typeof Me!="function")throw Error(s(150));return ee=Me.call(ee),Ie(G,U,ee,me)}if(typeof ee.then=="function")return Ot(G,U,zc(ee),me);if(ee.$$typeof===K)return Ot(G,U,Ic(G,ee),me);Fc(G,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,U!==null&&U.tag===6?(a(G,U.sibling),me=h(U,ee),me.return=G,G=me):(a(G,U),me=If(ee,G.mode,me),me.return=G,G=me),S(G)):a(G,U)}return function(G,U,ee,me){try{tl=0;var Me=Ot(G,U,ee,me);return is=null,Me}catch(Oe){if(Oe===rs||Oe===qc)throw Oe;var vt=ur(29,Oe,null,G.mode);return vt.lanes=me,vt.return=G,vt}}}var uo=m1(!0),g1=m1(!1),fa=!1;function Qf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gf(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 fo(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function po(t,r,a){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,yt&2){var h=l.pending;return h===null?r.next=r:(r.next=h.next,h.next=r),l.pending=r,r=Pc(t),Zv(t,null,a),r}return Oc(t,l,r,a),Pc(t)}function rl(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,a&4194048)){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,or(t,a)}}function Jf(t,r){var a=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var h=null,g=null;if(a=a.firstBaseUpdate,a!==null){do{var S={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};g===null?h=g=S:g=g.next=S,a=a.next}while(a!==null);g===null?h=g=r:g=g.next=r}else h=g=r;a={baseState:l.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:l.shared,callbacks:l.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}var Xf=!1;function il(){if(Xf){var t=ns;if(t!==null)throw t}}function al(t,r,a,l){Xf=!1;var h=t.updateQueue;fa=!1;var g=h.firstBaseUpdate,S=h.lastBaseUpdate,D=h.shared.pending;if(D!==null){h.shared.pending=null;var H=D,ne=H.next;H.next=null,S===null?g=ne:S.next=ne,S=H;var he=t.alternate;he!==null&&(he=he.updateQueue,D=he.lastBaseUpdate,D!==S&&(D===null?he.firstBaseUpdate=ne:D.next=ne,he.lastBaseUpdate=H))}if(g!==null){var ge=h.baseState;S=0,he=ne=H=null,D=g;do{var ae=D.lane&-536870913,ue=ae!==D.lane;if(ue?(it&ae)===ae:(l&ae)===ae){ae!==0&&ae===ts&&(Xf=!0),he!==null&&(he=he.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var De=t,Ie=D;ae=r;var Ot=a;switch(Ie.tag){case 1:if(De=Ie.payload,typeof De=="function"){ge=De.call(Ot,ge,ae);break e}ge=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Ie.payload,ae=typeof De=="function"?De.call(Ot,ge,ae):De,ae==null)break e;ge=C({},ge,ae);break e;case 2:fa=!0}}ae=D.callback,ae!==null&&(t.flags|=64,ue&&(t.flags|=8192),ue=h.callbacks,ue===null?h.callbacks=[ae]:ue.push(ae))}else ue={lane:ae,tag:D.tag,payload:D.payload,callback:D.callback,next:null},he===null?(ne=he=ue,H=ge):he=he.next=ue,S|=ae;if(D=D.next,D===null){if(D=h.shared.pending,D===null)break;ue=D,D=ue.next,ue.next=null,h.lastBaseUpdate=ue,h.shared.pending=null}}while(!0);he===null&&(H=ge),h.baseState=H,h.firstBaseUpdate=ne,h.lastBaseUpdate=he,g===null&&(h.shared.lanes=0),ya|=S,t.lanes=S,t.memoizedState=ge}}function y1(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function v1(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)y1(a[t],r)}var as=Be(null),Bc=Be(0);function b1(t,r){t=qi,Pe(Bc,t),Pe(as,r),qi=t|r.baseLanes}function Yf(){Pe(Bc,qi),Pe(as,as.current)}function Zf(){qi=Bc.current,je(as),je(Bc)}var dr=Be(null),Kr=null;function pa(t){var r=t.alternate;Pe(Yt,Yt.current&1),Pe(dr,t),Kr===null&&(r===null||as.current!==null||r.memoizedState!==null)&&(Kr=t)}function ep(t){Pe(Yt,Yt.current),Pe(dr,t),Kr===null&&(Kr=t)}function w1(t){t.tag===22?(Pe(Yt,Yt.current),Pe(dr,t),Kr===null&&(Kr=t)):ha(t)}function ha(){Pe(Yt,Yt.current),Pe(dr,dr.current)}function fr(t){je(dr),Kr===t&&(Kr=null),je(Yt)}var Yt=Be(0);function Hc(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||ah(a)||oh(a)))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 Di=0,Ke=null,Rt=null,on=null,Vc=!1,os=!1,ho=!1,$c=0,ol=0,ss=null,IT=0;function Qt(){throw Error(s(321))}function tp(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!cr(t[a],r[a]))return!1;return!0}function np(t,r,a,l,h,g){return Di=g,Ke=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,se.H=t===null||t.memoizedState===null?rb:yp,ho=!1,g=a(l,h),ho=!1,os&&(g=x1(r,a,l,h)),_1(t),g}function _1(t){se.H=cl;var r=Rt!==null&&Rt.next!==null;if(Di=0,on=Rt=Ke=null,Vc=!1,ol=0,ss=null,r)throw Error(s(300));t===null||sn||(t=t.dependencies,t!==null&&Nc(t)&&(sn=!0))}function x1(t,r,a,l){Ke=t;var h=0;do{if(os&&(ss=null),ol=0,os=!1,25<=h)throw Error(s(301));if(h+=1,on=Rt=null,t.updateQueue!=null){var g=t.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}se.H=ib,g=r(a,l)}while(os);return g}function AT(){var t=se.H,r=t.useState()[0];return r=typeof r.then=="function"?sl(r):r,t=t.useState()[0],(Rt===null?null:Rt.memoizedState)!==t&&(Ke.flags|=1024),r}function rp(){var t=$c!==0;return $c=0,t}function ip(t,r,a){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~a}function ap(t){if(Vc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Vc=!1}Di=0,on=Rt=Ke=null,os=!1,ol=$c=0,ss=null}function $n(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?Ke.memoizedState=on=t:on=on.next=t,on}function Zt(){if(Rt===null){var t=Ke.alternate;t=t===null?null:t.memoizedState}else t=Rt.next;var r=on===null?Ke.memoizedState:on.next;if(r!==null)on=r,Rt=t;else{if(t===null)throw Ke.alternate===null?Error(s(467)):Error(s(310));Rt=t,t={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},on===null?Ke.memoizedState=on=t:on=on.next=t}return on}function Wc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function sl(t){var r=ol;return ol+=1,ss===null&&(ss=[]),t=f1(ss,t,r),r=Ke,(on===null?r.memoizedState:on.next)===null&&(r=r.alternate,se.H=r===null||r.memoizedState===null?rb:yp),t}function Uc(t){if(typeof t=="object"&&t){if(typeof t.then=="function")return sl(t);if(t.$$typeof===K)return Cn(t)}throw Error(s(438,String(t)))}function op(t){var r=null,a=Ke.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var l=Ke.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(h){return h.slice()}),index:0})))}if(r??(r={data:[],index:0}),a===null&&(a=Wc(),Ke.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(t),l=0;l<t;l++)a[l]=we;return r.index++,a}function Oi(t,r){return typeof r=="function"?r(t):r}function Kc(t){return sp(Zt(),Rt,t)}function sp(t,r,a){var l=t.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=a;var h=t.baseQueue,g=l.pending;if(g!==null){if(h!==null){var S=h.next;h.next=g.next,g.next=S}r.baseQueue=h=g,l.pending=null}if(g=t.baseState,h===null)t.memoizedState=g;else{r=h.next;var D=S=null,H=null,ne=r,he=!1;do{var ge=ne.lane&-536870913;if(ge===ne.lane?(Di&ge)===ge:(it&ge)===ge){var ae=ne.revertLane;if(ae===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),ge===ts&&(he=!0);else if((Di&ae)===ae){ne=ne.next,ae===ts&&(he=!0);continue}else ge={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},H===null?(D=H=ge,S=g):H=H.next=ge,Ke.lanes|=ae,ya|=ae;ge=ne.action,ho&&a(g,ge),g=ne.hasEagerState?ne.eagerState:a(g,ge)}else ae={lane:ge,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},H===null?(D=H=ae,S=g):H=H.next=ae,Ke.lanes|=ge,ya|=ge;ne=ne.next}while(ne!==null&&ne!==r);if(H===null?S=g:H.next=D,!cr(g,t.memoizedState)&&(sn=!0,he&&(a=ns,a!==null)))throw a;t.memoizedState=g,t.baseState=S,t.baseQueue=H,l.lastRenderedState=g}return h===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function lp(t){var r=Zt(),a=r.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=t;var l=a.dispatch,h=a.pending,g=r.memoizedState;if(h!==null){a.pending=null;var S=h=h.next;do g=t(g,S.action),S=S.next;while(S!==h);cr(g,r.memoizedState)||(sn=!0),r.memoizedState=g,r.baseQueue===null&&(r.baseState=g),a.lastRenderedState=g}return[g,l]}function k1(t,r,a){var l=Ke,h=Zt(),g=st;if(g){if(a===void 0)throw Error(s(407));a=a()}else a=r();var S=!cr((Rt||h).memoizedState,a);if(S&&(h.memoizedState=a,sn=!0),h=h.queue,dp(E1.bind(null,l,h,t),[t]),h.getSnapshot!==r||S||on!==null&&on.memoizedState.tag&1){if(l.flags|=2048,ls(9,{destroy:void 0},C1.bind(null,l,h,a,r),null),It===null)throw Error(s(349));g||Di&127||S1(l,r,a)}return a}function S1(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=Ke.updateQueue,r===null?(r=Wc(),Ke.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function C1(t,r,a,l){r.value=a,r.getSnapshot=l,T1(r)&&R1(t)}function E1(t,r,a){return a(function(){T1(r)&&R1(t)})}function T1(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!cr(t,a)}catch{return!0}}function R1(t){var r=no(t,2);r!==null&&Yn(r,t,2)}function cp(t){var r=$n();if(typeof t=="function"){var a=t;if(t=a(),ho){Ge(!0);try{a()}finally{Ge(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:t},r}function D1(t,r,a,l){return t.baseState=a,sp(t,Rt,typeof l=="function"?l:Oi)}function qT(t,r,a,l,h){if(Jc(t))throw Error(s(485));if(t=r.action,t!==null){var g={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){g.listeners.push(S)}};se.T===null?g.isTransition=!1:a(!0),l(g),a=r.pending,a===null?(g.next=r.pending=g,O1(r,g)):(g.next=a.next,r.pending=a.next=g)}}function O1(t,r){var a=r.action,l=r.payload,h=t.state;if(r.isTransition){var g=se.T,S={};se.T=S;try{var D=a(h,l),H=se.S;H!==null&&H(S,D),P1(t,r,D)}catch(ne){up(t,r,ne)}finally{g!==null&&S.types!==null&&(g.types=S.types),se.T=g}}else try{g=a(h,l),P1(t,r,g)}catch(ne){up(t,r,ne)}}function P1(t,r,a){typeof a=="object"&&a&&typeof a.then=="function"?a.then(function(l){M1(t,r,l)},function(l){return up(t,r,l)}):M1(t,r,a)}function M1(t,r,a){r.status="fulfilled",r.value=a,L1(r),t.state=a,r=t.pending,r!==null&&(a=r.next,a===r?t.pending=null:(a=a.next,r.next=a,O1(t,a)))}function up(t,r,a){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=a,L1(r),r=r.next;while(r!==l)}t.action=null}function L1(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function N1(t,r){return r}function I1(t,r){if(st){var a=It.formState;if(a!==null){e:{var l=Ke;if(st){if(Bt){t:{for(var h=Bt,g=Tr;h.nodeType!==8;){if(!g){h=null;break t}if(h=Dr(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){Bt=Dr(h.nextSibling),l=h.data==="F!";break e}}ua(l)}l=!1}l&&(r=a[0])}}return a=$n(),a.memoizedState=a.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:N1,lastRenderedState:r},a.queue=l,a=eb.bind(null,Ke,l),l.dispatch=a,l=cp(!1),g=gp.bind(null,Ke,!1,l.queue),l=$n(),h={state:r,dispatch:null,action:t,pending:null},l.queue=h,a=qT.bind(null,Ke,h,g,a),h.dispatch=a,l.memoizedState=t,[r,a,!1]}function A1(t){return q1(Zt(),Rt,t)}function q1(t,r,a){if(r=sp(t,r,N1)[0],t=Kc(Oi)[0],typeof r=="object"&&r&&typeof r.then=="function")try{var l=sl(r)}catch(S){throw S===rs?qc:S}else l=r;r=Zt();var h=r.queue,g=h.dispatch;return a!==r.memoizedState&&(Ke.flags|=2048,ls(9,{destroy:void 0},jT.bind(null,h,a),null)),[l,g,t]}function jT(t,r){t.action=r}function j1(t){var r=Zt(),a=Rt;if(a!==null)return q1(r,a,t);Zt(),r=r.memoizedState,a=Zt();var l=a.queue.dispatch;return a.memoizedState=t,[r,l,!1]}function ls(t,r,a,l){return t={tag:t,create:a,deps:l,inst:r,next:null},r=Ke.updateQueue,r===null&&(r=Wc(),Ke.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=t.next=t:(l=a.next,a.next=t,t.next=l,r.lastEffect=t),t}function z1(){return Zt().memoizedState}function Qc(t,r,a,l){var h=$n();Ke.flags|=t,h.memoizedState=ls(1|r,{destroy:void 0},a,l===void 0?null:l)}function Gc(t,r,a,l){var h=Zt();l=l===void 0?null:l;var g=h.memoizedState.inst;Rt!==null&&l!==null&&tp(l,Rt.memoizedState.deps)?h.memoizedState=ls(r,g,a,l):(Ke.flags|=t,h.memoizedState=ls(1|r,g,a,l))}function F1(t,r){Qc(8390656,8,t,r)}function dp(t,r){Gc(2048,8,t,r)}function zT(t){Ke.flags|=4;var r=Ke.updateQueue;if(r===null)r=Wc(),Ke.updateQueue=r,r.events=[t];else{var a=r.events;a===null?r.events=[t]:a.push(t)}}function B1(t){var r=Zt().memoizedState;return zT({ref:r,nextImpl:t}),function(){if(yt&2)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function H1(t,r){return Gc(4,2,t,r)}function V1(t,r){return Gc(4,4,t,r)}function $1(t,r){if(typeof r=="function"){t=t();var a=r(t);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function W1(t,r,a){a=a==null?null:a.concat([t]),Gc(4,4,$1.bind(null,r,t),a)}function fp(){}function U1(t,r){var a=Zt();r=r===void 0?null:r;var l=a.memoizedState;return r!==null&&tp(r,l[1])?l[0]:(a.memoizedState=[t,r],t)}function K1(t,r){var a=Zt();r=r===void 0?null:r;var l=a.memoizedState;if(r!==null&&tp(r,l[1]))return l[0];if(l=t(),ho){Ge(!0);try{t()}finally{Ge(!1)}}return a.memoizedState=[l,r],l}function pp(t,r,a){return a===void 0||Di&1073741824&&!(it&261930)?t.memoizedState=r:(t.memoizedState=a,t=Wb(),Ke.lanes|=t,ya|=t,a)}function Q1(t,r,a,l){return cr(a,r)?a:as.current===null?!(Di&42)||Di&1073741824&&!(it&261930)?(sn=!0,t.memoizedState=a):(t=Wb(),Ke.lanes|=t,ya|=t,r):(t=pp(t,a,l),cr(t,r)||(sn=!0),t)}function G1(t,r,a,l,h){var g=Q.p;Q.p=g!==0&&8>g?g:8;var S=se.T,D={};se.T=D,gp(t,!1,r,a);try{var H=h(),ne=se.S;ne!==null&&ne(D,H),typeof H=="object"&&H&&typeof H.then=="function"?ll(t,r,NT(H,l),Rr(t)):ll(t,r,l,Rr(t))}catch(he){ll(t,r,{then:function(){},status:"rejected",reason:he},Rr())}finally{Q.p=g,S!==null&&D.types!==null&&(S.types=D.types),se.T=S}}function FT(){}function hp(t,r,a,l){if(t.tag!==5)throw Error(s(476));var h=J1(t).queue;G1(t,h,r,Le,a===null?FT:function(){return X1(t),a(l)})}function J1(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Le,baseState:Le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:Le},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function X1(t){var r=J1(t);r.next===null&&(r=t.alternate.memoizedState),ll(t,r.next.queue,{},Rr())}function mp(){return Cn(Cl)}function Y1(){return Zt().memoizedState}function Z1(){return Zt().memoizedState}function BT(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var a=Rr();t=fo(a);var l=po(r,t,a);l!==null&&(Yn(l,r,a),rl(l,r,a)),r={cache:$f()},t.payload=r;return}r=r.return}}function HT(t,r,a){var l=Rr();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Jc(t)?tb(r,a):(a=Lf(t,r,a,l),a!==null&&(Yn(a,t,l),nb(a,r,l)))}function eb(t,r,a){ll(t,r,a,Rr())}function ll(t,r,a,l){var h={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Jc(t))tb(r,h);else{var g=t.alternate;if(t.lanes===0&&(g===null||g.lanes===0)&&(g=r.lastRenderedReducer,g!==null))try{var S=r.lastRenderedState,D=g(S,a);if(h.hasEagerState=!0,h.eagerState=D,cr(D,S))return Oc(t,r,h,0),It===null&&Dc(),!1}catch{}if(a=Lf(t,r,h,l),a!==null)return Yn(a,t,l),nb(a,r,l),!0}return!1}function gp(t,r,a,l){if(l={lane:2,revertLane:Qp(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Jc(t)){if(r)throw Error(s(479))}else r=Lf(t,a,l,2),r!==null&&Yn(r,t,2)}function Jc(t){var r=t.alternate;return t===Ke||r!==null&&r===Ke}function tb(t,r){os=Vc=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function nb(t,r,a){if(a&4194048){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,or(t,a)}}var cl={readContext:Cn,use:Uc,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useLayoutEffect:Qt,useInsertionEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useSyncExternalStore:Qt,useId:Qt,useHostTransitionStatus:Qt,useFormState:Qt,useActionState:Qt,useOptimistic:Qt,useMemoCache:Qt,useCacheRefresh:Qt};cl.useEffectEvent=Qt;var rb={readContext:Cn,use:Uc,useCallback:function(t,r){return $n().memoizedState=[t,r===void 0?null:r],t},useContext:Cn,useEffect:F1,useImperativeHandle:function(t,r,a){a=a==null?null:a.concat([t]),Qc(4194308,4,$1.bind(null,r,t),a)},useLayoutEffect:function(t,r){return Qc(4194308,4,t,r)},useInsertionEffect:function(t,r){Qc(4,2,t,r)},useMemo:function(t,r){var a=$n();r=r===void 0?null:r;var l=t();if(ho){Ge(!0);try{t()}finally{Ge(!1)}}return a.memoizedState=[l,r],l},useReducer:function(t,r,a){var l=$n();if(a!==void 0){var h=a(r);if(ho){Ge(!0);try{a(r)}finally{Ge(!1)}}}else h=r;return l.memoizedState=l.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},l.queue=t,t=t.dispatch=HT.bind(null,Ke,t),[l.memoizedState,t]},useRef:function(t){var r=$n();return t={current:t},r.memoizedState=t},useState:function(t){t=cp(t);var r=t.queue,a=eb.bind(null,Ke,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:fp,useDeferredValue:function(t,r){return pp($n(),t,r)},useTransition:function(){var t=cp(!1);return t=G1.bind(null,Ke,t.queue,!0,!1),$n().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var l=Ke,h=$n();if(st){if(a===void 0)throw Error(s(407));a=a()}else{if(a=r(),It===null)throw Error(s(349));it&127||S1(l,r,a)}h.memoizedState=a;var g={value:a,getSnapshot:r};return h.queue=g,F1(E1.bind(null,l,g,t),[t]),l.flags|=2048,ls(9,{destroy:void 0},C1.bind(null,l,g,a,r),null),a},useId:function(){var t=$n(),r=It.identifierPrefix;if(st){var a=li,l=si;a=(l&~(1<<32-gt(l)-1)).toString(32)+a,r="_"+r+"R_"+a,a=$c++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=IT++,r="_"+r+"r_"+a.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:mp,useFormState:I1,useActionState:I1,useOptimistic:function(t){var r=$n();r.memoizedState=r.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=gp.bind(null,Ke,!0,a),a.dispatch=r,[t,r]},useMemoCache:op,useCacheRefresh:function(){return $n().memoizedState=BT.bind(null,Ke)},useEffectEvent:function(t){var r=$n(),a={impl:t};return r.memoizedState=a,function(){if(yt&2)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},yp={readContext:Cn,use:Uc,useCallback:U1,useContext:Cn,useEffect:dp,useImperativeHandle:W1,useInsertionEffect:H1,useLayoutEffect:V1,useMemo:K1,useReducer:Kc,useRef:z1,useState:function(){return Kc(Oi)},useDebugValue:fp,useDeferredValue:function(t,r){return Q1(Zt(),Rt.memoizedState,t,r)},useTransition:function(){var t=Kc(Oi)[0],r=Zt().memoizedState;return[typeof t=="boolean"?t:sl(t),r]},useSyncExternalStore:k1,useId:Y1,useHostTransitionStatus:mp,useFormState:A1,useActionState:A1,useOptimistic:function(t,r){return D1(Zt(),Rt,t,r)},useMemoCache:op,useCacheRefresh:Z1};yp.useEffectEvent=B1;var ib={readContext:Cn,use:Uc,useCallback:U1,useContext:Cn,useEffect:dp,useImperativeHandle:W1,useInsertionEffect:H1,useLayoutEffect:V1,useMemo:K1,useReducer:lp,useRef:z1,useState:function(){return lp(Oi)},useDebugValue:fp,useDeferredValue:function(t,r){var a=Zt();return Rt===null?pp(a,t,r):Q1(a,Rt.memoizedState,t,r)},useTransition:function(){var t=lp(Oi)[0],r=Zt().memoizedState;return[typeof t=="boolean"?t:sl(t),r]},useSyncExternalStore:k1,useId:Y1,useHostTransitionStatus:mp,useFormState:j1,useActionState:j1,useOptimistic:function(t,r){var a=Zt();return Rt===null?(a.baseState=t,[t,a.queue.dispatch]):D1(a,Rt,t,r)},useMemoCache:op,useCacheRefresh:Z1};ib.useEffectEvent=B1;function vp(t,r,a,l){r=t.memoizedState,a=a(l,r),a=a==null?r:C({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var bp={enqueueSetState:function(t,r,a){t=t._reactInternals;var l=Rr(),h=fo(l);h.payload=r,a!=null&&(h.callback=a),r=po(t,h,l),r!==null&&(Yn(r,t,l),rl(r,t,l))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var l=Rr(),h=fo(l);h.tag=1,h.payload=r,a!=null&&(h.callback=a),r=po(t,h,l),r!==null&&(Yn(r,t,l),rl(r,t,l))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=Rr(),l=fo(a);l.tag=2,r!=null&&(l.callback=r),r=po(t,l,a),r!==null&&(Yn(r,t,a),rl(r,t,a))}};function ab(t,r,a,l,h,g,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,g,S):r.prototype&&r.prototype.isPureReactComponent?!Gs(a,l)||!Gs(h,g):!0}function ob(t,r,a,l){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,l),r.state!==t&&bp.enqueueReplaceState(r,r.state,null)}function mo(t,r){var a=r;if("ref"in r)for(var l in a={},r)l!=="ref"&&(a[l]=r[l]);if(t=t.defaultProps)for(var h in a===r&&(a=C({},a)),t)a[h]===void 0&&(a[h]=t[h]);return a}function VT(t){Rc(t)}function $T(t){console.error(t)}function WT(t){Rc(t)}function Xc(t,r){try{var a=t.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function sb(t,r,a){try{var l=t.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function wp(t,r,a){return a=fo(a),a.tag=3,a.payload={element:null},a.callback=function(){Xc(t,r)},a}function lb(t){return t=fo(t),t.tag=3,t}function cb(t,r,a,l){var h=a.type.getDerivedStateFromError;if(typeof h=="function"){var g=l.value;t.payload=function(){return h(g)},t.callback=function(){sb(r,a,l)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){sb(r,a,l),typeof h!="function"&&(va===null?va=new Set([this]):va.add(this));var D=l.stack;this.componentDidCatch(l.value,{componentStack:D===null?"":D})})}function UT(t,r,a,l,h){if(a.flags|=32768,typeof l=="object"&&l&&typeof l.then=="function"){if(r=a.alternate,r!==null&&es(r,a,h,!0),a=dr.current,a!==null){switch(a.tag){case 31:case 13:return Kr===null?cu():a.alternate===null&&Gt===0&&(Gt=3),a.flags&=-257,a.flags|=65536,a.lanes=h,l===jc?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([l]):r.add(l),Wp(t,l,h)),!1;case 22:return a.flags|=65536,l===jc?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([l]):a.add(l)),Wp(t,l,h)),!1}throw Error(s(435,a.tag))}return Wp(t,l,h),cu(),!1}if(st)return r=dr.current,r===null?(l!==zf&&(r=Error(s(423),{cause:l}),Ys(Sr(r,a))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,l=Sr(l,a),h=wp(t.stateNode,l,h),Jf(t,h),Gt!==4&&(Gt=2)):(!(r.flags&65536)&&(r.flags|=256),r.flags|=65536,r.lanes=h,l!==zf&&(t=Error(s(422),{cause:l}),Ys(Sr(t,a)))),!1;var g=Error(s(520),{cause:l});if(g=Sr(g,a),yl===null?yl=[g]:yl.push(g),Gt!==4&&(Gt=2),r===null)return!0;l=Sr(l,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,t=h&-h,a.lanes|=t,t=wp(a.stateNode,l,t),Jf(a,t),!1;case 1:if(r=a.type,g=a.stateNode,!(a.flags&128)&&(typeof r.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(va===null||!va.has(g))))return a.flags|=65536,h&=-h,a.lanes|=h,h=lb(h),cb(h,t,a,l),Jf(a,h),!1}a=a.return}while(a!==null);return!1}var _p=Error(s(461)),sn=!1;function En(t,r,a,l){r.child=t===null?g1(r,null,a,l):uo(r,t.child,a,l)}function ub(t,r,a,l,h){a=a.render;var g=r.ref;if("ref"in l){var S={};for(var D in l)D!=="ref"&&(S[D]=l[D])}else S=l;return oo(r),l=np(t,r,a,S,g,h),D=rp(),t!==null&&!sn?(ip(t,r,h),Pi(t,r,h)):(st&&D&&qf(r),r.flags|=1,En(t,r,l,h),r.child)}function db(t,r,a,l,h){if(t===null){var g=a.type;return typeof g=="function"&&!Nf(g)&&g.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=g,fb(t,r,g,l,h)):(t=Mc(a.type,null,l,r,r.mode,h),t.ref=r.ref,t.return=r,r.child=t)}if(g=t.child,!Dp(t,h)){var S=g.memoizedProps;if(a=a.compare,a=a===null?Gs:a,a(S,l)&&t.ref===r.ref)return Pi(t,r,h)}return r.flags|=1,t=Ci(g,l),t.ref=r.ref,t.return=r,r.child=t}function fb(t,r,a,l,h){if(t!==null){var g=t.memoizedProps;if(Gs(g,l)&&t.ref===r.ref)if(sn=!1,r.pendingProps=l=g,Dp(t,h))t.flags&131072&&(sn=!0);else return r.lanes=t.lanes,Pi(t,r,h)}return xp(t,r,a,l,h)}function pb(t,r,a,l){var h=l.children,g=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(g=g===null?a:g.baseLanes|a,t!==null){for(l=r.child=t.child,h=0;l!==null;)h=h|l.lanes|l.childLanes,l=l.sibling;l=h&~g}else l=0,r.child=null;return hb(t,r,g,a,l)}if(a&536870912)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ac(r,g===null?null:g.cachePool),g===null?Yf():b1(r,g),w1(r);else return l=r.lanes=536870912,hb(t,r,g===null?a:g.baseLanes|a,a,l)}else g===null?(t!==null&&Ac(r,null),Yf(),ha(r)):(Ac(r,g.cachePool),b1(r,g),ha(r),r.memoizedState=null);return En(t,r,h,a),r.child}function ul(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function hb(t,r,a,l,h){var g=Uf();return g=g===null?null:{parent:an._currentValue,pool:g},r.memoizedState={baseLanes:a,cachePool:g},t!==null&&Ac(r,null),Yf(),w1(r),t!==null&&es(t,r,l,!0),r.childLanes=h,null}function Yc(t,r){return r=eu({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function mb(t,r,a){return uo(r,t.child,null,a),t=Yc(r,r.pendingProps),t.flags|=2,fr(r),r.memoizedState=null,t}function KT(t,r,a){var l=r.pendingProps,h=(r.flags&128)!=0;if(r.flags&=-129,t===null){if(st){if(l.mode==="hidden")return t=Yc(r,l),r.lanes=536870912,ul(null,t);if(ep(r),(t=Bt)?(t=R2(t,Tr),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:la===null?null:{id:si,overflow:li},retryLane:536870912,hydrationErrors:null},a=t1(t),a.return=r,r.child=a,Sn=r,Bt=null)):t=null,t===null)throw ua(r);return r.lanes=536870912,null}return Yc(r,l)}var g=t.memoizedState;if(g!==null){var S=g.dehydrated;if(ep(r),h)if(r.flags&256)r.flags&=-257,r=mb(t,r,a);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(s(558));else if(sn||es(t,r,a,!1),h=(a&t.childLanes)!==0,sn||h){if(l=It,l!==null&&(S=M(l,a),S!==0&&S!==g.retryLane))throw g.retryLane=S,no(t,S),Yn(l,t,S),_p;cu(),r=mb(t,r,a)}else t=g.treeContext,Bt=Dr(S.nextSibling),Sn=r,st=!0,ca=null,Tr=!1,t!==null&&i1(r,t),r=Yc(r,l),r.flags|=4096;return r}return t=Ci(t.child,{mode:l.mode,children:l.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Zc(t,r){var a=r.ref;if(a===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(r.flags|=4194816)}}function xp(t,r,a,l,h){return oo(r),a=np(t,r,a,l,void 0,h),l=rp(),t!==null&&!sn?(ip(t,r,h),Pi(t,r,h)):(st&&l&&qf(r),r.flags|=1,En(t,r,a,h),r.child)}function gb(t,r,a,l,h,g){return oo(r),r.updateQueue=null,a=x1(r,l,a,h),_1(t),l=rp(),t!==null&&!sn?(ip(t,r,g),Pi(t,r,g)):(st&&l&&qf(r),r.flags|=1,En(t,r,a,g),r.child)}function yb(t,r,a,l,h){if(oo(r),r.stateNode===null){var g=Jo,S=a.contextType;typeof S=="object"&&S&&(g=Cn(S)),g=new a(l,g),r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=bp,r.stateNode=g,g._reactInternals=r,g=r.stateNode,g.props=l,g.state=r.memoizedState,g.refs={},Qf(r),S=a.contextType,g.context=typeof S=="object"&&S?Cn(S):Jo,g.state=r.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(vp(r,a,S,l),g.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(S=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),S!==g.state&&bp.enqueueReplaceState(g,g.state,null),al(r,l,g,h),il(),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(t===null){g=r.stateNode;var D=r.memoizedProps,H=mo(a,D);g.props=H;var ne=g.context,he=a.contextType;S=Jo,typeof he=="object"&&he&&(S=Cn(he));var ge=a.getDerivedStateFromProps;he=typeof ge=="function"||typeof g.getSnapshotBeforeUpdate=="function",D=r.pendingProps!==D,he||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(D||ne!==S)&&ob(r,g,l,S),fa=!1;var ae=r.memoizedState;g.state=ae,al(r,l,g,h),il(),ne=r.memoizedState,D||ae!==ne||fa?(typeof ge=="function"&&(vp(r,a,ge,l),ne=r.memoizedState),(H=fa||ab(r,a,H,l,ae,ne,S))?(he||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(r.flags|=4194308)):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=ne),g.props=l,g.state=ne,g.context=S,l=H):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{g=r.stateNode,Gf(t,r),S=r.memoizedProps,he=mo(a,S),g.props=he,ge=r.pendingProps,ae=g.context,ne=a.contextType,H=Jo,typeof ne=="object"&&ne&&(H=Cn(ne)),D=a.getDerivedStateFromProps,(ne=typeof D=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S!==ge||ae!==H)&&ob(r,g,l,H),fa=!1,ae=r.memoizedState,g.state=ae,al(r,l,g,h),il();var ue=r.memoizedState;S!==ge||ae!==ue||fa||t!==null&&t.dependencies!==null&&Nc(t.dependencies)?(typeof D=="function"&&(vp(r,a,D,l),ue=r.memoizedState),(he=fa||ab(r,a,he,l,ae,ue,H)||t!==null&&t.dependencies!==null&&Nc(t.dependencies))?(ne||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(l,ue,H),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(l,ue,H)),typeof g.componentDidUpdate=="function"&&(r.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof g.componentDidUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=ue),g.props=l,g.state=ue,g.context=H,l=he):(typeof g.componentDidUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=1024),l=!1)}return g=l,Zc(t,r),l=(r.flags&128)!=0,g||l?(g=r.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:g.render(),r.flags|=1,t!==null&&l?(r.child=uo(r,t.child,null,h),r.child=uo(r,null,a,h)):En(t,r,a,h),r.memoizedState=g.state,t=r.child):t=Pi(t,r,h),t}function vb(t,r,a,l){return io(),r.flags|=256,En(t,r,a,l),r.child}var kp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sp(t){return{baseLanes:t,cachePool:u1()}}function Cp(t,r,a){return t=t===null?0:t.childLanes&~a,r&&(t|=hr),t}function bb(t,r,a){var l=r.pendingProps,h=!1,g=(r.flags&128)!=0,S;if((S=g)||(S=t!==null&&t.memoizedState===null?!1:(Yt.current&2)!=0),S&&(h=!0,r.flags&=-129),S=(r.flags&32)!=0,r.flags&=-33,t===null){if(st){if(h?pa(r):ha(r),(t=Bt)?(t=R2(t,Tr),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:la===null?null:{id:si,overflow:li},retryLane:536870912,hydrationErrors:null},a=t1(t),a.return=r,r.child=a,Sn=r,Bt=null)):t=null,t===null)throw ua(r);return oh(t)?r.lanes=32:r.lanes=536870912,null}var D=l.children;return l=l.fallback,h?(ha(r),h=r.mode,D=eu({mode:"hidden",children:D},h),l=ro(l,h,a,null),D.return=r,l.return=r,D.sibling=l,r.child=D,l=r.child,l.memoizedState=Sp(a),l.childLanes=Cp(t,S,a),r.memoizedState=kp,ul(null,l)):(pa(r),Ep(r,D))}var H=t.memoizedState;if(H!==null&&(D=H.dehydrated,D!==null)){if(g)r.flags&256?(pa(r),r.flags&=-257,r=Tp(t,r,a)):r.memoizedState===null?(ha(r),D=l.fallback,h=r.mode,l=eu({mode:"visible",children:l.children},h),D=ro(D,h,a,null),D.flags|=2,l.return=r,D.return=r,l.sibling=D,r.child=l,uo(r,t.child,null,a),l=r.child,l.memoizedState=Sp(a),l.childLanes=Cp(t,S,a),r.memoizedState=kp,r=ul(null,l)):(ha(r),r.child=t.child,r.flags|=128,r=null);else if(pa(r),oh(D)){if(S=D.nextSibling&&D.nextSibling.dataset,S)var ne=S.dgst;S=ne,l=Error(s(419)),l.stack="",l.digest=S,Ys({value:l,source:null,stack:null}),r=Tp(t,r,a)}else if(sn||es(t,r,a,!1),S=(a&t.childLanes)!==0,sn||S){if(S=It,S!==null&&(l=M(S,a),l!==0&&l!==H.retryLane))throw H.retryLane=l,no(t,l),Yn(S,t,l),_p;ah(D)||cu(),r=Tp(t,r,a)}else ah(D)?(r.flags|=192,r.child=t.child,r=null):(t=H.treeContext,Bt=Dr(D.nextSibling),Sn=r,st=!0,ca=null,Tr=!1,t!==null&&i1(r,t),r=Ep(r,l.children),r.flags|=4096);return r}return h?(ha(r),D=l.fallback,h=r.mode,H=t.child,ne=H.sibling,l=Ci(H,{mode:"hidden",children:l.children}),l.subtreeFlags=H.subtreeFlags&65011712,ne===null?(D=ro(D,h,a,null),D.flags|=2):D=Ci(ne,D),D.return=r,l.return=r,l.sibling=D,r.child=l,ul(null,l),l=r.child,D=t.child.memoizedState,D===null?D=Sp(a):(h=D.cachePool,h===null?h=u1():(H=an._currentValue,h=h.parent===H?h:{parent:H,pool:H}),D={baseLanes:D.baseLanes|a,cachePool:h}),l.memoizedState=D,l.childLanes=Cp(t,S,a),r.memoizedState=kp,ul(t.child,l)):(pa(r),a=t.child,t=a.sibling,a=Ci(a,{mode:"visible",children:l.children}),a.return=r,a.sibling=null,t!==null&&(S=r.deletions,S===null?(r.deletions=[t],r.flags|=16):S.push(t)),r.child=a,r.memoizedState=null,a)}function Ep(t,r){return r=eu({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function eu(t,r){return t=ur(22,t,null,r),t.lanes=0,t}function Tp(t,r,a){return uo(r,t.child,null,a),t=Ep(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function wb(t,r,a){t.lanes|=r;var l=t.alternate;l!==null&&(l.lanes|=r),Hf(t.return,r,a)}function Rp(t,r,a,l,h,g){var S=t.memoizedState;S===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:h,treeForkCount:g}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=l,S.tail=a,S.tailMode=h,S.treeForkCount=g)}function _b(t,r,a){var l=r.pendingProps,h=l.revealOrder,g=l.tail;l=l.children;var S=Yt.current,D=(S&2)!=0;if(D?(S=S&1|2,r.flags|=128):S&=1,Pe(Yt,S),En(t,r,l,a),l=st?Xs:0,!D&&t!==null&&t.flags&128)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&wb(t,a,r);else if(t.tag===19)wb(t,a,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(h){case"forwards":for(a=r.child,h=null;a!==null;)t=a.alternate,t!==null&&Hc(t)===null&&(h=a),a=a.sibling;a=h,a===null?(h=r.child,r.child=null):(h=a.sibling,a.sibling=null),Rp(r,!1,h,a,g,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,h=r.child,r.child=null;h!==null;){if(t=h.alternate,t!==null&&Hc(t)===null){r.child=h;break}t=h.sibling,h.sibling=a,a=h,h=t}Rp(r,!0,a,null,g,l);break;case"together":Rp(r,!1,null,null,void 0,l);break;default:r.memoizedState=null}return r.child}function Pi(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),ya|=r.lanes,(a&r.childLanes)===0)if(t!==null){if(es(t,r,a,!1),(a&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,a=Ci(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=Ci(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function Dp(t,r){return(t.lanes&r)===0?(t=t.dependencies,!!(t!==null&&Nc(t))):!0}function QT(t,r,a){switch(r.tag){case 3:un(r,r.stateNode.containerInfo),da(r,an,t.memoizedState.cache),io();break;case 27:case 5:tn(r);break;case 4:un(r,r.stateNode.containerInfo);break;case 10:da(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,ep(r),null;break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated===null?(a&r.child.childLanes)===0?(pa(r),t=Pi(t,r,a),t===null?null:t.sibling):bb(t,r,a):(pa(r),r.flags|=128,null);pa(r);break;case 19:var h=(t.flags&128)!=0;if(l=(a&r.childLanes)!==0,l||(l=(es(t,r,a,!1),(a&r.childLanes)!==0)),h){if(l)return _b(t,r,a);r.flags|=128}if(h=r.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Pe(Yt,Yt.current),l)break;return null;case 22:return r.lanes=0,pb(t,r,a,r.pendingProps);case 24:da(r,an,t.memoizedState.cache)}return Pi(t,r,a)}function xb(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps)sn=!0;else{if(!Dp(t,a)&&!(r.flags&128))return sn=!1,QT(t,r,a);sn=!!(t.flags&131072)}else sn=!1,st&&r.flags&1048576&&r1(r,Xs,r.index);switch(r.lanes=0,r.tag){case 16:e:{var l=r.pendingProps;if(t=lo(r.elementType),r.type=t,typeof t=="function")Nf(t)?(l=mo(t,l),r.tag=1,r=yb(null,r,t,l,a)):(r.tag=0,r=xp(null,r,t,l,a));else{if(t!=null){var h=t.$$typeof;if(h===pe){r.tag=11,r=ub(null,r,t,l,a);break e}else if(h===W){r.tag=14,r=db(null,r,t,l,a);break e}}throw r=Z(t)||t,Error(s(306,r,""))}}return r;case 0:return xp(t,r,r.type,r.pendingProps,a);case 1:return l=r.type,h=mo(l,r.pendingProps),yb(t,r,l,h,a);case 3:e:{if(un(r,r.stateNode.containerInfo),t===null)throw Error(s(387));l=r.pendingProps;var g=r.memoizedState;h=g.element,Gf(t,r),al(r,l,null,a);var S=r.memoizedState;if(l=S.cache,da(r,an,l),l!==g.cache&&Vf(r,[an],a,!0),il(),l=S.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=g,r.memoizedState=g,r.flags&256){r=vb(t,r,l,a);break e}else if(l!==h){h=Sr(Error(s(424)),r),Ys(h),r=vb(t,r,l,a);break e}else for((t=r.stateNode.containerInfo,t.nodeType)===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Bt=Dr(t.firstChild),Sn=r,st=!0,ca=null,Tr=!0,a=g1(r,null,l,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(io(),l===h){r=Pi(t,r,a);break e}En(t,r,l,a)}r=r.child}return r;case 26:return Zc(t,r),t===null?(a=N2(r.type,null,r.pendingProps,null))?r.memoizedState=a:st||(a=r.type,t=r.pendingProps,l=gu(mt.current).createElement(a),l[He]=r,l[Ve]=t,Tn(l,a,t),Xt(l),r.stateNode=l):r.memoizedState=N2(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return tn(r),t===null&&st&&(l=r.stateNode=P2(r.type,r.pendingProps,mt.current),Sn=r,Tr=!0,h=Bt,xa(r.type)?(sh=h,Bt=Dr(l.firstChild)):Bt=h),En(t,r,r.pendingProps.children,a),Zc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&st&&((h=l=Bt)&&(l=xR(l,r.type,r.pendingProps,Tr),l===null?h=!1:(r.stateNode=l,Sn=r,Bt=Dr(l.firstChild),Tr=!1,h=!0)),h||ua(r)),tn(r),h=r.type,g=r.pendingProps,S=t===null?null:t.memoizedProps,l=g.children,nh(h,g)?l=null:S!==null&&nh(h,S)&&(r.flags|=32),r.memoizedState!==null&&(h=np(t,r,AT,null,null,a),Cl._currentValue=h),Zc(t,r),En(t,r,l,a),r.child;case 6:return t===null&&st&&((t=a=Bt)&&(a=kR(a,r.pendingProps,Tr),a===null?t=!1:(r.stateNode=a,Sn=r,Bt=null,t=!0)),t||ua(r)),null;case 13:return bb(t,r,a);case 4:return un(r,r.stateNode.containerInfo),l=r.pendingProps,t===null?r.child=uo(r,null,l,a):En(t,r,l,a),r.child;case 11:return ub(t,r,r.type,r.pendingProps,a);case 7:return En(t,r,r.pendingProps,a),r.child;case 8:return En(t,r,r.pendingProps.children,a),r.child;case 12:return En(t,r,r.pendingProps.children,a),r.child;case 10:return l=r.pendingProps,da(r,r.type,l.value),En(t,r,l.children,a),r.child;case 9:return h=r.type._context,l=r.pendingProps.children,oo(r),h=Cn(h),l=l(h),r.flags|=1,En(t,r,l,a),r.child;case 14:return db(t,r,r.type,r.pendingProps,a);case 15:return fb(t,r,r.type,r.pendingProps,a);case 19:return _b(t,r,a);case 31:return KT(t,r,a);case 22:return pb(t,r,a,r.pendingProps);case 24:return oo(r),l=Cn(an),t===null?(h=Uf(),h===null&&(h=It,g=$f(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=a),h=g),r.memoizedState={parent:l,cache:h},Qf(r),da(r,an,h)):((t.lanes&a)!==0&&(Gf(t,r),al(r,null,null,a),il()),h=t.memoizedState,g=r.memoizedState,h.parent===l?(l=g.cache,da(r,an,l),l!==h.cache&&Vf(r,[an],a,!0)):(h={parent:l,cache:l},r.memoizedState=h,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=h),da(r,an,l))),En(t,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Mi(t){t.flags|=4}function Op(t,r,a,l,h){if((r=(t.mode&32)!=0)&&(r=!1),r){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if(Gb())t.flags|=8192;else throw co=jc,Kf}else t.flags&=-16777217}function kb(t,r){if(r.type!=="stylesheet"||r.state.loading&4)t.flags&=-16777217;else if(t.flags|=16777216,!z2(r))if(Gb())t.flags|=8192;else throw co=jc,Kf}function tu(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag===22?536870912:bi(),t.lanes|=r,fs|=r)}function dl(t,r){if(!st)switch(t.tailMode){case"hidden":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function Ht(t){var r=t.alternate!==null&&t.alternate.child===t.child,a=0,l=0;if(r)for(var h=t.child;h!==null;)a|=h.lanes|h.childLanes,l|=h.subtreeFlags&65011712,l|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)a|=h.lanes|h.childLanes,l|=h.subtreeFlags,l|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=l,t.childLanes=a,r}function GT(t,r,a){var l=r.pendingProps;switch(jf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ht(r),null;case 1:return Ht(r),null;case 3:return a=r.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),Ri(an),We(),a.pendingContext&&(a.pendingContext=(a.context=a.pendingContext,null)),(t===null||t.child===null)&&(Zo(r)?Mi(r):t===null||t.memoizedState.isDehydrated&&!(r.flags&256)||(r.flags|=1024,Ff())),Ht(r),null;case 26:var h=r.type,g=r.memoizedState;return t===null?(Mi(r),g===null?(Ht(r),Op(r,h,null,l,a)):(Ht(r),kb(r,g))):g?g===t.memoizedState?(Ht(r),r.flags&=-16777217):(Mi(r),Ht(r),kb(r,g)):(t=t.memoizedProps,t!==l&&Mi(r),Ht(r),Op(r,h,t,l,a)),null;case 27:if(wt(r),a=mt.current,h=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Mi(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Ht(r),null}t=Ae.current,Zo(r)?a1(r,t):(t=P2(h,l,a),r.stateNode=t,Mi(r))}return Ht(r),null;case 5:if(wt(r),h=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Mi(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Ht(r),null}if(g=Ae.current,Zo(r))a1(r,g);else{var S=gu(mt.current);switch(g){case 1:g=S.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=S.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=S.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=S.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=S.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof l.is=="string"?S.createElement("select",{is:l.is}):S.createElement("select"),l.multiple?g.multiple=!0:l.size&&(g.size=l.size);break;default:g=typeof l.is=="string"?S.createElement(h,{is:l.is}):S.createElement(h)}}g[He]=r,g[Ve]=l;e:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)g.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===r)break e;for(;S.sibling===null;){if(S.return===null||S.return===r)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}r.stateNode=g;e:switch(Tn(g,h,l),h){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Mi(r)}}return Ht(r),Op(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,a),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==l&&Mi(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(t=mt.current,Zo(r)){if(t=r.stateNode,a=r.memoizedProps,l=null,h=Sn,h!==null)switch(h.tag){case 27:case 5:l=h.memoizedProps}t[He]=r,t=!!(t.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||w2(t.nodeValue,a)),t||ua(r,!0)}else t=gu(t).createTextNode(l),t[He]=r,r.stateNode=t}return Ht(r),null;case 31:if(a=r.memoizedState,t===null||t.memoizedState!==null){if(l=Zo(r),a!==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[He]=r}else io(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Ht(r),t=!1}else a=Ff(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return r.flags&256?(fr(r),r):(fr(r),null);if(r.flags&128)throw Error(s(558))}return Ht(r),null;case 13:if(l=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Zo(r),l!==null&&l.dehydrated!==null){if(t===null){if(!h)throw Error(s(318));if(h=r.memoizedState,h=h===null?null:h.dehydrated,!h)throw Error(s(317));h[He]=r}else io(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Ht(r),h=!1}else h=Ff(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return r.flags&256?(fr(r),r):(fr(r),null)}return fr(r),r.flags&128?(r.lanes=a,r):(a=l!==null,t=t!==null&&t.memoizedState!==null,a&&(l=r.child,h=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(h=l.alternate.memoizedState.cachePool.pool),g=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==h&&(l.flags|=2048)),a!==t&&a&&(r.child.flags|=8192),tu(r,r.updateQueue),Ht(r),null);case 4:return We(),t===null&&g2(r.stateNode.containerInfo),Ht(r),null;case 10:return Ri(r.type),Ht(r),null;case 19:if(je(Yt),l=r.memoizedState,l===null)return Ht(r),null;if(h=(r.flags&128)!=0,g=l.rendering,g===null)if(h)dl(l,!1);else{if(Gt!==0||t!==null&&t.flags&128)for(t=r.child;t!==null;){if(g=Hc(t),g!==null){for(r.flags|=128,dl(l,!1),t=g.updateQueue,r.updateQueue=t,tu(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)e1(a,t),a=a.sibling;return Pe(Yt,Yt.current&1|2),st&&Ei(r,l.treeForkCount),r.child}t=t.sibling}l.tail!==null&&Ut()>ou&&(r.flags|=128,h=!0,dl(l,!1),r.lanes=4194304)}else{if(!h)if(t=Hc(g),t!==null){if(r.flags|=128,h=!0,t=t.updateQueue,r.updateQueue=t,tu(r,t),dl(l,!0),l.tail===null&&l.tailMode==="hidden"&&!g.alternate&&!st)return Ht(r),null}else 2*Ut()-l.renderingStartTime>ou&&a!==536870912&&(r.flags|=128,h=!0,dl(l,!1),r.lanes=4194304);l.isBackwards?(g.sibling=r.child,r.child=g):(t=l.last,t===null?r.child=g:t.sibling=g,l.last=g)}return l.tail===null?(Ht(r),null):(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Ut(),t.sibling=null,a=Yt.current,Pe(Yt,h?a&1|2:a&1),st&&Ei(r,l.treeForkCount),t);case 22:case 23:return fr(r),Zf(),l=r.memoizedState!==null,t===null?l&&(r.flags|=8192):t.memoizedState!==null!==l&&(r.flags|=8192),l?a&536870912&&!(r.flags&128)&&(Ht(r),r.subtreeFlags&6&&(r.flags|=8192)):Ht(r),a=r.updateQueue,a!==null&&tu(r,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==a&&(r.flags|=2048),t!==null&&je(so),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Ri(an),Ht(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function JT(t,r){switch(jf(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Ri(an),We(),t=r.flags,t&65536&&!(t&128)?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return wt(r),null;case 31:if(r.memoizedState!==null){if(fr(r),r.alternate===null)throw Error(s(340));io()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(fr(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));io()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return je(Yt),null;case 4:return We(),null;case 10:return Ri(r.type),null;case 22:case 23:return fr(r),Zf(),t!==null&&je(so),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Ri(an),null;case 25:return null;default:return null}}function Sb(t,r){switch(jf(r),r.tag){case 3:Ri(an),We();break;case 26:case 27:case 5:wt(r);break;case 4:We();break;case 31:r.memoizedState!==null&&fr(r);break;case 13:fr(r);break;case 19:je(Yt);break;case 10:Ri(r.type);break;case 22:case 23:fr(r),Zf(),t!==null&&je(so);break;case 24:Ri(an)}}function fl(t,r){try{var a=r.updateQueue,l=a===null?null:a.lastEffect;if(l!==null){var h=l.next;a=h;do{if((a.tag&t)===t){l=void 0;var g=a.create,S=a.inst;l=g(),S.destroy=l}a=a.next}while(a!==h)}}catch(D){Et(r,r.return,D)}}function ma(t,r,a){try{var l=r.updateQueue,h=l===null?null:l.lastEffect;if(h!==null){var g=h.next;l=g;do{if((l.tag&t)===t){var S=l.inst,D=S.destroy;if(D!==void 0){S.destroy=void 0,h=r;var H=a,ne=D;try{ne()}catch(he){Et(h,H,he)}}}l=l.next}while(l!==g)}}catch(he){Et(r,r.return,he)}}function Cb(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{v1(r,a)}catch(l){Et(t,t.return,l)}}}function Eb(t,r,a){a.props=mo(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(l){Et(t,r,l)}}function pl(t,r){try{var a=t.ref;if(a!==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 a=="function"?t.refCleanup=a(l):a.current=l}}catch(h){Et(t,r,h)}}function ci(t,r){var a=t.ref,l=t.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(h){Et(t,r,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(h){Et(t,r,h)}else a.current=null}function Tb(t){var r=t.type,a=t.memoizedProps,l=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(h){Et(t,t.return,h)}}function Pp(t,r,a){try{var l=t.stateNode;gR(l,t.type,a,r),l[Ve]=r}catch(h){Et(t,t.return,h)}}function Rb(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&xa(t.type)||t.tag===4}function Mp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Rb(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&&xa(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 Lp(t,r,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(t),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=xr));else if(l!==4&&(l===27&&xa(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(Lp(t,r,a),t=t.sibling;t!==null;)Lp(t,r,a),t=t.sibling}function nu(t,r,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?a.insertBefore(t,r):a.appendChild(t);else if(l!==4&&(l===27&&xa(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(nu(t,r,a),t=t.sibling;t!==null;)nu(t,r,a),t=t.sibling}function Db(t){var r=t.stateNode,a=t.memoizedProps;try{for(var l=t.type,h=r.attributes;h.length;)r.removeAttributeNode(h[0]);Tn(r,l,a),r[He]=t,r[Ve]=a}catch(g){Et(t,t.return,g)}}var Li=!1,ln=!1,Np=!1,Ob=typeof WeakSet=="function"?WeakSet:Set,kn=null;function XT(t,r){if(t=t.containerInfo,eh=ku,t=Wv(t),Tf(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var h=l.anchorOffset,g=l.focusNode;l=l.focusOffset;try{a.nodeType,g.nodeType}catch{a=null;break e}var S=0,D=-1,H=-1,ne=0,he=0,ge=t,ae=null;t:for(;;){for(var ue;ge!==a||h!==0&&ge.nodeType!==3||(D=S+h),ge!==g||l!==0&&ge.nodeType!==3||(H=S+l),ge.nodeType===3&&(S+=ge.nodeValue.length),(ue=ge.firstChild)!==null;)ae=ge,ge=ue;for(;;){if(ge===t)break t;if(ae===a&&++ne===h&&(D=S),ae===g&&++he===l&&(H=S),(ue=ge.nextSibling)!==null)break;ge=ae,ae=ge.parentNode}ge=ue}a=D===-1||H===-1?null:{start:D,end:H}}else a=null}a||(a={start:0,end:0})}else a=null;for(th={focusedElem:t,selectionRange:a},ku=!1,kn=r;kn!==null;)if(r=kn,t=r.child,r.subtreeFlags&1028&&t!==null)t.return=r,kn=t;else for(;kn!==null;){switch(r=kn,g=r.alternate,t=r.flags,r.tag){case 0:if(t&4&&(t=r.updateQueue,t=t===null?null:t.events,t!==null))for(a=0;a<t.length;a++)h=t[a],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if(t&1024&&g!==null){t=void 0,a=r,h=g.memoizedProps,g=g.memoizedState,l=a.stateNode;try{var De=mo(a.type,h);t=l.getSnapshotBeforeUpdate(De,g),l.__reactInternalSnapshotBeforeUpdate=t}catch(Ie){Et(a,a.return,Ie)}}break;case 3:if(t&1024){if(t=r.stateNode.containerInfo,a=t.nodeType,a===9)ih(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":ih(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,kn=t;break}kn=r.return}}function Pb(t,r,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Ii(t,a),l&4&&fl(5,a);break;case 1:if(Ii(t,a),l&4)if(t=a.stateNode,r===null)try{t.componentDidMount()}catch(S){Et(a,a.return,S)}else{var h=mo(a.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(h,r,t.__reactInternalSnapshotBeforeUpdate)}catch(S){Et(a,a.return,S)}}l&64&&Cb(a),l&512&&pl(a,a.return);break;case 3:if(Ii(t,a),l&64&&(t=a.updateQueue,t!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{v1(t,r)}catch(S){Et(a,a.return,S)}}break;case 27:r===null&&l&4&&Db(a);case 26:case 5:Ii(t,a),r===null&&l&4&&Tb(a),l&512&&pl(a,a.return);break;case 12:Ii(t,a);break;case 31:Ii(t,a),l&4&&Nb(t,a);break;case 13:Ii(t,a),l&4&&Ib(t,a),l&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=oR.bind(null,a),SR(t,a))));break;case 22:if(l=a.memoizedState!==null||Li,!l){r=r!==null&&r.memoizedState!==null||ln,h=Li;var g=ln;Li=l,(ln=r)&&!g?Ai(t,a,(a.subtreeFlags&8772)!=0):Ii(t,a),Li=h,ln=g}break;case 30:break;default:Ii(t,a)}}function Mb(t){var r=t.alternate;r!==null&&(t.alternate=null,Mb(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&wn(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 Wt=null,Qn=!1;function Ni(t,r,a){for(a=a.child;a!==null;)Lb(t,r,a),a=a.sibling}function Lb(t,r,a){if(Jt&&typeof Jt.onCommitFiberUnmount=="function")try{Jt.onCommitFiberUnmount(wr,a)}catch{}switch(a.tag){case 26:ln||ci(a,r),Ni(t,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ln||ci(a,r);var l=Wt,h=Qn;xa(a.type)&&(Wt=a.stateNode,Qn=!1),Ni(t,r,a),xl(a.stateNode),Wt=l,Qn=h;break;case 5:ln||ci(a,r);case 6:if(l=Wt,h=Qn,Wt=null,Ni(t,r,a),Wt=l,Qn=h,Wt!==null)if(Qn)try{(Wt.nodeType===9?Wt.body:Wt.nodeName==="HTML"?Wt.ownerDocument.body:Wt).removeChild(a.stateNode)}catch(g){Et(a,r,g)}else try{Wt.removeChild(a.stateNode)}catch(g){Et(a,r,g)}break;case 18:Wt!==null&&(Qn?(t=Wt,E2(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ws(t)):E2(Wt,a.stateNode));break;case 4:l=Wt,h=Qn,Wt=a.stateNode.containerInfo,Qn=!0,Ni(t,r,a),Wt=l,Qn=h;break;case 0:case 11:case 14:case 15:ma(2,a,r),ln||ma(4,a,r),Ni(t,r,a);break;case 1:ln||(ci(a,r),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Eb(a,r,l)),Ni(t,r,a);break;case 21:Ni(t,r,a);break;case 22:ln=(l=ln)||a.memoizedState!==null,Ni(t,r,a),ln=l;break;default:Ni(t,r,a)}}function Nb(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ws(t)}catch(a){Et(r,r.return,a)}}}function Ib(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ws(t)}catch(a){Et(r,r.return,a)}}function YT(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new Ob),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new Ob),r;default:throw Error(s(435,t.tag))}}function ru(t,r){var a=YT(t);r.forEach(function(l){if(!a.has(l)){a.add(l);var h=sR.bind(null,t,l);l.then(h,h)}})}function Gn(t,r){var a=r.deletions;if(a!==null)for(var l=0;l<a.length;l++){var h=a[l],g=t,S=r,D=S;e:for(;D!==null;){switch(D.tag){case 27:if(xa(D.type)){Wt=D.stateNode,Qn=!1;break e}break;case 5:Wt=D.stateNode,Qn=!1;break e;case 3:case 4:Wt=D.stateNode.containerInfo,Qn=!0;break e}D=D.return}if(Wt===null)throw Error(s(160));Lb(g,S,h),Wt=null,Qn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Ab(r,t),r=r.sibling}var Qr=null;function Ab(t,r){var a=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Gn(r,t),Jn(t),l&4&&(ma(3,t,t.return),fl(3,t),ma(5,t,t.return));break;case 1:Gn(r,t),Jn(t),l&512&&(ln||a===null||ci(a,a.return)),l&64&&Li&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var h=Qr;if(Gn(r,t),Jn(t),l&512&&(ln||a===null||ci(a,a.return)),l&4){var g=a===null?null:a.memoizedState;if(l=t.memoizedState,a===null)if(l===null)if(t.stateNode===null){e:{l=t.type,a=t.memoizedProps,h=h.ownerDocument||h;t:switch(l){case"title":g=h.getElementsByTagName("title")[0],(!g||g[ut]||g[He]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=h.createElement(l),h.head.insertBefore(g,h.querySelector("head > title"))),Tn(g,l,a),g[He]=t,Xt(g),l=g;break e;case"link":var S=q2("link","href",h).get(l+(a.href||""));if(S){for(var D=0;D<S.length;D++)if(g=S[D],g.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&g.getAttribute("rel")===(a.rel==null?null:a.rel)&&g.getAttribute("title")===(a.title==null?null:a.title)&&g.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){S.splice(D,1);break t}}g=h.createElement(l),Tn(g,l,a),h.head.appendChild(g);break;case"meta":if(S=q2("meta","content",h).get(l+(a.content||""))){for(D=0;D<S.length;D++)if(g=S[D],g.getAttribute("content")===(a.content==null?null:""+a.content)&&g.getAttribute("name")===(a.name==null?null:a.name)&&g.getAttribute("property")===(a.property==null?null:a.property)&&g.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&g.getAttribute("charset")===(a.charSet==null?null:a.charSet)){S.splice(D,1);break t}}g=h.createElement(l),Tn(g,l,a),h.head.appendChild(g);break;default:throw Error(s(468,l))}g[He]=t,Xt(g),l=g}t.stateNode=l}else j2(h,t.type,t.stateNode);else t.stateNode=A2(h,l,t.memoizedProps);else g===l?l===null&&t.stateNode!==null&&Pp(t,t.memoizedProps,a.memoizedProps):(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,l===null?j2(h,t.type,t.stateNode):A2(h,l,t.memoizedProps))}break;case 27:Gn(r,t),Jn(t),l&512&&(ln||a===null||ci(a,a.return)),a!==null&&l&4&&Pp(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Gn(r,t),Jn(t),l&512&&(ln||a===null||ci(a,a.return)),t.flags&32){h=t.stateNode;try{xi(h,"")}catch(De){Et(t,t.return,De)}}l&4&&t.stateNode!=null&&(h=t.memoizedProps,Pp(t,h,a===null?h:a.memoizedProps)),l&1024&&(Np=!0);break;case 6:if(Gn(r,t),Jn(t),l&4){if(t.stateNode===null)throw Error(s(162));l=t.memoizedProps,a=t.stateNode;try{a.nodeValue=l}catch(De){Et(t,t.return,De)}}break;case 3:if(bu=null,h=Qr,Qr=yu(r.containerInfo),Gn(r,t),Qr=h,Jn(t),l&4&&a!==null&&a.memoizedState.isDehydrated)try{ws(r.containerInfo)}catch(De){Et(t,t.return,De)}Np&&(Np=!1,qb(t));break;case 4:l=Qr,Qr=yu(t.stateNode.containerInfo),Gn(r,t),Jn(t),Qr=l;break;case 12:Gn(r,t),Jn(t);break;case 31:Gn(r,t),Jn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,ru(t,l)));break;case 13:Gn(r,t),Jn(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(au=Ut()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,ru(t,l)));break;case 22:h=t.memoizedState!==null;var H=a!==null&&a.memoizedState!==null,ne=Li,he=ln;if(Li=ne||h,ln=he||H,Gn(r,t),ln=he,Li=ne,Jn(t),l&8192)e:for(r=t.stateNode,r._visibility=h?r._visibility&-2:r._visibility|1,h&&(a===null||H||Li||ln||go(t)),a=null,r=t;;){if(r.tag===5||r.tag===26){if(a===null){H=a=r;try{if(g=H.stateNode,h)S=g.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{D=H.stateNode;var ge=H.memoizedProps.style,ae=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;D.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(De){Et(H,H.return,De)}}}else if(r.tag===6){if(a===null){H=r;try{H.stateNode.nodeValue=h?"":H.memoizedProps}catch(De){Et(H,H.return,De)}}}else if(r.tag===18){if(a===null){H=r;try{var ue=H.stateNode;h?T2(ue,!0):T2(H.stateNode,!1)}catch(De){Et(H,H.return,De)}}}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;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=t.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,ru(t,a))));break;case 19:Gn(r,t),Jn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,ru(t,l)));break;case 30:break;case 21:break;default:Gn(r,t),Jn(t)}}function Jn(t){var r=t.flags;if(r&2){try{for(var a,l=t.return;l!==null;){if(Rb(l)){a=l;break}l=l.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var h=a.stateNode;nu(t,Mp(t),h);break;case 5:var g=a.stateNode;a.flags&32&&(xi(g,""),a.flags&=-33),nu(t,Mp(t),g);break;case 3:case 4:var S=a.stateNode.containerInfo;Lp(t,Mp(t),S);break;default:throw Error(s(161))}}catch(D){Et(t,t.return,D)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function qb(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;qb(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Ii(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Pb(t,r.alternate,r),r=r.sibling}function go(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:ma(4,r,r.return),go(r);break;case 1:ci(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&Eb(r,r.return,a),go(r);break;case 27:xl(r.stateNode);case 26:case 5:ci(r,r.return),go(r);break;case 22:r.memoizedState===null&&go(r);break;case 30:go(r);break;default:go(r)}t=t.sibling}}function Ai(t,r,a){for(a&&(a=(r.subtreeFlags&8772)!=0),r=r.child;r!==null;){var l=r.alternate,h=t,g=r,S=g.flags;switch(g.tag){case 0:case 11:case 15:Ai(h,g,a),fl(4,g);break;case 1:if(Ai(h,g,a),l=g,h=l.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(ne){Et(l,l.return,ne)}if(l=g,h=l.updateQueue,h!==null){var D=l.stateNode;try{var H=h.shared.hiddenCallbacks;if(H!==null)for(h.shared.hiddenCallbacks=null,h=0;h<H.length;h++)y1(H[h],D)}catch(ne){Et(l,l.return,ne)}}a&&S&64&&Cb(g),pl(g,g.return);break;case 27:Db(g);case 26:case 5:Ai(h,g,a),a&&l===null&&S&4&&Tb(g),pl(g,g.return);break;case 12:Ai(h,g,a);break;case 31:Ai(h,g,a),a&&S&4&&Nb(h,g);break;case 13:Ai(h,g,a),a&&S&4&&Ib(h,g);break;case 22:g.memoizedState===null&&Ai(h,g,a),pl(g,g.return);break;case 30:break;default:Ai(h,g,a)}r=r.sibling}}function Ip(t,r){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Zs(a))}function Ap(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Zs(t))}function Gr(t,r,a,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)jb(t,r,a,l),r=r.sibling}function jb(t,r,a,l){var h=r.flags;switch(r.tag){case 0:case 11:case 15:Gr(t,r,a,l),h&2048&&fl(9,r);break;case 1:Gr(t,r,a,l);break;case 3:Gr(t,r,a,l),h&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Zs(t)));break;case 12:if(h&2048){Gr(t,r,a,l),t=r.stateNode;try{var g=r.memoizedProps,S=g.id,D=g.onPostCommit;typeof D=="function"&&D(S,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(H){Et(r,r.return,H)}}else Gr(t,r,a,l);break;case 31:Gr(t,r,a,l);break;case 13:Gr(t,r,a,l);break;case 23:break;case 22:g=r.stateNode,S=r.alternate,r.memoizedState===null?g._visibility&2?Gr(t,r,a,l):(g._visibility|=2,cs(t,r,a,l,(r.subtreeFlags&10256)!=0||!1)):g._visibility&2?Gr(t,r,a,l):hl(t,r),h&2048&&Ip(S,r);break;case 24:Gr(t,r,a,l),h&2048&&Ap(r.alternate,r);break;default:Gr(t,r,a,l)}}function cs(t,r,a,l,h){for(h&&(h=(r.subtreeFlags&10256)!=0||!1),r=r.child;r!==null;){var g=t,S=r,D=a,H=l,ne=S.flags;switch(S.tag){case 0:case 11:case 15:cs(g,S,D,H,h),fl(8,S);break;case 23:break;case 22:var he=S.stateNode;S.memoizedState===null?(he._visibility|=2,cs(g,S,D,H,h)):he._visibility&2?cs(g,S,D,H,h):hl(g,S),h&&ne&2048&&Ip(S.alternate,S);break;case 24:cs(g,S,D,H,h),h&&ne&2048&&Ap(S.alternate,S);break;default:cs(g,S,D,H,h)}r=r.sibling}}function hl(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=t,l=r,h=l.flags;switch(l.tag){case 22:hl(a,l),h&2048&&Ip(l.alternate,l);break;case 24:hl(a,l),h&2048&&Ap(l.alternate,l);break;default:hl(a,l)}r=r.sibling}}var ml=8192;function us(t,r,a){if(t.subtreeFlags&ml)for(t=t.child;t!==null;)zb(t,r,a),t=t.sibling}function zb(t,r,a){switch(t.tag){case 26:us(t,r,a),t.flags&ml&&t.memoizedState!==null&&AR(a,Qr,t.memoizedState,t.memoizedProps);break;case 5:us(t,r,a);break;case 3:case 4:var l=Qr;Qr=yu(t.stateNode.containerInfo),us(t,r,a),Qr=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=ml,ml=16777216,us(t,r,a),ml=l):us(t,r,a));break;default:us(t,r,a)}}function Fb(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 gl(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];kn=l,Hb(l,t)}Fb(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Bb(t),t=t.sibling}function Bb(t){switch(t.tag){case 0:case 11:case 15:gl(t),t.flags&2048&&ma(9,t,t.return);break;case 3:gl(t);break;case 12:gl(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,iu(t)):gl(t);break;default:gl(t)}}function iu(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];kn=l,Hb(l,t)}Fb(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:ma(8,r,r.return),iu(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,iu(r));break;default:iu(r)}t=t.sibling}}function Hb(t,r){for(;kn!==null;){var a=kn;switch(a.tag){case 0:case 11:case 15:ma(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Zs(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,kn=l;else e:for(a=t;kn!==null;){l=kn;var h=l.sibling,g=l.return;if(Mb(l),l===a){kn=null;break e}if(h!==null){h.return=g,kn=h;break e}kn=g}}}var ZT={getCacheForType:function(t){var r=Cn(an),a=r.data.get(t);return a===void 0&&(a=t(),r.data.set(t,a)),a},cacheSignal:function(){return Cn(an).controller.signal}},eR=typeof WeakMap=="function"?WeakMap:Map,yt=0,It=null,tt=null,it=0,Ct=0,pr=null,ga=!1,ds=!1,qp=!1,qi=0,Gt=0,ya=0,yo=0,jp=0,hr=0,fs=0,yl=null,Xn=null,zp=!1,au=0,Vb=0,ou=1/0,su=null,va=null,hn=0,ba=null,ps=null,ji=0,Fp=0,Bp=null,$b=null,vl=0,Hp=null;function Rr(){return yt&2&&it!==0?it&-it:se.T===null?te():Qp()}function Wb(){if(hr===0)if(!(it&536870912)||st){var t=St;St<<=1,!(St&3932160)&&(St=262144),hr=t}else hr=536870912;return t=dr.current,t!==null&&(t.flags|=32),hr}function Yn(t,r,a){(t===It&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)&&(hs(t,0),wa(t,it,hr,!1)),Ln(t,a),(!(yt&2)||t!==It)&&(t===It&&(!(yt&2)&&(yo|=a),Gt===4&&wa(t,it,hr,!1)),zi(t))}function Ub(t,r,a){if(yt&6)throw Error(s(327));var l=!a&&(r&127)==0&&(r&t.expiredLanes)===0||bn(t,r),h=l?rR(t,r):$p(t,r,!0),g=l;do{if(h===0){ds&&!l&&wa(t,r,0,!1);break}else{if(a=t.current.alternate,g&&!tR(a)){h=$p(t,r,!1),g=!1;continue}if(h===2){if(g=r,t.errorRecoveryDisabledLanes&g)var S=0;else S=t.pendingLanes&-536870913,S=S===0?S&536870912?536870912:0:S;if(S!==0){r=S;e:{var D=t;h=yl;var H=D.current.memoizedState.isDehydrated;if(H&&(hs(D,S).flags|=256),S=$p(D,S,!1),S!==2){if(qp&&!H){D.errorRecoveryDisabledLanes|=g,yo|=g,h=4;break e}g=Xn,Xn=h,g!==null&&(Xn===null?Xn=g:Xn.push.apply(Xn,g))}h=S}if(g=!1,h!==2)continue}}if(h===1){hs(t,0),wa(t,r,0,!0);break}e:{switch(l=t,g=h,g){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:wa(l,r,hr,!ga);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(h=au+300-Ut(),10<h)){if(wa(l,r,hr,!ga),Hr(l,0,!0)!==0)break e;ji=r,l.timeoutHandle=S2(Kb.bind(null,l,a,Xn,su,zp,r,hr,yo,fs,ga,g,"Throttled",-0,0),h);break e}Kb(l,a,Xn,su,zp,r,hr,yo,fs,ga,g,null,-0,0)}}break}while(!0);zi(t)}function Kb(t,r,a,l,h,g,S,D,H,ne,he,ge,ae,ue){if(t.timeoutHandle=-1,ge=r.subtreeFlags,ge&8192||(ge&16785408)==16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xr},zb(r,g,ge);var De=(g&62914560)===g?au-Ut():(g&4194048)===g?Vb-Ut():0;if(De=qR(ge,De),De!==null){ji=g,t.cancelPendingCommit=De(t2.bind(null,t,r,g,a,l,h,S,D,H,he,ge,null,ae,ue)),wa(t,g,S,!ne);return}}t2(t,r,g,a,l,h,S,D,H)}function tR(t){for(var r=t;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var h=a[l],g=h.getSnapshot;h=h.value;try{if(!cr(g(),h))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;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 wa(t,r,a,l){r&=~jp,r&=~yo,t.suspendedLanes|=r,t.pingedLanes&=~r,l&&(t.warmLanes|=r),l=t.expirationTimes;for(var h=r;0<h;){var g=31-gt(h),S=1<<g;l[g]=-1,h&=~S}a!==0&&Fn(t,a,r)}function lu(){return yt&6?!0:(bl(0,!1),!1)}function Vp(){if(tt!==null){if(Ct===0)var t=tt.return;else t=tt,Ti=ao=null,ap(t),is=null,tl=0,t=tt;for(;t!==null;)Sb(t.alternate,t),t=t.return;tt=null}}function hs(t,r){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,bR(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),ji=0,Vp(),It=t,tt=a=Ci(t.current,null),it=r,Ct=0,pr=null,ga=!1,ds=bn(t,r),qp=!1,fs=hr=jp=yo=ya=Gt=0,Xn=yl=null,zp=!1,r&8&&(r|=r&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=r;0<l;){var h=31-gt(l),g=1<<h;r|=t[h],l&=~g}return qi=r,Dc(),a}function Qb(t,r){Ke=null,se.H=cl,r===rs||r===qc?(r=p1(),Ct=3):r===Kf?(r=p1(),Ct=4):Ct=r===_p?8:typeof r=="object"&&r&&typeof r.then=="function"?6:1,pr=r,tt===null&&(Gt=1,Xc(t,Sr(r,t.current)))}function Gb(){var t=dr.current;return t===null?!0:(it&4194048)===it?Kr===null:(it&62914560)===it||it&536870912?t===Kr:!1}function Jb(){var t=se.H;return se.H=cl,t===null?cl:t}function Xb(){var t=se.A;return se.A=ZT,t}function cu(){Gt=4,ga||(it&4194048)!==it&&dr.current!==null||(ds=!0),!(ya&134217727)&&!(yo&134217727)||It===null||wa(It,it,hr,!1)}function $p(t,r,a){var l=yt;yt|=2;var h=Jb(),g=Xb();(It!==t||it!==r)&&(su=null,hs(t,r)),r=!1;var S=Gt;e:do try{if(Ct!==0&&tt!==null){var D=tt,H=pr;switch(Ct){case 8:Vp(),S=6;break e;case 3:case 2:case 9:case 6:dr.current===null&&(r=!0);var ne=Ct;if(Ct=0,pr=null,ms(t,D,H,ne),a&&ds){S=0;break e}break;default:ne=Ct,Ct=0,pr=null,ms(t,D,H,ne)}}nR(),S=Gt;break}catch(he){Qb(t,he)}while(!0);return r&&t.shellSuspendCounter++,Ti=ao=null,yt=l,se.H=h,se.A=g,tt===null&&(It=null,it=0,Dc()),S}function nR(){for(;tt!==null;)Yb(tt)}function rR(t,r){var a=yt;yt|=2;var l=Jb(),h=Xb();It!==t||it!==r?(su=null,ou=Ut()+500,hs(t,r)):ds=bn(t,r);e:do try{if(Ct!==0&&tt!==null){r=tt;var g=pr;t:switch(Ct){case 1:Ct=0,pr=null,ms(t,r,g,1);break;case 2:case 9:if(d1(g)){Ct=0,pr=null,Zb(r);break}r=function(){Ct!==2&&Ct!==9||It!==t||(Ct=7),zi(t)},g.then(r,r);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:d1(g)?(Ct=0,pr=null,Zb(r)):(Ct=0,pr=null,ms(t,r,g,7));break;case 5:var S=null;switch(tt.tag){case 26:S=tt.memoizedState;case 5:case 27:var D=tt;if(S?z2(S):D.stateNode.complete){Ct=0,pr=null;var H=D.sibling;if(H!==null)tt=H;else{var ne=D.return;ne===null?tt=null:(tt=ne,uu(ne))}break t}}Ct=0,pr=null,ms(t,r,g,5);break;case 6:Ct=0,pr=null,ms(t,r,g,6);break;case 8:Vp(),Gt=6;break e;default:throw Error(s(462))}}iR();break}catch(he){Qb(t,he)}while(!0);return Ti=ao=null,se.H=l,se.A=h,yt=a,tt===null?(It=null,it=0,Dc(),Gt):0}function iR(){for(;tt!==null&&!ta();)Yb(tt)}function Yb(t){var r=xb(t.alternate,t,qi);t.memoizedProps=t.pendingProps,r===null?uu(t):tt=r}function Zb(t){var r=t,a=r.alternate;switch(r.tag){case 15:case 0:r=gb(a,r,r.pendingProps,r.type,void 0,it);break;case 11:r=gb(a,r,r.pendingProps,r.type.render,r.ref,it);break;case 5:ap(r);default:Sb(a,r),r=tt=e1(r,qi),r=xb(a,r,qi)}t.memoizedProps=t.pendingProps,r===null?uu(t):tt=r}function ms(t,r,a,l){Ti=ao=null,ap(r),is=null,tl=0;var h=r.return;try{if(UT(t,h,r,a,it)){Gt=1,Xc(t,Sr(a,t.current)),tt=null;return}}catch(g){if(h!==null)throw tt=h,g;Gt=1,Xc(t,Sr(a,t.current)),tt=null;return}r.flags&32768?(st||l===1?t=!0:ds||it&536870912?t=!1:(ga=t=!0,(l===2||l===9||l===3||l===6)&&(l=dr.current,l!==null&&l.tag===13&&(l.flags|=16384))),e2(r,t)):uu(r)}function uu(t){var r=t;do{if(r.flags&32768){e2(r,ga);return}t=r.return;var a=GT(r.alternate,r,qi);if(a!==null){tt=a;return}if(r=r.sibling,r!==null){tt=r;return}tt=r=t}while(r!==null);Gt===0&&(Gt=5)}function e2(t,r){do{var a=JT(t.alternate,t);if(a!==null){a.flags&=32767,tt=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(t=t.sibling,t!==null)){tt=t;return}tt=t=a}while(t!==null);Gt=6,tt=null}function t2(t,r,a,l,h,g,S,D,H){t.cancelPendingCommit=null;do du();while(hn!==0);if(yt&6)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(g=r.lanes|r.childLanes,g|=Mf,wi(t,a,g,S,D,H),t===It&&(tt=It=null,it=0),ps=r,ba=t,ji=a,Fp=g,Bp=h,$b=l,r.subtreeFlags&10256||r.flags&10256?(t.callbackNode=null,t.callbackPriority=0,lR(zt,function(){return o2(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(r.flags&13878)!=0,r.subtreeFlags&13878||l){l=se.T,se.T=null,h=Q.p,Q.p=2,S=yt,yt|=4;try{XT(t,r,a)}finally{yt=S,Q.p=h,se.T=l}}hn=1,n2(),r2(),i2()}}function n2(){if(hn===1){hn=0;var t=ba,r=ps,a=(r.flags&13878)!=0;if(r.subtreeFlags&13878||a){a=se.T,se.T=null;var l=Q.p;Q.p=2;var h=yt;yt|=4;try{Ab(r,t);var g=th,S=Wv(t.containerInfo),D=g.focusedElem,H=g.selectionRange;if(S!==D&&D&&D.ownerDocument&&$v(D.ownerDocument.documentElement,D)){if(H!==null&&Tf(D)){var ne=H.start,he=H.end;if(he===void 0&&(he=ne),"selectionStart"in D)D.selectionStart=ne,D.selectionEnd=Math.min(he,D.value.length);else{var ge=D.ownerDocument||document,ae=ge&&ge.defaultView||window;if(ae.getSelection){var ue=ae.getSelection(),De=D.textContent.length,Ie=Math.min(H.start,De),Ot=H.end===void 0?Ie:Math.min(H.end,De);!ue.extend&&Ie>Ot&&(S=Ot,Ot=Ie,Ie=S);var G=Vv(D,Ie),U=Vv(D,Ot);if(G&&U&&(ue.rangeCount!==1||ue.anchorNode!==G.node||ue.anchorOffset!==G.offset||ue.focusNode!==U.node||ue.focusOffset!==U.offset)){var ee=ge.createRange();ee.setStart(G.node,G.offset),ue.removeAllRanges(),Ie>Ot?(ue.addRange(ee),ue.extend(U.node,U.offset)):(ee.setEnd(U.node,U.offset),ue.addRange(ee))}}}}for(ge=[],ue=D;ue=ue.parentNode;)ue.nodeType===1&&ge.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<ge.length;D++){var me=ge[D];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}ku=!!eh,th=eh=null}finally{yt=h,Q.p=l,se.T=a}}t.current=r,hn=2}}function r2(){if(hn===2){hn=0;var t=ba,r=ps,a=(r.flags&8772)!=0;if(r.subtreeFlags&8772||a){a=se.T,se.T=null;var l=Q.p;Q.p=2;var h=yt;yt|=4;try{Pb(t,r.alternate,r)}finally{yt=h,Q.p=l,se.T=a}}hn=3}}function i2(){if(hn===4||hn===3){hn=0,gi();var t=ba,r=ps,a=ji,l=$b;r.subtreeFlags&10256||r.flags&10256?hn=5:(hn=0,ps=ba=null,a2(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(va=null),j(a),r=r.stateNode,Jt&&typeof Jt.onCommitFiberRoot=="function")try{Jt.onCommitFiberRoot(wr,r,void 0,(r.current.flags&128)==128)}catch{}if(l!==null){r=se.T,h=Q.p,Q.p=2,se.T=null;try{for(var g=t.onRecoverableError,S=0;S<l.length;S++){var D=l[S];g(D.value,{componentStack:D.stack})}}finally{se.T=r,Q.p=h}}ji&3&&du(),zi(t),h=t.pendingLanes,a&261930&&h&42?t===Hp?vl++:(vl=0,Hp=t):vl=0,bl(0,!1)}}function a2(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Zs(r)))}function du(){return n2(),r2(),i2(),o2()}function o2(){if(hn!==5)return!1;var t=ba,r=Fp;Fp=0;var a=j(ji),l=se.T,h=Q.p;try{Q.p=32>a?32:a,se.T=null,a=Bp,Bp=null;var g=ba,S=ji;if(hn=0,ps=ba=null,ji=0,yt&6)throw Error(s(331));var D=yt;if(yt|=4,Bb(g.current),jb(g,g.current,S,a),yt=D,bl(0,!1),Jt&&typeof Jt.onPostCommitFiberRoot=="function")try{Jt.onPostCommitFiberRoot(wr,g)}catch{}return!0}finally{Q.p=h,se.T=l,a2(t,r)}}function s2(t,r,a){r=Sr(a,r),r=wp(t.stateNode,r,2),t=po(t,r,2),t!==null&&(Ln(t,2),zi(t))}function Et(t,r,a){if(t.tag===3)s2(t,t,a);else for(;r!==null;){if(r.tag===3){s2(r,t,a);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(va===null||!va.has(l))){t=Sr(a,t),a=lb(2),l=po(r,a,2),l!==null&&(cb(a,l,r,t),Ln(l,2),zi(l));break}}r=r.return}}function Wp(t,r,a){var l=t.pingCache;if(l===null){l=t.pingCache=new eR;var h=new Set;l.set(r,h)}else h=l.get(r),h===void 0&&(h=new Set,l.set(r,h));h.has(a)||(qp=!0,h.add(a),t=aR.bind(null,t,r,a),r.then(t,t))}function aR(t,r,a){var l=t.pingCache;l!==null&&l.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,It===t&&(it&a)===a&&(Gt===4||Gt===3&&(it&62914560)===it&&300>Ut()-au?!(yt&2)&&hs(t,0):jp|=a,fs===it&&(fs=0)),zi(t)}function l2(t,r){r===0&&(r=bi()),t=no(t,r),t!==null&&(Ln(t,r),zi(t))}function oR(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),l2(t,a)}function sR(t,r){var a=0;switch(t.tag){case 31:case 13:var l=t.stateNode,h=t.memoizedState;h!==null&&(a=h.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),l2(t,a)}function lR(t,r){return Pn(t,r)}var fu=null,gs=null,Up=!1,pu=!1,Kp=!1,_a=0;function zi(t){t!==gs&&t.next===null&&(gs===null?fu=gs=t:gs=gs.next=t),pu=!0,Up||(Up=!0,uR())}function bl(t,r){if(!Kp&&pu){Kp=!0;do for(var a=!1,l=fu;l!==null;){if(!r)if(t!==0){var h=l.pendingLanes;if(h===0)var g=0;else{var S=l.suspendedLanes,D=l.pingedLanes;g=(1<<31-gt(42|t)+1)-1,g&=h&~(S&~D),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,f2(l,g))}else g=it,g=Hr(l,l===It?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),!(g&3)||bn(l,g)||(a=!0,f2(l,g));l=l.next}while(a);Kp=!1}}function cR(){c2()}function c2(){pu=Up=!1;var t=0;_a!==0&&vR()&&(t=_a);for(var r=Ut(),a=null,l=fu;l!==null;){var h=l.next,g=u2(l,r);g===0?(l.next=null,a===null?fu=h:a.next=h,h===null&&(gs=a)):(a=l,(t!==0||g&3)&&(pu=!0)),l=h}hn!==0&&hn!==5||bl(t,!1),_a!==0&&(_a=0)}function u2(t,r){for(var a=t.suspendedLanes,l=t.pingedLanes,h=t.expirationTimes,g=t.pendingLanes&-62914561;0<g;){var S=31-gt(g),D=1<<S,H=h[S];H===-1?((D&a)===0||(D&l)!==0)&&(h[S]=ar(D,r)):H<=r&&(t.expiredLanes|=D),g&=~D}if(r=It,a=it,a=Hr(t,t===r?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,a===0||t===r&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&dn(l),t.callbackNode=null,t.callbackPriority=0;if(!(a&3)||bn(t,a)){if(r=a&-a,r===t.callbackPriority)return r;switch(l!==null&&dn(l),j(a)){case 2:case 8:a=ni;break;case 32:a=zt;break;case 268435456:a=_t;break;default:a=zt}return l=d2.bind(null,t),a=Pn(a,l),t.callbackPriority=r,t.callbackNode=a,r}return l!==null&&l!==null&&dn(l),t.callbackPriority=2,t.callbackNode=null,2}function d2(t,r){if(hn!==0&&hn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(du()&&t.callbackNode!==a)return null;var l=it;return l=Hr(t,t===It?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(Ub(t,l,r),u2(t,Ut()),t.callbackNode!=null&&t.callbackNode===a?d2.bind(null,t):null)}function f2(t,r){if(du())return null;Ub(t,r,!0)}function uR(){wR(function(){yt&6?Pn(fn,cR):c2()})}function Qp(){if(_a===0){var t=ts;t===0&&(t=_r,_r<<=1,!(_r&261888)&&(_r=256)),_a=t}return _a}function p2(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Vo(""+t)}function h2(t,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,t.id&&a.setAttribute("form",t.id),r.parentNode.insertBefore(a,r),t=new FormData(t),a.parentNode.removeChild(a),t}function dR(t,r,a,l,h){if(r==="submit"&&a&&a.stateNode===h){var g=p2((h[Ve]||null).action),S=l.submitter;S&&(r=(r=S[Ve]||null)?p2(r.formAction):S.getAttribute("formAction"),r!==null&&(g=r,S=null));var D=new u("action","action",null,l,h);t.push({event:D,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(_a!==0){var H=S?h2(h,S):new FormData(h);hp(a,{pending:!0,data:H,method:h.method,action:g},null,H)}}else typeof g=="function"&&(D.preventDefault(),H=S?h2(h,S):new FormData(h),hp(a,{pending:!0,data:H,method:h.method,action:g},g,H))},currentTarget:h}]})}}for(var Gp=0;Gp<Pf.length;Gp++){var Jp=Pf[Gp];Ur(Jp.toLowerCase(),"on"+(Jp[0].toUpperCase()+Jp.slice(1)))}Ur(Qv,"onAnimationEnd"),Ur(Gv,"onAnimationIteration"),Ur(Jv,"onAnimationStart"),Ur("dblclick","onDoubleClick"),Ur("focusin","onFocus"),Ur("focusout","onBlur"),Ur(ET,"onTransitionRun"),Ur(TT,"onTransitionStart"),Ur(RT,"onTransitionCancel"),Ur(Xv,"onTransitionEnd"),ia("onMouseEnter",["mouseout","mouseover"]),ia("onMouseLeave",["mouseout","mouseover"]),ia("onPointerEnter",["pointerout","pointerover"]),ia("onPointerLeave",["pointerout","pointerover"]),ai("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ai("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ai("onBeforeInput",["compositionend","keypress","textInput","paste"]),ai("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ai("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ai("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wl="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(" "),fR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wl));function m2(t,r){r=(r&4)!=0;for(var a=0;a<t.length;a++){var l=t[a],h=l.event;l=l.listeners;e:{var g=void 0;if(r)for(var S=l.length-1;0<=S;S--){var D=l[S],H=D.instance,ne=D.currentTarget;if(D=D.listener,H!==g&&h.isPropagationStopped())break e;g=D,h.currentTarget=ne;try{g(h)}catch(he){Rc(he)}h.currentTarget=null,g=H}else for(S=0;S<l.length;S++){if(D=l[S],H=D.instance,ne=D.currentTarget,D=D.listener,H!==g&&h.isPropagationStopped())break e;g=D,h.currentTarget=ne;try{g(h)}catch(he){Rc(he)}h.currentTarget=null,g=H}}}}function nt(t,r){var a=r[Mt];a===void 0&&(a=r[Mt]=new Set);var l=t+"__bubble";a.has(l)||(y2(r,t,2,!1),a.add(l))}function Xp(t,r,a){var l=0;r&&(l|=4),y2(a,t,l,r)}var hu="_reactListening"+Math.random().toString(36).slice(2);function g2(t){if(!t[hu]){t[hu]=!0,zs.forEach(function(a){a!=="selectionchange"&&(fR.has(a)||Xp(a,!1,t),Xp(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[hu]||(r[hu]=!0,Xp("selectionchange",!1,r))}}function y2(t,r,a,l){switch($2(r)){case 2:var h=HR;break;case 8:h=VR;break;default:h=fh}a=h.bind(null,r,a,t),h=void 0,!$s||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(h=!0),l?h===void 0?t.addEventListener(r,a,!0):t.addEventListener(r,a,{capture:!0,passive:h}):h===void 0?t.addEventListener(r,a,!1):t.addEventListener(r,a,{passive:h})}function Yp(t,r,a,l,h){var g=l;if(!(r&1)&&!(r&2)&&l!==null)e:for(;;){if(l===null)return;var S=l.tag;if(S===3||S===4){var D=l.stateNode.containerInfo;if(D===h)break;if(S===4)for(S=l.return;S!==null;){var H=S.tag;if((H===3||H===4)&&S.stateNode.containerInfo===h)return;S=S.return}for(;D!==null;){if(S=sr(D),S===null)return;if(H=S.tag,H===5||H===6||H===26||H===27){l=g=S;continue e}D=D.parentNode}}l=l.return}Sc(function(){var ne=g,he=Hs(a),ge=[];e:{var ae=Yv.get(t);if(ae!==void 0){var ue=u,De=t;switch(t){case"keypress":if(Xa(a)===0)break e;case"keydown":case"keyup":ue=Re;break;case"focusin":De="focus",ue=z;break;case"focusout":De="blur",ue=z;break;case"beforeblur":case"afterblur":ue=z;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=O;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=L;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=dt;break;case Qv:case Gv:case Jv:ue=q;break;case Xv:ue=Je;break;case"scroll":case"scrollend":ue=v;break;case"wheel":ue=Nt;break;case"copy":case"cut":case"paste":ue=oe;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=Ne;break;case"toggle":case"beforetoggle":ue=Ft}var Ie=(r&4)!=0,Ot=!Ie&&(t==="scroll"||t==="scrollend"),G=Ie?ae===null?null:ae+"Capture":ae;Ie=[];for(var U=ne,ee;U!==null;){var me=U;if(ee=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ee===null||G===null||(me=Qa(U,G),me!=null&&Ie.push(_l(U,me,ee))),Ot)break;U=U.return}0<Ie.length&&(ae=new ue(ae,De,null,a,he),ge.push({event:ae,listeners:Ie}))}}if(!(r&7)){e:{if(ae=t==="mouseover"||t==="pointerover",ue=t==="mouseout"||t==="pointerout",ae&&a!==_n&&(De=a.relatedTarget||a.fromElement)&&(sr(De)||De[ot]))break e;if((ue||ae)&&(ae=he.window===he?he:(ae=he.ownerDocument)?ae.defaultView||ae.parentWindow:window,ue?(De=a.relatedTarget||a.toElement,ue=ne,De=De?sr(De):null,De!==null&&(Ot=d(De),Ie=De.tag,De!==Ot||Ie!==5&&Ie!==27&&Ie!==6)&&(De=null)):(ue=null,De=ne),ue!==De)){if(Ie=O,me="onMouseLeave",G="onMouseEnter",U="mouse",(t==="pointerout"||t==="pointerover")&&(Ie=Ne,me="onPointerLeave",G="onPointerEnter",U="pointer"),Ot=ue==null?ae:Bn(ue),ee=De==null?ae:Bn(De),ae=new Ie(me,U+"leave",ue,a,he),ae.target=Ot,ae.relatedTarget=ee,me=null,sr(he)===ne&&(Ie=new Ie(G,U+"enter",De,a,he),Ie.target=ee,Ie.relatedTarget=Ot,me=Ie),Ot=me,ue&&De)t:{for(Ie=pR,G=ue,U=De,ee=0,me=G;me;me=Ie(me))ee++;me=0;for(var Me=U;Me;Me=Ie(Me))me++;for(;0<ee-me;)G=Ie(G),ee--;for(;0<me-ee;)U=Ie(U),me--;for(;ee--;){if(G===U||U!==null&&G===U.alternate){Ie=G;break t}G=Ie(G),U=Ie(U)}Ie=null}else Ie=null;ue!==null&&v2(ge,ae,ue,Ie,!1),De!==null&&Ot!==null&&v2(ge,Ot,De,Ie,!0)}}e:{if(ae=ne?Bn(ne):window,ue=ae.nodeName&&ae.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ae.type==="file")var vt=qv;else if(Iv(ae))if(jv)vt=kT;else{vt=_T;var Oe=wT}else ue=ae.nodeName,!ue||ue.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?ne&&Ka(ne.elementType)&&(vt=qv):vt=xT;if(vt&&(vt=vt(t,ne))){Av(ge,vt,a,he);break e}Oe&&Oe(t,ae,ne),t==="focusout"&&ne&&ae.type==="number"&&ne.memoizedProps.value!=null&&_i(ae,"number",ae.value)}switch(Oe=ne?Bn(ne):window,t){case"focusin":(Iv(Oe)||Oe.contentEditable==="true")&&(Ko=Oe,Rf=ne,Js=null);break;case"focusout":Js=Rf=Ko=null;break;case"mousedown":Df=!0;break;case"contextmenu":case"mouseup":case"dragend":Df=!1,Uv(ge,a,he);break;case"selectionchange":if(CT)break;case"keydown":case"keyup":Uv(ge,a,he)}var Qe;if($e)e:{switch(t){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else Uo?Ec(t,a)&&(at="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(at="onCompositionStart");at&&(pn&&a.locale!=="ko"&&(Uo||at!=="onCompositionStart"?at==="onCompositionEnd"&&Uo&&(Qe=Ws()):(Wr=he,$o="value"in Wr?Wr.value:Wr.textContent,Uo=!0)),Oe=mu(ne,at),0<Oe.length&&(at=new ie(at,t,null,a,he),ge.push({event:at,listeners:Oe}),Qe?at.data=Qe:(Qe=Wo(a),Qe!==null&&(at.data=Qe)))),(Qe=rn?gT(t,a):yT(t,a))&&(at=mu(ne,"onBeforeInput"),0<at.length&&(Oe=new ie("onBeforeInput","beforeinput",null,a,he),ge.push({event:Oe,listeners:at}),Oe.data=Qe)),dR(ge,t,ne,a,he)}m2(ge,r)})}function _l(t,r,a){return{instance:t,listener:r,currentTarget:a}}function mu(t,r){for(var a=r+"Capture",l=[];t!==null;){var h=t,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=Qa(t,a),h!=null&&l.unshift(_l(t,h,g)),h=Qa(t,r),h!=null&&l.push(_l(t,h,g))),t.tag===3)return l;t=t.return}return[]}function pR(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function v2(t,r,a,l,h){for(var g=r._reactName,S=[];a!==null&&a!==l;){var D=a,H=D.alternate,ne=D.stateNode;if(D=D.tag,H!==null&&H===l)break;D!==5&&D!==26&&D!==27||ne===null||(H=ne,h?(ne=Qa(a,g),ne!=null&&S.unshift(_l(a,ne,H))):h||(ne=Qa(a,g),ne!=null&&S.push(_l(a,ne,H)))),a=a.return}S.length!==0&&t.push({event:r,listeners:S})}var hR=/\r\n?/g,mR=/\u0000|\uFFFD/g;function b2(t){return(typeof t=="string"?t:""+t).replace(hR,`
10
+ `).replace(mR,"")}function w2(t,r){return r=b2(r),b2(t)===r}function Dt(t,r,a,l,h,g){switch(a){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||xi(t,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&xi(t,""+l);break;case"className":Ua(t,"class",l);break;case"tabIndex":Ua(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Ua(t,a,l);break;case"style":_c(t,l,g);break;case"data":if(r!=="object"){Ua(t,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||a!=="href")){t.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=Vo(""+l),t.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(a,"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 g=="function"&&(a==="formAction"?(r!=="input"&&Dt(t,r,"name",h.name,h,null),Dt(t,r,"formEncType",h.formEncType,h,null),Dt(t,r,"formMethod",h.formMethod,h,null),Dt(t,r,"formTarget",h.formTarget,h,null)):(Dt(t,r,"encType",h.encType,h,null),Dt(t,r,"method",h.method,h,null),Dt(t,r,"target",h.target,h,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=Vo(""+l),t.setAttribute(a,l);break;case"onClick":l!=null&&(t.onclick=xr);break;case"onScroll":l!=null&&nt("scroll",t);break;case"onScrollEnd":l!=null&&nt("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(h.children!=null)throw Error(s(60));t.innerHTML=a}}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}a=Vo(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);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(a,""+l):t.removeAttribute(a);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(a,""):t.removeAttribute(a);break;case"capture":case"download":l===!0?t.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,l):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(a,l):t.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(a):t.setAttribute(a,l);break;case"popover":nt("beforetoggle",t),nt("toggle",t),Wa(t,"popover",l);break;case"xlinkActuate":Vr(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Vr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Vr(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Vr(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Vr(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Vr(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Vr(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Vr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Vr(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Wa(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Ho.get(a)||a,Wa(t,a,l))}}function Zp(t,r,a,l,h,g){switch(a){case"style":_c(t,l,g);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(h.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"children":typeof l=="string"?xi(t,l):(typeof l=="number"||typeof l=="bigint")&&xi(t,""+l);break;case"onScroll":l!=null&&nt("scroll",t);break;case"onScrollEnd":l!=null&&nt("scrollend",t);break;case"onClick":l!=null&&(t.onclick=xr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!gc.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(h=a.endsWith("Capture"),r=a.slice(2,h?a.length-7:void 0),g=t[Ve]||null,g=g==null?null:g[a],typeof g=="function"&&t.removeEventListener(r,g,h),typeof l=="function")){typeof g!="function"&&g!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(r,l,h);break e}a in t?t[a]=l:l===!0?t.setAttribute(a,""):Wa(t,a,l)}}}function Tn(t,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":nt("error",t),nt("load",t);var l=!1,h=!1,g;for(g in a)if(a.hasOwnProperty(g)){var S=a[g];if(S!=null)switch(g){case"src":l=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Dt(t,r,g,S,a,null)}}h&&Dt(t,r,"srcSet",a.srcSet,a,null),l&&Dt(t,r,"src",a.src,a,null);return;case"input":nt("invalid",t);var D=g=S=h=null,H=null,ne=null;for(l in a)if(a.hasOwnProperty(l)){var he=a[l];if(he!=null)switch(l){case"name":h=he;break;case"type":S=he;break;case"checked":H=he;break;case"defaultChecked":ne=he;break;case"value":g=he;break;case"defaultValue":D=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(s(137,r));break;default:Dt(t,r,l,he,a,null)}}wc(t,g,D,H,ne,S,h,!1);return;case"select":for(h in nt("invalid",t),l=S=g=null,a)if(a.hasOwnProperty(h)&&(D=a[h],D!=null))switch(h){case"value":g=D;break;case"defaultValue":S=D;break;case"multiple":l=D;default:Dt(t,r,h,D,a,null)}r=g,a=S,t.multiple=!!l,r==null?a!=null&&oa(t,!!l,a,!0):oa(t,!!l,r,!1);return;case"textarea":for(S in nt("invalid",t),g=h=l=null,a)if(a.hasOwnProperty(S)&&(D=a[S],D!=null))switch(S){case"value":l=D;break;case"defaultValue":h=D;break;case"children":g=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(s(91));break;default:Dt(t,r,S,D,a,null)}Bo(t,l,h,g);return;case"option":for(H in a)a.hasOwnProperty(H)&&(l=a[H],l!=null)&&(H==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":Dt(t,r,H,l,a,null));return;case"dialog":nt("beforetoggle",t),nt("toggle",t),nt("cancel",t),nt("close",t);break;case"iframe":case"object":nt("load",t);break;case"video":case"audio":for(l=0;l<wl.length;l++)nt(wl[l],t);break;case"image":nt("error",t),nt("load",t);break;case"details":nt("toggle",t);break;case"embed":case"source":case"link":nt("error",t),nt("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(ne in a)if(a.hasOwnProperty(ne)&&(l=a[ne],l!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Dt(t,r,ne,l,a,null)}return;default:if(Ka(r)){for(he in a)a.hasOwnProperty(he)&&(l=a[he],l!==void 0&&Zp(t,r,he,l,a,void 0));return}}for(D in a)a.hasOwnProperty(D)&&(l=a[D],l!=null&&Dt(t,r,D,l,a,null))}function gR(t,r,a,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,g=null,S=null,D=null,H=null,ne=null,he=null;for(ue in a){var ge=a[ue];if(a.hasOwnProperty(ue)&&ge!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":H=ge;default:l.hasOwnProperty(ue)||Dt(t,r,ue,null,l,ge)}}for(var ae in l){var ue=l[ae];if(ge=a[ae],l.hasOwnProperty(ae)&&(ue!=null||ge!=null))switch(ae){case"type":g=ue;break;case"name":h=ue;break;case"checked":ne=ue;break;case"defaultChecked":he=ue;break;case"value":S=ue;break;case"defaultValue":D=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(s(137,r));break;default:ue!==ge&&Dt(t,r,ae,ue,l,ge)}}aa(t,S,D,H,ne,he,g,h);return;case"select":for(g in ue=S=D=ae=null,a)if(H=a[g],a.hasOwnProperty(g)&&H!=null)switch(g){case"value":break;case"multiple":ue=H;default:l.hasOwnProperty(g)||Dt(t,r,g,null,l,H)}for(h in l)if(g=l[h],H=a[h],l.hasOwnProperty(h)&&(g!=null||H!=null))switch(h){case"value":ae=g;break;case"defaultValue":D=g;break;case"multiple":S=g;default:g!==H&&Dt(t,r,h,g,l,H)}r=D,a=S,l=ue,ae==null?!!l!=!!a&&(r==null?oa(t,!!a,a?[]:"",!1):oa(t,!!a,r,!0)):oa(t,!!a,ae,!1);return;case"textarea":for(D in ue=ae=null,a)if(h=a[D],a.hasOwnProperty(D)&&h!=null&&!l.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:Dt(t,r,D,null,l,h)}for(S in l)if(h=l[S],g=a[S],l.hasOwnProperty(S)&&(h!=null||g!=null))switch(S){case"value":ae=h;break;case"defaultValue":ue=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(s(91));break;default:h!==g&&Dt(t,r,S,h,l,g)}sa(t,ae,ue);return;case"option":for(var De in a)ae=a[De],a.hasOwnProperty(De)&&ae!=null&&!l.hasOwnProperty(De)&&(De==="selected"?t.selected=!1:Dt(t,r,De,null,l,ae));for(H in l)ae=l[H],ue=a[H],l.hasOwnProperty(H)&&ae!==ue&&(ae!=null||ue!=null)&&(H==="selected"?t.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":Dt(t,r,H,ae,l,ue));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 Ie in a)ae=a[Ie],a.hasOwnProperty(Ie)&&ae!=null&&!l.hasOwnProperty(Ie)&&Dt(t,r,Ie,null,l,ae);for(ne in l)if(ae=l[ne],ue=a[ne],l.hasOwnProperty(ne)&&ae!==ue&&(ae!=null||ue!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(s(137,r));break;default:Dt(t,r,ne,ae,l,ue)}return;default:if(Ka(r)){for(var Ot in a)ae=a[Ot],a.hasOwnProperty(Ot)&&ae!==void 0&&!l.hasOwnProperty(Ot)&&Zp(t,r,Ot,void 0,l,ae);for(he in l)ae=l[he],ue=a[he],!l.hasOwnProperty(he)||ae===ue||ae===void 0&&ue===void 0||Zp(t,r,he,ae,l,ue);return}}for(var G in a)ae=a[G],a.hasOwnProperty(G)&&ae!=null&&!l.hasOwnProperty(G)&&Dt(t,r,G,null,l,ae);for(ge in l)ae=l[ge],ue=a[ge],!l.hasOwnProperty(ge)||ae===ue||ae==null&&ue==null||Dt(t,r,ge,ae,l,ue)}function _2(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function yR(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var h=a[l],g=h.transferSize,S=h.initiatorType,D=h.duration;if(g&&D&&_2(S)){for(S=0,D=h.responseEnd,l+=1;l<a.length;l++){var H=a[l],ne=H.startTime;if(ne>D)break;var he=H.transferSize,ge=H.initiatorType;he&&_2(ge)&&(H=H.responseEnd,S+=he*(H<D?1:(D-ne)/(H-ne)))}if(--l,r+=8*(g+S)/(h.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 eh=null,th=null;function gu(t){return t.nodeType===9?t:t.ownerDocument}function x2(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 k2(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 nh(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 rh=null;function vR(){var t=window.event;return t&&t.type==="popstate"?t===rh?!1:(rh=t,!0):(rh=null,!1)}var S2=typeof setTimeout=="function"?setTimeout:void 0,bR=typeof clearTimeout=="function"?clearTimeout:void 0,C2=typeof Promise=="function"?Promise:void 0,wR=typeof queueMicrotask=="function"?queueMicrotask:C2===void 0?S2:function(t){return C2.resolve(null).then(t).catch(_R)};function _R(t){setTimeout(function(){throw t})}function xa(t){return t==="head"}function E2(t,r){var a=r,l=0;do{var h=a.nextSibling;if(t.removeChild(a),h&&h.nodeType===8)if(a=h.data,a==="/$"||a==="/&"){if(l===0){t.removeChild(h),ws(r);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")xl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,xl(a);for(var g=a.firstChild;g;){var S=g.nextSibling,D=g.nodeName;g[ut]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&g.rel.toLowerCase()==="stylesheet"||a.removeChild(g),g=S}}else a==="body"&&xl(t.ownerDocument.body);a=h}while(a);ws(r)}function T2(t,r){var a=t;t=0;do{var l=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=l}while(a)}function ih(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":ih(a),wn(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function xR(t,r,a,l){for(;t.nodeType===1;){var h=a;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[ut])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(g=t.getAttribute("rel"),g==="stylesheet"&&t.hasAttribute("data-precedence")||g!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(g=t.getAttribute("src"),(g!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&g&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var g=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===g)return t}else return t;if(t=Dr(t.nextSibling),t===null)break}return null}function kR(t,r,a){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Dr(t.nextSibling),t===null))return null;return t}function R2(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Dr(t.nextSibling),t===null))return null;return t}function ah(t){return t.data==="$?"||t.data==="$~"}function oh(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function SR(t,r){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||a.readyState!=="loading")r();else{var l=function(){r(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function Dr(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 sh=null;function D2(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(r===0)return Dr(t.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}t=t.nextSibling}return null}function O2(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return t;r--}else a!=="/$"&&a!=="/&"||r++}t=t.previousSibling}return null}function P2(t,r,a){switch(r=gu(a),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 xl(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);wn(t)}var Or=new Map,M2=new Set;function yu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Fi=Q.d;Q.d={f:CR,r:ER,D:TR,C:RR,L:DR,m:OR,X:MR,S:PR,M:LR};function CR(){var t=Fi.f(),r=lu();return t||r}function ER(t){var r=ii(t);r!==null&&r.tag===5&&r.type==="form"?X1(r):Fi.r(t)}var ys=typeof document>"u"?null:document;function L2(t,r,a){var l=ys;if(l&&typeof r=="string"&&r){var h=lr(r);h='link[rel="'+t+'"][href="'+h+'"]',typeof a=="string"&&(h+='[crossorigin="'+a+'"]'),M2.has(h)||(M2.add(h),t={rel:t,crossOrigin:a,href:r},l.querySelector(h)===null&&(r=l.createElement("link"),Tn(r,"link",t),Xt(r),l.head.appendChild(r)))}}function TR(t){Fi.D(t),L2("dns-prefetch",t,null)}function RR(t,r){Fi.C(t,r),L2("preconnect",t,r)}function DR(t,r,a){Fi.L(t,r,a);var l=ys;if(l&&t&&r){var h='link[rel="preload"][as="'+lr(r)+'"]';r==="image"&&a&&a.imageSrcSet?(h+='[imagesrcset="'+lr(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(h+='[imagesizes="'+lr(a.imageSizes)+'"]')):h+='[href="'+lr(t)+'"]';var g=h;switch(r){case"style":g=vs(t);break;case"script":g=bs(t)}Or.has(g)||(t=C({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:t,as:r},a),Or.set(g,t),l.querySelector(h)!==null||r==="style"&&l.querySelector(kl(g))||r==="script"&&l.querySelector(Sl(g))||(r=l.createElement("link"),Tn(r,"link",t),Xt(r),l.head.appendChild(r)))}}function OR(t,r){Fi.m(t,r);var a=ys;if(a&&t){var l=r&&typeof r.as=="string"?r.as:"script",h='link[rel="modulepreload"][as="'+lr(l)+'"][href="'+lr(t)+'"]',g=h;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=bs(t)}if(!Or.has(g)&&(t=C({rel:"modulepreload",href:t},r),Or.set(g,t),a.querySelector(h)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Sl(g)))return}l=a.createElement("link"),Tn(l,"link",t),Xt(l),a.head.appendChild(l)}}}function PR(t,r,a){Fi.S(t,r,a);var l=ys;if(l&&t){var h=ra(l).hoistableStyles,g=vs(t);r||(r="default");var S=h.get(g);if(!S){var D={loading:0,preload:null};if(S=l.querySelector(kl(g)))D.loading=5;else{t=C({rel:"stylesheet",href:t,"data-precedence":r},a),(a=Or.get(g))&&lh(t,a);var H=S=l.createElement("link");Xt(H),Tn(H,"link",t),H._p=new Promise(function(ne,he){H.onload=ne,H.onerror=he}),H.addEventListener("load",function(){D.loading|=1}),H.addEventListener("error",function(){D.loading|=2}),D.loading|=4,vu(S,r,l)}S={type:"stylesheet",instance:S,count:1,state:D},h.set(g,S)}}}function MR(t,r){Fi.X(t,r);var a=ys;if(a&&t){var l=ra(a).hoistableScripts,h=bs(t),g=l.get(h);g||(g=a.querySelector(Sl(h)),g||(t=C({src:t,async:!0},r),(r=Or.get(h))&&ch(t,r),g=a.createElement("script"),Xt(g),Tn(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(h,g))}}function LR(t,r){Fi.M(t,r);var a=ys;if(a&&t){var l=ra(a).hoistableScripts,h=bs(t),g=l.get(h);g||(g=a.querySelector(Sl(h)),g||(t=C({src:t,async:!0,type:"module"},r),(r=Or.get(h))&&ch(t,r),g=a.createElement("script"),Xt(g),Tn(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(h,g))}}function N2(t,r,a,l){var h=(h=mt.current)?yu(h):null;if(!h)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=vs(a.href),a=ra(h).hoistableStyles,l=a.get(r),l||(l={type:"style",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=vs(a.href);var g=ra(h).hoistableStyles,S=g.get(t);if(S||(h=h.ownerDocument||h,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(t,S),(g=h.querySelector(kl(t)))&&!g._p&&(S.instance=g,S.state.loading=5),Or.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Or.set(t,a),g||NR(h,t,a,S.state))),r&&l===null)throw Error(s(528,""));return S}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=bs(a),a=ra(h).hoistableScripts,l=a.get(r),l||(l={type:"script",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function vs(t){return'href="'+lr(t)+'"'}function kl(t){return'link[rel="stylesheet"]['+t+"]"}function I2(t){return C({},t,{"data-precedence":t.precedence,precedence:null})}function NR(t,r,a,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}),Tn(r,"link",a),Xt(r),t.head.appendChild(r))}function bs(t){return'[src="'+lr(t)+'"]'}function Sl(t){return"script[async]"+t}function A2(t,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var l=t.querySelector('style[data-href~="'+lr(a.href)+'"]');if(l)return r.instance=l,Xt(l),l;var h=C({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Xt(l),Tn(l,"style",h),vu(l,a.precedence,t),r.instance=l;case"stylesheet":h=vs(a.href);var g=t.querySelector(kl(h));if(g)return r.state.loading|=4,r.instance=g,Xt(g),g;l=I2(a),(h=Or.get(h))&&lh(l,h),g=(t.ownerDocument||t).createElement("link"),Xt(g);var S=g;return S._p=new Promise(function(D,H){S.onload=D,S.onerror=H}),Tn(g,"link",l),r.state.loading|=4,vu(g,a.precedence,t),r.instance=g;case"script":return g=bs(a.src),(h=t.querySelector(Sl(g)))?(r.instance=h,Xt(h),h):(l=a,(h=Or.get(g))&&(l=C({},a),ch(l,h)),t=t.ownerDocument||t,h=t.createElement("script"),Xt(h),Tn(h,"link",l),t.head.appendChild(h),r.instance=h);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,vu(l,a.precedence,t));return r.instance}function vu(t,r,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=l.length?l[l.length-1]:null,g=h,S=0;S<l.length;S++){var D=l[S];if(D.dataset.precedence===r)g=D;else if(g!==h)break}g?g.parentNode.insertBefore(t,g.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(t,r.firstChild))}function lh(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.title??(t.title=r.title)}function ch(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.integrity??(t.integrity=r.integrity)}var bu=null;function q2(t,r,a){if(bu===null){var l=new Map,h=bu=new Map;h.set(a,l)}else h=bu,l=h.get(a),l||(l=new Map,h.set(a,l));if(l.has(t))return l;for(l.set(t,null),a=a.getElementsByTagName(t),h=0;h<a.length;h++){var g=a[h];if(!(g[ut]||g[He]||t==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var S=g.getAttribute(r)||"";S=t+S;var D=l.get(S);D?D.push(g):l.set(S,[g])}}return l}function j2(t,r,a){t=t.ownerDocument||t,t.head.insertBefore(a,r==="title"?t.querySelector("head > title"):null)}function IR(t,r,a){if(a===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 z2(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function AR(t,r,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&!(a.state.loading&4)){if(a.instance===null){var h=vs(l.href),g=r.querySelector(kl(h));if(g){r=g._p,typeof r=="object"&&r&&typeof r.then=="function"&&(t.count++,t=wu.bind(t),r.then(t,t)),a.state.loading|=4,a.instance=g,Xt(g);return}g=r.ownerDocument||r,l=I2(l),(h=Or.get(h))&&lh(l,h),g=g.createElement("link"),Xt(g);var S=g;S._p=new Promise(function(D,H){S.onload=D,S.onerror=H}),Tn(g,"link",l),a.instance=g}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,r),(r=a.state.preload)&&!(a.state.loading&3)&&(t.count++,a=wu.bind(t),r.addEventListener("load",a),r.addEventListener("error",a))}}var uh=0;function qR(t,r){return t.stylesheets&&t.count===0&&xu(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var l=setTimeout(function(){if(t.stylesheets&&xu(t,t.stylesheets),t.unsuspend){var g=t.unsuspend;t.unsuspend=null,g()}},6e4+r);0<t.imgBytes&&uh===0&&(uh=62500*yR());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&xu(t,t.stylesheets),t.unsuspend)){var g=t.unsuspend;t.unsuspend=null,g()}},(t.imgBytes>uh?50:800)+r);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(h)}}:null}function wu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var _u=null;function xu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,_u=new Map,r.forEach(jR,t),_u=null,wu.call(t))}function jR(t,r){if(!(r.state.loading&4)){var a=_u.get(t);if(a)var l=a.get(null);else{a=new Map,_u.set(t,a);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var S=h[g];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(a.set(S.dataset.precedence,S),l=S)}l&&a.set(null,l)}h=r.instance,S=h.getAttribute("data-precedence"),g=a.get(S)||l,g===l&&a.set(null,h),a.set(S,h),this.count++,l=wu.bind(this),h.addEventListener("load",l),h.addEventListener("error",l),g?g.parentNode.insertBefore(h,g.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),r.state.loading|=4}}var Cl={$$typeof:K,Provider:null,Consumer:null,_currentValue:Le,_currentValue2:Le,_threadCount:0};function zR(t,r,a,l,h,g,S,D,H){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=ri(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ri(0),this.hiddenUpdates=ri(null),this.identifierPrefix=l,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function FR(t,r,a,l,h,g,S,D,H,ne,he,ge){return t=new zR(t,r,a,S,H,ne,he,ge,D),r=1,g===!0&&(r|=24),g=ur(3,null,null,r),t.current=g,g.stateNode=t,r=$f(),r.refCount++,t.pooledCache=r,r.refCount++,g.memoizedState={element:l,isDehydrated:a,cache:r},Qf(g),t}function BR(t){return t?(t=Jo,t):Jo}function F2(t,r,a,l,h,g){h=BR(h),l.context===null?l.context=h:l.pendingContext=h,l=fo(r),l.payload={element:a},g=g===void 0?null:g,g!==null&&(l.callback=g),a=po(t,l,r),a!==null&&(Yn(a,t,r),rl(a,t,r))}function B2(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function dh(t,r){B2(t,r),(t=t.alternate)&&B2(t,r)}function H2(t){if(t.tag===13||t.tag===31){var r=no(t,67108864);r!==null&&Yn(r,t,67108864),dh(t,67108864)}}function V2(t){if(t.tag===13||t.tag===31){var r=Rr();r=Ye(r);var a=no(t,r);a!==null&&Yn(a,t,r),dh(t,r)}}var ku=!0;function HR(t,r,a,l){var h=se.T;se.T=null;var g=Q.p;try{Q.p=2,fh(t,r,a,l)}finally{Q.p=g,se.T=h}}function VR(t,r,a,l){var h=se.T;se.T=null;var g=Q.p;try{Q.p=8,fh(t,r,a,l)}finally{Q.p=g,se.T=h}}function fh(t,r,a,l){if(ku){var h=ph(l);if(h===null)Yp(t,r,l,Su,a),W2(t,l);else if(WR(h,t,r,a,l))l.stopPropagation();else if(W2(t,l),r&4&&-1<$R.indexOf(t)){for(;h!==null;){var g=ii(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var S=Mn(g.pendingLanes);if(S!==0){var D=g;for(D.pendingLanes|=2,D.entangledLanes|=2;S;){var H=1<<31-gt(S);D.entanglements[1]|=H,S&=~H}zi(g),!(yt&6)&&(ou=Ut()+500,bl(0,!1))}}break;case 31:case 13:D=no(g,2),D!==null&&Yn(D,g,2),lu(),dh(g,2)}if(g=ph(l),g===null&&Yp(t,r,l,Su,a),g===h)break;h=g}h!==null&&l.stopPropagation()}else Yp(t,r,l,null,a)}}function ph(t){return t=Hs(t),hh(t)}var Su=null;function hh(t){if(Su=null,t=sr(t),t!==null){var r=d(t);if(r===null)t=null;else{var a=r.tag;if(a===13){if(t=f(r),t!==null)return t;t=null}else if(a===31){if(t=p(r),t!==null)return t;t=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return Su=t,null}function $2(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(yi()){case fn:return 2;case ni:return 8;case zt:case Br:return 32;case _t:return 268435456;default:return 32}default:return 32}}var mh=!1,ka=null,Sa=null,Ca=null,El=new Map,Tl=new Map,Ea=[],$R="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 W2(t,r){switch(t){case"focusin":case"focusout":ka=null;break;case"dragenter":case"dragleave":Sa=null;break;case"mouseover":case"mouseout":Ca=null;break;case"pointerover":case"pointerout":El.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tl.delete(r.pointerId)}}function Rl(t,r,a,l,h,g){return t===null||t.nativeEvent!==g?(t={blockedOn:r,domEventName:a,eventSystemFlags:l,nativeEvent:g,targetContainers:[h]},r!==null&&(r=ii(r),r!==null&&H2(r)),t):(t.eventSystemFlags|=l,r=t.targetContainers,h!==null&&r.indexOf(h)===-1&&r.push(h),t)}function WR(t,r,a,l,h){switch(r){case"focusin":return ka=Rl(ka,t,r,a,l,h),!0;case"dragenter":return Sa=Rl(Sa,t,r,a,l,h),!0;case"mouseover":return Ca=Rl(Ca,t,r,a,l,h),!0;case"pointerover":var g=h.pointerId;return El.set(g,Rl(El.get(g)||null,t,r,a,l,h)),!0;case"gotpointercapture":return g=h.pointerId,Tl.set(g,Rl(Tl.get(g)||null,t,r,a,l,h)),!0}return!1}function U2(t){var r=sr(t.target);if(r!==null){var a=d(r);if(a!==null){if(r=a.tag,r===13){if(r=f(a),r!==null){t.blockedOn=r,ve(t.priority,function(){V2(a)});return}}else if(r===31){if(r=p(a),r!==null){t.blockedOn=r,ve(t.priority,function(){V2(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Cu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=ph(t.nativeEvent);if(a===null){a=t.nativeEvent;var l=new a.constructor(a.type,a);_n=l,a.target.dispatchEvent(l),_n=null}else return r=ii(a),r!==null&&H2(r),t.blockedOn=a,!1;r.shift()}return!0}function K2(t,r,a){Cu(t)&&a.delete(r)}function UR(){mh=!1,ka!==null&&Cu(ka)&&(ka=null),Sa!==null&&Cu(Sa)&&(Sa=null),Ca!==null&&Cu(Ca)&&(Ca=null),El.forEach(K2),Tl.forEach(K2)}function Eu(t,r){t.blockedOn===r&&(t.blockedOn=null,mh||(mh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,UR)))}var Tu=null;function Q2(t){Tu!==t&&(Tu=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Tu===t&&(Tu=null);for(var r=0;r<t.length;r+=3){var a=t[r],l=t[r+1],h=t[r+2];if(typeof l!="function"){if(hh(l||a)===null)continue;break}var g=ii(a);g!==null&&(t.splice(r,3),r-=3,hp(g,{pending:!0,data:h,method:a.method,action:l},l,h))}}))}function ws(t){function r(H){return Eu(H,t)}ka!==null&&Eu(ka,t),Sa!==null&&Eu(Sa,t),Ca!==null&&Eu(Ca,t),El.forEach(r),Tl.forEach(r);for(var a=0;a<Ea.length;a++){var l=Ea[a];l.blockedOn===t&&(l.blockedOn=null)}for(;0<Ea.length&&(a=Ea[0],a.blockedOn===null);)U2(a),a.blockedOn===null&&Ea.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var h=a[l],g=a[l+1],S=h[Ve]||null;if(typeof g=="function")S||Q2(a);else if(S){var D=null;if(g&&g.hasAttribute("formAction")){if(h=g,S=g[Ve]||null)D=S.formAction;else if(hh(h)!==null)continue}else D=S.action;typeof D=="function"?a[l+1]=D:(a.splice(l,3),l-=3),Q2(a)}}}function KR(){function t(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(S){return h=S})},focusReset:"manual",scroll:"manual"})}function r(){h!==null&&(h(),h=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),h!==null&&(h(),h=null)}}}function gh(t){this._internalRoot=t}yh.prototype.render=gh.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var a=r.current;F2(a,Rr(),t,r,null,null)},yh.prototype.unmount=gh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;F2(t.current,2,null,t,null,null),lu(),r[ot]=null}};function yh(t){this._internalRoot=t}yh.prototype.unstable_scheduleHydration=function(t){if(t){var r=te();t={blockedOn:null,target:t,priority:r};for(var a=0;a<Ea.length&&r!==0&&r<Ea[a].priority;a++);Ea.splice(a,0,t),a===0&&U2(t)}};var G2=i.version;if(G2!=="19.2.3")throw Error(s(527,G2,"19.2.3"));Q.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=w(r),t=t===null?null:_(t),t=t===null?null:t.stateNode,t};var QR={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:se,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ru=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ru.isDisabled&&Ru.supportsFiber)try{wr=Ru.inject(QR),Jt=Ru}catch{}}e.createRoot=function(t,r){if(!c(t))throw Error(s(299));var a=!1,l="",h=VT,g=$T,S=WT;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=FR(t,1,!1,null,null,a,l,null,h,g,S,KR),t[ot]=r.current,g2(t),new gh(r)}})),nd=Ee(((e,n)=>{function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(o){console.error(o)}}i(),n.exports=Na()})),Fm="Expected a function";function kx(e,n){var i;if(typeof n!="function")throw TypeError(Fm);return e=c4(e),function(){return--e>0&&(i=n.apply(this,arguments)),e<=1&&(n=void 0),i}}var Sx=kx;function Cx(e){return Sx(2,e)}let Bm;_m=Cx,Bm=Math.max;function Ex(e){if(!(e&&e.length))return[];var n=0;return e=u4(e,function(i){if(d4(i))return n=Bm(i.length,n),!0}),s4(n,function(i){return l4(e,v4(i))})}var Tx=f4(Ex);Em=function(e,n){if(e==null)throw Error(n||`Expected value but got ${e}`)},BigInt.prototype.toJSON=function(){return JSON.rawJSON(this.toString())},Pm=function(e){try{return JSON.parse(e,(n,i)=>yd(i))}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,i)=>typeof i=="string"?i==="\u25D0NaN\u25D0"?NaN:i==="\u25D0Infinity\u25D0"?1/0:i==="\u25D0-Infinity\u25D0"?-1/0:yd(i):yd(i))}catch{return{}}};function Rx(e,n){return e==null?"":typeof e=="number"&&!Number.isNaN(e)?e.toLocaleString(n,{useGrouping:!1,maximumFractionDigits:20}):String(e)}S_=function(e,n){if(e.length===0)return"";let i=Object.keys(e[0]),o=e.map(s=>i.map(c=>Rx(s[c],n)).join(" "));return`${i.join(" ")}
11
11
  ${o.join(`
12
12
  `)}`},w_=function(e){if(e.length===0)return"";let n=Object.keys(e[0]);return[`| ${n.join(" | ")} |`,`|${n.map(()=>"---").join("|")}|`,...e.map(i=>`| ${n.map(o=>Dx(i[o])).join(" | ")} |`)].join(`
13
13
  `)};function Dx(e){if(e==null)return"";if(Array.isArray(e)||typeof e=="object")return Hm(JSON.stringify(e));let n=String(e),i=/\[([^\]]+)]\((https?:\/\/[^)]+)\)/g,o=new Map,s=0;n=n.replaceAll(i,c=>{let d=`__MDLINK_${s++}__`;return o.set(d,c),d}),n=n.replaceAll(/(https?:\/\/\S+)/g,"[$1]($1)");for(let[c,d]of o)n=n.replace(c,d);return Hm(n)}function Hm(e){return e.replaceAll("\\","\\\\").replaceAll("|","\\|").replaceAll(`
14
- `," ").replaceAll("\r","")}function yd(e){return typeof e=="object"&&e&&"$bigint"in e&&typeof e.$bigint=="string"?BigInt(e.$bigint):e}var Vm="abcdefghijklmnopqrstuvwxyz",$m=Vm+Vm.toUpperCase(),Wm=new Set;Rs="__scratch__",yr="setup",La={create(){let e=0,n;do{let i="";for(let o=0;o<4;o++)i+=$m[Math.floor(Math.random()*$m.length)];n=i,e++}while(Wm.has(n)&&e<100);if(e>=100)throw Error("Failed to generate unique CellId after 100 attempts");return Wm.add(n),n}},er={create(e){return In(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 i=er.findElement(n);if(i)return i;let o=n.getRootNode();if(n=o instanceof ShadowRoot?o.host:n.parentElement,n===o)break}return null}},q_=function(e){let n=null,i=er.findElementThroughShadowDOMs(e);return i&&(n=er.parse(i.id)),n},Yu={parse(e){return e.getAttribute("object-id")},parseOrThrow(e){let n=Yu.parse(e);return In(n,"<marimo-ui-element/> missing object-id attribute"),n}},O_={create(e){return`output-${e}`}},km=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 i=new URL(window.location.href);i.searchParams.set(e,n),window.history.replaceState({},"",i.toString())}getSearchParam(e){return new URL(window.location.href).searchParams.get(e)}},qu=function(e){return Pm(e??"")},x_=function(e){return ui.mapValues(e.dataset,n=>typeof n=="string"?qu(n):n)},nx=function(e,n){let i=e.parentElement?Yu.parse(e.parentElement):void 0;return i&&n.has(i)?n.lookupValue(i):qu(e.dataset.initialValue)},Fl=function(){if(w4())return document.title||null;if(wh()){let i=km.getFilename();if(i)return i}let e=document.querySelector("marimo-filename");Em(e,"marimo-filename tag not found");let n=e.innerHTML;return n.length===0?null:n};var Ox=Symbol("");u_=function(e,n){return ze(e,function(i,o,s){o(this,n(i(this),s))})};function vd(e,n){let i=null,o=new Map,s=new Set,c=f=>{let p;if(n===void 0)p=o.get(f);else for(let[w,_]of o)if(n(w,f)){p=_;break}if(p!==void 0)if(i!=null&&i(p[1],f))c.remove(f);else return p[0];let y=e(f);return o.set(f,[y,Date.now()]),d("CREATE",f,y),y},d=(f,p,y)=>{for(let w of s)w({type:f,param:p,atom:y})};return c.unstable_listen=f=>(s.add(f),()=>{s.delete(f)}),c.getParams=()=>o.keys(),c.remove=f=>{if(n===void 0){if(!o.has(f))return;let[p]=o.get(f);o.delete(f),d("REMOVE",f,p)}else for(let[p,[y]]of o)if(n(p,f)){o.delete(p),d("REMOVE",p,y);break}},c.setShouldRemove=f=>{if(i=f,i)for(let[p,[y,w]]of o)i(w,p)&&(o.delete(p),d("REMOVE",p,y))},c}var bd=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),Px=new WeakMap,Mx=(e,n,i,o)=>bd(e,bd(()=>new WeakMap,bd(()=>new WeakMap,Px,n),i),o);function Lx(e,n,i=Object.is){return Mx(()=>{let o=Symbol(),s=([d,f])=>{if(f===o)return n(d);let p=n(d,f);return i(f,p)?f:p},c=ze(d=>{let f=d(c);return s([d(e),f])});return c.init=o,c},e,n,i)}var Um=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),Nx=new WeakMap,Ix=(e,n,i)=>Um(e,Um(()=>new WeakMap,Nx,n),i),Ax={},Km=e=>!!e.write,qx=e=>typeof e=="function";function jx(e,n){return Ix(()=>{let i=new WeakMap,o=(d,f)=>{let p=i.get(d);if(p)return p;let y=f&&i.get(f),w=[],_=[];return d.forEach((C,E)=>{let T=n?n(C):E;_[E]=T;let I=y&&y.atomList[y.keyList.indexOf(T)];if(I){w[E]=I;return}let $=V=>{let F=V(s),N=V(e),K=o(N,F==null?void 0:F.arr).keyList.indexOf(T);if(K<0||K>=N.length){let pe=d[o(d).keyList.indexOf(T)];if(pe)return pe;throw Error("splitAtom: index out of bounds for read")}return N[K]};w[E]=Km(e)?ze($,(V,F,N)=>{let K=V(s),pe=V(e),P=o(pe,K==null?void 0:K.arr).keyList.indexOf(T);if(P<0||P>=pe.length)throw Error("splitAtom: index out of bounds for write");let A=qx(N)?N(pe[P]):N;Object.is(pe[P],A)||F(e,[...pe.slice(0,P),A,...pe.slice(P+1)])}):ze($)}),p=y&&y.keyList.length===_.length&&y.keyList.every((C,E)=>C===_[E])?y:{arr:d,atomList:w,keyList:_},i.set(d,p),p},s=ze(d=>{let f=d(s);return o(d(e),f==null?void 0:f.arr)});s.init=void 0;let c=Km(e)?ze(d=>d(s).atomList,(d,f,p)=>{switch(p.type){case"remove":{let y=d(c).indexOf(p.atom);if(y>=0){let w=d(e);f(e,[...w.slice(0,y),...w.slice(y+1)])}break}case"insert":{let y=p.before?d(c).indexOf(p.before):d(c).length;if(y>=0){let w=d(e);f(e,[...w.slice(0,y),p.value,...w.slice(y)])}break}case"move":{let y=d(c).indexOf(p.atom),w=p.before?d(c).indexOf(p.before):d(c).length;if(y>=0&&w>=0){let _=d(e);y<w?f(e,[..._.slice(0,y),..._.slice(y+1,w),_[y],..._.slice(w)]):f(e,[..._.slice(0,w),_[y],..._.slice(w,y),..._.slice(y+1)])}break}}}):ze(d=>d(s).atomList);return c},e,n||Ax)}var Qm=e=>typeof(e==null?void 0:e.then)=="function";function Gm(e=()=>{try{return window.localStorage}catch{return}},n){var f;let i,o,s={getItem:(p,y)=>{var C;let w=E=>{if(E||(E=""),i!==E){try{o=JSON.parse(E,n==null?void 0:n.reviver)}catch{return y}i=E}return o},_=((C=e())==null?void 0:C.getItem(p))??null;return Qm(_)?_.then(w):w(_)},setItem:(p,y)=>{var w;return(w=e())==null?void 0:w.setItem(p,JSON.stringify(y,n==null?void 0:n.replacer))},removeItem:p=>{var y;return(y=e())==null?void 0:y.removeItem(p)}},c=p=>(y,w,_)=>p(y,C=>{let E;try{E=JSON.parse(C||"")}catch{E=_}w(E)}),d;try{d=(f=e())==null?void 0:f.subscribe}catch{}return!d&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(d=(p,y)=>{if(!(e()instanceof window.Storage))return()=>{};let w=_=>{_.storageArea===e()&&_.key===p&&y(_.newValue)};return window.addEventListener("storage",w),()=>{window.removeEventListener("storage",w)}}),d&&(s.subscribe=c(d)),s}var zx=Gm();$l=function(e,n,i=zx,o){let s=ze(o!=null&&o.getOnInit?i.getItem(e,n):n);return s.onMount=c=>{c(i.getItem(e,n));let d;return i.subscribe&&(d=i.subscribe(e,c,n)),d},ze(c=>c(s),(c,d,f)=>{let p=typeof f=="function"?f(c(s)):f;return p===Ox?(d(s,n),i.removeItem(e)):Qm(p)?p.then(y=>(d(s,y),i.setItem(e,y))):(d(s,p),i.setItem(e,p))})},$n=function(e){let n,i,o;return typeof e=="object"?(n=e.hashFunction,i=e.expiring,o=e.tags):n=e,(s,c,d)=>{if(d.value!=null)d.value=Jm(d.value,n,i,o);else if(d.get!=null)d.get=Jm(d.get,n,i,o);else throw"Only put a Memoize() decorator on a method or get accessor."}};var wd=new Map;function Jm(e,n,i=0,o){let s=Symbol("__memoized_map__");return function(...c){let d;this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let f=this[s];if(Array.isArray(o))for(let p of o)wd.has(p)?wd.get(p).push(f):wd.set(p,[f]);if(n||c.length>0||i>0){let p;p=n===!0?c.map(_=>_.toString()).join("!"):n?n.apply(this,c):c[0];let y=`${p}__timestamp`,w=!1;if(i>0)if(!f.has(y))w=!0;else{let _=f.get(y);w=Date.now()-_>i}f.has(p)&&!w?d=f.get(p):(d=e.apply(this,c),f.set(p,d),i>0&&f.set(y,Date.now()))}else{let p=this;f.has(p)?d=f.get(p):(d=e.apply(this,c),f.set(p,d))}return d}}Es=ze(Fl()),J_=ze(void 0);var Fx=class{constructor(){ke(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 Bx(){let{hasLocalStorage:e,hasSessionStorage:n}=aD();return e?window.localStorage:n?window.sessionStorage:new Fx}Ts=Bx();let Qi;s_=class{constructor(e,n=Ts){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)}},Bu=class{constructor(e,n,i=Ts){this.schema=e,this.getDefaultValue=n,this.storage=i}get(e){try{let n=this.storage.getItem(e);if(n==null)return this.getDefaultValue();let i=this.schema.safeParse(JSON.parse(n));return i.success?i.data:(Ee.warn("Error parsing zod local storage",i.error),this.getDefaultValue())}catch(n){return Ee.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)}},im=class extends Bu{constructor(e,n,i){let o=lt.get(Es);super(n,i),this.filename=o;try{this.unsubscribeFromFilename=lt.sub(Es,()=>{let s=lt.get(Es);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 i=this.get(e);this.remove(e),this.filename=n,this.set(e,i)}}dispose(){this.unsubscribeFromFilename&&(this.unsubscribeFromFilename=(this.unsubscribeFromFilename(),null))}},Qi="marimo:notebook-col-sizes";function Hx(){return{widths:[]}}var Eo=new im(Qi,Z2({widths:o4(r4([i4(),a4("contentWidth")]).default("contentWidth"))}),Hx);$w={getColumnWidth:e=>Eo.get(Qi).widths[e]??"contentWidth",saveColumnWidth:(e,n)=>{let i=Eo.get(Qi).widths;if(i[e])i[e]=n;else{for(;i.length<=e;)i.push("contentWidth");i[e]=n}Eo.set(Qi,{widths:i})},clearStorage:()=>{Eo.remove(Qi)}};function Vx(e,n){let i=Eo.get(Qi).widths,o=Ml(i,e,n);Eo.set(Qi,{widths:o})}var Xm,Ym,Zm,Nr,e0,t0,n0,r0,Wn,i0,a0,o0,s0,l0,c0,en;function tr(e,n,i,o,s){var c={};return Object.keys(o).forEach(function(d){c[d]=o[d]}),c.enumerable=!!c.enumerable,c.configurable=!!c.configurable,("value"in c||c.initializer)&&(c.writable=!0),c=i.slice().reverse().reduce(function(d,f){return f(e,n,d)||d},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 Ia=(Xm=$n(),Ym=$n(),Zm=$n(),Nr=class{constructor(e,n,i){this.value=e,this.isCollapsed=n,this.children=i}geDescendantCount(){let e=0,n=[...this.children];for(;n.length>0;){let i=n.pop();e++;for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}return e}getDescendants(){let e=[],n=[...this.children];for(;n.length>0;){let i=n.pop();e.push(i.value);for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}return e}get inOrderIds(){let e=[],n=i=>{e.push(i.value);for(let o of i.children)n(o)};for(let i of this.children)n(i);return e}toString(){return this.isCollapsed?`${this.value} (collapsed)`:String(this.value)}equals(e){return this.value===e.value}},tr(Nr.prototype,"geDescendantCount",[Xm],Object.getOwnPropertyDescriptor(Nr.prototype,"geDescendantCount"),Nr.prototype),tr(Nr.prototype,"getDescendants",[Ym],Object.getOwnPropertyDescriptor(Nr.prototype,"getDescendants"),Nr.prototype),tr(Nr.prototype,"inOrderIds",[Zm],Object.getOwnPropertyDescriptor(Nr.prototype,"inOrderIds"),Nr.prototype),Nr);var $x=0;let To;To=(e0=$n(),t0=$n(),n0=$n(),r0=$n(),Wn=class Co{constructor(n,i){this.nodes=n,this.id=i}static from(n){let i=`tree_${$x++}`;return new Co(n.map(o=>new Ia(o,!1,[])),i)}static fromWithPreviousShape(n,i){var c;if(!i)return Co.from(n);let o=i.id,s=new Co(n.map(d=>new Ia(d,!1,[])),o);for(let d of n)if(i.isCollapsed(d)){let f=((c=i._nodeMap.get(d))==null?void 0:c.children)??[];for(let p=f.length-1;p>=0;p--){let y=f[p];if(s._nodeMap.has(y.value)){s=s.collapse(d,y.value);break}}}return s}withNodes(n){return new Co(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 i of this.nodes)n.set(i.value,i);return n}getDescendants(n){let i=this._nodeMap.get(n);return i?i.getDescendants():(Ee.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),[])}isCollapsed(n){let i=this._nodeMap.get(n);return i?i.isCollapsed:(Ee.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),!1)}indexOfOrThrow(n){let i=this.nodes.findIndex(o=>o.value===n);if(i===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);return i}slice(n,i){return this.nodes.slice(n,i).map(o=>o.value)}moveToFront(n){let i=this.indexOfOrThrow(n);return this.withNodes(Ml(this.nodes,i,0))}moveToBack(n){let i=this.indexOfOrThrow(n);return this.withNodes(Ml(this.nodes,i,this.nodes.length-1))}collapse(n,i){let o=this.nodes.findIndex(p=>p.value===n);if(o===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let s=i===void 0?this.nodes.length:this.nodes.findIndex(p=>p.value===i);if(s===-1)throw Error(`Node ${i} not found in tree`);if(s<o)throw Error(`Node ${i} is before node ${n}`);let c=[...this.nodes],d=c[o];if(d.isCollapsed)throw Error(`Node ${n} is already collapsed`);let f=c.splice(o+1,s-o);return c[o]=new Ia(d.value,!0,f),this.withNodes(c)}collapseAll(n){let i=[...this.nodes];if(n.length===0)throw Error("No collapse ranges provided");if(n.length!==i.length)throw Error(`Collapse ranges length ${n.length} does not match tree length ${i.length}`);let o=i.length-1;for(;o>=0;){let s=i[o],c=n[o];if(!s.isCollapsed&&c){let{id:d,until:f}=c;if(d!==s.value)throw Error(`Node ${s.value} does not match collapse range id ${d}`);let p=f===void 0?i.length:i.findIndex(w=>w.value===f);if(p===-1)throw Error(`Node ${f} not found in tree`);if(p<o)throw Error(`Node ${f} is before node ${d}`);let y=i.splice(o+1,p-o);i[o]=new Ia(s.value,!0,y),o--}else o--}return this.withNodes(i)}expand(n){let i=this.nodes.findIndex(c=>c.value===n);if(i===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let o=[...this.nodes],s=o[i];if(!s.isCollapsed)throw Error(`Node ${n} is already expanded`);return o[i]=new Ia(s.value,!1,[]),o=ww(o,i+1,s.children),this.withNodes(o)}expandAll(){let n=[...this.nodes],i=0;for(;i<n.length;){let o=n[i];o.isCollapsed&&(n[i]=new Ia(o.value,!1,[]),n=ww(n,i+1,o.children)),i++}return this.withNodes(n)}move(n,i){return this.withNodes(Ml(this.nodes,n,i))}at(n){var i;return(i=this.nodes.at(n))==null?void 0:i.value}atOrThrow(n){let i=this.nodes.at(n);if(i===void 0)throw Error(`Node at index ${n} not found in tree`);return i.value}first(){return this.atOrThrow(0)}last(){return this.atOrThrow(this.nodes.length-1)}after(n){let i=this.indexOfOrThrow(n);if(i!==this.nodes.length-1)return this.at(i+1)}before(n){let i=this.indexOfOrThrow(n);if(i!==0)return this.at(i-1)}insert(n,i){return this.withNodes(bw(this.nodes,i,new Ia(n,!1,[])))}insertAtEnd(n){return this.insert(n,this.nodes.length)}insertAtStart(n){return this.insert(n,0)}deleteAtIndex(n){let i=this.atOrThrow(n),o=this.withNodes(this.nodes);try{o=o.expand(i)}catch{}return this.withNodes(iD(o.nodes,n))}delete(n){let i=this.indexOfOrThrow(n);return this.deleteAtIndex(i)}getCount(n){var i;return((i=this._nodeMap.get(n))==null?void 0:i.geDescendantCount())??0}findAndExpandDeep(n){let i=this.find(n);if(i.length===0)return this;let o=this.withNodes(this.nodes);for(let s of i)try{o=o.expand(s)}catch{}return o}find(n){function i(o,s){for(let c of o){if(c.value===n)return[...s,n];let d=i(c.children,[...s,c.value]);if(d.length>0)return d}return[]}return i(this.nodes,[])}split(n){let i=this.nodes.findIndex(c=>c.value===n);if(i===-1)throw Error(`Node ${n} not found in tree`);let o=this.nodes.slice(0,i),s=this.nodes.slice(i);return o.length===0?[Co.from([]),this.withNodes(s)]:[this.withNodes(o),Co.from([]).withNodes(s)]}equals(n){return this.nodes.length===n.nodes.length&&this.nodes.every((i,o)=>i.value===n.nodes[o].value)}toString(){let n=0,i="",o=s=>{for(let c of s)i+=`${" ".repeat(n*2)}${c.toString()}
15
- `,n+=1,o(c.children),--n};return o(this.nodes),i}},tr(Wn.prototype,"topLevelIds",[e0],Object.getOwnPropertyDescriptor(Wn.prototype,"topLevelIds"),Wn.prototype),tr(Wn.prototype,"inOrderIds",[t0],Object.getOwnPropertyDescriptor(Wn.prototype,"inOrderIds"),Wn.prototype),tr(Wn.prototype,"idSet",[n0],Object.getOwnPropertyDescriptor(Wn.prototype,"idSet"),Wn.prototype),tr(Wn.prototype,"_nodeMap",[r0],Object.getOwnPropertyDescriptor(Wn.prototype,"_nodeMap"),Wn.prototype),Wn),Vl=(i0=$n(),a0=$n(),o0=$n(),s0=$n(),l0=$n(),c0=$n(),en=class An{constructor(n){this.columns=n,n.length===0&&(this.columns=[To.from([])])}static from(n){return new An(n.map(i=>To.from(i)))}static fromWithPreviousShape(n,i){if(!i)return An.from([n]);let o=i.getColumns(),s=Array.from({length:o.length},()=>[]),c=0;for(let d of n){let f=o.findIndex(p=>p.idSet.has(d));f===-1?s[c].push(d):(c=f,s[f].push(d))}return new An(s.map((d,f)=>To.fromWithPreviousShape(d,o[f])))}isEmpty(){return this.columns.length===0?!0:this.columns.every(n=>n.nodes.length===0)}static fromIdsAndColumns(n){let i=Math.max(1,...n.map(([,c])=>(c??0)+1)),o=Array.from({length:i},()=>[]),s=0;for(let[c,d]of n)d==null||d<0?o[s].push(c):(o[d].push(c),s=d);return An.from(o)}get topLevelIds(){return this.columns.map(n=>n.topLevelIds)}get iterateTopLevelIds(){let n=this.columns;function*i(){for(let o of n)for(let s of o.topLevelIds)yield s}return i()}get inOrderIds(){return this.columns.flatMap(n=>n.inOrderIds)}get colLength(){return this.columns.length}get idLength(){return this.columns.reduce((n,i)=>n+i.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 i=this.columns[n];if(!i)throw Error(`Column ${n} not found`);return i}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,i=[]){return new An(this.columns.flatMap(o=>o.id===n?[o,To.from(i)]:[o]))}insertBreakpoint(n){let i=this.findWithId(n),[o,s]=i.split(n);return new An(this.columns.flatMap(c=>c===i?[o,s].filter(Boolean):[c]))}delete(n){if(this.columns.length<=1)return this;let i=this.indexOfOrThrow(n),o=i===0?1:i-1,s=[...this.columns],c=s[i];return s[o]=c.withNodes([...s[o].nodes,...c.nodes]),s.splice(i,1),new An(s)}mergeAllColumns(){if(this.columns.length<=1)return this;let n=this.columns.flatMap(o=>o.nodes),i=this.columns[0];return new An([i.withNodes(n)])}moveWithinColumn(n,i,o){return this.transform(n,s=>s.move(i,o))}moveAcrossColumns(n,i,o,s){let c=this.indexOfOrThrow(n),d=this.indexOfOrThrow(o),f=[...this.columns],p=f[c],y=p.nodes.findIndex(C=>C.value===i);if(y===-1)throw Error(`Node ${i} not found in column ${n}`);let w=p.nodes[y];f[c]=p.withNodes(p.nodes.filter((C,E)=>E!==y));let _=f[d];if(s){let C=_.indexOfOrThrow(s);f[d]=_.withNodes(bw(_.nodes,C,w))}else f[d]=_.withNodes([w,..._.nodes]);return new An(f)}indexOfOrThrow(n){let i=this.columns.findIndex(o=>o.id===n);if(i===-1)throw Error(`Column ${n} not found. Possible values: ${this.getColumnIds().join(", ")}`);return i}moveColumn(n,i){if(n===i)return this;let o=this.indexOfOrThrow(n),s=i==="_left_"?o-1:i==="_right_"?o+1:this.indexOfOrThrow(i);return Vx(o,s),new An(Ml([...this.columns],o,s))}moveToNewColumn(n){let i=this.findWithId(n),o=this.columns.map(c=>c.id===i.id?c.delete(n):c),s=To.from([n]);return new An([...o,s])}findWithId(n){let i=this.columns.find(o=>o.inOrderIds.includes(n));if(!i)throw Ee.log(`Possible values: ${this.columns.map(o=>o.inOrderIds).join(", ")}`),Error(`Cell ${n} not found in any column`);return i}transformWithCellId(n,i){let o=!1,s=this.columns.map(c=>{if(c.inOrderIds.includes(n)){let d=i(c);return c!==d&&(o=!0),d}return c});return o?new An(s):this}setupCellExists(){return this.columns.some(n=>n.topLevelIds.includes(yr))}insertId(n,i,o){return this.transform(i,s=>s.insert(n,o))}deleteById(n){return this.transformWithCellId(n,i=>i.delete(n))}compact(){return this.columns.length===1||!this.columns.some(n=>n.nodes.length===0)?this:new An(this.columns.filter(n=>n.nodes.length>0))}transform(n,i){let o=this._columnMap.get(n);if(!o)return Ee.warn(`Column ${n} not found`),this;let s=i(o);return o===s?this:new An(this.columns.map(c=>c.id===n?s:c))}transformAll(n){let i=!1,o=this.columns.map(s=>{let c=n(s);return s.equals(c)||(i=!0),c});return i?new An(o):this}},tr(en.prototype,"isEmpty",[i0],Object.getOwnPropertyDescriptor(en.prototype,"isEmpty"),en.prototype),tr(en.prototype,"topLevelIds",[a0],Object.getOwnPropertyDescriptor(en.prototype,"topLevelIds"),en.prototype),tr(en.prototype,"inOrderIds",[o0],Object.getOwnPropertyDescriptor(en.prototype,"inOrderIds"),en.prototype),tr(en.prototype,"idLength",[s0],Object.getOwnPropertyDescriptor(en.prototype,"idLength"),en.prototype),tr(en.prototype,"_columnMap",[l0],Object.getOwnPropertyDescriptor(en.prototype,"_columnMap"),en.prototype),tr(en.prototype,"getColumnIds",[c0],Object.getOwnPropertyDescriptor(en.prototype,"getColumnIds"),en.prototype),en);let _d,xd,kd,u0,Sd,d0,f0,p0,h0,Cd,Ed,m0,Td,Rd;_d=Ce((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 i(o){return o.type===n.Tag||o.type===n.Script||o.type===n.Style}e.isTag=i,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})),xd=Ce((e=>{var n=e&&e.__extends||(function(){var P=function(A,W){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(de,fe){de.__proto__=fe}||function(de,fe){for(var we in fe)Object.prototype.hasOwnProperty.call(fe,we)&&(de[we]=fe[we])},P(A,W)};return function(A,W){if(typeof W!="function"&&W!==null)throw TypeError("Class extends value "+String(W)+" is not a constructor or null");P(A,W);function de(){this.constructor=A}A.prototype=W===null?Object.create(W):(de.prototype=W.prototype,new de)}})(),i=e&&e.__assign||function(){return i=Object.assign||function(P){for(var A,W=1,de=arguments.length;W<de;W++)for(var fe in A=arguments[W],A)Object.prototype.hasOwnProperty.call(A,fe)&&(P[fe]=A[fe]);return P},i.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=_d(),s=(function(){function P(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(P.prototype,"parentNode",{get:function(){return this.parent},set:function(A){this.parent=A},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"previousSibling",{get:function(){return this.prev},set:function(A){this.prev=A},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"nextSibling",{get:function(){return this.next},set:function(A){this.next=A},enumerable:!1,configurable:!0}),P.prototype.cloneNode=function(A){return A===void 0&&(A=!1),K(this,A)},P})();e.Node=s;var c=(function(P){n(A,P);function A(W){var de=P.call(this)||this;return de.data=W,de}return Object.defineProperty(A.prototype,"nodeValue",{get:function(){return this.data},set:function(W){this.data=W},enumerable:!1,configurable:!0}),A})(s);e.DataNode=c;var d=(function(P){n(A,P);function A(){var W=P!==null&&P.apply(this,arguments)||this;return W.type=o.ElementType.Text,W}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),A})(c);e.Text=d;var f=(function(P){n(A,P);function A(){var W=P!==null&&P.apply(this,arguments)||this;return W.type=o.ElementType.Comment,W}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),A})(c);e.Comment=f;var p=(function(P){n(A,P);function A(W,de){var fe=P.call(this,de)||this;return fe.name=W,fe.type=o.ElementType.Directive,fe}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),A})(c);e.ProcessingInstruction=p;var y=(function(P){n(A,P);function A(W){var de=P.call(this)||this;return de.children=W,de}return Object.defineProperty(A.prototype,"firstChild",{get:function(){return this.children[0]??null},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"childNodes",{get:function(){return this.children},set:function(W){this.children=W},enumerable:!1,configurable:!0}),A})(s);e.NodeWithChildren=y;var w=(function(P){n(A,P);function A(){var W=P!==null&&P.apply(this,arguments)||this;return W.type=o.ElementType.CDATA,W}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),A})(y);e.CDATA=w;var _=(function(P){n(A,P);function A(){var W=P!==null&&P.apply(this,arguments)||this;return W.type=o.ElementType.Root,W}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),A})(y);e.Document=_;var C=(function(P){n(A,P);function A(W,de,fe,we){fe===void 0&&(fe=[]),we===void 0&&(we=W==="script"?o.ElementType.Script:W==="style"?o.ElementType.Style:o.ElementType.Tag);var J=P.call(this,fe)||this;return J.name=W,J.attribs=de,J.type=we,J}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"tagName",{get:function(){return this.name},set:function(W){this.name=W},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"attributes",{get:function(){var W=this;return Object.keys(this.attribs).map(function(de){var fe,we;return{name:de,value:W.attribs[de],namespace:(fe=W["x-attribsNamespace"])==null?void 0:fe[de],prefix:(we=W["x-attribsPrefix"])==null?void 0:we[de]}})},enumerable:!1,configurable:!0}),A})(y);e.Element=C;function E(P){return(0,o.isTag)(P)}e.isTag=E;function T(P){return P.type===o.ElementType.CDATA}e.isCDATA=T;function I(P){return P.type===o.ElementType.Text}e.isText=I;function $(P){return P.type===o.ElementType.Comment}e.isComment=$;function V(P){return P.type===o.ElementType.Directive}e.isDirective=V;function F(P){return P.type===o.ElementType.Root}e.isDocument=F;function N(P){return Object.prototype.hasOwnProperty.call(P,"children")}e.hasChildren=N;function K(P,A){A===void 0&&(A=!1);var W;if(I(P))W=new d(P.data);else if($(P))W=new f(P.data);else if(E(P)){var de=A?pe(P.children):[],fe=new C(P.name,i({},P.attribs),de);de.forEach(function(Se){return Se.parent=fe}),P.namespace!=null&&(fe.namespace=P.namespace),P["x-attribsNamespace"]&&(fe["x-attribsNamespace"]=i({},P["x-attribsNamespace"])),P["x-attribsPrefix"]&&(fe["x-attribsPrefix"]=i({},P["x-attribsPrefix"])),W=fe}else if(T(P)){var de=A?pe(P.children):[],we=new w(de);de.forEach(function(Z){return Z.parent=we}),W=we}else if(F(P)){var de=A?pe(P.children):[],J=new _(de);de.forEach(function(Z){return Z.parent=J}),P["x-mode"]&&(J["x-mode"]=P["x-mode"]),W=J}else if(V(P)){var be=new p(P.name,P.data);P["x-name"]!=null&&(be["x-name"]=P["x-name"],be["x-publicId"]=P["x-publicId"],be["x-systemId"]=P["x-systemId"]),W=be}else throw Error(`Not implemented yet: ${P.type}`);return W.startIndex=P.startIndex,W.endIndex=P.endIndex,P.sourceCodeLocation!=null&&(W.sourceCodeLocation=P.sourceCodeLocation),W}e.cloneNode=K;function pe(P){for(var A=P.map(function(de){return K(de,!0)}),W=1;W<A.length;W++)A[W].prev=A[W-1],A[W-1].next=A[W];return A}})),kd=Ce((e=>{var n=e&&e.__createBinding||(Object.create?(function(f,p,y,w){w===void 0&&(w=y);var _=Object.getOwnPropertyDescriptor(p,y);(!_||("get"in _?!p.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return p[y]}}),Object.defineProperty(f,w,_)}):(function(f,p,y,w){w===void 0&&(w=y),f[w]=p[y]})),i=e&&e.__exportStar||function(f,p){for(var y in f)y!=="default"&&!Object.prototype.hasOwnProperty.call(p,y)&&n(p,f,y)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var o=_d(),s=xd();i(xd(),e);var c={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},d=(function(){function f(p,y,w){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof y=="function"&&(w=y,y=c),typeof p=="object"&&(y=p,p=void 0),this.callback=p??null,this.options=y??c,this.elementCB=w??null}return f.prototype.onparserinit=function(p){this.parser=p},f.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},f.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},f.prototype.onerror=function(p){this.handleCallback(p)},f.prototype.onclosetag=function(){this.lastNode=null;var p=this.tagStack.pop();this.options.withEndIndices&&(p.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(p)},f.prototype.onopentag=function(p,y){var w=this.options.xmlMode?o.ElementType.Tag:void 0,_=new s.Element(p,y,void 0,w);this.addNode(_),this.tagStack.push(_)},f.prototype.ontext=function(p){var y=this.lastNode;if(y&&y.type===o.ElementType.Text)y.data+=p,this.options.withEndIndices&&(y.endIndex=this.parser.endIndex);else{var w=new s.Text(p);this.addNode(w),this.lastNode=w}},f.prototype.oncomment=function(p){if(this.lastNode&&this.lastNode.type===o.ElementType.Comment){this.lastNode.data+=p;return}var y=new s.Comment(p);this.addNode(y),this.lastNode=y},f.prototype.oncommentend=function(){this.lastNode=null},f.prototype.oncdatastart=function(){var p=new s.Text(""),y=new s.CDATA([p]);this.addNode(y),p.parent=y,this.lastNode=p},f.prototype.oncdataend=function(){this.lastNode=null},f.prototype.onprocessinginstruction=function(p,y){var w=new s.ProcessingInstruction(p,y);this.addNode(w)},f.prototype.handleCallback=function(p){if(typeof this.callback=="function")this.callback(p,this.dom);else if(p)throw p},f.prototype.addNode=function(p){var y=this.tagStack[this.tagStack.length-1],w=y.children[y.children.length-1];this.options.withStartIndices&&(p.startIndex=this.parser.startIndex),this.options.withEndIndices&&(p.endIndex=this.parser.endIndex),y.children.push(p),w&&(p.prev=w,w.next=p),p.parent=y,this.lastNode=null},f})();e.DomHandler=d,e.default=d})),u0=Ce((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,i){return n[i.toLowerCase()]=i,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")})),Sd=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=s,e.escapeSpecialCharacters=d,e.revertEscapedCharacters=f,e.formatDOM=p;var n=kd(),i=u0();function o(y){return i.CASE_SENSITIVE_TAG_NAMES_MAP[y]}function s(y){for(var w={},_=0,C=y.length;_<C;_++){var E=y[_];w[E.name]=E.value}return w}function c(y){return y=y.toLowerCase(),o(y)||y}function d(y){return y.replace(i.CARRIAGE_RETURN_REGEX,i.CARRIAGE_RETURN_PLACEHOLDER)}function f(y){return y.replace(i.CARRIAGE_RETURN_PLACEHOLDER_REGEX,i.CARRIAGE_RETURN)}function p(y,w,_){w===void 0&&(w=null);for(var C=[],E,T=0,I=y.length;T<I;T++){var $=y[T];switch($.nodeType){case 1:var V=c($.nodeName);E=new n.Element(V,s($.attributes)),E.children=p(V==="template"?$.content.childNodes:$.childNodes,E);break;case 3:E=new n.Text(f($.nodeValue));break;case 8:E=new n.Comment($.nodeValue);break;default:continue}var F=C[T-1]||null;F&&(F.next=E),E.parent=w,E.prev=F,E.next=null,C.push(E)}return _&&(E=new n.ProcessingInstruction(_.substring(0,_.indexOf(" ")).toLowerCase(),_),E.next=C[0]||null,E.parent=w,C.unshift(E),C[1]&&(C[1].prev=C[0])),C}})),d0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=$;var n=Sd(),i="html",o="head",s="body",c=/<([a-zA-Z]+[0-9]?)/,d=/<head[^]*>/i,f=/<body[^]*>/i,p=function(V,F){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},y=function(V,F){throw Error("This browser does not support `DOMParser.prototype.parseFromString`")},w=typeof window=="object"&&window.DOMParser;if(typeof w=="function"){var _=new w,C="text/html";y=function(V,F){return F&&(V=`<${F}>${V}</${F}>`),_.parseFromString(V,C)},p=y}if(typeof document=="object"&&document.implementation){var E=document.implementation.createHTMLDocument();p=function(V,F){if(F){var N=E.documentElement.querySelector(F);return N&&(N.innerHTML=V),E}return E.documentElement.innerHTML=V,E}}var T=typeof document=="object"&&document.createElement("template"),I;T&&T.content&&(I=function(V){return T.innerHTML=V,T.content.childNodes});function $(V){var F,N;V=(0,n.escapeSpecialCharacters)(V);var K=V.match(c),pe=K&&K[1]?K[1].toLowerCase():"";switch(pe){case i:var P=y(V);if(!d.test(V)){var W=P.querySelector(o);(F=W==null?void 0:W.parentNode)==null||F.removeChild(W)}if(!f.test(V)){var W=P.querySelector(s);(N=W==null?void 0:W.parentNode)==null||N.removeChild(W)}return P.querySelectorAll(i);case o:case s:var A=p(V).querySelectorAll(pe);return f.test(V)&&d.test(V)?A[0].parentNode.childNodes:A;default:if(I)return I(V);var W=p(V,s).querySelector(s);return W.childNodes}}})),f0=Ce((e=>{var n=e&&e.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var i=n(d0()),o=Sd(),s=/<(![a-zA-Z\s]+)>/;function c(d){if(typeof d!="string")throw TypeError("First argument must be a string");if(!d)return[];var f=d.match(s),p=f?f[1]:void 0;return(0,o.formatDOM)((0,i.default)(d),null,p)}})),p0=Ce((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}})),h0=Ce((e=>{var n=0,i=1,o=2,s=3,c=4,d=5,f=6;function p(N){return w.hasOwnProperty(N)?w[N]:null}function y(N,K,pe,P,A,W,de){this.acceptsBooleans=K===o||K===s||K===c,this.attributeName=P,this.attributeNamespace=A,this.mustUseProperty=pe,this.propertyName=N,this.type=K,this.sanitizeURL=W,this.removeEmptyString=de}var w={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(N=>{w[N]=new y(N,n,!1,N,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([N,K])=>{w[N]=new y(N,i,!1,K,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(N=>{w[N]=new y(N,o,!1,N.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(N=>{w[N]=new y(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=>{w[N]=new y(N,s,!1,N.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(N=>{w[N]=new y(N,s,!0,N,null,!1,!1)}),["capture","download"].forEach(N=>{w[N]=new y(N,c,!1,N,null,!1,!1)}),["cols","rows","size","span"].forEach(N=>{w[N]=new y(N,f,!1,N,null,!1,!1)}),["rowSpan","start"].forEach(N=>{w[N]=new y(N,d,!1,N.toLowerCase(),null,!1,!1)});var _=/[\-\:]([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 K=N.replace(_,C);w[K]=new y(K,i,!1,N,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(N=>{let K=N.replace(_,C);w[K]=new y(K,i,!1,N,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(N=>{let K=N.replace(_,C);w[K]=new y(K,i,!1,N,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(N=>{w[N]=new y(N,i,!1,N.toLowerCase(),null,!1,!1)});var E="xlinkHref";w[E]=new y("xlinkHref",i,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(N=>{w[N]=new y(N,i,!1,N.toLowerCase(),null,!0,!0)});var{CAMELCASE:T,SAME:I,possibleStandardNames:$}=p0(),V=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]*$")),F=Object.keys($).reduce((N,K)=>{let pe=$[K];return pe===I?N[K]=K:pe===T?N[K.toLowerCase()]=K:N[K]=pe,N},{});e.BOOLEAN=s,e.BOOLEANISH_STRING=o,e.NUMERIC=d,e.OVERLOADED_BOOLEAN=c,e.POSITIVE_NUMERIC=f,e.RESERVED=n,e.STRING=i,e.getPropertyInfo=p,e.isCustomAttribute=V,e.possibleStandardNames=F})),Cd=Ce((e=>{var n=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};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=f;var i=Ou(),o=n(oD()),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(p,y){return p.includes("-")?!s.has(p):!!(y&&typeof y.is=="string")}var d={reactCompat:!0};function f(p,y){if(typeof p=="string"){if(!p.trim()){y.style={};return}try{y.style=(0,o.default)(p,d)}catch{y.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(i.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),e.canTextBeChildOfNode=function(p){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(p.name)},e.returnFirstArg=function(p){return p}})),Ed=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var n=h0(),i=Cd(),o=["checked","value"],s=["input","select","textarea"],c={reset:!0,submit:!0};function d(p,y){p===void 0&&(p={});var w={},_=!!(p.type&&c[p.type]);for(var C in p){var E=p[C];if((0,n.isCustomAttribute)(C)){w[C]=E;continue}var T=C.toLowerCase(),I=f(T);if(I){var $=(0,n.getPropertyInfo)(I);switch(o.includes(I)&&s.includes(y)&&!_&&(I=f("default"+T)),w[I]=E,$&&$.type){case n.BOOLEAN:w[I]=!0;break;case n.OVERLOADED_BOOLEAN:E===""&&(w[I]=!0);break}continue}i.PRESERVE_CUSTOM_ATTRIBUTES&&(w[C]=E)}return(0,i.setStyleProp)(p.style,w),w}function f(p){return n.possibleStandardNames[p]}})),m0=Ce((e=>{var n=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var i=Ou(),o=n(Ed()),s=Cd(),c={cloneElement:i.cloneElement,createElement:i.createElement,isValidElement:i.isValidElement};function d(p,y){y===void 0&&(y={});for(var w=[],_=typeof y.replace=="function",C=y.transform||s.returnFirstArg,E=y.library||c,T=E.cloneElement,I=E.createElement,$=E.isValidElement,V=p.length,F=0;F<V;F++){var N=p[F];if(_){var K=y.replace(N,F);if($(K)){V>1&&(K=T(K,{key:K.key||F})),w.push(C(K,N,F));continue}}if(N.type==="text"){var pe=!N.data.trim().length;if(pe&&N.parent&&!(0,s.canTextBeChildOfNode)(N.parent)||y.trim&&pe)continue;w.push(C(N.data,N,F));continue}var P=N,A={};f(P)?((0,s.setStyleProp)(P.attribs.style,P.attribs),A=P.attribs):P.attribs&&(A=(0,o.default)(P.attribs,P.name));var W=void 0;switch(N.type){case"script":case"style":N.children[0]&&(A.dangerouslySetInnerHTML={__html:N.children[0].data});break;case"tag":N.name==="textarea"&&N.children[0]?A.defaultValue=N.children[0].data:N.children&&N.children.length&&(W=d(N.children,y));break;default:continue}V>1&&(A.key=F),w.push(C(I(N.name,A,W),N,F))}return w.length===1?w[0]:w}function f(p){return s.PRESERVE_CUSTOM_ATTRIBUTES&&p.type==="tag"&&(0,s.isCustomComponent)(p.name,p.attribs)}})),Td=Ce((e=>{var n=e&&e.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=d;var i=n(f0());e.htmlToDOM=i.default,e.attributesToProps=n(Ed()).default;var o=n(m0());e.domToReact=o.default;var s=kd();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 d(f,p){if(typeof f!="string")throw TypeError("First argument must be a string");return f?(0,o.default)((0,i.default)(f,(p==null?void 0:p.htmlparser2)||c),p):[]}})),Rd=vh(Td(),1),Da=Td(),qm=Rd.default.default||Rd.default;let Yl;Yl=(e,n)=>{let[i,...o]=n.split("."),s=(e.attribs.class||"").split(" ");return e.tagName===i&&o.every(c=>s.includes(c))},Ww=e=>{var n;return e&&Yl(e,"span.nb")&&e.firstChild instanceof Da.Text&&((n=e.firstChild.nodeValue)==null?void 0:n.includes("__marimo__"))},tm=function(e){var n,i,o;if(e instanceof Da.Element&&e.firstChild instanceof Da.Text&&Yl(e,"span.nb")){let s=e.next;if(s&&s instanceof Da.Text){let c=s.next;if(c&&c instanceof Da.Element&&c.firstChild instanceof Da.Text&&Yl(c,"span.m")){let d=Number.parseInt(c.firstChild.nodeValue||"0",10);if((n=e.firstChild.nodeValue)!=null&&n.includes("__marimo__")){let f=(i=/__marimo__cell_(\w+)_/.exec(e.firstChild.nodeValue))==null?void 0:i[1];if(f&&d)return{kind:"cell",cellId:f,lineNumber:d}}else{let f=(o=/"(.+?)"/.exec(e.firstChild.nodeValue))==null?void 0:o[1];if(f&&d)return{kind:"file",filePath:f,lineNumber:d}}}}}return null},Uh=function(e){let n=[];return qm(e,{replace:i=>{let o=tm(i);if(o)return n.push(o),"dummy"}}),n};function g0(e){return n=>{let i=!1;for(let o of n)o&&(i=e(o)||i);return i}}const Wx=g0(O4),Ux=g0(P4);let Dd,y0,Ro,v0,Do,b0;Dd=Ce(((e,n)=>{var i=typeof Reflect=="object"?Reflect:null,o=i&&typeof i.apply=="function"?i.apply:function(P,A,W){return Function.prototype.apply.call(P,A,W)},s=i&&typeof i.ownKeys=="function"?i.ownKeys:Object.getOwnPropertySymbols?function(P){return Object.getOwnPropertyNames(P).concat(Object.getOwnPropertySymbols(P))}:function(P){return Object.getOwnPropertyNames(P)};function c(P){console&&console.warn&&console.warn(P)}var d=Number.isNaN||function(P){return P!==P};function f(){f.init.call(this)}n.exports=f,n.exports.once=N,f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var p=10;function y(P){if(typeof P!="function")throw TypeError('The "listener" argument must be of type Function. Received type '+typeof P)}Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return p},set:function(P){if(typeof P!="number"||P<0||d(P))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+P+".");p=P}}),f.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},f.prototype.setMaxListeners=function(P){if(typeof P!="number"||P<0||d(P))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+P+".");return this._maxListeners=P,this};function w(P){return P._maxListeners===void 0?f.defaultMaxListeners:P._maxListeners}f.prototype.getMaxListeners=function(){return w(this)},f.prototype.emit=function(P){for(var A=[],W=1;W<arguments.length;W++)A.push(arguments[W]);var de=P==="error",fe=this._events;if(fe!==void 0)de&&(de=fe.error===void 0);else if(!de)return!1;if(de){var we;if(A.length>0&&(we=A[0]),we instanceof Error)throw we;var J=Error("Unhandled error."+(we?" ("+we.message+")":""));throw J.context=we,J}var be=fe[P];if(be===void 0)return!1;if(typeof be=="function")o(be,this,A);else for(var Se=be.length,Z=$(be,Se),W=0;W<Se;++W)o(Z[W],this,A);return!0};function _(P,A,W,de){var fe,we,J;if(y(W),we=P._events,we===void 0?(we=P._events=Object.create(null),P._eventsCount=0):(we.newListener!==void 0&&(P.emit("newListener",A,W.listener?W.listener:W),we=P._events),J=we[A]),J===void 0)J=we[A]=W,++P._eventsCount;else if(typeof J=="function"?J=we[A]=de?[W,J]:[J,W]:de?J.unshift(W):J.push(W),fe=w(P),fe>0&&J.length>fe&&!J.warned){J.warned=!0;var be=Error("Possible EventEmitter memory leak detected. "+J.length+" "+String(A)+" listeners added. Use emitter.setMaxListeners() to increase limit");be.name="MaxListenersExceededWarning",be.emitter=P,be.type=A,be.count=J.length,c(be)}return P}f.prototype.addListener=function(P,A){return _(this,P,A,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(P,A){return _(this,P,A,!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(P,A,W){var de={fired:!1,wrapFn:void 0,target:P,type:A,listener:W},fe=C.bind(de);return fe.listener=W,de.wrapFn=fe,fe}f.prototype.once=function(P,A){return y(A),this.on(P,E(this,P,A)),this},f.prototype.prependOnceListener=function(P,A){return y(A),this.prependListener(P,E(this,P,A)),this},f.prototype.removeListener=function(P,A){var W,de,fe,we,J;if(y(A),de=this._events,de===void 0||(W=de[P],W===void 0))return this;if(W===A||W.listener===A)--this._eventsCount===0?this._events=Object.create(null):(delete de[P],de.removeListener&&this.emit("removeListener",P,W.listener||A));else if(typeof W!="function"){for(fe=-1,we=W.length-1;we>=0;we--)if(W[we]===A||W[we].listener===A){J=W[we].listener,fe=we;break}if(fe<0)return this;fe===0?W.shift():V(W,fe),W.length===1&&(de[P]=W[0]),de.removeListener!==void 0&&this.emit("removeListener",P,J||A)}return this},f.prototype.off=f.prototype.removeListener,f.prototype.removeAllListeners=function(P){var A,W=this._events,de;if(W===void 0)return this;if(W.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):W[P]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete W[P]),this;if(arguments.length===0){var fe=Object.keys(W),we;for(de=0;de<fe.length;++de)we=fe[de],we!=="removeListener"&&this.removeAllListeners(we);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(A=W[P],typeof A=="function")this.removeListener(P,A);else if(A!==void 0)for(de=A.length-1;de>=0;de--)this.removeListener(P,A[de]);return this};function T(P,A,W){var de=P._events;if(de===void 0)return[];var fe=de[A];return fe===void 0?[]:typeof fe=="function"?W?[fe.listener||fe]:[fe]:W?F(fe):$(fe,fe.length)}f.prototype.listeners=function(P){return T(this,P,!0)},f.prototype.rawListeners=function(P){return T(this,P,!1)},f.listenerCount=function(P,A){return typeof P.listenerCount=="function"?P.listenerCount(A):I.call(P,A)},f.prototype.listenerCount=I;function I(P){var A=this._events;if(A!==void 0){var W=A[P];if(typeof W=="function")return 1;if(W!==void 0)return W.length}return 0}f.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function $(P,A){for(var W=Array(A),de=0;de<A;++de)W[de]=P[de];return W}function V(P,A){for(;A+1<P.length;A++)P[A]=P[A+1];P.pop()}function F(P){for(var A=Array(P.length),W=0;W<A.length;++W)A[W]=P[W].listener||P[W];return A}function N(P,A){return new Promise(function(W,de){function fe(J){P.removeListener(A,we),de(J)}function we(){typeof P.removeListener=="function"&&P.removeListener("error",fe),W([].slice.call(arguments))}pe(P,A,we,{once:!0}),A!=="error"&&K(P,fe,{once:!0})})}function K(P,A,W){typeof P.on=="function"&&pe(P,"error",A,W)}function pe(P,A,W,de){if(typeof P.on=="function")de.once?P.once(A,W):P.on(A,W);else if(typeof P.addEventListener=="function")P.addEventListener(A,function fe(we){de.once&&P.removeEventListener(A,fe),W(we)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof P)}})),y0=Ce((e=>{var n=e&&e.__awaiter||function(s,c,d,f){function p(y){return y instanceof d?y:new d(function(w){w(y)})}return new(d||(d=Promise))(function(y,w){function _(T){try{E(f.next(T))}catch(I){w(I)}}function C(T){try{E(f.throw(T))}catch(I){w(I)}}function E(T){T.done?y(T.value):p(T.value).then(_,C)}E((f=f.apply(s,c||[])).next())})},i=e&&e.__generator||function(s,c){var d={label:0,sent:function(){if(y[0]&1)throw y[1];return y[1]},trys:[],ops:[]},f,p,y,w;return w={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(w[Symbol.iterator]=function(){return this}),w;function _(E){return function(T){return C([E,T])}}function C(E){if(f)throw TypeError("Generator is already executing.");for(;d;)try{if(f=1,p&&(y=E[0]&2?p.return:E[0]?p.throw||((y=p.return)&&y.call(p),0):p.next)&&!(y=y.call(p,E[1])).done)return y;switch(p=0,y&&(E=[E[0]&2,y.value]),E[0]){case 0:case 1:y=E;break;case 4:return d.label++,{value:E[1],done:!1};case 5:d.label++,p=E[1],E=[0];continue;case 7:E=d.ops.pop(),d.trys.pop();continue;default:if(y=d.trys,!(y=y.length>0&&y[y.length-1])&&(E[0]===6||E[0]===2)){d=0;continue}if(E[0]===3&&(!y||E[1]>y[0]&&E[1]<y[3])){d.label=E[1];break}if(E[0]===6&&d.label<y[1]){d.label=y[1],y=E;break}if(y&&d.label<y[2]){d.label=y[2],d.ops.push(E);break}y[2]&&d.ops.pop(),d.trys.pop();continue}E=c.call(s,d)}catch(T){E=[6,T],p=0}finally{f=y=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=Dd();e.defaultNextRequest=function(){var s=-1;return function(){return++s}},e.default=(function(){function s(c,d){d===void 0&&(d=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=d}return s.prototype.connect=function(){var c=this;return Promise.all(this.transports.map(function(d){return n(c,void 0,void 0,function(){return i(this,function(f){switch(f.label){case 0:return d.subscribe("error",this.handleError.bind(this)),d.subscribe("notification",this.handleNotification.bind(this)),[4,d.connect()];case 1:return f.sent(),[2]}})})}))},s.prototype.getPrimaryTransport=function(){return this.transports[0]},s.prototype.request=function(c,d,f){return d===void 0&&(d=!1),n(this,void 0,void 0,function(){var p,y,w,_,C=this;return i(this,function(E){return p=this.nextID().toString(),y=d?null:p,w={request:this.makeRequest(c.method,c.params||[],y),internalID:p},this.batchStarted?(_=new Promise(function(T,I){C.batch.push({resolve:T,reject:I,request:w})}),[2,_]):[2,this.getPrimaryTransport().sendData(w,f)]})})},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,d,f){return f?{jsonrpc:"2.0",id:f,method:c,params:d}:{jsonrpc:"2.0",method:c,params:d}},s.prototype.handleError=function(c){this.requestChannel.emit("error",c)},s.prototype.handleNotification=function(c){this.requestChannel.emit("notification",c)},s})()})),Ro=Ce((e=>{var n=e&&e.__extends||(function(){var o=function(s,c){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var p in f)f.hasOwnProperty(p)&&(d[p]=f[p])},o(s,c)};return function(s,c){o(s,c);function d(){this.constructor=s}s.prototype=c===null?Object.create(c):(d.prototype=c.prototype,new d)}})();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 i=(function(o){n(s,o);function s(c,d,f){var p=this.constructor,y=o.call(this,c)||this;return y.message=c,y.code=d,y.data=f,Object.setPrototypeOf(y,p.prototype),y}return s})(Error);e.JSONRPCError=i,e.convertJSONToRPCError=function(o){if(o.error){var s=o.error,c=s.message,d=s.code,f=s.data;return new i(c,d,f)}return new i("Unknown error",e.ERR_UNKNOWN,o)}})),v0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TransportRequestManager=void 0;var n=Dd(),i=Ro();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 d=this;s.forEach(function(f){var p=d.pendingRequest[f.internalID];if(delete d.pendingBatchRequest[f.internalID],p!==void 0){if(c){p.reject(c);return}p.resolve(),(f.request.id===null||f.request.id===void 0)&&delete d.pendingRequest[f.internalID]}})},o.prototype.isPendingRequest=function(s){return this.pendingRequest.hasOwnProperty(s)},o.prototype.resolveResponse=function(s,c){c===void 0&&(c=!0);var d=s;try{return d=JSON.parse(s),this.checkJSONRPC(d)===!1?void 0:d instanceof Array?this.resolveBatch(d,c):this.resolveRes(d,c)}catch{var f=new i.JSONRPCError("Bad response format",i.ERR_UNKNOWN,s);return c&&this.transportEventChannel.emit("error",f),f}},o.prototype.addBatchReq=function(s,c){var d=this;return s.forEach(function(f){var p=f.resolve,y=f.reject,w=f.request.internalID;d.pendingBatchRequest[w]=!0,d.pendingRequest[w]={resolve:p,reject:y}}),Promise.resolve()},o.prototype.addReq=function(s,c){var d=this;return new Promise(function(f,p){c!==null&&c&&d.setRequestTimeout(s,c,p),d.pendingRequest[s]={resolve:f,reject:p}})},o.prototype.checkJSONRPC=function(s){var c=[s];return s instanceof Array&&(c=s),c.every(function(d){return d.result!==void 0||d.error!==void 0||d.method!==void 0})},o.prototype.processResult=function(s,c){if(s.error){var d=i.convertJSONToRPCError(s);c.reject(d);return}c.resolve(s.result)},o.prototype.resolveBatch=function(s,c){var d=this,f=s.map(function(p){return d.resolveRes(p,c)}).filter(function(p){return p});if(f.length>0)return f[0]},o.prototype.resolveRes=function(s,c){var d=s.id,f=s.error,p=this.pendingRequest[d];if(p){delete this.pendingRequest[d],this.processResult(s,p),this.transportEventChannel.emit("response",s);return}if(d===void 0&&f===void 0){this.transportEventChannel.emit("notification",s);return}var y;return f&&(y=i.convertJSONToRPCError(s)),c&&f&&y&&this.transportEventChannel.emit("error",y),y},o.prototype.setRequestTimeout=function(s,c,d){var f=this;setTimeout(function(){delete f.pendingRequest[s],d(new i.JSONRPCError("Request timeout request took longer than "+c+" ms to resolve",i.ERR_TIMEOUT))},c)},o})()})),Oa=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Transport=void 0;var n=v0();e.Transport=(function(){function i(){this.transportRequestManager=new n.TransportRequestManager,this.transportRequestManager.transportEventChannel.on("error",function(){})}return i.prototype.subscribe=function(o,s){this.transportRequestManager.transportEventChannel.addListener(o,s)},i.prototype.unsubscribe=function(o,s){if(!o)return this.transportRequestManager.transportEventChannel.removeAllListeners();o&&s&&this.transportRequestManager.transportEventChannel.removeListener(o,s)},i.prototype.parseData=function(o){return o instanceof Array?o.map(function(s){return s.request.request}):o.request},i})()})),Do=Ce((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(i){return i.request.request.id!=null}).map(function(i){return i.request}):[]},e.getNotifications=function(n){return n instanceof Array?n.filter(function(i){return e.isNotification(i.request)}).map(function(i){return i.request}):e.isNotification(n)?[n]:[]}})),b0=Ce((e=>{var n=e&&e.__extends||(function(){var c=function(d,f){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,y){p.__proto__=y}||function(p,y){for(var w in y)y.hasOwnProperty(w)&&(p[w]=y[w])},c(d,f)};return function(d,f){c(d,f);function p(){this.constructor=d}d.prototype=f===null?Object.create(f):(p.prototype=f.prototype,new p)}})();Object.defineProperty(e,"__esModule",{value:!0});var i=Oa(),o=Do(),s=Ro();e.default=(function(c){n(d,c);function d(f,p,y){var w=c.call(this)||this;return w.connection=f,w.reqUri=p,w.resUri=y,w}return d.prototype.connect=function(){var f=this;return this.connection.on(this.resUri,function(p){f.transportRequestManager.resolveResponse(p)}),Promise.resolve()},d.prototype.sendData=function(f,p){p===void 0&&(p=null);var y=this.transportRequestManager.addRequest(f,p),w=o.getNotifications(f),_=this.parseData(f);try{return this.connection.emit(this.reqUri,_),this.transportRequestManager.settlePendingRequest(w),y}catch(E){var C=new s.JSONRPCError(E.message,s.ERR_UNKNOWN,E);return this.transportRequestManager.settlePendingRequest(w,C),Promise.reject(C)}},d.prototype.close=function(){this.connection.removeAllListeners()},d})(i.Transport)}));function Kx(e){return e&&DataView.prototype.isPrototypeOf(e)}function Oo(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 Od(e){return typeof e!="string"&&(e=String(e)),e}function Pd(e){var n={next:function(){var i=e.shift();return{done:i===void 0,value:i}}};return Rn.iterable&&(n[Symbol.iterator]=function(){return n}),n}function cn(e){this.map={},e instanceof cn?e.forEach(function(n,i){this.append(i,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 Md(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function w0(e){return new Promise(function(n,i){e.onload=function(){n(e.result)},e.onerror=function(){i(e.error)}})}function Qx(e){var n=new FileReader,i=w0(n);return n.readAsArrayBuffer(e),i}function Gx(e){var n=new FileReader,i=w0(n),o=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=o?o[1]:"utf-8";return n.readAsText(e,s),i}function Jx(e){for(var n=new Uint8Array(e),i=Array(n.length),o=0;o<n.length;o++)i[o]=String.fromCharCode(n[o]);return i.join("")}function _0(e){if(e.slice)return e.slice(0);var n=new Uint8Array(e.byteLength);return n.set(new Uint8Array(e)),n.buffer}function x0(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:Rn.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Rn.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Rn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Rn.arrayBuffer&&Rn.blob&&Kx(e)?(this._bodyArrayBuffer=_0(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Rn.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||C0(e))?this._bodyArrayBuffer=_0(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):Rn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Rn.blob&&(this.blob=function(){var e=Md(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 Md(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(Rn.blob)return this.blob().then(Qx);throw Error("could not read as ArrayBuffer")},this.text=function(){var e=Md(this);if(e)return e;if(this._bodyBlob)return Gx(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Jx(this._bodyArrayBuffer));if(this._bodyFormData)throw Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Rn.formData&&(this.formData=function(){return this.text().then(Yx)}),this.json=function(){return this.text().then(JSON.parse)},this}function Xx(e){var n=e.toUpperCase();return E0.indexOf(n)>-1?n:e}function Aa(e,n){if(!(this instanceof Aa))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');n||(n={});var i=n.body;if(e instanceof Aa){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,n.headers||(this.headers=new cn(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!i&&e._bodyInit!=null&&(i=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 cn(n.headers)),this.method=Xx(n.method||this.method||"GET"),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal||(function(){if("AbortController"in gn)return new AbortController().signal})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&i)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),(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 Yx(e){var n=new FormData;return e.trim().split("&").forEach(function(i){if(i){var o=i.split("="),s=o.shift().replace(/\+/g," "),c=o.join("=").replace(/\+/g," ");n.append(decodeURIComponent(s),decodeURIComponent(c))}}),n}function Zx(e){var n=new cn;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(i){return i.indexOf(`
16
- `)===0?i.substr(1,i.length):i}).forEach(function(i){var o=i.split(":"),s=o.shift().trim();if(s){var c=o.join(":").trim();try{n.append(s,c)}catch(d){console.warn("Response "+d.message)}}}),n}function Zr(e,n){if(!(this instanceof Zr))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 cn(n.headers),this.url=n.url||"",this._initBody(e)}function k0(e,n){return new Promise(function(i,o){var s=new Aa(e,n);if(s.signal&&s.signal.aborted)return o(new Gi("Aborted","AbortError"));var c=new XMLHttpRequest;function d(){c.abort()}c.onload=function(){var y={statusText:c.statusText,headers:Zx(c.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(c.status<200||c.status>599)?y.status=200:y.status=c.status,y.url="responseURL"in c?c.responseURL:y.headers.get("X-Request-URL");var w="response"in c?c.response:c.responseText;setTimeout(function(){i(new Zr(w,y))},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 Gi("Aborted","AbortError"))},0)};function f(y){try{return y===""&&gn.location.href?gn.location.href:y}catch{return y}}if(c.open(s.method,f(s.url),!0),s.credentials==="include"?c.withCredentials=!0:s.credentials==="omit"&&(c.withCredentials=!1),"responseType"in c&&(Rn.blob?c.responseType="blob":Rn.arrayBuffer&&(c.responseType="arraybuffer")),n&&typeof n.headers=="object"&&!(n.headers instanceof cn||gn.Headers&&n.headers instanceof gn.Headers)){var p=[];Object.getOwnPropertyNames(n.headers).forEach(function(y){p.push(Oo(y)),c.setRequestHeader(y,Od(n.headers[y]))}),s.headers.forEach(function(y,w){p.indexOf(w)===-1&&c.setRequestHeader(w,y)})}else s.headers.forEach(function(y,w){c.setRequestHeader(w,y)});s.signal&&(s.signal.addEventListener("abort",d),c.onreadystatechange=function(){c.readyState===4&&s.signal.removeEventListener("abort",d)}),c.send(s._bodyInit===void 0?null:s._bodyInit)})}let gn,Rn,S0,C0,E0,T0,Gi,R0,D0,O0,P0,qa,M0,L0,N0,I0,A0,q0,Po,Ld,Nd,j0,Ji,Mo,Zl,z0,Id,F0,B0,H0,V0,ec,$0,ja,Ad,Vt,tc,W0,U0,K0,Q0,G0,J0,X0,Y0,Z0,eg,tg,ng,rg,ig,ag,og,sg,lg,cg,ug,dg,fg,pg,hg;R0=J2((()=>{gn=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},Rn={searchParams:"URLSearchParams"in gn,iterable:"Symbol"in gn&&"iterator"in Symbol,blob:"FileReader"in gn&&"Blob"in gn&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in gn,arrayBuffer:"ArrayBuffer"in gn},Rn.arrayBuffer&&(S0=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],C0=ArrayBuffer.isView||function(e){return e&&S0.indexOf(Object.prototype.toString.call(e))>-1}),cn.prototype.append=function(e,n){e=Oo(e),n=Od(n);var i=this.map[e];this.map[e]=i?i+", "+n:n},cn.prototype.delete=function(e){delete this.map[Oo(e)]},cn.prototype.get=function(e){return e=Oo(e),this.has(e)?this.map[e]:null},cn.prototype.has=function(e){return this.map.hasOwnProperty(Oo(e))},cn.prototype.set=function(e,n){this.map[Oo(e)]=Od(n)},cn.prototype.forEach=function(e,n){for(var i in this.map)this.map.hasOwnProperty(i)&&e.call(n,this.map[i],i,this)},cn.prototype.keys=function(){var e=[];return this.forEach(function(n,i){e.push(i)}),Pd(e)},cn.prototype.values=function(){var e=[];return this.forEach(function(n){e.push(n)}),Pd(e)},cn.prototype.entries=function(){var e=[];return this.forEach(function(n,i){e.push([i,n])}),Pd(e)},Rn.iterable&&(cn.prototype[Symbol.iterator]=cn.prototype.entries),E0=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],Aa.prototype.clone=function(){return new Aa(this,{body:this._bodyInit})},x0.call(Aa.prototype),x0.call(Zr.prototype),Zr.prototype.clone=function(){return new Zr(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new cn(this.headers),url:this.url})},Zr.error=function(){var e=new Zr(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e},T0=[301,302,303,307,308],Zr.redirect=function(e,n){if(T0.indexOf(n)===-1)throw RangeError("Invalid status code");return new Zr(null,{status:n,headers:{location:e}})},Gi=gn.DOMException;try{new Gi}catch{Gi=function(e,n){this.message=e,this.name=n,this.stack=Error(e).stack},Gi.prototype=Object.create(Error.prototype),Gi.prototype.constructor=Gi}k0.polyfill=!0,gn.fetch||(gn.fetch=k0,gn.Headers=cn,gn.Request=Aa,gn.Response=Zr)})),D0=Ce(((e,n)=>{R0(),n.exports=self.fetch.bind(self)})),O0=Ce((e=>{var n=e&&e.__extends||(function(){var w=function(_,C){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,T){E.__proto__=T}||function(E,T){for(var I in T)T.hasOwnProperty(I)&&(E[I]=T[I])},w(_,C)};return function(_,C){w(_,C);function E(){this.constructor=_}_.prototype=C===null?Object.create(C):(E.prototype=C.prototype,new E)}})(),i=e&&e.__awaiter||function(w,_,C,E){function T(I){return I instanceof C?I:new C(function($){$(I)})}return new(C||(C=Promise))(function(I,$){function V(K){try{N(E.next(K))}catch(pe){$(pe)}}function F(K){try{N(E.throw(K))}catch(pe){$(pe)}}function N(K){K.done?I(K.value):T(K.value).then(V,F)}N((E=E.apply(w,_||[])).next())})},o=e&&e.__generator||function(w,_){var C={label:0,sent:function(){if(I[0]&1)throw I[1];return I[1]},trys:[],ops:[]},E,T,I,$;return $={next:V(0),throw:V(1),return:V(2)},typeof Symbol=="function"&&($[Symbol.iterator]=function(){return this}),$;function V(N){return function(K){return F([N,K])}}function F(N){if(E)throw TypeError("Generator is already executing.");for(;C;)try{if(E=1,T&&(I=N[0]&2?T.return:N[0]?T.throw||((I=T.return)&&I.call(T),0):T.next)&&!(I=I.call(T,N[1])).done)return I;switch(T=0,I&&(N=[N[0]&2,I.value]),N[0]){case 0:case 1:I=N;break;case 4:return C.label++,{value:N[1],done:!1};case 5:C.label++,T=N[1],N=[0];continue;case 7:N=C.ops.pop(),C.trys.pop();continue;default:if(I=C.trys,!(I=I.length>0&&I[I.length-1])&&(N[0]===6||N[0]===2)){C=0;continue}if(N[0]===3&&(!I||N[1]>I[0]&&N[1]<I[3])){C.label=N[1];break}if(N[0]===6&&C.label<I[1]){C.label=I[1],I=N;break}if(I&&C.label<I[2]){C.label=I[2],C.ops.push(N);break}I[2]&&C.ops.pop(),C.trys.pop();continue}N=_.call(w,C)}catch(K){N=[6,K],T=0}finally{E=I=0}if(N[0]&5)throw N[1];return{value:N[0]?N[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTTPTransport=void 0;var c=s(D0()),d=Oa(),f=Do(),p=Ro(),y=(function(w){n(_,w);function _(C,E){var T=w.call(this)||this;return T.onlyNotifications=function(I){return I instanceof Array?I.every(function($){return $.request.request.id===null||$.request.request.id===void 0}):I.request.id===null||I.request.id===void 0},T.uri=C,T.credentials=E&&E.credentials,T.headers=_.setupHeaders(E&&E.headers),T.injectedFetcher=E==null?void 0:E.fetcher,T}return _.prototype.connect=function(){return Promise.resolve()},_.prototype.sendData=function(C,E){return E===void 0&&(E=null),i(this,void 0,void 0,function(){var T,I,$,V,F,N,pe,K,pe;return o(this,function(P){switch(P.label){case 0:T=this.transportRequestManager.addRequest(C,E),I=f.getNotifications(C),$=f.getBatchRequests(C),V=this.injectedFetcher||c.default,P.label=1;case 1:return P.trys.push([1,4,,5]),[4,V(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(C)),credentials:this.credentials})];case 2:return F=P.sent(),this.transportRequestManager.settlePendingRequest(I),this.onlyNotifications(C)?[2,Promise.resolve()]:[4,F.text()];case 3:return N=P.sent(),pe=this.transportRequestManager.resolveResponse(N),pe?(this.transportRequestManager.settlePendingRequest($,pe),[2,Promise.reject(pe)]):[3,5];case 4:return K=P.sent(),pe=new p.JSONRPCError(K.message,p.ERR_UNKNOWN,K),this.transportRequestManager.settlePendingRequest(I,pe),this.transportRequestManager.settlePendingRequest(f.getBatchRequests(C),pe),[2,Promise.reject(pe)];case 5:return[2,T]}})})},_.prototype.close=function(){},_.setupHeaders=function(C){var E=new Headers(C);return E.set("Content-Type","application/json"),E},_})(d.Transport);e.HTTPTransport=y,e.default=y})),P0=ZR({default:()=>M0},1),L0=J2((()=>{qa=null,typeof WebSocket<"u"?qa=WebSocket:typeof MozWebSocket<"u"?qa=MozWebSocket:typeof global<"u"?qa=global.WebSocket||global.MozWebSocket:typeof window<"u"?qa=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(qa=self.WebSocket||self.MozWebSocket),M0=qa})),N0=Ce((e=>{var n=e&&e.__extends||(function(){var y=function(w,_){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,E){C.__proto__=E}||function(C,E){for(var T in E)E.hasOwnProperty(T)&&(C[T]=E[T])},y(w,_)};return function(w,_){y(w,_);function C(){this.constructor=w}w.prototype=_===null?Object.create(_):(C.prototype=_.prototype,new C)}})(),i=e&&e.__awaiter||function(y,w,_,C){function E(T){return T instanceof _?T:new _(function(I){I(T)})}return new(_||(_=Promise))(function(T,I){function $(N){try{F(C.next(N))}catch(K){I(K)}}function V(N){try{F(C.throw(N))}catch(K){I(K)}}function F(N){N.done?T(N.value):E(N.value).then($,V)}F((C=C.apply(y,w||[])).next())})},o=e&&e.__generator||function(y,w){var _={label:0,sent:function(){if(T[0]&1)throw T[1];return T[1]},trys:[],ops:[]},C,E,T,I;return I={next:$(0),throw:$(1),return:$(2)},typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function $(F){return function(N){return V([F,N])}}function V(F){if(C)throw TypeError("Generator is already executing.");for(;_;)try{if(C=1,E&&(T=F[0]&2?E.return:F[0]?E.throw||((T=E.return)&&T.call(E),0):E.next)&&!(T=T.call(E,F[1])).done)return T;switch(E=0,T&&(F=[F[0]&2,T.value]),F[0]){case 0:case 1:T=F;break;case 4:return _.label++,{value:F[1],done:!1};case 5:_.label++,E=F[1],F=[0];continue;case 7:F=_.ops.pop(),_.trys.pop();continue;default:if(T=_.trys,!(T=T.length>0&&T[T.length-1])&&(F[0]===6||F[0]===2)){_=0;continue}if(F[0]===3&&(!T||F[1]>T[0]&&F[1]<T[3])){_.label=F[1];break}if(F[0]===6&&_.label<T[1]){_.label=T[1],T=F;break}if(T&&_.label<T[2]){_.label=T[2],_.ops.push(F);break}T[2]&&_.ops.pop(),_.trys.pop();continue}F=w.call(y,_)}catch(N){F=[6,N],E=0}finally{C=T=0}if(F[0]&5)throw F[1];return{value:F[0]?F[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0});var c=s((L0(),Du(P0))),d=Oa(),f=Do(),p=Ro();e.default=(function(y){n(w,y);function w(_){var C=y.call(this)||this;return C.uri=_,C.connection=new c.default(_),C}return w.prototype.connect=function(){var _=this;return new Promise(function(C,E){var T=function(){_.connection.removeEventListener("open",T),C()};_.connection.addEventListener("open",T),_.connection.addEventListener("message",function(I){var $=I.data;_.transportRequestManager.resolveResponse($)})})},w.prototype.sendData=function(_,C){return C===void 0&&(C=5e3),i(this,void 0,void 0,function(){var E,T,I;return o(this,function($){E=this.transportRequestManager.addRequest(_,C),T=f.getNotifications(_);try{this.connection.send(JSON.stringify(this.parseData(_))),this.transportRequestManager.settlePendingRequest(T)}catch(V){I=new p.JSONRPCError(V.message,p.ERR_UNKNOWN,V),this.transportRequestManager.settlePendingRequest(T,I),this.transportRequestManager.settlePendingRequest(f.getBatchRequests(_),I),E=Promise.reject(I)}return[2,E]})})},w.prototype.close=function(){this.connection.close()},w})(d.Transport)})),I0=Ce((e=>{var n=e&&e.__extends||(function(){var f=function(p,y){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,_){w.__proto__=_}||function(w,_){for(var C in _)_.hasOwnProperty(C)&&(w[C]=_[C])},f(p,y)};return function(p,y){f(p,y);function w(){this.constructor=p}p.prototype=y===null?Object.create(y):(w.prototype=y.prototype,new w)}})(),i=e&&e.__awaiter||function(f,p,y,w){function _(C){return C instanceof y?C:new y(function(E){E(C)})}return new(y||(y=Promise))(function(C,E){function T(V){try{$(w.next(V))}catch(F){E(F)}}function I(V){try{$(w.throw(V))}catch(F){E(F)}}function $(V){V.done?C(V.value):_(V.value).then(T,I)}$((w=w.apply(f,p||[])).next())})},o=e&&e.__generator||function(f,p){var y={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},w,_,C,E;return E={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function T($){return function(V){return I([$,V])}}function I($){if(w)throw TypeError("Generator is already executing.");for(;y;)try{if(w=1,_&&(C=$[0]&2?_.return:$[0]?_.throw||((C=_.return)&&C.call(_),0):_.next)&&!(C=C.call(_,$[1])).done)return C;switch(_=0,C&&($=[$[0]&2,C.value]),$[0]){case 0:case 1:C=$;break;case 4:return y.label++,{value:$[1],done:!1};case 5:y.label++,_=$[1],$=[0];continue;case 7:$=y.ops.pop(),y.trys.pop();continue;default:if(C=y.trys,!(C=C.length>0&&C[C.length-1])&&($[0]===6||$[0]===2)){y=0;continue}if($[0]===3&&(!C||$[1]>C[0]&&$[1]<C[3])){y.label=$[1];break}if($[0]===6&&y.label<C[1]){y.label=C[1],C=$;break}if(C&&y.label<C[2]){y.label=C[2],y.ops.push($);break}C[2]&&y.ops.pop(),y.trys.pop();continue}$=p.call(f,y)}catch(V){$=[6,V],_=0}finally{w=C=0}if($[0]&5)throw $[1];return{value:$[0]?$[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=Oa(),c=Do(),d=function(f){var p=400,y=window.screen.height;return window.open(f,"inspector:popup","left=0,top=0,width="+p+",height="+y+",resizable,scrollbars=yes,status=1")};e.default=(function(f){n(p,f);function p(y){var w=f.call(this)||this;return w.messageHandler=function(_){w.transportRequestManager.resolveResponse(JSON.stringify(_.data))},w.uri=y,w.postMessageID="post-message-transport-"+Math.random(),w}return p.prototype.createWindow=function(y){return new Promise(function(w,_){var C=d(y);setTimeout(function(){w(C)},3e3)})},p.prototype.connect=function(){var y=this,w=/^(http|https):\/\/.*$/;return new Promise(function(_,C){return i(y,void 0,void 0,function(){var E;return o(this,function(T){switch(T.label){case 0:return w.test(this.uri)||C(Error("Bad URI")),E=this,[4,this.createWindow(this.uri)];case 1:return E.frame=T.sent(),window.addEventListener("message",this.messageHandler),_(),[2]}})})})},p.prototype.sendData=function(y,w){return w===void 0&&(w=5e3),i(this,void 0,void 0,function(){var _,C;return o(this,function(E){return _=this.transportRequestManager.addRequest(y,null),C=c.getNotifications(y),this.frame&&(this.frame.postMessage(y.request,this.uri),this.transportRequestManager.settlePendingRequest(C)),[2,_]})})},p.prototype.close=function(){this.frame&&(window.removeEventListener("message",this.messageHandler),this.frame.close())},p})(s.Transport)})),A0=Ce((e=>{var n=e&&e.__extends||(function(){var d=function(f,p){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,w){y.__proto__=w}||function(y,w){for(var _ in w)w.hasOwnProperty(_)&&(y[_]=w[_])},d(f,p)};return function(f,p){d(f,p);function y(){this.constructor=f}f.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}})(),i=e&&e.__awaiter||function(d,f,p,y){function w(_){return _ instanceof p?_:new p(function(C){C(_)})}return new(p||(p=Promise))(function(_,C){function E($){try{I(y.next($))}catch(V){C(V)}}function T($){try{I(y.throw($))}catch(V){C(V)}}function I($){$.done?_($.value):w($.value).then(E,T)}I((y=y.apply(d,f||[])).next())})},o=e&&e.__generator||function(d,f){var p={label:0,sent:function(){if(_[0]&1)throw _[1];return _[1]},trys:[],ops:[]},y,w,_,C;return C={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function E(I){return function($){return T([I,$])}}function T(I){if(y)throw TypeError("Generator is already executing.");for(;p;)try{if(y=1,w&&(_=I[0]&2?w.return:I[0]?w.throw||((_=w.return)&&_.call(w),0):w.next)&&!(_=_.call(w,I[1])).done)return _;switch(w=0,_&&(I=[I[0]&2,_.value]),I[0]){case 0:case 1:_=I;break;case 4:return p.label++,{value:I[1],done:!1};case 5:p.label++,w=I[1],I=[0];continue;case 7:I=p.ops.pop(),p.trys.pop();continue;default:if(_=p.trys,!(_=_.length>0&&_[_.length-1])&&(I[0]===6||I[0]===2)){p=0;continue}if(I[0]===3&&(!_||I[1]>_[0]&&I[1]<_[3])){p.label=I[1];break}if(I[0]===6&&p.label<_[1]){p.label=_[1],_=I;break}if(_&&p.label<_[2]){p.label=_[2],p.ops.push(I);break}_[2]&&p.ops.pop(),p.trys.pop();continue}I=f.call(d,p)}catch($){I=[6,$],w=0}finally{y=_=0}if(I[0]&5)throw I[1];return{value:I[0]?I[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=Oa(),c=Do();e.default=(function(d){n(f,d);function f(p){var y=d.call(this)||this;return y.messageHandler=function(w){y.transportRequestManager.resolveResponse(JSON.stringify(w.data))},y.uri=p,y.postMessageID="post-message-transport-"+Math.random(),y}return f.prototype.createWindow=function(p){var y=this;return new Promise(function(w,_){var C,E=document.createElement("iframe");E.setAttribute("id",y.postMessageID),E.setAttribute("width","0px"),E.setAttribute("height","0px"),E.setAttribute("style","visiblity:hidden;border:none;outline:none;"),E.addEventListener("load",function(){w(C)}),E.setAttribute("src",p),window.document.body.appendChild(E),C=E.contentWindow})},f.prototype.connect=function(){var p=this,y=/^(http|https):\/\/.*$/;return new Promise(function(w,_){return i(p,void 0,void 0,function(){var C;return o(this,function(E){switch(E.label){case 0:return y.test(this.uri)||_(Error("Bad URI")),C=this,[4,this.createWindow(this.uri)];case 1:return C.frame=E.sent(),window.addEventListener("message",this.messageHandler),w(),[2]}})})})},f.prototype.sendData=function(p,y){return y===void 0&&(y=5e3),i(this,void 0,void 0,function(){var w,_;return o(this,function(C){return w=this.transportRequestManager.addRequest(p,null),_=c.getNotifications(p),this.frame&&(this.frame.postMessage(p.request,"*"),this.transportRequestManager.settlePendingRequest(_)),[2,w]})})},f.prototype.close=function(){var p;(p=document.getElementById(this.postMessageID))==null||p.remove(),window.removeEventListener("message",this.messageHandler)},f})(s.Transport)})),q0=Ce((e=>{var n=e&&e.__awaiter||function(o,s,c,d){function f(p){return p instanceof c?p:new c(function(y){y(p)})}return new(c||(c=Promise))(function(p,y){function w(E){try{C(d.next(E))}catch(T){y(T)}}function _(E){try{C(d.throw(E))}catch(T){y(T)}}function C(E){E.done?p(E.value):f(E.value).then(w,_)}C((d=d.apply(o,s||[])).next())})},i=e&&e.__generator||function(o,s){var c={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},d,f,p,y;return y={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function w(C){return function(E){return _([C,E])}}function _(C){if(d)throw TypeError("Generator is already executing.");for(;c;)try{if(d=1,f&&(p=C[0]&2?f.return:C[0]?f.throw||((p=f.return)&&p.call(f),0):f.next)&&!(p=p.call(f,C[1])).done)return p;switch(f=0,p&&(C=[C[0]&2,p.value]),C[0]){case 0:case 1:p=C;break;case 4:return c.label++,{value:C[1],done:!1};case 5:c.label++,f=C[1],C=[0];continue;case 7:C=c.ops.pop(),c.trys.pop();continue;default:if(p=c.trys,!(p=p.length>0&&p[p.length-1])&&(C[0]===6||C[0]===2)){c=0;continue}if(C[0]===3&&(!p||C[1]>p[0]&&C[1]<p[3])){c.label=C[1];break}if(C[0]===6&&c.label<p[1]){c.label=p[1],p=C;break}if(p&&c.label<p[2]){c.label=p[2],c.ops.push(C);break}p[2]&&c.ops.pop(),c.trys.pop();continue}C=s.call(o,c)}catch(E){C=[6,E],f=0}finally{d=p=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 i(this,function(d){switch(d.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:d.sent(),d.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 i(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})()})),zl=Ce((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(y0()).default,e.EventEmitterTransport=n(b0()).default,e.HTTPTransport=n(O0()).default,e.WebSocketTransport=n(N0()).default,e.PostMessageWindowTransport=n(I0()).default,e.PostMessageIframeTransport=n(A0()).default;var i=Ro();Object.defineProperty(e,"JSONRPCError",{enumerable:!0,get:function(){return i.JSONRPCError}});var o=n(q0());e.Client=o.default,e.default=o.default})),Po=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function n(p){return p===!0||p===!1}e.boolean=n;function i(p){return typeof p=="string"||p instanceof String}e.string=i;function o(p){return typeof p=="number"||p instanceof Number}e.number=o;function s(p){return p instanceof Error}e.error=s;function c(p){return typeof p=="function"}e.func=c;function d(p){return Array.isArray(p)}e.array=d;function f(p){return d(p)&&p.every(y=>i(y))}e.stringArray=f})),Ld=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;var n=Po(),i;(function(d){d.ParseError=-32700,d.InvalidRequest=-32600,d.MethodNotFound=-32601,d.InvalidParams=-32602,d.InternalError=-32603,d.jsonrpcReservedErrorRangeStart=-32099,d.serverErrorStart=-32099,d.MessageWriteError=-32099,d.MessageReadError=-32098,d.PendingResponseRejected=-32097,d.ConnectionInactive=-32096,d.ServerNotInitialized=-32002,d.UnknownErrorCode=-32001,d.jsonrpcReservedErrorRangeEnd=-32e3,d.serverErrorEnd=-32e3})(i||(e.ErrorCodes=i={})),e.ResponseError=class gx extends Error{constructor(f,p,y){super(p),this.code=n.number(f)?f:i.UnknownErrorCode,this.data=y,Object.setPrototypeOf(this,gx.prototype)}toJson(){let f={code:this.code,message:this.message};return this.data!==void 0&&(f.data=this.data),f}};var o=class md{constructor(f){this.kind=f}static is(f){return f===md.auto||f===md.byName||f===md.byPosition}toString(){return this.kind}};e.ParameterStructures=o,o.auto=new o("auto"),o.byPosition=new o("byPosition"),o.byName=new o("byName");var s=class{constructor(d,f){this.method=d,this.numberOfParams=f}get parameterStructures(){return o.auto}};e.AbstractMessageSignature=s,e.RequestType0=class extends s{constructor(d){super(d,0)}},e.RequestType=class extends s{constructor(d,f=o.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends s{constructor(d,f=o.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends s{constructor(d){super(d,2)}},e.RequestType3=class extends s{constructor(d){super(d,3)}},e.RequestType4=class extends s{constructor(d){super(d,4)}},e.RequestType5=class extends s{constructor(d){super(d,5)}},e.RequestType6=class extends s{constructor(d){super(d,6)}},e.RequestType7=class extends s{constructor(d){super(d,7)}},e.RequestType8=class extends s{constructor(d){super(d,8)}},e.RequestType9=class extends s{constructor(d){super(d,9)}},e.NotificationType=class extends s{constructor(d,f=o.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends s{constructor(d){super(d,0)}},e.NotificationType1=class extends s{constructor(d,f=o.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends s{constructor(d){super(d,2)}},e.NotificationType3=class extends s{constructor(d){super(d,3)}},e.NotificationType4=class extends s{constructor(d){super(d,4)}},e.NotificationType5=class extends s{constructor(d){super(d,5)}},e.NotificationType6=class extends s{constructor(d){super(d,6)}},e.NotificationType7=class extends s{constructor(d){super(d,7)}},e.NotificationType8=class extends s{constructor(d){super(d,8)}},e.NotificationType9=class extends s{constructor(d){super(d,9)}};var c;(function(d){function f(w){let _=w;return _&&n.string(_.method)&&(n.string(_.id)||n.number(_.id))}d.isRequest=f;function p(w){let _=w;return _&&n.string(_.method)&&w.id===void 0}d.isNotification=p;function y(w){let _=w;return _&&(_.result!==void 0||!!_.error)&&(n.string(_.id)||n.number(_.id)||_.id===null)}d.isResponse=y})(c||(e.Message=c={}))})),Nd=Ce((e=>{var n;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var i;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.Last})(i||(e.Touch=i={}));var o=class{constructor(){this[n]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var s;return(s=this._head)==null?void 0:s.value}get last(){var s;return(s=this._tail)==null?void 0:s.value}has(s){return this._map.has(s)}get(s,c=i.None){let d=this._map.get(s);if(d)return c!==i.None&&this.touch(d,c),d.value}set(s,c,d=i.None){let f=this._map.get(s);if(f)f.value=c,d!==i.None&&this.touch(f,d);else{switch(f={key:s,value:c,next:void 0,previous:void 0},d){case i.None:this.addItemLast(f);break;case i.First:this.addItemFirst(f);break;case i.Last:this.addItemLast(f);break;default:this.addItemLast(f);break}this._map.set(s,f),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){let c=this._map.get(s);if(c)return this._map.delete(s),this.removeItem(c),this._size--,c.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error("Invalid list");let s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,c){let d=this._state,f=this._head;for(;f;){if(c?s.bind(c)(f.value,f.key,this):s(f.value,f.key,this),this._state!==d)throw Error("LinkedMap got modified during iteration.");f=f.next}}keys(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let f={value:c.key,done:!1};return c=c.next,f}else return{value:void 0,done:!0}}};return d}values(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let f={value:c.value,done:!1};return c=c.next,f}else return{value:void 0,done:!0}}};return d}entries(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let f={value:[c.key,c.value],done:!1};return c=c.next,f}else return{value:void 0,done:!0}}};return d}[(n=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let c=this._head,d=this.size;for(;c&&d>s;)this._map.delete(c.key),c=c.next,d--;this._head=c,this._size=d,c&&(c.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{let c=s.next,d=s.previous;if(!c||!d)throw Error("Invalid list");c.previous=d,d.next=c}s.next=void 0,s.previous=void 0,this._state++}touch(s,c){if(!this._head||!this._tail)throw Error("Invalid list");if(!(c!==i.First&&c!==i.Last)){if(c===i.First){if(s===this._head)return;let d=s.next,f=s.previous;s===this._tail?(f.next=void 0,this._tail=f):(d.previous=f,f.next=d),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(c===i.Last){if(s===this._tail)return;let d=s.next,f=s.previous;s===this._head?(d.previous=void 0,this._head=d):(d.previous=f,f.next=d),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){let s=[];return this.forEach((c,d)=>{s.push([d,c])}),s}fromJSON(s){this.clear();for(let[c,d]of s)this.set(c,d)}};e.LinkedMap=o,e.LRUCache=class extends o{constructor(s,c=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,c),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,c=i.AsNew){return super.get(s,c)}peek(s){return super.get(s,i.None)}set(s,c){return super.set(s,c,i.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}})),j0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var n;(function(i){function o(s){return{dispose:s}}i.create=o})(n||(e.Disposable=n={}))})),Ji=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n;function i(){if(n===void 0)throw Error("No runtime abstraction layer installed");return n}(function(o){function s(c){if(c===void 0)throw Error("No runtime abstraction layer provided");n=c}o.install=s})(i||(i={})),e.default=i})),Mo=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var n=Ji(),i;(function(c){let d={dispose(){}};c.None=function(){return d}})(i||(e.Event=i={}));var o=class{add(c,d=null,f){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(c),this._contexts.push(d),Array.isArray(f)&&f.push({dispose:()=>this.remove(c,d)})}remove(c,d=null){if(!this._callbacks)return;let f=!1;for(let p=0,y=this._callbacks.length;p<y;p++)if(this._callbacks[p]===c)if(this._contexts[p]===d){this._callbacks.splice(p,1),this._contexts.splice(p,1);return}else f=!0;if(f)throw Error("When adding a listener with a context, you should remove it with the same context")}invoke(...c){if(!this._callbacks)return[];let d=[],f=this._callbacks.slice(0),p=this._contexts.slice(0);for(let y=0,w=f.length;y<w;y++)try{d.push(f[y].apply(p[y],c))}catch(_){(0,n.default)().console.error(_)}return d}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},s=class yx{constructor(d){this._options=d}get event(){return this._event||(this._event=(d,f,p)=>{this._callbacks||(this._callbacks=new o),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(d,f);let y={dispose:()=>{this._callbacks&&(this._callbacks.remove(d,f),y.dispose=yx._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(p)&&p.push(y),y}),this._event}fire(d){this._callbacks&&this._callbacks.invoke.call(this._callbacks,d)}dispose(){this._callbacks&&(this._callbacks=(this._callbacks.dispose(),void 0))}};e.Emitter=s,s._noop=function(){}})),Zl=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var n=Ji(),i=Po(),o=Mo(),s;(function(f){f.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:o.Event.None}),f.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:o.Event.None});function p(y){let w=y;return w&&(w===f.None||w===f.Cancelled||i.boolean(w.isCancellationRequested)&&!!w.onCancellationRequested)}f.is=p})(s||(e.CancellationToken=s={}));var c=Object.freeze(function(f,p){let y=(0,n.default)().timer.setTimeout(f.bind(p),0);return{dispose(){y.dispose()}}}),d=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?c:(this._emitter||(this._emitter=new o.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter=(this._emitter.dispose(),void 0))}};e.CancellationTokenSource=class{get token(){return this._token||(this._token=new d),this._token}cancel(){this._token?this._token.cancel():this._token=s.Cancelled}dispose(){this._token?this._token instanceof d&&this._token.dispose():this._token=s.None}}})),z0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var n=Zl(),i;(function(c){c.Continue=0,c.Cancelled=1})(i||(i={})),e.SharedArraySenderStrategy=class{constructor(){this.buffers=new Map}enableCancellation(c){if(c.id===null)return;let d=new SharedArrayBuffer(4),f=new Int32Array(d,0,1);f[0]=i.Continue,this.buffers.set(c.id,d),c.$cancellationData=d}async sendCancellation(c,d){let f=this.buffers.get(d);if(f===void 0)return;let p=new Int32Array(f,0,1);Atomics.store(p,0,i.Cancelled)}cleanup(c){this.buffers.delete(c)}dispose(){this.buffers.clear()}};var o=class{constructor(c){this.data=new Int32Array(c,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===i.Cancelled}get onCancellationRequested(){throw Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},s=class{constructor(c){this.token=new o(c)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{constructor(){this.kind="request"}createCancellationTokenSource(c){let d=c.$cancellationData;return d===void 0?new n.CancellationTokenSource:new s(d)}}})),Id=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var n=Ji();e.Semaphore=class{constructor(i=1){if(i<=0)throw Error("Capacity must be greater than 0");this._capacity=i,this._active=0,this._waiting=[]}lock(i){return new Promise((o,s)=>{this._waiting.push({thunk:i,resolve:o,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,n.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let i=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error("To many thunks active");try{let o=i.thunk();o instanceof Promise?o.then(s=>{this._active--,i.resolve(s),this.runNext()},s=>{this._active--,i.reject(s),this.runNext()}):(this._active--,i.resolve(o),this.runNext())}catch(o){this._active--,i.reject(o),this.runNext()}}}})),F0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var n=Ji(),i=Po(),o=Mo(),s=Id(),c;(function(p){function y(w){let _=w;return _&&i.func(_.listen)&&i.func(_.dispose)&&i.func(_.onError)&&i.func(_.onClose)&&i.func(_.onPartialMessage)}p.is=y})(c||(e.MessageReader=c={}));var d=class{constructor(){this.errorEmitter=new o.Emitter,this.closeEmitter=new o.Emitter,this.partialMessageEmitter=new o.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(p){this.errorEmitter.fire(this.asError(p))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(p){this.partialMessageEmitter.fire(p)}asError(p){return p instanceof Error?p:Error(`Reader received error. Reason: ${i.string(p.message)?p.message:"unknown"}`)}};e.AbstractMessageReader=d;var f;(function(p){function y(w){let _,C,E=new Map,T,I=new Map;if(w===void 0||typeof w=="string")_=w??"utf-8";else{if(_=w.charset??"utf-8",w.contentDecoder!==void 0&&(C=w.contentDecoder,E.set(C.name,C)),w.contentDecoders!==void 0)for(let $ of w.contentDecoders)E.set($.name,$);if(w.contentTypeDecoder!==void 0&&(T=w.contentTypeDecoder,I.set(T.name,T)),w.contentTypeDecoders!==void 0)for(let $ of w.contentTypeDecoders)I.set($.name,$)}return T===void 0&&(T=(0,n.default)().applicationJson.decoder,I.set(T.name,T)),{charset:_,contentDecoder:C,contentDecoders:E,contentTypeDecoder:T,contentTypeDecoders:I}}p.fromOptions=y})(f||(f={})),e.ReadableStreamMessageReader=class extends d{constructor(p,y){super(),this.readable=p,this.options=f.fromOptions(y),this.buffer=(0,n.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new s.Semaphore(1)}set partialMessageTimeout(p){this._partialMessageTimeout=p}get partialMessageTimeout(){return this._partialMessageTimeout}listen(p){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=p;let y=this.readable.onData(w=>{this.onData(w)});return this.readable.onError(w=>this.fireError(w)),this.readable.onClose(()=>this.fireClose()),y}onData(p){try{for(this.buffer.append(p);;){if(this.nextMessageLength===-1){let w=this.buffer.tryReadHeaders(!0);if(!w)return;let _=w.get("content-length");if(!_){this.fireError(Error(`Header must provide a Content-Length property.
17
- ${JSON.stringify(Object.fromEntries(w))}`));return}let C=parseInt(_);if(isNaN(C)){this.fireError(Error(`Content-Length value must be a number. Got ${_}`));return}this.nextMessageLength=C}let y=this.buffer.tryReadBody(this.nextMessageLength);if(y===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let w=this.options.contentDecoder===void 0?y:await this.options.contentDecoder.decode(y),_=await this.options.contentTypeDecoder.decode(w,this.options);this.callback(_)}).catch(w=>{this.fireError(w)})}}catch(y){this.fireError(y)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer=(this.partialMessageTimer.dispose(),void 0))}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,n.default)().timer.setTimeout((p,y)=>{this.partialMessageTimer=void 0,p===this.messageToken&&(this.firePartialMessage({messageToken:p,waitingTime:y}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}})),B0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var n=Ji(),i=Po(),o=Id(),s=Mo(),c="Content-Length: ",d=`\r
18
- `,f;(function(w){function _(C){let E=C;return E&&i.func(E.dispose)&&i.func(E.onClose)&&i.func(E.onError)&&i.func(E.write)}w.is=_})(f||(e.MessageWriter=f={}));var p=class{constructor(){this.errorEmitter=new s.Emitter,this.closeEmitter=new s.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(w,_,C){this.errorEmitter.fire([this.asError(w),_,C])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(w){return w instanceof Error?w:Error(`Writer received error. Reason: ${i.string(w.message)?w.message:"unknown"}`)}};e.AbstractMessageWriter=p;var y;(function(w){function _(C){return C===void 0||typeof C=="string"?{charset:C??"utf-8",contentTypeEncoder:(0,n.default)().applicationJson.encoder}:{charset:C.charset??"utf-8",contentEncoder:C.contentEncoder,contentTypeEncoder:C.contentTypeEncoder??(0,n.default)().applicationJson.encoder}}w.fromOptions=_})(y||(y={})),e.WriteableStreamMessageWriter=class extends p{constructor(w,_){super(),this.writable=w,this.options=y.fromOptions(_),this.errorCount=0,this.writeSemaphore=new o.Semaphore(1),this.writable.onError(C=>this.fireError(C)),this.writable.onClose(()=>this.fireClose())}async write(w){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(w,this.options).then(_=>this.options.contentEncoder===void 0?_:this.options.contentEncoder.encode(_)).then(_=>{let C=[];return C.push(c,_.byteLength.toString(),d),C.push(d),this.doWrite(w,C,_)},_=>{throw this.fireError(_),_}))}async doWrite(w,_,C){try{return await this.writable.write(_.join(""),"ascii"),this.writable.write(C)}catch(E){return this.handleError(E,w),Promise.reject(E)}}handleError(w,_){this.errorCount++,this.fireError(w,_,this.errorCount)}end(){this.writable.end()}}})),H0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0;var n=13,i=10,o=`\r
14
+ `," ").replaceAll("\r","")}function yd(e){return typeof e=="object"&&e&&"$bigint"in e&&typeof e.$bigint=="string"?BigInt(e.$bigint):e}var Vm="abcdefghijklmnopqrstuvwxyz",$m=Vm+Vm.toUpperCase(),Wm=new Set;Rs="__scratch__",yr="setup",La={create(){let e=0,n;do{let i="";for(let o=0;o<4;o++)i+=$m[Math.floor(Math.random()*$m.length)];n=i,e++}while(Wm.has(n)&&e<100);if(e>=100)throw Error("Failed to generate unique CellId after 100 attempts");return Wm.add(n),n}},er={create(e){return In(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 i=er.findElement(n);if(i)return i;let o=n.getRootNode();if(n=o instanceof ShadowRoot?o.host:n.parentElement,n===o)break}return null}},q_=function(e){let n=null,i=er.findElementThroughShadowDOMs(e);return i&&(n=er.parse(i.id)),n},Yu={parse(e){return e.getAttribute("object-id")},parseOrThrow(e){let n=Yu.parse(e);return In(n,"<marimo-ui-element/> missing object-id attribute"),n}},O_={create(e){return`output-${e}`}},km=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 i=new URL(window.location.href);i.searchParams.set(e,n),window.history.replaceState({},"",i.toString())}getSearchParam(e){return new URL(window.location.href).searchParams.get(e)}},qu=function(e){return Pm(e??"")},x_=function(e){return ui.mapValues(e.dataset,n=>typeof n=="string"?qu(n):n)},nx=function(e,n){let i=e.parentElement?Yu.parse(e.parentElement):void 0;return i&&n.has(i)?n.lookupValue(i):qu(e.dataset.initialValue)},zl=function(){if(w4())return document.title||null;if(wh()){let i=km.getFilename();if(i)return i}let e=document.querySelector("marimo-filename");Em(e,"marimo-filename tag not found");let n=e.innerHTML;return n.length===0?null:n};var Ox=Symbol("");u_=function(e,n){return ze(e,function(i,o,s){o(this,n(i(this),s))})};function vd(e,n){let i=null,o=new Map,s=new Set,c=f=>{let p;if(n===void 0)p=o.get(f);else for(let[w,_]of o)if(n(w,f)){p=_;break}if(p!==void 0)if(i!=null&&i(p[1],f))c.remove(f);else return p[0];let y=e(f);return o.set(f,[y,Date.now()]),d("CREATE",f,y),y},d=(f,p,y)=>{for(let w of s)w({type:f,param:p,atom:y})};return c.unstable_listen=f=>(s.add(f),()=>{s.delete(f)}),c.getParams=()=>o.keys(),c.remove=f=>{if(n===void 0){if(!o.has(f))return;let[p]=o.get(f);o.delete(f),d("REMOVE",f,p)}else for(let[p,[y]]of o)if(n(p,f)){o.delete(p),d("REMOVE",p,y);break}},c.setShouldRemove=f=>{if(i=f,i)for(let[p,[y,w]]of o)i(w,p)&&(o.delete(p),d("REMOVE",p,y))},c}var bd=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),Px=new WeakMap,Mx=(e,n,i,o)=>bd(e,bd(()=>new WeakMap,bd(()=>new WeakMap,Px,n),i),o);function Lx(e,n,i=Object.is){return Mx(()=>{let o=Symbol(),s=([d,f])=>{if(f===o)return n(d);let p=n(d,f);return i(f,p)?f:p},c=ze(d=>{let f=d(c);return s([d(e),f])});return c.init=o,c},e,n,i)}var Um=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),Nx=new WeakMap,Ix=(e,n,i)=>Um(e,Um(()=>new WeakMap,Nx,n),i),Ax={},Km=e=>!!e.write,qx=e=>typeof e=="function";function jx(e,n){return Ix(()=>{let i=new WeakMap,o=(d,f)=>{let p=i.get(d);if(p)return p;let y=f&&i.get(f),w=[],_=[];return d.forEach((C,E)=>{let T=n?n(C):E;_[E]=T;let I=y&&y.atomList[y.keyList.indexOf(T)];if(I){w[E]=I;return}let $=V=>{let F=V(s),N=V(e),K=o(N,F==null?void 0:F.arr).keyList.indexOf(T);if(K<0||K>=N.length){let pe=d[o(d).keyList.indexOf(T)];if(pe)return pe;throw Error("splitAtom: index out of bounds for read")}return N[K]};w[E]=Km(e)?ze($,(V,F,N)=>{let K=V(s),pe=V(e),P=o(pe,K==null?void 0:K.arr).keyList.indexOf(T);if(P<0||P>=pe.length)throw Error("splitAtom: index out of bounds for write");let A=qx(N)?N(pe[P]):N;Object.is(pe[P],A)||F(e,[...pe.slice(0,P),A,...pe.slice(P+1)])}):ze($)}),p=y&&y.keyList.length===_.length&&y.keyList.every((C,E)=>C===_[E])?y:{arr:d,atomList:w,keyList:_},i.set(d,p),p},s=ze(d=>{let f=d(s);return o(d(e),f==null?void 0:f.arr)});s.init=void 0;let c=Km(e)?ze(d=>d(s).atomList,(d,f,p)=>{switch(p.type){case"remove":{let y=d(c).indexOf(p.atom);if(y>=0){let w=d(e);f(e,[...w.slice(0,y),...w.slice(y+1)])}break}case"insert":{let y=p.before?d(c).indexOf(p.before):d(c).length;if(y>=0){let w=d(e);f(e,[...w.slice(0,y),p.value,...w.slice(y)])}break}case"move":{let y=d(c).indexOf(p.atom),w=p.before?d(c).indexOf(p.before):d(c).length;if(y>=0&&w>=0){let _=d(e);y<w?f(e,[..._.slice(0,y),..._.slice(y+1,w),_[y],..._.slice(w)]):f(e,[..._.slice(0,w),_[y],..._.slice(w,y),..._.slice(y+1)])}break}}}):ze(d=>d(s).atomList);return c},e,n||Ax)}var Qm=e=>typeof(e==null?void 0:e.then)=="function";function Gm(e=()=>{try{return window.localStorage}catch{return}},n){var f;let i,o,s={getItem:(p,y)=>{var C;let w=E=>{if(E||(E=""),i!==E){try{o=JSON.parse(E,n==null?void 0:n.reviver)}catch{return y}i=E}return o},_=((C=e())==null?void 0:C.getItem(p))??null;return Qm(_)?_.then(w):w(_)},setItem:(p,y)=>{var w;return(w=e())==null?void 0:w.setItem(p,JSON.stringify(y,n==null?void 0:n.replacer))},removeItem:p=>{var y;return(y=e())==null?void 0:y.removeItem(p)}},c=p=>(y,w,_)=>p(y,C=>{let E;try{E=JSON.parse(C||"")}catch{E=_}w(E)}),d;try{d=(f=e())==null?void 0:f.subscribe}catch{}return!d&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(d=(p,y)=>{if(!(e()instanceof window.Storage))return()=>{};let w=_=>{_.storageArea===e()&&_.key===p&&y(_.newValue)};return window.addEventListener("storage",w),()=>{window.removeEventListener("storage",w)}}),d&&(s.subscribe=c(d)),s}var zx=Gm();Vl=function(e,n,i=zx,o){let s=ze(o!=null&&o.getOnInit?i.getItem(e,n):n);return s.onMount=c=>{c(i.getItem(e,n));let d;return i.subscribe&&(d=i.subscribe(e,c,n)),d},ze(c=>c(s),(c,d,f)=>{let p=typeof f=="function"?f(c(s)):f;return p===Ox?(d(s,n),i.removeItem(e)):Qm(p)?p.then(y=>(d(s,y),i.setItem(e,y))):(d(s,p),i.setItem(e,p))})},Wn=function(e){let n,i,o;return typeof e=="object"?(n=e.hashFunction,i=e.expiring,o=e.tags):n=e,(s,c,d)=>{if(d.value!=null)d.value=Jm(d.value,n,i,o);else if(d.get!=null)d.get=Jm(d.get,n,i,o);else throw"Only put a Memoize() decorator on a method or get accessor."}};var wd=new Map;function Jm(e,n,i=0,o){let s=Symbol("__memoized_map__");return function(...c){let d;this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let f=this[s];if(Array.isArray(o))for(let p of o)wd.has(p)?wd.get(p).push(f):wd.set(p,[f]);if(n||c.length>0||i>0){let p;p=n===!0?c.map(_=>_.toString()).join("!"):n?n.apply(this,c):c[0];let y=`${p}__timestamp`,w=!1;if(i>0)if(!f.has(y))w=!0;else{let _=f.get(y);w=Date.now()-_>i}f.has(p)&&!w?d=f.get(p):(d=e.apply(this,c),f.set(p,d),i>0&&f.set(y,Date.now()))}else{let p=this;f.has(p)?d=f.get(p):(d=e.apply(this,c),f.set(p,d))}return d}}Es=ze(zl()),J_=ze(void 0);var Fx=class{constructor(){ke(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 Bx(){let{hasLocalStorage:e,hasSessionStorage:n}=aD();return e?window.localStorage:n?window.sessionStorage:new Fx}Ts=Bx();let Qi;s_=class{constructor(e,n=Ts){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)}},Bu=class{constructor(e,n,i=Ts){this.schema=e,this.getDefaultValue=n,this.storage=i}get(e){try{let n=this.storage.getItem(e);if(n==null)return this.getDefaultValue();let i=this.schema.safeParse(JSON.parse(n));return i.success?i.data:(Se.warn("Error parsing zod local storage",i.error),this.getDefaultValue())}catch(n){return Se.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)}},im=class extends Bu{constructor(e,n,i){let o=lt.get(Es);super(n,i),this.filename=o;try{this.unsubscribeFromFilename=lt.sub(Es,()=>{let s=lt.get(Es);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 i=this.get(e);this.remove(e),this.filename=n,this.set(e,i)}}dispose(){this.unsubscribeFromFilename&&(this.unsubscribeFromFilename=(this.unsubscribeFromFilename(),null))}},Qi="marimo:notebook-col-sizes";function Hx(){return{widths:[]}}var Eo=new im(Qi,Z2({widths:o4(r4([i4(),a4("contentWidth")]).default("contentWidth"))}),Hx);$w={getColumnWidth:e=>Eo.get(Qi).widths[e]??"contentWidth",saveColumnWidth:(e,n)=>{let i=Eo.get(Qi).widths;if(i[e])i[e]=n;else{for(;i.length<=e;)i.push("contentWidth");i[e]=n}Eo.set(Qi,{widths:i})},clearStorage:()=>{Eo.remove(Qi)}};function Vx(e,n){let i=Eo.get(Qi).widths,o=Pl(i,e,n);Eo.set(Qi,{widths:o})}var Xm,Ym,Zm,Nr,e0,t0,n0,r0,Un,i0,a0,o0,s0,l0,c0,en;function tr(e,n,i,o,s){var c={};return Object.keys(o).forEach(function(d){c[d]=o[d]}),c.enumerable=!!c.enumerable,c.configurable=!!c.configurable,("value"in c||c.initializer)&&(c.writable=!0),c=i.slice().reverse().reduce(function(d,f){return f(e,n,d)||d},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 Ia=(Xm=Wn(),Ym=Wn(),Zm=Wn(),Nr=class{constructor(e,n,i){this.value=e,this.isCollapsed=n,this.children=i}geDescendantCount(){let e=0,n=[...this.children];for(;n.length>0;){let i=n.pop();e++;for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}return e}getDescendants(){let e=[],n=[...this.children];for(;n.length>0;){let i=n.pop();e.push(i.value);for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}return e}get inOrderIds(){let e=[],n=i=>{e.push(i.value);for(let o of i.children)n(o)};for(let i of this.children)n(i);return e}toString(){return this.isCollapsed?`${this.value} (collapsed)`:String(this.value)}equals(e){return this.value===e.value}},tr(Nr.prototype,"geDescendantCount",[Xm],Object.getOwnPropertyDescriptor(Nr.prototype,"geDescendantCount"),Nr.prototype),tr(Nr.prototype,"getDescendants",[Ym],Object.getOwnPropertyDescriptor(Nr.prototype,"getDescendants"),Nr.prototype),tr(Nr.prototype,"inOrderIds",[Zm],Object.getOwnPropertyDescriptor(Nr.prototype,"inOrderIds"),Nr.prototype),Nr);var $x=0;let To;To=(e0=Wn(),t0=Wn(),n0=Wn(),r0=Wn(),Un=class Co{constructor(n,i){this.nodes=n,this.id=i}static from(n){let i=`tree_${$x++}`;return new Co(n.map(o=>new Ia(o,!1,[])),i)}static fromWithPreviousShape(n,i){var c;if(!i)return Co.from(n);let o=i.id,s=new Co(n.map(d=>new Ia(d,!1,[])),o);for(let d of n)if(i.isCollapsed(d)){let f=((c=i._nodeMap.get(d))==null?void 0:c.children)??[];for(let p=f.length-1;p>=0;p--){let y=f[p];if(s._nodeMap.has(y.value)){s=s.collapse(d,y.value);break}}}return s}withNodes(n){return new Co(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 i of this.nodes)n.set(i.value,i);return n}getDescendants(n){let i=this._nodeMap.get(n);return i?i.getDescendants():(Se.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),[])}isCollapsed(n){let i=this._nodeMap.get(n);return i?i.isCollapsed:(Se.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),!1)}indexOfOrThrow(n){let i=this.nodes.findIndex(o=>o.value===n);if(i===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);return i}slice(n,i){return this.nodes.slice(n,i).map(o=>o.value)}moveToFront(n){let i=this.indexOfOrThrow(n);return this.withNodes(Pl(this.nodes,i,0))}moveToBack(n){let i=this.indexOfOrThrow(n);return this.withNodes(Pl(this.nodes,i,this.nodes.length-1))}collapse(n,i){let o=this.nodes.findIndex(p=>p.value===n);if(o===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let s=i===void 0?this.nodes.length:this.nodes.findIndex(p=>p.value===i);if(s===-1)throw Error(`Node ${i} not found in tree`);if(s<o)throw Error(`Node ${i} is before node ${n}`);let c=[...this.nodes],d=c[o];if(d.isCollapsed)throw Error(`Node ${n} is already collapsed`);let f=c.splice(o+1,s-o);return c[o]=new Ia(d.value,!0,f),this.withNodes(c)}collapseAll(n){let i=[...this.nodes];if(n.length===0)throw Error("No collapse ranges provided");if(n.length!==i.length)throw Error(`Collapse ranges length ${n.length} does not match tree length ${i.length}`);let o=i.length-1;for(;o>=0;){let s=i[o],c=n[o];if(!s.isCollapsed&&c){let{id:d,until:f}=c;if(d!==s.value)throw Error(`Node ${s.value} does not match collapse range id ${d}`);let p=f===void 0?i.length:i.findIndex(w=>w.value===f);if(p===-1)throw Error(`Node ${f} not found in tree`);if(p<o)throw Error(`Node ${f} is before node ${d}`);let y=i.splice(o+1,p-o);i[o]=new Ia(s.value,!0,y),o--}else o--}return this.withNodes(i)}expand(n){let i=this.nodes.findIndex(c=>c.value===n);if(i===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let o=[...this.nodes],s=o[i];if(!s.isCollapsed)throw Error(`Node ${n} is already expanded`);return o[i]=new Ia(s.value,!1,[]),o=ww(o,i+1,s.children),this.withNodes(o)}expandAll(){let n=[...this.nodes],i=0;for(;i<n.length;){let o=n[i];o.isCollapsed&&(n[i]=new Ia(o.value,!1,[]),n=ww(n,i+1,o.children)),i++}return this.withNodes(n)}move(n,i){return this.withNodes(Pl(this.nodes,n,i))}at(n){var i;return(i=this.nodes.at(n))==null?void 0:i.value}atOrThrow(n){let i=this.nodes.at(n);if(i===void 0)throw Error(`Node at index ${n} not found in tree`);return i.value}first(){return this.atOrThrow(0)}last(){return this.atOrThrow(this.nodes.length-1)}after(n){let i=this.indexOfOrThrow(n);if(i!==this.nodes.length-1)return this.at(i+1)}before(n){let i=this.indexOfOrThrow(n);if(i!==0)return this.at(i-1)}insert(n,i){return this.withNodes(bw(this.nodes,i,new Ia(n,!1,[])))}insertAtEnd(n){return this.insert(n,this.nodes.length)}insertAtStart(n){return this.insert(n,0)}deleteAtIndex(n){let i=this.atOrThrow(n),o=this.withNodes(this.nodes);try{o=o.expand(i)}catch{}return this.withNodes(iD(o.nodes,n))}delete(n){let i=this.indexOfOrThrow(n);return this.deleteAtIndex(i)}getCount(n){var i;return((i=this._nodeMap.get(n))==null?void 0:i.geDescendantCount())??0}findAndExpandDeep(n){let i=this.find(n);if(i.length===0)return this;let o=this.withNodes(this.nodes);for(let s of i)try{o=o.expand(s)}catch{}return o}find(n){function i(o,s){for(let c of o){if(c.value===n)return[...s,n];let d=i(c.children,[...s,c.value]);if(d.length>0)return d}return[]}return i(this.nodes,[])}split(n){let i=this.nodes.findIndex(c=>c.value===n);if(i===-1)throw Error(`Node ${n} not found in tree`);let o=this.nodes.slice(0,i),s=this.nodes.slice(i);return o.length===0?[Co.from([]),this.withNodes(s)]:[this.withNodes(o),Co.from([]).withNodes(s)]}equals(n){return this.nodes.length===n.nodes.length&&this.nodes.every((i,o)=>i.value===n.nodes[o].value)}toString(){let n=0,i="",o=s=>{for(let c of s)i+=`${" ".repeat(n*2)}${c.toString()}
15
+ `,n+=1,o(c.children),--n};return o(this.nodes),i}},tr(Un.prototype,"topLevelIds",[e0],Object.getOwnPropertyDescriptor(Un.prototype,"topLevelIds"),Un.prototype),tr(Un.prototype,"inOrderIds",[t0],Object.getOwnPropertyDescriptor(Un.prototype,"inOrderIds"),Un.prototype),tr(Un.prototype,"idSet",[n0],Object.getOwnPropertyDescriptor(Un.prototype,"idSet"),Un.prototype),tr(Un.prototype,"_nodeMap",[r0],Object.getOwnPropertyDescriptor(Un.prototype,"_nodeMap"),Un.prototype),Un),Hl=(i0=Wn(),a0=Wn(),o0=Wn(),s0=Wn(),l0=Wn(),c0=Wn(),en=class An{constructor(n){this.columns=n,n.length===0&&(this.columns=[To.from([])])}static from(n){return new An(n.map(i=>To.from(i)))}static fromWithPreviousShape(n,i){if(!i)return An.from([n]);let o=i.getColumns(),s=Array.from({length:o.length},()=>[]),c=0;for(let d of n){let f=o.findIndex(p=>p.idSet.has(d));f===-1?s[c].push(d):(c=f,s[f].push(d))}return new An(s.map((d,f)=>To.fromWithPreviousShape(d,o[f])))}isEmpty(){return this.columns.length===0?!0:this.columns.every(n=>n.nodes.length===0)}static fromIdsAndColumns(n){let i=Math.max(1,...n.map(([,c])=>(c??0)+1)),o=Array.from({length:i},()=>[]),s=0;for(let[c,d]of n)d==null||d<0?o[s].push(c):(o[d].push(c),s=d);return An.from(o)}get topLevelIds(){return this.columns.map(n=>n.topLevelIds)}get iterateTopLevelIds(){let n=this.columns;function*i(){for(let o of n)for(let s of o.topLevelIds)yield s}return i()}get inOrderIds(){return this.columns.flatMap(n=>n.inOrderIds)}get colLength(){return this.columns.length}get idLength(){return this.columns.reduce((n,i)=>n+i.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 i=this.columns[n];if(!i)throw Error(`Column ${n} not found`);return i}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,i=[]){return new An(this.columns.flatMap(o=>o.id===n?[o,To.from(i)]:[o]))}insertBreakpoint(n){let i=this.findWithId(n),[o,s]=i.split(n);return new An(this.columns.flatMap(c=>c===i?[o,s].filter(Boolean):[c]))}delete(n){if(this.columns.length<=1)return this;let i=this.indexOfOrThrow(n),o=i===0?1:i-1,s=[...this.columns],c=s[i];return s[o]=c.withNodes([...s[o].nodes,...c.nodes]),s.splice(i,1),new An(s)}mergeAllColumns(){if(this.columns.length<=1)return this;let n=this.columns.flatMap(o=>o.nodes),i=this.columns[0];return new An([i.withNodes(n)])}moveWithinColumn(n,i,o){return this.transform(n,s=>s.move(i,o))}moveAcrossColumns(n,i,o,s){let c=this.indexOfOrThrow(n),d=this.indexOfOrThrow(o),f=[...this.columns],p=f[c],y=p.nodes.findIndex(C=>C.value===i);if(y===-1)throw Error(`Node ${i} not found in column ${n}`);let w=p.nodes[y];f[c]=p.withNodes(p.nodes.filter((C,E)=>E!==y));let _=f[d];if(s){let C=_.indexOfOrThrow(s);f[d]=_.withNodes(bw(_.nodes,C,w))}else f[d]=_.withNodes([w,..._.nodes]);return new An(f)}indexOfOrThrow(n){let i=this.columns.findIndex(o=>o.id===n);if(i===-1)throw Error(`Column ${n} not found. Possible values: ${this.getColumnIds().join(", ")}`);return i}moveColumn(n,i){if(n===i)return this;let o=this.indexOfOrThrow(n),s=i==="_left_"?o-1:i==="_right_"?o+1:this.indexOfOrThrow(i);return Vx(o,s),new An(Pl([...this.columns],o,s))}moveToNewColumn(n){let i=this.findWithId(n),o=this.columns.map(c=>c.id===i.id?c.delete(n):c),s=To.from([n]);return new An([...o,s])}findWithId(n){let i=this.columns.find(o=>o.inOrderIds.includes(n));if(!i)throw Se.log(`Possible values: ${this.columns.map(o=>o.inOrderIds).join(", ")}`),Error(`Cell ${n} not found in any column`);return i}transformWithCellId(n,i){let o=!1,s=this.columns.map(c=>{if(c.inOrderIds.includes(n)){let d=i(c);return c!==d&&(o=!0),d}return c});return o?new An(s):this}setupCellExists(){return this.columns.some(n=>n.topLevelIds.includes(yr))}insertId(n,i,o){return this.transform(i,s=>s.insert(n,o))}deleteById(n){return this.transformWithCellId(n,i=>i.delete(n))}compact(){return this.columns.length===1||!this.columns.some(n=>n.nodes.length===0)?this:new An(this.columns.filter(n=>n.nodes.length>0))}transform(n,i){let o=this._columnMap.get(n);if(!o)return Se.warn(`Column ${n} not found`),this;let s=i(o);return o===s?this:new An(this.columns.map(c=>c.id===n?s:c))}transformAll(n){let i=!1,o=this.columns.map(s=>{let c=n(s);return s.equals(c)||(i=!0),c});return i?new An(o):this}},tr(en.prototype,"isEmpty",[i0],Object.getOwnPropertyDescriptor(en.prototype,"isEmpty"),en.prototype),tr(en.prototype,"topLevelIds",[a0],Object.getOwnPropertyDescriptor(en.prototype,"topLevelIds"),en.prototype),tr(en.prototype,"inOrderIds",[o0],Object.getOwnPropertyDescriptor(en.prototype,"inOrderIds"),en.prototype),tr(en.prototype,"idLength",[s0],Object.getOwnPropertyDescriptor(en.prototype,"idLength"),en.prototype),tr(en.prototype,"_columnMap",[l0],Object.getOwnPropertyDescriptor(en.prototype,"_columnMap"),en.prototype),tr(en.prototype,"getColumnIds",[c0],Object.getOwnPropertyDescriptor(en.prototype,"getColumnIds"),en.prototype),en);let _d,xd,kd,u0,Sd,d0,f0,p0,h0,Cd,Ed,m0,Td,Rd;_d=Ee((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 i(o){return o.type===n.Tag||o.type===n.Script||o.type===n.Style}e.isTag=i,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})),xd=Ee((e=>{var n=e&&e.__extends||(function(){var P=function(A,W){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(de,fe){de.__proto__=fe}||function(de,fe){for(var we in fe)Object.prototype.hasOwnProperty.call(fe,we)&&(de[we]=fe[we])},P(A,W)};return function(A,W){if(typeof W!="function"&&W!==null)throw TypeError("Class extends value "+String(W)+" is not a constructor or null");P(A,W);function de(){this.constructor=A}A.prototype=W===null?Object.create(W):(de.prototype=W.prototype,new de)}})(),i=e&&e.__assign||function(){return i=Object.assign||function(P){for(var A,W=1,de=arguments.length;W<de;W++)for(var fe in A=arguments[W],A)Object.prototype.hasOwnProperty.call(A,fe)&&(P[fe]=A[fe]);return P},i.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=_d(),s=(function(){function P(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(P.prototype,"parentNode",{get:function(){return this.parent},set:function(A){this.parent=A},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"previousSibling",{get:function(){return this.prev},set:function(A){this.prev=A},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"nextSibling",{get:function(){return this.next},set:function(A){this.next=A},enumerable:!1,configurable:!0}),P.prototype.cloneNode=function(A){return A===void 0&&(A=!1),K(this,A)},P})();e.Node=s;var c=(function(P){n(A,P);function A(W){var de=P.call(this)||this;return de.data=W,de}return Object.defineProperty(A.prototype,"nodeValue",{get:function(){return this.data},set:function(W){this.data=W},enumerable:!1,configurable:!0}),A})(s);e.DataNode=c;var d=(function(P){n(A,P);function A(){var W=P!==null&&P.apply(this,arguments)||this;return W.type=o.ElementType.Text,W}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),A})(c);e.Text=d;var f=(function(P){n(A,P);function A(){var W=P!==null&&P.apply(this,arguments)||this;return W.type=o.ElementType.Comment,W}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),A})(c);e.Comment=f;var p=(function(P){n(A,P);function A(W,de){var fe=P.call(this,de)||this;return fe.name=W,fe.type=o.ElementType.Directive,fe}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),A})(c);e.ProcessingInstruction=p;var y=(function(P){n(A,P);function A(W){var de=P.call(this)||this;return de.children=W,de}return Object.defineProperty(A.prototype,"firstChild",{get:function(){return this.children[0]??null},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"childNodes",{get:function(){return this.children},set:function(W){this.children=W},enumerable:!1,configurable:!0}),A})(s);e.NodeWithChildren=y;var w=(function(P){n(A,P);function A(){var W=P!==null&&P.apply(this,arguments)||this;return W.type=o.ElementType.CDATA,W}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),A})(y);e.CDATA=w;var _=(function(P){n(A,P);function A(){var W=P!==null&&P.apply(this,arguments)||this;return W.type=o.ElementType.Root,W}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),A})(y);e.Document=_;var C=(function(P){n(A,P);function A(W,de,fe,we){fe===void 0&&(fe=[]),we===void 0&&(we=W==="script"?o.ElementType.Script:W==="style"?o.ElementType.Style:o.ElementType.Tag);var J=P.call(this,fe)||this;return J.name=W,J.attribs=de,J.type=we,J}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"tagName",{get:function(){return this.name},set:function(W){this.name=W},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"attributes",{get:function(){var W=this;return Object.keys(this.attribs).map(function(de){var fe,we;return{name:de,value:W.attribs[de],namespace:(fe=W["x-attribsNamespace"])==null?void 0:fe[de],prefix:(we=W["x-attribsPrefix"])==null?void 0:we[de]}})},enumerable:!1,configurable:!0}),A})(y);e.Element=C;function E(P){return(0,o.isTag)(P)}e.isTag=E;function T(P){return P.type===o.ElementType.CDATA}e.isCDATA=T;function I(P){return P.type===o.ElementType.Text}e.isText=I;function $(P){return P.type===o.ElementType.Comment}e.isComment=$;function V(P){return P.type===o.ElementType.Directive}e.isDirective=V;function F(P){return P.type===o.ElementType.Root}e.isDocument=F;function N(P){return Object.prototype.hasOwnProperty.call(P,"children")}e.hasChildren=N;function K(P,A){A===void 0&&(A=!1);var W;if(I(P))W=new d(P.data);else if($(P))W=new f(P.data);else if(E(P)){var de=A?pe(P.children):[],fe=new C(P.name,i({},P.attribs),de);de.forEach(function(Ce){return Ce.parent=fe}),P.namespace!=null&&(fe.namespace=P.namespace),P["x-attribsNamespace"]&&(fe["x-attribsNamespace"]=i({},P["x-attribsNamespace"])),P["x-attribsPrefix"]&&(fe["x-attribsPrefix"]=i({},P["x-attribsPrefix"])),W=fe}else if(T(P)){var de=A?pe(P.children):[],we=new w(de);de.forEach(function(Z){return Z.parent=we}),W=we}else if(F(P)){var de=A?pe(P.children):[],J=new _(de);de.forEach(function(Z){return Z.parent=J}),P["x-mode"]&&(J["x-mode"]=P["x-mode"]),W=J}else if(V(P)){var be=new p(P.name,P.data);P["x-name"]!=null&&(be["x-name"]=P["x-name"],be["x-publicId"]=P["x-publicId"],be["x-systemId"]=P["x-systemId"]),W=be}else throw Error(`Not implemented yet: ${P.type}`);return W.startIndex=P.startIndex,W.endIndex=P.endIndex,P.sourceCodeLocation!=null&&(W.sourceCodeLocation=P.sourceCodeLocation),W}e.cloneNode=K;function pe(P){for(var A=P.map(function(de){return K(de,!0)}),W=1;W<A.length;W++)A[W].prev=A[W-1],A[W-1].next=A[W];return A}})),kd=Ee((e=>{var n=e&&e.__createBinding||(Object.create?(function(f,p,y,w){w===void 0&&(w=y);var _=Object.getOwnPropertyDescriptor(p,y);(!_||("get"in _?!p.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return p[y]}}),Object.defineProperty(f,w,_)}):(function(f,p,y,w){w===void 0&&(w=y),f[w]=p[y]})),i=e&&e.__exportStar||function(f,p){for(var y in f)y!=="default"&&!Object.prototype.hasOwnProperty.call(p,y)&&n(p,f,y)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var o=_d(),s=xd();i(xd(),e);var c={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},d=(function(){function f(p,y,w){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof y=="function"&&(w=y,y=c),typeof p=="object"&&(y=p,p=void 0),this.callback=p??null,this.options=y??c,this.elementCB=w??null}return f.prototype.onparserinit=function(p){this.parser=p},f.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},f.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},f.prototype.onerror=function(p){this.handleCallback(p)},f.prototype.onclosetag=function(){this.lastNode=null;var p=this.tagStack.pop();this.options.withEndIndices&&(p.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(p)},f.prototype.onopentag=function(p,y){var w=this.options.xmlMode?o.ElementType.Tag:void 0,_=new s.Element(p,y,void 0,w);this.addNode(_),this.tagStack.push(_)},f.prototype.ontext=function(p){var y=this.lastNode;if(y&&y.type===o.ElementType.Text)y.data+=p,this.options.withEndIndices&&(y.endIndex=this.parser.endIndex);else{var w=new s.Text(p);this.addNode(w),this.lastNode=w}},f.prototype.oncomment=function(p){if(this.lastNode&&this.lastNode.type===o.ElementType.Comment){this.lastNode.data+=p;return}var y=new s.Comment(p);this.addNode(y),this.lastNode=y},f.prototype.oncommentend=function(){this.lastNode=null},f.prototype.oncdatastart=function(){var p=new s.Text(""),y=new s.CDATA([p]);this.addNode(y),p.parent=y,this.lastNode=p},f.prototype.oncdataend=function(){this.lastNode=null},f.prototype.onprocessinginstruction=function(p,y){var w=new s.ProcessingInstruction(p,y);this.addNode(w)},f.prototype.handleCallback=function(p){if(typeof this.callback=="function")this.callback(p,this.dom);else if(p)throw p},f.prototype.addNode=function(p){var y=this.tagStack[this.tagStack.length-1],w=y.children[y.children.length-1];this.options.withStartIndices&&(p.startIndex=this.parser.startIndex),this.options.withEndIndices&&(p.endIndex=this.parser.endIndex),y.children.push(p),w&&(p.prev=w,w.next=p),p.parent=y,this.lastNode=null},f})();e.DomHandler=d,e.default=d})),u0=Ee((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,i){return n[i.toLowerCase()]=i,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")})),Sd=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=s,e.escapeSpecialCharacters=d,e.revertEscapedCharacters=f,e.formatDOM=p;var n=kd(),i=u0();function o(y){return i.CASE_SENSITIVE_TAG_NAMES_MAP[y]}function s(y){for(var w={},_=0,C=y.length;_<C;_++){var E=y[_];w[E.name]=E.value}return w}function c(y){return y=y.toLowerCase(),o(y)||y}function d(y){return y.replace(i.CARRIAGE_RETURN_REGEX,i.CARRIAGE_RETURN_PLACEHOLDER)}function f(y){return y.replace(i.CARRIAGE_RETURN_PLACEHOLDER_REGEX,i.CARRIAGE_RETURN)}function p(y,w,_){w===void 0&&(w=null);for(var C=[],E,T=0,I=y.length;T<I;T++){var $=y[T];switch($.nodeType){case 1:var V=c($.nodeName);E=new n.Element(V,s($.attributes)),E.children=p(V==="template"?$.content.childNodes:$.childNodes,E);break;case 3:E=new n.Text(f($.nodeValue));break;case 8:E=new n.Comment($.nodeValue);break;default:continue}var F=C[T-1]||null;F&&(F.next=E),E.parent=w,E.prev=F,E.next=null,C.push(E)}return _&&(E=new n.ProcessingInstruction(_.substring(0,_.indexOf(" ")).toLowerCase(),_),E.next=C[0]||null,E.parent=w,C.unshift(E),C[1]&&(C[1].prev=C[0])),C}})),d0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=$;var n=Sd(),i="html",o="head",s="body",c=/<([a-zA-Z]+[0-9]?)/,d=/<head[^]*>/i,f=/<body[^]*>/i,p=function(V,F){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},y=function(V,F){throw Error("This browser does not support `DOMParser.prototype.parseFromString`")},w=typeof window=="object"&&window.DOMParser;if(typeof w=="function"){var _=new w,C="text/html";y=function(V,F){return F&&(V=`<${F}>${V}</${F}>`),_.parseFromString(V,C)},p=y}if(typeof document=="object"&&document.implementation){var E=document.implementation.createHTMLDocument();p=function(V,F){if(F){var N=E.documentElement.querySelector(F);return N&&(N.innerHTML=V),E}return E.documentElement.innerHTML=V,E}}var T=typeof document=="object"&&document.createElement("template"),I;T&&T.content&&(I=function(V){return T.innerHTML=V,T.content.childNodes});function $(V){var F,N;V=(0,n.escapeSpecialCharacters)(V);var K=V.match(c),pe=K&&K[1]?K[1].toLowerCase():"";switch(pe){case i:var P=y(V);if(!d.test(V)){var W=P.querySelector(o);(F=W==null?void 0:W.parentNode)==null||F.removeChild(W)}if(!f.test(V)){var W=P.querySelector(s);(N=W==null?void 0:W.parentNode)==null||N.removeChild(W)}return P.querySelectorAll(i);case o:case s:var A=p(V).querySelectorAll(pe);return f.test(V)&&d.test(V)?A[0].parentNode.childNodes:A;default:if(I)return I(V);var W=p(V,s).querySelector(s);return W.childNodes}}})),f0=Ee((e=>{var n=e&&e.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var i=n(d0()),o=Sd(),s=/<(![a-zA-Z\s]+)>/;function c(d){if(typeof d!="string")throw TypeError("First argument must be a string");if(!d)return[];var f=d.match(s),p=f?f[1]:void 0;return(0,o.formatDOM)((0,i.default)(d),null,p)}})),p0=Ee((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}})),h0=Ee((e=>{var n=0,i=1,o=2,s=3,c=4,d=5,f=6;function p(N){return w.hasOwnProperty(N)?w[N]:null}function y(N,K,pe,P,A,W,de){this.acceptsBooleans=K===o||K===s||K===c,this.attributeName=P,this.attributeNamespace=A,this.mustUseProperty=pe,this.propertyName=N,this.type=K,this.sanitizeURL=W,this.removeEmptyString=de}var w={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(N=>{w[N]=new y(N,n,!1,N,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([N,K])=>{w[N]=new y(N,i,!1,K,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(N=>{w[N]=new y(N,o,!1,N.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(N=>{w[N]=new y(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=>{w[N]=new y(N,s,!1,N.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(N=>{w[N]=new y(N,s,!0,N,null,!1,!1)}),["capture","download"].forEach(N=>{w[N]=new y(N,c,!1,N,null,!1,!1)}),["cols","rows","size","span"].forEach(N=>{w[N]=new y(N,f,!1,N,null,!1,!1)}),["rowSpan","start"].forEach(N=>{w[N]=new y(N,d,!1,N.toLowerCase(),null,!1,!1)});var _=/[\-\:]([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 K=N.replace(_,C);w[K]=new y(K,i,!1,N,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(N=>{let K=N.replace(_,C);w[K]=new y(K,i,!1,N,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(N=>{let K=N.replace(_,C);w[K]=new y(K,i,!1,N,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(N=>{w[N]=new y(N,i,!1,N.toLowerCase(),null,!1,!1)});var E="xlinkHref";w[E]=new y("xlinkHref",i,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(N=>{w[N]=new y(N,i,!1,N.toLowerCase(),null,!0,!0)});var{CAMELCASE:T,SAME:I,possibleStandardNames:$}=p0(),V=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]*$")),F=Object.keys($).reduce((N,K)=>{let pe=$[K];return pe===I?N[K]=K:pe===T?N[K.toLowerCase()]=K:N[K]=pe,N},{});e.BOOLEAN=s,e.BOOLEANISH_STRING=o,e.NUMERIC=d,e.OVERLOADED_BOOLEAN=c,e.POSITIVE_NUMERIC=f,e.RESERVED=n,e.STRING=i,e.getPropertyInfo=p,e.isCustomAttribute=V,e.possibleStandardNames=F})),Cd=Ee((e=>{var n=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};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=f;var i=Ou(),o=n(oD()),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(p,y){return p.includes("-")?!s.has(p):!!(y&&typeof y.is=="string")}var d={reactCompat:!0};function f(p,y){if(typeof p=="string"){if(!p.trim()){y.style={};return}try{y.style=(0,o.default)(p,d)}catch{y.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(i.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),e.canTextBeChildOfNode=function(p){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(p.name)},e.returnFirstArg=function(p){return p}})),Ed=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var n=h0(),i=Cd(),o=["checked","value"],s=["input","select","textarea"],c={reset:!0,submit:!0};function d(p,y){p===void 0&&(p={});var w={},_=!!(p.type&&c[p.type]);for(var C in p){var E=p[C];if((0,n.isCustomAttribute)(C)){w[C]=E;continue}var T=C.toLowerCase(),I=f(T);if(I){var $=(0,n.getPropertyInfo)(I);switch(o.includes(I)&&s.includes(y)&&!_&&(I=f("default"+T)),w[I]=E,$&&$.type){case n.BOOLEAN:w[I]=!0;break;case n.OVERLOADED_BOOLEAN:E===""&&(w[I]=!0);break}continue}i.PRESERVE_CUSTOM_ATTRIBUTES&&(w[C]=E)}return(0,i.setStyleProp)(p.style,w),w}function f(p){return n.possibleStandardNames[p]}})),m0=Ee((e=>{var n=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var i=Ou(),o=n(Ed()),s=Cd(),c={cloneElement:i.cloneElement,createElement:i.createElement,isValidElement:i.isValidElement};function d(p,y){y===void 0&&(y={});for(var w=[],_=typeof y.replace=="function",C=y.transform||s.returnFirstArg,E=y.library||c,T=E.cloneElement,I=E.createElement,$=E.isValidElement,V=p.length,F=0;F<V;F++){var N=p[F];if(_){var K=y.replace(N,F);if($(K)){V>1&&(K=T(K,{key:K.key||F})),w.push(C(K,N,F));continue}}if(N.type==="text"){var pe=!N.data.trim().length;if(pe&&N.parent&&!(0,s.canTextBeChildOfNode)(N.parent)||y.trim&&pe)continue;w.push(C(N.data,N,F));continue}var P=N,A={};f(P)?((0,s.setStyleProp)(P.attribs.style,P.attribs),A=P.attribs):P.attribs&&(A=(0,o.default)(P.attribs,P.name));var W=void 0;switch(N.type){case"script":case"style":N.children[0]&&(A.dangerouslySetInnerHTML={__html:N.children[0].data});break;case"tag":N.name==="textarea"&&N.children[0]?A.defaultValue=N.children[0].data:N.children&&N.children.length&&(W=d(N.children,y));break;default:continue}V>1&&(A.key=F),w.push(C(I(N.name,A,W),N,F))}return w.length===1?w[0]:w}function f(p){return s.PRESERVE_CUSTOM_ATTRIBUTES&&p.type==="tag"&&(0,s.isCustomComponent)(p.name,p.attribs)}})),Td=Ee((e=>{var n=e&&e.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=d;var i=n(f0());e.htmlToDOM=i.default,e.attributesToProps=n(Ed()).default;var o=n(m0());e.domToReact=o.default;var s=kd();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 d(f,p){if(typeof f!="string")throw TypeError("First argument must be a string");return f?(0,o.default)((0,i.default)(f,(p==null?void 0:p.htmlparser2)||c),p):[]}})),Rd=vh(Td(),1),Da=Td(),qm=Rd.default.default||Rd.default;let Xl;Xl=(e,n)=>{let[i,...o]=n.split("."),s=(e.attribs.class||"").split(" ");return e.tagName===i&&o.every(c=>s.includes(c))},Ww=e=>{var n;return e&&Xl(e,"span.nb")&&e.firstChild instanceof Da.Text&&((n=e.firstChild.nodeValue)==null?void 0:n.includes("__marimo__"))},tm=function(e){var n,i,o;if(e instanceof Da.Element&&e.firstChild instanceof Da.Text&&Xl(e,"span.nb")){let s=e.next;if(s&&s instanceof Da.Text){let c=s.next;if(c&&c instanceof Da.Element&&c.firstChild instanceof Da.Text&&Xl(c,"span.m")){let d=Number.parseInt(c.firstChild.nodeValue||"0",10);if((n=e.firstChild.nodeValue)!=null&&n.includes("__marimo__")){let f=(i=/__marimo__cell_(\w+)_/.exec(e.firstChild.nodeValue))==null?void 0:i[1];if(f&&d)return{kind:"cell",cellId:f,lineNumber:d}}else{let f=(o=/"(.+?)"/.exec(e.firstChild.nodeValue))==null?void 0:o[1];if(f&&d)return{kind:"file",filePath:f,lineNumber:d}}}}}return null},Uh=function(e){let n=[];return qm(e,{replace:i=>{let o=tm(i);if(o)return n.push(o),"dummy"}}),n};function g0(e){return n=>{let i=!1;for(let o of n)o&&(i=e(o)||i);return i}}const Wx=g0(O4),Ux=g0(P4);let Dd,y0,Ro,v0,Do,b0;Dd=Ee(((e,n)=>{var i=typeof Reflect=="object"?Reflect:null,o=i&&typeof i.apply=="function"?i.apply:function(P,A,W){return Function.prototype.apply.call(P,A,W)},s=i&&typeof i.ownKeys=="function"?i.ownKeys:Object.getOwnPropertySymbols?function(P){return Object.getOwnPropertyNames(P).concat(Object.getOwnPropertySymbols(P))}:function(P){return Object.getOwnPropertyNames(P)};function c(P){console&&console.warn&&console.warn(P)}var d=Number.isNaN||function(P){return P!==P};function f(){f.init.call(this)}n.exports=f,n.exports.once=N,f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var p=10;function y(P){if(typeof P!="function")throw TypeError('The "listener" argument must be of type Function. Received type '+typeof P)}Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return p},set:function(P){if(typeof P!="number"||P<0||d(P))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+P+".");p=P}}),f.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},f.prototype.setMaxListeners=function(P){if(typeof P!="number"||P<0||d(P))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+P+".");return this._maxListeners=P,this};function w(P){return P._maxListeners===void 0?f.defaultMaxListeners:P._maxListeners}f.prototype.getMaxListeners=function(){return w(this)},f.prototype.emit=function(P){for(var A=[],W=1;W<arguments.length;W++)A.push(arguments[W]);var de=P==="error",fe=this._events;if(fe!==void 0)de&&(de=fe.error===void 0);else if(!de)return!1;if(de){var we;if(A.length>0&&(we=A[0]),we instanceof Error)throw we;var J=Error("Unhandled error."+(we?" ("+we.message+")":""));throw J.context=we,J}var be=fe[P];if(be===void 0)return!1;if(typeof be=="function")o(be,this,A);else for(var Ce=be.length,Z=$(be,Ce),W=0;W<Ce;++W)o(Z[W],this,A);return!0};function _(P,A,W,de){var fe,we,J;if(y(W),we=P._events,we===void 0?(we=P._events=Object.create(null),P._eventsCount=0):(we.newListener!==void 0&&(P.emit("newListener",A,W.listener?W.listener:W),we=P._events),J=we[A]),J===void 0)J=we[A]=W,++P._eventsCount;else if(typeof J=="function"?J=we[A]=de?[W,J]:[J,W]:de?J.unshift(W):J.push(W),fe=w(P),fe>0&&J.length>fe&&!J.warned){J.warned=!0;var be=Error("Possible EventEmitter memory leak detected. "+J.length+" "+String(A)+" listeners added. Use emitter.setMaxListeners() to increase limit");be.name="MaxListenersExceededWarning",be.emitter=P,be.type=A,be.count=J.length,c(be)}return P}f.prototype.addListener=function(P,A){return _(this,P,A,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(P,A){return _(this,P,A,!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(P,A,W){var de={fired:!1,wrapFn:void 0,target:P,type:A,listener:W},fe=C.bind(de);return fe.listener=W,de.wrapFn=fe,fe}f.prototype.once=function(P,A){return y(A),this.on(P,E(this,P,A)),this},f.prototype.prependOnceListener=function(P,A){return y(A),this.prependListener(P,E(this,P,A)),this},f.prototype.removeListener=function(P,A){var W,de,fe,we,J;if(y(A),de=this._events,de===void 0||(W=de[P],W===void 0))return this;if(W===A||W.listener===A)--this._eventsCount===0?this._events=Object.create(null):(delete de[P],de.removeListener&&this.emit("removeListener",P,W.listener||A));else if(typeof W!="function"){for(fe=-1,we=W.length-1;we>=0;we--)if(W[we]===A||W[we].listener===A){J=W[we].listener,fe=we;break}if(fe<0)return this;fe===0?W.shift():V(W,fe),W.length===1&&(de[P]=W[0]),de.removeListener!==void 0&&this.emit("removeListener",P,J||A)}return this},f.prototype.off=f.prototype.removeListener,f.prototype.removeAllListeners=function(P){var A,W=this._events,de;if(W===void 0)return this;if(W.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):W[P]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete W[P]),this;if(arguments.length===0){var fe=Object.keys(W),we;for(de=0;de<fe.length;++de)we=fe[de],we!=="removeListener"&&this.removeAllListeners(we);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(A=W[P],typeof A=="function")this.removeListener(P,A);else if(A!==void 0)for(de=A.length-1;de>=0;de--)this.removeListener(P,A[de]);return this};function T(P,A,W){var de=P._events;if(de===void 0)return[];var fe=de[A];return fe===void 0?[]:typeof fe=="function"?W?[fe.listener||fe]:[fe]:W?F(fe):$(fe,fe.length)}f.prototype.listeners=function(P){return T(this,P,!0)},f.prototype.rawListeners=function(P){return T(this,P,!1)},f.listenerCount=function(P,A){return typeof P.listenerCount=="function"?P.listenerCount(A):I.call(P,A)},f.prototype.listenerCount=I;function I(P){var A=this._events;if(A!==void 0){var W=A[P];if(typeof W=="function")return 1;if(W!==void 0)return W.length}return 0}f.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function $(P,A){for(var W=Array(A),de=0;de<A;++de)W[de]=P[de];return W}function V(P,A){for(;A+1<P.length;A++)P[A]=P[A+1];P.pop()}function F(P){for(var A=Array(P.length),W=0;W<A.length;++W)A[W]=P[W].listener||P[W];return A}function N(P,A){return new Promise(function(W,de){function fe(J){P.removeListener(A,we),de(J)}function we(){typeof P.removeListener=="function"&&P.removeListener("error",fe),W([].slice.call(arguments))}pe(P,A,we,{once:!0}),A!=="error"&&K(P,fe,{once:!0})})}function K(P,A,W){typeof P.on=="function"&&pe(P,"error",A,W)}function pe(P,A,W,de){if(typeof P.on=="function")de.once?P.once(A,W):P.on(A,W);else if(typeof P.addEventListener=="function")P.addEventListener(A,function fe(we){de.once&&P.removeEventListener(A,fe),W(we)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof P)}})),y0=Ee((e=>{var n=e&&e.__awaiter||function(s,c,d,f){function p(y){return y instanceof d?y:new d(function(w){w(y)})}return new(d||(d=Promise))(function(y,w){function _(T){try{E(f.next(T))}catch(I){w(I)}}function C(T){try{E(f.throw(T))}catch(I){w(I)}}function E(T){T.done?y(T.value):p(T.value).then(_,C)}E((f=f.apply(s,c||[])).next())})},i=e&&e.__generator||function(s,c){var d={label:0,sent:function(){if(y[0]&1)throw y[1];return y[1]},trys:[],ops:[]},f,p,y,w;return w={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(w[Symbol.iterator]=function(){return this}),w;function _(E){return function(T){return C([E,T])}}function C(E){if(f)throw TypeError("Generator is already executing.");for(;d;)try{if(f=1,p&&(y=E[0]&2?p.return:E[0]?p.throw||((y=p.return)&&y.call(p),0):p.next)&&!(y=y.call(p,E[1])).done)return y;switch(p=0,y&&(E=[E[0]&2,y.value]),E[0]){case 0:case 1:y=E;break;case 4:return d.label++,{value:E[1],done:!1};case 5:d.label++,p=E[1],E=[0];continue;case 7:E=d.ops.pop(),d.trys.pop();continue;default:if(y=d.trys,!(y=y.length>0&&y[y.length-1])&&(E[0]===6||E[0]===2)){d=0;continue}if(E[0]===3&&(!y||E[1]>y[0]&&E[1]<y[3])){d.label=E[1];break}if(E[0]===6&&d.label<y[1]){d.label=y[1],y=E;break}if(y&&d.label<y[2]){d.label=y[2],d.ops.push(E);break}y[2]&&d.ops.pop(),d.trys.pop();continue}E=c.call(s,d)}catch(T){E=[6,T],p=0}finally{f=y=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=Dd();e.defaultNextRequest=function(){var s=-1;return function(){return++s}},e.default=(function(){function s(c,d){d===void 0&&(d=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=d}return s.prototype.connect=function(){var c=this;return Promise.all(this.transports.map(function(d){return n(c,void 0,void 0,function(){return i(this,function(f){switch(f.label){case 0:return d.subscribe("error",this.handleError.bind(this)),d.subscribe("notification",this.handleNotification.bind(this)),[4,d.connect()];case 1:return f.sent(),[2]}})})}))},s.prototype.getPrimaryTransport=function(){return this.transports[0]},s.prototype.request=function(c,d,f){return d===void 0&&(d=!1),n(this,void 0,void 0,function(){var p,y,w,_,C=this;return i(this,function(E){return p=this.nextID().toString(),y=d?null:p,w={request:this.makeRequest(c.method,c.params||[],y),internalID:p},this.batchStarted?(_=new Promise(function(T,I){C.batch.push({resolve:T,reject:I,request:w})}),[2,_]):[2,this.getPrimaryTransport().sendData(w,f)]})})},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,d,f){return f?{jsonrpc:"2.0",id:f,method:c,params:d}:{jsonrpc:"2.0",method:c,params:d}},s.prototype.handleError=function(c){this.requestChannel.emit("error",c)},s.prototype.handleNotification=function(c){this.requestChannel.emit("notification",c)},s})()})),Ro=Ee((e=>{var n=e&&e.__extends||(function(){var o=function(s,c){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var p in f)f.hasOwnProperty(p)&&(d[p]=f[p])},o(s,c)};return function(s,c){o(s,c);function d(){this.constructor=s}s.prototype=c===null?Object.create(c):(d.prototype=c.prototype,new d)}})();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 i=(function(o){n(s,o);function s(c,d,f){var p=this.constructor,y=o.call(this,c)||this;return y.message=c,y.code=d,y.data=f,Object.setPrototypeOf(y,p.prototype),y}return s})(Error);e.JSONRPCError=i,e.convertJSONToRPCError=function(o){if(o.error){var s=o.error,c=s.message,d=s.code,f=s.data;return new i(c,d,f)}return new i("Unknown error",e.ERR_UNKNOWN,o)}})),v0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TransportRequestManager=void 0;var n=Dd(),i=Ro();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 d=this;s.forEach(function(f){var p=d.pendingRequest[f.internalID];if(delete d.pendingBatchRequest[f.internalID],p!==void 0){if(c){p.reject(c);return}p.resolve(),(f.request.id===null||f.request.id===void 0)&&delete d.pendingRequest[f.internalID]}})},o.prototype.isPendingRequest=function(s){return this.pendingRequest.hasOwnProperty(s)},o.prototype.resolveResponse=function(s,c){c===void 0&&(c=!0);var d=s;try{return d=JSON.parse(s),this.checkJSONRPC(d)===!1?void 0:d instanceof Array?this.resolveBatch(d,c):this.resolveRes(d,c)}catch{var f=new i.JSONRPCError("Bad response format",i.ERR_UNKNOWN,s);return c&&this.transportEventChannel.emit("error",f),f}},o.prototype.addBatchReq=function(s,c){var d=this;return s.forEach(function(f){var p=f.resolve,y=f.reject,w=f.request.internalID;d.pendingBatchRequest[w]=!0,d.pendingRequest[w]={resolve:p,reject:y}}),Promise.resolve()},o.prototype.addReq=function(s,c){var d=this;return new Promise(function(f,p){c!==null&&c&&d.setRequestTimeout(s,c,p),d.pendingRequest[s]={resolve:f,reject:p}})},o.prototype.checkJSONRPC=function(s){var c=[s];return s instanceof Array&&(c=s),c.every(function(d){return d.result!==void 0||d.error!==void 0||d.method!==void 0})},o.prototype.processResult=function(s,c){if(s.error){var d=i.convertJSONToRPCError(s);c.reject(d);return}c.resolve(s.result)},o.prototype.resolveBatch=function(s,c){var d=this,f=s.map(function(p){return d.resolveRes(p,c)}).filter(function(p){return p});if(f.length>0)return f[0]},o.prototype.resolveRes=function(s,c){var d=s.id,f=s.error,p=this.pendingRequest[d];if(p){delete this.pendingRequest[d],this.processResult(s,p),this.transportEventChannel.emit("response",s);return}if(d===void 0&&f===void 0){this.transportEventChannel.emit("notification",s);return}var y;return f&&(y=i.convertJSONToRPCError(s)),c&&f&&y&&this.transportEventChannel.emit("error",y),y},o.prototype.setRequestTimeout=function(s,c,d){var f=this;setTimeout(function(){delete f.pendingRequest[s],d(new i.JSONRPCError("Request timeout request took longer than "+c+" ms to resolve",i.ERR_TIMEOUT))},c)},o})()})),Oa=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Transport=void 0;var n=v0();e.Transport=(function(){function i(){this.transportRequestManager=new n.TransportRequestManager,this.transportRequestManager.transportEventChannel.on("error",function(){})}return i.prototype.subscribe=function(o,s){this.transportRequestManager.transportEventChannel.addListener(o,s)},i.prototype.unsubscribe=function(o,s){if(!o)return this.transportRequestManager.transportEventChannel.removeAllListeners();o&&s&&this.transportRequestManager.transportEventChannel.removeListener(o,s)},i.prototype.parseData=function(o){return o instanceof Array?o.map(function(s){return s.request.request}):o.request},i})()})),Do=Ee((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(i){return i.request.request.id!=null}).map(function(i){return i.request}):[]},e.getNotifications=function(n){return n instanceof Array?n.filter(function(i){return e.isNotification(i.request)}).map(function(i){return i.request}):e.isNotification(n)?[n]:[]}})),b0=Ee((e=>{var n=e&&e.__extends||(function(){var c=function(d,f){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,y){p.__proto__=y}||function(p,y){for(var w in y)y.hasOwnProperty(w)&&(p[w]=y[w])},c(d,f)};return function(d,f){c(d,f);function p(){this.constructor=d}d.prototype=f===null?Object.create(f):(p.prototype=f.prototype,new p)}})();Object.defineProperty(e,"__esModule",{value:!0});var i=Oa(),o=Do(),s=Ro();e.default=(function(c){n(d,c);function d(f,p,y){var w=c.call(this)||this;return w.connection=f,w.reqUri=p,w.resUri=y,w}return d.prototype.connect=function(){var f=this;return this.connection.on(this.resUri,function(p){f.transportRequestManager.resolveResponse(p)}),Promise.resolve()},d.prototype.sendData=function(f,p){p===void 0&&(p=null);var y=this.transportRequestManager.addRequest(f,p),w=o.getNotifications(f),_=this.parseData(f);try{return this.connection.emit(this.reqUri,_),this.transportRequestManager.settlePendingRequest(w),y}catch(E){var C=new s.JSONRPCError(E.message,s.ERR_UNKNOWN,E);return this.transportRequestManager.settlePendingRequest(w,C),Promise.reject(C)}},d.prototype.close=function(){this.connection.removeAllListeners()},d})(i.Transport)}));function Kx(e){return e&&DataView.prototype.isPrototypeOf(e)}function Oo(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 Od(e){return typeof e!="string"&&(e=String(e)),e}function Pd(e){var n={next:function(){var i=e.shift();return{done:i===void 0,value:i}}};return Rn.iterable&&(n[Symbol.iterator]=function(){return n}),n}function cn(e){this.map={},e instanceof cn?e.forEach(function(n,i){this.append(i,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 Md(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function w0(e){return new Promise(function(n,i){e.onload=function(){n(e.result)},e.onerror=function(){i(e.error)}})}function Qx(e){var n=new FileReader,i=w0(n);return n.readAsArrayBuffer(e),i}function Gx(e){var n=new FileReader,i=w0(n),o=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=o?o[1]:"utf-8";return n.readAsText(e,s),i}function Jx(e){for(var n=new Uint8Array(e),i=Array(n.length),o=0;o<n.length;o++)i[o]=String.fromCharCode(n[o]);return i.join("")}function _0(e){if(e.slice)return e.slice(0);var n=new Uint8Array(e.byteLength);return n.set(new Uint8Array(e)),n.buffer}function x0(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:Rn.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Rn.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Rn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Rn.arrayBuffer&&Rn.blob&&Kx(e)?(this._bodyArrayBuffer=_0(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Rn.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||C0(e))?this._bodyArrayBuffer=_0(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):Rn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Rn.blob&&(this.blob=function(){var e=Md(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 Md(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(Rn.blob)return this.blob().then(Qx);throw Error("could not read as ArrayBuffer")},this.text=function(){var e=Md(this);if(e)return e;if(this._bodyBlob)return Gx(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Jx(this._bodyArrayBuffer));if(this._bodyFormData)throw Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Rn.formData&&(this.formData=function(){return this.text().then(Yx)}),this.json=function(){return this.text().then(JSON.parse)},this}function Xx(e){var n=e.toUpperCase();return E0.indexOf(n)>-1?n:e}function Aa(e,n){if(!(this instanceof Aa))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');n||(n={});var i=n.body;if(e instanceof Aa){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,n.headers||(this.headers=new cn(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!i&&e._bodyInit!=null&&(i=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 cn(n.headers)),this.method=Xx(n.method||this.method||"GET"),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal||(function(){if("AbortController"in gn)return new AbortController().signal})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&i)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),(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 Yx(e){var n=new FormData;return e.trim().split("&").forEach(function(i){if(i){var o=i.split("="),s=o.shift().replace(/\+/g," "),c=o.join("=").replace(/\+/g," ");n.append(decodeURIComponent(s),decodeURIComponent(c))}}),n}function Zx(e){var n=new cn;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(i){return i.indexOf(`
16
+ `)===0?i.substr(1,i.length):i}).forEach(function(i){var o=i.split(":"),s=o.shift().trim();if(s){var c=o.join(":").trim();try{n.append(s,c)}catch(d){console.warn("Response "+d.message)}}}),n}function Zr(e,n){if(!(this instanceof Zr))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 cn(n.headers),this.url=n.url||"",this._initBody(e)}function k0(e,n){return new Promise(function(i,o){var s=new Aa(e,n);if(s.signal&&s.signal.aborted)return o(new Gi("Aborted","AbortError"));var c=new XMLHttpRequest;function d(){c.abort()}c.onload=function(){var y={statusText:c.statusText,headers:Zx(c.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(c.status<200||c.status>599)?y.status=200:y.status=c.status,y.url="responseURL"in c?c.responseURL:y.headers.get("X-Request-URL");var w="response"in c?c.response:c.responseText;setTimeout(function(){i(new Zr(w,y))},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 Gi("Aborted","AbortError"))},0)};function f(y){try{return y===""&&gn.location.href?gn.location.href:y}catch{return y}}if(c.open(s.method,f(s.url),!0),s.credentials==="include"?c.withCredentials=!0:s.credentials==="omit"&&(c.withCredentials=!1),"responseType"in c&&(Rn.blob?c.responseType="blob":Rn.arrayBuffer&&(c.responseType="arraybuffer")),n&&typeof n.headers=="object"&&!(n.headers instanceof cn||gn.Headers&&n.headers instanceof gn.Headers)){var p=[];Object.getOwnPropertyNames(n.headers).forEach(function(y){p.push(Oo(y)),c.setRequestHeader(y,Od(n.headers[y]))}),s.headers.forEach(function(y,w){p.indexOf(w)===-1&&c.setRequestHeader(w,y)})}else s.headers.forEach(function(y,w){c.setRequestHeader(w,y)});s.signal&&(s.signal.addEventListener("abort",d),c.onreadystatechange=function(){c.readyState===4&&s.signal.removeEventListener("abort",d)}),c.send(s._bodyInit===void 0?null:s._bodyInit)})}let gn,Rn,S0,C0,E0,T0,Gi,R0,D0,O0,P0,qa,M0,L0,N0,I0,A0,q0,Po,Ld,Nd,j0,Ji,Mo,Yl,z0,Id,F0,B0,H0,V0,Zl,$0,ja,Ad,Vt,ec,W0,U0,K0,Q0,G0,J0,X0,Y0,Z0,eg,tg,ng,rg,ig,ag,og,sg,lg,cg,ug,dg,fg,pg,hg;R0=J2((()=>{gn=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},Rn={searchParams:"URLSearchParams"in gn,iterable:"Symbol"in gn&&"iterator"in Symbol,blob:"FileReader"in gn&&"Blob"in gn&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in gn,arrayBuffer:"ArrayBuffer"in gn},Rn.arrayBuffer&&(S0=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],C0=ArrayBuffer.isView||function(e){return e&&S0.indexOf(Object.prototype.toString.call(e))>-1}),cn.prototype.append=function(e,n){e=Oo(e),n=Od(n);var i=this.map[e];this.map[e]=i?i+", "+n:n},cn.prototype.delete=function(e){delete this.map[Oo(e)]},cn.prototype.get=function(e){return e=Oo(e),this.has(e)?this.map[e]:null},cn.prototype.has=function(e){return this.map.hasOwnProperty(Oo(e))},cn.prototype.set=function(e,n){this.map[Oo(e)]=Od(n)},cn.prototype.forEach=function(e,n){for(var i in this.map)this.map.hasOwnProperty(i)&&e.call(n,this.map[i],i,this)},cn.prototype.keys=function(){var e=[];return this.forEach(function(n,i){e.push(i)}),Pd(e)},cn.prototype.values=function(){var e=[];return this.forEach(function(n){e.push(n)}),Pd(e)},cn.prototype.entries=function(){var e=[];return this.forEach(function(n,i){e.push([i,n])}),Pd(e)},Rn.iterable&&(cn.prototype[Symbol.iterator]=cn.prototype.entries),E0=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],Aa.prototype.clone=function(){return new Aa(this,{body:this._bodyInit})},x0.call(Aa.prototype),x0.call(Zr.prototype),Zr.prototype.clone=function(){return new Zr(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new cn(this.headers),url:this.url})},Zr.error=function(){var e=new Zr(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e},T0=[301,302,303,307,308],Zr.redirect=function(e,n){if(T0.indexOf(n)===-1)throw RangeError("Invalid status code");return new Zr(null,{status:n,headers:{location:e}})},Gi=gn.DOMException;try{new Gi}catch{Gi=function(e,n){this.message=e,this.name=n,this.stack=Error(e).stack},Gi.prototype=Object.create(Error.prototype),Gi.prototype.constructor=Gi}k0.polyfill=!0,gn.fetch||(gn.fetch=k0,gn.Headers=cn,gn.Request=Aa,gn.Response=Zr)})),D0=Ee(((e,n)=>{R0(),n.exports=self.fetch.bind(self)})),O0=Ee((e=>{var n=e&&e.__extends||(function(){var w=function(_,C){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,T){E.__proto__=T}||function(E,T){for(var I in T)T.hasOwnProperty(I)&&(E[I]=T[I])},w(_,C)};return function(_,C){w(_,C);function E(){this.constructor=_}_.prototype=C===null?Object.create(C):(E.prototype=C.prototype,new E)}})(),i=e&&e.__awaiter||function(w,_,C,E){function T(I){return I instanceof C?I:new C(function($){$(I)})}return new(C||(C=Promise))(function(I,$){function V(K){try{N(E.next(K))}catch(pe){$(pe)}}function F(K){try{N(E.throw(K))}catch(pe){$(pe)}}function N(K){K.done?I(K.value):T(K.value).then(V,F)}N((E=E.apply(w,_||[])).next())})},o=e&&e.__generator||function(w,_){var C={label:0,sent:function(){if(I[0]&1)throw I[1];return I[1]},trys:[],ops:[]},E,T,I,$;return $={next:V(0),throw:V(1),return:V(2)},typeof Symbol=="function"&&($[Symbol.iterator]=function(){return this}),$;function V(N){return function(K){return F([N,K])}}function F(N){if(E)throw TypeError("Generator is already executing.");for(;C;)try{if(E=1,T&&(I=N[0]&2?T.return:N[0]?T.throw||((I=T.return)&&I.call(T),0):T.next)&&!(I=I.call(T,N[1])).done)return I;switch(T=0,I&&(N=[N[0]&2,I.value]),N[0]){case 0:case 1:I=N;break;case 4:return C.label++,{value:N[1],done:!1};case 5:C.label++,T=N[1],N=[0];continue;case 7:N=C.ops.pop(),C.trys.pop();continue;default:if(I=C.trys,!(I=I.length>0&&I[I.length-1])&&(N[0]===6||N[0]===2)){C=0;continue}if(N[0]===3&&(!I||N[1]>I[0]&&N[1]<I[3])){C.label=N[1];break}if(N[0]===6&&C.label<I[1]){C.label=I[1],I=N;break}if(I&&C.label<I[2]){C.label=I[2],C.ops.push(N);break}I[2]&&C.ops.pop(),C.trys.pop();continue}N=_.call(w,C)}catch(K){N=[6,K],T=0}finally{E=I=0}if(N[0]&5)throw N[1];return{value:N[0]?N[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTTPTransport=void 0;var c=s(D0()),d=Oa(),f=Do(),p=Ro(),y=(function(w){n(_,w);function _(C,E){var T=w.call(this)||this;return T.onlyNotifications=function(I){return I instanceof Array?I.every(function($){return $.request.request.id===null||$.request.request.id===void 0}):I.request.id===null||I.request.id===void 0},T.uri=C,T.credentials=E&&E.credentials,T.headers=_.setupHeaders(E&&E.headers),T.injectedFetcher=E==null?void 0:E.fetcher,T}return _.prototype.connect=function(){return Promise.resolve()},_.prototype.sendData=function(C,E){return E===void 0&&(E=null),i(this,void 0,void 0,function(){var T,I,$,V,F,N,pe,K,pe;return o(this,function(P){switch(P.label){case 0:T=this.transportRequestManager.addRequest(C,E),I=f.getNotifications(C),$=f.getBatchRequests(C),V=this.injectedFetcher||c.default,P.label=1;case 1:return P.trys.push([1,4,,5]),[4,V(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(C)),credentials:this.credentials})];case 2:return F=P.sent(),this.transportRequestManager.settlePendingRequest(I),this.onlyNotifications(C)?[2,Promise.resolve()]:[4,F.text()];case 3:return N=P.sent(),pe=this.transportRequestManager.resolveResponse(N),pe?(this.transportRequestManager.settlePendingRequest($,pe),[2,Promise.reject(pe)]):[3,5];case 4:return K=P.sent(),pe=new p.JSONRPCError(K.message,p.ERR_UNKNOWN,K),this.transportRequestManager.settlePendingRequest(I,pe),this.transportRequestManager.settlePendingRequest(f.getBatchRequests(C),pe),[2,Promise.reject(pe)];case 5:return[2,T]}})})},_.prototype.close=function(){},_.setupHeaders=function(C){var E=new Headers(C);return E.set("Content-Type","application/json"),E},_})(d.Transport);e.HTTPTransport=y,e.default=y})),P0=ZR({default:()=>M0},1),L0=J2((()=>{qa=null,typeof WebSocket<"u"?qa=WebSocket:typeof MozWebSocket<"u"?qa=MozWebSocket:typeof global<"u"?qa=global.WebSocket||global.MozWebSocket:typeof window<"u"?qa=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(qa=self.WebSocket||self.MozWebSocket),M0=qa})),N0=Ee((e=>{var n=e&&e.__extends||(function(){var y=function(w,_){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,E){C.__proto__=E}||function(C,E){for(var T in E)E.hasOwnProperty(T)&&(C[T]=E[T])},y(w,_)};return function(w,_){y(w,_);function C(){this.constructor=w}w.prototype=_===null?Object.create(_):(C.prototype=_.prototype,new C)}})(),i=e&&e.__awaiter||function(y,w,_,C){function E(T){return T instanceof _?T:new _(function(I){I(T)})}return new(_||(_=Promise))(function(T,I){function $(N){try{F(C.next(N))}catch(K){I(K)}}function V(N){try{F(C.throw(N))}catch(K){I(K)}}function F(N){N.done?T(N.value):E(N.value).then($,V)}F((C=C.apply(y,w||[])).next())})},o=e&&e.__generator||function(y,w){var _={label:0,sent:function(){if(T[0]&1)throw T[1];return T[1]},trys:[],ops:[]},C,E,T,I;return I={next:$(0),throw:$(1),return:$(2)},typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function $(F){return function(N){return V([F,N])}}function V(F){if(C)throw TypeError("Generator is already executing.");for(;_;)try{if(C=1,E&&(T=F[0]&2?E.return:F[0]?E.throw||((T=E.return)&&T.call(E),0):E.next)&&!(T=T.call(E,F[1])).done)return T;switch(E=0,T&&(F=[F[0]&2,T.value]),F[0]){case 0:case 1:T=F;break;case 4:return _.label++,{value:F[1],done:!1};case 5:_.label++,E=F[1],F=[0];continue;case 7:F=_.ops.pop(),_.trys.pop();continue;default:if(T=_.trys,!(T=T.length>0&&T[T.length-1])&&(F[0]===6||F[0]===2)){_=0;continue}if(F[0]===3&&(!T||F[1]>T[0]&&F[1]<T[3])){_.label=F[1];break}if(F[0]===6&&_.label<T[1]){_.label=T[1],T=F;break}if(T&&_.label<T[2]){_.label=T[2],_.ops.push(F);break}T[2]&&_.ops.pop(),_.trys.pop();continue}F=w.call(y,_)}catch(N){F=[6,N],E=0}finally{C=T=0}if(F[0]&5)throw F[1];return{value:F[0]?F[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0});var c=s((L0(),Du(P0))),d=Oa(),f=Do(),p=Ro();e.default=(function(y){n(w,y);function w(_){var C=y.call(this)||this;return C.uri=_,C.connection=new c.default(_),C}return w.prototype.connect=function(){var _=this;return new Promise(function(C,E){var T=function(){_.connection.removeEventListener("open",T),C()};_.connection.addEventListener("open",T),_.connection.addEventListener("message",function(I){var $=I.data;_.transportRequestManager.resolveResponse($)})})},w.prototype.sendData=function(_,C){return C===void 0&&(C=5e3),i(this,void 0,void 0,function(){var E,T,I;return o(this,function($){E=this.transportRequestManager.addRequest(_,C),T=f.getNotifications(_);try{this.connection.send(JSON.stringify(this.parseData(_))),this.transportRequestManager.settlePendingRequest(T)}catch(V){I=new p.JSONRPCError(V.message,p.ERR_UNKNOWN,V),this.transportRequestManager.settlePendingRequest(T,I),this.transportRequestManager.settlePendingRequest(f.getBatchRequests(_),I),E=Promise.reject(I)}return[2,E]})})},w.prototype.close=function(){this.connection.close()},w})(d.Transport)})),I0=Ee((e=>{var n=e&&e.__extends||(function(){var f=function(p,y){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,_){w.__proto__=_}||function(w,_){for(var C in _)_.hasOwnProperty(C)&&(w[C]=_[C])},f(p,y)};return function(p,y){f(p,y);function w(){this.constructor=p}p.prototype=y===null?Object.create(y):(w.prototype=y.prototype,new w)}})(),i=e&&e.__awaiter||function(f,p,y,w){function _(C){return C instanceof y?C:new y(function(E){E(C)})}return new(y||(y=Promise))(function(C,E){function T(V){try{$(w.next(V))}catch(F){E(F)}}function I(V){try{$(w.throw(V))}catch(F){E(F)}}function $(V){V.done?C(V.value):_(V.value).then(T,I)}$((w=w.apply(f,p||[])).next())})},o=e&&e.__generator||function(f,p){var y={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},w,_,C,E;return E={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function T($){return function(V){return I([$,V])}}function I($){if(w)throw TypeError("Generator is already executing.");for(;y;)try{if(w=1,_&&(C=$[0]&2?_.return:$[0]?_.throw||((C=_.return)&&C.call(_),0):_.next)&&!(C=C.call(_,$[1])).done)return C;switch(_=0,C&&($=[$[0]&2,C.value]),$[0]){case 0:case 1:C=$;break;case 4:return y.label++,{value:$[1],done:!1};case 5:y.label++,_=$[1],$=[0];continue;case 7:$=y.ops.pop(),y.trys.pop();continue;default:if(C=y.trys,!(C=C.length>0&&C[C.length-1])&&($[0]===6||$[0]===2)){y=0;continue}if($[0]===3&&(!C||$[1]>C[0]&&$[1]<C[3])){y.label=$[1];break}if($[0]===6&&y.label<C[1]){y.label=C[1],C=$;break}if(C&&y.label<C[2]){y.label=C[2],y.ops.push($);break}C[2]&&y.ops.pop(),y.trys.pop();continue}$=p.call(f,y)}catch(V){$=[6,V],_=0}finally{w=C=0}if($[0]&5)throw $[1];return{value:$[0]?$[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=Oa(),c=Do(),d=function(f){var p=400,y=window.screen.height;return window.open(f,"inspector:popup","left=0,top=0,width="+p+",height="+y+",resizable,scrollbars=yes,status=1")};e.default=(function(f){n(p,f);function p(y){var w=f.call(this)||this;return w.messageHandler=function(_){w.transportRequestManager.resolveResponse(JSON.stringify(_.data))},w.uri=y,w.postMessageID="post-message-transport-"+Math.random(),w}return p.prototype.createWindow=function(y){return new Promise(function(w,_){var C=d(y);setTimeout(function(){w(C)},3e3)})},p.prototype.connect=function(){var y=this,w=/^(http|https):\/\/.*$/;return new Promise(function(_,C){return i(y,void 0,void 0,function(){var E;return o(this,function(T){switch(T.label){case 0:return w.test(this.uri)||C(Error("Bad URI")),E=this,[4,this.createWindow(this.uri)];case 1:return E.frame=T.sent(),window.addEventListener("message",this.messageHandler),_(),[2]}})})})},p.prototype.sendData=function(y,w){return w===void 0&&(w=5e3),i(this,void 0,void 0,function(){var _,C;return o(this,function(E){return _=this.transportRequestManager.addRequest(y,null),C=c.getNotifications(y),this.frame&&(this.frame.postMessage(y.request,this.uri),this.transportRequestManager.settlePendingRequest(C)),[2,_]})})},p.prototype.close=function(){this.frame&&(window.removeEventListener("message",this.messageHandler),this.frame.close())},p})(s.Transport)})),A0=Ee((e=>{var n=e&&e.__extends||(function(){var d=function(f,p){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,w){y.__proto__=w}||function(y,w){for(var _ in w)w.hasOwnProperty(_)&&(y[_]=w[_])},d(f,p)};return function(f,p){d(f,p);function y(){this.constructor=f}f.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}})(),i=e&&e.__awaiter||function(d,f,p,y){function w(_){return _ instanceof p?_:new p(function(C){C(_)})}return new(p||(p=Promise))(function(_,C){function E($){try{I(y.next($))}catch(V){C(V)}}function T($){try{I(y.throw($))}catch(V){C(V)}}function I($){$.done?_($.value):w($.value).then(E,T)}I((y=y.apply(d,f||[])).next())})},o=e&&e.__generator||function(d,f){var p={label:0,sent:function(){if(_[0]&1)throw _[1];return _[1]},trys:[],ops:[]},y,w,_,C;return C={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function E(I){return function($){return T([I,$])}}function T(I){if(y)throw TypeError("Generator is already executing.");for(;p;)try{if(y=1,w&&(_=I[0]&2?w.return:I[0]?w.throw||((_=w.return)&&_.call(w),0):w.next)&&!(_=_.call(w,I[1])).done)return _;switch(w=0,_&&(I=[I[0]&2,_.value]),I[0]){case 0:case 1:_=I;break;case 4:return p.label++,{value:I[1],done:!1};case 5:p.label++,w=I[1],I=[0];continue;case 7:I=p.ops.pop(),p.trys.pop();continue;default:if(_=p.trys,!(_=_.length>0&&_[_.length-1])&&(I[0]===6||I[0]===2)){p=0;continue}if(I[0]===3&&(!_||I[1]>_[0]&&I[1]<_[3])){p.label=I[1];break}if(I[0]===6&&p.label<_[1]){p.label=_[1],_=I;break}if(_&&p.label<_[2]){p.label=_[2],p.ops.push(I);break}_[2]&&p.ops.pop(),p.trys.pop();continue}I=f.call(d,p)}catch($){I=[6,$],w=0}finally{y=_=0}if(I[0]&5)throw I[1];return{value:I[0]?I[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=Oa(),c=Do();e.default=(function(d){n(f,d);function f(p){var y=d.call(this)||this;return y.messageHandler=function(w){y.transportRequestManager.resolveResponse(JSON.stringify(w.data))},y.uri=p,y.postMessageID="post-message-transport-"+Math.random(),y}return f.prototype.createWindow=function(p){var y=this;return new Promise(function(w,_){var C,E=document.createElement("iframe");E.setAttribute("id",y.postMessageID),E.setAttribute("width","0px"),E.setAttribute("height","0px"),E.setAttribute("style","visiblity:hidden;border:none;outline:none;"),E.addEventListener("load",function(){w(C)}),E.setAttribute("src",p),window.document.body.appendChild(E),C=E.contentWindow})},f.prototype.connect=function(){var p=this,y=/^(http|https):\/\/.*$/;return new Promise(function(w,_){return i(p,void 0,void 0,function(){var C;return o(this,function(E){switch(E.label){case 0:return y.test(this.uri)||_(Error("Bad URI")),C=this,[4,this.createWindow(this.uri)];case 1:return C.frame=E.sent(),window.addEventListener("message",this.messageHandler),w(),[2]}})})})},f.prototype.sendData=function(p,y){return y===void 0&&(y=5e3),i(this,void 0,void 0,function(){var w,_;return o(this,function(C){return w=this.transportRequestManager.addRequest(p,null),_=c.getNotifications(p),this.frame&&(this.frame.postMessage(p.request,"*"),this.transportRequestManager.settlePendingRequest(_)),[2,w]})})},f.prototype.close=function(){var p;(p=document.getElementById(this.postMessageID))==null||p.remove(),window.removeEventListener("message",this.messageHandler)},f})(s.Transport)})),q0=Ee((e=>{var n=e&&e.__awaiter||function(o,s,c,d){function f(p){return p instanceof c?p:new c(function(y){y(p)})}return new(c||(c=Promise))(function(p,y){function w(E){try{C(d.next(E))}catch(T){y(T)}}function _(E){try{C(d.throw(E))}catch(T){y(T)}}function C(E){E.done?p(E.value):f(E.value).then(w,_)}C((d=d.apply(o,s||[])).next())})},i=e&&e.__generator||function(o,s){var c={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},d,f,p,y;return y={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function w(C){return function(E){return _([C,E])}}function _(C){if(d)throw TypeError("Generator is already executing.");for(;c;)try{if(d=1,f&&(p=C[0]&2?f.return:C[0]?f.throw||((p=f.return)&&p.call(f),0):f.next)&&!(p=p.call(f,C[1])).done)return p;switch(f=0,p&&(C=[C[0]&2,p.value]),C[0]){case 0:case 1:p=C;break;case 4:return c.label++,{value:C[1],done:!1};case 5:c.label++,f=C[1],C=[0];continue;case 7:C=c.ops.pop(),c.trys.pop();continue;default:if(p=c.trys,!(p=p.length>0&&p[p.length-1])&&(C[0]===6||C[0]===2)){c=0;continue}if(C[0]===3&&(!p||C[1]>p[0]&&C[1]<p[3])){c.label=C[1];break}if(C[0]===6&&c.label<p[1]){c.label=p[1],p=C;break}if(p&&c.label<p[2]){c.label=p[2],c.ops.push(C);break}p[2]&&c.ops.pop(),c.trys.pop();continue}C=s.call(o,c)}catch(E){C=[6,E],f=0}finally{d=p=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 i(this,function(d){switch(d.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:d.sent(),d.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 i(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})()})),jl=Ee((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(y0()).default,e.EventEmitterTransport=n(b0()).default,e.HTTPTransport=n(O0()).default,e.WebSocketTransport=n(N0()).default,e.PostMessageWindowTransport=n(I0()).default,e.PostMessageIframeTransport=n(A0()).default;var i=Ro();Object.defineProperty(e,"JSONRPCError",{enumerable:!0,get:function(){return i.JSONRPCError}});var o=n(q0());e.Client=o.default,e.default=o.default})),Po=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function n(p){return p===!0||p===!1}e.boolean=n;function i(p){return typeof p=="string"||p instanceof String}e.string=i;function o(p){return typeof p=="number"||p instanceof Number}e.number=o;function s(p){return p instanceof Error}e.error=s;function c(p){return typeof p=="function"}e.func=c;function d(p){return Array.isArray(p)}e.array=d;function f(p){return d(p)&&p.every(y=>i(y))}e.stringArray=f})),Ld=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;var n=Po(),i;(function(d){d.ParseError=-32700,d.InvalidRequest=-32600,d.MethodNotFound=-32601,d.InvalidParams=-32602,d.InternalError=-32603,d.jsonrpcReservedErrorRangeStart=-32099,d.serverErrorStart=-32099,d.MessageWriteError=-32099,d.MessageReadError=-32098,d.PendingResponseRejected=-32097,d.ConnectionInactive=-32096,d.ServerNotInitialized=-32002,d.UnknownErrorCode=-32001,d.jsonrpcReservedErrorRangeEnd=-32e3,d.serverErrorEnd=-32e3})(i||(e.ErrorCodes=i={})),e.ResponseError=class gx extends Error{constructor(f,p,y){super(p),this.code=n.number(f)?f:i.UnknownErrorCode,this.data=y,Object.setPrototypeOf(this,gx.prototype)}toJson(){let f={code:this.code,message:this.message};return this.data!==void 0&&(f.data=this.data),f}};var o=class md{constructor(f){this.kind=f}static is(f){return f===md.auto||f===md.byName||f===md.byPosition}toString(){return this.kind}};e.ParameterStructures=o,o.auto=new o("auto"),o.byPosition=new o("byPosition"),o.byName=new o("byName");var s=class{constructor(d,f){this.method=d,this.numberOfParams=f}get parameterStructures(){return o.auto}};e.AbstractMessageSignature=s,e.RequestType0=class extends s{constructor(d){super(d,0)}},e.RequestType=class extends s{constructor(d,f=o.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends s{constructor(d,f=o.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends s{constructor(d){super(d,2)}},e.RequestType3=class extends s{constructor(d){super(d,3)}},e.RequestType4=class extends s{constructor(d){super(d,4)}},e.RequestType5=class extends s{constructor(d){super(d,5)}},e.RequestType6=class extends s{constructor(d){super(d,6)}},e.RequestType7=class extends s{constructor(d){super(d,7)}},e.RequestType8=class extends s{constructor(d){super(d,8)}},e.RequestType9=class extends s{constructor(d){super(d,9)}},e.NotificationType=class extends s{constructor(d,f=o.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends s{constructor(d){super(d,0)}},e.NotificationType1=class extends s{constructor(d,f=o.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends s{constructor(d){super(d,2)}},e.NotificationType3=class extends s{constructor(d){super(d,3)}},e.NotificationType4=class extends s{constructor(d){super(d,4)}},e.NotificationType5=class extends s{constructor(d){super(d,5)}},e.NotificationType6=class extends s{constructor(d){super(d,6)}},e.NotificationType7=class extends s{constructor(d){super(d,7)}},e.NotificationType8=class extends s{constructor(d){super(d,8)}},e.NotificationType9=class extends s{constructor(d){super(d,9)}};var c;(function(d){function f(w){let _=w;return _&&n.string(_.method)&&(n.string(_.id)||n.number(_.id))}d.isRequest=f;function p(w){let _=w;return _&&n.string(_.method)&&w.id===void 0}d.isNotification=p;function y(w){let _=w;return _&&(_.result!==void 0||!!_.error)&&(n.string(_.id)||n.number(_.id)||_.id===null)}d.isResponse=y})(c||(e.Message=c={}))})),Nd=Ee((e=>{var n;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var i;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.Last})(i||(e.Touch=i={}));var o=class{constructor(){this[n]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var s;return(s=this._head)==null?void 0:s.value}get last(){var s;return(s=this._tail)==null?void 0:s.value}has(s){return this._map.has(s)}get(s,c=i.None){let d=this._map.get(s);if(d)return c!==i.None&&this.touch(d,c),d.value}set(s,c,d=i.None){let f=this._map.get(s);if(f)f.value=c,d!==i.None&&this.touch(f,d);else{switch(f={key:s,value:c,next:void 0,previous:void 0},d){case i.None:this.addItemLast(f);break;case i.First:this.addItemFirst(f);break;case i.Last:this.addItemLast(f);break;default:this.addItemLast(f);break}this._map.set(s,f),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){let c=this._map.get(s);if(c)return this._map.delete(s),this.removeItem(c),this._size--,c.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error("Invalid list");let s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,c){let d=this._state,f=this._head;for(;f;){if(c?s.bind(c)(f.value,f.key,this):s(f.value,f.key,this),this._state!==d)throw Error("LinkedMap got modified during iteration.");f=f.next}}keys(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let f={value:c.key,done:!1};return c=c.next,f}else return{value:void 0,done:!0}}};return d}values(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let f={value:c.value,done:!1};return c=c.next,f}else return{value:void 0,done:!0}}};return d}entries(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let f={value:[c.key,c.value],done:!1};return c=c.next,f}else return{value:void 0,done:!0}}};return d}[(n=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let c=this._head,d=this.size;for(;c&&d>s;)this._map.delete(c.key),c=c.next,d--;this._head=c,this._size=d,c&&(c.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{let c=s.next,d=s.previous;if(!c||!d)throw Error("Invalid list");c.previous=d,d.next=c}s.next=void 0,s.previous=void 0,this._state++}touch(s,c){if(!this._head||!this._tail)throw Error("Invalid list");if(!(c!==i.First&&c!==i.Last)){if(c===i.First){if(s===this._head)return;let d=s.next,f=s.previous;s===this._tail?(f.next=void 0,this._tail=f):(d.previous=f,f.next=d),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(c===i.Last){if(s===this._tail)return;let d=s.next,f=s.previous;s===this._head?(d.previous=void 0,this._head=d):(d.previous=f,f.next=d),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){let s=[];return this.forEach((c,d)=>{s.push([d,c])}),s}fromJSON(s){this.clear();for(let[c,d]of s)this.set(c,d)}};e.LinkedMap=o,e.LRUCache=class extends o{constructor(s,c=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,c),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,c=i.AsNew){return super.get(s,c)}peek(s){return super.get(s,i.None)}set(s,c){return super.set(s,c,i.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}})),j0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var n;(function(i){function o(s){return{dispose:s}}i.create=o})(n||(e.Disposable=n={}))})),Ji=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n;function i(){if(n===void 0)throw Error("No runtime abstraction layer installed");return n}(function(o){function s(c){if(c===void 0)throw Error("No runtime abstraction layer provided");n=c}o.install=s})(i||(i={})),e.default=i})),Mo=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var n=Ji(),i;(function(c){let d={dispose(){}};c.None=function(){return d}})(i||(e.Event=i={}));var o=class{add(c,d=null,f){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(c),this._contexts.push(d),Array.isArray(f)&&f.push({dispose:()=>this.remove(c,d)})}remove(c,d=null){if(!this._callbacks)return;let f=!1;for(let p=0,y=this._callbacks.length;p<y;p++)if(this._callbacks[p]===c)if(this._contexts[p]===d){this._callbacks.splice(p,1),this._contexts.splice(p,1);return}else f=!0;if(f)throw Error("When adding a listener with a context, you should remove it with the same context")}invoke(...c){if(!this._callbacks)return[];let d=[],f=this._callbacks.slice(0),p=this._contexts.slice(0);for(let y=0,w=f.length;y<w;y++)try{d.push(f[y].apply(p[y],c))}catch(_){(0,n.default)().console.error(_)}return d}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},s=class yx{constructor(d){this._options=d}get event(){return this._event||(this._event=(d,f,p)=>{this._callbacks||(this._callbacks=new o),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(d,f);let y={dispose:()=>{this._callbacks&&(this._callbacks.remove(d,f),y.dispose=yx._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(p)&&p.push(y),y}),this._event}fire(d){this._callbacks&&this._callbacks.invoke.call(this._callbacks,d)}dispose(){this._callbacks&&(this._callbacks=(this._callbacks.dispose(),void 0))}};e.Emitter=s,s._noop=function(){}})),Yl=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var n=Ji(),i=Po(),o=Mo(),s;(function(f){f.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:o.Event.None}),f.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:o.Event.None});function p(y){let w=y;return w&&(w===f.None||w===f.Cancelled||i.boolean(w.isCancellationRequested)&&!!w.onCancellationRequested)}f.is=p})(s||(e.CancellationToken=s={}));var c=Object.freeze(function(f,p){let y=(0,n.default)().timer.setTimeout(f.bind(p),0);return{dispose(){y.dispose()}}}),d=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?c:(this._emitter||(this._emitter=new o.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter=(this._emitter.dispose(),void 0))}};e.CancellationTokenSource=class{get token(){return this._token||(this._token=new d),this._token}cancel(){this._token?this._token.cancel():this._token=s.Cancelled}dispose(){this._token?this._token instanceof d&&this._token.dispose():this._token=s.None}}})),z0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var n=Yl(),i;(function(c){c.Continue=0,c.Cancelled=1})(i||(i={})),e.SharedArraySenderStrategy=class{constructor(){this.buffers=new Map}enableCancellation(c){if(c.id===null)return;let d=new SharedArrayBuffer(4),f=new Int32Array(d,0,1);f[0]=i.Continue,this.buffers.set(c.id,d),c.$cancellationData=d}async sendCancellation(c,d){let f=this.buffers.get(d);if(f===void 0)return;let p=new Int32Array(f,0,1);Atomics.store(p,0,i.Cancelled)}cleanup(c){this.buffers.delete(c)}dispose(){this.buffers.clear()}};var o=class{constructor(c){this.data=new Int32Array(c,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===i.Cancelled}get onCancellationRequested(){throw Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},s=class{constructor(c){this.token=new o(c)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{constructor(){this.kind="request"}createCancellationTokenSource(c){let d=c.$cancellationData;return d===void 0?new n.CancellationTokenSource:new s(d)}}})),Id=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var n=Ji();e.Semaphore=class{constructor(i=1){if(i<=0)throw Error("Capacity must be greater than 0");this._capacity=i,this._active=0,this._waiting=[]}lock(i){return new Promise((o,s)=>{this._waiting.push({thunk:i,resolve:o,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,n.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let i=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error("To many thunks active");try{let o=i.thunk();o instanceof Promise?o.then(s=>{this._active--,i.resolve(s),this.runNext()},s=>{this._active--,i.reject(s),this.runNext()}):(this._active--,i.resolve(o),this.runNext())}catch(o){this._active--,i.reject(o),this.runNext()}}}})),F0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var n=Ji(),i=Po(),o=Mo(),s=Id(),c;(function(p){function y(w){let _=w;return _&&i.func(_.listen)&&i.func(_.dispose)&&i.func(_.onError)&&i.func(_.onClose)&&i.func(_.onPartialMessage)}p.is=y})(c||(e.MessageReader=c={}));var d=class{constructor(){this.errorEmitter=new o.Emitter,this.closeEmitter=new o.Emitter,this.partialMessageEmitter=new o.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(p){this.errorEmitter.fire(this.asError(p))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(p){this.partialMessageEmitter.fire(p)}asError(p){return p instanceof Error?p:Error(`Reader received error. Reason: ${i.string(p.message)?p.message:"unknown"}`)}};e.AbstractMessageReader=d;var f;(function(p){function y(w){let _,C,E=new Map,T,I=new Map;if(w===void 0||typeof w=="string")_=w??"utf-8";else{if(_=w.charset??"utf-8",w.contentDecoder!==void 0&&(C=w.contentDecoder,E.set(C.name,C)),w.contentDecoders!==void 0)for(let $ of w.contentDecoders)E.set($.name,$);if(w.contentTypeDecoder!==void 0&&(T=w.contentTypeDecoder,I.set(T.name,T)),w.contentTypeDecoders!==void 0)for(let $ of w.contentTypeDecoders)I.set($.name,$)}return T===void 0&&(T=(0,n.default)().applicationJson.decoder,I.set(T.name,T)),{charset:_,contentDecoder:C,contentDecoders:E,contentTypeDecoder:T,contentTypeDecoders:I}}p.fromOptions=y})(f||(f={})),e.ReadableStreamMessageReader=class extends d{constructor(p,y){super(),this.readable=p,this.options=f.fromOptions(y),this.buffer=(0,n.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new s.Semaphore(1)}set partialMessageTimeout(p){this._partialMessageTimeout=p}get partialMessageTimeout(){return this._partialMessageTimeout}listen(p){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=p;let y=this.readable.onData(w=>{this.onData(w)});return this.readable.onError(w=>this.fireError(w)),this.readable.onClose(()=>this.fireClose()),y}onData(p){try{for(this.buffer.append(p);;){if(this.nextMessageLength===-1){let w=this.buffer.tryReadHeaders(!0);if(!w)return;let _=w.get("content-length");if(!_){this.fireError(Error(`Header must provide a Content-Length property.
17
+ ${JSON.stringify(Object.fromEntries(w))}`));return}let C=parseInt(_);if(isNaN(C)){this.fireError(Error(`Content-Length value must be a number. Got ${_}`));return}this.nextMessageLength=C}let y=this.buffer.tryReadBody(this.nextMessageLength);if(y===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let w=this.options.contentDecoder===void 0?y:await this.options.contentDecoder.decode(y),_=await this.options.contentTypeDecoder.decode(w,this.options);this.callback(_)}).catch(w=>{this.fireError(w)})}}catch(y){this.fireError(y)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer=(this.partialMessageTimer.dispose(),void 0))}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,n.default)().timer.setTimeout((p,y)=>{this.partialMessageTimer=void 0,p===this.messageToken&&(this.firePartialMessage({messageToken:p,waitingTime:y}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}})),B0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var n=Ji(),i=Po(),o=Id(),s=Mo(),c="Content-Length: ",d=`\r
18
+ `,f;(function(w){function _(C){let E=C;return E&&i.func(E.dispose)&&i.func(E.onClose)&&i.func(E.onError)&&i.func(E.write)}w.is=_})(f||(e.MessageWriter=f={}));var p=class{constructor(){this.errorEmitter=new s.Emitter,this.closeEmitter=new s.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(w,_,C){this.errorEmitter.fire([this.asError(w),_,C])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(w){return w instanceof Error?w:Error(`Writer received error. Reason: ${i.string(w.message)?w.message:"unknown"}`)}};e.AbstractMessageWriter=p;var y;(function(w){function _(C){return C===void 0||typeof C=="string"?{charset:C??"utf-8",contentTypeEncoder:(0,n.default)().applicationJson.encoder}:{charset:C.charset??"utf-8",contentEncoder:C.contentEncoder,contentTypeEncoder:C.contentTypeEncoder??(0,n.default)().applicationJson.encoder}}w.fromOptions=_})(y||(y={})),e.WriteableStreamMessageWriter=class extends p{constructor(w,_){super(),this.writable=w,this.options=y.fromOptions(_),this.errorCount=0,this.writeSemaphore=new o.Semaphore(1),this.writable.onError(C=>this.fireError(C)),this.writable.onClose(()=>this.fireClose())}async write(w){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(w,this.options).then(_=>this.options.contentEncoder===void 0?_:this.options.contentEncoder.encode(_)).then(_=>{let C=[];return C.push(c,_.byteLength.toString(),d),C.push(d),this.doWrite(w,C,_)},_=>{throw this.fireError(_),_}))}async doWrite(w,_,C){try{return await this.writable.write(_.join(""),"ascii"),this.writable.write(C)}catch(E){return this.handleError(E,w),Promise.reject(E)}}handleError(w,_){this.errorCount++,this.fireError(w,_,this.errorCount)}end(){this.writable.end()}}})),H0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0;var n=13,i=10,o=`\r
19
19
  `;e.AbstractMessageBuffer=class{constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){let c=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(c),this._totalLength+=c.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let c=0,d=0,f=0,p=0;e:for(;d<this._chunks.length;){let C=this._chunks[d];for(f=0;f<C.length;){switch(C[f]){case n:switch(c){case 0:c=1;break;case 2:c=3;break;default:c=0}break;case i:switch(c){case 1:c=2;break;case 3:c=4,f++;break e;default:c=0}break;default:c=0}f++}p+=C.byteLength,d++}if(c!==4)return;let y=this._read(p+f),w=new Map,_=this.toString(y,"ascii").split(o);if(_.length<2)return w;for(let C=0;C<_.length-2;C++){let E=_[C],T=E.indexOf(":");if(T===-1)throw Error(`Message header must separate key and value using ':'
20
- ${E}`);let I=E.substr(0,T),$=E.substr(T+1).trim();w.set(s?I.toLowerCase():I,$)}return w}tryReadBody(s){if(!(this._totalLength<s))return this._read(s)}get numberOfBytes(){return this._totalLength}_read(s){if(s===0)return this.emptyBuffer();if(s>this._totalLength)throw Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){let f=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(f)}if(this._chunks[0].byteLength>s){let f=this._chunks[0],p=this.asNative(f,s);return this._chunks[0]=f.slice(s),this._totalLength-=s,p}let c=this.allocNative(s),d=0;for(;s>0;){let f=this._chunks[0];if(f.byteLength>s){let p=f.slice(0,s);c.set(p,d),d+=s,this._chunks[0]=f.slice(s),this._totalLength-=s,s-=s}else c.set(f,d),d+=f.byteLength,this._chunks.shift(),this._totalLength-=f.byteLength,s-=f.byteLength}return c}}})),V0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;var n=Ji(),i=Po(),o=Ld(),s=Nd(),c=Mo(),d=Zl(),f;(function(J){J.type=new o.NotificationType("$/cancelRequest")})(f||(f={}));var p;(function(J){function be(Se){return typeof Se=="string"||typeof Se=="number"}J.is=be})(p||(e.ProgressToken=p={}));var y;(function(J){J.type=new o.NotificationType("$/progress")})(y||(y={})),e.ProgressType=class{constructor(){}};var w;(function(J){function be(Se){return i.func(Se)}J.is=be})(w||(w={})),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var _;(function(J){J[J.Off=0]="Off",J[J.Messages=1]="Messages",J[J.Compact=2]="Compact",J[J.Verbose=3]="Verbose"})(_||(e.Trace=_={}));var C;(function(J){J.Off="off",J.Messages="messages",J.Compact="compact",J.Verbose="verbose"})(C||(e.TraceValues=C={})),(function(J){function be(Z){if(!i.string(Z))return J.Off;switch(Z=Z.toLowerCase(),Z){case"off":return J.Off;case"messages":return J.Messages;case"compact":return J.Compact;case"verbose":return J.Verbose;default:return J.Off}}J.fromString=be;function Se(Z){switch(Z){case J.Off:return"off";case J.Messages:return"messages";case J.Compact:return"compact";case J.Verbose:return"verbose";default:return"off"}}J.toString=Se})(_||(e.Trace=_={}));var E;(function(J){J.Text="text",J.JSON="json"})(E||(e.TraceFormat=E={})),(function(J){function be(Se){return i.string(Se)?(Se=Se.toLowerCase(),Se==="json"?J.JSON:J.Text):J.Text}J.fromString=be})(E||(e.TraceFormat=E={}));var T;(function(J){J.type=new o.NotificationType("$/setTrace")})(T||(e.SetTraceNotification=T={}));var I;(function(J){J.type=new o.NotificationType("$/logTrace")})(I||(e.LogTraceNotification=I={}));var $;(function(J){J[J.Closed=1]="Closed",J[J.Disposed=2]="Disposed",J[J.AlreadyListening=3]="AlreadyListening"})($||(e.ConnectionErrors=$={}));var V=class vx extends Error{constructor(be,Se){super(Se),this.code=be,Object.setPrototypeOf(this,vx.prototype)}};e.ConnectionError=V;var F;(function(J){function be(Se){let Z=Se;return Z&&i.func(Z.cancelUndispatched)}J.is=be})(F||(e.ConnectionStrategy=F={}));var N;(function(J){function be(Se){let Z=Se;return Z&&(Z.kind===void 0||Z.kind==="id")&&i.func(Z.createCancellationTokenSource)&&(Z.dispose===void 0||i.func(Z.dispose))}J.is=be})(N||(e.IdCancellationReceiverStrategy=N={}));var K;(function(J){function be(Se){let Z=Se;return Z&&Z.kind==="request"&&i.func(Z.createCancellationTokenSource)&&(Z.dispose===void 0||i.func(Z.dispose))}J.is=be})(K||(e.RequestCancellationReceiverStrategy=K={}));var pe;(function(J){J.Message=Object.freeze({createCancellationTokenSource(Se){return new d.CancellationTokenSource}});function be(Se){return N.is(Se)||K.is(Se)}J.is=be})(pe||(e.CancellationReceiverStrategy=pe={}));var P;(function(J){J.Message=Object.freeze({sendCancellation(Se,Z){return Se.sendNotification(f.type,{id:Z})},cleanup(Se){}});function be(Se){let Z=Se;return Z&&i.func(Z.sendCancellation)&&i.func(Z.cleanup)}J.is=be})(P||(e.CancellationSenderStrategy=P={}));var A;(function(J){J.Message=Object.freeze({receiver:pe.Message,sender:P.Message});function be(Se){let Z=Se;return Z&&pe.is(Z.receiver)&&P.is(Z.sender)}J.is=be})(A||(e.CancellationStrategy=A={}));var W;(function(J){function be(Se){let Z=Se;return Z&&i.func(Z.handleMessage)}J.is=be})(W||(e.MessageStrategy=W={}));var de;(function(J){function be(Se){let Z=Se;return Z&&(A.is(Z.cancellationStrategy)||F.is(Z.connectionStrategy)||W.is(Z.messageStrategy))}J.is=be})(de||(e.ConnectionOptions=de={}));var fe;(function(J){J[J.New=1]="New",J[J.Listening=2]="Listening",J[J.Closed=3]="Closed",J[J.Disposed=4]="Disposed"})(fe||(fe={}));function we(J,be,Se,Z){let re=Se===void 0?e.NullLogger:Se,se=0,Q=0,Le=0,Fe,et=new Map,Be,je=new Map,Pe=new Map,Ae,ft=new s.LinkedMap,mt=new Map,Dn=new Set,un=new Map,We=_.Off,tn=E.Text,wt,vn=fe.New,vr=new c.Emitter,pt=new c.Emitter,Fr=new c.Emitter,nn=new c.Emitter,mi=new c.Emitter,On=Z&&Z.cancellationStrategy?Z.cancellationStrategy:A.Message;function br(j){if(j===null)throw Error("Can't send requests with id null since the response can't be correlated.");return"req-"+j.toString()}function Pn(j){return j===null?"res-unknown-"+(++Le).toString():"res-"+j.toString()}function dn(){return"not-"+(++Q).toString()}function ta(j,te){o.Message.isRequest(te)?j.set(br(te.id),te):o.Message.isResponse(te)?j.set(Pn(te.id),te):j.set(dn(),te)}function gi(j){}function Ut(){return vn===fe.Listening}function yi(){return vn===fe.Closed}function fn(){return vn===fe.Disposed}function ni(){(vn===fe.New||vn===fe.Listening)&&(vn=fe.Closed,pt.fire(void 0))}function zt(j){vr.fire([j,void 0,void 0])}function Br(j){vr.fire(j)}J.onClose(ni),J.onError(zt),be.onClose(ni),be.onError(Br);function _t(){Ae||ft.size===0||(Ae=(0,n.default)().timer.setImmediate(()=>{Ae=void 0,na()}))}function vi(j){o.Message.isRequest(j)?Jt(j):o.Message.isNotification(j)?gt(j):o.Message.isResponse(j)?Ge(j):xt(j)}function na(){if(ft.size===0)return;let j=ft.shift();try{let te=Z==null?void 0:Z.messageStrategy;W.is(te)?te.handleMessage(j,vi):vi(j)}finally{_t()}}let wr=j=>{try{if(o.Message.isNotification(j)&&j.method===f.type.method){let te=j.params.id,ve=br(te),Te=ft.get(ve);if(o.Message.isRequest(Te)){let Ve=Z==null?void 0:Z.connectionStrategy,ot=Ve&&Ve.cancelUndispatched?Ve.cancelUndispatched(Te,gi):void 0;if(ot&&(ot.error!==void 0||ot.result!==void 0)){ft.delete(ve),un.delete(te),ot.id=Te.id,St(ot,j.method,Date.now()),be.write(ot).catch(()=>re.error("Sending response for canceled message failed."));return}}let He=un.get(te);if(He!==void 0){He.cancel(),Mn(j);return}else Dn.add(te)}ta(ft,j)}finally{_t()}};function Jt(j){if(fn())return;function te(Ze,Lt,rt){let ut={jsonrpc:"2.0",id:j.id};Ze instanceof o.ResponseError?ut.error=Ze.toJson():ut.result=Ze===void 0?null:Ze,St(ut,Lt,rt),be.write(ut).catch(()=>re.error("Sending response failed."))}function ve(Ze,Lt,rt){let ut={jsonrpc:"2.0",id:j.id,error:Ze.toJson()};St(ut,Lt,rt),be.write(ut).catch(()=>re.error("Sending response failed."))}function Te(Ze,Lt,rt){Ze===void 0&&(Ze=null);let ut={jsonrpc:"2.0",id:j.id,result:Ze};St(ut,Lt,rt),be.write(ut).catch(()=>re.error("Sending response failed."))}ir(j);let He=et.get(j.method),Ve,ot;He&&(Ve=He.type,ot=He.handler);let Mt=Date.now();if(ot||Fe){let Ze=j.id??String(Date.now()),Lt=N.is(On.receiver)?On.receiver.createCancellationTokenSource(Ze):On.receiver.createCancellationTokenSource(j);j.id!==null&&Dn.has(j.id)&&Lt.cancel(),j.id!==null&&un.set(Ze,Lt);try{let rt;if(ot)if(j.params===void 0){if(Ve!==void 0&&Ve.numberOfParams!==0){ve(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${j.method} defines ${Ve.numberOfParams} params but received none.`),j.method,Mt);return}rt=ot(Lt.token)}else if(Array.isArray(j.params)){if(Ve!==void 0&&Ve.parameterStructures===o.ParameterStructures.byName){ve(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${j.method} defines parameters by name but received parameters by position`),j.method,Mt);return}rt=ot(...j.params,Lt.token)}else{if(Ve!==void 0&&Ve.parameterStructures===o.ParameterStructures.byPosition){ve(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${j.method} defines parameters by position but received parameters by name`),j.method,Mt);return}rt=ot(j.params,Lt.token)}else Fe&&(rt=Fe(j.method,j.params,Lt.token));let ut=rt;rt?ut.then?ut.then(wn=>{un.delete(Ze),te(wn,j.method,Mt)},wn=>{un.delete(Ze),wn instanceof o.ResponseError?ve(wn,j.method,Mt):wn&&i.string(wn.message)?ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed with message: ${wn.message}`),j.method,Mt):ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed unexpectedly without providing any details.`),j.method,Mt)}):(un.delete(Ze),te(rt,j.method,Mt)):(un.delete(Ze),Te(rt,j.method,Mt))}catch(rt){un.delete(Ze),rt instanceof o.ResponseError?te(rt,j.method,Mt):rt&&i.string(rt.message)?ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed with message: ${rt.message}`),j.method,Mt):ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed unexpectedly without providing any details.`),j.method,Mt)}}else ve(new o.ResponseError(o.ErrorCodes.MethodNotFound,`Unhandled method ${j.method}`),j.method,Mt)}function Ge(j){if(!fn())if(j.id===null)j.error?re.error(`Received response message without id: Error is:
20
+ ${E}`);let I=E.substr(0,T),$=E.substr(T+1).trim();w.set(s?I.toLowerCase():I,$)}return w}tryReadBody(s){if(!(this._totalLength<s))return this._read(s)}get numberOfBytes(){return this._totalLength}_read(s){if(s===0)return this.emptyBuffer();if(s>this._totalLength)throw Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){let f=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(f)}if(this._chunks[0].byteLength>s){let f=this._chunks[0],p=this.asNative(f,s);return this._chunks[0]=f.slice(s),this._totalLength-=s,p}let c=this.allocNative(s),d=0;for(;s>0;){let f=this._chunks[0];if(f.byteLength>s){let p=f.slice(0,s);c.set(p,d),d+=s,this._chunks[0]=f.slice(s),this._totalLength-=s,s-=s}else c.set(f,d),d+=f.byteLength,this._chunks.shift(),this._totalLength-=f.byteLength,s-=f.byteLength}return c}}})),V0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;var n=Ji(),i=Po(),o=Ld(),s=Nd(),c=Mo(),d=Yl(),f;(function(J){J.type=new o.NotificationType("$/cancelRequest")})(f||(f={}));var p;(function(J){function be(Ce){return typeof Ce=="string"||typeof Ce=="number"}J.is=be})(p||(e.ProgressToken=p={}));var y;(function(J){J.type=new o.NotificationType("$/progress")})(y||(y={})),e.ProgressType=class{constructor(){}};var w;(function(J){function be(Ce){return i.func(Ce)}J.is=be})(w||(w={})),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var _;(function(J){J[J.Off=0]="Off",J[J.Messages=1]="Messages",J[J.Compact=2]="Compact",J[J.Verbose=3]="Verbose"})(_||(e.Trace=_={}));var C;(function(J){J.Off="off",J.Messages="messages",J.Compact="compact",J.Verbose="verbose"})(C||(e.TraceValues=C={})),(function(J){function be(Z){if(!i.string(Z))return J.Off;switch(Z=Z.toLowerCase(),Z){case"off":return J.Off;case"messages":return J.Messages;case"compact":return J.Compact;case"verbose":return J.Verbose;default:return J.Off}}J.fromString=be;function Ce(Z){switch(Z){case J.Off:return"off";case J.Messages:return"messages";case J.Compact:return"compact";case J.Verbose:return"verbose";default:return"off"}}J.toString=Ce})(_||(e.Trace=_={}));var E;(function(J){J.Text="text",J.JSON="json"})(E||(e.TraceFormat=E={})),(function(J){function be(Ce){return i.string(Ce)?(Ce=Ce.toLowerCase(),Ce==="json"?J.JSON:J.Text):J.Text}J.fromString=be})(E||(e.TraceFormat=E={}));var T;(function(J){J.type=new o.NotificationType("$/setTrace")})(T||(e.SetTraceNotification=T={}));var I;(function(J){J.type=new o.NotificationType("$/logTrace")})(I||(e.LogTraceNotification=I={}));var $;(function(J){J[J.Closed=1]="Closed",J[J.Disposed=2]="Disposed",J[J.AlreadyListening=3]="AlreadyListening"})($||(e.ConnectionErrors=$={}));var V=class vx extends Error{constructor(be,Ce){super(Ce),this.code=be,Object.setPrototypeOf(this,vx.prototype)}};e.ConnectionError=V;var F;(function(J){function be(Ce){let Z=Ce;return Z&&i.func(Z.cancelUndispatched)}J.is=be})(F||(e.ConnectionStrategy=F={}));var N;(function(J){function be(Ce){let Z=Ce;return Z&&(Z.kind===void 0||Z.kind==="id")&&i.func(Z.createCancellationTokenSource)&&(Z.dispose===void 0||i.func(Z.dispose))}J.is=be})(N||(e.IdCancellationReceiverStrategy=N={}));var K;(function(J){function be(Ce){let Z=Ce;return Z&&Z.kind==="request"&&i.func(Z.createCancellationTokenSource)&&(Z.dispose===void 0||i.func(Z.dispose))}J.is=be})(K||(e.RequestCancellationReceiverStrategy=K={}));var pe;(function(J){J.Message=Object.freeze({createCancellationTokenSource(Ce){return new d.CancellationTokenSource}});function be(Ce){return N.is(Ce)||K.is(Ce)}J.is=be})(pe||(e.CancellationReceiverStrategy=pe={}));var P;(function(J){J.Message=Object.freeze({sendCancellation(Ce,Z){return Ce.sendNotification(f.type,{id:Z})},cleanup(Ce){}});function be(Ce){let Z=Ce;return Z&&i.func(Z.sendCancellation)&&i.func(Z.cleanup)}J.is=be})(P||(e.CancellationSenderStrategy=P={}));var A;(function(J){J.Message=Object.freeze({receiver:pe.Message,sender:P.Message});function be(Ce){let Z=Ce;return Z&&pe.is(Z.receiver)&&P.is(Z.sender)}J.is=be})(A||(e.CancellationStrategy=A={}));var W;(function(J){function be(Ce){let Z=Ce;return Z&&i.func(Z.handleMessage)}J.is=be})(W||(e.MessageStrategy=W={}));var de;(function(J){function be(Ce){let Z=Ce;return Z&&(A.is(Z.cancellationStrategy)||F.is(Z.connectionStrategy)||W.is(Z.messageStrategy))}J.is=be})(de||(e.ConnectionOptions=de={}));var fe;(function(J){J[J.New=1]="New",J[J.Listening=2]="Listening",J[J.Closed=3]="Closed",J[J.Disposed=4]="Disposed"})(fe||(fe={}));function we(J,be,Ce,Z){let re=Ce===void 0?e.NullLogger:Ce,se=0,Q=0,Le=0,Fe,et=new Map,Be,je=new Map,Pe=new Map,Ae,ft=new s.LinkedMap,mt=new Map,Dn=new Set,un=new Map,We=_.Off,tn=E.Text,wt,vn=fe.New,vr=new c.Emitter,pt=new c.Emitter,Fr=new c.Emitter,nn=new c.Emitter,mi=new c.Emitter,On=Z&&Z.cancellationStrategy?Z.cancellationStrategy:A.Message;function br(j){if(j===null)throw Error("Can't send requests with id null since the response can't be correlated.");return"req-"+j.toString()}function Pn(j){return j===null?"res-unknown-"+(++Le).toString():"res-"+j.toString()}function dn(){return"not-"+(++Q).toString()}function ta(j,te){o.Message.isRequest(te)?j.set(br(te.id),te):o.Message.isResponse(te)?j.set(Pn(te.id),te):j.set(dn(),te)}function gi(j){}function Ut(){return vn===fe.Listening}function yi(){return vn===fe.Closed}function fn(){return vn===fe.Disposed}function ni(){(vn===fe.New||vn===fe.Listening)&&(vn=fe.Closed,pt.fire(void 0))}function zt(j){vr.fire([j,void 0,void 0])}function Br(j){vr.fire(j)}J.onClose(ni),J.onError(zt),be.onClose(ni),be.onError(Br);function _t(){Ae||ft.size===0||(Ae=(0,n.default)().timer.setImmediate(()=>{Ae=void 0,na()}))}function vi(j){o.Message.isRequest(j)?Jt(j):o.Message.isNotification(j)?gt(j):o.Message.isResponse(j)?Ge(j):xt(j)}function na(){if(ft.size===0)return;let j=ft.shift();try{let te=Z==null?void 0:Z.messageStrategy;W.is(te)?te.handleMessage(j,vi):vi(j)}finally{_t()}}let wr=j=>{try{if(o.Message.isNotification(j)&&j.method===f.type.method){let te=j.params.id,ve=br(te),Te=ft.get(ve);if(o.Message.isRequest(Te)){let Ve=Z==null?void 0:Z.connectionStrategy,ot=Ve&&Ve.cancelUndispatched?Ve.cancelUndispatched(Te,gi):void 0;if(ot&&(ot.error!==void 0||ot.result!==void 0)){ft.delete(ve),un.delete(te),ot.id=Te.id,St(ot,j.method,Date.now()),be.write(ot).catch(()=>re.error("Sending response for canceled message failed."));return}}let He=un.get(te);if(He!==void 0){He.cancel(),Mn(j);return}else Dn.add(te)}ta(ft,j)}finally{_t()}};function Jt(j){if(fn())return;function te(Ze,Lt,rt){let ut={jsonrpc:"2.0",id:j.id};Ze instanceof o.ResponseError?ut.error=Ze.toJson():ut.result=Ze===void 0?null:Ze,St(ut,Lt,rt),be.write(ut).catch(()=>re.error("Sending response failed."))}function ve(Ze,Lt,rt){let ut={jsonrpc:"2.0",id:j.id,error:Ze.toJson()};St(ut,Lt,rt),be.write(ut).catch(()=>re.error("Sending response failed."))}function Te(Ze,Lt,rt){Ze===void 0&&(Ze=null);let ut={jsonrpc:"2.0",id:j.id,result:Ze};St(ut,Lt,rt),be.write(ut).catch(()=>re.error("Sending response failed."))}ir(j);let He=et.get(j.method),Ve,ot;He&&(Ve=He.type,ot=He.handler);let Mt=Date.now();if(ot||Fe){let Ze=j.id??String(Date.now()),Lt=N.is(On.receiver)?On.receiver.createCancellationTokenSource(Ze):On.receiver.createCancellationTokenSource(j);j.id!==null&&Dn.has(j.id)&&Lt.cancel(),j.id!==null&&un.set(Ze,Lt);try{let rt;if(ot)if(j.params===void 0){if(Ve!==void 0&&Ve.numberOfParams!==0){ve(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${j.method} defines ${Ve.numberOfParams} params but received none.`),j.method,Mt);return}rt=ot(Lt.token)}else if(Array.isArray(j.params)){if(Ve!==void 0&&Ve.parameterStructures===o.ParameterStructures.byName){ve(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${j.method} defines parameters by name but received parameters by position`),j.method,Mt);return}rt=ot(...j.params,Lt.token)}else{if(Ve!==void 0&&Ve.parameterStructures===o.ParameterStructures.byPosition){ve(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${j.method} defines parameters by position but received parameters by name`),j.method,Mt);return}rt=ot(j.params,Lt.token)}else Fe&&(rt=Fe(j.method,j.params,Lt.token));let ut=rt;rt?ut.then?ut.then(wn=>{un.delete(Ze),te(wn,j.method,Mt)},wn=>{un.delete(Ze),wn instanceof o.ResponseError?ve(wn,j.method,Mt):wn&&i.string(wn.message)?ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed with message: ${wn.message}`),j.method,Mt):ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed unexpectedly without providing any details.`),j.method,Mt)}):(un.delete(Ze),te(rt,j.method,Mt)):(un.delete(Ze),Te(rt,j.method,Mt))}catch(rt){un.delete(Ze),rt instanceof o.ResponseError?te(rt,j.method,Mt):rt&&i.string(rt.message)?ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed with message: ${rt.message}`),j.method,Mt):ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed unexpectedly without providing any details.`),j.method,Mt)}}else ve(new o.ResponseError(o.ErrorCodes.MethodNotFound,`Unhandled method ${j.method}`),j.method,Mt)}function Ge(j){if(!fn())if(j.id===null)j.error?re.error(`Received response message without id: Error is:
21
21
  ${JSON.stringify(j.error,void 0,4)}`):re.error("Received response message without id. No further error information provided.");else{let te=j.id,ve=mt.get(te);if(Hr(j,ve),ve!==void 0){mt.delete(te);try{if(j.error){let Te=j.error;ve.reject(new o.ResponseError(Te.code,Te.message,Te.data))}else if(j.result!==void 0)ve.resolve(j.result);else throw Error("Should never happen.")}catch(Te){Te.message?re.error(`Response handler '${ve.method}' failed with message: ${Te.message}`):re.error(`Response handler '${ve.method}' failed unexpectedly.`)}}}}function gt(j){if(fn())return;let te,ve;if(j.method===f.type.method){let Te=j.params.id;Dn.delete(Te),Mn(j);return}else{let Te=je.get(j.method);Te&&(ve=Te.handler,te=Te.type)}if(ve||Be)try{if(Mn(j),ve)if(j.params===void 0)te!==void 0&&te.numberOfParams!==0&&te.parameterStructures!==o.ParameterStructures.byName&&re.error(`Notification ${j.method} defines ${te.numberOfParams} params but received none.`),ve();else if(Array.isArray(j.params)){let Te=j.params;j.method===y.type.method&&Te.length===2&&p.is(Te[0])?ve({token:Te[0],value:Te[1]}):(te!==void 0&&(te.parameterStructures===o.ParameterStructures.byName&&re.error(`Notification ${j.method} defines parameters by name but received parameters by position`),te.numberOfParams!==j.params.length&&re.error(`Notification ${j.method} defines ${te.numberOfParams} params but received ${Te.length} arguments`)),ve(...Te))}else te!==void 0&&te.parameterStructures===o.ParameterStructures.byPosition&&re.error(`Notification ${j.method} defines parameters by position but received parameters by name`),ve(j.params);else Be&&Be(j.method,j.params)}catch(Te){Te.message?re.error(`Notification handler '${j.method}' failed with message: ${Te.message}`):re.error(`Notification handler '${j.method}' failed unexpectedly.`)}else Fr.fire(j)}function xt(j){if(!j){re.error("Received empty message.");return}re.error(`Received message which is neither a response nor a notification message:
22
- ${JSON.stringify(j,null,4)}`);let te=j;if(i.string(te.id)||i.number(te.id)){let ve=te.id,Te=mt.get(ve);Te&&Te.reject(Error("The received response has neither a result nor an error property."))}}function kt(j){if(j!=null)switch(We){case _.Verbose:return JSON.stringify(j,null,4);case _.Compact:return JSON.stringify(j);default:return}}function jn(j){if(!(We===_.Off||!wt))if(tn===E.Text){let te;(We===_.Verbose||We===_.Compact)&&j.params&&(te=`Params: ${kt(j.params)}
22
+ ${JSON.stringify(j,null,4)}`);let te=j;if(i.string(te.id)||i.number(te.id)){let ve=te.id,Te=mt.get(ve);Te&&Te.reject(Error("The received response has neither a result nor an error property."))}}function kt(j){if(j!=null)switch(We){case _.Verbose:return JSON.stringify(j,null,4);case _.Compact:return JSON.stringify(j);default:return}}function zn(j){if(!(We===_.Off||!wt))if(tn===E.Text){let te;(We===_.Verbose||We===_.Compact)&&j.params&&(te=`Params: ${kt(j.params)}
23
23
 
24
24
  `),wt.log(`Sending request '${j.method} - (${j.id})'.`,te)}else bn("send-request",j)}function _r(j){if(!(We===_.Off||!wt))if(tn===E.Text){let te;(We===_.Verbose||We===_.Compact)&&(te=j.params?`Params: ${kt(j.params)}
25
25
 
@@ -43,7 +43,7 @@ ${JSON.stringify(j,null,4)}`);let te=j;if(i.string(te.id)||i.number(te.id)){let
43
43
 
44
44
  `:j.error===void 0&&(ve=`No result returned.
45
45
 
46
- `)),te){let Te=j.error?` Request failed: ${j.error.message} (${j.error.code}).`:"";wt.log(`Received response '${te.method} - (${j.id})' in ${Date.now()-te.timerStart}ms.${Te}`,ve)}else wt.log(`Received response ${j.id} without active response promise.`,ve)}else bn("receive-response",j)}function bn(j,te){if(!wt||We===_.Off)return;let ve={isLSPMessage:!0,type:j,message:te,timestamp:Date.now()};wt.log(ve)}function ar(){if(yi())throw new V($.Closed,"Connection is closed.");if(fn())throw new V($.Disposed,"Connection is disposed.")}function bi(){if(Ut())throw new V($.AlreadyListening,"Connection is already listening")}function ri(){if(!Ut())throw Error("Call listen() first.")}function Ln(j){return j===void 0?null:j}function wi(j){if(j!==null)return j}function zn(j){return j!=null&&!Array.isArray(j)&&typeof j=="object"}function or(j,te){switch(j){case o.ParameterStructures.auto:return zn(te)?wi(te):[Ln(te)];case o.ParameterStructures.byName:if(!zn(te))throw Error("Received parameters by name but param is not an object literal.");return wi(te);case o.ParameterStructures.byPosition:return[Ln(te)];default:throw Error(`Unknown parameter structure ${j.toString()}`)}}function M(j,te){let ve,Te=j.numberOfParams;switch(Te){case 0:ve=void 0;break;case 1:ve=or(j.parameterStructures,te[0]);break;default:ve=[];for(let He=0;He<te.length&&He<Te;He++)ve.push(Ln(te[He]));if(te.length<Te)for(let He=te.length;He<Te;He++)ve.push(null);break}return ve}let Ye={sendNotification:(j,...te)=>{ar();let ve,Te;if(i.string(j)){ve=j;let Ve=te[0],ot=0,Mt=o.ParameterStructures.auto;o.ParameterStructures.is(Ve)&&(ot=1,Mt=Ve);let Ze=te.length,Lt=Ze-ot;switch(Lt){case 0:Te=void 0;break;case 1:Te=or(Mt,te[ot]);break;default:if(Mt===o.ParameterStructures.byName)throw Error(`Received ${Lt} parameters for 'by Name' notification parameter structure.`);Te=te.slice(ot,Ze).map(rt=>Ln(rt));break}}else{let Ve=te;ve=j.method,Te=M(j,Ve)}let He={jsonrpc:"2.0",method:ve,params:Te};return _r(He),be.write(He).catch(Ve=>{throw re.error("Sending notification failed."),Ve})},onNotification:(j,te)=>{ar();let ve;return i.func(j)?Be=j:te&&(i.string(j)?(ve=j,je.set(j,{type:void 0,handler:te})):(ve=j.method,je.set(j.method,{type:j,handler:te}))),{dispose:()=>{ve===void 0?Be=void 0:je.delete(ve)}}},onProgress:(j,te,ve)=>{if(Pe.has(te))throw Error(`Progress handler for token ${te} already registered`);return Pe.set(te,ve),{dispose:()=>{Pe.delete(te)}}},sendProgress:(j,te,ve)=>Ye.sendNotification(y.type,{token:te,value:ve}),onUnhandledProgress:nn.event,sendRequest:(j,...te)=>{ar(),ri();let ve,Te,He;if(i.string(j)){ve=j;let Ze=te[0],Lt=te[te.length-1],rt=0,ut=o.ParameterStructures.auto;o.ParameterStructures.is(Ze)&&(rt=1,ut=Ze);let wn=te.length;d.CancellationToken.is(Lt)&&(--wn,He=Lt);let sr=wn-rt;switch(sr){case 0:Te=void 0;break;case 1:Te=or(ut,te[rt]);break;default:if(ut===o.ParameterStructures.byName)throw Error(`Received ${sr} parameters for 'by Name' request parameter structure.`);Te=te.slice(rt,wn).map(ii=>Ln(ii));break}}else{let Ze=te;ve=j.method,Te=M(j,Ze);let Lt=j.numberOfParams;He=d.CancellationToken.is(Ze[Lt])?Ze[Lt]:void 0}let Ve=se++,ot;He&&(ot=He.onCancellationRequested(()=>{let Ze=On.sender.sendCancellation(Ye,Ve);return Ze===void 0?(re.log(`Received no promise from cancellation strategy when cancelling id ${Ve}`),Promise.resolve()):Ze.catch(()=>{re.log(`Sending cancellation messages for id ${Ve} failed`)})}));let Mt={jsonrpc:"2.0",id:Ve,method:ve,params:Te};return jn(Mt),typeof On.sender.enableCancellation=="function"&&On.sender.enableCancellation(Mt),new Promise(async(Ze,Lt)=>{let rt={method:ve,timerStart:Date.now(),resolve:ut=>{Ze(ut),On.sender.cleanup(Ve),ot==null||ot.dispose()},reject:ut=>{Lt(ut),On.sender.cleanup(Ve),ot==null||ot.dispose()}};try{await be.write(Mt),mt.set(Ve,rt)}catch(ut){throw re.error("Sending request failed."),rt.reject(new o.ResponseError(o.ErrorCodes.MessageWriteError,ut.message?ut.message:"Unknown reason")),ut}})},onRequest:(j,te)=>{ar();let ve=null;return w.is(j)?(ve=void 0,Fe=j):i.string(j)?(ve=null,te!==void 0&&(ve=j,et.set(j,{handler:te,type:void 0}))):te!==void 0&&(ve=j.method,et.set(j.method,{type:j,handler:te})),{dispose:()=>{ve!==null&&(ve===void 0?Fe=void 0:et.delete(ve))}}},hasPendingResponse:()=>mt.size>0,trace:async(j,te,ve)=>{let Te=!1,He=E.Text;ve!==void 0&&(i.boolean(ve)?Te=ve:(Te=ve.sendNotification||!1,He=ve.traceFormat||E.Text)),We=j,tn=He,wt=We===_.Off?void 0:te,Te&&!yi()&&!fn()&&await Ye.sendNotification(T.type,{value:_.toString(j)})},onError:vr.event,onClose:pt.event,onUnhandledNotification:Fr.event,onDispose:mi.event,end:()=>{be.end()},dispose:()=>{if(fn())return;vn=fe.Disposed,mi.fire(void 0);let j=new o.ResponseError(o.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let te of mt.values())te.reject(j);mt=new Map,un=new Map,Dn=new Set,ft=new s.LinkedMap,i.func(be.dispose)&&be.dispose(),i.func(J.dispose)&&J.dispose()},listen:()=>{ar(),bi(),vn=fe.Listening,J.listen(wr)},inspect:()=>{(0,n.default)().console.log("inspect")}};return Ye.onNotification(I.type,j=>{if(We===_.Off||!wt)return;let te=We===_.Verbose||We===_.Compact;wt.log(j.message,te?j.verbose:void 0)}),Ye.onNotification(y.type,j=>{let te=Pe.get(j.token);te?te(j.value):nn.fire(j)}),Ye}e.createMessageConnection=we})),ec=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;var n=Ld();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return n.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return n.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return n.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return n.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return n.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return n.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return n.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return n.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return n.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return n.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return n.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return n.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return n.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return n.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return n.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return n.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return n.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return n.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return n.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return n.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return n.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return n.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return n.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return n.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return n.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return n.ParameterStructures}});var i=Nd();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return i.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return i.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return i.Touch}});var o=j0();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return o.Disposable}});var s=Mo();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});var c=Zl();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return c.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return c.CancellationToken}});var d=z0();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return d.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return d.SharedArrayReceiverStrategy}});var f=F0();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return f.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return f.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return f.ReadableStreamMessageReader}});var p=B0();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return p.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return p.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return p.WriteableStreamMessageWriter}});var y=H0();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return y.AbstractMessageBuffer}});var w=V0();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return w.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return w.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return w.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return w.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return w.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return w.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return w.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return w.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return w.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return w.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return w.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return w.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return w.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return w.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return w.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return w.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return w.MessageStrategy}}),e.RAL=Ji().default})),$0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=ec(),i=class bx extends n.AbstractMessageBuffer{constructor(y="utf-8"){super(y),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return bx.emptyBuffer}fromString(y,w){return new TextEncoder().encode(y)}toString(y,w){return w==="ascii"?this.asciiDecoder.decode(y):new TextDecoder(w).decode(y)}asNative(y,w){return w===void 0?y:y.slice(0,w)}allocNative(y){return new Uint8Array(y)}};i.emptyBuffer=new Uint8Array;var o=class{constructor(p){this.socket=p,this._onData=new n.Emitter,this._messageListener=y=>{y.data.arrayBuffer().then(w=>{this._onData.fire(new Uint8Array(w))},()=>{(0,n.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(p){return this.socket.addEventListener("close",p),n.Disposable.create(()=>this.socket.removeEventListener("close",p))}onError(p){return this.socket.addEventListener("error",p),n.Disposable.create(()=>this.socket.removeEventListener("error",p))}onEnd(p){return this.socket.addEventListener("end",p),n.Disposable.create(()=>this.socket.removeEventListener("end",p))}onData(p){return this._onData.event(p)}},s=class{constructor(p){this.socket=p}onClose(p){return this.socket.addEventListener("close",p),n.Disposable.create(()=>this.socket.removeEventListener("close",p))}onError(p){return this.socket.addEventListener("error",p),n.Disposable.create(()=>this.socket.removeEventListener("error",p))}onEnd(p){return this.socket.addEventListener("end",p),n.Disposable.create(()=>this.socket.removeEventListener("end",p))}write(p,y){if(typeof p=="string"){if(y!==void 0&&y!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${y}`);this.socket.send(p)}else this.socket.send(p);return Promise.resolve()}end(){this.socket.close()}},c=new TextEncoder,d=Object.freeze({messageBuffer:Object.freeze({create:p=>new i(p)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(p,y)=>{if(y.charset!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${y.charset}`);return Promise.resolve(c.encode(JSON.stringify(p,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(p,y)=>{if(!(p instanceof Uint8Array))throw Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(y.charset).decode(p)))}})}),stream:Object.freeze({asReadableStream:p=>new o(p),asWritableStream:p=>new s(p)}),console,timer:Object.freeze({setTimeout(p,y,...w){let _=setTimeout(p,y,...w);return{dispose:()=>clearTimeout(_)}},setImmediate(p,...y){let w=setTimeout(p,0,...y);return{dispose:()=>clearTimeout(w)}},setInterval(p,y,...w){let _=setInterval(p,y,...w);return{dispose:()=>clearInterval(_)}}})});function f(){return d}(function(p){function y(){n.RAL.install(d)}p.install=y})(f||(f={})),e.default=f})),ja=Ce((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,f,p){p===void 0&&(p=f);var y=Object.getOwnPropertyDescriptor(d,f);(!y||("get"in y?!d.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(c,p,y)}):(function(c,d,f,p){p===void 0&&(p=f),c[p]=d[f]})),i=e&&e.__exportStar||function(c,d){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&n(d,c,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0,$0().default.install();var o=ec();i(ec(),e),e.BrowserMessageReader=class extends o.AbstractMessageReader{constructor(c){super(),this._onData=new o.Emitter,this._messageListener=d=>{this._onData.fire(d.data)},c.addEventListener("error",d=>this.fireError(d)),c.onmessage=this._messageListener}listen(c){return this._onData.event(c)}},e.BrowserMessageWriter=class extends o.AbstractMessageWriter{constructor(c){super(),this.port=c,this.errorCount=0,c.addEventListener("error",d=>this.fireError(d))}write(c){try{return this.port.postMessage(c),Promise.resolve()}catch(d){return this.handleError(d,c),Promise.reject(d)}}handleError(c,d){this.errorCount++,this.fireError(c,d,this.errorCount)}end(){}};function s(c,d,f,p){return f===void 0&&(f=o.NullLogger),o.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,o.createMessageConnection)(c,d,f,p)}e.createMessageConnection=s})),Ad=Ce(((e,n)=>{n.exports=ja()})),Vt=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var n=ja(),i;(function(o){o.clientToServer="clientToServer",o.serverToClient="serverToClient",o.both="both"})(i||(e.MessageDirection=i={})),e.RegistrationType=class{constructor(o){this.method=o}},e.ProtocolRequestType0=class extends n.RequestType0{constructor(o){super(o)}},e.ProtocolRequestType=class extends n.RequestType{constructor(o){super(o,n.ParameterStructures.byName)}},e.ProtocolNotificationType0=class extends n.NotificationType0{constructor(o){super(o)}},e.ProtocolNotificationType=class extends n.NotificationType{constructor(o){super(o,n.ParameterStructures.byName)}}})),tc=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function n(w){return w===!0||w===!1}e.boolean=n;function i(w){return typeof w=="string"||w instanceof String}e.string=i;function o(w){return typeof w=="number"||w instanceof Number}e.number=o;function s(w){return w instanceof Error}e.error=s;function c(w){return typeof w=="function"}e.func=c;function d(w){return Array.isArray(w)}e.array=d;function f(w){return d(w)&&w.every(_=>i(_))}e.stringArray=f;function p(w,_){return Array.isArray(w)&&w.every(_)}e.typedArray=p;function y(w){return typeof w=="object"&&!!w}e.objectLiteral=y})),W0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/implementation",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ImplementationRequest=i={}))})),U0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/typeDefinition",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.TypeDefinitionRequest=i={}))})),K0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var n=Vt(),i;(function(s){s.method="workspace/workspaceFolders",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(i||(e.WorkspaceFoldersRequest=i={}));var o;(function(s){s.method="workspace/didChangeWorkspaceFolders",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolNotificationType(s.method)})(o||(e.DidChangeWorkspaceFoldersNotification=o={}))})),Q0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var n=Vt(),i;(function(o){o.method="workspace/configuration",o.messageDirection=n.MessageDirection.serverToClient,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ConfigurationRequest=i={}))})),G0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var n=Vt(),i;(function(s){s.method="textDocument/documentColor",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.DocumentColorRequest=i={}));var o;(function(s){s.method="textDocument/colorPresentation",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(o||(e.ColorPresentationRequest=o={}))})),J0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var n=Vt(),i;(function(s){s.method="textDocument/foldingRange",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.FoldingRangeRequest=i={}));var o;(function(s){s.method="workspace/foldingRange/refresh",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(o||(e.FoldingRangeRefreshRequest=o={}))})),X0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/declaration",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.DeclarationRequest=i={}))})),Y0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/selectionRange",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.SelectionRangeRequest=i={}))})),Z0=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var n=ja(),i=Vt(),o;(function(d){d.type=new n.ProgressType;function f(p){return p===d.type}d.is=f})(o||(e.WorkDoneProgress=o={}));var s;(function(d){d.method="window/workDoneProgress/create",d.messageDirection=i.MessageDirection.serverToClient,d.type=new i.ProtocolRequestType(d.method)})(s||(e.WorkDoneProgressCreateRequest=s={}));var c;(function(d){d.method="window/workDoneProgress/cancel",d.messageDirection=i.MessageDirection.clientToServer,d.type=new i.ProtocolNotificationType(d.method)})(c||(e.WorkDoneProgressCancelNotification=c={}))})),eg=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var n=Vt(),i;(function(c){c.method="textDocument/prepareCallHierarchy",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.CallHierarchyPrepareRequest=i={}));var o;(function(c){c.method="callHierarchy/incomingCalls",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.CallHierarchyIncomingCallsRequest=o={}));var s;(function(c){c.method="callHierarchy/outgoingCalls",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.CallHierarchyOutgoingCallsRequest=s={}))})),tg=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var n=Vt(),i;(function(p){p.Relative="relative"})(i||(e.TokenFormat=i={}));var o;(function(p){p.method="textDocument/semanticTokens",p.type=new n.RegistrationType(p.method)})(o||(e.SemanticTokensRegistrationType=o={}));var s;(function(p){p.method="textDocument/semanticTokens/full",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolRequestType(p.method),p.registrationMethod=o.method})(s||(e.SemanticTokensRequest=s={}));var c;(function(p){p.method="textDocument/semanticTokens/full/delta",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolRequestType(p.method),p.registrationMethod=o.method})(c||(e.SemanticTokensDeltaRequest=c={}));var d;(function(p){p.method="textDocument/semanticTokens/range",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolRequestType(p.method),p.registrationMethod=o.method})(d||(e.SemanticTokensRangeRequest=d={}));var f;(function(p){p.method="workspace/semanticTokens/refresh",p.messageDirection=n.MessageDirection.serverToClient,p.type=new n.ProtocolRequestType0(p.method)})(f||(e.SemanticTokensRefreshRequest=f={}))})),ng=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var n=Vt(),i;(function(o){o.method="window/showDocument",o.messageDirection=n.MessageDirection.serverToClient,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ShowDocumentRequest=i={}))})),rg=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/linkedEditingRange",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.LinkedEditingRangeRequest=i={}))})),ig=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;var n=Vt(),i;(function(y){y.file="file",y.folder="folder"})(i||(e.FileOperationPatternKind=i={}));var o;(function(y){y.method="workspace/willCreateFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolRequestType(y.method)})(o||(e.WillCreateFilesRequest=o={}));var s;(function(y){y.method="workspace/didCreateFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolNotificationType(y.method)})(s||(e.DidCreateFilesNotification=s={}));var c;(function(y){y.method="workspace/willRenameFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolRequestType(y.method)})(c||(e.WillRenameFilesRequest=c={}));var d;(function(y){y.method="workspace/didRenameFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolNotificationType(y.method)})(d||(e.DidRenameFilesNotification=d={}));var f;(function(y){y.method="workspace/didDeleteFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolNotificationType(y.method)})(f||(e.DidDeleteFilesNotification=f={}));var p;(function(y){y.method="workspace/willDeleteFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolRequestType(y.method)})(p||(e.WillDeleteFilesRequest=p={}))})),ag=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var n=Vt(),i;(function(c){c.document="document",c.project="project",c.group="group",c.scheme="scheme",c.global="global"})(i||(e.UniquenessLevel=i={}));var o;(function(c){c.$import="import",c.$export="export",c.local="local"})(o||(e.MonikerKind=o={}));var s;(function(c){c.method="textDocument/moniker",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.MonikerRequest=s={}))})),og=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var n=Vt(),i;(function(c){c.method="textDocument/prepareTypeHierarchy",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.TypeHierarchyPrepareRequest=i={}));var o;(function(c){c.method="typeHierarchy/supertypes",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.TypeHierarchySupertypesRequest=o={}));var s;(function(c){c.method="typeHierarchy/subtypes",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.TypeHierarchySubtypesRequest=s={}))})),sg=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var n=Vt(),i;(function(s){s.method="textDocument/inlineValue",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.InlineValueRequest=i={}));var o;(function(s){s.method="workspace/inlineValue/refresh",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(o||(e.InlineValueRefreshRequest=o={}))})),lg=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var n=Vt(),i;(function(c){c.method="textDocument/inlayHint",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.InlayHintRequest=i={}));var o;(function(c){c.method="inlayHint/resolve",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.InlayHintResolveRequest=o={}));var s;(function(c){c.method="workspace/inlayHint/refresh",c.messageDirection=n.MessageDirection.serverToClient,c.type=new n.ProtocolRequestType0(c.method)})(s||(e.InlayHintRefreshRequest=s={}))})),cg=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var n=ja(),i=tc(),o=Vt(),s;(function(y){function w(_){let C=_;return C&&i.boolean(C.retriggerRequest)}y.is=w})(s||(e.DiagnosticServerCancellationData=s={}));var c;(function(y){y.Full="full",y.Unchanged="unchanged"})(c||(e.DocumentDiagnosticReportKind=c={}));var d;(function(y){y.method="textDocument/diagnostic",y.messageDirection=o.MessageDirection.clientToServer,y.type=new o.ProtocolRequestType(y.method),y.partialResult=new n.ProgressType})(d||(e.DocumentDiagnosticRequest=d={}));var f;(function(y){y.method="workspace/diagnostic",y.messageDirection=o.MessageDirection.clientToServer,y.type=new o.ProtocolRequestType(y.method),y.partialResult=new n.ProgressType})(f||(e.WorkspaceDiagnosticRequest=f={}));var p;(function(y){y.method="workspace/diagnostic/refresh",y.messageDirection=o.MessageDirection.serverToClient,y.type=new o.ProtocolRequestType0(y.method)})(p||(e.DiagnosticRefreshRequest=p={}))})),ug=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;var n=(Eh(),Du(Ch)),i=tc(),o=Vt(),s;(function(T){T.Markup=1,T.Code=2;function I($){return $===1||$===2}T.is=I})(s||(e.NotebookCellKind=s={}));var c;(function(T){function I(F,N){let K={executionOrder:F};return(N===!0||N===!1)&&(K.success=N),K}T.create=I;function $(F){let N=F;return i.objectLiteral(N)&&n.uinteger.is(N.executionOrder)&&(N.success===void 0||i.boolean(N.success))}T.is=$;function V(F,N){return F===N?!0:F==null||N==null?!1:F.executionOrder===N.executionOrder&&F.success===N.success}T.equals=V})(c||(e.ExecutionSummary=c={}));var d;(function(T){function I(N,K){return{kind:N,document:K}}T.create=I;function $(N){let K=N;return i.objectLiteral(K)&&s.is(K.kind)&&n.DocumentUri.is(K.document)&&(K.metadata===void 0||i.objectLiteral(K.metadata))}T.is=$;function V(N,K){let pe=new Set;return N.document!==K.document&&pe.add("document"),N.kind!==K.kind&&pe.add("kind"),N.executionSummary!==K.executionSummary&&pe.add("executionSummary"),(N.metadata!==void 0||K.metadata!==void 0)&&!F(N.metadata,K.metadata)&&pe.add("metadata"),(N.executionSummary!==void 0||K.executionSummary!==void 0)&&!c.equals(N.executionSummary,K.executionSummary)&&pe.add("executionSummary"),pe}T.diff=V;function F(N,K){if(N===K)return!0;if(N==null||K==null||typeof N!=typeof K||typeof N!="object")return!1;let pe=Array.isArray(N),P=Array.isArray(K);if(pe!==P)return!1;if(pe&&P){if(N.length!==K.length)return!1;for(let A=0;A<N.length;A++)if(!F(N[A],K[A]))return!1}if(i.objectLiteral(N)&&i.objectLiteral(K)){let A=Object.keys(N),W=Object.keys(K);if(A.length!==W.length||(A.sort(),W.sort(),!F(A,W)))return!1;for(let de=0;de<A.length;de++){let fe=A[de];if(!F(N[fe],K[fe]))return!1}}return!0}})(d||(e.NotebookCell=d={}));var f;(function(T){function I(V,F,N,K){return{uri:V,notebookType:F,version:N,cells:K}}T.create=I;function $(V){let F=V;return i.objectLiteral(F)&&i.string(F.uri)&&n.integer.is(F.version)&&i.typedArray(F.cells,d.is)}T.is=$})(f||(e.NotebookDocument=f={}));var p;(function(T){T.method="notebookDocument/sync",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.RegistrationType(T.method)})(p||(e.NotebookDocumentSyncRegistrationType=p={}));var y;(function(T){T.method="notebookDocument/didOpen",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(y||(e.DidOpenNotebookDocumentNotification=y={}));var w;(function(T){function I(V){let F=V;return i.objectLiteral(F)&&n.uinteger.is(F.start)&&n.uinteger.is(F.deleteCount)&&(F.cells===void 0||i.typedArray(F.cells,d.is))}T.is=I;function $(V,F,N){let K={start:V,deleteCount:F};return N!==void 0&&(K.cells=N),K}T.create=$})(w||(e.NotebookCellArrayChange=w={}));var _;(function(T){T.method="notebookDocument/didChange",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(_||(e.DidChangeNotebookDocumentNotification=_={}));var C;(function(T){T.method="notebookDocument/didSave",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(C||(e.DidSaveNotebookDocumentNotification=C={}));var E;(function(T){T.method="notebookDocument/didClose",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(E||(e.DidCloseNotebookDocumentNotification=E={}))})),dg=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineCompletionRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/inlineCompletion",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.InlineCompletionRequest=i={}))})),fg=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangesFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.InlineCompletionRequest=e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=void 0;var n=Vt(),i=(Eh(),Du(Ch)),o=tc(),s=W0();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return s.ImplementationRequest}});var c=U0();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return c.TypeDefinitionRequest}});var d=K0();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return d.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return d.DidChangeWorkspaceFoldersNotification}});var f=Q0();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return f.ConfigurationRequest}});var p=G0();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return p.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return p.ColorPresentationRequest}});var y=J0();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return y.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return y.FoldingRangeRefreshRequest}});var w=X0();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return w.DeclarationRequest}});var _=Y0();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return _.SelectionRangeRequest}});var C=Z0();Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return C.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return C.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return C.WorkDoneProgressCancelNotification}});var E=eg();Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return E.CallHierarchyPrepareRequest}});var T=tg();Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return T.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return T.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return T.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return T.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return T.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return T.SemanticTokensRegistrationType}});var I=ng();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return I.ShowDocumentRequest}});var $=rg();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return $.LinkedEditingRangeRequest}});var V=ig();Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return V.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return V.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return V.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return V.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return V.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return V.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return V.WillDeleteFilesRequest}});var F=ag();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return F.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return F.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return F.MonikerRequest}});var N=og();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return N.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return N.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return N.TypeHierarchySupertypesRequest}});var K=sg();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return K.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return K.InlineValueRefreshRequest}});var pe=lg();Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return pe.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return pe.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return pe.InlayHintRefreshRequest}});var P=cg();Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return P.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return P.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return P.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return P.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return P.DiagnosticRefreshRequest}});var A=ug();Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return A.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return A.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return A.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return A.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return A.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return A.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidCloseNotebookDocumentNotification}});var W=dg();Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return W.InlineCompletionRequest}});var de;(function(M){function Ye(j){let te=j;return o.string(te)||o.string(te.language)||o.string(te.scheme)||o.string(te.pattern)}M.is=Ye})(de||(e.TextDocumentFilter=de={}));var fe;(function(M){function Ye(j){let te=j;return o.objectLiteral(te)&&(o.string(te.notebookType)||o.string(te.scheme)||o.string(te.pattern))}M.is=Ye})(fe||(e.NotebookDocumentFilter=fe={}));var we;(function(M){function Ye(j){let te=j;return o.objectLiteral(te)&&(o.string(te.notebook)||fe.is(te.notebook))&&(te.language===void 0||o.string(te.language))}M.is=Ye})(we||(e.NotebookCellTextDocumentFilter=we={}));var J;(function(M){function Ye(j){if(!Array.isArray(j))return!1;for(let te of j)if(!o.string(te)&&!de.is(te)&&!we.is(te))return!1;return!0}M.is=Ye})(J||(e.DocumentSelector=J={}));var be;(function(M){M.method="client/registerCapability",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(be||(e.RegistrationRequest=be={}));var Se;(function(M){M.method="client/unregisterCapability",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(Se||(e.UnregistrationRequest=Se={}));var Z;(function(M){M.Create="create",M.Rename="rename",M.Delete="delete"})(Z||(e.ResourceOperationKind=Z={}));var re;(function(M){M.Abort="abort",M.Transactional="transactional",M.TextOnlyTransactional="textOnlyTransactional",M.Undo="undo"})(re||(e.FailureHandlingKind=re={}));var se;(function(M){M.UTF8="utf-8",M.UTF16="utf-16",M.UTF32="utf-32"})(se||(e.PositionEncodingKind=se={}));var Q;(function(M){function Ye(j){let te=j;return te&&o.string(te.id)&&te.id.length>0}M.hasId=Ye})(Q||(e.StaticRegistrationOptions=Q={}));var Le;(function(M){function Ye(j){let te=j;return te&&(te.documentSelector===null||J.is(te.documentSelector))}M.is=Ye})(Le||(e.TextDocumentRegistrationOptions=Le={}));var Fe;(function(M){function Ye(te){let ve=te;return o.objectLiteral(ve)&&(ve.workDoneProgress===void 0||o.boolean(ve.workDoneProgress))}M.is=Ye;function j(te){let ve=te;return ve&&o.boolean(ve.workDoneProgress)}M.hasWorkDoneProgress=j})(Fe||(e.WorkDoneProgressOptions=Fe={}));var et;(function(M){M.method="initialize",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(et||(e.InitializeRequest=et={}));var Be;(function(M){M.unknownProtocolVersion=1})(Be||(e.InitializeErrorCodes=Be={}));var je;(function(M){M.method="initialized",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(je||(e.InitializedNotification=je={}));var Pe;(function(M){M.method="shutdown",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType0(M.method)})(Pe||(e.ShutdownRequest=Pe={}));var Ae;(function(M){M.method="exit",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType0(M.method)})(Ae||(e.ExitNotification=Ae={}));var ft;(function(M){M.method="workspace/didChangeConfiguration",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(ft||(e.DidChangeConfigurationNotification=ft={}));var mt;(function(M){M.Error=1,M.Warning=2,M.Info=3,M.Log=4,M.Debug=5})(mt||(e.MessageType=mt={}));var Dn;(function(M){M.method="window/showMessage",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(Dn||(e.ShowMessageNotification=Dn={}));var un;(function(M){M.method="window/showMessageRequest",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(un||(e.ShowMessageRequest=un={}));var We;(function(M){M.method="window/logMessage",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(We||(e.LogMessageNotification=We={}));var tn;(function(M){M.method="telemetry/event",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(tn||(e.TelemetryEventNotification=tn={}));var wt;(function(M){M.None=0,M.Full=1,M.Incremental=2})(wt||(e.TextDocumentSyncKind=wt={}));var vn;(function(M){M.method="textDocument/didOpen",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(vn||(e.DidOpenTextDocumentNotification=vn={}));var vr;(function(M){function Ye(te){let ve=te;return ve!=null&&typeof ve.text=="string"&&ve.range!==void 0&&(ve.rangeLength===void 0||typeof ve.rangeLength=="number")}M.isIncremental=Ye;function j(te){let ve=te;return ve!=null&&typeof ve.text=="string"&&ve.range===void 0&&ve.rangeLength===void 0}M.isFull=j})(vr||(e.TextDocumentContentChangeEvent=vr={}));var pt;(function(M){M.method="textDocument/didChange",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(pt||(e.DidChangeTextDocumentNotification=pt={}));var Fr;(function(M){M.method="textDocument/didClose",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(Fr||(e.DidCloseTextDocumentNotification=Fr={}));var nn;(function(M){M.method="textDocument/didSave",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(nn||(e.DidSaveTextDocumentNotification=nn={}));var mi;(function(M){M.Manual=1,M.AfterDelay=2,M.FocusOut=3})(mi||(e.TextDocumentSaveReason=mi={}));var On;(function(M){M.method="textDocument/willSave",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(On||(e.WillSaveTextDocumentNotification=On={}));var br;(function(M){M.method="textDocument/willSaveWaitUntil",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(br||(e.WillSaveTextDocumentWaitUntilRequest=br={}));var Pn;(function(M){M.method="workspace/didChangeWatchedFiles",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(Pn||(e.DidChangeWatchedFilesNotification=Pn={}));var dn;(function(M){M.Created=1,M.Changed=2,M.Deleted=3})(dn||(e.FileChangeType=dn={}));var ta;(function(M){function Ye(j){let te=j;return o.objectLiteral(te)&&(i.URI.is(te.baseUri)||i.WorkspaceFolder.is(te.baseUri))&&o.string(te.pattern)}M.is=Ye})(ta||(e.RelativePattern=ta={}));var gi;(function(M){M.Create=1,M.Change=2,M.Delete=4})(gi||(e.WatchKind=gi={}));var Ut;(function(M){M.method="textDocument/publishDiagnostics",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(Ut||(e.PublishDiagnosticsNotification=Ut={}));var yi;(function(M){M.Invoked=1,M.TriggerCharacter=2,M.TriggerForIncompleteCompletions=3})(yi||(e.CompletionTriggerKind=yi={}));var fn;(function(M){M.method="textDocument/completion",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(fn||(e.CompletionRequest=fn={}));var ni;(function(M){M.method="completionItem/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ni||(e.CompletionResolveRequest=ni={}));var zt;(function(M){M.method="textDocument/hover",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(zt||(e.HoverRequest=zt={}));var Br;(function(M){M.Invoked=1,M.TriggerCharacter=2,M.ContentChange=3})(Br||(e.SignatureHelpTriggerKind=Br={}));var _t;(function(M){M.method="textDocument/signatureHelp",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(_t||(e.SignatureHelpRequest=_t={}));var vi;(function(M){M.method="textDocument/definition",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(vi||(e.DefinitionRequest=vi={}));var na;(function(M){M.method="textDocument/references",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(na||(e.ReferencesRequest=na={}));var wr;(function(M){M.method="textDocument/documentHighlight",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(wr||(e.DocumentHighlightRequest=wr={}));var Jt;(function(M){M.method="textDocument/documentSymbol",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Jt||(e.DocumentSymbolRequest=Jt={}));var Ge;(function(M){M.method="textDocument/codeAction",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Ge||(e.CodeActionRequest=Ge={}));var gt;(function(M){M.method="codeAction/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(gt||(e.CodeActionResolveRequest=gt={}));var xt;(function(M){M.method="workspace/symbol",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(xt||(e.WorkspaceSymbolRequest=xt={}));var kt;(function(M){M.method="workspaceSymbol/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(kt||(e.WorkspaceSymbolResolveRequest=kt={}));var jn;(function(M){M.method="textDocument/codeLens",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(jn||(e.CodeLensRequest=jn={}));var _r;(function(M){M.method="codeLens/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(_r||(e.CodeLensResolveRequest=_r={}));var St;(function(M){M.method="workspace/codeLens/refresh",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType0(M.method)})(St||(e.CodeLensRefreshRequest=St={}));var ir;(function(M){M.method="textDocument/documentLink",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ir||(e.DocumentLinkRequest=ir={}));var Mn;(function(M){M.method="documentLink/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Mn||(e.DocumentLinkResolveRequest=Mn={}));var Hr;(function(M){M.method="textDocument/formatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Hr||(e.DocumentFormattingRequest=Hr={}));var bn;(function(M){M.method="textDocument/rangeFormatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(bn||(e.DocumentRangeFormattingRequest=bn={}));var ar;(function(M){M.method="textDocument/rangesFormatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ar||(e.DocumentRangesFormattingRequest=ar={}));var bi;(function(M){M.method="textDocument/onTypeFormatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(bi||(e.DocumentOnTypeFormattingRequest=bi={}));var ri;(function(M){M.Identifier=1})(ri||(e.PrepareSupportDefaultBehavior=ri={}));var Ln;(function(M){M.method="textDocument/rename",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Ln||(e.RenameRequest=Ln={}));var wi;(function(M){M.method="textDocument/prepareRename",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(wi||(e.PrepareRenameRequest=wi={}));var zn;(function(M){M.method="workspace/executeCommand",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(zn||(e.ExecuteCommandRequest=zn={}));var or;(function(M){M.method="workspace/applyEdit",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType("workspace/applyEdit")})(or||(e.ApplyWorkspaceEditRequest=or={}))})),pg=Ce((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var n=ja();function i(o,s,c,d){return n.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,n.createMessageConnection)(o,s,c,d)}e.createProtocolConnection=i})),hg=Ce((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,f,p){p===void 0&&(p=f);var y=Object.getOwnPropertyDescriptor(d,f);(!y||("get"in y?!d.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(c,p,y)}):(function(c,d,f,p){p===void 0&&(p=f),c[p]=d[f]})),i=e&&e.__exportStar||function(c,d){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&n(d,c,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,i(ja(),e),i((Eh(),Du(Ch)),e),i(Vt(),e),i(fg(),e);var o=pg();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return o.createProtocolConnection}});var s;(function(c){c.lspReservedErrorRangeStart=-32899,c.RequestFailed=-32803,c.ServerCancelled=-32802,c.ContentModified=-32801,c.RequestCancelled=-32800,c.lspReservedErrorRangeEnd=-32800})(s||(e.LSPErrorCodes=s={}))})),Vu=Ce((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,f,p){p===void 0&&(p=f);var y=Object.getOwnPropertyDescriptor(d,f);(!y||("get"in y?!d.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(c,p,y)}):(function(c,d,f,p){p===void 0&&(p=f),c[p]=d[f]})),i=e&&e.__exportStar||function(c,d){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&n(d,c,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var o=Ad();i(Ad(),e),i(hg(),e);function s(c,d,f,p){return(0,o.createMessageConnection)(c,d,f,p)}e.createProtocolConnection=s}));function yn(e,n){if(n.line>=e.lines)return n.character===0?e.length:void 0;let i=e.line(n.line+1).from+n.character;if(!(i>e.length))return i}function Ir(e,n){return yn(e,n)||0}function Xi(e,n){let i=e.lineAt(n);return{character:n-i.from,line:i.number-1}}var nc=new Sw.Renderer,ek=nc.code;nc.code=e=>e.text.trim()?ek.call(nc,e):"";function mg(e){return Sw(e,{async:!1,gfm:!0,breaks:!0,renderer:nc})}function Ar(e,n=mg){if(!e)return"";if(ik(e)){let i=e.value;return e.kind==="markdown"&&(i=n(i.trim())),i}return Array.isArray(e)?e.map(i=>Ar(i,n)).filter(Boolean).join(`
46
+ `)),te){let Te=j.error?` Request failed: ${j.error.message} (${j.error.code}).`:"";wt.log(`Received response '${te.method} - (${j.id})' in ${Date.now()-te.timerStart}ms.${Te}`,ve)}else wt.log(`Received response ${j.id} without active response promise.`,ve)}else bn("receive-response",j)}function bn(j,te){if(!wt||We===_.Off)return;let ve={isLSPMessage:!0,type:j,message:te,timestamp:Date.now()};wt.log(ve)}function ar(){if(yi())throw new V($.Closed,"Connection is closed.");if(fn())throw new V($.Disposed,"Connection is disposed.")}function bi(){if(Ut())throw new V($.AlreadyListening,"Connection is already listening")}function ri(){if(!Ut())throw Error("Call listen() first.")}function Ln(j){return j===void 0?null:j}function wi(j){if(j!==null)return j}function Fn(j){return j!=null&&!Array.isArray(j)&&typeof j=="object"}function or(j,te){switch(j){case o.ParameterStructures.auto:return Fn(te)?wi(te):[Ln(te)];case o.ParameterStructures.byName:if(!Fn(te))throw Error("Received parameters by name but param is not an object literal.");return wi(te);case o.ParameterStructures.byPosition:return[Ln(te)];default:throw Error(`Unknown parameter structure ${j.toString()}`)}}function M(j,te){let ve,Te=j.numberOfParams;switch(Te){case 0:ve=void 0;break;case 1:ve=or(j.parameterStructures,te[0]);break;default:ve=[];for(let He=0;He<te.length&&He<Te;He++)ve.push(Ln(te[He]));if(te.length<Te)for(let He=te.length;He<Te;He++)ve.push(null);break}return ve}let Ye={sendNotification:(j,...te)=>{ar();let ve,Te;if(i.string(j)){ve=j;let Ve=te[0],ot=0,Mt=o.ParameterStructures.auto;o.ParameterStructures.is(Ve)&&(ot=1,Mt=Ve);let Ze=te.length,Lt=Ze-ot;switch(Lt){case 0:Te=void 0;break;case 1:Te=or(Mt,te[ot]);break;default:if(Mt===o.ParameterStructures.byName)throw Error(`Received ${Lt} parameters for 'by Name' notification parameter structure.`);Te=te.slice(ot,Ze).map(rt=>Ln(rt));break}}else{let Ve=te;ve=j.method,Te=M(j,Ve)}let He={jsonrpc:"2.0",method:ve,params:Te};return _r(He),be.write(He).catch(Ve=>{throw re.error("Sending notification failed."),Ve})},onNotification:(j,te)=>{ar();let ve;return i.func(j)?Be=j:te&&(i.string(j)?(ve=j,je.set(j,{type:void 0,handler:te})):(ve=j.method,je.set(j.method,{type:j,handler:te}))),{dispose:()=>{ve===void 0?Be=void 0:je.delete(ve)}}},onProgress:(j,te,ve)=>{if(Pe.has(te))throw Error(`Progress handler for token ${te} already registered`);return Pe.set(te,ve),{dispose:()=>{Pe.delete(te)}}},sendProgress:(j,te,ve)=>Ye.sendNotification(y.type,{token:te,value:ve}),onUnhandledProgress:nn.event,sendRequest:(j,...te)=>{ar(),ri();let ve,Te,He;if(i.string(j)){ve=j;let Ze=te[0],Lt=te[te.length-1],rt=0,ut=o.ParameterStructures.auto;o.ParameterStructures.is(Ze)&&(rt=1,ut=Ze);let wn=te.length;d.CancellationToken.is(Lt)&&(--wn,He=Lt);let sr=wn-rt;switch(sr){case 0:Te=void 0;break;case 1:Te=or(ut,te[rt]);break;default:if(ut===o.ParameterStructures.byName)throw Error(`Received ${sr} parameters for 'by Name' request parameter structure.`);Te=te.slice(rt,wn).map(ii=>Ln(ii));break}}else{let Ze=te;ve=j.method,Te=M(j,Ze);let Lt=j.numberOfParams;He=d.CancellationToken.is(Ze[Lt])?Ze[Lt]:void 0}let Ve=se++,ot;He&&(ot=He.onCancellationRequested(()=>{let Ze=On.sender.sendCancellation(Ye,Ve);return Ze===void 0?(re.log(`Received no promise from cancellation strategy when cancelling id ${Ve}`),Promise.resolve()):Ze.catch(()=>{re.log(`Sending cancellation messages for id ${Ve} failed`)})}));let Mt={jsonrpc:"2.0",id:Ve,method:ve,params:Te};return zn(Mt),typeof On.sender.enableCancellation=="function"&&On.sender.enableCancellation(Mt),new Promise(async(Ze,Lt)=>{let rt={method:ve,timerStart:Date.now(),resolve:ut=>{Ze(ut),On.sender.cleanup(Ve),ot==null||ot.dispose()},reject:ut=>{Lt(ut),On.sender.cleanup(Ve),ot==null||ot.dispose()}};try{await be.write(Mt),mt.set(Ve,rt)}catch(ut){throw re.error("Sending request failed."),rt.reject(new o.ResponseError(o.ErrorCodes.MessageWriteError,ut.message?ut.message:"Unknown reason")),ut}})},onRequest:(j,te)=>{ar();let ve=null;return w.is(j)?(ve=void 0,Fe=j):i.string(j)?(ve=null,te!==void 0&&(ve=j,et.set(j,{handler:te,type:void 0}))):te!==void 0&&(ve=j.method,et.set(j.method,{type:j,handler:te})),{dispose:()=>{ve!==null&&(ve===void 0?Fe=void 0:et.delete(ve))}}},hasPendingResponse:()=>mt.size>0,trace:async(j,te,ve)=>{let Te=!1,He=E.Text;ve!==void 0&&(i.boolean(ve)?Te=ve:(Te=ve.sendNotification||!1,He=ve.traceFormat||E.Text)),We=j,tn=He,wt=We===_.Off?void 0:te,Te&&!yi()&&!fn()&&await Ye.sendNotification(T.type,{value:_.toString(j)})},onError:vr.event,onClose:pt.event,onUnhandledNotification:Fr.event,onDispose:mi.event,end:()=>{be.end()},dispose:()=>{if(fn())return;vn=fe.Disposed,mi.fire(void 0);let j=new o.ResponseError(o.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let te of mt.values())te.reject(j);mt=new Map,un=new Map,Dn=new Set,ft=new s.LinkedMap,i.func(be.dispose)&&be.dispose(),i.func(J.dispose)&&J.dispose()},listen:()=>{ar(),bi(),vn=fe.Listening,J.listen(wr)},inspect:()=>{(0,n.default)().console.log("inspect")}};return Ye.onNotification(I.type,j=>{if(We===_.Off||!wt)return;let te=We===_.Verbose||We===_.Compact;wt.log(j.message,te?j.verbose:void 0)}),Ye.onNotification(y.type,j=>{let te=Pe.get(j.token);te?te(j.value):nn.fire(j)}),Ye}e.createMessageConnection=we})),Zl=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;var n=Ld();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return n.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return n.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return n.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return n.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return n.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return n.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return n.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return n.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return n.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return n.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return n.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return n.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return n.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return n.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return n.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return n.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return n.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return n.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return n.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return n.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return n.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return n.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return n.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return n.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return n.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return n.ParameterStructures}});var i=Nd();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return i.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return i.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return i.Touch}});var o=j0();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return o.Disposable}});var s=Mo();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});var c=Yl();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return c.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return c.CancellationToken}});var d=z0();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return d.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return d.SharedArrayReceiverStrategy}});var f=F0();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return f.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return f.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return f.ReadableStreamMessageReader}});var p=B0();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return p.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return p.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return p.WriteableStreamMessageWriter}});var y=H0();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return y.AbstractMessageBuffer}});var w=V0();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return w.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return w.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return w.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return w.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return w.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return w.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return w.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return w.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return w.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return w.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return w.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return w.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return w.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return w.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return w.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return w.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return w.MessageStrategy}}),e.RAL=Ji().default})),$0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=Zl(),i=class bx extends n.AbstractMessageBuffer{constructor(y="utf-8"){super(y),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return bx.emptyBuffer}fromString(y,w){return new TextEncoder().encode(y)}toString(y,w){return w==="ascii"?this.asciiDecoder.decode(y):new TextDecoder(w).decode(y)}asNative(y,w){return w===void 0?y:y.slice(0,w)}allocNative(y){return new Uint8Array(y)}};i.emptyBuffer=new Uint8Array;var o=class{constructor(p){this.socket=p,this._onData=new n.Emitter,this._messageListener=y=>{y.data.arrayBuffer().then(w=>{this._onData.fire(new Uint8Array(w))},()=>{(0,n.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(p){return this.socket.addEventListener("close",p),n.Disposable.create(()=>this.socket.removeEventListener("close",p))}onError(p){return this.socket.addEventListener("error",p),n.Disposable.create(()=>this.socket.removeEventListener("error",p))}onEnd(p){return this.socket.addEventListener("end",p),n.Disposable.create(()=>this.socket.removeEventListener("end",p))}onData(p){return this._onData.event(p)}},s=class{constructor(p){this.socket=p}onClose(p){return this.socket.addEventListener("close",p),n.Disposable.create(()=>this.socket.removeEventListener("close",p))}onError(p){return this.socket.addEventListener("error",p),n.Disposable.create(()=>this.socket.removeEventListener("error",p))}onEnd(p){return this.socket.addEventListener("end",p),n.Disposable.create(()=>this.socket.removeEventListener("end",p))}write(p,y){if(typeof p=="string"){if(y!==void 0&&y!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${y}`);this.socket.send(p)}else this.socket.send(p);return Promise.resolve()}end(){this.socket.close()}},c=new TextEncoder,d=Object.freeze({messageBuffer:Object.freeze({create:p=>new i(p)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(p,y)=>{if(y.charset!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${y.charset}`);return Promise.resolve(c.encode(JSON.stringify(p,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(p,y)=>{if(!(p instanceof Uint8Array))throw Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(y.charset).decode(p)))}})}),stream:Object.freeze({asReadableStream:p=>new o(p),asWritableStream:p=>new s(p)}),console,timer:Object.freeze({setTimeout(p,y,...w){let _=setTimeout(p,y,...w);return{dispose:()=>clearTimeout(_)}},setImmediate(p,...y){let w=setTimeout(p,0,...y);return{dispose:()=>clearTimeout(w)}},setInterval(p,y,...w){let _=setInterval(p,y,...w);return{dispose:()=>clearInterval(_)}}})});function f(){return d}(function(p){function y(){n.RAL.install(d)}p.install=y})(f||(f={})),e.default=f})),ja=Ee((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,f,p){p===void 0&&(p=f);var y=Object.getOwnPropertyDescriptor(d,f);(!y||("get"in y?!d.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(c,p,y)}):(function(c,d,f,p){p===void 0&&(p=f),c[p]=d[f]})),i=e&&e.__exportStar||function(c,d){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&n(d,c,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0,$0().default.install();var o=Zl();i(Zl(),e),e.BrowserMessageReader=class extends o.AbstractMessageReader{constructor(c){super(),this._onData=new o.Emitter,this._messageListener=d=>{this._onData.fire(d.data)},c.addEventListener("error",d=>this.fireError(d)),c.onmessage=this._messageListener}listen(c){return this._onData.event(c)}},e.BrowserMessageWriter=class extends o.AbstractMessageWriter{constructor(c){super(),this.port=c,this.errorCount=0,c.addEventListener("error",d=>this.fireError(d))}write(c){try{return this.port.postMessage(c),Promise.resolve()}catch(d){return this.handleError(d,c),Promise.reject(d)}}handleError(c,d){this.errorCount++,this.fireError(c,d,this.errorCount)}end(){}};function s(c,d,f,p){return f===void 0&&(f=o.NullLogger),o.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,o.createMessageConnection)(c,d,f,p)}e.createMessageConnection=s})),Ad=Ee(((e,n)=>{n.exports=ja()})),Vt=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var n=ja(),i;(function(o){o.clientToServer="clientToServer",o.serverToClient="serverToClient",o.both="both"})(i||(e.MessageDirection=i={})),e.RegistrationType=class{constructor(o){this.method=o}},e.ProtocolRequestType0=class extends n.RequestType0{constructor(o){super(o)}},e.ProtocolRequestType=class extends n.RequestType{constructor(o){super(o,n.ParameterStructures.byName)}},e.ProtocolNotificationType0=class extends n.NotificationType0{constructor(o){super(o)}},e.ProtocolNotificationType=class extends n.NotificationType{constructor(o){super(o,n.ParameterStructures.byName)}}})),ec=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function n(w){return w===!0||w===!1}e.boolean=n;function i(w){return typeof w=="string"||w instanceof String}e.string=i;function o(w){return typeof w=="number"||w instanceof Number}e.number=o;function s(w){return w instanceof Error}e.error=s;function c(w){return typeof w=="function"}e.func=c;function d(w){return Array.isArray(w)}e.array=d;function f(w){return d(w)&&w.every(_=>i(_))}e.stringArray=f;function p(w,_){return Array.isArray(w)&&w.every(_)}e.typedArray=p;function y(w){return typeof w=="object"&&!!w}e.objectLiteral=y})),W0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/implementation",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ImplementationRequest=i={}))})),U0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/typeDefinition",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.TypeDefinitionRequest=i={}))})),K0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var n=Vt(),i;(function(s){s.method="workspace/workspaceFolders",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(i||(e.WorkspaceFoldersRequest=i={}));var o;(function(s){s.method="workspace/didChangeWorkspaceFolders",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolNotificationType(s.method)})(o||(e.DidChangeWorkspaceFoldersNotification=o={}))})),Q0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var n=Vt(),i;(function(o){o.method="workspace/configuration",o.messageDirection=n.MessageDirection.serverToClient,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ConfigurationRequest=i={}))})),G0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var n=Vt(),i;(function(s){s.method="textDocument/documentColor",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.DocumentColorRequest=i={}));var o;(function(s){s.method="textDocument/colorPresentation",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(o||(e.ColorPresentationRequest=o={}))})),J0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var n=Vt(),i;(function(s){s.method="textDocument/foldingRange",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.FoldingRangeRequest=i={}));var o;(function(s){s.method="workspace/foldingRange/refresh",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(o||(e.FoldingRangeRefreshRequest=o={}))})),X0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/declaration",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.DeclarationRequest=i={}))})),Y0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/selectionRange",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.SelectionRangeRequest=i={}))})),Z0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var n=ja(),i=Vt(),o;(function(d){d.type=new n.ProgressType;function f(p){return p===d.type}d.is=f})(o||(e.WorkDoneProgress=o={}));var s;(function(d){d.method="window/workDoneProgress/create",d.messageDirection=i.MessageDirection.serverToClient,d.type=new i.ProtocolRequestType(d.method)})(s||(e.WorkDoneProgressCreateRequest=s={}));var c;(function(d){d.method="window/workDoneProgress/cancel",d.messageDirection=i.MessageDirection.clientToServer,d.type=new i.ProtocolNotificationType(d.method)})(c||(e.WorkDoneProgressCancelNotification=c={}))})),eg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var n=Vt(),i;(function(c){c.method="textDocument/prepareCallHierarchy",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.CallHierarchyPrepareRequest=i={}));var o;(function(c){c.method="callHierarchy/incomingCalls",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.CallHierarchyIncomingCallsRequest=o={}));var s;(function(c){c.method="callHierarchy/outgoingCalls",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.CallHierarchyOutgoingCallsRequest=s={}))})),tg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var n=Vt(),i;(function(p){p.Relative="relative"})(i||(e.TokenFormat=i={}));var o;(function(p){p.method="textDocument/semanticTokens",p.type=new n.RegistrationType(p.method)})(o||(e.SemanticTokensRegistrationType=o={}));var s;(function(p){p.method="textDocument/semanticTokens/full",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolRequestType(p.method),p.registrationMethod=o.method})(s||(e.SemanticTokensRequest=s={}));var c;(function(p){p.method="textDocument/semanticTokens/full/delta",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolRequestType(p.method),p.registrationMethod=o.method})(c||(e.SemanticTokensDeltaRequest=c={}));var d;(function(p){p.method="textDocument/semanticTokens/range",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolRequestType(p.method),p.registrationMethod=o.method})(d||(e.SemanticTokensRangeRequest=d={}));var f;(function(p){p.method="workspace/semanticTokens/refresh",p.messageDirection=n.MessageDirection.serverToClient,p.type=new n.ProtocolRequestType0(p.method)})(f||(e.SemanticTokensRefreshRequest=f={}))})),ng=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var n=Vt(),i;(function(o){o.method="window/showDocument",o.messageDirection=n.MessageDirection.serverToClient,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ShowDocumentRequest=i={}))})),rg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/linkedEditingRange",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.LinkedEditingRangeRequest=i={}))})),ig=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;var n=Vt(),i;(function(y){y.file="file",y.folder="folder"})(i||(e.FileOperationPatternKind=i={}));var o;(function(y){y.method="workspace/willCreateFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolRequestType(y.method)})(o||(e.WillCreateFilesRequest=o={}));var s;(function(y){y.method="workspace/didCreateFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolNotificationType(y.method)})(s||(e.DidCreateFilesNotification=s={}));var c;(function(y){y.method="workspace/willRenameFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolRequestType(y.method)})(c||(e.WillRenameFilesRequest=c={}));var d;(function(y){y.method="workspace/didRenameFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolNotificationType(y.method)})(d||(e.DidRenameFilesNotification=d={}));var f;(function(y){y.method="workspace/didDeleteFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolNotificationType(y.method)})(f||(e.DidDeleteFilesNotification=f={}));var p;(function(y){y.method="workspace/willDeleteFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolRequestType(y.method)})(p||(e.WillDeleteFilesRequest=p={}))})),ag=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var n=Vt(),i;(function(c){c.document="document",c.project="project",c.group="group",c.scheme="scheme",c.global="global"})(i||(e.UniquenessLevel=i={}));var o;(function(c){c.$import="import",c.$export="export",c.local="local"})(o||(e.MonikerKind=o={}));var s;(function(c){c.method="textDocument/moniker",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.MonikerRequest=s={}))})),og=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var n=Vt(),i;(function(c){c.method="textDocument/prepareTypeHierarchy",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.TypeHierarchyPrepareRequest=i={}));var o;(function(c){c.method="typeHierarchy/supertypes",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.TypeHierarchySupertypesRequest=o={}));var s;(function(c){c.method="typeHierarchy/subtypes",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.TypeHierarchySubtypesRequest=s={}))})),sg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var n=Vt(),i;(function(s){s.method="textDocument/inlineValue",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.InlineValueRequest=i={}));var o;(function(s){s.method="workspace/inlineValue/refresh",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(o||(e.InlineValueRefreshRequest=o={}))})),lg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var n=Vt(),i;(function(c){c.method="textDocument/inlayHint",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.InlayHintRequest=i={}));var o;(function(c){c.method="inlayHint/resolve",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.InlayHintResolveRequest=o={}));var s;(function(c){c.method="workspace/inlayHint/refresh",c.messageDirection=n.MessageDirection.serverToClient,c.type=new n.ProtocolRequestType0(c.method)})(s||(e.InlayHintRefreshRequest=s={}))})),cg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var n=ja(),i=ec(),o=Vt(),s;(function(y){function w(_){let C=_;return C&&i.boolean(C.retriggerRequest)}y.is=w})(s||(e.DiagnosticServerCancellationData=s={}));var c;(function(y){y.Full="full",y.Unchanged="unchanged"})(c||(e.DocumentDiagnosticReportKind=c={}));var d;(function(y){y.method="textDocument/diagnostic",y.messageDirection=o.MessageDirection.clientToServer,y.type=new o.ProtocolRequestType(y.method),y.partialResult=new n.ProgressType})(d||(e.DocumentDiagnosticRequest=d={}));var f;(function(y){y.method="workspace/diagnostic",y.messageDirection=o.MessageDirection.clientToServer,y.type=new o.ProtocolRequestType(y.method),y.partialResult=new n.ProgressType})(f||(e.WorkspaceDiagnosticRequest=f={}));var p;(function(y){y.method="workspace/diagnostic/refresh",y.messageDirection=o.MessageDirection.serverToClient,y.type=new o.ProtocolRequestType0(y.method)})(p||(e.DiagnosticRefreshRequest=p={}))})),ug=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;var n=(Eh(),Du(Ch)),i=ec(),o=Vt(),s;(function(T){T.Markup=1,T.Code=2;function I($){return $===1||$===2}T.is=I})(s||(e.NotebookCellKind=s={}));var c;(function(T){function I(F,N){let K={executionOrder:F};return(N===!0||N===!1)&&(K.success=N),K}T.create=I;function $(F){let N=F;return i.objectLiteral(N)&&n.uinteger.is(N.executionOrder)&&(N.success===void 0||i.boolean(N.success))}T.is=$;function V(F,N){return F===N?!0:F==null||N==null?!1:F.executionOrder===N.executionOrder&&F.success===N.success}T.equals=V})(c||(e.ExecutionSummary=c={}));var d;(function(T){function I(N,K){return{kind:N,document:K}}T.create=I;function $(N){let K=N;return i.objectLiteral(K)&&s.is(K.kind)&&n.DocumentUri.is(K.document)&&(K.metadata===void 0||i.objectLiteral(K.metadata))}T.is=$;function V(N,K){let pe=new Set;return N.document!==K.document&&pe.add("document"),N.kind!==K.kind&&pe.add("kind"),N.executionSummary!==K.executionSummary&&pe.add("executionSummary"),(N.metadata!==void 0||K.metadata!==void 0)&&!F(N.metadata,K.metadata)&&pe.add("metadata"),(N.executionSummary!==void 0||K.executionSummary!==void 0)&&!c.equals(N.executionSummary,K.executionSummary)&&pe.add("executionSummary"),pe}T.diff=V;function F(N,K){if(N===K)return!0;if(N==null||K==null||typeof N!=typeof K||typeof N!="object")return!1;let pe=Array.isArray(N),P=Array.isArray(K);if(pe!==P)return!1;if(pe&&P){if(N.length!==K.length)return!1;for(let A=0;A<N.length;A++)if(!F(N[A],K[A]))return!1}if(i.objectLiteral(N)&&i.objectLiteral(K)){let A=Object.keys(N),W=Object.keys(K);if(A.length!==W.length||(A.sort(),W.sort(),!F(A,W)))return!1;for(let de=0;de<A.length;de++){let fe=A[de];if(!F(N[fe],K[fe]))return!1}}return!0}})(d||(e.NotebookCell=d={}));var f;(function(T){function I(V,F,N,K){return{uri:V,notebookType:F,version:N,cells:K}}T.create=I;function $(V){let F=V;return i.objectLiteral(F)&&i.string(F.uri)&&n.integer.is(F.version)&&i.typedArray(F.cells,d.is)}T.is=$})(f||(e.NotebookDocument=f={}));var p;(function(T){T.method="notebookDocument/sync",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.RegistrationType(T.method)})(p||(e.NotebookDocumentSyncRegistrationType=p={}));var y;(function(T){T.method="notebookDocument/didOpen",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(y||(e.DidOpenNotebookDocumentNotification=y={}));var w;(function(T){function I(V){let F=V;return i.objectLiteral(F)&&n.uinteger.is(F.start)&&n.uinteger.is(F.deleteCount)&&(F.cells===void 0||i.typedArray(F.cells,d.is))}T.is=I;function $(V,F,N){let K={start:V,deleteCount:F};return N!==void 0&&(K.cells=N),K}T.create=$})(w||(e.NotebookCellArrayChange=w={}));var _;(function(T){T.method="notebookDocument/didChange",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(_||(e.DidChangeNotebookDocumentNotification=_={}));var C;(function(T){T.method="notebookDocument/didSave",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(C||(e.DidSaveNotebookDocumentNotification=C={}));var E;(function(T){T.method="notebookDocument/didClose",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(E||(e.DidCloseNotebookDocumentNotification=E={}))})),dg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineCompletionRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/inlineCompletion",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.InlineCompletionRequest=i={}))})),fg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangesFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.InlineCompletionRequest=e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=void 0;var n=Vt(),i=(Eh(),Du(Ch)),o=ec(),s=W0();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return s.ImplementationRequest}});var c=U0();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return c.TypeDefinitionRequest}});var d=K0();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return d.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return d.DidChangeWorkspaceFoldersNotification}});var f=Q0();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return f.ConfigurationRequest}});var p=G0();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return p.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return p.ColorPresentationRequest}});var y=J0();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return y.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return y.FoldingRangeRefreshRequest}});var w=X0();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return w.DeclarationRequest}});var _=Y0();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return _.SelectionRangeRequest}});var C=Z0();Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return C.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return C.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return C.WorkDoneProgressCancelNotification}});var E=eg();Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return E.CallHierarchyPrepareRequest}});var T=tg();Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return T.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return T.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return T.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return T.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return T.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return T.SemanticTokensRegistrationType}});var I=ng();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return I.ShowDocumentRequest}});var $=rg();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return $.LinkedEditingRangeRequest}});var V=ig();Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return V.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return V.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return V.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return V.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return V.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return V.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return V.WillDeleteFilesRequest}});var F=ag();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return F.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return F.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return F.MonikerRequest}});var N=og();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return N.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return N.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return N.TypeHierarchySupertypesRequest}});var K=sg();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return K.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return K.InlineValueRefreshRequest}});var pe=lg();Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return pe.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return pe.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return pe.InlayHintRefreshRequest}});var P=cg();Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return P.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return P.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return P.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return P.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return P.DiagnosticRefreshRequest}});var A=ug();Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return A.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return A.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return A.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return A.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return A.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return A.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidCloseNotebookDocumentNotification}});var W=dg();Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return W.InlineCompletionRequest}});var de;(function(M){function Ye(j){let te=j;return o.string(te)||o.string(te.language)||o.string(te.scheme)||o.string(te.pattern)}M.is=Ye})(de||(e.TextDocumentFilter=de={}));var fe;(function(M){function Ye(j){let te=j;return o.objectLiteral(te)&&(o.string(te.notebookType)||o.string(te.scheme)||o.string(te.pattern))}M.is=Ye})(fe||(e.NotebookDocumentFilter=fe={}));var we;(function(M){function Ye(j){let te=j;return o.objectLiteral(te)&&(o.string(te.notebook)||fe.is(te.notebook))&&(te.language===void 0||o.string(te.language))}M.is=Ye})(we||(e.NotebookCellTextDocumentFilter=we={}));var J;(function(M){function Ye(j){if(!Array.isArray(j))return!1;for(let te of j)if(!o.string(te)&&!de.is(te)&&!we.is(te))return!1;return!0}M.is=Ye})(J||(e.DocumentSelector=J={}));var be;(function(M){M.method="client/registerCapability",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(be||(e.RegistrationRequest=be={}));var Ce;(function(M){M.method="client/unregisterCapability",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(Ce||(e.UnregistrationRequest=Ce={}));var Z;(function(M){M.Create="create",M.Rename="rename",M.Delete="delete"})(Z||(e.ResourceOperationKind=Z={}));var re;(function(M){M.Abort="abort",M.Transactional="transactional",M.TextOnlyTransactional="textOnlyTransactional",M.Undo="undo"})(re||(e.FailureHandlingKind=re={}));var se;(function(M){M.UTF8="utf-8",M.UTF16="utf-16",M.UTF32="utf-32"})(se||(e.PositionEncodingKind=se={}));var Q;(function(M){function Ye(j){let te=j;return te&&o.string(te.id)&&te.id.length>0}M.hasId=Ye})(Q||(e.StaticRegistrationOptions=Q={}));var Le;(function(M){function Ye(j){let te=j;return te&&(te.documentSelector===null||J.is(te.documentSelector))}M.is=Ye})(Le||(e.TextDocumentRegistrationOptions=Le={}));var Fe;(function(M){function Ye(te){let ve=te;return o.objectLiteral(ve)&&(ve.workDoneProgress===void 0||o.boolean(ve.workDoneProgress))}M.is=Ye;function j(te){let ve=te;return ve&&o.boolean(ve.workDoneProgress)}M.hasWorkDoneProgress=j})(Fe||(e.WorkDoneProgressOptions=Fe={}));var et;(function(M){M.method="initialize",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(et||(e.InitializeRequest=et={}));var Be;(function(M){M.unknownProtocolVersion=1})(Be||(e.InitializeErrorCodes=Be={}));var je;(function(M){M.method="initialized",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(je||(e.InitializedNotification=je={}));var Pe;(function(M){M.method="shutdown",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType0(M.method)})(Pe||(e.ShutdownRequest=Pe={}));var Ae;(function(M){M.method="exit",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType0(M.method)})(Ae||(e.ExitNotification=Ae={}));var ft;(function(M){M.method="workspace/didChangeConfiguration",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(ft||(e.DidChangeConfigurationNotification=ft={}));var mt;(function(M){M.Error=1,M.Warning=2,M.Info=3,M.Log=4,M.Debug=5})(mt||(e.MessageType=mt={}));var Dn;(function(M){M.method="window/showMessage",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(Dn||(e.ShowMessageNotification=Dn={}));var un;(function(M){M.method="window/showMessageRequest",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(un||(e.ShowMessageRequest=un={}));var We;(function(M){M.method="window/logMessage",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(We||(e.LogMessageNotification=We={}));var tn;(function(M){M.method="telemetry/event",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(tn||(e.TelemetryEventNotification=tn={}));var wt;(function(M){M.None=0,M.Full=1,M.Incremental=2})(wt||(e.TextDocumentSyncKind=wt={}));var vn;(function(M){M.method="textDocument/didOpen",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(vn||(e.DidOpenTextDocumentNotification=vn={}));var vr;(function(M){function Ye(te){let ve=te;return ve!=null&&typeof ve.text=="string"&&ve.range!==void 0&&(ve.rangeLength===void 0||typeof ve.rangeLength=="number")}M.isIncremental=Ye;function j(te){let ve=te;return ve!=null&&typeof ve.text=="string"&&ve.range===void 0&&ve.rangeLength===void 0}M.isFull=j})(vr||(e.TextDocumentContentChangeEvent=vr={}));var pt;(function(M){M.method="textDocument/didChange",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(pt||(e.DidChangeTextDocumentNotification=pt={}));var Fr;(function(M){M.method="textDocument/didClose",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(Fr||(e.DidCloseTextDocumentNotification=Fr={}));var nn;(function(M){M.method="textDocument/didSave",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(nn||(e.DidSaveTextDocumentNotification=nn={}));var mi;(function(M){M.Manual=1,M.AfterDelay=2,M.FocusOut=3})(mi||(e.TextDocumentSaveReason=mi={}));var On;(function(M){M.method="textDocument/willSave",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(On||(e.WillSaveTextDocumentNotification=On={}));var br;(function(M){M.method="textDocument/willSaveWaitUntil",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(br||(e.WillSaveTextDocumentWaitUntilRequest=br={}));var Pn;(function(M){M.method="workspace/didChangeWatchedFiles",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(Pn||(e.DidChangeWatchedFilesNotification=Pn={}));var dn;(function(M){M.Created=1,M.Changed=2,M.Deleted=3})(dn||(e.FileChangeType=dn={}));var ta;(function(M){function Ye(j){let te=j;return o.objectLiteral(te)&&(i.URI.is(te.baseUri)||i.WorkspaceFolder.is(te.baseUri))&&o.string(te.pattern)}M.is=Ye})(ta||(e.RelativePattern=ta={}));var gi;(function(M){M.Create=1,M.Change=2,M.Delete=4})(gi||(e.WatchKind=gi={}));var Ut;(function(M){M.method="textDocument/publishDiagnostics",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(Ut||(e.PublishDiagnosticsNotification=Ut={}));var yi;(function(M){M.Invoked=1,M.TriggerCharacter=2,M.TriggerForIncompleteCompletions=3})(yi||(e.CompletionTriggerKind=yi={}));var fn;(function(M){M.method="textDocument/completion",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(fn||(e.CompletionRequest=fn={}));var ni;(function(M){M.method="completionItem/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ni||(e.CompletionResolveRequest=ni={}));var zt;(function(M){M.method="textDocument/hover",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(zt||(e.HoverRequest=zt={}));var Br;(function(M){M.Invoked=1,M.TriggerCharacter=2,M.ContentChange=3})(Br||(e.SignatureHelpTriggerKind=Br={}));var _t;(function(M){M.method="textDocument/signatureHelp",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(_t||(e.SignatureHelpRequest=_t={}));var vi;(function(M){M.method="textDocument/definition",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(vi||(e.DefinitionRequest=vi={}));var na;(function(M){M.method="textDocument/references",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(na||(e.ReferencesRequest=na={}));var wr;(function(M){M.method="textDocument/documentHighlight",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(wr||(e.DocumentHighlightRequest=wr={}));var Jt;(function(M){M.method="textDocument/documentSymbol",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Jt||(e.DocumentSymbolRequest=Jt={}));var Ge;(function(M){M.method="textDocument/codeAction",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Ge||(e.CodeActionRequest=Ge={}));var gt;(function(M){M.method="codeAction/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(gt||(e.CodeActionResolveRequest=gt={}));var xt;(function(M){M.method="workspace/symbol",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(xt||(e.WorkspaceSymbolRequest=xt={}));var kt;(function(M){M.method="workspaceSymbol/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(kt||(e.WorkspaceSymbolResolveRequest=kt={}));var zn;(function(M){M.method="textDocument/codeLens",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(zn||(e.CodeLensRequest=zn={}));var _r;(function(M){M.method="codeLens/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(_r||(e.CodeLensResolveRequest=_r={}));var St;(function(M){M.method="workspace/codeLens/refresh",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType0(M.method)})(St||(e.CodeLensRefreshRequest=St={}));var ir;(function(M){M.method="textDocument/documentLink",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ir||(e.DocumentLinkRequest=ir={}));var Mn;(function(M){M.method="documentLink/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Mn||(e.DocumentLinkResolveRequest=Mn={}));var Hr;(function(M){M.method="textDocument/formatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Hr||(e.DocumentFormattingRequest=Hr={}));var bn;(function(M){M.method="textDocument/rangeFormatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(bn||(e.DocumentRangeFormattingRequest=bn={}));var ar;(function(M){M.method="textDocument/rangesFormatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ar||(e.DocumentRangesFormattingRequest=ar={}));var bi;(function(M){M.method="textDocument/onTypeFormatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(bi||(e.DocumentOnTypeFormattingRequest=bi={}));var ri;(function(M){M.Identifier=1})(ri||(e.PrepareSupportDefaultBehavior=ri={}));var Ln;(function(M){M.method="textDocument/rename",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Ln||(e.RenameRequest=Ln={}));var wi;(function(M){M.method="textDocument/prepareRename",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(wi||(e.PrepareRenameRequest=wi={}));var Fn;(function(M){M.method="workspace/executeCommand",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Fn||(e.ExecuteCommandRequest=Fn={}));var or;(function(M){M.method="workspace/applyEdit",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType("workspace/applyEdit")})(or||(e.ApplyWorkspaceEditRequest=or={}))})),pg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var n=ja();function i(o,s,c,d){return n.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,n.createMessageConnection)(o,s,c,d)}e.createProtocolConnection=i})),hg=Ee((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,f,p){p===void 0&&(p=f);var y=Object.getOwnPropertyDescriptor(d,f);(!y||("get"in y?!d.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(c,p,y)}):(function(c,d,f,p){p===void 0&&(p=f),c[p]=d[f]})),i=e&&e.__exportStar||function(c,d){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&n(d,c,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,i(ja(),e),i((Eh(),Du(Ch)),e),i(Vt(),e),i(fg(),e);var o=pg();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return o.createProtocolConnection}});var s;(function(c){c.lspReservedErrorRangeStart=-32899,c.RequestFailed=-32803,c.ServerCancelled=-32802,c.ContentModified=-32801,c.RequestCancelled=-32800,c.lspReservedErrorRangeEnd=-32800})(s||(e.LSPErrorCodes=s={}))})),Vu=Ee((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,f,p){p===void 0&&(p=f);var y=Object.getOwnPropertyDescriptor(d,f);(!y||("get"in y?!d.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(c,p,y)}):(function(c,d,f,p){p===void 0&&(p=f),c[p]=d[f]})),i=e&&e.__exportStar||function(c,d){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&n(d,c,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var o=Ad();i(Ad(),e),i(hg(),e);function s(c,d,f,p){return(0,o.createMessageConnection)(c,d,f,p)}e.createProtocolConnection=s}));function yn(e,n){if(n.line>=e.lines)return n.character===0?e.length:void 0;let i=e.line(n.line+1).from+n.character;if(!(i>e.length))return i}function Ir(e,n){return yn(e,n)||0}function Xi(e,n){let i=e.lineAt(n);return{character:n-i.from,line:i.number-1}}var tc=new Sw.Renderer,ek=tc.code;tc.code=e=>e.text.trim()?ek.call(tc,e):"";function mg(e){return Sw(e,{async:!1,gfm:!0,breaks:!0,renderer:tc})}function Ar(e,n=mg){if(!e)return"";if(ik(e)){let i=e.value;return e.kind==="markdown"&&(i=n(i.trim())),i}return Array.isArray(e)?e.map(i=>Ar(i,n)).filter(Boolean).join(`
47
47
 
48
48
  `):typeof e=="string"?e:""}function tk(e){if(e.length===0)return"";if(e.length===1)return e[0]||"";e.sort();let n=e[0]||"",i=e[e.length-1]||"",o=0;for(;o<n.length&&n[o]===i[o];)o++;return n.substring(0,o)}function nk(e){if(e.length===0)return;let n=tk(e.map(s=>{var c;return((c=s.textEdit)==null?void 0:c.newText)||s.label}));if(n==="")return;let i=[];for(let s=0;s<n.length;s++){let c=n.slice(0,s+1);if(c.length>0){let d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i.push(d)}}let o=i.join("|");return RegExp(`(${o})$`)}function rk(e){return(e==null?void 0:e.range)!==void 0}function ik(e){return e.kind!==void 0}function nr(e,n){let i=document.createElement("div");i.className="cm-error-message",i.style.cssText=`
49
49
  position: absolute;
@@ -56,24 +56,24 @@ ${JSON.stringify(j,null,4)}`);let te=j;if(i.string(te.id)||i.number(te.id)){let
56
56
  z-index: 100;
57
57
  max-width: 300px;
58
58
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
59
- `,i.textContent=n;let o=e.coordsAtPos(e.state.selection.main.head);o&&(i.style.left=`${o.left}px`,i.style.top=`${o.bottom+5}px`),document.body.appendChild(i),setTimeout(()=>{i.style.opacity="0",i.style.transition="opacity 0.2s",setTimeout(()=>i.remove(),200)},3e3)}function rc(e){if(e==null)return!0;if(Array.isArray(e))return e.length===0||e.every(rc);if(typeof e=="string")return gg(e);let n=e.value;return typeof n=="string"?gg(n):!1}function gg(e){return e==null?!0:typeof e=="string"?e.trim()===""||/^[\s\n`]*$/.test(e):!1}function ak(e,n){let i=[];return n.iterChanges((o,s,c,d,f)=>{let p=f.toString();if(o===0&&s===e.length){i.push({text:p});return}let y=Xi(e,o),w=Xi(e,s);i.push({range:{start:y,end:w},text:p})}),i.sort((o,s)=>{if(!o.range)return 1;if(!s.range)return-1;let c=o.range.start.line??-1,d=s.range.start.line??-1;if(c!==d)return d-c;let f=o.range.start.character??-1;return(s.range.start.character??-1)-f}),i}var ok=Vu(),sk=Object.fromEntries(Object.entries(ok.CompletionItemKind).map(([e,n])=>[n,e])),yg;(function(e){e.PlainText=1,e.Snippet=2})(yg||(yg={}));function lk(e){return e.replaceAll(/\\\\/g,"").replaceAll(/(\$(\d+))/g,(n,i,o)=>"${"+o+"}")}function ck(e,n){let{detail:i,labelDetails:o,label:s,kind:c,textEdit:d,insertText:f,documentation:p,additionalTextEdits:y,insertTextFormat:w}=e,_={label:s,detail:(o==null?void 0:o.detail)||i,apply(C,E,T,I){if(d&&rk(d)?C.dispatch(_w(C.state,d.newText,Ir(C.state.doc,d.range.start),Ir(C.state.doc,d.range.end))):f&&w===yg.Snippet&&n.useSnippetOnCompletion?lD(lk(f))(C,null,T,I):C.dispatch(_w(C.state,s,T,I)),!y)return;let $=y.sort(({range:{end:V}},{range:{end:F}})=>Ir(C.state.doc,V)<Ir(C.state.doc,F)?1:Ir(C.state.doc,V)>Ir(C.state.doc,F)?-1:0);for(let V of $)C.dispatch(C.state.update({changes:{from:Ir(C.state.doc,V.range.start),to:yn(C.state.doc,V.range.end),insert:V.newText}}))},type:c&&sk[c].toLowerCase()};return n.hasResolveProvider&&n.resolveItem?_.info=async()=>{var C;try{let E=await((C=n.resolveItem)==null?void 0:C.call(n,e)),T=document.createElement("div");T.classList.add("documentation");let I=(E==null?void 0:E.documentation)||p;return!I||rc(I)?null:(n.allowHTMLContent?T.innerHTML=Ar(I,n.markdownRenderer):T.textContent=Ar(I,n.markdownRenderer),T)}catch(E){if(console.error("Failed to resolve completion item:",E),rc(p))return null;if(p){let T=document.createElement("div");return T.classList.add("documentation"),n.allowHTMLContent?T.innerHTML=Ar(p,n.markdownRenderer):T.textContent=Ar(p,n.markdownRenderer),T}return null}}:p&&(_.info=()=>{let C=document.createElement("div");return C.classList.add("documentation"),n.allowHTMLContent?C.innerHTML=Ar(p,n.markdownRenderer):C.textContent=Ar(p,n.markdownRenderer),C}),_}function uk(e,n,i){let o=[n?dk(n):fk,i==="python"?pk:void 0].filter(Boolean),s=e;if(n){let c=n.toLowerCase();/^\w+$/.test(c)&&(s=s.filter(({label:d,filterText:f})=>(f??d).toLowerCase().startsWith(c)))}for(let c of o)s.sort(c);return s}function dk(e){return(n,i)=>{let o=n.sortText??n.label,s=i.sortText??i.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 fk(e,n){let i=e.sortText??e.label,o=n.sortText??n.label;return i.localeCompare(o)}function pk(e,n){let i=e.label.endsWith("="),o=n.label.endsWith("=");return i&&!o?-1:!i&&o?1:0}function vg(e){let n=new Proxy({},{get(){throw Error(e)}});return function(i){return i.at(-1)??n}}const bg=Ol.define({combine:vg("No document URI provided. Either pass a one into the extension or use documentUri.of().")}),hk=Ol.define({combine:vg("No language ID provided. Either pass a one into the extension or use languageId.of().")});let qd,wg;qd=zl(),wg=1e4,jl=class{constructor({rootUri:e,workspaceFolders:n,transport:i,initializationOptions:o,capabilities:s,timeout:c=wg,getWorkspaceConfiguration:d}){ke(this,"ready");ke(this,"capabilities");ke(this,"initializePromise");ke(this,"rootUri");ke(this,"workspaceFolders");ke(this,"timeout");ke(this,"transport");ke(this,"requestManager");ke(this,"client");ke(this,"initializationOptions");ke(this,"clientCapabilities");ke(this,"notificationListeners",new Set);this.rootUri=e,this.workspaceFolders=n,this.transport=i,this.initializationOptions=o,this.clientCapabilities=s,this.timeout=c,this.ready=!1,this.capabilities=null,this.requestManager=new qd.RequestManager([this.transport]),this.client=new qd.Client(this.requestManager),this.client.onNotification(p=>{this.processNotification(p)});let f=this.transport;f!=null&&f.connection&&f.connection.addEventListener("message",p=>{let y=JSON.parse(p.data);y.method==="workspace/configuration"&&d?f.connection.send(JSON.stringify({jsonrpc:"2.0",id:y.id,result:d(y.params)})):y.method&&y.id&&f.connection.send(JSON.stringify({jsonrpc:"2.0",id:y.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,i){return this.client.request({method:e,params:n},i)}notify(e,n){return this.client.notify({method:e,params:n})}processNotification(e){this.notificationListeners.forEach(n=>n(e))}},zl();var Yi=Vu(),_g=console.log;function mk(){return String(Date.now()+Math.random())}let jd;Il=Bi.define(),Gl=xs.define({create:()=>null,update(e,n){for(let i of n.effects)if(i.is(Il))return i.value;if(e&&n.docChanged){let i=n.changes.mapPos(e.pos),o=e.end==null?void 0:n.changes.mapPos(e.end);return{...e,pos:i,end:o}}return e},provide:e=>C4.from(e)}),jd=D4.define();var gk=20,yk=class{constructor(e){ke(this,"documentVersion");ke(this,"pluginId");ke(this,"client");ke(this,"documentUri");ke(this,"languageId");ke(this,"view");ke(this,"allowHTMLContent");ke(this,"useSnippetOnCompletion");ke(this,"sendIncrementalChanges");ke(this,"featureOptions");ke(this,"onGoToDefinition");ke(this,"markdownRenderer");ke(this,"disposeListener");ke(this,"lastSeenDiagnosticsVersion",0);let{client:n,documentUri:i,languageId:o,view:s,featureOptions:c,sendIncrementalChanges:d=!0,allowHTMLContent:f=!1,useSnippetOnCompletion:p=!1,onGoToDefinition:y,markdownRenderer:w=mg}=e;this.documentVersion=0,this.pluginId=mk(),this.client=n,this.documentUri=i,this.languageId=o,this.view=s,this.allowHTMLContent=f,this.useSnippetOnCompletion=p,this.sendIncrementalChanges=d,this.featureOptions=c,this.onGoToDefinition=y,this.markdownRenderer=w,this.disposeListener=n.onNotification(this.processNotification.bind(this)),this.initialize({documentText:this.view.state.doc.toString()})}update({state:e,docChanged:n,startState:{doc:i},changes:o}){n&&(this.sendIncrementalChanges?this.sendChanges(ak(i,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:i}){var y;if(!this.featureOptions.hoverEnabled||!(this.client.ready&&((y=this.client.capabilities)!=null&&y.hoverProvider)))return null;let o=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:n,character:i}});if(!o)return null;let{contents:s,range:c}=o,d=yn(e.state.doc,{line:n,character:i}),f;if(c&&(d=yn(e.state.doc,c.start),f=yn(e.state.doc,c.end)),d==null||rc(s))return null;let p=document.createElement("div");return p.classList.add("documentation","cm-lsp-hover-tooltip"),this.allowHTMLContent?p.innerHTML=Ar(s,this.markdownRenderer):p.textContent=Ar(s,this.markdownRenderer),{pos:d,end:f,create:w=>({dom:p}),above:!0}}async requestCompletion(e,{line:n,character:i},{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:i},context:{triggerKind:o,triggerCharacter:s}});if(!c)return null;let d="items"in c?c.items:c,f=nk(d),p=f?e.matchBefore(f):e.matchBefore(/[a-zA-Z0-9]+/),{pos:y}=e,w=uk(d,p==null?void 0:p.text,this.languageId);p&&(y=p.from);let _=w.map(E=>{var T,I;return ck(E,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:((I=(T=this.client.capabilities)==null?void 0:T.completionProvider)==null?void 0:I.resolveProvider)??!1,resolveItem:this.client.completionItemResolve.bind(this.client)})});return{from:y,options:_,filter:!1}}async requestDefinition(e,{line:n,character:i}){var w;if(!this.featureOptions.definitionEnabled||!(this.client.ready&&((w=this.client.capabilities)!=null&&w.definitionProvider)))return;let o=await this.client.textDocumentDefinition({textDocument:{uri:this.documentUri},position:{line:n,character:i}});if(!o)return;let s=Array.isArray(o)?o:[o];if(s.length===0)return;let c=s[0];if(!c)return;let d="uri"in c?c.uri:c.targetUri,f="range"in c?c.range:c.targetRange,p=d!==this.documentUri,y={uri:d,range:f,isExternalDocument:p};return p||e.dispatch(e.state.update({selection:{anchor:Ir(e.state.doc,f.start),head:yn(e.state.doc,f.end)}})),this.onGoToDefinition&&this.onGoToDefinition(y),y}processNotification(e){try{e.method==="textDocument/publishDiagnostics"&&this.processDiagnostics(e.params)}catch(n){_g(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={[Yi.DiagnosticSeverity.Error]:"error",[Yi.DiagnosticSeverity.Warning]:"warning",[Yi.DiagnosticSeverity.Information]:"info",[Yi.DiagnosticSeverity.Hint]:"info"},i=e.diagnostics.map(async({range:s,message:c,severity:d,code:f,source:p})=>{var w;let y=(w=await this.requestCodeActions(s,[f]))==null?void 0:w.map(_=>{var C;return{name:"command"in _&&typeof _.command=="object"&&((C=_.command)==null?void 0:C.title)||_.title,apply:async()=>{var E;if("edit"in _&&((E=_.edit)!=null&&E.changes)){let T=_.edit.changes[this.documentUri];if(!T)return;for(let I of T)this.view.dispatch(this.view.state.update({changes:{from:Ir(this.view.state.doc,I.range.start),to:yn(this.view.state.doc,I.range.end),insert:I.newText}}))}"command"in _&&_.command&&_g("Executing command:",_.command)}}});return{from:Ir(this.view.state.doc,s.start),to:Ir(this.view.state.doc,s.end),severity:n[d??Yi.DiagnosticSeverity.Error],message:c,renderMessage:()=>{let _=document.createElement("div");return _.innerHTML=this.markdownRenderer(c),_},source:p||this.languageId,markClass:this.pluginId,actions:y}}),o=await Promise.all(i);this.addDiagnostics(o)}addDiagnostics(e){if(e.length===0)return;let n=this.view.state,i=[];Y4(n,c=>(i.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(vw(n,[...s,...e]))}clearDiagnostics(){this.view.dispatch(vw(this.view.state,[]))}async requestCodeActions(e,n){var i;return!this.featureOptions.codeActionsEnabled||!(this.client.ready&&((i=this.client.capabilities)!=null&&i.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:i}){var o;if(this.featureOptions.renameEnabled){if(!this.client.ready){nr(e,"Language server not ready");return}if(!((o=this.client.capabilities)!=null&&o.renameProvider)){nr(e,"Rename not supported by language server");return}try{let s=await this.client.textDocumentPrepareRename({textDocument:{uri:this.documentUri},position:{line:n,character:i}}).catch(()=>this.prepareRenameFallback(e,{line:n,character:i}));if(!s||"defaultBehavior"in s){nr(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 d=document.createElement("input");d.type="text",d.style.cssText="width: 200px; padding: 4px; border: 1px solid #ddd;";let f="range"in s?s.range:s,p=yn(e.state.doc,f.start);if(p==null)return;let y=yn(e.state.doc,f.end);d.value=e.state.doc.sliceString(p,y),c.appendChild(d);let w=e.coordsAtPos(p);if(!w)return;c.style.left=`${w.left}px`,c.style.top=`${w.bottom+5}px`;let _=async()=>{let E=d.value.trim();if(!E){nr(e,"New name cannot be empty"),c.remove();return}if(E===d.defaultValue){c.remove();return}try{let T=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:n,character:i},newName:E});await this.applyRenameEdit(e,T)}catch(T){nr(e,`Rename failed: ${T instanceof Error?T.message:"Unknown error"}`)}finally{c.remove()}};d.addEventListener("keydown",E=>{E.key==="Enter"?_():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),d.focus(),d.select()}catch(s){nr(e,`Rename failed: ${s instanceof Error?s.message:"Unknown error"}`)}}}async requestSignatureHelp(e,{line:n,character:i},o=void 0){var s,c,d;if(!(this.featureOptions.signatureHelpEnabled&&this.client.ready&&((s=this.client.capabilities)!=null&&s.signatureHelpProvider)))return null;try{let f=await this.client.textDocumentSignatureHelp({textDocument:{uri:this.documentUri},position:{line:n,character:i},context:{isRetrigger:!1,triggerKind:1,triggerCharacter:o}});if(!(f!=null&&f.signatures)||f.signatures.length===0)return null;let p=this.createTooltipContainer(),y=f.activeSignature??0,w=f.signatures[y]||f.signatures[0];if(!w)return null;let _=f.activeParameter??w.activeParameter??0,C=this.createSignatureElement(w,_);p.appendChild(C),w.documentation&&p.appendChild(this.createDocumentationElement(w.documentation));let E=(c=w.parameters)==null?void 0:c[_];E!=null&&E.documentation&&p.appendChild(this.createParameterDocElement(E.documentation));let T=yn(e.state.doc,{line:n,character:i});return T==null?null:{pos:T,end:T,create:I=>({dom:p}),above:((d=this.featureOptions.signatureHelpOptions)==null?void 0:d.position)==="above"}}catch(f){return console.error("Signature help error:",f),null}}async showSignatureHelpTooltip(e,n,i){let o=await this.requestSignatureHelp(e,Xi(e.state.doc,n),i);e.dispatch({effects:Il.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 i=document.createElement("div");if(i.classList.add("cm-signature"),i.style.cssText="font-family: monospace; margin-bottom: 4px;",!e.label||typeof e.label!="string")return i.textContent="Signature information unavailable",i;let o=e.label,s=e.parameters||[];if(s.length===0||!s[n])return i.textContent=o,i;let c=s[n].label;return typeof c=="string"?this.allowHTMLContent?i.innerHTML=o.replace(c,`<strong class="cm-signature-active-param">${c}</strong>`):i.textContent=o.replace(c,`\xAB${c}\xBB`):Array.isArray(c)&&c.length===2?this.applyRangeHighlighting(i,o,c[0],c[1]):i.textContent=o,i}applyRangeHighlighting(e,n,i,o){e.textContent="";let s=n.substring(0,i),c=n.substring(i,o),d=n.substring(o);e.appendChild(document.createTextNode(s));let f=document.createElement("span");f.classList.add("cm-signature-active-param"),f.style.cssText="font-weight: bold; text-decoration: underline;",f.textContent=c,e.appendChild(f),e.appendChild(document.createTextNode(d))}createDocumentationElement(e){let n=document.createElement("div");n.classList.add("cm-signature-docs"),n.style.cssText="margin-top: 4px; color: #666;";let i=Ar(e,this.markdownRenderer);return this.allowHTMLContent?n.innerHTML=i:n.textContent=i,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 i=Ar(e,this.markdownRenderer);return this.allowHTMLContent?n.innerHTML=i:n.textContent=i,n}prepareRenameFallback(e,{line:n,character:i}){let o=e.state.doc.line(n+1).text,s=/\w+/g,c,d=i,f=i;for(;(c=s.exec(o))!==null;){let p=c.index,y=c.index+c[0].length;if(i>=p&&i<=y){d=p,f=y;break}}return d===i&&f===i?null:{range:{start:{line:n,character:d},end:{line:n,character:f}},placeholder:o.slice(d,f)}}async applyRenameEdit(e,n){if(!n)return nr(e,"No edit returned from language server"),!1;let i=n.changes??{},o=n.documentChanges??[];if(Object.keys(i).length===0&&o.length===0)return nr(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){nr(e,"Multi-file rename not supported yet");continue}let c=s.edits.sort((d,f)=>{let p=yn(e.state.doc,d.range.start);return(yn(e.state.doc,f.range.start)??0)-(p??0)}).map(d=>({from:yn(e.state.doc,d.range.start)??0,to:yn(e.state.doc,d.range.end)??0,insert:d.newText}));return e.dispatch(e.state.update({changes:c})),!0}return nr(e,"File creation, deletion, or renaming operations not supported yet"),!1}else if(Object.keys(i).length>0)for(let[s,c]of Object.entries(i)){if(s!==this.documentUri){nr(e,"Multi-file rename not supported yet");continue}let d=c.sort((f,p)=>{let y=yn(e.state.doc,f.range.start);return(yn(e.state.doc,p.range.start)??0)-(y??0)}).map(f=>({from:yn(e.state.doc,f.range.start)??0,to:yn(e.state.doc,f.range.end)??0,insert:f.newText}));e.dispatch(e.state.update({changes:d}))}return!1}};bm=function(e){var d;let n=null,i={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=[Pl.define(f=>(n=new yk({client:o,documentUri:e.documentUri??f.state.facet(bg),languageId:e.languageId??f.state.facet(hk),view:f,featureOptions:s,sendIncrementalChanges:e.sendIncrementalChanges,allowHTMLContent:e.allowHTMLContent,useSnippetOnCompletion:e.useSnippetOnCompletion,onGoToDefinition:e.onGoToDefinition,markdownRenderer:e.markdownRenderer}),n))];if(c.push(Ra.of([{key:i.signatureHelp,run:f=>{if(!(n&&s.signatureHelpEnabled))return!1;let p=f.state.selection.main.head;return n.showSignatureHelpTooltip(f,p),!0}},{key:i.rename,run:f=>{if(!(n&&s.renameEnabled))return!1;let p=f.state.selection.main.head;return n.requestRename(f,Xi(f.state.doc,p)),!0}},{key:i.goToDefinition,run:f=>{if(!(n&&s.definitionEnabled))return!1;let p=f.state.selection.main.head;return n.requestDefinition(f,Xi(f.state.doc,p)).catch(y=>nr(f,`Go to definition failed: ${y instanceof Error?y.message:"Unknown error"}`)),!0}}])),s.hoverEnabled&&c.push(xh((f,p)=>n==null?null:n.requestHoverTooltip(f,Xi(f.state.doc,p)),e.hoverConfig)),s.signatureHelpEnabled){c.push(Gl);let f=p=>p.state.field(Gl)?(p.dispatch({effects:Il.of(null)}),!0):!1;c.push(Kt.domEventHandlers({mousedown:(p,y)=>(f(y),!1)})),c.push(Ra.of([{key:")",run:p=>(f(p),!1)},{key:"Escape",run:p=>f(p)}])),c.push(Kt.updateListener.of(p=>{if(!(n&&s.signatureActivateOnTyping)||!p.state.field(Gl)||!(p.selectionSet||p.docChanged))return;let y=p.state.selection.main.head;_k(p.state.doc,y)||f(p.view)})),c.push(Kt.updateListener.of(async p=>{var E;if(!(n&&p.docChanged)||p.transactions.some(T=>T.annotation(jd))||!((E=n.client.capabilities)!=null&&E.signatureHelpProvider)||!s.signatureActivateOnTyping)return;let y=n.client.capabilities.signatureHelpProvider.triggerCharacters||["(",","],w=p.changes,_=-1,C;w.iterChanges((T,I,$,V,F)=>{if(_>=0)return;let N=bk(F.toString(),$,y);N&&(_=N.triggerPos,C=N.triggerCharacter)}),_>=0&&n.showSignatureHelpTooltip(p.view,_,C)}))}return s.completionEnabled&&c.push(Iu({...e.completionConfig,override:[async f=>{var _,C;if(n==null)return null;let{state:p,pos:y}=f,w=vk(f,((C=(_=n.client.capabilities)==null?void 0:_.completionProvider)==null?void 0:C.triggerCharacters)??[],e.completionMatchBefore);return w==null?null:await n.requestCompletion(f,Xi(p.doc,y),w)},...((d=e.completionConfig)==null?void 0:d.override)||[]]})),c.push(Kt.domEventHandlers({click:(f,p)=>{if(s.definitionEnabled&&i.goToDefinition==="ctrlcmd"&&(f.ctrlKey||f.metaKey)){let y=p.posAtCoords({x:f.clientX,y:f.clientY});y&&n&&(n.requestDefinition(p,Xi(p.state.doc,y)).catch(w=>nr(p,`Go to definition failed: ${w instanceof Error?w.message:"Unknown error"}`)),f.preventDefault())}}})),c};function vk(e,n,i){let{state:o,pos:s,explicit:c}=e,d=o.doc.lineAt(s),f=Yi.CompletionTriggerKind.Invoked,p,y=d.text[s-d.from-1]||"",w=n==null?void 0:n.includes(y);return!c&&w&&(f=Yi.CompletionTriggerKind.TriggerCharacter,p=y),f===Yi.CompletionTriggerKind.Invoked&&!e.matchBefore(i||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:f,triggerCharacter:p}}function bk(e,n,i){if(!e)return null;for(let o of i){let s=e.indexOf(o);if(s!==-1)return{triggerPos:n+s+1,triggerCharacter:o}}return null}function wk(e){let n=0;for(let i of e)i==="("?n++:i===")"&&n--;return n}function _k(e,n,i=gk){let o=e.lineAt(n),s=Math.max(1,o.number-i),c=e.line(s).from;return wk(e.sliceString(c,n))>0}Wu=function(e,n,i={}){let{preserveCursor:o=!0,effects:s,userEvent:c}=i,d=e.state.doc;if(d.toString()!==n)if(o&&e.hasFocus){let f=e.state.selection.main.head,p=d.lineAt(f),y=p.number,w=f-p.from,_=e.state.update({changes:{from:0,to:d.length,insert:n}}).state.doc,C;if(y<=_.lines){let E=_.line(y),T=E.length;C=E.from+Math.min(w,T)}else C=_.line(_.lines).to;e.dispatch({changes:{from:0,to:d.length,insert:n},annotations:jd.of(!0),selection:{anchor:C},effects:s,userEvent:c})}else e.dispatch({changes:{from:0,to:d.length,insert:n},effects:s,userEvent:c})},bo=function(){return Ol.define({combine:e=>e.find(n=>n!==void 0)})};const xg=bo(),kg=bo(),zd=bo(),ic=bo(),Sg=bo();Bw=function({cellId:e,completionConfig:n,hotkeys:i,placeholderType:o,lspConfig:s,diagnosticsConfig:c}){return[ic.of(e),xg.of(n),kg.of(i),zd.of(o),Sg.of({...s,diagnostics:c})]},Qu=new Lu;function xk(e){return Object.values(e.cellRuntime).some(n=>n.status==="running")}function kk(e){return Object.values(e.cellRuntime).filter(n=>n.status==="running"||n.status==="queued").length}function Sk(e){return Mm(e).length>0}Aw=function(e){return e.cellIds.inOrderIds.map(n=>e.cellData[n])};function Ck({cellHandles:e}){let n={};for(let[i,o]of ui.entries(e))o.current&&(n[i]=o.current.editorView);return n}Nm=function(e){let{cellIds:n,cellData:i}=e,o=[];for(let s of n.inOrderIds)i[s].config.disabled&&o.push(s);return o},pm=function(e){let{cellIds:n,cellData:i}=e,o=[];for(let s of n.inOrderIds)i[s].config.disabled||o.push(s);return o};function Ek(e){return e.history.length>0}px=function(e,n){let i=e.cellIds.findWithId(n).getDescendants(n);return{stale:i.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:i.some(o=>{var s;return(s=e.cellRuntime[o])==null?void 0:s.errored}),runningOrQueued:i.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"})}},Mm=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.inOrderIds.filter(s=>nm({executionTime:o[s].runElapsedTimeMs??i[s].lastExecutionTime,status:o[s].status,errored:o[s].errored,interrupted:o[s].interrupted,stopped:o[s].stopped})||i[s].edited||o[s].interrupted||o[s].staleInputs&&!(o[s].status==="disabled-transitively"||i[s].config.disabled))},nm=function({executionTime:e,status:n,errored:i,interrupted:o,stopped:s}){return e===null&&n!=="queued"&&n!=="running"&&!(i||o||s)},Pt=Ol.define({combine:e=>e[0]}),Ui=Ol.define({combine:e=>e[0]});var Tk={...Th,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"};const Cg=Rh.define(Tk),Eg=Rh.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 Rk=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 ac(e){return Rk.has(e)}function Tg(e){let n=e.dialect;if(!ac(n))return Ee.debug("Unknown dialect",{dialect:n}),Ds;switch(n){case"postgresql":case"postgres":return Th;case"mysql":return pD;case"sqlite":return dD;case"mssql":case"sqlserver":case"microsoft sql server":return mD;case"duckdb":return Eg;case"mariadb":return gD;case"cassandra":return yD;case"oracledb":case"oracle":return uD;case"bigquery":return Cg;case"timescaledb":return Th;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 Ee.debug("Unsupported dialect",{dialect:n}),Ds;default:return _s(n),Ds}}var Dk={...hD,caseInsensitiveIdentifiers:!0,identifierQuotes:"'"};let Ds;Ds=Rh.define(Dk),$i="__marimo_duckdb",ko=new Set([$i]),H_="memory",Kl=function(e){return e===""};var Os={formatTableName:e=>e,formatSelectClause:(e,n)=>`SELECT ${e} FROM ${n} LIMIT 100`};function Ok(e){if(e=e.toLowerCase(),!ac(e))return Os;switch(e){case"bigquery":{let n=Cg.spec.identifierQuotes;return{formatTableName:i=>`${n}${i}${n}`,formatSelectClause:Os.formatSelectClause}}case"mssql":case"sqlserver":case"microsoft sql server":return{formatTableName:Os.formatTableName,formatSelectClause:(n,i)=>`SELECT TOP 100 ${n} FROM ${i}`};case"timescaledb":case"postgres":case"postgresql":case"duckdb":return{formatTableName:n=>n.split(".").map(i=>`"${i}"`).join("."),formatSelectClause:(n,i)=>`SELECT ${n==="*"?"*":`"${n}"`} FROM ${i} 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 Os;default:return _s(e),Os}}G_=function({table:e,columnName:n,sqlTableContext:i}){if(i){let{engine:o,schema:s,defaultSchema:c,defaultDatabase:d,database:f,dialect:p}=i,y=e.name;Kl(s)?y=f===d?y:`${f}.${y}`:(s!==c&&(y=`${s}.${y}`),f!==d&&(y=`${f}.${y}`));let w=Ok(p),_=w.formatTableName(y),C=w.formatSelectClause(n,_);return o==="__marimo_duckdb"?`_df = mo.sql(f"""
59
+ `,i.textContent=n;let o=e.coordsAtPos(e.state.selection.main.head);o&&(i.style.left=`${o.left}px`,i.style.top=`${o.bottom+5}px`),document.body.appendChild(i),setTimeout(()=>{i.style.opacity="0",i.style.transition="opacity 0.2s",setTimeout(()=>i.remove(),200)},3e3)}function nc(e){if(e==null)return!0;if(Array.isArray(e))return e.length===0||e.every(nc);if(typeof e=="string")return gg(e);let n=e.value;return typeof n=="string"?gg(n):!1}function gg(e){return e==null?!0:typeof e=="string"?e.trim()===""||/^[\s\n`]*$/.test(e):!1}function ak(e,n){let i=[];return n.iterChanges((o,s,c,d,f)=>{let p=f.toString();if(o===0&&s===e.length){i.push({text:p});return}let y=Xi(e,o),w=Xi(e,s);i.push({range:{start:y,end:w},text:p})}),i.sort((o,s)=>{if(!o.range)return 1;if(!s.range)return-1;let c=o.range.start.line??-1,d=s.range.start.line??-1;if(c!==d)return d-c;let f=o.range.start.character??-1;return(s.range.start.character??-1)-f}),i}var ok=Vu(),sk=Object.fromEntries(Object.entries(ok.CompletionItemKind).map(([e,n])=>[n,e])),yg;(function(e){e.PlainText=1,e.Snippet=2})(yg||(yg={}));function lk(e){return e.replaceAll(/\\\\/g,"").replaceAll(/(\$(\d+))/g,(n,i,o)=>"${"+o+"}")}function ck(e,n){let{detail:i,labelDetails:o,label:s,kind:c,textEdit:d,insertText:f,documentation:p,additionalTextEdits:y,insertTextFormat:w}=e,_={label:s,detail:(o==null?void 0:o.detail)||i,apply(C,E,T,I){if(d&&rk(d)?C.dispatch(_w(C.state,d.newText,Ir(C.state.doc,d.range.start),Ir(C.state.doc,d.range.end))):f&&w===yg.Snippet&&n.useSnippetOnCompletion?lD(lk(f))(C,null,T,I):C.dispatch(_w(C.state,f||s,T,I)),!y)return;let $=y.sort(({range:{end:V}},{range:{end:F}})=>Ir(C.state.doc,V)<Ir(C.state.doc,F)?1:Ir(C.state.doc,V)>Ir(C.state.doc,F)?-1:0);for(let V of $)C.dispatch(C.state.update({changes:{from:Ir(C.state.doc,V.range.start),to:yn(C.state.doc,V.range.end),insert:V.newText}}))},type:c&&sk[c].toLowerCase()};return n.hasResolveProvider&&n.resolveItem?_.info=async()=>{var C;try{let E=await((C=n.resolveItem)==null?void 0:C.call(n,e)),T=document.createElement("div");T.classList.add("documentation");let I=(E==null?void 0:E.documentation)||p;return!I||nc(I)?null:(n.allowHTMLContent?T.innerHTML=Ar(I,n.markdownRenderer):T.textContent=Ar(I,n.markdownRenderer),T)}catch(E){if(console.error("Failed to resolve completion item:",E),nc(p))return null;if(p){let T=document.createElement("div");return T.classList.add("documentation"),n.allowHTMLContent?T.innerHTML=Ar(p,n.markdownRenderer):T.textContent=Ar(p,n.markdownRenderer),T}return null}}:p&&(_.info=()=>{let C=document.createElement("div");return C.classList.add("documentation"),n.allowHTMLContent?C.innerHTML=Ar(p,n.markdownRenderer):C.textContent=Ar(p,n.markdownRenderer),C}),_}function uk(e,n,i){let o=[n?dk(n):fk,i==="python"?pk:void 0].filter(Boolean),s=e;if(n){let c=n.toLowerCase();/^\w+$/.test(c)&&(s=s.filter(({label:d,filterText:f})=>(f??d).toLowerCase().startsWith(c)))}for(let c of o)s.sort(c);return s}function dk(e){return(n,i)=>{let o=n.sortText??n.label,s=i.sortText??i.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 fk(e,n){let i=e.sortText??e.label,o=n.sortText??n.label;return i.localeCompare(o)}function pk(e,n){let i=e.label.endsWith("="),o=n.label.endsWith("=");return i&&!o?-1:!i&&o?1:0}function vg(e){let n=new Proxy({},{get(){throw Error(e)}});return function(i){return i.at(-1)??n}}const bg=Dl.define({combine:vg("No document URI provided. Either pass a one into the extension or use documentUri.of().")}),hk=Dl.define({combine:vg("No language ID provided. Either pass a one into the extension or use languageId.of().")});let qd,wg;qd=jl(),wg=1e4,ql=class{constructor({rootUri:e,workspaceFolders:n,transport:i,initializationOptions:o,capabilities:s,timeout:c=wg,getWorkspaceConfiguration:d}){ke(this,"ready");ke(this,"capabilities");ke(this,"initializePromise");ke(this,"rootUri");ke(this,"workspaceFolders");ke(this,"timeout");ke(this,"transport");ke(this,"requestManager");ke(this,"client");ke(this,"initializationOptions");ke(this,"clientCapabilities");ke(this,"notificationListeners",new Set);this.rootUri=e,this.workspaceFolders=n,this.transport=i,this.initializationOptions=o,this.clientCapabilities=s,this.timeout=c,this.ready=!1,this.capabilities=null,this.requestManager=new qd.RequestManager([this.transport]),this.client=new qd.Client(this.requestManager),this.client.onNotification(p=>{this.processNotification(p)});let f=this.transport;f!=null&&f.connection&&f.connection.addEventListener("message",p=>{let y=JSON.parse(p.data);y.method==="workspace/configuration"&&d?f.connection.send(JSON.stringify({jsonrpc:"2.0",id:y.id,result:d(y.params)})):y.method&&y.id&&f.connection.send(JSON.stringify({jsonrpc:"2.0",id:y.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,i){return this.client.request({method:e,params:n},i)}notify(e,n){return this.client.notify({method:e,params:n})}processNotification(e){this.notificationListeners.forEach(n=>n(e))}},jl();var Yi=Vu(),_g=console.log;function mk(){return String(Date.now()+Math.random())}let jd;Nl=Bi.define(),Ql=xs.define({create:()=>null,update(e,n){for(let i of n.effects)if(i.is(Nl))return i.value;if(e&&n.docChanged){let i=n.changes.mapPos(e.pos),o=e.end==null?void 0:n.changes.mapPos(e.end);return{...e,pos:i,end:o}}return e},provide:e=>C4.from(e)}),jd=D4.define();var gk=20,yk=class{constructor(e){ke(this,"documentVersion");ke(this,"pluginId");ke(this,"client");ke(this,"documentUri");ke(this,"languageId");ke(this,"view");ke(this,"allowHTMLContent");ke(this,"useSnippetOnCompletion");ke(this,"sendIncrementalChanges");ke(this,"featureOptions");ke(this,"onGoToDefinition");ke(this,"markdownRenderer");ke(this,"disposeListener");ke(this,"lastSeenDiagnosticsVersion",0);let{client:n,documentUri:i,languageId:o,view:s,featureOptions:c,sendIncrementalChanges:d=!0,allowHTMLContent:f=!1,useSnippetOnCompletion:p=!1,onGoToDefinition:y,markdownRenderer:w=mg}=e;this.documentVersion=0,this.pluginId=mk(),this.client=n,this.documentUri=i,this.languageId=o,this.view=s,this.allowHTMLContent=f,this.useSnippetOnCompletion=p,this.sendIncrementalChanges=d,this.featureOptions=c,this.onGoToDefinition=y,this.markdownRenderer=w,this.disposeListener=n.onNotification(this.processNotification.bind(this)),this.initialize({documentText:this.view.state.doc.toString()})}update({state:e,docChanged:n,startState:{doc:i},changes:o}){n&&(this.sendIncrementalChanges?this.sendChanges(ak(i,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:i}){var y;if(!this.featureOptions.hoverEnabled||!(this.client.ready&&((y=this.client.capabilities)!=null&&y.hoverProvider)))return null;let o=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:n,character:i}});if(!o)return null;let{contents:s,range:c}=o,d=yn(e.state.doc,{line:n,character:i}),f;if(c&&(d=yn(e.state.doc,c.start),f=yn(e.state.doc,c.end)),d==null||nc(s))return null;let p=document.createElement("div");return p.classList.add("documentation","cm-lsp-hover-tooltip"),this.allowHTMLContent?p.innerHTML=Ar(s,this.markdownRenderer):p.textContent=Ar(s,this.markdownRenderer),{pos:d,end:f,create:w=>({dom:p}),above:!0}}async requestCompletion(e,{line:n,character:i},{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:i},context:{triggerKind:o,triggerCharacter:s}});if(!c)return null;let d="items"in c?c.items:c,f=nk(d),p=f?e.matchBefore(f):e.matchBefore(/[a-zA-Z0-9]+/),{pos:y}=e,w=uk(d,p==null?void 0:p.text,this.languageId);p&&(y=p.from);let _=w.map(E=>{var T,I;return ck(E,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:((I=(T=this.client.capabilities)==null?void 0:T.completionProvider)==null?void 0:I.resolveProvider)??!1,resolveItem:this.client.completionItemResolve.bind(this.client)})});return{from:y,options:_,filter:!1}}async requestDefinition(e,{line:n,character:i}){var w;if(!this.featureOptions.definitionEnabled||!(this.client.ready&&((w=this.client.capabilities)!=null&&w.definitionProvider)))return;let o=await this.client.textDocumentDefinition({textDocument:{uri:this.documentUri},position:{line:n,character:i}});if(!o)return;let s=Array.isArray(o)?o:[o];if(s.length===0)return;let c=s[0];if(!c)return;let d="uri"in c?c.uri:c.targetUri,f="range"in c?c.range:c.targetRange,p=d!==this.documentUri,y={uri:d,range:f,isExternalDocument:p};return p||e.dispatch(e.state.update({selection:{anchor:Ir(e.state.doc,f.start),head:yn(e.state.doc,f.end)}})),this.onGoToDefinition&&this.onGoToDefinition(y),y}processNotification(e){try{e.method==="textDocument/publishDiagnostics"&&this.processDiagnostics(e.params)}catch(n){_g(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={[Yi.DiagnosticSeverity.Error]:"error",[Yi.DiagnosticSeverity.Warning]:"warning",[Yi.DiagnosticSeverity.Information]:"info",[Yi.DiagnosticSeverity.Hint]:"info"},i=e.diagnostics.map(async({range:s,message:c,severity:d,code:f,source:p})=>{var w;let y=(w=await this.requestCodeActions(s,[f]))==null?void 0:w.map(_=>{var C;return{name:"command"in _&&typeof _.command=="object"&&((C=_.command)==null?void 0:C.title)||_.title,apply:async()=>{var E;if("edit"in _&&((E=_.edit)!=null&&E.changes)){let T=_.edit.changes[this.documentUri];if(!T)return;for(let I of T)this.view.dispatch(this.view.state.update({changes:{from:Ir(this.view.state.doc,I.range.start),to:yn(this.view.state.doc,I.range.end),insert:I.newText}}))}"command"in _&&_.command&&_g("Executing command:",_.command)}}});return{from:Ir(this.view.state.doc,s.start),to:Ir(this.view.state.doc,s.end),severity:n[d??Yi.DiagnosticSeverity.Error],message:c,renderMessage:()=>{let _=document.createElement("div");return _.innerHTML=this.markdownRenderer(c),_},source:p||this.languageId,markClass:this.pluginId,actions:y}}),o=await Promise.all(i);this.addDiagnostics(o)}addDiagnostics(e){if(e.length===0)return;let n=this.view.state,i=[];Y4(n,c=>(i.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(vw(n,[...s,...e]))}clearDiagnostics(){this.view.dispatch(vw(this.view.state,[]))}async requestCodeActions(e,n){var i;return!this.featureOptions.codeActionsEnabled||!(this.client.ready&&((i=this.client.capabilities)!=null&&i.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:i}){var o;if(this.featureOptions.renameEnabled){if(!this.client.ready){nr(e,"Language server not ready");return}if(!((o=this.client.capabilities)!=null&&o.renameProvider)){nr(e,"Rename not supported by language server");return}try{let s=await this.client.textDocumentPrepareRename({textDocument:{uri:this.documentUri},position:{line:n,character:i}}).catch(()=>this.prepareRenameFallback(e,{line:n,character:i}));if(!s||"defaultBehavior"in s){nr(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 d=document.createElement("input");d.type="text",d.style.cssText="width: 200px; padding: 4px; border: 1px solid #ddd;";let f="range"in s?s.range:s,p=yn(e.state.doc,f.start);if(p==null)return;let y=yn(e.state.doc,f.end);d.value=e.state.doc.sliceString(p,y),c.appendChild(d);let w=e.coordsAtPos(p);if(!w)return;c.style.left=`${w.left}px`,c.style.top=`${w.bottom+5}px`;let _=async()=>{let E=d.value.trim();if(!E){nr(e,"New name cannot be empty"),c.remove();return}if(E===d.defaultValue){c.remove();return}try{let T=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:n,character:i},newName:E});await this.applyRenameEdit(e,T)}catch(T){nr(e,`Rename failed: ${T instanceof Error?T.message:"Unknown error"}`)}finally{c.remove()}};d.addEventListener("keydown",E=>{E.key==="Enter"?_():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),d.focus(),d.select()}catch(s){nr(e,`Rename failed: ${s instanceof Error?s.message:"Unknown error"}`)}}}async requestSignatureHelp(e,{line:n,character:i},o=void 0){var s,c,d;if(!(this.featureOptions.signatureHelpEnabled&&this.client.ready&&((s=this.client.capabilities)!=null&&s.signatureHelpProvider)))return null;try{let f=await this.client.textDocumentSignatureHelp({textDocument:{uri:this.documentUri},position:{line:n,character:i},context:{isRetrigger:!1,triggerKind:1,triggerCharacter:o}});if(!(f!=null&&f.signatures)||f.signatures.length===0)return null;let p=this.createTooltipContainer(),y=f.activeSignature??0,w=f.signatures[y]||f.signatures[0];if(!w)return null;let _=f.activeParameter??w.activeParameter??0,C=this.createSignatureElement(w,_);p.appendChild(C),w.documentation&&p.appendChild(this.createDocumentationElement(w.documentation));let E=(c=w.parameters)==null?void 0:c[_];E!=null&&E.documentation&&p.appendChild(this.createParameterDocElement(E.documentation));let T=yn(e.state.doc,{line:n,character:i});return T==null?null:{pos:T,end:T,create:I=>({dom:p}),above:((d=this.featureOptions.signatureHelpOptions)==null?void 0:d.position)==="above"}}catch(f){return console.error("Signature help error:",f),null}}async showSignatureHelpTooltip(e,n,i){let o=await this.requestSignatureHelp(e,Xi(e.state.doc,n),i);e.dispatch({effects:Nl.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 i=document.createElement("div");if(i.classList.add("cm-signature"),i.style.cssText="font-family: monospace; margin-bottom: 4px;",!e.label||typeof e.label!="string")return i.textContent="Signature information unavailable",i;let o=e.label,s=e.parameters||[];if(s.length===0||!s[n])return i.textContent=o,i;let c=s[n].label;return typeof c=="string"?this.allowHTMLContent?i.innerHTML=o.replace(c,`<strong class="cm-signature-active-param">${c}</strong>`):i.textContent=o.replace(c,`\xAB${c}\xBB`):Array.isArray(c)&&c.length===2?this.applyRangeHighlighting(i,o,c[0],c[1]):i.textContent=o,i}applyRangeHighlighting(e,n,i,o){e.textContent="";let s=n.substring(0,i),c=n.substring(i,o),d=n.substring(o);e.appendChild(document.createTextNode(s));let f=document.createElement("span");f.classList.add("cm-signature-active-param"),f.style.cssText="font-weight: bold; text-decoration: underline;",f.textContent=c,e.appendChild(f),e.appendChild(document.createTextNode(d))}createDocumentationElement(e){let n=document.createElement("div");n.classList.add("cm-signature-docs"),n.style.cssText="margin-top: 4px; color: #666;";let i=Ar(e,this.markdownRenderer);return this.allowHTMLContent?n.innerHTML=i:n.textContent=i,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 i=Ar(e,this.markdownRenderer);return this.allowHTMLContent?n.innerHTML=i:n.textContent=i,n}prepareRenameFallback(e,{line:n,character:i}){let o=e.state.doc.line(n+1).text,s=/\w+/g,c,d=i,f=i;for(;(c=s.exec(o))!==null;){let p=c.index,y=c.index+c[0].length;if(i>=p&&i<=y){d=p,f=y;break}}return d===i&&f===i?null:{range:{start:{line:n,character:d},end:{line:n,character:f}},placeholder:o.slice(d,f)}}async applyRenameEdit(e,n){if(!n)return nr(e,"No edit returned from language server"),!1;let i=n.changes??{},o=n.documentChanges??[];if(Object.keys(i).length===0&&o.length===0)return nr(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){nr(e,"Multi-file rename not supported yet");continue}let c=s.edits.sort((d,f)=>{let p=yn(e.state.doc,d.range.start);return(yn(e.state.doc,f.range.start)??0)-(p??0)}).map(d=>({from:yn(e.state.doc,d.range.start)??0,to:yn(e.state.doc,d.range.end)??0,insert:d.newText}));return e.dispatch(e.state.update({changes:c})),!0}return nr(e,"File creation, deletion, or renaming operations not supported yet"),!1}else if(Object.keys(i).length>0)for(let[s,c]of Object.entries(i)){if(s!==this.documentUri){nr(e,"Multi-file rename not supported yet");continue}let d=c.sort((f,p)=>{let y=yn(e.state.doc,f.range.start);return(yn(e.state.doc,p.range.start)??0)-(y??0)}).map(f=>({from:yn(e.state.doc,f.range.start)??0,to:yn(e.state.doc,f.range.end)??0,insert:f.newText}));e.dispatch(e.state.update({changes:d}))}return!1}};bm=function(e){var d;let n=null,i={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=[Ol.define(f=>(n=new yk({client:o,documentUri:e.documentUri??f.state.facet(bg),languageId:e.languageId??f.state.facet(hk),view:f,featureOptions:s,sendIncrementalChanges:e.sendIncrementalChanges,allowHTMLContent:e.allowHTMLContent,useSnippetOnCompletion:e.useSnippetOnCompletion,onGoToDefinition:e.onGoToDefinition,markdownRenderer:e.markdownRenderer}),n))];if(c.push(Ra.of([{key:i.signatureHelp,run:f=>{if(!(n&&s.signatureHelpEnabled))return!1;let p=f.state.selection.main.head;return n.showSignatureHelpTooltip(f,p),!0}},{key:i.rename,run:f=>{if(!(n&&s.renameEnabled))return!1;let p=f.state.selection.main.head;return n.requestRename(f,Xi(f.state.doc,p)),!0}},{key:i.goToDefinition,run:f=>{if(!(n&&s.definitionEnabled))return!1;let p=f.state.selection.main.head;return n.requestDefinition(f,Xi(f.state.doc,p)).catch(y=>nr(f,`Go to definition failed: ${y instanceof Error?y.message:"Unknown error"}`)),!0}}])),s.hoverEnabled&&c.push(xh((f,p)=>n==null?null:n.requestHoverTooltip(f,Xi(f.state.doc,p)),e.hoverConfig)),s.signatureHelpEnabled){c.push(Ql);let f=p=>p.state.field(Ql)?(p.dispatch({effects:Nl.of(null)}),!0):!1;c.push(Kt.domEventHandlers({mousedown:(p,y)=>(f(y),!1)})),c.push(Ra.of([{key:")",run:p=>(f(p),!1)},{key:"Escape",run:p=>f(p)}])),c.push(Kt.updateListener.of(p=>{if(!(n&&s.signatureActivateOnTyping)||!p.state.field(Ql)||!(p.selectionSet||p.docChanged))return;let y=p.state.selection.main.head;_k(p.state.doc,y)||f(p.view)})),c.push(Kt.updateListener.of(async p=>{var E;if(!(n&&p.docChanged)||p.transactions.some(T=>T.annotation(jd))||!((E=n.client.capabilities)!=null&&E.signatureHelpProvider)||!s.signatureActivateOnTyping)return;let y=n.client.capabilities.signatureHelpProvider.triggerCharacters||["(",","],w=p.changes,_=-1,C;w.iterChanges((T,I,$,V,F)=>{if(_>=0)return;let N=bk(F.toString(),$,y);N&&(_=N.triggerPos,C=N.triggerCharacter)}),_>=0&&n.showSignatureHelpTooltip(p.view,_,C)}))}return s.completionEnabled&&c.push(Iu({...e.completionConfig,override:[async f=>{var _,C;if(n==null)return null;let{state:p,pos:y}=f,w=vk(f,((C=(_=n.client.capabilities)==null?void 0:_.completionProvider)==null?void 0:C.triggerCharacters)??[],e.completionMatchBefore);return w==null?null:await n.requestCompletion(f,Xi(p.doc,y),w)},...((d=e.completionConfig)==null?void 0:d.override)||[]]})),c.push(Kt.domEventHandlers({click:(f,p)=>{if(s.definitionEnabled&&i.goToDefinition==="ctrlcmd"&&(f.ctrlKey||f.metaKey)){let y=p.posAtCoords({x:f.clientX,y:f.clientY});y&&n&&(n.requestDefinition(p,Xi(p.state.doc,y)).catch(w=>nr(p,`Go to definition failed: ${w instanceof Error?w.message:"Unknown error"}`)),f.preventDefault())}}})),c};function vk(e,n,i){let{state:o,pos:s,explicit:c}=e,d=o.doc.lineAt(s),f=Yi.CompletionTriggerKind.Invoked,p,y=d.text[s-d.from-1]||"",w=n==null?void 0:n.includes(y);return!c&&w&&(f=Yi.CompletionTriggerKind.TriggerCharacter,p=y),f===Yi.CompletionTriggerKind.Invoked&&!e.matchBefore(i||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:f,triggerCharacter:p}}function bk(e,n,i){if(!e)return null;for(let o of i){let s=e.indexOf(o);if(s!==-1)return{triggerPos:n+s+1,triggerCharacter:o}}return null}function wk(e){let n=0;for(let i of e)i==="("?n++:i===")"&&n--;return n}function _k(e,n,i=gk){let o=e.lineAt(n),s=Math.max(1,o.number-i),c=e.line(s).from;return wk(e.sliceString(c,n))>0}Wu=function(e,n,i={}){let{preserveCursor:o=!0,effects:s,userEvent:c}=i,d=e.state.doc;if(d.toString()!==n)if(o&&e.hasFocus){let f=e.state.selection.main.head,p=d.lineAt(f),y=p.number,w=f-p.from,_=e.state.update({changes:{from:0,to:d.length,insert:n}}).state.doc,C;if(y<=_.lines){let E=_.line(y),T=E.length;C=E.from+Math.min(w,T)}else C=_.line(_.lines).to;e.dispatch({changes:{from:0,to:d.length,insert:n},annotations:jd.of(!0),selection:{anchor:C},effects:s,userEvent:c})}else e.dispatch({changes:{from:0,to:d.length,insert:n},effects:s,userEvent:c})},bo=function(){return Dl.define({combine:e=>e.find(n=>n!==void 0)})};const xg=bo(),kg=bo(),zd=bo(),rc=bo(),Sg=bo();Bw=function({cellId:e,completionConfig:n,hotkeys:i,placeholderType:o,lspConfig:s,diagnosticsConfig:c}){return[rc.of(e),xg.of(n),kg.of(i),zd.of(o),Sg.of({...s,diagnostics:c})]},Qu=new Lu;function xk(e){return Object.values(e.cellRuntime).some(n=>n.status==="running")}function kk(e){return Object.values(e.cellRuntime).filter(n=>n.status==="running"||n.status==="queued").length}function Sk(e){return Mm(e).length>0}Aw=function(e){return e.cellIds.inOrderIds.map(n=>e.cellData[n])};function Ck({cellHandles:e}){let n={};for(let[i,o]of ui.entries(e))o.current&&(n[i]=o.current.editorView);return n}Nm=function(e){let{cellIds:n,cellData:i}=e,o=[];for(let s of n.inOrderIds)i[s].config.disabled&&o.push(s);return o},pm=function(e){let{cellIds:n,cellData:i}=e,o=[];for(let s of n.inOrderIds)i[s].config.disabled||o.push(s);return o};function Ek(e){return e.history.length>0}px=function(e,n){let i=e.cellIds.findWithId(n).getDescendants(n);return{stale:i.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:i.some(o=>{var s;return(s=e.cellRuntime[o])==null?void 0:s.errored}),runningOrQueued:i.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"})}},Mm=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.inOrderIds.filter(s=>nm({executionTime:o[s].runElapsedTimeMs??i[s].lastExecutionTime,status:o[s].status,errored:o[s].errored,interrupted:o[s].interrupted,stopped:o[s].stopped})||i[s].edited||o[s].interrupted||o[s].staleInputs&&!(o[s].status==="disabled-transitively"||i[s].config.disabled))},nm=function({executionTime:e,status:n,errored:i,interrupted:o,stopped:s}){return e===null&&n!=="queued"&&n!=="running"&&!(i||o||s)},Pt=Dl.define({combine:e=>e[0]}),Ui=Dl.define({combine:e=>e[0]});var Tk={...Th,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"};const Cg=Rh.define(Tk),Eg=Rh.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 Rk=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 ic(e){return Rk.has(e)}function Tg(e){let n=e.dialect;if(!ic(n))return Se.debug("Unknown dialect",{dialect:n}),Ds;switch(n){case"postgresql":case"postgres":return Th;case"mysql":return pD;case"sqlite":return dD;case"mssql":case"sqlserver":case"microsoft sql server":return mD;case"duckdb":return Eg;case"mariadb":return gD;case"cassandra":return yD;case"oracledb":case"oracle":return uD;case"bigquery":return Cg;case"timescaledb":return Th;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 Se.debug("Unsupported dialect",{dialect:n}),Ds;default:return _s(n),Ds}}var Dk={...hD,caseInsensitiveIdentifiers:!0,identifierQuotes:"'"};let Ds;Ds=Rh.define(Dk),$i="__marimo_duckdb",ko=new Set([$i]),H_="memory",Ul=function(e){return e===""};var Os={formatTableName:e=>e,formatSelectClause:(e,n)=>`SELECT ${e} FROM ${n} LIMIT 100`};function Ok(e){if(e=e.toLowerCase(),!ic(e))return Os;switch(e){case"bigquery":{let n=Cg.spec.identifierQuotes;return{formatTableName:i=>`${n}${i}${n}`,formatSelectClause:Os.formatSelectClause}}case"mssql":case"sqlserver":case"microsoft sql server":return{formatTableName:Os.formatTableName,formatSelectClause:(n,i)=>`SELECT TOP 100 ${n} FROM ${i}`};case"timescaledb":case"postgres":case"postgresql":case"duckdb":return{formatTableName:n=>n.split(".").map(i=>`"${i}"`).join("."),formatSelectClause:(n,i)=>`SELECT ${n==="*"?"*":`"${n}"`} FROM ${i} 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 Os;default:return _s(e),Os}}G_=function({table:e,columnName:n,sqlTableContext:i}){if(i){let{engine:o,schema:s,defaultSchema:c,defaultDatabase:d,database:f,dialect:p}=i,y=e.name;Ul(s)?y=f===d?y:`${f}.${y}`:(s!==c&&(y=`${s}.${y}`),f!==d&&(y=`${f}.${y}`));let w=Ok(p),_=w.formatTableName(y),C=w.formatSelectClause(n,_);return o==="__marimo_duckdb"?`_df = mo.sql(f"""
60
60
  ${C}
61
61
  """)`:`_df = mo.sql(f"""
62
62
  ${C}
63
- """, engine=${o})`}return`_df = mo.sql(f'SELECT "${n}" FROM ${e.name} LIMIT 100')`},__=function(e,n){if(n==="date"||n==="datetime"||n==="time"){if(e==="min")return"Earliest";if(e==="max")return"Latest"}return e};function Pk(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:VD,createActions:$D,valueAtom:Rg,useActions:Mk}=Ll(Pk,{addDatasets:(e,n)=>{let{previewDatasetColumn:i}=Vi();for(let f of n.tables)for(let p of f.columns){let y=`${f.name}:${p.name}`;e.expandedColumns.has(y)&&i({tableName:f.name,columnName:p.name,source:f.source,sourceType:f.source_type})}let o=e.tables;n.clear_channel&&(o=o.filter(f=>f.source!==n.clear_channel));let s=[...n.tables,...o],c=new Set,d=s.filter(f=>{let p=`${f.name}:${f.source}`;return c.has(p)?!1:(c.add(p),!0)}).sort((f,p)=>f.name.localeCompare(p.name));return{...e,tables:d}},filterDatasetsFromVariables:(e,n)=>{let i=new Set(n),o=e.tables.filter(s=>s.variable_name?i.has(s.variable_name):!0);return{...e,tables:o}},toggleTable:(e,n)=>{let i=new Set(e.expandedTables);return i.has(n)?i.delete(n):i.add(n),{...e,expandedTables:i}},toggleColumn:(e,n)=>{let i=`${n.table}:${n.column}`,o=new Set(e.expandedColumns);return o.has(i)?o.delete(i):o.add(i),{...e,expandedColumns:o}},closeAllColumns:e=>({...e,expandedColumns:new Set}),addColumnPreview:(e,n)=>{let i=`${n.table_name}:${n.column_name}`,o=new Map(e.columnsPreviews);return o.set(i,n),{...e,columnsPreviews:o}}});z_=()=>Zn(Rg),dd=ze(e=>e(Rg).tables),v_=ze(new Set),W_=ze(!1),ox=function(){return Mk()};var Lk=new Map([[$i,{name:$i,dialect:"duckdb",source:"duckdb",display_name:"DuckDB (In-Memory)",databases:[]}]]);function Nk(){return{latestEngineSelected:$i,connectionsMap:Lk}}let Ik,Ak;({reducer:Ik,createActions:Ak,valueAtom:So,useActions:m_}=Ll(Nk,{addDataSourceConnection:(e,n)=>{if(n.connections.length===0)return e;let{latestEngineSelected:i,connectionsMap:o}=e,s=new Map(o);for(let c of n.connections)s.set(c.name,c);return{latestEngineSelected:i,connectionsMap:s}},filterDataSourcesFromVariables:(e,n)=>{let{latestEngineSelected:i,connectionsMap:o}=e,s=new Set(n),c=new Map([...o].filter(([d])=>ko.has(d)?!0:s.has(d)));return{latestEngineSelected:c.has(i)?i:$i,connectionsMap:c}},clearDataSourceConnections:()=>({latestEngineSelected:$i,connectionsMap:new Map}),removeDataSourceConnection:(e,n)=>{let{latestEngineSelected:i,connectionsMap:o}=e,s=new Map(o);return s.delete(n),{latestEngineSelected:s.has(i)?i:$i,connectionsMap:s}},addTableList:(e,n)=>{let{tables:i,sqlTableContext:o}=n,{connectionsMap:s,latestEngineSelected:c}=e,d=o.engine,f=s.get(d);if(!f)return e;let p=new Map(s),y={...f,databases:f.databases.map(w=>w.name===o.database?{...w,schemas:w.schemas.map(_=>_.name===o.schema?{..._,tables:i}:_)}:w)};return p.set(d,y),{latestEngineSelected:c,connectionsMap:p}},addTable:(e,n)=>{let{table:i,sqlTableContext:o}=n,{connectionsMap:s,latestEngineSelected:c}=e,d=o.engine,f=i.name,p=s.get(d);if(!p)return e;let y=new Map(s),w={...p,databases:p.databases.map(_=>_.name===o.database?{..._,schemas:_.schemas.map(C=>{if(C.name!==o.schema)return C;let E=C.tables.length===0?[i]:C.tables.map(T=>T.name===f?i:T);return{...C,tables:E}})}:_)};return y.set(d,w),{latestEngineSelected:c,connectionsMap:y}}})),ld=ze(e=>e(So).connectionsMap);function Dg(e){let n=lt.get(So);n.connectionsMap.has(e)&&lt.set(So,{...n,latestEngineSelected:e})}rx=ze(e=>{let n=lt.get(dd),i=e(So).connectionsMap,o=new Map;for(let s of n)o.set(s.name,s);for(let s of i.values())for(let c of s.databases){let d=c.name===s.default_database||s.databases.length===1;for(let f of c.schemas){let p=f.name===s.default_schema,y=Kl(f.name);for(let w of f.tables){let _;if(_=w.name,y){_=d?w.name:`${c.name}.${w.name}`,o.has(_)?Ee.warn(`Table name collision for ${_}. Skipping.`):o.set(_,w);continue}if(d&&p&&!o.has(_)){o.set(_,w);continue}if(_=`${f.name}.${w.name}`,d&&!o.has(_)){o.set(_,w);continue}_=`${c.name}.${f.name}.${w.name}`,o.has(_)?Ee.warn(`Table name collision for ${_}. Skipping.`):o.set(_,w)}}}return o}),P_=function(e){return e.variable_name?"dataframe":"table"};let Ps,Fd,Og,Bd,Pg,Mg,Hd,Lg;Ps=class{constructor(e,n={}){ke(this,"cache",new Map);this.maxSize=e,this.options=n}getOrCreate(e){In(this.options.create,"create function is required");let n=this.cache.get(e);if(n!==void 0)return n;let i=this.options.create(e);return this.cache.set(e,i),i}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 i=this.cache.keys().next().value;i!==void 0&&this.cache.delete(i)}}keys(){return this.cache.keys()}values(){return this.cache.values()}entries(){return this.cache.entries()}delete(e){this.cache.delete(e)}},ym=Tt("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"}]]),Lh=Tt("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"}]]),Yh=Tt("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"}]]),dm=Tt("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"}]]),sm=Tt("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"}]]),Fd=Tt("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"}]]),cm=Tt("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"}]]),Vh=Tt("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"}]]),Rm=Tt("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Og=Tt("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"}]]),$h=Tt("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),Bd=Tt("database-backup",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 12a9 3 0 0 0 5 2.69",key:"1ui2ym"}],["path",{d:"M21 9.3V5",key:"6k6cib"}],["path",{d:"M3 5v14a9 3 0 0 0 6.47 2.88",key:"i62tjy"}],["path",{d:"M12 12v4h4",key:"1bxaet"}],["path",{d:"M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16",key:"1f4ei9"}]]),Cs=Tt("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"}]]),Gu=Tt("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=Tt("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"}]]),Pg=Tt("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"}]]),Hu=Tt("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Mg=Tt("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"}]]),_o=Tt("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"}]]),Nh=Tt("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"}]]),Am=Tt("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=Tt("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"}]]),Wh=Tt("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"}]]),Hd=Tt("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"}]]),Lg=Tt("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"}]]),Fh=Tt("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"}]]),wo=Tt("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"}]]),Jh=Tt("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"}]]),Qh=Tt("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"}]]),ql=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 Ng(e){let[n,i]=e.split(" ");return i?`${ql(n)} ${i}`:ql(e)}zu={boolean:p4,date:h4,time:Rm,datetime:Fd,temporal:Fd,number:bh,string:m4,integer:bh,unknown:sm},L_=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 _s(e),"bg-(--slate-4) dark:bg-(--slate-6)"}};let Ms,B,Ig,Vd,Ag,Lo,qg,jg,zg,Fg,Bg,No,ei,za,pi,$d;Pa=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`}},I_=class wx{constructor(n){this.words=n}static of(...n){return new wx(n.map(i=>typeof i=="string"?new Pa(i):i))}join(n,i){return this.words.map(o=>o.pluralize(i)).join(n)}},Ms=Jr(),B=vh(k4(),1),Ig=5,Vd={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)]"},Ag={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)]"},Lo="p-3 min-w-[250px] flex flex-col divide-y",qg=new Pa("column","columns"),jg=new Pa("row","rows"),zg=new Pa("schema","schemas"),Fg=new Pa("table","tables"),Bg=new Pa("database","databases"),No=e=>{let n=(0,Ms.c)(6),{icon:i,title:o,badge:s}=e,c;n[0]===o?c=n[1]:(c=(0,B.jsx)("h3",{className:"font-semibold text-sm",children:o}),n[0]=o,n[1]=c);let d;return n[2]!==s||n[3]!==i||n[4]!==c?(d=(0,B.jsxs)("div",{className:"flex items-center gap-2 pb-2",children:[i,c,s]}),n[2]=s,n[3]=i,n[4]=c,n[5]=d):d=n[5],d},ei=e=>{let n=(0,Ms.c)(5),{label:i,value:o}=e,s;n[0]===i?s=n[1]:(s=(0,B.jsxs)("span",{className:"text-[var(--slate-11)]",children:[i,":"]}),n[0]=i,n[1]=s);let c;return n[2]!==s||n[3]!==o?(c=(0,B.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},za=e=>{let n=(0,Ms.c)(5),{icon:i,text:o}=e,s;n[0]===o?s=n[1]:(s=(0,B.jsx)("span",{className:"text-xs text-[var(--slate-11)]",children:o}),n[0]=o,n[1]=s);let c;return n[2]!==i||n[3]!==s?(c=(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[i,s]}),n[2]=i,n[3]=s,n[4]=c):c=n[4],c},pi=e=>{let n=(0,Ms.c)(15),{title:i,items:o,totalCount:s,limit:c}=e,d=i===void 0?"":i,f=c===void 0?Ig:c;if(o.length===0)return null;let p;n[0]!==o||n[1]!==f?(p=o.slice(0,f),n[0]=o,n[1]=f,n[2]=p):p=n[2];let y=p,w=s>f,_;n[3]===d?_=n[4]:(_=d&&(0,B.jsxs)("h4",{className:"text-xs font-medium text-[var(--slate-11)] mb-2",children:[d,":"]}),n[3]=d,n[4]=_);let C;n[5]!==w||n[6]!==f||n[7]!==s?(C=w&&(0,B.jsxs)("div",{className:"text-xs text-[var(--slate-10)] text-center py-1",children:["... and ",s-f," more"]}),n[5]=w,n[6]=f,n[7]=s,n[8]=C):C=n[8];let E;n[9]!==C||n[10]!==y?(E=(0,B.jsxs)("div",{className:"flex flex-col gap-1 overflow-y-auto",children:[y,C]}),n[9]=C,n[10]=y,n[11]=E):E=n[11];let T;return n[12]!==_||n[13]!==E?(T=(0,B.jsxs)("div",{className:"py-2",children:[_,E]}),n[12]=_,n[13]=E,n[14]=T):T=n[14],T},$d=e=>Vd[e]||Vd.unknown;const qk=e=>{var d,f;let n=e.type==="view"?(0,B.jsx)(Gu,{className:"w-4 h-4 text-[var(--blue-9)]"}):(0,B.jsx)(wo,{className:"w-4 h-4 text-[var(--green-9)]"}),i=(0,B.jsx)(mr,{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(p=>{let y=zu[p.type];return(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs rounded",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(y,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{className:"font-mono",children:p.name})]}),(0,B.jsx)(mr,{variant:"outline",className:`text-xs ${$d(p.type)}`,children:p.type})]},p.name)}),s=e.primary_keys&&e.primary_keys.length>0,c=e.indexes&&e.indexes.length>0;return(0,B.jsxs)("div",{className:`${Lo} min-w-[300px]`,children:[(0,B.jsx)(No,{icon:n,title:e.name,badge:i}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,B.jsx)(ei,{label:"Source",value:(0,B.jsx)(mr,{variant:"outline",className:`text-xs ${Ag[e.source_type]}`,children:e.source})}),e.variable_name&&(0,B.jsx)(ei,{label:"Variable",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.variable_name})}),e.engine&&(0,B.jsx)(ei,{label:"Engine",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(e.num_columns!=null||e.num_rows!=null)&&(0,B.jsxs)("div",{className:"grid grid-cols-2 gap-2 py-2",children:[e.num_columns!=null&&(0,B.jsx)(za,{icon:(0,B.jsx)($h,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_columns} ${qg.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,B.jsx)(za,{icon:(0,B.jsx)(bh,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_rows} ${jg.pluralize(e.num_rows)}`})]}),e.columns.length===0&&oc("column"),(s||c)&&(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[s&&(0,B.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[(0,B.jsx)(OD,{className:"w-3 h-3 text-[var(--amber-9)]"}),(0,B.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Primary Keys:"})]}),(d=e.primary_keys)==null?void 0:d.map(p=>(0,B.jsx)(mr,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:p},p))]}),c&&(0,B.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,B.jsxs)("div",{className:"flex items-center gap-1 mb-1",children:[(0,B.jsx)(Lh,{className:"w-3 h-3 text-[var(--purple-9)]"}),(0,B.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Indexes:"})]}),(f=e.indexes)==null?void 0:f.map(p=>(0,B.jsx)(mr,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:p},p))]})]}),e.columns.length>0&&(0,B.jsx)(pi,{items:o,totalCount:e.columns.length})]})},jk=e=>{var s;let n=zu[e.type],i=(0,B.jsx)(mr,{variant:"outline",className:`text-xs ${$d(e.type)}`,children:e.type}),o=((s=e.sample_values)==null?void 0:s.map((c,d)=>(0,B.jsx)("div",{className:"text-xs bg-[var(--slate-3)] rounded font-mono",children:c==null?"null":String(c)},d)))||[];return(0,B.jsxs)("div",{className:Lo,children:[(0,B.jsx)(No,{icon:(0,B.jsx)(n,{className:"w-4 h-4 text-[var(--slate-9)]"}),title:e.name,badge:i}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 mt-2",children:[(0,B.jsx)(ei,{label:"Type",value:(0,B.jsx)("span",{className:"font-medium",children:e.type})}),(0,B.jsx)(ei,{label:"External Type",value:(0,B.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,B.jsx)(pi,{title:"Sample Values",items:o,totalCount:e.sample_values.length})]})},zk=e=>{let n=(0,B.jsx)(mr,{variant:"outline",className:"text-xs bg-[var(--blue-4)] text-[var(--blue-11)]",children:e.dialect}),i=e.schemas.map(o=>(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(_o,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{children:o.name})]}),(0,B.jsxs)(mr,{variant:"outline",className:"text-xs",children:[o.tables.length," ",Fg.pluralize(o.tables.length)]})]},o.name));return(0,B.jsxs)("div",{className:Lo,children:[(0,B.jsx)(No,{icon:(0,B.jsx)(Cs,{className:"w-4 h-4 text-[var(--blue-9)]"}),title:e.name,badge:n}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,B.jsx)(ei,{label:"Dialect",value:(0,B.jsx)("span",{className:"font-medium",children:e.dialect})}),e.engine&&(0,B.jsx)(ei,{label:"Engine",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(0,B.jsx)("div",{className:"py-2",children:(0,B.jsx)(za,{icon:(0,B.jsx)(_o,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.schemas.length} schema${e.schemas.length===1?"":"s"}`})}),e.schemas.length===0&&oc("schema"),e.schemas.length>0&&(0,B.jsx)(pi,{title:"Schemas",items:i,totalCount:e.schemas.length})]})},Fk=e=>{let n=(0,B.jsx)(mr,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:"Schema"}),i=e.tables.map(o=>(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[o.type==="view"?(0,B.jsx)(Gu,{className:"w-3 h-3 text-[var(--blue-9)]"}):(0,B.jsx)(wo,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,B.jsx)("span",{children:o.name})]}),(0,B.jsx)(mr,{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,B.jsxs)("div",{className:Lo,children:[(0,B.jsx)(No,{icon:(0,B.jsx)(_o,{className:"w-4 h-4 text-[var(--green-9)]"}),title:e.name,badge:n}),(0,B.jsx)("div",{className:"py-2",children:(0,B.jsx)(za,{icon:(0,B.jsx)(wo,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.tables.length} table${e.tables.length===1?"":"s"}`})}),e.tables.length===0&&oc("table"),e.tables.length>0&&(0,B.jsx)(pi,{title:"Tables",items:i,totalCount:e.tables.length})]})};var Hg=(0,B.jsx)(mr,{variant:"outline",children:"default"}),Bk=8,Vg=3;let oc;jw=(e,n)=>{let i=e.databases.length,o=e.databases.reduce((p,y)=>p+y.schemas.length,0),s=(p,y)=>{if(p.tables.length===0)return null;let w=p.name===e.default_schema&&y,_=[];return o<Bk&&(_=p.tables.slice(0,Vg+1).map(C=>(0,B.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,B.jsx)(wo,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:C.name})]},C.name))),(0,B.jsxs)("div",{children:[(0,B.jsxs)("div",{className:"flex items-center gap-2 text-xs rounded hover:bg-[var(--slate-3)] ml-2",children:[(0,B.jsx)(_o,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{children:p.name}),w&&Hg,(0,B.jsxs)(mr,{variant:"outline",className:"text-xs ml-auto",children:[p.tables.length," tables"]})]}),(0,B.jsx)(pi,{items:_,totalCount:p.tables.length,limit:Vg})]},p.name)},c=e.databases.map(p=>{let y=p.name===e.default_database||e.databases.length===1,w=p.schemas.map(_=>s(_,y));return(0,B.jsxs)("div",{children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(Cs,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:p.name}),y&&Hg]}),w&&(0,B.jsx)(pi,{items:w,totalCount:p.schemas.length})]},p.name)}),d=e.name;ko.has(e.name)&&(d="In-Memory");let f=n==null?void 0:n.map(p=>(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(wo,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:p.name})]},p.name));return(0,B.jsxs)("div",{className:`${Lo} px-1`,children:[(0,B.jsx)(No,{icon:(0,B.jsx)(Og,{className:"w-4 h-4 text-[var(--purple-9)]"}),title:d}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,B.jsx)(ei,{label:"Dialect",value:(0,B.jsx)("span",{className:"font-medium",children:ql(e.dialect)})}),(0,B.jsx)(ei,{label:"Source",value:(0,B.jsx)(mr,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:e.source})})]}),(0,B.jsxs)("div",{className:"flex flex-row justify-between py-2",children:[(0,B.jsx)(za,{icon:(0,B.jsx)(Cs,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${i} ${Bg.pluralize(i)}`}),(0,B.jsx)(za,{icon:(0,B.jsx)(_o,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${o} ${zg.pluralize(o)}`})]}),i>0&&(0,B.jsx)(pi,{items:c,totalCount:i}),f&&f.length>0&&(0,B.jsx)(pi,{title:"Dataframes",items:f,totalCount:f.length})]})},oc=e=>(0,B.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,B.jsx)(Hu,{size:10,className:"mt-1 text-[var(--slate-10)] shrink-0"}),(0,B.jsxs)("span",{className:"text-xs text-[var(--slate-11)]",children:["No ",e," information available.",`
64
- `,(0,B.jsx)("span",{className:"text-[var(--blue-10)]",children:"Introspect to see more details."})]})]});var sc=nd(),$g=class{constructor(){ke(this,"schema",{})}addTable(e,n){let i={self:Vk({table:n}),children:n.columns.map(o=>Hk({column:o}))};return this.setAt([...e,n.name],i),this}addSchema(e,n){let i={self:$k({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}addDatabase(e,n){let i={self:Wk({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}setAt(e,n){let i=this.schema;for(let o of e.slice(0,-1))i[o]||(i[o]={children:{}}),i=i[o].children;i[e[e.length-1]]=n}build(){return this.schema}reset(){return this.schema={},this}};function Hk(e){return{label:e.column.name,type:"column",info:()=>{let n=document.createElement("div");return(0,sc.createRoot)(n).render(jk(e.column)),{dom:n}}}}function Vk(e){return{label:e.table.name,type:"table",info:()=>{let n=document.createElement("div");return(0,sc.createRoot)(n).render(qk(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,sc.createRoot)(n).render(Fk(e.namespace)),{dom:n}}}}function Wk(e){return{label:e.namespace.name,detail:e.path.join("."),type:"database",info:()=>{let n=document.createElement("div");return(0,sc.createRoot)(n).render(zk(e.namespace)),{dom:n}}}}var Uk=ze(e=>{let n=e(dd),i=new $g;for(let o of n)i.addTable([],o);return i.build()}),Kk=class{constructor(){this.cache=new Ps(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return lt.get(ld).get(e)}getConnectionSchema(e){var d;let{default_database:n,databases:i,default_schema:o}=e,s=new $g,c=i.find(f=>f.name===n||i.length===1);if(((d=c??i[0])==null?void 0:d.schemas.some(f=>Kl(f.name)))??!1){for(let f of i){let p=f.name===(c==null?void 0:c.name),y=f.schemas.flatMap(w=>w.tables);s.addDatabase([f.name],f);for(let w of y)p?s.addTable([],w):s.addTable([f.name],w)}return{shouldAddLocalTables:!1,schema:s.build(),defaultSchema:c==null?void 0:c.name}}if(c)for(let f of c.schemas){s.addSchema([f.name],f);for(let p of f.tables)s.addTable([f.name],p)}for(let f of i){s.addDatabase([f.name],f);for(let p of f.schemas){s.addSchema([f.name,p.name],p);for(let y of p.tables)s.addTable([f.name,p.name],y)}}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?Tg(n):Ds}getCompletionSource(e){let n=this.getConnection(e);if(!n)return null;let i=()=>lt.get(Uk),o=this.cache.getOrCreate(n);return{dialect:Tg(n),schema:o.shouldAddLocalTables?{...o.schema,...i()}:o.schema,defaultSchema:o.defaultSchema,defaultTable:Qk(n)}}};function Qk(e){if(e.databases.length!==1)return;let n=e.databases[0];if(n.schemas.length!==1)return;let i=n.schemas[0];if(i.tables.length===1)return i.tables[0].name}const Fa=new Kk,Ls=Bi.define();Fu=async function(e){let{sendFormat:n}=Vi(),i=ui.mapValues(e,s=>Xr(s)),o=await n({codes:i,lineLength:iw().formatting.line_length});for(let[s,c]of ui.entries(o.codes)){let d=s,f=i[d],p=e[d];p&&c!==f&&(p.state.facet(Pt).updateCellCode({cellId:d,code:c,formattingChange:!0}),xo(p,c))}},n_=function(){return Fu(Ck(od()))};async function Gk(e,n){let{formatDialect:i}=await ce(async()=>{let{formatDialect:_}=await import("./esm-BHwEmOw7.js").then(async C=>(await C.__tla,C));return{formatDialect:_}},__vite__mapDeps([0,1]),import.meta.url),o=await Jk(Fa.getInternalDialect(n)),s=e.state.field(Lr),c=S4(e.state);if(s.type!=="sql"){Ee.error("Language adapter is not SQL");return}let d=e.state.doc.toString(),f;try{f=i(d,{dialect:o,tabWidth:c,useTabs:!1})}catch(_){Ee.error("Error formatting SQL",{error:_});return}let p=s.transformIn(f)[0],y=e.state.facet(Pt),w=e.state.facet(ic);y.updateCellCode({cellId:w,code:p,formattingChange:!0}),Wu(e,f,{effects:[Ls.of(!0)]})}async function Jk(e){let{bigquery:n,db2:i,db2i:o,duckdb:s,hive:c,mariadb:d,mysql:f,tidb:p,n1ql:y,plsql:w,postgresql:_,redshift:C,spark:E,sqlite:T,sql:I,trino:$,transactsql:V,singlestoredb:F,snowflake:N}=await ce(async()=>{let{bigquery:pe,db2:P,db2i:A,duckdb:W,hive:de,mariadb:fe,mysql:we,tidb:J,n1ql:be,plsql:Se,postgresql:Z,redshift:re,spark:se,sqlite:Q,sql:Le,trino:Fe,transactsql:et,singlestoredb:Be,snowflake:je}=await import("./esm-BHwEmOw7.js").then(async Pe=>(await Pe.__tla,Pe));return{bigquery:pe,db2:P,db2i:A,duckdb:W,hive:de,mariadb:fe,mysql:we,tidb:J,n1ql:be,plsql:Se,postgresql:Z,redshift:re,spark:se,sqlite:Q,sql:Le,trino:Fe,transactsql:et,singlestoredb:Be,snowflake:je}},__vite__mapDeps([0,1]),import.meta.url),K=I;if(!e||!ac(e))return K;switch(e){case"mysql":return f;case"mariadb":return d;case"postgres":case"postgresql":return _;case"sqlite":return T;case"db2":return i;case"db2i":return o;case"hive":return c;case"redshift":return C;case"snowflake":return N;case"trino":return $;case"tidb":return p;case"oracle":case"oracledb":return w;case"spark":return E;case"singlestoredb":return F;case"couchbase":return y;case"bigquery":return n;case"duckdb":return s;case"mssql":case"sqlserver":case"microsoft sql server":return V;case"athena":case"awsathena":case"cassandra":case"noql":case"flink":case"mongodb":case"timescaledb":case"datafusion":return I;case"databricks":return E;default:return _s(e),K}}var Xk=nd();function Yk(e,n){let i=document.createElement("div"),o;return{dom:i,mount(){o=(0,Xk.createRoot)(i),o.render((0,B.jsx)(X2,{store:lt,children:(0,B.jsx)(n,{view:e})}))},update(){o==null||o.render((0,B.jsx)(X2,{store:lt,children:(0,B.jsx)(n,{view:e})}))},destroy(){o==null||o.unmount()}}}function ye(e){return new gw(hw.define(e))}function Zi(e){return ce(()=>import("./dist-Z4EybR_c.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 Zk=[le.of({name:"C",extensions:["c","h","ino"],load(){return ce(()=>import("./dist-BhtRbLYO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),le.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return ce(()=>import("./dist-BhtRbLYO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),le.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Zi("Cassandra")}}),le.of({name:"CSS",extensions:["css"],load(){return ce(()=>import("./dist-B407S7D_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([8,9,5]),import.meta.url).then(e=>e.css())}}),le.of({name:"Go",extensions:["go"],load(){return ce(()=>import("./dist-CIhvkX-u.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([10,11,4,5]),import.meta.url).then(e=>e.go())}}),le.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return ce(()=>import("./dist-BSxIk2Vq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([12,9,5,13,14,4]),import.meta.url).then(e=>e.html())}}),le.of({name:"Java",extensions:["java"],load(){return ce(()=>import("./dist-CyLRJKkZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([15,16,5]),import.meta.url).then(e=>e.java())}}),le.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return ce(()=>import("./dist-SpkGM8op.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript())}}),le.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return ce(()=>import("./dist-Dnr44J-w.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([18,9,5,13,14,4,19]),import.meta.url).then(e=>e.jinja())}}),le.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return ce(()=>import("./dist-B_YgElQP.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([20,21,5]),import.meta.url).then(e=>e.json())}}),le.of({name:"JSX",extensions:["jsx"],load(){return ce(()=>import("./dist-SpkGM8op.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({jsx:!0}))}}),le.of({name:"LESS",extensions:["less"],load(){return ce(()=>import("./dist-BYEzs7zM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([22,9,5,23]),import.meta.url).then(e=>e.less())}}),le.of({name:"Liquid",extensions:["liquid"],load(){return ce(()=>import("./dist-0C6YCYyu.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([24,9,5,13,14,4,25]),import.meta.url).then(e=>e.liquid())}}),le.of({name:"MariaDB SQL",load(){return Zi("MariaSQL")}}),le.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return ce(()=>import("./dist-DstaRs6N.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([26,9,5,13,14,4,27]),import.meta.url).then(e=>e.markdown())}}),le.of({name:"MS SQL",load(){return Zi("MSSQL")}}),le.of({name:"MySQL",load(){return Zi("MySQL")}}),le.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return ce(()=>import("./dist-Ad37Z4TC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([28,9,5,13,14,4,29]),import.meta.url).then(e=>e.php())}}),le.of({name:"PLSQL",extensions:["pls"],load(){return Zi("PLSQL")}}),le.of({name:"PostgreSQL",load(){return Zi("PostgreSQL")}}),le.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return ce(()=>import("./dist-Cip4Ndtd.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([30,31,4,5]),import.meta.url).then(e=>e.python())}}),le.of({name:"Rust",extensions:["rs"],load(){return ce(()=>import("./dist-DiFit-1W.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([32,33,5]),import.meta.url).then(e=>e.rust())}}),le.of({name:"Sass",extensions:["sass"],load(){return ce(()=>import("./dist-CYdfU9am.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass({indented:!0}))}}),le.of({name:"SCSS",extensions:["scss"],load(){return ce(()=>import("./dist-CYdfU9am.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass())}}),le.of({name:"SQL",extensions:["sql"],load(){return Zi("StandardSQL")}}),le.of({name:"SQLite",load(){return Zi("SQLite")}}),le.of({name:"TSX",extensions:["tsx"],load(){return ce(()=>import("./dist-SpkGM8op.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}))}}),le.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return ce(()=>import("./dist-SpkGM8op.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({typescript:!0}))}}),le.of({name:"WebAssembly",extensions:["wat","wast"],load(){return ce(()=>import("./dist-w6kOVH_r.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([36,37,5]),import.meta.url).then(e=>e.wast())}}),le.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return ce(()=>import("./dist-Chrniyxe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([38,39,5]),import.meta.url).then(e=>e.xml())}}),le.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return ce(()=>import("./dist-fX0SBNCK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([40,41,5]),import.meta.url).then(e=>e.yaml())}}),le.of({name:"APL",extensions:["dyalog","apl"],load(){return ce(()=>import("./apl-Dkj9Qe7k.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([42,43]),import.meta.url).then(e=>ye(e.apl))}}),le.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return ce(()=>import("./asciiarmor-BtQZNUPe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([44,45]),import.meta.url).then(e=>ye(e.asciiArmor))}}),le.of({name:"ASN.1",extensions:["asn","asn1"],load(){return ce(()=>import("./asn1-Df2Lrqg5.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([46,47]),import.meta.url).then(e=>ye(e.asn1({})))}}),le.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return ce(()=>import("./asterisk-DQege133.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.asterisk))}}),le.of({name:"Brainfuck",extensions:["b","bf"],load(){return ce(()=>import("./brainfuck-BKWhJvy5.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([48,49]),import.meta.url).then(e=>ye(e.brainfuck))}}),le.of({name:"Cobol",extensions:["cob","cpy"],load(){return ce(()=>import("./cobol-D0Y9QJHH.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>ye(e.cobol))}}),le.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return ce(()=>import("./clike-Db5sDcCN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.csharp))}}),le.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return ce(()=>import("./clojure-CktH9n5q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>ye(e.clojure))}}),le.of({name:"ClojureScript",extensions:["cljs"],load(){return ce(()=>import("./clojure-CktH9n5q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>ye(e.clojure))}}),le.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return ce(()=>import("./css-DPSOOi60.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([56,57]),import.meta.url).then(e=>ye(e.gss))}}),le.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return ce(()=>import("./cmake-BwTN0lwz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([58,59]),import.meta.url).then(e=>ye(e.cmake))}}),le.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return ce(()=>import("./coffeescript-CL84ZPXU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([60,61]),import.meta.url).then(e=>ye(e.coffeeScript))}}),le.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return ce(()=>import("./commonlisp-CukhuKqj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([62,63]),import.meta.url).then(e=>ye(e.commonLisp))}}),le.of({name:"Cypher",extensions:["cyp","cypher"],load(){return ce(()=>import("./cypher-DTLWn8Gw.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([64,65]),import.meta.url).then(e=>ye(e.cypher))}}),le.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return ce(()=>import("./python-BAh1L3Ue.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([66,67]),import.meta.url).then(e=>ye(e.cython))}}),le.of({name:"Crystal",extensions:["cr"],load(){return ce(()=>import("./crystal-DjLRzuWS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([68,69]),import.meta.url).then(e=>ye(e.crystal))}}),le.of({name:"D",extensions:["d"],load(){return ce(()=>import("./d-DWjY1SxT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([70,71]),import.meta.url).then(e=>ye(e.d))}}),le.of({name:"Dart",extensions:["dart"],load(){return ce(()=>import("./clike-Db5sDcCN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.dart))}}),le.of({name:"diff",extensions:["diff","patch"],load(){return ce(()=>import("./diff-CBkFqCNH.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([72,73]),import.meta.url).then(e=>ye(e.diff))}}),le.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return ce(()=>import("./dockerfile-pmRcusjN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([74,75]),import.meta.url).then(e=>ye(e.dockerFile))}}),le.of({name:"DTD",extensions:["dtd"],load(){return ce(()=>import("./dtd-BuqGL9hz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([76,77]),import.meta.url).then(e=>ye(e.dtd))}}),le.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return ce(()=>import("./dylan-WTW5QtBM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([78,79]),import.meta.url).then(e=>ye(e.dylan))}}),le.of({name:"EBNF",load(){return ce(()=>import("./ebnf-BAIwm2E9.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.ebnf))}}),le.of({name:"ECL",extensions:["ecl"],load(){return ce(()=>import("./ecl-DBVSQs77.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([80,81]),import.meta.url).then(e=>ye(e.ecl))}}),le.of({name:"edn",extensions:["edn"],load(){return ce(()=>import("./clojure-CktH9n5q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>ye(e.clojure))}}),le.of({name:"Eiffel",extensions:["e"],load(){return ce(()=>import("./eiffel-C3Tl80Mr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([82,83]),import.meta.url).then(e=>ye(e.eiffel))}}),le.of({name:"Elm",extensions:["elm"],load(){return ce(()=>import("./elm-BzK6589w.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([84,85]),import.meta.url).then(e=>ye(e.elm))}}),le.of({name:"Erlang",extensions:["erl"],load(){return ce(()=>import("./erlang-DMCyf1S1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([86,87]),import.meta.url).then(e=>ye(e.erlang))}}),le.of({name:"Esper",load(){return ce(()=>import("./sql-Ba7Mq1qs.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.esper))}}),le.of({name:"Factor",extensions:["factor"],load(){return ce(()=>import("./factor-Y7W4xwTs.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([88,89,75]),import.meta.url).then(e=>ye(e.factor))}}),le.of({name:"FCL",load(){return ce(()=>import("./fcl-BRXWXeJY.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.fcl))}}),le.of({name:"Forth",extensions:["forth","fth","4th"],load(){return ce(()=>import("./forth-a7Ame17q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([90,91]),import.meta.url).then(e=>ye(e.forth))}}),le.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return ce(()=>import("./fortran-D8W1t7ql.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>ye(e.fortran))}}),le.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return ce(()=>import("./mllike-Dy0V9wt1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>ye(e.fSharp))}}),le.of({name:"Gas",extensions:["s"],load(){return ce(()=>import("./gas-CPCP4r6U.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([96,97]),import.meta.url).then(e=>ye(e.gas))}}),le.of({name:"Gherkin",extensions:["feature"],load(){return ce(()=>import("./gherkin-dyINaGjD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([98,99]),import.meta.url).then(e=>ye(e.gherkin))}}),le.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return ce(()=>import("./groovy-yBYyWQAY.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([100,101]),import.meta.url).then(e=>ye(e.groovy))}}),le.of({name:"Haskell",extensions:["hs"],load(){return ce(()=>import("./haskell-DOSr8Xuo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([102,103]),import.meta.url).then(e=>ye(e.haskell))}}),le.of({name:"Haxe",extensions:["hx"],load(){return ce(()=>import("./haxe-JqSUWIxe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>ye(e.haxe))}}),le.of({name:"HXML",extensions:["hxml"],load(){return ce(()=>import("./haxe-JqSUWIxe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>ye(e.hxml))}}),le.of({name:"HTTP",load(){return ce(()=>import("./http-DxX5IMY1.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.http))}}),le.of({name:"IDL",extensions:["pro"],load(){return ce(()=>import("./idl-D2Ag6F2o.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([106,107]),import.meta.url).then(e=>ye(e.idl))}}),le.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return ce(()=>import("./javascript-3AO8kHoR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([108,109]),import.meta.url).then(e=>ye(e.jsonld))}}),le.of({name:"Julia",extensions:["jl"],load(){return ce(()=>import("./julia-DB4UbzHR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([110,111]),import.meta.url).then(e=>ye(e.julia))}}),le.of({name:"Kotlin",extensions:["kt","kts"],load(){return ce(()=>import("./clike-Db5sDcCN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.kotlin))}}),le.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return ce(()=>import("./livescript-DReeORQ9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([112,113]),import.meta.url).then(e=>ye(e.liveScript))}}),le.of({name:"Lua",extensions:["lua"],load(){return ce(()=>import("./lua-ybhkw42a.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([114,115]),import.meta.url).then(e=>ye(e.lua))}}),le.of({name:"mIRC",extensions:["mrc"],load(){return ce(()=>import("./mirc-BeRjyZ00.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([116,117]),import.meta.url).then(e=>ye(e.mirc))}}),le.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return ce(()=>import("./mathematica-DknPFJHQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([118,119]),import.meta.url).then(e=>ye(e.mathematica))}}),le.of({name:"Modelica",extensions:["mo"],load(){return ce(()=>import("./modelica--iMtH0NO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([120,121]),import.meta.url).then(e=>ye(e.modelica))}}),le.of({name:"MUMPS",extensions:["mps"],load(){return ce(()=>import("./mumps-DXhR5sNO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([122,123]),import.meta.url).then(e=>ye(e.mumps))}}),le.of({name:"Mbox",extensions:["mbox"],load(){return ce(()=>import("./mbox-CvGrdGLO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([124,125]),import.meta.url).then(e=>ye(e.mbox))}}),le.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return ce(()=>import("./nginx-C7sPMZD3.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.nginx))}}),le.of({name:"NSIS",extensions:["nsh","nsi"],load(){return ce(()=>import("./nsis-FfqfUShs.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([126,127,75]),import.meta.url).then(e=>ye(e.nsis))}}),le.of({name:"NTriples",extensions:["nt","nq"],load(){return ce(()=>import("./ntriples-C3Y5YwlO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([128,129]),import.meta.url).then(e=>ye(e.ntriples))}}),le.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return ce(()=>import("./clike-Db5sDcCN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.objectiveC))}}),le.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return ce(()=>import("./clike-Db5sDcCN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.objectiveCpp))}}),le.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return ce(()=>import("./mllike-Dy0V9wt1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>ye(e.oCaml))}}),le.of({name:"Octave",extensions:["m"],load(){return ce(()=>import("./octave-Dn-U4f-O.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([130,131]),import.meta.url).then(e=>ye(e.octave))}}),le.of({name:"Oz",extensions:["oz"],load(){return ce(()=>import("./oz-Dx3Usekg.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([132,133]),import.meta.url).then(e=>ye(e.oz))}}),le.of({name:"Pascal",extensions:["p","pas"],load(){return ce(()=>import("./pascal-Bhoas9O4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([134,135]),import.meta.url).then(e=>ye(e.pascal))}}),le.of({name:"Perl",extensions:["pl","pm"],load(){return ce(()=>import("./perl-uQVtdMdg.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([136,137]),import.meta.url).then(e=>ye(e.perl))}}),le.of({name:"Pig",extensions:["pig"],load(){return ce(()=>import("./pig-DDagqkh7.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([138,139]),import.meta.url).then(e=>ye(e.pig))}}),le.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return ce(()=>import("./powershell-WeyQqZtK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([140,141]),import.meta.url).then(e=>ye(e.powerShell))}}),le.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return ce(()=>import("./properties-MEyUmkzm.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([142,143]),import.meta.url).then(e=>ye(e.properties))}}),le.of({name:"ProtoBuf",extensions:["proto"],load(){return ce(()=>import("./protobuf-DrUQLGvH.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([144,145]),import.meta.url).then(e=>ye(e.protobuf))}}),le.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return ce(()=>import("./pug-YYu0lKKy.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([146,147,109]),import.meta.url).then(e=>ye(e.pug))}}),le.of({name:"Puppet",extensions:["pp"],load(){return ce(()=>import("./puppet-C9UhEtzi.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([148,149]),import.meta.url).then(e=>ye(e.puppet))}}),le.of({name:"Q",extensions:["q"],load(){return ce(()=>import("./q-CoA1I94V.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([150,151]),import.meta.url).then(e=>ye(e.q))}}),le.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return ce(()=>import("./r-CnPeMCLv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([152,153]),import.meta.url).then(e=>ye(e.r))}}),le.of({name:"RPM Changes",load(){return ce(()=>import("./rpm-DOBsrwns.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>ye(e.rpmChanges))}}),le.of({name:"RPM Spec",extensions:["spec"],load(){return ce(()=>import("./rpm-DOBsrwns.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>ye(e.rpmSpec))}}),le.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return ce(()=>import("./ruby-DphmqCS4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([156,157]),import.meta.url).then(e=>ye(e.ruby))}}),le.of({name:"SAS",extensions:["sas"],load(){return ce(()=>import("./sas-DqX-D0mu.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([158,159]),import.meta.url).then(e=>ye(e.sas))}}),le.of({name:"Scala",extensions:["scala"],load(){return ce(()=>import("./clike-Db5sDcCN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.scala))}}),le.of({name:"Scheme",extensions:["scm","ss"],load(){return ce(()=>import("./scheme-BDPqQOec.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([160,161]),import.meta.url).then(e=>ye(e.scheme))}}),le.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return ce(()=>import("./shell-BbHQ-2DS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([162,163]),import.meta.url).then(e=>ye(e.shell))}}),le.of({name:"Sieve",extensions:["siv","sieve"],load(){return ce(()=>import("./sieve-AQvCITfE.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([164,165]),import.meta.url).then(e=>ye(e.sieve))}}),le.of({name:"Smalltalk",extensions:["st"],load(){return ce(()=>import("./smalltalk-C_EFh1kg.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([166,167]),import.meta.url).then(e=>ye(e.smalltalk))}}),le.of({name:"Solr",load(){return ce(()=>import("./solr-B2csZ4mu.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.solr))}}),le.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return ce(()=>import("./mllike-Dy0V9wt1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>ye(e.sml))}}),le.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return ce(()=>import("./sparql-BlXg3dFR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([168,169]),import.meta.url).then(e=>ye(e.sparql))}}),le.of({name:"Spreadsheet",alias:["excel","formula"],load(){return ce(()=>import("./spreadsheet-C9drr7Wf.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.spreadsheet))}}),le.of({name:"Squirrel",extensions:["nut"],load(){return ce(()=>import("./clike-Db5sDcCN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.squirrel))}}),le.of({name:"Stylus",extensions:["styl"],load(){return ce(()=>import("./stylus-Dvm1D-Up.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([170,171]),import.meta.url).then(e=>ye(e.stylus))}}),le.of({name:"Swift",extensions:["swift"],load(){return ce(()=>import("./swift-BYNffoE5.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([172,173]),import.meta.url).then(e=>ye(e.swift))}}),le.of({name:"sTeX",load(){return ce(()=>import("./stex-D6sqtveI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>ye(e.stex))}}),le.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return ce(()=>import("./stex-D6sqtveI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>ye(e.stex))}}),le.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return ce(()=>import("./verilog-CtASbUB4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>ye(e.verilog))}}),le.of({name:"Tcl",extensions:["tcl"],load(){return ce(()=>import("./tcl-BXf8cJq0.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([178,179]),import.meta.url).then(e=>ye(e.tcl))}}),le.of({name:"Textile",extensions:["textile"],load(){return ce(()=>import("./textile-BYQcpBSz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([180,181]),import.meta.url).then(e=>ye(e.textile))}}),le.of({name:"TiddlyWiki",load(){return ce(()=>import("./tiddlywiki-CEYqr2EK.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.tiddlyWiki))}}),le.of({name:"Tiki wiki",load(){return ce(()=>import("./tiki-Drx00sPe.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.tiki))}}),le.of({name:"TOML",extensions:["toml"],load(){return ce(()=>import("./toml-DRBRsKy_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([182,183]),import.meta.url).then(e=>ye(e.toml))}}),le.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return ce(()=>import("./troff-DrvwLjLq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([184,185]),import.meta.url).then(e=>ye(e.troff))}}),le.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return ce(()=>import("./ttcn-DP5EbkJT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([186,187]),import.meta.url).then(e=>ye(e.ttcn))}}),le.of({name:"TTCN_CFG",extensions:["cfg"],load(){return ce(()=>import("./ttcn-cfg-BRAAKR13.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([188,189]),import.meta.url).then(e=>ye(e.ttcnCfg))}}),le.of({name:"Turtle",extensions:["ttl"],load(){return ce(()=>import("./turtle-Dfy5N6iI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([190,191]),import.meta.url).then(e=>ye(e.turtle))}}),le.of({name:"Web IDL",extensions:["webidl"],load(){return ce(()=>import("./webidl-CHQTLbOi.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([192,193]),import.meta.url).then(e=>ye(e.webIDL))}}),le.of({name:"VB.NET",extensions:["vb"],load(){return ce(()=>import("./vb-DzPnQ7Kn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([194,195]),import.meta.url).then(e=>ye(e.vb))}}),le.of({name:"VBScript",extensions:["vbs"],load(){return ce(()=>import("./vbscript-Dsr7xm0B.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([196,197]),import.meta.url).then(e=>ye(e.vbScript))}}),le.of({name:"Velocity",extensions:["vtl"],load(){return ce(()=>import("./velocity-BP08r0ZT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([198,199]),import.meta.url).then(e=>ye(e.velocity))}}),le.of({name:"Verilog",extensions:["v"],load(){return ce(()=>import("./verilog-CtASbUB4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>ye(e.verilog))}}),le.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return ce(()=>import("./vhdl-BNXpaYPc.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([200,201]),import.meta.url).then(e=>ye(e.vhdl))}}),le.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return ce(()=>import("./xquery-BysgHIf7.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([202,203]),import.meta.url).then(e=>ye(e.xQuery))}}),le.of({name:"Yacas",extensions:["ys"],load(){return ce(()=>import("./yacas-jKltHvRl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([204,205]),import.meta.url).then(e=>ye(e.yacas))}}),le.of({name:"Z80",extensions:["z80"],load(){return ce(()=>import("./z80-DVuK3CCU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([206,207]),import.meta.url).then(e=>ye(e.z80))}}),le.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return ce(()=>import("./mscgen-CqR_OhJF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>ye(e.mscgen))}}),le.of({name:"X\xF9",extensions:["xu"],load(){return ce(()=>import("./mscgen-CqR_OhJF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>ye(e.xu))}}),le.of({name:"MsGenny",extensions:["msgenny"],load(){return ce(()=>import("./mscgen-CqR_OhJF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>ye(e.msgenny))}}),le.of({name:"Vue",extensions:["vue"],load(){return ce(()=>import("./dist-rTuWF9u4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([210,9,5,13,14,4,211]),import.meta.url).then(e=>e.vue())}}),le.of({name:"Angular Template",load(){return ce(()=>import("./dist-DeazQ1Kh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([212,9,5,13,14,4]),import.meta.url).then(e=>e.angular())}})],Wg=new WeakMap,eS=/(\n|\r\n?|\u2028|\u2029)/g,tS=/^\s*/,nS=/\S/,rS=Array.prototype.slice,Wd=48,Ug=57,Kg=97,iS=102,Qg=65,aS=70;Jl=function(e){if(typeof e=="string")return Xg([e])[0];if(typeof e=="function")return function(){let o=rS.call(arguments);return o[0]=Jg(o[0]),e.apply(this,o)};let n=Jg(e),i=Gg(n,0);for(let o=1;o<n.length;o++)i+=arguments[o]+Gg(n,o);return i};function Gg(e,n){let i=e[n];if(i===void 0)throw TypeError(`invalid cooked string at index ${n}`);return i}function Jg(e){let n=Wg.get(e);if(n)return n;let i=Xg(e.raw),o=i.map(sS);return Object.defineProperty(o,"raw",{value:Object.freeze(i)}),Object.freeze(o),Wg.set(e,o),o}function Xg(e){let n=e.map(s=>s.split(eS)),i;for(let s=0;s<n.length;s++){let c=n[s],d=s===0,f=s+1===n.length;if(d){if(c.length===1||c[0].length>0)throw Error("invalid content on opening line");c[1]=""}if(f){if(c.length===1||nS.test(c[c.length-1]))throw Error("invalid content on closing line");c[c.length-2]="",c[c.length-1]=""}for(let p=2;p<c.length;p+=2){let y=c[p],w=p+1===c.length&&!f,_=tS.exec(y)[0];if(!w&&_.length===y.length){c[p]="";continue}i=oS(_,i)}}let o=i?i.length:0;return n.map(s=>{let c=s[0];for(let d=1;d<s.length;d+=2){let f=s[d],p=s[d+1];c+=f+p.slice(o)}return c})}function oS(e,n){if(n===void 0||e===n)return e;let i=0;for(let o=Math.min(e.length,n.length);i<o&&e[i]===n[i];i++);return e.slice(0,i)}function sS(e){let n="",i=0,o=0;for(;(o=e.indexOf("\\",o))>-1;){if(n+=e.slice(i,o),++o===e.length)return;let s=e[o++];switch(s){case"b":n+="\b";break;case"t":n+=" ";break;case"n":n+=`
63
+ """, engine=${o})`}return`_df = mo.sql(f'SELECT "${n}" FROM ${e.name} LIMIT 100')`},__=function(e,n){if(n==="date"||n==="datetime"||n==="time"){if(e==="min")return"Earliest";if(e==="max")return"Latest"}return e};function Pk(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:VD,createActions:$D,valueAtom:Rg,useActions:Mk}=Ml(Pk,{addDatasets:(e,n)=>{let{previewDatasetColumn:i}=Vi();for(let f of n.tables)for(let p of f.columns){let y=`${f.name}:${p.name}`;e.expandedColumns.has(y)&&i({tableName:f.name,columnName:p.name,source:f.source,sourceType:f.source_type})}let o=e.tables;n.clear_channel&&(o=o.filter(f=>f.source!==n.clear_channel));let s=[...n.tables,...o],c=new Set,d=s.filter(f=>{let p=`${f.name}:${f.source}`;return c.has(p)?!1:(c.add(p),!0)}).sort((f,p)=>f.name.localeCompare(p.name));return{...e,tables:d}},filterDatasetsFromVariables:(e,n)=>{let i=new Set(n),o=e.tables.filter(s=>s.variable_name?i.has(s.variable_name):!0);return{...e,tables:o}},toggleTable:(e,n)=>{let i=new Set(e.expandedTables);return i.has(n)?i.delete(n):i.add(n),{...e,expandedTables:i}},toggleColumn:(e,n)=>{let i=`${n.table}:${n.column}`,o=new Set(e.expandedColumns);return o.has(i)?o.delete(i):o.add(i),{...e,expandedColumns:o}},closeAllColumns:e=>({...e,expandedColumns:new Set}),addColumnPreview:(e,n)=>{let i=`${n.table_name}:${n.column_name}`,o=new Map(e.columnsPreviews);return o.set(i,n),{...e,columnsPreviews:o}}});z_=()=>Zn(Rg),dd=ze(e=>e(Rg).tables),v_=ze(new Set),W_=ze(!1),ox=function(){return Mk()};var Lk=new Map([[$i,{name:$i,dialect:"duckdb",source:"duckdb",display_name:"DuckDB (In-Memory)",databases:[]}]]);function Nk(){return{latestEngineSelected:$i,connectionsMap:Lk}}let Ik,Ak;({reducer:Ik,createActions:Ak,valueAtom:So,useActions:m_}=Ml(Nk,{addDataSourceConnection:(e,n)=>{if(n.connections.length===0)return e;let{latestEngineSelected:i,connectionsMap:o}=e,s=new Map(o);for(let c of n.connections)s.set(c.name,c);return{latestEngineSelected:i,connectionsMap:s}},filterDataSourcesFromVariables:(e,n)=>{let{latestEngineSelected:i,connectionsMap:o}=e,s=new Set(n),c=new Map([...o].filter(([d])=>ko.has(d)?!0:s.has(d)));return{latestEngineSelected:c.has(i)?i:$i,connectionsMap:c}},clearDataSourceConnections:()=>({latestEngineSelected:$i,connectionsMap:new Map}),removeDataSourceConnection:(e,n)=>{let{latestEngineSelected:i,connectionsMap:o}=e,s=new Map(o);return s.delete(n),{latestEngineSelected:s.has(i)?i:$i,connectionsMap:s}},addTableList:(e,n)=>{let{tables:i,sqlTableContext:o}=n,{connectionsMap:s,latestEngineSelected:c}=e,d=o.engine,f=s.get(d);if(!f)return e;let p=new Map(s),y={...f,databases:f.databases.map(w=>w.name===o.database?{...w,schemas:w.schemas.map(_=>_.name===o.schema?{..._,tables:i}:_)}:w)};return p.set(d,y),{latestEngineSelected:c,connectionsMap:p}},addTable:(e,n)=>{let{table:i,sqlTableContext:o}=n,{connectionsMap:s,latestEngineSelected:c}=e,d=o.engine,f=i.name,p=s.get(d);if(!p)return e;let y=new Map(s),w={...p,databases:p.databases.map(_=>_.name===o.database?{..._,schemas:_.schemas.map(C=>{if(C.name!==o.schema)return C;let E=C.tables.length===0?[i]:C.tables.map(T=>T.name===f?i:T);return{...C,tables:E}})}:_)};return y.set(d,w),{latestEngineSelected:c,connectionsMap:y}}})),ld=ze(e=>e(So).connectionsMap);function Dg(e){let n=lt.get(So);n.connectionsMap.has(e)&&lt.set(So,{...n,latestEngineSelected:e})}rx=ze(e=>{let n=lt.get(dd),i=e(So).connectionsMap,o=new Map;for(let s of n)o.set(s.name,s);for(let s of i.values())for(let c of s.databases){let d=c.name===s.default_database||s.databases.length===1;for(let f of c.schemas){let p=f.name===s.default_schema,y=Ul(f.name);for(let w of f.tables){let _;if(_=w.name,y){_=d?w.name:`${c.name}.${w.name}`,o.has(_)?Se.warn(`Table name collision for ${_}. Skipping.`):o.set(_,w);continue}if(d&&p&&!o.has(_)){o.set(_,w);continue}if(_=`${f.name}.${w.name}`,d&&!o.has(_)){o.set(_,w);continue}_=`${c.name}.${f.name}.${w.name}`,o.has(_)?Se.warn(`Table name collision for ${_}. Skipping.`):o.set(_,w)}}}return o}),P_=function(e){return e.variable_name?"dataframe":"table"};let ac,Fd,Og,Bd,Pg,Mg,Hd,Lg;ac=class{constructor(e,n={}){ke(this,"cache",new Map);this.maxSize=e,this.options=n}getOrCreate(e){In(this.options.create,"create function is required");let n=this.cache.get(e);if(n!==void 0)return n;let i=this.options.create(e);return this.cache.set(e,i),i}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 i=this.cache.keys().next().value;i!==void 0&&this.cache.delete(i)}}keys(){return this.cache.keys()}values(){return this.cache.values()}entries(){return this.cache.entries()}delete(e){this.cache.delete(e)}},ym=Tt("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"}]]),Lh=Tt("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"}]]),Yh=Tt("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"}]]),dm=Tt("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"}]]),sm=Tt("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"}]]),Fd=Tt("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"}]]),cm=Tt("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"}]]),Vh=Tt("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"}]]),Rm=Tt("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Og=Tt("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"}]]),$h=Tt("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),Bd=Tt("database-backup",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 12a9 3 0 0 0 5 2.69",key:"1ui2ym"}],["path",{d:"M21 9.3V5",key:"6k6cib"}],["path",{d:"M3 5v14a9 3 0 0 0 6.47 2.88",key:"i62tjy"}],["path",{d:"M12 12v4h4",key:"1bxaet"}],["path",{d:"M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16",key:"1f4ei9"}]]),Cs=Tt("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"}]]),Gu=Tt("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=Tt("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"}]]),Pg=Tt("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"}]]),Hu=Tt("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Mg=Tt("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"}]]),_o=Tt("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"}]]),Nh=Tt("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"}]]),Am=Tt("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=Tt("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"}]]),Wh=Tt("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"}]]),Hd=Tt("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"}]]),Lg=Tt("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"}]]),Fh=Tt("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"}]]),wo=Tt("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"}]]),Jh=Tt("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"}]]),Qh=Tt("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"}]]),Al=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 Ng(e){let[n,i]=e.split(" ");return i?`${Al(n)} ${i}`:Al(e)}zu={boolean:p4,date:h4,time:Rm,datetime:Fd,temporal:Fd,number:bh,string:m4,integer:bh,unknown:sm},L_=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 _s(e),"bg-(--slate-4) dark:bg-(--slate-6)"}};let Ps,B,Ig,Vd,Ag,Lo,qg,jg,zg,Fg,Bg,No,ei,za,pi,$d;Pa=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`}},I_=class wx{constructor(n){this.words=n}static of(...n){return new wx(n.map(i=>typeof i=="string"?new Pa(i):i))}join(n,i){return this.words.map(o=>o.pluralize(i)).join(n)}},Ps=Jr(),B=vh(k4(),1),Ig=5,Vd={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)]"},Ag={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)]"},Lo="p-3 min-w-[250px] flex flex-col divide-y",qg=new Pa("column","columns"),jg=new Pa("row","rows"),zg=new Pa("schema","schemas"),Fg=new Pa("table","tables"),Bg=new Pa("database","databases"),No=e=>{let n=(0,Ps.c)(6),{icon:i,title:o,badge:s}=e,c;n[0]===o?c=n[1]:(c=(0,B.jsx)("h3",{className:"font-semibold text-sm",children:o}),n[0]=o,n[1]=c);let d;return n[2]!==s||n[3]!==i||n[4]!==c?(d=(0,B.jsxs)("div",{className:"flex items-center gap-2 pb-2",children:[i,c,s]}),n[2]=s,n[3]=i,n[4]=c,n[5]=d):d=n[5],d},ei=e=>{let n=(0,Ps.c)(5),{label:i,value:o}=e,s;n[0]===i?s=n[1]:(s=(0,B.jsxs)("span",{className:"text-[var(--slate-11)]",children:[i,":"]}),n[0]=i,n[1]=s);let c;return n[2]!==s||n[3]!==o?(c=(0,B.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},za=e=>{let n=(0,Ps.c)(5),{icon:i,text:o}=e,s;n[0]===o?s=n[1]:(s=(0,B.jsx)("span",{className:"text-xs text-[var(--slate-11)]",children:o}),n[0]=o,n[1]=s);let c;return n[2]!==i||n[3]!==s?(c=(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[i,s]}),n[2]=i,n[3]=s,n[4]=c):c=n[4],c},pi=e=>{let n=(0,Ps.c)(15),{title:i,items:o,totalCount:s,limit:c}=e,d=i===void 0?"":i,f=c===void 0?Ig:c;if(o.length===0)return null;let p;n[0]!==o||n[1]!==f?(p=o.slice(0,f),n[0]=o,n[1]=f,n[2]=p):p=n[2];let y=p,w=s>f,_;n[3]===d?_=n[4]:(_=d&&(0,B.jsxs)("h4",{className:"text-xs font-medium text-[var(--slate-11)] mb-2",children:[d,":"]}),n[3]=d,n[4]=_);let C;n[5]!==w||n[6]!==f||n[7]!==s?(C=w&&(0,B.jsxs)("div",{className:"text-xs text-[var(--slate-10)] text-center py-1",children:["... and ",s-f," more"]}),n[5]=w,n[6]=f,n[7]=s,n[8]=C):C=n[8];let E;n[9]!==C||n[10]!==y?(E=(0,B.jsxs)("div",{className:"flex flex-col gap-1 overflow-y-auto",children:[y,C]}),n[9]=C,n[10]=y,n[11]=E):E=n[11];let T;return n[12]!==_||n[13]!==E?(T=(0,B.jsxs)("div",{className:"py-2",children:[_,E]}),n[12]=_,n[13]=E,n[14]=T):T=n[14],T},$d=e=>Vd[e]||Vd.unknown;const qk=e=>{var d,f;let n=e.type==="view"?(0,B.jsx)(Gu,{className:"w-4 h-4 text-[var(--blue-9)]"}):(0,B.jsx)(wo,{className:"w-4 h-4 text-[var(--green-9)]"}),i=(0,B.jsx)(mr,{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(p=>{let y=zu[p.type];return(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs rounded",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(y,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{className:"font-mono",children:p.name})]}),(0,B.jsx)(mr,{variant:"outline",className:`text-xs ${$d(p.type)}`,children:p.type})]},p.name)}),s=e.primary_keys&&e.primary_keys.length>0,c=e.indexes&&e.indexes.length>0;return(0,B.jsxs)("div",{className:`${Lo} min-w-[300px]`,children:[(0,B.jsx)(No,{icon:n,title:e.name,badge:i}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,B.jsx)(ei,{label:"Source",value:(0,B.jsx)(mr,{variant:"outline",className:`text-xs ${Ag[e.source_type]}`,children:e.source})}),e.variable_name&&(0,B.jsx)(ei,{label:"Variable",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.variable_name})}),e.engine&&(0,B.jsx)(ei,{label:"Engine",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(e.num_columns!=null||e.num_rows!=null)&&(0,B.jsxs)("div",{className:"grid grid-cols-2 gap-2 py-2",children:[e.num_columns!=null&&(0,B.jsx)(za,{icon:(0,B.jsx)($h,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_columns} ${qg.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,B.jsx)(za,{icon:(0,B.jsx)(bh,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_rows} ${jg.pluralize(e.num_rows)}`})]}),e.columns.length===0&&oc("column"),(s||c)&&(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[s&&(0,B.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[(0,B.jsx)(OD,{className:"w-3 h-3 text-[var(--amber-9)]"}),(0,B.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Primary Keys:"})]}),(d=e.primary_keys)==null?void 0:d.map(p=>(0,B.jsx)(mr,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:p},p))]}),c&&(0,B.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,B.jsxs)("div",{className:"flex items-center gap-1 mb-1",children:[(0,B.jsx)(Lh,{className:"w-3 h-3 text-[var(--purple-9)]"}),(0,B.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Indexes:"})]}),(f=e.indexes)==null?void 0:f.map(p=>(0,B.jsx)(mr,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:p},p))]})]}),e.columns.length>0&&(0,B.jsx)(pi,{items:o,totalCount:e.columns.length})]})},jk=e=>{var s;let n=zu[e.type],i=(0,B.jsx)(mr,{variant:"outline",className:`text-xs ${$d(e.type)}`,children:e.type}),o=((s=e.sample_values)==null?void 0:s.map((c,d)=>(0,B.jsx)("div",{className:"text-xs bg-[var(--slate-3)] rounded font-mono",children:c==null?"null":String(c)},d)))||[];return(0,B.jsxs)("div",{className:Lo,children:[(0,B.jsx)(No,{icon:(0,B.jsx)(n,{className:"w-4 h-4 text-[var(--slate-9)]"}),title:e.name,badge:i}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 mt-2",children:[(0,B.jsx)(ei,{label:"Type",value:(0,B.jsx)("span",{className:"font-medium",children:e.type})}),(0,B.jsx)(ei,{label:"External Type",value:(0,B.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,B.jsx)(pi,{title:"Sample Values",items:o,totalCount:e.sample_values.length})]})},zk=e=>{let n=(0,B.jsx)(mr,{variant:"outline",className:"text-xs bg-[var(--blue-4)] text-[var(--blue-11)]",children:e.dialect}),i=e.schemas.map(o=>(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(_o,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{children:o.name})]}),(0,B.jsxs)(mr,{variant:"outline",className:"text-xs",children:[o.tables.length," ",Fg.pluralize(o.tables.length)]})]},o.name));return(0,B.jsxs)("div",{className:Lo,children:[(0,B.jsx)(No,{icon:(0,B.jsx)(Cs,{className:"w-4 h-4 text-[var(--blue-9)]"}),title:e.name,badge:n}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,B.jsx)(ei,{label:"Dialect",value:(0,B.jsx)("span",{className:"font-medium",children:e.dialect})}),e.engine&&(0,B.jsx)(ei,{label:"Engine",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(0,B.jsx)("div",{className:"py-2",children:(0,B.jsx)(za,{icon:(0,B.jsx)(_o,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.schemas.length} schema${e.schemas.length===1?"":"s"}`})}),e.schemas.length===0&&oc("schema"),e.schemas.length>0&&(0,B.jsx)(pi,{title:"Schemas",items:i,totalCount:e.schemas.length})]})},Fk=e=>{let n=(0,B.jsx)(mr,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:"Schema"}),i=e.tables.map(o=>(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[o.type==="view"?(0,B.jsx)(Gu,{className:"w-3 h-3 text-[var(--blue-9)]"}):(0,B.jsx)(wo,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,B.jsx)("span",{children:o.name})]}),(0,B.jsx)(mr,{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,B.jsxs)("div",{className:Lo,children:[(0,B.jsx)(No,{icon:(0,B.jsx)(_o,{className:"w-4 h-4 text-[var(--green-9)]"}),title:e.name,badge:n}),(0,B.jsx)("div",{className:"py-2",children:(0,B.jsx)(za,{icon:(0,B.jsx)(wo,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.tables.length} table${e.tables.length===1?"":"s"}`})}),e.tables.length===0&&oc("table"),e.tables.length>0&&(0,B.jsx)(pi,{title:"Tables",items:i,totalCount:e.tables.length})]})};var Hg=(0,B.jsx)(mr,{variant:"outline",children:"default"}),Bk=8,Vg=3;let oc;jw=(e,n)=>{let i=e.databases.length,o=e.databases.reduce((p,y)=>p+y.schemas.length,0),s=(p,y)=>{if(p.tables.length===0)return null;let w=p.name===e.default_schema&&y,_=[];return o<Bk&&(_=p.tables.slice(0,Vg+1).map(C=>(0,B.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,B.jsx)(wo,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:C.name})]},C.name))),(0,B.jsxs)("div",{children:[(0,B.jsxs)("div",{className:"flex items-center gap-2 text-xs rounded hover:bg-[var(--slate-3)] ml-2",children:[(0,B.jsx)(_o,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{children:p.name}),w&&Hg,(0,B.jsxs)(mr,{variant:"outline",className:"text-xs ml-auto",children:[p.tables.length," tables"]})]}),(0,B.jsx)(pi,{items:_,totalCount:p.tables.length,limit:Vg})]},p.name)},c=e.databases.map(p=>{let y=p.name===e.default_database||e.databases.length===1,w=p.schemas.map(_=>s(_,y));return(0,B.jsxs)("div",{children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(Cs,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:p.name}),y&&Hg]}),w&&(0,B.jsx)(pi,{items:w,totalCount:p.schemas.length})]},p.name)}),d=e.name;ko.has(e.name)&&(d="In-Memory");let f=n==null?void 0:n.map(p=>(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(wo,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:p.name})]},p.name));return(0,B.jsxs)("div",{className:`${Lo} px-1`,children:[(0,B.jsx)(No,{icon:(0,B.jsx)(Og,{className:"w-4 h-4 text-[var(--purple-9)]"}),title:d}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,B.jsx)(ei,{label:"Dialect",value:(0,B.jsx)("span",{className:"font-medium",children:Al(e.dialect)})}),(0,B.jsx)(ei,{label:"Source",value:(0,B.jsx)(mr,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:e.source})})]}),(0,B.jsxs)("div",{className:"flex flex-row justify-between py-2",children:[(0,B.jsx)(za,{icon:(0,B.jsx)(Cs,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${i} ${Bg.pluralize(i)}`}),(0,B.jsx)(za,{icon:(0,B.jsx)(_o,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${o} ${zg.pluralize(o)}`})]}),i>0&&(0,B.jsx)(pi,{items:c,totalCount:i}),f&&f.length>0&&(0,B.jsx)(pi,{title:"Dataframes",items:f,totalCount:f.length})]})},oc=e=>(0,B.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,B.jsx)(Hu,{size:10,className:"mt-1 text-[var(--slate-10)] shrink-0"}),(0,B.jsxs)("span",{className:"text-xs text-[var(--slate-11)]",children:["No ",e," information available.",`
64
+ `,(0,B.jsx)("span",{className:"text-[var(--blue-10)]",children:"Introspect to see more details."})]})]});var sc=nd(),$g=class{constructor(){ke(this,"schema",{})}addTable(e,n){let i={self:Vk({table:n}),children:n.columns.map(o=>Hk({column:o}))};return this.setAt([...e,n.name],i),this}addSchema(e,n){let i={self:$k({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}addDatabase(e,n){let i={self:Wk({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}setAt(e,n){let i=this.schema;for(let o of e.slice(0,-1))i[o]||(i[o]={children:{}}),i=i[o].children;i[e[e.length-1]]=n}build(){return this.schema}reset(){return this.schema={},this}};function Hk(e){return{label:e.column.name,type:"column",info:()=>{let n=document.createElement("div");return(0,sc.createRoot)(n).render(jk(e.column)),{dom:n}}}}function Vk(e){return{label:e.table.name,type:"table",info:()=>{let n=document.createElement("div");return(0,sc.createRoot)(n).render(qk(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,sc.createRoot)(n).render(Fk(e.namespace)),{dom:n}}}}function Wk(e){return{label:e.namespace.name,detail:e.path.join("."),type:"database",info:()=>{let n=document.createElement("div");return(0,sc.createRoot)(n).render(zk(e.namespace)),{dom:n}}}}var Uk=ze(e=>{let n=e(dd),i=new $g;for(let o of n)i.addTable([],o);return i.build()}),Kk=class{constructor(){this.cache=new ac(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return lt.get(ld).get(e)}getConnectionSchema(e){var d;let{default_database:n,databases:i,default_schema:o}=e,s=new $g,c=i.find(f=>f.name===n||i.length===1);if(((d=c??i[0])==null?void 0:d.schemas.some(f=>Ul(f.name)))??!1){for(let f of i){let p=f.name===(c==null?void 0:c.name),y=f.schemas.flatMap(w=>w.tables);s.addDatabase([f.name],f);for(let w of y)p?s.addTable([],w):s.addTable([f.name],w)}return{shouldAddLocalTables:!1,schema:s.build(),defaultSchema:c==null?void 0:c.name}}if(c)for(let f of c.schemas){s.addSchema([f.name],f);for(let p of f.tables)s.addTable([f.name],p)}for(let f of i){s.addDatabase([f.name],f);for(let p of f.schemas){s.addSchema([f.name,p.name],p);for(let y of p.tables)s.addTable([f.name,p.name],y)}}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?Tg(n):Ds}getCompletionSource(e){let n=this.getConnection(e);if(!n)return null;let i=()=>lt.get(Uk),o=this.cache.getOrCreate(n);return{dialect:Tg(n),schema:o.shouldAddLocalTables?{...o.schema,...i()}:o.schema,defaultSchema:o.defaultSchema,defaultTable:Qk(n)}}};function Qk(e){if(e.databases.length!==1)return;let n=e.databases[0];if(n.schemas.length!==1)return;let i=n.schemas[0];if(i.tables.length===1)return i.tables[0].name}const Fa=new Kk,Ms=Bi.define();Fu=async function(e){let{sendFormat:n}=Vi(),i=ui.mapValues(e,s=>Xr(s)),o=await n({codes:i,lineLength:iw().formatting.line_length});for(let[s,c]of ui.entries(o.codes)){let d=s,f=i[d],p=e[d];p&&c!==f&&(p.state.facet(Pt).updateCellCode({cellId:d,code:c,formattingChange:!0}),xo(p,c))}},n_=function(){return Fu(Ck(od()))};async function Gk(e,n){let{formatDialect:i}=await ce(async()=>{let{formatDialect:_}=await import("./esm-BHwEmOw7.js").then(async C=>(await C.__tla,C));return{formatDialect:_}},__vite__mapDeps([0,1]),import.meta.url),o=await Jk(Fa.getInternalDialect(n)),s=e.state.field(Lr),c=S4(e.state);if(s.type!=="sql"){Se.error("Language adapter is not SQL");return}let d=e.state.doc.toString(),f;try{f=i(d,{dialect:o,tabWidth:c,useTabs:!1})}catch(_){Se.error("Error formatting SQL",{error:_});return}let p=s.transformIn(f)[0],y=e.state.facet(Pt),w=e.state.facet(rc);y.updateCellCode({cellId:w,code:p,formattingChange:!0}),Wu(e,f,{effects:[Ms.of(!0)]})}async function Jk(e){let{bigquery:n,db2:i,db2i:o,duckdb:s,hive:c,mariadb:d,mysql:f,tidb:p,n1ql:y,plsql:w,postgresql:_,redshift:C,spark:E,sqlite:T,sql:I,trino:$,transactsql:V,singlestoredb:F,snowflake:N}=await ce(async()=>{let{bigquery:pe,db2:P,db2i:A,duckdb:W,hive:de,mariadb:fe,mysql:we,tidb:J,n1ql:be,plsql:Ce,postgresql:Z,redshift:re,spark:se,sqlite:Q,sql:Le,trino:Fe,transactsql:et,singlestoredb:Be,snowflake:je}=await import("./esm-BHwEmOw7.js").then(async Pe=>(await Pe.__tla,Pe));return{bigquery:pe,db2:P,db2i:A,duckdb:W,hive:de,mariadb:fe,mysql:we,tidb:J,n1ql:be,plsql:Ce,postgresql:Z,redshift:re,spark:se,sqlite:Q,sql:Le,trino:Fe,transactsql:et,singlestoredb:Be,snowflake:je}},__vite__mapDeps([0,1]),import.meta.url),K=I;if(!e||!ic(e))return K;switch(e){case"mysql":return f;case"mariadb":return d;case"postgres":case"postgresql":return _;case"sqlite":return T;case"db2":return i;case"db2i":return o;case"hive":return c;case"redshift":return C;case"snowflake":return N;case"trino":return $;case"tidb":return p;case"oracle":case"oracledb":return w;case"spark":return E;case"singlestoredb":return F;case"couchbase":return y;case"bigquery":return n;case"duckdb":return s;case"mssql":case"sqlserver":case"microsoft sql server":return V;case"athena":case"awsathena":case"cassandra":case"noql":case"flink":case"mongodb":case"timescaledb":case"datafusion":return I;case"databricks":return E;default:return _s(e),K}}var Xk=nd();function Yk(e,n){let i=document.createElement("div"),o;return{dom:i,mount(){o=(0,Xk.createRoot)(i),o.render((0,B.jsx)(X2,{store:lt,children:(0,B.jsx)(n,{view:e})}))},update(){o==null||o.render((0,B.jsx)(X2,{store:lt,children:(0,B.jsx)(n,{view:e})}))},destroy(){o==null||o.unmount()}}}function ye(e){return new gw(hw.define(e))}function Zi(e){return ce(()=>import("./dist-Z4EybR_c.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 Zk=[le.of({name:"C",extensions:["c","h","ino"],load(){return ce(()=>import("./dist-BhtRbLYO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),le.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return ce(()=>import("./dist-BhtRbLYO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),le.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Zi("Cassandra")}}),le.of({name:"CSS",extensions:["css"],load(){return ce(()=>import("./dist-B407S7D_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([8,9,5]),import.meta.url).then(e=>e.css())}}),le.of({name:"Go",extensions:["go"],load(){return ce(()=>import("./dist-CIhvkX-u.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([10,11,4,5]),import.meta.url).then(e=>e.go())}}),le.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return ce(()=>import("./dist-BSxIk2Vq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([12,9,5,13,14,4]),import.meta.url).then(e=>e.html())}}),le.of({name:"Java",extensions:["java"],load(){return ce(()=>import("./dist-CyLRJKkZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([15,16,5]),import.meta.url).then(e=>e.java())}}),le.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return ce(()=>import("./dist-SpkGM8op.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript())}}),le.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return ce(()=>import("./dist-Dnr44J-w.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([18,9,5,13,14,4,19]),import.meta.url).then(e=>e.jinja())}}),le.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return ce(()=>import("./dist-B_YgElQP.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([20,21,5]),import.meta.url).then(e=>e.json())}}),le.of({name:"JSX",extensions:["jsx"],load(){return ce(()=>import("./dist-SpkGM8op.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({jsx:!0}))}}),le.of({name:"LESS",extensions:["less"],load(){return ce(()=>import("./dist-BYEzs7zM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([22,9,5,23]),import.meta.url).then(e=>e.less())}}),le.of({name:"Liquid",extensions:["liquid"],load(){return ce(()=>import("./dist-0C6YCYyu.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([24,9,5,13,14,4,25]),import.meta.url).then(e=>e.liquid())}}),le.of({name:"MariaDB SQL",load(){return Zi("MariaSQL")}}),le.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return ce(()=>import("./dist-DstaRs6N.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([26,9,5,13,14,4,27]),import.meta.url).then(e=>e.markdown())}}),le.of({name:"MS SQL",load(){return Zi("MSSQL")}}),le.of({name:"MySQL",load(){return Zi("MySQL")}}),le.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return ce(()=>import("./dist-Ad37Z4TC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([28,9,5,13,14,4,29]),import.meta.url).then(e=>e.php())}}),le.of({name:"PLSQL",extensions:["pls"],load(){return Zi("PLSQL")}}),le.of({name:"PostgreSQL",load(){return Zi("PostgreSQL")}}),le.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return ce(()=>import("./dist-Cip4Ndtd.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([30,31,4,5]),import.meta.url).then(e=>e.python())}}),le.of({name:"Rust",extensions:["rs"],load(){return ce(()=>import("./dist-DiFit-1W.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([32,33,5]),import.meta.url).then(e=>e.rust())}}),le.of({name:"Sass",extensions:["sass"],load(){return ce(()=>import("./dist-CYdfU9am.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass({indented:!0}))}}),le.of({name:"SCSS",extensions:["scss"],load(){return ce(()=>import("./dist-CYdfU9am.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass())}}),le.of({name:"SQL",extensions:["sql"],load(){return Zi("StandardSQL")}}),le.of({name:"SQLite",load(){return Zi("SQLite")}}),le.of({name:"TSX",extensions:["tsx"],load(){return ce(()=>import("./dist-SpkGM8op.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}))}}),le.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return ce(()=>import("./dist-SpkGM8op.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({typescript:!0}))}}),le.of({name:"WebAssembly",extensions:["wat","wast"],load(){return ce(()=>import("./dist-w6kOVH_r.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([36,37,5]),import.meta.url).then(e=>e.wast())}}),le.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return ce(()=>import("./dist-Chrniyxe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([38,39,5]),import.meta.url).then(e=>e.xml())}}),le.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return ce(()=>import("./dist-fX0SBNCK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([40,41,5]),import.meta.url).then(e=>e.yaml())}}),le.of({name:"APL",extensions:["dyalog","apl"],load(){return ce(()=>import("./apl-Dkj9Qe7k.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([42,43]),import.meta.url).then(e=>ye(e.apl))}}),le.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return ce(()=>import("./asciiarmor-BtQZNUPe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([44,45]),import.meta.url).then(e=>ye(e.asciiArmor))}}),le.of({name:"ASN.1",extensions:["asn","asn1"],load(){return ce(()=>import("./asn1-Df2Lrqg5.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([46,47]),import.meta.url).then(e=>ye(e.asn1({})))}}),le.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return ce(()=>import("./asterisk-DQege133.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.asterisk))}}),le.of({name:"Brainfuck",extensions:["b","bf"],load(){return ce(()=>import("./brainfuck-BKWhJvy5.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([48,49]),import.meta.url).then(e=>ye(e.brainfuck))}}),le.of({name:"Cobol",extensions:["cob","cpy"],load(){return ce(()=>import("./cobol-D0Y9QJHH.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>ye(e.cobol))}}),le.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return ce(()=>import("./clike-Db5sDcCN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.csharp))}}),le.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return ce(()=>import("./clojure-CktH9n5q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>ye(e.clojure))}}),le.of({name:"ClojureScript",extensions:["cljs"],load(){return ce(()=>import("./clojure-CktH9n5q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>ye(e.clojure))}}),le.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return ce(()=>import("./css-DPSOOi60.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([56,57]),import.meta.url).then(e=>ye(e.gss))}}),le.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return ce(()=>import("./cmake-BwTN0lwz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([58,59]),import.meta.url).then(e=>ye(e.cmake))}}),le.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return ce(()=>import("./coffeescript-CL84ZPXU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([60,61]),import.meta.url).then(e=>ye(e.coffeeScript))}}),le.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return ce(()=>import("./commonlisp-CukhuKqj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([62,63]),import.meta.url).then(e=>ye(e.commonLisp))}}),le.of({name:"Cypher",extensions:["cyp","cypher"],load(){return ce(()=>import("./cypher-DTLWn8Gw.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([64,65]),import.meta.url).then(e=>ye(e.cypher))}}),le.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return ce(()=>import("./python-BAh1L3Ue.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([66,67]),import.meta.url).then(e=>ye(e.cython))}}),le.of({name:"Crystal",extensions:["cr"],load(){return ce(()=>import("./crystal-DjLRzuWS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([68,69]),import.meta.url).then(e=>ye(e.crystal))}}),le.of({name:"D",extensions:["d"],load(){return ce(()=>import("./d-DWjY1SxT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([70,71]),import.meta.url).then(e=>ye(e.d))}}),le.of({name:"Dart",extensions:["dart"],load(){return ce(()=>import("./clike-Db5sDcCN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.dart))}}),le.of({name:"diff",extensions:["diff","patch"],load(){return ce(()=>import("./diff-CBkFqCNH.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([72,73]),import.meta.url).then(e=>ye(e.diff))}}),le.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return ce(()=>import("./dockerfile-pmRcusjN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([74,75]),import.meta.url).then(e=>ye(e.dockerFile))}}),le.of({name:"DTD",extensions:["dtd"],load(){return ce(()=>import("./dtd-BuqGL9hz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([76,77]),import.meta.url).then(e=>ye(e.dtd))}}),le.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return ce(()=>import("./dylan-WTW5QtBM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([78,79]),import.meta.url).then(e=>ye(e.dylan))}}),le.of({name:"EBNF",load(){return ce(()=>import("./ebnf-BAIwm2E9.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.ebnf))}}),le.of({name:"ECL",extensions:["ecl"],load(){return ce(()=>import("./ecl-DBVSQs77.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([80,81]),import.meta.url).then(e=>ye(e.ecl))}}),le.of({name:"edn",extensions:["edn"],load(){return ce(()=>import("./clojure-CktH9n5q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>ye(e.clojure))}}),le.of({name:"Eiffel",extensions:["e"],load(){return ce(()=>import("./eiffel-C3Tl80Mr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([82,83]),import.meta.url).then(e=>ye(e.eiffel))}}),le.of({name:"Elm",extensions:["elm"],load(){return ce(()=>import("./elm-BzK6589w.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([84,85]),import.meta.url).then(e=>ye(e.elm))}}),le.of({name:"Erlang",extensions:["erl"],load(){return ce(()=>import("./erlang-DMCyf1S1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([86,87]),import.meta.url).then(e=>ye(e.erlang))}}),le.of({name:"Esper",load(){return ce(()=>import("./sql-Ba7Mq1qs.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.esper))}}),le.of({name:"Factor",extensions:["factor"],load(){return ce(()=>import("./factor-Y7W4xwTs.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([88,89,75]),import.meta.url).then(e=>ye(e.factor))}}),le.of({name:"FCL",load(){return ce(()=>import("./fcl-BRXWXeJY.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.fcl))}}),le.of({name:"Forth",extensions:["forth","fth","4th"],load(){return ce(()=>import("./forth-a7Ame17q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([90,91]),import.meta.url).then(e=>ye(e.forth))}}),le.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return ce(()=>import("./fortran-D8W1t7ql.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>ye(e.fortran))}}),le.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return ce(()=>import("./mllike-Dy0V9wt1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>ye(e.fSharp))}}),le.of({name:"Gas",extensions:["s"],load(){return ce(()=>import("./gas-CPCP4r6U.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([96,97]),import.meta.url).then(e=>ye(e.gas))}}),le.of({name:"Gherkin",extensions:["feature"],load(){return ce(()=>import("./gherkin-dyINaGjD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([98,99]),import.meta.url).then(e=>ye(e.gherkin))}}),le.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return ce(()=>import("./groovy-yBYyWQAY.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([100,101]),import.meta.url).then(e=>ye(e.groovy))}}),le.of({name:"Haskell",extensions:["hs"],load(){return ce(()=>import("./haskell-DOSr8Xuo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([102,103]),import.meta.url).then(e=>ye(e.haskell))}}),le.of({name:"Haxe",extensions:["hx"],load(){return ce(()=>import("./haxe-JqSUWIxe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>ye(e.haxe))}}),le.of({name:"HXML",extensions:["hxml"],load(){return ce(()=>import("./haxe-JqSUWIxe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>ye(e.hxml))}}),le.of({name:"HTTP",load(){return ce(()=>import("./http-DxX5IMY1.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.http))}}),le.of({name:"IDL",extensions:["pro"],load(){return ce(()=>import("./idl-D2Ag6F2o.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([106,107]),import.meta.url).then(e=>ye(e.idl))}}),le.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return ce(()=>import("./javascript-3AO8kHoR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([108,109]),import.meta.url).then(e=>ye(e.jsonld))}}),le.of({name:"Julia",extensions:["jl"],load(){return ce(()=>import("./julia-DB4UbzHR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([110,111]),import.meta.url).then(e=>ye(e.julia))}}),le.of({name:"Kotlin",extensions:["kt","kts"],load(){return ce(()=>import("./clike-Db5sDcCN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.kotlin))}}),le.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return ce(()=>import("./livescript-DReeORQ9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([112,113]),import.meta.url).then(e=>ye(e.liveScript))}}),le.of({name:"Lua",extensions:["lua"],load(){return ce(()=>import("./lua-ybhkw42a.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([114,115]),import.meta.url).then(e=>ye(e.lua))}}),le.of({name:"mIRC",extensions:["mrc"],load(){return ce(()=>import("./mirc-BeRjyZ00.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([116,117]),import.meta.url).then(e=>ye(e.mirc))}}),le.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return ce(()=>import("./mathematica-DknPFJHQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([118,119]),import.meta.url).then(e=>ye(e.mathematica))}}),le.of({name:"Modelica",extensions:["mo"],load(){return ce(()=>import("./modelica--iMtH0NO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([120,121]),import.meta.url).then(e=>ye(e.modelica))}}),le.of({name:"MUMPS",extensions:["mps"],load(){return ce(()=>import("./mumps-DXhR5sNO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([122,123]),import.meta.url).then(e=>ye(e.mumps))}}),le.of({name:"Mbox",extensions:["mbox"],load(){return ce(()=>import("./mbox-CvGrdGLO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([124,125]),import.meta.url).then(e=>ye(e.mbox))}}),le.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return ce(()=>import("./nginx-C7sPMZD3.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.nginx))}}),le.of({name:"NSIS",extensions:["nsh","nsi"],load(){return ce(()=>import("./nsis-FfqfUShs.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([126,127,75]),import.meta.url).then(e=>ye(e.nsis))}}),le.of({name:"NTriples",extensions:["nt","nq"],load(){return ce(()=>import("./ntriples-C3Y5YwlO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([128,129]),import.meta.url).then(e=>ye(e.ntriples))}}),le.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return ce(()=>import("./clike-Db5sDcCN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.objectiveC))}}),le.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return ce(()=>import("./clike-Db5sDcCN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.objectiveCpp))}}),le.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return ce(()=>import("./mllike-Dy0V9wt1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>ye(e.oCaml))}}),le.of({name:"Octave",extensions:["m"],load(){return ce(()=>import("./octave-Dn-U4f-O.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([130,131]),import.meta.url).then(e=>ye(e.octave))}}),le.of({name:"Oz",extensions:["oz"],load(){return ce(()=>import("./oz-Dx3Usekg.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([132,133]),import.meta.url).then(e=>ye(e.oz))}}),le.of({name:"Pascal",extensions:["p","pas"],load(){return ce(()=>import("./pascal-Bhoas9O4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([134,135]),import.meta.url).then(e=>ye(e.pascal))}}),le.of({name:"Perl",extensions:["pl","pm"],load(){return ce(()=>import("./perl-uQVtdMdg.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([136,137]),import.meta.url).then(e=>ye(e.perl))}}),le.of({name:"Pig",extensions:["pig"],load(){return ce(()=>import("./pig-DDagqkh7.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([138,139]),import.meta.url).then(e=>ye(e.pig))}}),le.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return ce(()=>import("./powershell-WeyQqZtK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([140,141]),import.meta.url).then(e=>ye(e.powerShell))}}),le.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return ce(()=>import("./properties-MEyUmkzm.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([142,143]),import.meta.url).then(e=>ye(e.properties))}}),le.of({name:"ProtoBuf",extensions:["proto"],load(){return ce(()=>import("./protobuf-DrUQLGvH.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([144,145]),import.meta.url).then(e=>ye(e.protobuf))}}),le.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return ce(()=>import("./pug-YYu0lKKy.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([146,147,109]),import.meta.url).then(e=>ye(e.pug))}}),le.of({name:"Puppet",extensions:["pp"],load(){return ce(()=>import("./puppet-C9UhEtzi.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([148,149]),import.meta.url).then(e=>ye(e.puppet))}}),le.of({name:"Q",extensions:["q"],load(){return ce(()=>import("./q-CoA1I94V.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([150,151]),import.meta.url).then(e=>ye(e.q))}}),le.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return ce(()=>import("./r-CnPeMCLv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([152,153]),import.meta.url).then(e=>ye(e.r))}}),le.of({name:"RPM Changes",load(){return ce(()=>import("./rpm-DOBsrwns.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>ye(e.rpmChanges))}}),le.of({name:"RPM Spec",extensions:["spec"],load(){return ce(()=>import("./rpm-DOBsrwns.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>ye(e.rpmSpec))}}),le.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return ce(()=>import("./ruby-DphmqCS4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([156,157]),import.meta.url).then(e=>ye(e.ruby))}}),le.of({name:"SAS",extensions:["sas"],load(){return ce(()=>import("./sas-DqX-D0mu.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([158,159]),import.meta.url).then(e=>ye(e.sas))}}),le.of({name:"Scala",extensions:["scala"],load(){return ce(()=>import("./clike-Db5sDcCN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.scala))}}),le.of({name:"Scheme",extensions:["scm","ss"],load(){return ce(()=>import("./scheme-BDPqQOec.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([160,161]),import.meta.url).then(e=>ye(e.scheme))}}),le.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return ce(()=>import("./shell-BbHQ-2DS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([162,163]),import.meta.url).then(e=>ye(e.shell))}}),le.of({name:"Sieve",extensions:["siv","sieve"],load(){return ce(()=>import("./sieve-AQvCITfE.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([164,165]),import.meta.url).then(e=>ye(e.sieve))}}),le.of({name:"Smalltalk",extensions:["st"],load(){return ce(()=>import("./smalltalk-C_EFh1kg.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([166,167]),import.meta.url).then(e=>ye(e.smalltalk))}}),le.of({name:"Solr",load(){return ce(()=>import("./solr-B2csZ4mu.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.solr))}}),le.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return ce(()=>import("./mllike-Dy0V9wt1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>ye(e.sml))}}),le.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return ce(()=>import("./sparql-BlXg3dFR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([168,169]),import.meta.url).then(e=>ye(e.sparql))}}),le.of({name:"Spreadsheet",alias:["excel","formula"],load(){return ce(()=>import("./spreadsheet-C9drr7Wf.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.spreadsheet))}}),le.of({name:"Squirrel",extensions:["nut"],load(){return ce(()=>import("./clike-Db5sDcCN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.squirrel))}}),le.of({name:"Stylus",extensions:["styl"],load(){return ce(()=>import("./stylus-Dvm1D-Up.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([170,171]),import.meta.url).then(e=>ye(e.stylus))}}),le.of({name:"Swift",extensions:["swift"],load(){return ce(()=>import("./swift-BYNffoE5.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([172,173]),import.meta.url).then(e=>ye(e.swift))}}),le.of({name:"sTeX",load(){return ce(()=>import("./stex-D6sqtveI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>ye(e.stex))}}),le.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return ce(()=>import("./stex-D6sqtveI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>ye(e.stex))}}),le.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return ce(()=>import("./verilog-CtASbUB4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>ye(e.verilog))}}),le.of({name:"Tcl",extensions:["tcl"],load(){return ce(()=>import("./tcl-BXf8cJq0.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([178,179]),import.meta.url).then(e=>ye(e.tcl))}}),le.of({name:"Textile",extensions:["textile"],load(){return ce(()=>import("./textile-BYQcpBSz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([180,181]),import.meta.url).then(e=>ye(e.textile))}}),le.of({name:"TiddlyWiki",load(){return ce(()=>import("./tiddlywiki-CEYqr2EK.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.tiddlyWiki))}}),le.of({name:"Tiki wiki",load(){return ce(()=>import("./tiki-Drx00sPe.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.tiki))}}),le.of({name:"TOML",extensions:["toml"],load(){return ce(()=>import("./toml-DRBRsKy_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([182,183]),import.meta.url).then(e=>ye(e.toml))}}),le.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return ce(()=>import("./troff-DrvwLjLq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([184,185]),import.meta.url).then(e=>ye(e.troff))}}),le.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return ce(()=>import("./ttcn-DP5EbkJT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([186,187]),import.meta.url).then(e=>ye(e.ttcn))}}),le.of({name:"TTCN_CFG",extensions:["cfg"],load(){return ce(()=>import("./ttcn-cfg-BRAAKR13.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([188,189]),import.meta.url).then(e=>ye(e.ttcnCfg))}}),le.of({name:"Turtle",extensions:["ttl"],load(){return ce(()=>import("./turtle-Dfy5N6iI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([190,191]),import.meta.url).then(e=>ye(e.turtle))}}),le.of({name:"Web IDL",extensions:["webidl"],load(){return ce(()=>import("./webidl-CHQTLbOi.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([192,193]),import.meta.url).then(e=>ye(e.webIDL))}}),le.of({name:"VB.NET",extensions:["vb"],load(){return ce(()=>import("./vb-DzPnQ7Kn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([194,195]),import.meta.url).then(e=>ye(e.vb))}}),le.of({name:"VBScript",extensions:["vbs"],load(){return ce(()=>import("./vbscript-Dsr7xm0B.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([196,197]),import.meta.url).then(e=>ye(e.vbScript))}}),le.of({name:"Velocity",extensions:["vtl"],load(){return ce(()=>import("./velocity-BP08r0ZT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([198,199]),import.meta.url).then(e=>ye(e.velocity))}}),le.of({name:"Verilog",extensions:["v"],load(){return ce(()=>import("./verilog-CtASbUB4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>ye(e.verilog))}}),le.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return ce(()=>import("./vhdl-BNXpaYPc.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([200,201]),import.meta.url).then(e=>ye(e.vhdl))}}),le.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return ce(()=>import("./xquery-BysgHIf7.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([202,203]),import.meta.url).then(e=>ye(e.xQuery))}}),le.of({name:"Yacas",extensions:["ys"],load(){return ce(()=>import("./yacas-jKltHvRl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([204,205]),import.meta.url).then(e=>ye(e.yacas))}}),le.of({name:"Z80",extensions:["z80"],load(){return ce(()=>import("./z80-DVuK3CCU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([206,207]),import.meta.url).then(e=>ye(e.z80))}}),le.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return ce(()=>import("./mscgen-CqR_OhJF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>ye(e.mscgen))}}),le.of({name:"X\xF9",extensions:["xu"],load(){return ce(()=>import("./mscgen-CqR_OhJF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>ye(e.xu))}}),le.of({name:"MsGenny",extensions:["msgenny"],load(){return ce(()=>import("./mscgen-CqR_OhJF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>ye(e.msgenny))}}),le.of({name:"Vue",extensions:["vue"],load(){return ce(()=>import("./dist-rTuWF9u4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([210,9,5,13,14,4,211]),import.meta.url).then(e=>e.vue())}}),le.of({name:"Angular Template",load(){return ce(()=>import("./dist-DeazQ1Kh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([212,9,5,13,14,4]),import.meta.url).then(e=>e.angular())}})],Wg=new WeakMap,eS=/(\n|\r\n?|\u2028|\u2029)/g,tS=/^\s*/,nS=/\S/,rS=Array.prototype.slice,Wd=48,Ug=57,Kg=97,iS=102,Qg=65,aS=70;Gl=function(e){if(typeof e=="string")return Xg([e])[0];if(typeof e=="function")return function(){let o=rS.call(arguments);return o[0]=Jg(o[0]),e.apply(this,o)};let n=Jg(e),i=Gg(n,0);for(let o=1;o<n.length;o++)i+=arguments[o]+Gg(n,o);return i};function Gg(e,n){let i=e[n];if(i===void 0)throw TypeError(`invalid cooked string at index ${n}`);return i}function Jg(e){let n=Wg.get(e);if(n)return n;let i=Xg(e.raw),o=i.map(sS);return Object.defineProperty(o,"raw",{value:Object.freeze(i)}),Object.freeze(o),Wg.set(e,o),o}function Xg(e){let n=e.map(s=>s.split(eS)),i;for(let s=0;s<n.length;s++){let c=n[s],d=s===0,f=s+1===n.length;if(d){if(c.length===1||c[0].length>0)throw Error("invalid content on opening line");c[1]=""}if(f){if(c.length===1||nS.test(c[c.length-1]))throw Error("invalid content on closing line");c[c.length-2]="",c[c.length-1]=""}for(let p=2;p<c.length;p+=2){let y=c[p],w=p+1===c.length&&!f,_=tS.exec(y)[0];if(!w&&_.length===y.length){c[p]="";continue}i=oS(_,i)}}let o=i?i.length:0;return n.map(s=>{let c=s[0];for(let d=1;d<s.length;d+=2){let f=s[d],p=s[d+1];c+=f+p.slice(o)}return c})}function oS(e,n){if(n===void 0||e===n)return e;let i=0;for(let o=Math.min(e.length,n.length);i<o&&e[i]===n[i];i++);return e.slice(0,i)}function sS(e){let n="",i=0,o=0;for(;(o=e.indexOf("\\",o))>-1;){if(n+=e.slice(i,o),++o===e.length)return;let s=e[o++];switch(s){case"b":n+="\b";break;case"t":n+=" ";break;case"n":n+=`
65
65
  `;break;case"v":n+="\v";break;case"f":n+="\f";break;case"r":n+="\r";break;case"\r":o<e.length&&e[o]===`
66
66
  `&&++o;case`
67
- `:case"\u2028":case"\u2029":break;case"0":if(Yg(e,o))return;n+="\0";break;case"x":{let c=Ud(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 d=e.indexOf("}",++o);if(d===-1)return;c=Ud(e,o,d),o=d+1}else c=Ud(e,o,o+4),o+=4;if(c===-1||c>1114111)return;n+=String.fromCodePoint(c);break}default:if(Yg(s,0))return;n+=s}i=o}return n+e.slice(i)}function Yg(e,n){let i=e.charCodeAt(n);return i>=Wd&&i<=Ug}function Ud(e,n,i){if(i>=e.length)return-1;let o=0;for(;n<i;n++){let s=lS(e.charCodeAt(n));if(s===-1)return-1;o=o*16+s}return o}function lS(e){return e>=Wd&&e<=Ug?e-Wd:e>=Kg&&e<=iS?e-Kg+10:e>=Qg&&e<=aS?e-Qg+10:-1}const Zg=["","f","r","fr","rf"];function cS(e){try{return Jl(`
67
+ `:case"\u2028":case"\u2029":break;case"0":if(Yg(e,o))return;n+="\0";break;case"x":{let c=Ud(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 d=e.indexOf("}",++o);if(d===-1)return;c=Ud(e,o,d),o=d+1}else c=Ud(e,o,o+4),o+=4;if(c===-1||c>1114111)return;n+=String.fromCodePoint(c);break}default:if(Yg(s,0))return;n+=s}i=o}return n+e.slice(i)}function Yg(e,n){let i=e.charCodeAt(n);return i>=Wd&&i<=Ug}function Ud(e,n,i){if(i>=e.length)return-1;let o=0;for(;n<i;n++){let s=lS(e.charCodeAt(n));if(s===-1)return-1;o=o*16+s}return o}function lS(e){return e>=Wd&&e<=Ug?e-Wd:e>=Kg&&e<=iS?e-Kg+10:e>=Qg&&e<=aS?e-Qg+10:-1}const Zg=["","f","r","fr","rf"];function cS(e){try{return Gl(`
68
68
  ${e}
69
69
  `).trim()}catch{return e}}function uS(e){return MD.parse(e)}var dS=new Set(["(","[","{",",",")","]","}"]);function fS(e,n){return e.name==="ArgList"?{args:pS(e),kwargs:hS(e,n)}:(console.warn(`Not an ArgList, name: ${e.name}`),{args:[],kwargs:[]})}function pS(e){var o;e.firstChild();let n=[],i=e.name;do if(i=e.name,!dS.has(i)){if(i==="VariableName"&&((o=e.node.nextSibling)==null?void 0:o.name)==="AssignOp"){e.prev();break}n.push(e.node)}while(e.nextSibling());return n}function hS(e,n){let i=[],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 d=c.nextSibling;if(!d)continue;let f=n.slice(d.from,d.to).trim();i.push({key:s,value:f})}while(e.nextSibling());return i}function mS(e,n){if(e.name==="String"){let i=n.slice(e.from,e.to);return i.startsWith('r"""')||i.startsWith("r'''")?i.slice(4,-3):i.startsWith('"""')||i.startsWith("'''")?i.slice(3,-3):i.startsWith('r"')||i.startsWith("r'")?i.slice(2,-1):i.slice(1,-1)}if(e.name==="FormatString"){let i=n.slice(e.from,e.to);return i.startsWith('f"""')||i.startsWith("f'''")?i.slice(4,-3):i.startsWith('rf"""')||i.startsWith("rf'''")||i.startsWith('fr"""')||i.startsWith("fr'''")?i.slice(5,-3):i.startsWith('r"""')||i.startsWith("r'''")?i.slice(4,-3):i.startsWith('f"')||i.startsWith("f'")?i.slice(2,-1):i.startsWith('rf"')||i.startsWith("rf'")||i.startsWith('fr"')||i.startsWith("fr'")?i.slice(3,-1):(i.startsWith('r"')||i.startsWith("r'"),i.slice(2,-1))}return null}function gS(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 yS(e){let n=[...Zg].sort((i,o)=>o.length-i.length);for(let i of n)if(e.startsWith(i))return[i,e.slice(i.length)];return["",e]}function vS(e,n){return e.replaceAll(`\\${n}`,n)}var bS=[['"""','"""'],["'''","'''"],['"','"'],["'","'"]],wS=Zg.flatMap(e=>bS.map(([n,i])=>[e+n,i])).map(([e,n])=>[e,RegExp(`^mo\\.md\\(\\s*${ey(e)}(.*)${ey(n)}\\s*\\)$`,"s")]);function ey(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var ty=class{constructor(){ke(this,"type","markdown");ke(this,"defaultCode",`mo.md(r"""
70
70
  """)`);ke(this,"defaultMetadata",{quotePrefix:"r"})}static fromMarkdown(e){return`mo.md(r"""
71
71
  ${e}
72
- """)`}transformIn(e){e=e.trim();let n={...this.defaultMetadata};if(e==="")return{code:"",offset:0,metadata:n};for(let[i,o]of wS){let s=e.match(o);if(s){let c=s[1],[d,f]=yS(i);n.quotePrefix=d;let p=vS(c,f),y=e.indexOf(c);return{code:Jl(`
72
+ """)`}transformIn(e){e=e.trim();let n={...this.defaultMetadata};if(e==="")return{code:"",offset:0,metadata:n};for(let[i,o]of wS){let s=e.match(o);if(s){let c=s[1],[d,f]=yS(i);n.quotePrefix=d;let p=vS(c,f),y=e.indexOf(c);return{code:Gl(`
73
73
  ${p}
74
74
  `).trim(),offset:y,metadata:n}}}return{code:e,offset:0,metadata:n}}transformOut(e,n){e===""&&(e=" ");let{quotePrefix:i}=n,o=e.replaceAll('""',String.raw`"\"`),s=`mo.md(${i}"""
75
75
  `;return{code:s+o+`
76
- """)`,offset:s.length+1}}isSupported(e){if(e=e.trim(),e==="")return!0;if(!e.startsWith("mo.md("))return!1;if(e==="mo.md()")return!0;let n=Oh.parser.parse(e),i=[{match:"Script"},{match:"ExpressionStatement"},{match:"CallExpression"},{match:"MemberExpression"},{match:"VariableName"},{match:"."},{match:"PropertyName"},{match:"ArgList"},{match:"("},{match:/String|FormatString/,stop:!0},{match:")"}],o=!0;return n.iterate({enter:s=>{let c=i.shift();if(c===void 0)return o=!1,!1;let d=c.match;return typeof d=="string"?(o&&(o=d===s.name),o&&!c.stop):(d.test(s.name)||(o=!1),o&&!c.stop)}}),o}},_S=class{constructor(){ke(this,"type","python");ke(this,"defaultCode","");ke(this,"defaultMetadata",{})}transformIn(e){return{code:e,offset:0,metadata:{}}}transformOut(e,n){return{code:e,offset:0}}isSupported(e){return!0}},Kd="__marimo_duckdb",ny=class{constructor(){ke(this,"type","sql");ke(this,"defaultMetadata",{dataframeName:"_df",quotePrefix:"f",commentLines:[],showOutput:!0,engine:Kd})}get defaultCode(){return'_df = mo.sql(f"""SELECT * FROM """)'}static fromQuery(e){return`_df = mo.sql(f"""${e.trim()}""")`}transformIn(e){e=e.trim();let n={...this.defaultMetadata,commentLines:this.extractCommentLines(e)};if(!this.isSupported(e))return{code:e,offset:0,metadata:n};if(e==="")return{code:"",offset:0,metadata:n};let i=ry(e);return i?(n.dataframeName=i.dfName,n.showOutput=i.output??!0,n.engine=i.engine??Kd,{code:Jl(`
76
+ """)`,offset:s.length+1}}isSupported(e){if(e=e.trim(),e==="")return!0;if(!e.startsWith("mo.md("))return!1;if(e==="mo.md()")return!0;let n=Oh.parser.parse(e),i=[{match:"Script"},{match:"ExpressionStatement"},{match:"CallExpression"},{match:"MemberExpression"},{match:"VariableName"},{match:"."},{match:"PropertyName"},{match:"ArgList"},{match:"("},{match:/String|FormatString/,stop:!0},{match:")"}],o=!0;return n.iterate({enter:s=>{let c=i.shift();if(c===void 0)return o=!1,!1;let d=c.match;return typeof d=="string"?(o&&(o=d===s.name),o&&!c.stop):(d.test(s.name)||(o=!1),o&&!c.stop)}}),o}},_S=class{constructor(){ke(this,"type","python");ke(this,"defaultCode","");ke(this,"defaultMetadata",{})}transformIn(e){return{code:e,offset:0,metadata:{}}}transformOut(e,n){return{code:e,offset:0}}isSupported(e){return!0}},Kd="__marimo_duckdb",ny=class{constructor(){ke(this,"type","sql");ke(this,"defaultMetadata",{dataframeName:"_df",quotePrefix:"f",commentLines:[],showOutput:!0,engine:Kd})}get defaultCode(){return'_df = mo.sql(f"""SELECT * FROM """)'}static fromQuery(e){return`_df = mo.sql(f"""${e.trim()}""")`}transformIn(e){e=e.trim();let n={...this.defaultMetadata,commentLines:this.extractCommentLines(e)};if(!this.isSupported(e))return{code:e,offset:0,metadata:n};if(e==="")return{code:"",offset:0,metadata:n};let i=ry(e);return i?(n.dataframeName=i.dfName,n.showOutput=i.output??!0,n.engine=i.engine??Kd,{code:Gl(`
77
77
  ${i.sqlString}
78
78
  `).trim(),offset:i.startPosition,metadata:n}):{code:e,offset:0,metadata:n}}transformOut(e,n){let{quotePrefix:i,commentLines:o,showOutput:s,engine:c,dataframeName:d}=n,f=`${d} = mo.sql(
79
79
  ${i}"""
@@ -85,27 +85,27 @@ ${i.sqlString}
85
85
  `)+kS(p)+y,offset:f.length+1}}isSupported(e){return e.trim()===""?!0:!e.includes("mo.sql")||e.split("mo.sql").length>2?!1:ry(e)!==null}extractCommentLines(e){let n=e.split(`
86
86
  `),i=[];for(let o of n)if(o!=null&&o.startsWith("#"))i.push(o);else break;return i}};function xS(e){do{if(e.name==="AssignStatement")return e.node;if(e.name!=="Comment")return null}while(e.next());return null}function ry(e){try{let n=uS(e).cursor();n.name==="Script"&&n.next();let i=xS(n);if(!i||e.slice(i.to).trim().length>0)return null;let o=null,s=null,c,d,f=0,p=i.cursor();if(p.firstChild(),p.name==="VariableName"&&(o=e.slice(p.from,p.to)),!o)return null;let y=!1,w=null;for(;p.nextSibling();)if(p.name==="AssignOp")y=!0;else if(y&&!w){w=p.node;break}if(!w||w.name==="ConditionalExpression"||w.name==="BinaryExpression"||w.name==="UnaryExpression")return null;let _=w.cursor(),C=null;if(_.name==="CallExpression")C=_.node;else{_.firstChild();do if(_.name==="CallExpression"){C=_.node;break}while(_.nextSibling())}if(C){let E=C.cursor(),T=!1;if(E.firstChild(),E.name==="MemberExpression"&&(T=e.slice(E.from,E.to)==="mo.sql"),T){for(;E.next();)if(E.name==="ArgList"){let{args:I,kwargs:$}=fS(E.node.cursor(),e);I.length===1&&(s=mS(I[0],e),f=I[0].from+gS(e.slice(I[0].from,I[0].to)));for(let{key:V,value:F}of $)switch(V){case"engine":c=F;break;case"output":d=F==="True";break}if(s==="")return{dfName:o,sqlString:"",engine:c,output:d,startPosition:f};break}}}return!o||!s?null:{dfName:o,sqlString:cS(s),engine:c,output:d,startPosition:f}}catch(n){return console.warn("Failed to parse SQL statement",n),null}}function kS(e){return e.split(`
87
87
  `).map(n=>n!=null&&n.trim()?` ${n}`:n).join(`
88
- `)}function SS(e,n){return{get:()=>n.get(e),sub:i=>n.sub(e,()=>i(n.get(e)))}}function CS(e,{offset:n,body:i=window,behavior:o="smooth"}){let s=(n==null?void 0:n.top)??0,c=(n==null?void 0:n.bottom)??0,d=e.getBoundingClientRect();if(d.top<s){i.scrollBy({top:d.top-s,behavior:o});return}if(d.bottom>window.innerHeight-c){i.scrollBy({top:d.bottom-window.innerHeight+c,behavior:o});return}}Ku=function(e){return e?e.state.field(Lr).type:"python"};function ES(e,n){return!e||Ku(e)===n?!1:e.state.doc.toString().trim()===""?!0:gr[n].isSupported(Xr(e))}Ih=function(e,n,i={}){return!i.force&&!ES(e,n)?!1:(gm(e,{language:n}),n)};function TS(e){return Ra.of([{key:e.getHotkey("cell.format").key,preventDefault:!0,run:n=>(Fu({[n.state.facet(Ui)]:n}),!0)},{key:e.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:n=>{let i=Ku(n);if(i!=="markdown"&&i!=="python")return!1;let o=Ih(n,i==="python"?"markdown":"python",{force:!0});return o==="markdown"&&n.state.facet(Pt).afterToggleMarkdown(),o!==!1}}])}fx=function(){return Kt.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(n=>n.effects.some(i=>i.is(Ls))))return;iy(e.view,{behavior:"smooth"})}})};function iy(e,n){let i=e.dom.getElementsByClassName("cm-activeLine cm-line");if(i.length===1){let o=i[0],s=document.getElementById("App");In(s,"App not found"),CS(o,{offset:{top:30,bottom:150},body:s,behavior:n.behavior})}}function RS(){return{}}let DS,OS,ay;({reducer:DS,createActions:OS,valueAtom:Ma,useActions:ay}=Ll(RS,{setVariables:(e,n)=>{let i={...e},o={};for(let s of n)o[s.name]={...i[s.name],...s};return o},addVariables:(e,n)=>{let i={...e};for(let o of n)i[o.name]={...i[o.name],...o};return i},setMetadata:(e,n)=>{let i={...e};for(let{name:o,value:s,dataType:c}of n)i[o]&&(i[o]={...i[o],value:s,dataType:c});return i}})),lx=()=>Zn(Ma),hx=function(){return ay()},T_=function(e){let n=e.storage||Ts;return{getItem(i,o){try{let s=n.getItem(i);if(!s)return o;let c=JSON.parse(s);return e.fromSerializable(c)}catch(s){return Ee.warn(`Error getting ${i} from storage`,s),o}},setItem:(i,o)=>{n.setItem(i,JSON.stringify(e.toSerializable(o)))},removeItem:i=>{n.removeItem(i)}}},Wl=Gm(()=>Ts);function PS(e,n){if(typeof window>"u")return;let i=`__marimo__${n}`;window[i]&&Ee.warn(`Overwriting existing debug object ${i}`),window[i]=e}var MS={markdown:!0,wasm_layouts:!1,rtc_v2:!1,performant_table_charts:!1,chat_modes:!1,cache_panel:!1,external_agents:!1,server_side_pdf_export:!0};Ql=function(e){var n,i;return((i=(n=iw())==null?void 0:n.experimental)==null?void 0:i[e])??MS[e]};function LS(e,n){Vi().saveUserConfig({config:{experimental:{[e]:n}}})}B_=({feature:e,children:n})=>Ql(e)?n:null,PS(LS,"setFeatureFlag"),Ul=[{type:"files",Icon:Pg,label:"Files",tooltip:"View files",defaultSection:"sidebar"},{type:"variables",Icon:Qh,label:"Variables",tooltip:"Explore variables and data sources",defaultSection:"sidebar"},{type:"packages",Icon:dm,label:"Packages",tooltip:"Manage packages",defaultSection:"sidebar"},{type:"ai",Icon:Yh,label:"AI",tooltip:"Chat & Agents",defaultSection:"sidebar"},{type:"outline",Icon:Wh,label:"Outline",tooltip:"View outline",defaultSection:"sidebar"},{type:"documentation",Icon:Jh,label:"Docs",tooltip:"View live docs",defaultSection:"sidebar"},{type:"dependencies",Icon:Nh,label:"Dependencies",tooltip:"Explore dependencies",defaultSection:"sidebar"},{type:"errors",Icon:Vh,label:"Errors",tooltip:"View errors",defaultSection:"developer-panel"},{type:"scratchpad",Icon:Am,label:"Scratchpad",tooltip:"Scratchpad",defaultSection:"developer-panel"},{type:"tracing",Icon:ym,label:"Tracing",tooltip:"View tracing",defaultSection:"developer-panel"},{type:"secrets",Icon:Mg,label:"Secrets",tooltip:"Manage secrets",defaultSection:"developer-panel",hidden:wh()},{type:"logs",Icon:rm,label:"Logs",tooltip:"View logs",defaultSection:"developer-panel"},{type:"terminal",Icon:Fh,label:"Terminal",tooltip:"Terminal",hidden:wh(),defaultSection:"developer-panel",requiredCapability:"terminal"},{type:"snippets",Icon:Lg,label:"Snippets",tooltip:"Snippets",defaultSection:"developer-panel"},{type:"cache",Icon:DD,label:"Cache",tooltip:"View cache",defaultSection:"developer-panel",hidden:!Ql("cache_panel")}],C_=new Map(Ul.map(e=>[e.type,e])),Q_=function(e,n){return!!(e.hidden||e.requiredCapability&&!n[e.requiredCapability])};var NS=Jr();mm=$l("marimo:panel-layout",{sidebar:Ul.filter(e=>!e.hidden&&e.defaultSection==="sidebar").map(e=>e.type),developerPanel:Ul.filter(e=>!e.hidden&&e.defaultSection==="developer-panel").map(e=>e.type)},Wl,{getOnInit:!0});function oy(e){let n=lt.get(mm);return n.sidebar.includes(e)?"sidebar":n.developerPanel.includes(e)?"developer-panel":null}var sy="marimo:sidebar",ly=new Bu(Z2({selectedPanel:ew().optional().transform(e=>e),isSidebarOpen:tw(),isDeveloperPanelOpen:tw().optional().default(!1),selectedDeveloperPanelTab:ew().optional().default("errors").transform(e=>e)}),IS);function IS(){return{selectedPanel:"variables",isSidebarOpen:!1,isDeveloperPanelOpen:!1,selectedDeveloperPanelTab:"errors"}}let AS,qS,cy;({reducer:AS,createActions:qS,valueAtom:ud,useActions:cy}=Ll(()=>ly.get(sy),{openApplication:(e,n)=>{let i=oy(n);return i==="sidebar"?{...e,selectedPanel:n,isSidebarOpen:!0}:i==="developer-panel"?{...e,selectedDeveloperPanelTab:n,isDeveloperPanelOpen:!0}:e},toggleApplication:(e,n)=>{let i=oy(n);return i==="sidebar"?{...e,selectedPanel:n,isSidebarOpen:e.isSidebarOpen?e.selectedPanel!==n:!0}:i==="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)=>ly.set(sy,n)])),ax=()=>{let e=(0,NS.c)(2),n=Zn(ud);if(n.isSidebarOpen)return n;let i;return e[0]===n?i=e[1]:(i={...n,selectedPanel:void 0},e[0]=n,e[1]=i),i},j_=function(){return cy()},Cm=ze({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1});function lc(e){var n;return((n=lt.get(Cm))==null?void 0:n[e])??!1}Xu=ze({documentation:null});var uy=new Set(["FunctionDefinition","LambdaExpression","ArrayComprehensionExpression","SetComprehension","DictionaryComprehensionExpression","ComprehensionExpression","ClassDefinition"]);function jS(e){let n=cw(e.state);if(!n||BS(n))return[];let i=new Set(Object.keys(e.variables).filter(E=>{let T=e.variables[E];return T.dataType!=="module"&&!T.declaredBy.includes("setup")&&!T.declaredBy.includes(e.cellId)}));if(i.size===0)return[];let o=[],s=new Map,c=new Map,d=new Map;function f(E,T){var K,pe,P,A,W,de,fe,we,J,be,Se;let I=E.cursor(),$=I.name,V=I.from,F=uy.has($),N=T;switch(F&&(N=[...T,V],s.set(V,new Set),c.set(V,$)),$){case"FunctionDefinition":{let Z=E.cursor();Z.firstChild();do if(Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=T[T.length-1]??-1;s.has(Q)||s.set(Q,new Set),(K=s.get(Q))==null||K.add(se);break}while(Z.nextSibling());let re=E.cursor();re.firstChild();do if(re.name==="ParamList"){let se=re.node.cursor();se.firstChild();do if(se.name==="VariableName"){let Q=e.state.doc.sliceString(se.from,se.to);(pe=s.get(V))==null||pe.add(Q)}while(se.nextSibling())}while(re.nextSibling());break}case"LambdaExpression":{let Z=E.cursor();Z.firstChild();do if(Z.name==="ParamList"){let re=Z.node.cursor();re.firstChild();do if(re.name==="VariableName"){let se=e.state.doc.sliceString(re.from,re.to);(P=s.get(V))==null||P.add(se)}while(re.nextSibling())}while(Z.nextSibling());break}case"ArrayComprehensionExpression":case"DictionaryComprehensionExpression":case"SetComprehension":case"ComprehensionExpression":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="for")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to);(A=s.get(V))==null||A.add(se)}else if(re&&Z.name==="TupleExpression"){let se=Z.node.cursor();se.firstChild();do if(se.name==="VariableName"){let Q=e.state.doc.sliceString(se.from,se.to);(W=s.get(V))==null||W.add(Q)}while(se.nextSibling())}else re&&Z.name==="in"&&(re=!1);while(Z.nextSibling());break}case"ClassDefinition":{let Z=E.cursor();Z.firstChild();do if(Z.name==="VariableName"){let re=e.state.doc.sliceString(Z.from,Z.to),se=T[T.length-1]??-1;s.has(se)||s.set(se,new Set),(de=s.get(se))==null||de.add(re);break}while(Z.nextSibling());d.set(V,[]);break}case"AssignStatement":{let Z=E.cursor(),re=[];Z.firstChild();do Z.name==="AssignOp"&&re.push(Z.from);while(Z.nextSibling());let se=re[re.length-1],Q=E.cursor();Q.firstChild();let Le=N[N.length-1]??-1;do Q.from<se&&Qd(Q,{currentScope:Le,state:e.state,allDeclarations:s,scopeTypes:c,classLevelDeclarations:d,assignmentPosition:I.to});while(Q.nextSibling());break}case"ForStatement":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="for")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=N[N.length-1]??-1;s.has(Q)||s.set(Q,new Set),(fe=s.get(Q))==null||fe.add(se)}else re&&Z.name==="in"&&(re=!1);while(Z.nextSibling());break}case"ImportStatement":{let Z=E.cursor();Z.firstChild();do if(Z.name==="VariableName"){let re=e.state.doc.sliceString(Z.from,Z.to),se=N[N.length-1]??-1;s.has(se)||s.set(se,new Set),(we=s.get(se))==null||we.add(re)}while(Z.nextSibling());break}case"ImportFromStatement":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="import")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=N[N.length-1]??-1;s.has(Q)||s.set(Q,new Set),(J=s.get(Q))==null||J.add(se)}while(Z.nextSibling());break}case"TryStatement":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="as")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=N[N.length-1]??-1;s.has(Q)||s.set(Q,new Set),(be=s.get(Q))==null||be.add(se),re=!1}while(Z.nextSibling());break}case"WithStatement":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="as")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=N[N.length-1]??-1;s.has(Q)||s.set(Q,new Set),(Se=s.get(Q))==null||Se.add(se),re=!1}while(Z.nextSibling());break}}C(I,Z=>{f(Z,N)})}function p(E,T,I){let $=d.get(T);return $?$.some(([V,F])=>V===E&&F<I):!1}function y(E,T,I){var $,V;for(let F of T)if(c.get(F)==="ClassDefinition"){if(p(E,F,I))return!0}else if(($=s.get(F))!=null&&$.has(E))return!0;return((V=s.get(-1))==null?void 0:V.has(E))??!1}function w(E,T){let I=E.cursor(),$=I.name,V=I.from,F=uy.has($),N=T;if(F&&(N=[...T,V]),$==="VariableName"){let K=e.state.doc.sliceString(I.from,I.to);_(K,I)&&(y(K,N,I.from)||o.push({from:I.from,to:I.to,variableName:K}))}C(I,K=>{w(K,N)})}function _(E,T){return i.has(E)&&!zS(T)&&!FS(T)}function C(E,T){if(E.firstChild())do T(E.node);while(E.nextSibling())}return f(n,[]),w(n,[]),o}function zS(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 FS(e){let n=e.node.cursor();if(n.parent()&&n.name==="AssignStatement"){let i=n.node.cursor();i.firstChild();let o=-1;do if(i.name==="AssignOp"){o=i.from;break}while(i.nextSibling());return o!==-1&&e.from<o}return!1}function BS(e){let n=e.cursor();do if(n.name==="\u26A0"||n.type.isError)return!0;while(n.next());return!1}function Qd(e,n){var i;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),(i=n.allDeclarations.get(n.currentScope))==null||i.add(o);break}case"TupleExpression":{let o=e.node.cursor();o.firstChild();do Qd(o,n);while(o.nextSibling());break}case"ArrayExpression":{let o=e.node.cursor();o.firstChild();do Qd(o,n);while(o.nextSibling());break}}}var HS=Hi.mark({class:"mo-cm-reactive-reference"});V_=Hi.mark({class:"mo-cm-reactive-reference-hover"});var dy=Bi.define(),VS=class{constructor(e,n){ke(this,"highlightDebounceMs",300);this.view=e,this.cellId=n,this.scheduleHighlighting=nw(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=lt.sub(Ma,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=jS({state:this.view.state,cellId:this.cellId,variables:lt.get(Ma)});e.length>0&&Ee.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:dy.of(e)})})}};id=xs.define({create(){return{decorations:Hi.none,ranges:[]}},update(e,n){let i={decorations:e.decorations.map(n.changes),ranges:e.ranges};for(let o of n.effects)o.is(dy)&&(i={decorations:Hi.set(o.value.map(s=>HS.range(s.from,s.to))),ranges:o.value});return i},provide:e=>Kt.decorations.from(e,n=>n.decorations)});function $S(e){return[id,Pl.define(n=>new VS(n,e))]}Y_=function(e,n){return n?$S(e):[]};function fy(e,n=!1){if(!e)return null;let i=document.createElement("span");if(i.classList.add("mo-cm-tooltip"),i.classList.add("docs-documentation"),n&&i.classList.add("cm-tooltip-section"),i.style.display="flex",i.style.flexDirection="column",i.style.gap=".8rem",i.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=b4()?"\u2318":"Ctrl",o.append(document.createTextNode("Jump to defining cell ")),o.append(s),o.append(document.createTextNode(" + Click")),i.append(o)}return i}fd=new Au("autocomplete-result",async(e,n)=>{let{sendCodeCompletionRequest:i}=Vi();await i({id:e,...n})});var WS={param:3,property:2};const Gd={asCompletionResult(e,n){return{from:e-n.prefix_length,options:n.options.map(i=>({label:i.name,type:i.type,boost:WS[i.type]??1,info:()=>fy(i.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:n,limitToType:i,excludeTypes:o,exactName:s,showGoToDefinitionHint:c=!1}){let d=US(n.options,s);if(!d)return;let f=e-n.prefix_length,p=fy(d.completion_info,c);if(p&&!(i&&d.type!==i)&&!(o!=null&&o.includes(d.type)))return{pos:f,html:d.completion_info,end:f+d.name.length,above:!0,create:()=>({dom:p,resize:!1})}}};function US(e,n){if(e.length!==0){if(e.length===1)return e[0];if(n)return e.find(i=>i.name===n)}}k_=function(e){var n;return[(n=e==null?void 0:e.pylsp)!=null&&n.enabled&&lc("pylsp")?[]:xh(async(i,o)=>{let s=await py({view:i,pos:o,excludeTypes:["tooltip"]});return s===null||s==="cancelled"?null:s},{hideOnChange:!0}),GS]};async function py({view:e,pos:n,excludeTypes:i}){var w;let o=er.findElement(e.dom);if(!o)return Ee.error("Failed to find active cell."),null;let s=er.parse(o.id),{startToken:c,endToken:d}=Jd(e.state.doc,n),f=((w=e.state.field(id,!1))==null?void 0:w.ranges.some(_=>n>=_.from&&n<=_.to))??!1,p=await fd.request({document:e.state.doc.slice(0,d).toString(),cellId:s});if(!p)return"cancelled";let y=e.state.doc.slice(c,d).toString();return Gd.asHoverTooltip({position:d,message:p,exactName:y,excludeTypes:i,showGoToDefinitionHint:f})??null}function Jd(e,n){let i=n,o=i>0?e.sliceString(i-1,i):"",s=i<e.length?e.sliceString(i,i+1):"";o==="("&&s===")"&&--i;let c=i,d=i;for(;c>0;){let f=e.sliceString(c-1,c);if(!/\w/.test(f))break;c--}for(;d<e.length;){let f=e.sliceString(d,d+1);if(!/\w/.test(f))break;d++}return{startToken:c,endToken:d}}function KS(e){let{head:n}=e.selection.main,i=e.doc.sliceString(n-1,n);return/\w/.test(i)}var QS=nw(async(e,n)=>{if(lt.get(ud).selectedPanel!=="documentation")return;let i=await py({view:e,pos:n});i!=="cancelled"&&lt.set(Xu,{documentation:(i==null?void 0:i.html)??null})},300),GS=Kt.updateListener.of(e=>{if(e.selectionSet&&KS(e.state)){let n=e.state.selection.main.head;QS(e.view,n)}});function hy(e,n){e.focus(),requestAnimationFrame(()=>{e.dispatch({selection:{anchor:n,head:n},effects:Kt.scrollIntoView(n,{y:"center"})})})}ju=function(e,n){let{state:i}=e,o=cw(i),s=!1,c=0;return o.iterate({enter:d=>{if(s)return!1;if(d.name==="VariableName"&&i.doc.sliceString(d.from,d.to)===n)return c=d.from,s=!0,!1;if(d.name==="Comment"||d.name==="String")return!1}}),s?(hy(e,c),!0):!1};function JS(e,n){return hy(e,e.state.doc.line(n).from),!0}function XS(e){let{from:n,to:i}=e.selection.main;if(n===i){let{startToken:o,endToken:s}=Jd(e.doc,n);return e.doc.sliceString(o,s)}return e.doc.sliceString(n,i)}function YS(e,n){if(!n)return null;let i=e[n];return!i||i.declaredBy.length===0?null:i.declaredBy[0]}function ZS(e){return e.startsWith("_")}Zh=function(e){let{state:n}=e,i=XS(n);return i?(kw(e),e.dispatch({effects:F4}),fm(e,i)):!1},fm=function(e,n){let i=eC(e,n);return i?ju(i,n):!1},d_=function(e,n){let i=my(e);return i?JS(i,n):!1};function eC(e,n){if(ZS(n))return e;let i=YS(lt.get(Ma),n);return i?my(i):null}function my(e){var n;return((n=lt.get(bt).cellHandles[e].current)==null?void 0:n.editorView)??null}function tC(e){var n=e.Pos;function i(u,m,v){if(m.line===v.line&&m.ch>=v.ch-1){var b=u.getLine(m.line).charCodeAt(m.ch);55296<=b&&b<=55551&&(v.ch+=1)}return{start:m,end:v}}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,d=[{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"}],f=vn("");function p(u){u.setOption("disableInput",!0),u.setOption("showCursorWhenSelecting",!1),e.signal(u,"vim-mode-change",{mode:"normal"}),u.on("cursorActivity",$o),se(u),e.on(u.getInputField(),"paste",w(u))}function y(u){u.setOption("disableInput",!1),u.off("cursorActivity",$o),e.off(u.getInputField(),"paste",w(u)),u.state.vim=null,sa&&clearTimeout(sa)}function w(u){var m=u.state.vim;return m.onPasteFn||(m.onPasteFn=function(){m.insertMode||(u.setCursor(_t(u.getCursor(),0,1)),fn.enterInsertMode(u,{},m))}),m.onPasteFn}var _=/[\d]/,C=[e.isWordChar,function(u){return u&&!e.isWordChar(u)&&!/\s/.test(u)}],E=[function(u){return/\S/.test(u)}],T=["<",">"],I=["-",'"',".",":","_","/","+"],$=/^\w$/,V=/^[A-Z]$/;try{V=RegExp("^[\\p{Lu}]$","u")}catch{}function F(u,m){return m>=u.firstLine()&&m<=u.lastLine()}function N(u){return/^[a-z]$/.test(u)}function K(u){return"()[]{}".indexOf(u)!=-1}function pe(u){return _.test(u)}function P(u){return V.test(u)}function A(u){return/^\s*$/.test(u)}function W(u){return".?!".indexOf(u)!=-1}function de(u,m){for(var v=0;v<m.length;v++)if(m[v]==u)return!0;return!1}var fe={};function we(u,m,v,b,x){if(m===void 0&&!x)throw Error("defaultValue is required unless callback is provided");if(v||(v="string"),fe[u]={type:v,defaultValue:m,callback:x},b)for(var k=0;k<b.length;k++)fe[b[k]]=fe[u];m&&J(u,m)}function J(u,m,v,b){var x=fe[u];b||(b={});var k=b.scope;if(!x)return Error("Unknown option: "+u);if(x.type=="boolean"){if(m&&m!==!0)return Error("Invalid argument: "+u+"="+m);m!==!1&&(m=!0)}x.callback?(k!=="local"&&x.callback(m,void 0),k!=="global"&&v&&x.callback(m,v)):(k!=="local"&&(x.value=x.type=="boolean"?!!m:m),k!=="global"&&v&&(v.state.vim.options[u]={value:m}))}function be(u,m,v){var b=fe[u];v||(v={});var x=v.scope;if(!b)return Error("Unknown option: "+u);if(b.callback){let k=m&&b.callback(void 0,m);return x!=="global"&&k!==void 0?k:x==="local"?void 0:b.callback()}else return(x!=="global"&&m&&m.state.vim.options[u]||x!=="local"&&b||{}).value}we("filetype",void 0,"string",["ft"],function(u,m){if(m!==void 0)if(u===void 0){let v=m.getOption("mode");return v=="null"?"":v}else{let v=u==""?"null":u;m.setOption("mode",v)}}),we("textwidth",80,"number",["tw"],function(u,m){if(m!==void 0){if(u===void 0)return m.getOption("textwidth");var v=Math.round(u);v>1&&m.setOption("textwidth",v)}});var Se=function(){var u=100,m=-1,v=0,b=0,x=Array(u);function k(L,z,q){var oe=x[m%u];function ie(Y){var xe=++m%u,_e=x[xe];_e&&_e.clear(),x[xe]=L.setBookmark(Y)}if(oe){var X=oe.find();X&&!gt(X,z)&&ie(z)}else ie(z);ie(q),v=m,b=m-u+1,b<0&&(b=0)}function R(L,z){m+=z,m>v?m=v:m<b&&(m=b);var q=x[(u+m)%u];if(q&&!q.find()){var oe=z>0?1:-1,ie,X=L.getCursor();do if(m+=oe,q=x[(u+m)%u],q&&(ie=q.find())&&!gt(X,ie))break;while(m<v&&m>b)}return q}function O(L,z){var q=m,oe=R(L,z);return m=q,oe&&oe.find()}return{cachedCursor:void 0,add:k,find:O,move:R}},Z=function(u){return u?{changes:u.changes,expectCursorActivityForChange:u.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class re{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=Z()}exitMacroRecordMode(){var m=Q.macroModeState;m.onRecordingDone&&m.onRecordingDone(),m.onRecordingDone=void 0,m.isRecording=!1}enterMacroRecordMode(m,v){var b=Q.registerController.getRegister(v);if(b){if(b.clear(),this.latestRegister=v,m.openDialog){var x=Nn("span",{class:"cm-vim-message"},"recording @"+v);this.onRecordingDone=m.openDialog(x,function(){},{bottom:!0})}this.isRecording=!0}}}function se(u){return u.state.vim||(u.state.vim={inputState:new vr,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 Q;function Le(){for(var u in Q={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:Se(),macroModeState:new re,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new On({}),searchHistoryController:new br,exCommandHistoryController:new br},fe){var m=fe[u];m.value=m.defaultValue}}class Fe{constructor(m,v){this.keyName=m,this.key=v.key,this.ctrlKey=v.ctrlKey,this.altKey=v.altKey,this.metaKey=v.metaKey,this.shiftKey=v.shiftKey}}var et,Be={enterVimMode:p,leaveVimMode:y,buildKeyMap:function(){},getRegisterController:function(){return Q.registerController},resetVimGlobalState_:Le,getVimGlobalState_:function(){return Q},maybeInitVimState_:se,suppressErrorLogging:!1,InsertModeKey:Fe,map:function(u,m,v){_n.map(u,m,v)},unmap:function(u,m){return _n.unmap(u,m)},noremap:function(u,m,v){_n.map(u,m,v,!0)},mapclear:function(u){var m=o.length,v=c,b=o.slice(0,m-v);if(o=o.slice(m-v),u)for(var x=b.length-1;x>=0;x--){var k=b[x];if(u!==k.context)if(k.context)this._mapCommand(k);else{var R=["normal","insert","visual"];for(var O in R)if(R[O]!==u){var L=Object.assign({},k);L.context=R[O],this._mapCommand(L)}}}},langmap:wt,vimKeyFromEvent:tn,setOption:J,getOption:be,defineOption:we,defineEx:function(u,m,v){if(!m)m=u;else if(u.indexOf(m)!==0)throw Error('(Vim.defineEx) "'+m+'" is not a prefix of "'+u+'", command not registered');xr[u]=v,_n.commandMap_[m]={name:u,shortName:m,type:"api"}},handleKey:function(u,m,v){var b=this.findKey(u,m,v);if(typeof b=="function")return b()},multiSelectHandleKey:Si,findKey:function(u,m,v){var b=se(u),x=u;function k(){var q=Q.macroModeState;if(q.isRecording){if(m=="q")return q.exitMacroRecordMode(),pt(x),!0;v!="mapping"&&$r(q,m)}}function R(){if(m=="<Esc>"){if(b.visualMode)Ye(x);else if(b.insertMode)Hn(x);else return;return pt(x),!0}}function O(){if(R())return!0;b.inputState.keyBuffer.push(m);var q=b.inputState.keyBuffer.join(""),oe=m.length==1,ie=Pn.matchCommand(q,o,b.inputState,"insert"),X=b.inputState.changeQueue;if(ie.type=="none")return pt(x),!1;if(ie.type=="partial"){if(ie.expectLiteralNext&&(b.expectLiteralNext=!0),et&&window.clearTimeout(et),et=oe&&window.setTimeout(function(){b.insertMode&&b.inputState.keyBuffer.length&&pt(x)},be("insertModeEscKeysTimeout")),oe){var Y=x.listSelections();(!X||X.removed.length!=Y.length)&&(X=b.inputState.changeQueue=new Fr),X.inserted+=m;for(var xe=0;xe<Y.length;xe++){var _e=kt(Y[xe].anchor,Y[xe].head),qe=jn(Y[xe].anchor,Y[xe].head),Re=x.getRange(_e,x.state.overwrite?_t(qe,0,1):qe);X.removed[xe]=(X.removed[xe]||"")+Re}}return!oe}else ie.type=="full"&&(b.inputState.keyBuffer.length=0);if(b.expectLiteralNext=!1,et&&window.clearTimeout(et),ie.command&&X){for(var Y=x.listSelections(),xe=0;xe<Y.length;xe++){var Ne=Y[xe].head;x.replaceRange(X.removed[xe]||"",_t(Ne,0,-X.inserted.length),Ne,"+input")}Q.macroModeState.lastInsertModeChanges.changes.pop()}return ie.command||pt(x),ie.command}function L(){if(k()||R())return!0;b.inputState.keyBuffer.push(m);var q=b.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(q))return!0;var oe=/^(\d*)(.*)$/.exec(q);if(!oe)return pt(x),!1;var ie=b.visualMode?"visual":"normal",X=oe[2]||oe[1];b.inputState.operatorShortcut&&b.inputState.operatorShortcut.slice(-1)==X&&(X=b.inputState.operatorShortcut);var Y=Pn.matchCommand(X,o,b.inputState,ie);return Y.type=="none"?(pt(x),!1):Y.type=="partial"?(Y.expectLiteralNext&&(b.expectLiteralNext=!0),!0):Y.type=="clear"?(pt(x),!0):(b.expectLiteralNext=!1,b.inputState.keyBuffer.length=0,oe=/^(\d*)(.*)$/.exec(q),oe&&oe[1]&&oe[1]!="0"&&b.inputState.pushRepeatDigit(oe[1]),Y.command)}var z=b.insertMode?O():L();if(z===!1)return!b.insertMode&&(m.length===1||e.isMac&&/<A-.>/.test(m))?function(){return!0}:void 0;if(z===!0)return function(){return!0};if(z)return function(){return x.operation(function(){x.curOp.isVimOp=!0;try{if(typeof z!="object")return;z.type=="keyToKey"?mt(x,z.toKeys,z):Pn.processCommand(x,b,z)}catch(q){throw x.state.vim=void 0,se(x),Be.suppressErrorLogging||console.log(q),q}return!0})}},handleEx:function(u,m){_n.processCommand(u,m)},defineMotion:ta,defineAction:ni,defineOperator:yi,mapCommand:Sc,_mapCommand:oi,defineRegister:mi,exitVisualMode:Ye,exitInsertMode:Hn},je=[],Pe=!1,Ae;function ft(u){if(!Ae)throw Error("No prompt to send key to");if(u[0]=="<"){var m=u.toLowerCase().slice(1,-1);if(m=m.split("-").pop()||"",m=="lt")u="<";else if(m=="space")u=" ";else if(m=="cr")u=`
88
+ `)}function SS(e,n){return{get:()=>n.get(e),sub:i=>n.sub(e,()=>i(n.get(e)))}}function CS(e,{offset:n,body:i=window,behavior:o="smooth"}){let s=(n==null?void 0:n.top)??0,c=(n==null?void 0:n.bottom)??0,d=e.getBoundingClientRect();if(d.top<s){i.scrollBy({top:d.top-s,behavior:o});return}if(d.bottom>window.innerHeight-c){i.scrollBy({top:d.bottom-window.innerHeight+c,behavior:o});return}}Ku=function(e){return e?e.state.field(Lr).type:"python"};function ES(e,n){return!e||Ku(e)===n?!1:e.state.doc.toString().trim()===""?!0:gr[n].isSupported(Xr(e))}Ih=function(e,n,i={}){return!i.force&&!ES(e,n)?!1:(gm(e,{language:n}),n)};function TS(e){return Ra.of([{key:e.getHotkey("cell.format").key,preventDefault:!0,run:n=>(Fu({[n.state.facet(Ui)]:n}),!0)},{key:e.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:n=>{let i=Ku(n);if(i!=="markdown"&&i!=="python")return!1;let o=Ih(n,i==="python"?"markdown":"python",{force:!0});return o==="markdown"&&n.state.facet(Pt).afterToggleMarkdown(),o!==!1}}])}fx=function(){return Kt.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(n=>n.effects.some(i=>i.is(Ms))))return;iy(e.view,{behavior:"smooth"})}})};function iy(e,n){let i=e.dom.getElementsByClassName("cm-activeLine cm-line");if(i.length===1){let o=i[0],s=document.getElementById("App");In(s,"App not found"),CS(o,{offset:{top:30,bottom:150},body:s,behavior:n.behavior})}}function RS(){return{}}let DS,OS,ay;({reducer:DS,createActions:OS,valueAtom:Ma,useActions:ay}=Ml(RS,{setVariables:(e,n)=>{let i={...e},o={};for(let s of n)o[s.name]={...i[s.name],...s};return o},addVariables:(e,n)=>{let i={...e};for(let o of n)i[o.name]={...i[o.name],...o};return i},setMetadata:(e,n)=>{let i={...e};for(let{name:o,value:s,dataType:c}of n)i[o]&&(i[o]={...i[o],value:s,dataType:c});return i}})),lx=()=>Zn(Ma),hx=function(){return ay()},T_=function(e){let n=e.storage||Ts;return{getItem(i,o){try{let s=n.getItem(i);if(!s)return o;let c=JSON.parse(s);return e.fromSerializable(c)}catch(s){return Se.warn(`Error getting ${i} from storage`,s),o}},setItem:(i,o)=>{n.setItem(i,JSON.stringify(e.toSerializable(o)))},removeItem:i=>{n.removeItem(i)}}},$l=Gm(()=>Ts);function PS(e,n){if(typeof window>"u")return;let i=`__marimo__${n}`;window[i]&&Se.warn(`Overwriting existing debug object ${i}`),window[i]=e}var MS={markdown:!0,wasm_layouts:!1,rtc_v2:!1,performant_table_charts:!1,chat_modes:!1,cache_panel:!1,external_agents:!1,server_side_pdf_export:!0};Kl=function(e){var n,i;return((i=(n=iw())==null?void 0:n.experimental)==null?void 0:i[e])??MS[e]};function LS(e,n){Vi().saveUserConfig({config:{experimental:{[e]:n}}})}B_=({feature:e,children:n})=>Kl(e)?n:null,PS(LS,"setFeatureFlag"),Wl=[{type:"files",Icon:Pg,label:"Files",tooltip:"View files",defaultSection:"sidebar"},{type:"variables",Icon:Qh,label:"Variables",tooltip:"Explore variables and data sources",defaultSection:"sidebar"},{type:"packages",Icon:dm,label:"Packages",tooltip:"Manage packages",defaultSection:"sidebar"},{type:"ai",Icon:Yh,label:"AI",tooltip:"Chat & Agents",defaultSection:"sidebar"},{type:"outline",Icon:Wh,label:"Outline",tooltip:"View outline",defaultSection:"sidebar"},{type:"documentation",Icon:Jh,label:"Docs",tooltip:"View live docs",defaultSection:"sidebar"},{type:"dependencies",Icon:Nh,label:"Dependencies",tooltip:"Explore dependencies",defaultSection:"sidebar"},{type:"errors",Icon:Vh,label:"Errors",tooltip:"View errors",defaultSection:"developer-panel"},{type:"scratchpad",Icon:Am,label:"Scratchpad",tooltip:"Scratchpad",defaultSection:"developer-panel"},{type:"tracing",Icon:ym,label:"Tracing",tooltip:"View tracing",defaultSection:"developer-panel"},{type:"secrets",Icon:Mg,label:"Secrets",tooltip:"Manage secrets",defaultSection:"developer-panel",hidden:wh()},{type:"logs",Icon:rm,label:"Logs",tooltip:"View logs",defaultSection:"developer-panel"},{type:"terminal",Icon:Fh,label:"Terminal",tooltip:"Terminal",hidden:wh(),defaultSection:"developer-panel",requiredCapability:"terminal"},{type:"snippets",Icon:Lg,label:"Snippets",tooltip:"Snippets",defaultSection:"developer-panel"},{type:"cache",Icon:DD,label:"Cache",tooltip:"View cache",defaultSection:"developer-panel",hidden:!Kl("cache_panel")}],C_=new Map(Wl.map(e=>[e.type,e])),Q_=function(e,n){return!!(e.hidden||e.requiredCapability&&!n[e.requiredCapability])};var NS=Jr();mm=Vl("marimo:panel-layout",{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)},$l,{getOnInit:!0});function oy(e){let n=lt.get(mm);return n.sidebar.includes(e)?"sidebar":n.developerPanel.includes(e)?"developer-panel":null}var sy="marimo:sidebar",ly=new Bu(Z2({selectedPanel:ew().optional().transform(e=>e),isSidebarOpen:tw(),isDeveloperPanelOpen:tw().optional().default(!1),selectedDeveloperPanelTab:ew().optional().default("errors").transform(e=>e)}),IS);function IS(){return{selectedPanel:"variables",isSidebarOpen:!1,isDeveloperPanelOpen:!1,selectedDeveloperPanelTab:"errors"}}let AS,qS,cy;({reducer:AS,createActions:qS,valueAtom:ud,useActions:cy}=Ml(()=>ly.get(sy),{openApplication:(e,n)=>{let i=oy(n);return i==="sidebar"?{...e,selectedPanel:n,isSidebarOpen:!0}:i==="developer-panel"?{...e,selectedDeveloperPanelTab:n,isDeveloperPanelOpen:!0}:e},toggleApplication:(e,n)=>{let i=oy(n);return i==="sidebar"?{...e,selectedPanel:n,isSidebarOpen:e.isSidebarOpen?e.selectedPanel!==n:!0}:i==="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)=>ly.set(sy,n)])),ax=()=>{let e=(0,NS.c)(2),n=Zn(ud);if(n.isSidebarOpen)return n;let i;return e[0]===n?i=e[1]:(i={...n,selectedPanel:void 0},e[0]=n,e[1]=i),i},j_=function(){return cy()},Cm=ze({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1});function lc(e){var n;return((n=lt.get(Cm))==null?void 0:n[e])??!1}Xu=ze({documentation:null});var uy=new Set(["FunctionDefinition","LambdaExpression","ArrayComprehensionExpression","SetComprehension","DictionaryComprehensionExpression","ComprehensionExpression","ClassDefinition"]);function jS(e){let n=cw(e.state);if(!n||BS(n))return[];let i=new Set(Object.keys(e.variables).filter(E=>{let T=e.variables[E];return T.dataType!=="module"&&!T.declaredBy.includes("setup")&&!T.declaredBy.includes(e.cellId)}));if(i.size===0)return[];let o=[],s=new Map,c=new Map,d=new Map;function f(E,T){var K,pe,P,A,W,de,fe,we,J,be,Ce;let I=E.cursor(),$=I.name,V=I.from,F=uy.has($),N=T;switch(F&&(N=[...T,V],s.set(V,new Set),c.set(V,$)),$){case"FunctionDefinition":{let Z=E.cursor();Z.firstChild();do if(Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=T[T.length-1]??-1;s.has(Q)||s.set(Q,new Set),(K=s.get(Q))==null||K.add(se);break}while(Z.nextSibling());let re=E.cursor();re.firstChild();do if(re.name==="ParamList"){let se=re.node.cursor();se.firstChild();do if(se.name==="VariableName"){let Q=e.state.doc.sliceString(se.from,se.to);(pe=s.get(V))==null||pe.add(Q)}while(se.nextSibling())}while(re.nextSibling());break}case"LambdaExpression":{let Z=E.cursor();Z.firstChild();do if(Z.name==="ParamList"){let re=Z.node.cursor();re.firstChild();do if(re.name==="VariableName"){let se=e.state.doc.sliceString(re.from,re.to);(P=s.get(V))==null||P.add(se)}while(re.nextSibling())}while(Z.nextSibling());break}case"ArrayComprehensionExpression":case"DictionaryComprehensionExpression":case"SetComprehension":case"ComprehensionExpression":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="for")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to);(A=s.get(V))==null||A.add(se)}else if(re&&Z.name==="TupleExpression"){let se=Z.node.cursor();se.firstChild();do if(se.name==="VariableName"){let Q=e.state.doc.sliceString(se.from,se.to);(W=s.get(V))==null||W.add(Q)}while(se.nextSibling())}else re&&Z.name==="in"&&(re=!1);while(Z.nextSibling());break}case"ClassDefinition":{let Z=E.cursor();Z.firstChild();do if(Z.name==="VariableName"){let re=e.state.doc.sliceString(Z.from,Z.to),se=T[T.length-1]??-1;s.has(se)||s.set(se,new Set),(de=s.get(se))==null||de.add(re);break}while(Z.nextSibling());d.set(V,[]);break}case"AssignStatement":{let Z=E.cursor(),re=[];Z.firstChild();do Z.name==="AssignOp"&&re.push(Z.from);while(Z.nextSibling());let se=re[re.length-1],Q=E.cursor();Q.firstChild();let Le=N[N.length-1]??-1;do Q.from<se&&Qd(Q,{currentScope:Le,state:e.state,allDeclarations:s,scopeTypes:c,classLevelDeclarations:d,assignmentPosition:I.to});while(Q.nextSibling());break}case"ForStatement":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="for")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=N[N.length-1]??-1;s.has(Q)||s.set(Q,new Set),(fe=s.get(Q))==null||fe.add(se)}else re&&Z.name==="in"&&(re=!1);while(Z.nextSibling());break}case"ImportStatement":{let Z=E.cursor();Z.firstChild();do if(Z.name==="VariableName"){let re=e.state.doc.sliceString(Z.from,Z.to),se=N[N.length-1]??-1;s.has(se)||s.set(se,new Set),(we=s.get(se))==null||we.add(re)}while(Z.nextSibling());break}case"ImportFromStatement":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="import")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=N[N.length-1]??-1;s.has(Q)||s.set(Q,new Set),(J=s.get(Q))==null||J.add(se)}while(Z.nextSibling());break}case"TryStatement":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="as")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=N[N.length-1]??-1;s.has(Q)||s.set(Q,new Set),(be=s.get(Q))==null||be.add(se),re=!1}while(Z.nextSibling());break}case"WithStatement":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="as")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=N[N.length-1]??-1;s.has(Q)||s.set(Q,new Set),(Ce=s.get(Q))==null||Ce.add(se),re=!1}while(Z.nextSibling());break}}C(I,Z=>{f(Z,N)})}function p(E,T,I){let $=d.get(T);return $?$.some(([V,F])=>V===E&&F<I):!1}function y(E,T,I){var $,V;for(let F of T)if(c.get(F)==="ClassDefinition"){if(p(E,F,I))return!0}else if(($=s.get(F))!=null&&$.has(E))return!0;return((V=s.get(-1))==null?void 0:V.has(E))??!1}function w(E,T){let I=E.cursor(),$=I.name,V=I.from,F=uy.has($),N=T;if(F&&(N=[...T,V]),$==="VariableName"){let K=e.state.doc.sliceString(I.from,I.to);_(K,I)&&(y(K,N,I.from)||o.push({from:I.from,to:I.to,variableName:K}))}C(I,K=>{w(K,N)})}function _(E,T){return i.has(E)&&!zS(T)&&!FS(T)}function C(E,T){if(E.firstChild())do T(E.node);while(E.nextSibling())}return f(n,[]),w(n,[]),o}function zS(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 FS(e){let n=e.node.cursor();if(n.parent()&&n.name==="AssignStatement"){let i=n.node.cursor();i.firstChild();let o=-1;do if(i.name==="AssignOp"){o=i.from;break}while(i.nextSibling());return o!==-1&&e.from<o}return!1}function BS(e){let n=e.cursor();do if(n.name==="\u26A0"||n.type.isError)return!0;while(n.next());return!1}function Qd(e,n){var i;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),(i=n.allDeclarations.get(n.currentScope))==null||i.add(o);break}case"TupleExpression":{let o=e.node.cursor();o.firstChild();do Qd(o,n);while(o.nextSibling());break}case"ArrayExpression":{let o=e.node.cursor();o.firstChild();do Qd(o,n);while(o.nextSibling());break}}}var HS=Hi.mark({class:"mo-cm-reactive-reference"});V_=Hi.mark({class:"mo-cm-reactive-reference-hover"});var dy=Bi.define(),VS=class{constructor(e,n){ke(this,"highlightDebounceMs",300);this.view=e,this.cellId=n,this.scheduleHighlighting=nw(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=lt.sub(Ma,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=jS({state:this.view.state,cellId:this.cellId,variables:lt.get(Ma)});e.length>0&&Se.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:dy.of(e)})})}};id=xs.define({create(){return{decorations:Hi.none,ranges:[]}},update(e,n){let i={decorations:e.decorations.map(n.changes),ranges:e.ranges};for(let o of n.effects)o.is(dy)&&(i={decorations:Hi.set(o.value.map(s=>HS.range(s.from,s.to))),ranges:o.value});return i},provide:e=>Kt.decorations.from(e,n=>n.decorations)});function $S(e){return[id,Ol.define(n=>new VS(n,e))]}Y_=function(e,n){return n?$S(e):[]};function fy(e,n=!1){if(!e)return null;let i=document.createElement("span");if(i.classList.add("mo-cm-tooltip"),i.classList.add("docs-documentation"),n&&i.classList.add("cm-tooltip-section"),i.style.display="flex",i.style.flexDirection="column",i.style.gap=".8rem",i.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=b4()?"\u2318":"Ctrl",o.append(document.createTextNode("Jump to defining cell ")),o.append(s),o.append(document.createTextNode(" + Click")),i.append(o)}return i}fd=new Au("autocomplete-result",async(e,n)=>{let{sendCodeCompletionRequest:i}=Vi();await i({id:e,...n})});var WS={param:3,property:2};const Gd={asCompletionResult(e,n){return{from:e-n.prefix_length,options:n.options.map(i=>({label:i.name,type:i.type,boost:WS[i.type]??1,info:()=>fy(i.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:n,limitToType:i,excludeTypes:o,exactName:s,showGoToDefinitionHint:c=!1}){let d=US(n.options,s);if(!d)return;let f=e-n.prefix_length,p=fy(d.completion_info,c);if(p&&!(i&&d.type!==i)&&!(o!=null&&o.includes(d.type)))return{pos:f,html:d.completion_info,end:f+d.name.length,above:!0,create:()=>({dom:p,resize:!1})}}};function US(e,n){if(e.length!==0){if(e.length===1)return e[0];if(n)return e.find(i=>i.name===n)}}k_=function(e){var n;return[(n=e==null?void 0:e.pylsp)!=null&&n.enabled&&lc("pylsp")?[]:xh(async(i,o)=>{let s=await py({view:i,pos:o,excludeTypes:["tooltip"]});return s===null||s==="cancelled"?null:s},{hideOnChange:!0}),GS]};async function py({view:e,pos:n,excludeTypes:i}){var w;let o=er.findElement(e.dom);if(!o)return Se.error("Failed to find active cell."),null;let s=er.parse(o.id),{startToken:c,endToken:d}=Jd(e.state.doc,n),f=((w=e.state.field(id,!1))==null?void 0:w.ranges.some(_=>n>=_.from&&n<=_.to))??!1,p=await fd.request({document:e.state.doc.slice(0,d).toString(),cellId:s});if(!p)return"cancelled";let y=e.state.doc.slice(c,d).toString();return Gd.asHoverTooltip({position:d,message:p,exactName:y,excludeTypes:i,showGoToDefinitionHint:f})??null}function Jd(e,n){let i=n,o=i>0?e.sliceString(i-1,i):"",s=i<e.length?e.sliceString(i,i+1):"";o==="("&&s===")"&&--i;let c=i,d=i;for(;c>0;){let f=e.sliceString(c-1,c);if(!/\w/.test(f))break;c--}for(;d<e.length;){let f=e.sliceString(d,d+1);if(!/\w/.test(f))break;d++}return{startToken:c,endToken:d}}function KS(e){let{head:n}=e.selection.main,i=e.doc.sliceString(n-1,n);return/\w/.test(i)}var QS=nw(async(e,n)=>{if(lt.get(ud).selectedPanel!=="documentation")return;let i=await py({view:e,pos:n});i!=="cancelled"&&lt.set(Xu,{documentation:(i==null?void 0:i.html)??null})},300),GS=Kt.updateListener.of(e=>{if(e.selectionSet&&KS(e.state)){let n=e.state.selection.main.head;QS(e.view,n)}});function hy(e,n){e.focus(),requestAnimationFrame(()=>{e.dispatch({selection:{anchor:n,head:n},effects:Kt.scrollIntoView(n,{y:"center"})})})}ju=function(e,n){let{state:i}=e,o=cw(i),s=!1,c=0;return o.iterate({enter:d=>{if(s)return!1;if(d.name==="VariableName"&&i.doc.sliceString(d.from,d.to)===n)return c=d.from,s=!0,!1;if(d.name==="Comment"||d.name==="String")return!1}}),s?(hy(e,c),!0):!1};function JS(e,n){return hy(e,e.state.doc.line(n).from),!0}function XS(e){let{from:n,to:i}=e.selection.main;if(n===i){let{startToken:o,endToken:s}=Jd(e.doc,n);return e.doc.sliceString(o,s)}return e.doc.sliceString(n,i)}function YS(e,n){if(!n)return null;let i=e[n];return!i||i.declaredBy.length===0?null:i.declaredBy[0]}function ZS(e){return e.startsWith("_")}Zh=function(e){let{state:n}=e,i=XS(n);return i?(kw(e),e.dispatch({effects:F4}),fm(e,i)):!1},fm=function(e,n){let i=eC(e,n);return i?ju(i,n):!1},d_=function(e,n){let i=my(e);return i?JS(i,n):!1};function eC(e,n){if(ZS(n))return e;let i=YS(lt.get(Ma),n);return i?my(i):null}function my(e){var n;return((n=lt.get(bt).cellHandles[e].current)==null?void 0:n.editorView)??null}function tC(e){var n=e.Pos;function i(u,m,v){if(m.line===v.line&&m.ch>=v.ch-1){var b=u.getLine(m.line).charCodeAt(m.ch);55296<=b&&b<=55551&&(v.ch+=1)}return{start:m,end:v}}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,d=[{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"}],f=vn("");function p(u){u.setOption("disableInput",!0),u.setOption("showCursorWhenSelecting",!1),e.signal(u,"vim-mode-change",{mode:"normal"}),u.on("cursorActivity",$o),se(u),e.on(u.getInputField(),"paste",w(u))}function y(u){u.setOption("disableInput",!1),u.off("cursorActivity",$o),e.off(u.getInputField(),"paste",w(u)),u.state.vim=null,sa&&clearTimeout(sa)}function w(u){var m=u.state.vim;return m.onPasteFn||(m.onPasteFn=function(){m.insertMode||(u.setCursor(_t(u.getCursor(),0,1)),fn.enterInsertMode(u,{},m))}),m.onPasteFn}var _=/[\d]/,C=[e.isWordChar,function(u){return u&&!e.isWordChar(u)&&!/\s/.test(u)}],E=[function(u){return/\S/.test(u)}],T=["<",">"],I=["-",'"',".",":","_","/","+"],$=/^\w$/,V=/^[A-Z]$/;try{V=RegExp("^[\\p{Lu}]$","u")}catch{}function F(u,m){return m>=u.firstLine()&&m<=u.lastLine()}function N(u){return/^[a-z]$/.test(u)}function K(u){return"()[]{}".indexOf(u)!=-1}function pe(u){return _.test(u)}function P(u){return V.test(u)}function A(u){return/^\s*$/.test(u)}function W(u){return".?!".indexOf(u)!=-1}function de(u,m){for(var v=0;v<m.length;v++)if(m[v]==u)return!0;return!1}var fe={};function we(u,m,v,b,x){if(m===void 0&&!x)throw Error("defaultValue is required unless callback is provided");if(v||(v="string"),fe[u]={type:v,defaultValue:m,callback:x},b)for(var k=0;k<b.length;k++)fe[b[k]]=fe[u];m&&J(u,m)}function J(u,m,v,b){var x=fe[u];b||(b={});var k=b.scope;if(!x)return Error("Unknown option: "+u);if(x.type=="boolean"){if(m&&m!==!0)return Error("Invalid argument: "+u+"="+m);m!==!1&&(m=!0)}x.callback?(k!=="local"&&x.callback(m,void 0),k!=="global"&&v&&x.callback(m,v)):(k!=="local"&&(x.value=x.type=="boolean"?!!m:m),k!=="global"&&v&&(v.state.vim.options[u]={value:m}))}function be(u,m,v){var b=fe[u];v||(v={});var x=v.scope;if(!b)return Error("Unknown option: "+u);if(b.callback){let k=m&&b.callback(void 0,m);return x!=="global"&&k!==void 0?k:x==="local"?void 0:b.callback()}else return(x!=="global"&&m&&m.state.vim.options[u]||x!=="local"&&b||{}).value}we("filetype",void 0,"string",["ft"],function(u,m){if(m!==void 0)if(u===void 0){let v=m.getOption("mode");return v=="null"?"":v}else{let v=u==""?"null":u;m.setOption("mode",v)}}),we("textwidth",80,"number",["tw"],function(u,m){if(m!==void 0){if(u===void 0)return m.getOption("textwidth");var v=Math.round(u);v>1&&m.setOption("textwidth",v)}});var Ce=function(){var u=100,m=-1,v=0,b=0,x=Array(u);function k(L,z,q){var oe=x[m%u];function ie(Y){var xe=++m%u,_e=x[xe];_e&&_e.clear(),x[xe]=L.setBookmark(Y)}if(oe){var X=oe.find();X&&!gt(X,z)&&ie(z)}else ie(z);ie(q),v=m,b=m-u+1,b<0&&(b=0)}function R(L,z){m+=z,m>v?m=v:m<b&&(m=b);var q=x[(u+m)%u];if(q&&!q.find()){var oe=z>0?1:-1,ie,X=L.getCursor();do if(m+=oe,q=x[(u+m)%u],q&&(ie=q.find())&&!gt(X,ie))break;while(m<v&&m>b)}return q}function O(L,z){var q=m,oe=R(L,z);return m=q,oe&&oe.find()}return{cachedCursor:void 0,add:k,find:O,move:R}},Z=function(u){return u?{changes:u.changes,expectCursorActivityForChange:u.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class re{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=Z()}exitMacroRecordMode(){var m=Q.macroModeState;m.onRecordingDone&&m.onRecordingDone(),m.onRecordingDone=void 0,m.isRecording=!1}enterMacroRecordMode(m,v){var b=Q.registerController.getRegister(v);if(b){if(b.clear(),this.latestRegister=v,m.openDialog){var x=Nn("span",{class:"cm-vim-message"},"recording @"+v);this.onRecordingDone=m.openDialog(x,function(){},{bottom:!0})}this.isRecording=!0}}}function se(u){return u.state.vim||(u.state.vim={inputState:new vr,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 Q;function Le(){for(var u in Q={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:Ce(),macroModeState:new re,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new On({}),searchHistoryController:new br,exCommandHistoryController:new br},fe){var m=fe[u];m.value=m.defaultValue}}class Fe{constructor(m,v){this.keyName=m,this.key=v.key,this.ctrlKey=v.ctrlKey,this.altKey=v.altKey,this.metaKey=v.metaKey,this.shiftKey=v.shiftKey}}var et,Be={enterVimMode:p,leaveVimMode:y,buildKeyMap:function(){},getRegisterController:function(){return Q.registerController},resetVimGlobalState_:Le,getVimGlobalState_:function(){return Q},maybeInitVimState_:se,suppressErrorLogging:!1,InsertModeKey:Fe,map:function(u,m,v){_n.map(u,m,v)},unmap:function(u,m){return _n.unmap(u,m)},noremap:function(u,m,v){_n.map(u,m,v,!0)},mapclear:function(u){var m=o.length,v=c,b=o.slice(0,m-v);if(o=o.slice(m-v),u)for(var x=b.length-1;x>=0;x--){var k=b[x];if(u!==k.context)if(k.context)this._mapCommand(k);else{var R=["normal","insert","visual"];for(var O in R)if(R[O]!==u){var L=Object.assign({},k);L.context=R[O],this._mapCommand(L)}}}},langmap:wt,vimKeyFromEvent:tn,setOption:J,getOption:be,defineOption:we,defineEx:function(u,m,v){if(!m)m=u;else if(u.indexOf(m)!==0)throw Error('(Vim.defineEx) "'+m+'" is not a prefix of "'+u+'", command not registered');xr[u]=v,_n.commandMap_[m]={name:u,shortName:m,type:"api"}},handleKey:function(u,m,v){var b=this.findKey(u,m,v);if(typeof b=="function")return b()},multiSelectHandleKey:Si,findKey:function(u,m,v){var b=se(u),x=u;function k(){var q=Q.macroModeState;if(q.isRecording){if(m=="q")return q.exitMacroRecordMode(),pt(x),!0;v!="mapping"&&$r(q,m)}}function R(){if(m=="<Esc>"){if(b.visualMode)Ye(x);else if(b.insertMode)Vn(x);else return;return pt(x),!0}}function O(){if(R())return!0;b.inputState.keyBuffer.push(m);var q=b.inputState.keyBuffer.join(""),oe=m.length==1,ie=Pn.matchCommand(q,o,b.inputState,"insert"),X=b.inputState.changeQueue;if(ie.type=="none")return pt(x),!1;if(ie.type=="partial"){if(ie.expectLiteralNext&&(b.expectLiteralNext=!0),et&&window.clearTimeout(et),et=oe&&window.setTimeout(function(){b.insertMode&&b.inputState.keyBuffer.length&&pt(x)},be("insertModeEscKeysTimeout")),oe){var Y=x.listSelections();(!X||X.removed.length!=Y.length)&&(X=b.inputState.changeQueue=new Fr),X.inserted+=m;for(var xe=0;xe<Y.length;xe++){var _e=kt(Y[xe].anchor,Y[xe].head),qe=zn(Y[xe].anchor,Y[xe].head),Re=x.getRange(_e,x.state.overwrite?_t(qe,0,1):qe);X.removed[xe]=(X.removed[xe]||"")+Re}}return!oe}else ie.type=="full"&&(b.inputState.keyBuffer.length=0);if(b.expectLiteralNext=!1,et&&window.clearTimeout(et),ie.command&&X){for(var Y=x.listSelections(),xe=0;xe<Y.length;xe++){var Ne=Y[xe].head;x.replaceRange(X.removed[xe]||"",_t(Ne,0,-X.inserted.length),Ne,"+input")}Q.macroModeState.lastInsertModeChanges.changes.pop()}return ie.command||pt(x),ie.command}function L(){if(k()||R())return!0;b.inputState.keyBuffer.push(m);var q=b.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(q))return!0;var oe=/^(\d*)(.*)$/.exec(q);if(!oe)return pt(x),!1;var ie=b.visualMode?"visual":"normal",X=oe[2]||oe[1];b.inputState.operatorShortcut&&b.inputState.operatorShortcut.slice(-1)==X&&(X=b.inputState.operatorShortcut);var Y=Pn.matchCommand(X,o,b.inputState,ie);return Y.type=="none"?(pt(x),!1):Y.type=="partial"?(Y.expectLiteralNext&&(b.expectLiteralNext=!0),!0):Y.type=="clear"?(pt(x),!0):(b.expectLiteralNext=!1,b.inputState.keyBuffer.length=0,oe=/^(\d*)(.*)$/.exec(q),oe&&oe[1]&&oe[1]!="0"&&b.inputState.pushRepeatDigit(oe[1]),Y.command)}var z=b.insertMode?O():L();if(z===!1)return!b.insertMode&&(m.length===1||e.isMac&&/<A-.>/.test(m))?function(){return!0}:void 0;if(z===!0)return function(){return!0};if(z)return function(){return x.operation(function(){x.curOp.isVimOp=!0;try{if(typeof z!="object")return;z.type=="keyToKey"?mt(x,z.toKeys,z):Pn.processCommand(x,b,z)}catch(q){throw x.state.vim=void 0,se(x),Be.suppressErrorLogging||console.log(q),q}return!0})}},handleEx:function(u,m){_n.processCommand(u,m)},defineMotion:ta,defineAction:ni,defineOperator:yi,mapCommand:Sc,_mapCommand:oi,defineRegister:mi,exitVisualMode:Ye,exitInsertMode:Vn},je=[],Pe=!1,Ae;function ft(u){if(!Ae)throw Error("No prompt to send key to");if(u[0]=="<"){var m=u.toLowerCase().slice(1,-1);if(m=m.split("-").pop()||"",m=="lt")u="<";else if(m=="space")u=" ";else if(m=="cr")u=`
89
89
  `;else if(We[m]){var v=Ae.value||"",b={key:We[m],target:{value:v,selectionEnd:v.length,selectionStart:v.length}};Ae.onKeyDown&&Ae.onKeyDown(b,Ae.value,k),Ae&&Ae.onKeyUp&&Ae.onKeyUp(b,Ae.value,k);return}}if(u==`
90
90
  `){var x=Ae;Ae=null,x.onClose&&x.onClose(x.value)}else Ae.value=(Ae.value||"")+u;function k(R){Ae&&(typeof R=="string"?Ae.value=R:Ae=null)}}function mt(u,m,v){var b=Pe;if(v){if(je.indexOf(v)!=-1)return;je.push(v),Pe=v.noremap!=0}try{for(var x=se(u),k=/<(?:[CSMA]-)*\w+>|./gi,R;R=k.exec(m);){var O=R[0],L=x.insertMode;if(Ae){ft(O);continue}if(!Be.handleKey(u,O,"mapping")&&L&&x.insertMode){if(O[0]=="<"){var z=O.toLowerCase().slice(1,-1);if(z=z.split("-").pop()||"",z=="lt")O="<";else if(z=="space")O=" ";else if(z=="cr")O=`
91
91
  `;else if(We.hasOwnProperty(z)){O=We[z],Ya(u,O);continue}else O=O[0],k.lastIndex=R.index+1}u.replaceSelection(O)}}}finally{if(je.pop(),Pe=je.length?b:!1,!je.length&&Ae){var q=Ae;Ae=null,aa(u,q)}}}var Dn={Return:"CR",Backspace:"BS",Delete:"Del",Escape:"Esc",Insert:"Ins",ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"CR"," ":"Space"},un={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},We={};"Left|Right|Up|Down|End|Home".split("|").concat(Object.keys(Dn)).forEach(function(u){We[(Dn[u]||"").toLowerCase()]=We[u.toLowerCase()]=u});function tn(u,m){var k;var v=u.key;if(!un[v]){v.length>1&&v[0]=="n"&&(v=v.replace("Numpad","")),v=Dn[v]||v;var b="";if(u.ctrlKey&&(b+="C-"),u.altKey&&(b+="A-"),u.metaKey&&(b+="M-"),e.isMac&&b=="A-"&&v.length==1&&(b=b.slice(2)),(b||v.length>1)&&u.shiftKey&&(b+="S-"),m&&!m.expectLiteralNext&&v.length==1){if(f.keymap&&v in f.keymap)(f.remapCtrl!=0||!b)&&(v=f.keymap[v]);else if(v.charCodeAt(0)>128&&!s[v]){var x=((k=u.code)==null?void 0:k.slice(-1))||"";u.shiftKey||(x=x.toLowerCase()),x&&(v=x,!b&&u.altKey&&(b="A-"))}}return b+=v,b.length>1&&(b="<"+b+">"),b}}function wt(u,m){f.string!==u&&(f=vn(u)),f.remapCtrl=m}function vn(u){let m={};if(!u)return{keymap:m,string:""};function v(b){return b.split(/\\?(.)/).filter(Boolean)}return u.split(/((?:[^\\,]|\\.)+),/).map(b=>{if(!b)return;let x=b.split(/((?:[^\\;]|\\.)+);/);if(x.length==3){let k=v(x[1]),R=v(x[2]);if(k.length!==R.length)return;for(let O=0;O<k.length;++O)m[k[O]]=R[O]}else if(x.length==1){let k=v(b);if(k.length%2!=0)return;for(let R=0;R<k.length;R+=2)m[k[R]]=k[R+1]}}),{keymap:m,string:u}}we("langmap",void 0,"string",["lmap"],function(u,m){if(u===void 0)return f.string;wt(u)});class vr{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(m){this.operator?this.motionRepeat=this.motionRepeat.concat(m):this.prefixRepeat=this.prefixRepeat.concat(m)}getRepeat(){var m=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(m=1,this.prefixRepeat.length>0&&(m*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(m*=parseInt(this.motionRepeat.join(""),10))),m}}function pt(u,m){u.state.vim.inputState=new vr,u.state.vim.expectLiteralNext=!1,e.signal(u,"vim-command-done",m)}function Fr(){this.removed=[],this.inserted=""}class nn{constructor(m,v,b){this.clear(),this.keyBuffer=[m||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!v,this.blockwise=!!b}setText(m,v,b){this.keyBuffer=[m||""],this.linewise=!!v,this.blockwise=!!b}pushText(m,v){v&&(this.linewise||this.keyBuffer.push(`
92
92
  `),this.linewise=!0),this.keyBuffer.push(m)}pushInsertModeChanges(m){this.insertModeChanges.push(Z(m))}pushSearchQuery(m){this.searchQueries.push(m)}clear(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1}toString(){return this.keyBuffer.join("")}}function mi(u,m){var v=Q.registerController.registers;if(!u||u.length!=1)throw Error("Register name must be 1 character");if(v[u])throw Error("Register already defined "+u);v[u]=m,I.push(u)}class On{constructor(m){this.registers=m,this.unnamedRegister=m['"']=new nn,m["."]=new nn,m[":"]=new nn,m["/"]=new nn,m["+"]=new nn}pushText(m,v,b,x,k){if(m!=="_"){x&&b.charAt(b.length-1)!==`
93
93
  `&&(b+=`
94
94
  `);var R=this.isValidRegister(m)?this.getRegister(m):null;if(!R||!m){switch(v){case"yank":this.registers[0]=new nn(b,x,k);break;case"delete":case"change":b.indexOf(`
95
- `)==-1?this.registers["-"]=new nn(b,x):(this.shiftNumericRegisters_(),this.registers[1]=new nn(b,x));break}this.unnamedRegister.setText(b,x,k);return}P(m)?R.pushText(b,x):R.setText(b,x,k),m==="+"&&navigator.clipboard.writeText(b),this.unnamedRegister.setText(R.toString(),x)}}getRegister(m){return this.isValidRegister(m)?(m=m.toLowerCase(),this.registers[m]||(this.registers[m]=new nn),this.registers[m]):this.unnamedRegister}isValidRegister(m){return m&&(de(m,I)||$.test(m))}shiftNumericRegisters_(){for(var m=9;m>=2;m--)this.registers[m]=this.getRegister(""+(m-1))}}class br{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch(m,v){var b=this.historyBuffer,x=v?-1:1;this.initialPrefix===null&&(this.initialPrefix=m);for(var k=this.iterator+x;v?k>=0:k<b.length;k+=x)for(var R=b[k],O=0;O<=R.length;O++)if(this.initialPrefix==R.substring(0,O))return this.iterator=k,R;if(k>=b.length)return this.iterator=b.length,this.initialPrefix;if(k<0)return m}pushInput(m){var v=this.historyBuffer.indexOf(m);v>-1&&this.historyBuffer.splice(v,1),m.length&&this.historyBuffer.push(m)}reset(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}}var Pn={matchCommand:function(u,m,v,b){var x=vi(u,m,b,v),k=x.full[0];if(!k)return x.partial.length?{type:"partial",expectLiteralNext:x.partial.length==1&&x.partial[0].keys.slice(-11)=="<character>"}:{type:"none"};if(k.keys.slice(-11)=="<character>"||k.keys.slice(-10)=="<register>"){var R=wr(u);if(!R||R.length>1)return{type:"clear"};v.selectedCharacter=R}return{type:"full",command:k}},processCommand:function(u,m,v){switch(m.inputState.repeatOverride=v.repeatOverride,v.type){case"motion":this.processMotion(u,m,v);break;case"operator":this.processOperator(u,m,v);break;case"operatorMotion":this.processOperatorMotion(u,m,v);break;case"action":this.processAction(u,m,v);break;case"search":this.processSearch(u,m,v);break;case"ex":case"keyToEx":this.processEx(u,m,v);break}},processMotion:function(u,m,v){m.inputState.motion=v.motion,m.inputState.motionArgs=Br(v.motionArgs),this.evalInput(u,m)},processOperator:function(u,m,v){var b=m.inputState;if(b.operator)if(b.operator==v.operator){b.motion="expandToLine",b.motionArgs={linewise:!0,repeat:1},this.evalInput(u,m);return}else pt(u);b.operator=v.operator,b.operatorArgs=Br(v.operatorArgs),v.keys.length>1&&(b.operatorShortcut=v.keys),v.exitVisualBlock&&(m.visualBlock=!1,zn(u)),m.visualMode&&this.evalInput(u,m)},processOperatorMotion:function(u,m,v){var b=m.visualMode,x=Br(v.operatorMotionArgs);x&&b&&x.visualLine&&(m.visualLine=!0),this.processOperator(u,m,v),b||this.processMotion(u,m,v)},processAction:function(u,m,v){var b=m.inputState,x=b.getRepeat(),k=!!x,R=Br(v.actionArgs)||{repeat:1};b.selectedCharacter&&(R.selectedCharacter=b.selectedCharacter),v.operator&&this.processOperator(u,m,v),v.motion&&this.processMotion(u,m,v),(v.motion||v.operator)&&this.evalInput(u,m),R.repeat=x||1,R.repeatIsExplicit=k,R.registerName=b.registerName,pt(u),m.lastMotion=null,v.isEdit&&this.recordLastEdit(m,b,v),fn[v.action](u,R,m)},processSearch:function(u,m,v){if(!u.getSearchCursor)return;var b=v.searchArgs.forward,x=v.searchArgs.wholeWordOnly;Kn(u).setReversed(!b);var k=b?"/":"?",R=Kn(u).getQuery(),O=u.getScrollInfo(),L="";function z(Re,Ne,dt){Q.searchHistoryController.pushInput(Re),Q.searchHistoryController.reset();try{_i(u,Re,Ne,dt)}catch{ct(u,"Invalid regex: "+Re),pt(u);return}Pn.processMotion(u,m,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:v.searchArgs.toJumplist}})}function q(Re){u.scrollTo(O.left,O.top),z(Re,!0,!0);var Ne=Q.macroModeState;Ne.isRecording&&Ga(Ne,Re)}function oe(){return be("pcre")?"(JavaScript regexp: set pcre)":"(Vim regexp: set nopcre)"}function ie(Re,Ne,dt){var Je=tn(Re),Nt,Ft;Je=="<Up>"||Je=="<Down>"?(Nt=Je=="<Up>",Ft=Re.target?Re.target.selectionEnd:0,Ne=Q.searchHistoryController.nextMatch(Ne,Nt)||"",dt(Ne),Ft&&Re.target&&(Re.target.selectionEnd=Re.target.selectionStart=Math.min(Ft,Re.target.value.length))):Je&&Je!="<Left>"&&Je!="<Right>"&&Q.searchHistoryController.reset(),L=Ne,X()}function X(){var Re;try{Re=_i(u,L,!0,!0)}catch{}Re?u.scrollIntoView(xi(u,!b,Re),30):(ki(u),u.scrollTo(O.left,O.top))}function Y(Re,Ne,dt){var Je=tn(Re);Je=="<Esc>"||Je=="<C-c>"||Je=="<C-[>"||Je=="<BS>"&&Ne==""?(Q.searchHistoryController.pushInput(Ne),Q.searchHistoryController.reset(),_i(u,(R==null?void 0:R.source)||""),ki(u),u.scrollTo(O.left,O.top),e.e_stop(Re),pt(u),dt(),u.focus()):Je=="<Up>"||Je=="<Down>"?e.e_stop(Re):Je=="<C-u>"&&(e.e_stop(Re),dt(""))}switch(v.searchArgs.querySrc){case"prompt":var xe=Q.macroModeState;xe.isPlaying?z(xe.replaySearchQueries.shift()||"",!0,!1):aa(u,{onClose:q,prefix:k,desc:Nn("span",{$cursor:"pointer",onmousedown:function(Ne){Ne.preventDefault(),J("pcre",!be("pcre")),this.textContent=oe(),X()}},oe()),onKeyUp:ie,onKeyDown:Y});break;case"wordUnderCursor":var _e=Te(u,{noSymbol:!0}),qe=!0;if(_e||(_e=Te(u,{noSymbol:!1}),qe=!1),!_e){ct(u,"No word under cursor"),pt(u);return}let Re=u.getLine(_e.start.line).substring(_e.start.ch,_e.end.ch);Re=qe&&x?"\\b"+Re+"\\b":Mn(Re),Q.jumpList.cachedCursor=u.getCursor(),u.setCursor(_e.start),z(Re,!0,!1);break}},processEx:function(u,m,v){function b(O){Q.exCommandHistoryController.pushInput(O),Q.exCommandHistoryController.reset(),_n.processCommand(u,O),u.state.vim&&pt(u),ki(u)}function x(O,L,z){var q=tn(O),oe,ie;(q=="<Esc>"||q=="<C-c>"||q=="<C-[>"||q=="<BS>"&&L=="")&&(Q.exCommandHistoryController.pushInput(L),Q.exCommandHistoryController.reset(),e.e_stop(O),pt(u),ki(u),z(),u.focus()),q=="<Up>"||q=="<Down>"?(e.e_stop(O),oe=q=="<Up>",ie=O.target?O.target.selectionEnd:0,L=Q.exCommandHistoryController.nextMatch(L,oe)||"",z(L),ie&&O.target&&(O.target.selectionEnd=O.target.selectionStart=Math.min(ie,O.target.value.length))):q=="<C-u>"?(e.e_stop(O),z("")):q&&q!="<Left>"&&q!="<Right>"&&Q.exCommandHistoryController.reset()}function k(O,L){var z=new e.StringStream(L),q={};try{if(_n.parseInput_(u,z,q),q.commandName!="s"){ki(u);return}var oe=_n.matchCommand_(q.commandName);if(!oe||(_n.parseCommandArgs_(z,q,oe),!q.argString))return;var ie=Hs(q.argString.slice(1),!0,!0);ie&&Bo(u,ie)}catch{}}if(v.type=="keyToEx")_n.processCommand(u,v.exArgs.input);else{var R={onClose:b,onKeyDown:x,onKeyUp:k,prefix:":"};m.visualMode&&(R.value="'<,'>",R.selectValueOnOpen=!1),aa(u,R)}},evalInput:function(u,m){var v=m.inputState,b=v.motion,x=v.motionArgs||{repeat:1},k=v.operator,R=v.operatorArgs||{},O=v.registerName,L=m.sel,z=Ge(m.visualMode?zt(u,L.head):u.getCursor("head")),q=Ge(m.visualMode?zt(u,L.anchor):u.getCursor("anchor")),oe=Ge(z),ie=Ge(q),X,Y,xe;if(k&&this.recordLastEdit(m,v),xe=v.repeatOverride===void 0?v.getRepeat():v.repeatOverride,xe>0&&x.explicitRepeat?x.repeatIsExplicit=!0:(x.noRepeat||!x.explicitRepeat&&xe===0)&&(xe=1,x.repeatIsExplicit=!1),v.selectedCharacter&&(x.selectedCharacter=R.selectedCharacter=v.selectedCharacter),x.repeat=xe,pt(u),b){var _e=dn[b](u,z,x,m,v);if(m.lastMotion=dn[b],!_e)return;if(x.toJumplist){var qe=Q.jumpList,Re=qe.cachedCursor;Re?(Ve(u,Re,_e),delete qe.cachedCursor):Ve(u,z,_e)}_e instanceof Array?(Y=_e[0],X=_e[1]):X=_e,X||(X=Ge(z)),m.visualMode?(m.visualBlock&&X.ch===1/0||(X=zt(u,X,oe)),Y&&(Y=zt(u,Y)),Y||(Y=ie),L.anchor=Y,L.head=X,zn(u),Fn(u,m,"<",xt(Y,X)?Y:X),Fn(u,m,">",xt(Y,X)?X:Y)):k||(X=zt(u,X,oe),u.setCursor(X.line,X.ch))}if(k){if(R.lastSel){Y=ie;var Ne=R.lastSel,dt=Math.abs(Ne.head.line-Ne.anchor.line),Je=Math.abs(Ne.head.ch-Ne.anchor.ch);X=Ne.visualLine?new n(ie.line+dt,ie.ch):Ne.visualBlock?new n(ie.line+dt,ie.ch+Je):Ne.head.line==Ne.anchor.line?new n(ie.line,ie.ch+Je):new n(ie.line+dt,ie.ch),m.visualMode=!0,m.visualLine=Ne.visualLine,m.visualBlock=Ne.visualBlock,L=m.sel={anchor:Y,head:X},zn(u)}else m.visualMode&&(R.lastSel={anchor:Ge(L.anchor),head:Ge(L.head),visualBlock:m.visualBlock,visualLine:m.visualLine});var Nt,Ft,Ue,$e,$t;if(m.visualMode){Nt=kt(L.head,L.anchor),Ft=jn(L.head,L.anchor),Ue=m.visualLine||R.linewise,$e=m.visualBlock?"block":Ue?"line":"char";var rn=i(u,Nt,Ft);if($t=or(u,{anchor:rn.start,head:rn.end},$e),Ue){var pn=$t.ranges;if($e=="block")for(var Za=0;Za<pn.length;Za++)pn[Za].head.ch=St(u,pn[Za].head.line);else $e=="line"&&(pn[0].head=new n(pn[0].head.line+1,0))}}else{if(Nt=Ge(Y||ie),Ft=Ge(X||oe),xt(Ft,Nt)){var Cc=Nt;Nt=Ft,Ft=Cc}Ue=x.linewise||R.linewise,Ue?te(u,Nt,Ft):x.forward&&j(u,Nt,Ft),$e="char";var Ec=!x.inclusive||Ue,rn=i(u,Nt,Ft);$t=or(u,{anchor:rn.start,head:rn.end},$e,Ec)}u.setSelections($t.ranges,$t.primary),m.lastMotion=null,R.repeat=xe,R.registerName=O,R.linewise=Ue;var Wo=Ut[k](u,R,$t.ranges,ie,X);m.visualMode&&Ye(u,Wo!=null),Wo&&u.setCursor(Wo)}},recordLastEdit:function(u,m,v){var b=Q.macroModeState;b.isPlaying||(u.lastEditInputState=m,u.lastEditActionCommand=v,b.lastInsertModeChanges.changes=[],b.lastInsertModeChanges.expectCursorActivityForChange=!1,b.lastInsertModeChanges.visualBlock=u.visualBlock?u.sel.head.line-u.sel.anchor.line:0)}},dn={moveToTopLine:function(u,m,v){var b=Ka(u).top+v.repeat-1;return new n(b,ve(u.getLine(b)))},moveToMiddleLine:function(u){var m=Ka(u),v=Math.floor((m.top+m.bottom)*.5);return new n(v,ve(u.getLine(v)))},moveToBottomLine:function(u,m,v){var b=Ka(u).bottom-v.repeat+1;return new n(b,ve(u.getLine(b)))},expandToLine:function(u,m,v){return new n(m.line+v.repeat-1,1/0)},findNext:function(u,m,v){var b=Kn(u),x=b.getQuery();if(x){var k=!v.forward;k=b.isReversed()?!k:k,Bo(u,x);var R=xi(u,k,x,v.repeat);return R||ct(u,"No match found "+x+(be("pcre")?" (set nopcre to use Vim regexps)":"")),R}},findAndSelectNextInclusive:function(u,m,v,b,x){var k=Kn(u),R=k.getQuery();if(R){var O=!v.forward;O=k.isReversed()?!O:O;var L=Sf(u,O,R,v.repeat,b);if(L){if(x.operator)return L;var z=L[0],q=new n(L[1].line,L[1].ch-1);if(b.visualMode){(b.visualLine||b.visualBlock)&&(b.visualLine=!1,b.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""}));var oe=b.sel.anchor;if(oe)return k.isReversed()?v.forward?[oe,z]:[oe,q]:v.forward?[oe,q]:[oe,z]}else b.visualMode=!0,b.visualLine=!1,b.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""});return O?[q,z]:[z,q]}}},goToMark:function(u,m,v,b){var x=Ho(u,b,v.selectedCharacter||"");return x?v.linewise?{line:x.line,ch:ve(u.getLine(x.line))}:x:null},moveToOtherHighlightedEnd:function(u,m,v,b){var x=b.sel;return b.visualBlock&&v.sameLine?[zt(u,new n(x.anchor.line,x.head.ch)),zt(u,new n(x.head.line,x.anchor.ch))]:[x.head,x.anchor]},jumpToMark:function(u,m,v,b){for(var x=m,k=0;k<v.repeat;k++){var R=x;for(var O in b.marks)if(N(O)){var L=b.marks[O].find();if(!(v.forward?xt(L,R):xt(R,L))&&!(v.linewise&&L.line==R.line)){var z=gt(R,x),q=v.forward?_r(R,L,x):_r(x,L,R);(z||q)&&(x=L)}}}return v.linewise&&(x=new n(x.line,ve(u.getLine(x.line)))),x},moveByCharacters:function(u,m,v){var b=m,x=v.repeat,k=v.forward?b.ch+x:b.ch-x;return new n(b.line,k)},moveByLines:function(u,m,v,b){var x=m,k=x.ch;switch(b.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:k=b.lastHPos;break;default:b.lastHPos=k}var R=v.repeat+(v.repeatOffset||0),O=v.forward?x.line+R:x.line-R,L=u.firstLine(),z=u.lastLine(),q=u.findPosV(x,v.forward?R:-R,"line",b.lastHSPos);return(v.forward?q.line>O:q.line<O)&&(O=q.line,k=q.ch),O<L&&x.line==L?this.moveToStartOfLine(u,m,v,b):O>z&&x.line==z?wn(u,m,v,b,!0):(v.toFirstChar&&(k=ve(u.getLine(O)),b.lastHPos=k),b.lastHSPos=u.charCoords(new n(O,k),"div").left,new n(O,k))},moveByDisplayLines:function(u,m,v,b){var x=m;switch(b.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:b.lastHSPos=u.charCoords(x,"div").left}var k=v.repeat,R=u.findPosV(x,v.forward?k:-k,"line",b.lastHSPos);if(R.hitSide)if(v.forward){var O={top:u.charCoords(R,"div").top+8,left:b.lastHSPos};R=u.coordsChar(O,"div")}else{var L=u.charCoords(new n(u.firstLine(),0),"div");L.left=b.lastHSPos,R=u.coordsChar(L,"div")}return b.lastHPos=R.ch,R},moveByPage:function(u,m,v){var b=m,x=v.repeat;return u.findPosV(b,v.forward?x:-x,"page")},moveByParagraph:function(u,m,v){var b=v.forward?1:-1;return Xt(u,m,v.repeat,b).start},moveBySentence:function(u,m,v){var b=v.forward?1:-1;return gc(u,m,v.repeat,b)},moveByScroll:function(u,m,v,b){var x=u.getScrollInfo(),k=null,R=v.repeat;R||(R=x.clientHeight/(2*u.defaultTextHeight()));var O=u.charCoords(m,"local");if(v.repeat=R,k=dn.moveByDisplayLines(u,m,v,b),!k)return null;var L=u.charCoords(k,"local");return u.scrollTo(null,x.top+L.top-O.top),k},moveByWords:function(u,m,v){return ut(u,m,v.repeat,!!v.forward,!!v.wordEnd,!!v.bigWord)},moveTillCharacter:function(u,m,v){var b=v.repeat,x=sr(u,b,v.forward,v.selectedCharacter,m),k=v.forward?-1:1;return ot(k,v),x?(x.ch+=k,x):null},moveToCharacter:function(u,m,v){var b=v.repeat;return ot(0,v),sr(u,b,v.forward,v.selectedCharacter,m)||m},moveToSymbol:function(u,m,v){var b=v.repeat;return v.selectedCharacter&&Lt(u,b,v.forward,v.selectedCharacter)||m},moveToColumn:function(u,m,v,b){var x=v.repeat;return b.lastHPos=x-1,b.lastHSPos=u.charCoords(m,"div").left,ii(u,x)},moveToEol:function(u,m,v,b){return wn(u,m,v,b,!1)},moveToFirstNonWhiteSpaceCharacter:function(u,m){var v=m;return new n(v.line,ve(u.getLine(v.line)))},moveToMatchedSymbol:function(u,m){for(var v=m,b=v.line,x=v.ch,k=u.getLine(b),R;x<k.length;x++)if(R=k.charAt(x),R&&K(R)){var O=u.getTokenTypeAt(new n(b,x+1));if(O!=="string"&&O!=="comment")break}if(x<k.length){var L=R==="<"||R===">"?/[(){}[\]<>]/:/[(){}[\]]/;return u.findMatchingBracket(new n(b,x),{bracketRegex:L}).to}else return v},moveToStartOfLine:function(u,m){return new n(m.line,0)},moveToLineOrEdgeOfDocument:function(u,m,v){var b=v.forward?u.lastLine():u.firstLine();return v.repeatIsExplicit&&(b=v.repeat-u.getOption("firstLineNumber")),new n(b,ve(u.getLine(b)))},moveToStartOfDisplayLine:function(u){return u.execCommand("goLineLeft"),u.getCursor()},moveToEndOfDisplayLine:function(u){u.execCommand("goLineRight");var m=u.getCursor();return m.sticky=="before"&&m.ch--,m},textObjectManipulation:function(u,m,v,b){var x={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},k={"'":!0,'"':!0,"`":!0},R=v.selectedCharacter||"";R=="b"?R="(":R=="B"&&(R="{");var O=!v.textObjectInner,L,z;if(x[R]){if(z=!0,L=ai(u,m,R,O),!L){var q=u.getSearchCursor(RegExp("\\"+R,"g"),m);q.find()&&(L=ai(u,q.from(),R,O))}}else if(k[R])z=!0,L=ia(u,m,R,O);else if(R==="W"||R==="w")for(var oe=v.repeat||1;oe-- >0;){var ie=Te(u,{inclusive:O,innerWord:!O,bigWord:R==="W",noSymbol:R==="W",multiline:!0},L&&L.end);ie&&(L||(L=ie),L.end=ie.end)}else if(R==="p")if(L=Xt(u,m,v.repeat,0,O),v.linewise=!0,b.visualMode)b.visualLine||(b.visualLine=!0);else{var X=b.inputState.operatorArgs;X&&(X.linewise=!0),L.end.line--}else if(R==="t")L=He(u,m,O);else if(R==="s"){var Y=u.getLine(m.line);m.ch>0&&W(Y[m.ch])&&--m.ch;var xe=Fs(u,m,v.repeat,1,O),_e=Fs(u,m,v.repeat,-1,O);A(u.getLine(_e.line)[_e.ch])&&A(u.getLine(xe.line)[xe.ch-1])&&(_e={line:_e.line,ch:_e.ch+1}),L={start:_e,end:xe}}return L?u.state.vim.visualMode?wi(u,L.start,L.end,z):[L.start,L.end]:null},repeatLastCharacterSearch:function(u,m,v){var b=Q.lastCharacterSearch,x=v.repeat,k=v.forward===b.forward,R=(b.increment?1:0)*(k?-1:1);u.moveH(-R,"char"),v.inclusive=!!k;var O=sr(u,x,k,b.selectedCharacter);return O?(O.ch+=R,O):(u.moveH(R,"char"),m)}};function ta(u,m){dn[u]=m}function gi(u,m){for(var v=[],b=0;b<m;b++)v.push(u);return v}var Ut={change:function(u,m,v){var b,x,k=u.state.vim,R=v[0].anchor,O=v[0].head;if(k.visualMode)if(m.fullLine)O.ch=Number.MAX_VALUE,O.line--,u.setSelection(R,O),x=u.getSelection(),u.replaceSelection(""),b=R;else{x=u.getSelection();var L=gi("",v.length);u.replaceSelections(L),b=kt(v[0].head,v[0].anchor)}else{x=u.getRange(R,O);var z=k.lastEditInputState;if((z==null?void 0:z.motion)=="moveByWords"&&!A(x)){var q=/\s+$/.exec(x);q&&z.motionArgs&&z.motionArgs.forward&&(O=_t(O,0,-q[0].length),x=x.slice(0,-q[0].length))}m.linewise&&(R=new n(R.line,ve(u.getLine(R.line))),O.line>R.line&&(O=new n(O.line-1,Number.MAX_VALUE))),u.replaceRange("",R,O),b=R}Q.registerController.pushText(m.registerName,"change",x,m.linewise,v.length>1),fn.enterInsertMode(u,{head:b},u.state.vim)},delete:function(u,m,v){var b,x,k=u.state.vim;if(k.visualBlock){x=u.getSelection();var R=gi("",v.length);u.replaceSelections(R),b=kt(v[0].head,v[0].anchor)}else{var O=v[0].anchor,L=v[0].head;m.linewise&&L.line!=u.firstLine()&&O.line==u.lastLine()&&O.line==L.line-1&&(O.line==u.firstLine()?O.ch=0:O=new n(O.line-1,St(u,O.line-1))),x=u.getRange(O,L),u.replaceRange("",O,L),b=O,m.linewise&&(b=dn.moveToFirstNonWhiteSpaceCharacter(u,O))}return Q.registerController.pushText(m.registerName,"delete",x,m.linewise,k.visualBlock),zt(u,b)},indent:function(u,m,v){var b=u.state.vim,x=b.visualMode&&m.repeat||1;if(b.visualBlock){for(var k=u.getOption("tabSize"),R=u.getOption("indentWithTabs")?" ":" ".repeat(k),O,L=v.length-1;L>=0;L--)if(O=kt(v[L].anchor,v[L].head),m.indentRight)u.replaceRange(R.repeat(x),O,O);else{for(var z=u.getLine(O.line),q=0,oe=0;oe<x;oe++){var ie=z[O.ch+q];if(ie==" ")q++;else if(ie==" "){q++;for(var X=1;X<R.length&&(ie=z[O.ch+q],ie===" ");X++)q++}else break}u.replaceRange("",O,_t(O,0,q))}return O}else if(u.indentMore)for(var oe=0;oe<x;oe++)m.indentRight?u.indentMore():u.indentLess();else{var Y=v[0].anchor.line,xe=b.visualBlock?v[v.length-1].anchor.line:v[0].head.line;m.linewise&&xe--;for(var L=Y;L<=xe;L++)for(var oe=0;oe<x;oe++)u.indentLine(L,m.indentRight)}return dn.moveToFirstNonWhiteSpaceCharacter(u,v[0].anchor)},indentAuto:function(u,m,v){return u.execCommand("indentAuto"),dn.moveToFirstNonWhiteSpaceCharacter(u,v[0].anchor)},hardWrap:function(u,m,v,b){if(u.hardWrap){var x=v[0].anchor.line,k=v[0].head.line;m.linewise&&k--;var R=u.hardWrap({from:x,to:k});return R>x&&m.linewise&&R--,m.keepCursor?b:new n(R,0)}},changeCase:function(u,m,v,b,x){for(var k=u.getSelections(),R=[],O=m.toLower,L=0;L<k.length;L++){var z=k[L],q="";if(O===!0)q=z.toLowerCase();else if(O===!1)q=z.toUpperCase();else for(var oe=0;oe<z.length;oe++){var ie=z.charAt(oe);q+=P(ie)?ie.toLowerCase():ie.toUpperCase()}R.push(q)}return u.replaceSelections(R),m.shouldMoveCursor?x:!u.state.vim.visualMode&&m.linewise&&v[0].anchor.line+1==v[0].head.line?dn.moveToFirstNonWhiteSpaceCharacter(u,b):m.linewise?b:kt(v[0].anchor,v[0].head)},yank:function(u,m,v,b){var x=u.state.vim,k=u.getSelection(),R=x.visualMode?kt(x.sel.anchor,x.sel.head,v[0].head,v[0].anchor):b;return Q.registerController.pushText(m.registerName,"yank",k,m.linewise,x.visualBlock),R},rot13:function(u,m,v,b,x){for(var k=u.getSelections(),R=[],O=0;O<k.length;O++){let L=k[O].split("").map(z=>{let q=z.charCodeAt(0);return q>=65&&q<=90?String.fromCharCode(65+(q-65+13)%26):q>=97&&q<=122?String.fromCharCode(97+(q-97+13)%26):z}).join("");R.push(L)}return u.replaceSelections(R),m.shouldMoveCursor?x:!u.state.vim.visualMode&&m.linewise&&v[0].anchor.line+1==v[0].head.line?dn.moveToFirstNonWhiteSpaceCharacter(u,b):m.linewise?b:kt(v[0].anchor,v[0].head)}};function yi(u,m){Ut[u]=m}var fn={jumpListWalk:function(u,m,v){if(!v.visualMode){var b=m.repeat||1,x=m.forward,k=Q.jumpList.move(u,x?b:-b),R=k?k.find():void 0;R||(R=u.getCursor()),u.setCursor(R)}},scroll:function(u,m,v){if(!v.visualMode){var b=m.repeat||1,x=u.defaultTextHeight(),k=u.getScrollInfo().top,R=x*b,O=m.forward?k+R:k-R,L=Ge(u.getCursor()),z=u.charCoords(L,"local");if(m.forward)O>z.top?(L.line+=(O-z.top)/x,L.line=Math.ceil(L.line),u.setCursor(L),z=u.charCoords(L,"local"),u.scrollTo(null,z.top)):u.scrollTo(null,O);else{var q=O+u.getScrollInfo().clientHeight;q<z.bottom?(L.line-=(z.bottom-q)/x,L.line=Math.floor(L.line),u.setCursor(L),z=u.charCoords(L,"local"),u.scrollTo(null,z.bottom-u.getScrollInfo().clientHeight)):u.scrollTo(null,O)}}},scrollToCursor:function(u,m){var v=u.getCursor().line,b=u.charCoords(new n(v,0),"local"),x=u.getScrollInfo().clientHeight,k=b.top;switch(m.position){case"center":k=b.bottom-x/2;break;case"bottom":var R=new n(v,u.getLine(v).length-1),O=u.charCoords(R,"local").bottom-k;k=k-x+O;break}u.scrollTo(null,k)},replayMacro:function(u,m,v){var b=m.selectedCharacter||"",x=m.repeat||1,k=Q.macroModeState;for(b=="@"?b=k.latestRegister||"":k.latestRegister=b;x--;)Qa(u,v,k,b)},enterMacroRecordMode:function(u,m){var v=Q.macroModeState,b=m.selectedCharacter;Q.registerController.isValidRegister(b)&&v.enterMacroRecordMode(u,b)},toggleOverwrite:function(u){u.state.overwrite?(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})):(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(u,m,v){if(!u.getOption("readOnly")){v.insertMode=!0,v.insertModeRepeat=m&&m.repeat||1;var b=m?m.insertAt:null,x=v.sel,k=m.head||u.getCursor("head"),R=u.listSelections().length;if(b=="eol")k=new n(k.line,St(u,k.line));else if(b=="bol")k=new n(k.line,0);else if(b=="charAfter"){var O=i(u,k,_t(k,0,1));k=O.end}else if(b=="firstNonBlank"){var O=i(u,k,dn.moveToFirstNonWhiteSpaceCharacter(u,k));k=O.end}else if(b=="startOfSelectedArea"){if(!v.visualMode)return;v.visualBlock?(k=new n(Math.min(x.head.line,x.anchor.line),Math.min(x.head.ch,x.anchor.ch)),R=Math.abs(x.head.line-x.anchor.line)+1):k=x.head.line<x.anchor.line?x.head:new n(x.anchor.line,0)}else if(b=="endOfSelectedArea"){if(!v.visualMode)return;v.visualBlock?(k=new n(Math.min(x.head.line,x.anchor.line),Math.max(x.head.ch,x.anchor.ch)+1),R=Math.abs(x.head.line-x.anchor.line)+1):k=x.head.line>=x.anchor.line?_t(x.head,0,1):new n(x.anchor.line,0)}else if(b=="inplace"){if(v.visualMode)return}else b=="lastEdit"&&(k=xc(u)||k);u.setOption("disableInput",!1),m&&m.replace?(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"})):(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})),Q.macroModeState.isPlaying||(u.on("change",Wr),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=u.setBookmark(k,{insertLeft:!0}),e.on(u.getInputField(),"keydown",Us)),v.visualMode&&Ye(u),ar(u,k,R)}},toggleVisualMode:function(u,m,v){var b=m.repeat,x=u.getCursor(),k;if(v.visualMode)v.visualLine!=!!m.linewise||v.visualBlock!=!!m.blockwise?(v.visualLine=!!m.linewise,v.visualBlock=!!m.blockwise,e.signal(u,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""}),zn(u)):Ye(u);else{v.visualMode=!0,v.visualLine=!!m.linewise,v.visualBlock=!!m.blockwise,k=zt(u,new n(x.line,x.ch+b-1));var R=i(u,x,k);v.sel={anchor:R.start,head:R.end},e.signal(u,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""}),zn(u),Fn(u,v,"<",kt(x,k)),Fn(u,v,">",jn(x,k))}},reselectLastSelection:function(u,m,v){var b=v.lastSelection;if(v.visualMode&&Ln(u,v),b){var x=b.anchorMark.find(),k=b.headMark.find();if(!x||!k)return;v.sel={anchor:x,head:k},v.visualMode=!0,v.visualLine=b.visualLine,v.visualBlock=b.visualBlock,zn(u),Fn(u,v,"<",kt(x,k)),Fn(u,v,">",jn(x,k)),e.signal(u,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""})}},joinLines:function(u,m,v){var b,x;if(v.visualMode){if(b=u.getCursor("anchor"),x=u.getCursor("head"),xt(x,b)){var k=x;x=b,b=k}x.ch=St(u,x.line)-1}else{var R=Math.max(m.repeat,2);b=u.getCursor(),x=zt(u,new n(b.line+R-1,1/0))}for(var O=0,L=b.line;L<x.line;L++){O=St(u,b.line);var z="",q=0;if(!m.keepSpaces){var oe=u.getLine(b.line+1);q=oe.search(/\S/),q==-1?q=oe.length:z=" "}u.replaceRange(z,new n(b.line,O),new n(b.line+1,q))}var ie=zt(u,new n(b.line,O));v.visualMode&&Ye(u,!1),u.setCursor(ie)},newLineAndEnterInsertMode:function(u,m,v){v.insertMode=!0;var b=Ge(u.getCursor());b.line===u.firstLine()&&!m.after?(u.replaceRange(`
95
+ `)==-1?this.registers["-"]=new nn(b,x):(this.shiftNumericRegisters_(),this.registers[1]=new nn(b,x));break}this.unnamedRegister.setText(b,x,k);return}P(m)?R.pushText(b,x):R.setText(b,x,k),m==="+"&&navigator.clipboard.writeText(b),this.unnamedRegister.setText(R.toString(),x)}}getRegister(m){return this.isValidRegister(m)?(m=m.toLowerCase(),this.registers[m]||(this.registers[m]=new nn),this.registers[m]):this.unnamedRegister}isValidRegister(m){return m&&(de(m,I)||$.test(m))}shiftNumericRegisters_(){for(var m=9;m>=2;m--)this.registers[m]=this.getRegister(""+(m-1))}}class br{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch(m,v){var b=this.historyBuffer,x=v?-1:1;this.initialPrefix===null&&(this.initialPrefix=m);for(var k=this.iterator+x;v?k>=0:k<b.length;k+=x)for(var R=b[k],O=0;O<=R.length;O++)if(this.initialPrefix==R.substring(0,O))return this.iterator=k,R;if(k>=b.length)return this.iterator=b.length,this.initialPrefix;if(k<0)return m}pushInput(m){var v=this.historyBuffer.indexOf(m);v>-1&&this.historyBuffer.splice(v,1),m.length&&this.historyBuffer.push(m)}reset(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}}var Pn={matchCommand:function(u,m,v,b){var x=vi(u,m,b,v),k=x.full[0];if(!k)return x.partial.length?{type:"partial",expectLiteralNext:x.partial.length==1&&x.partial[0].keys.slice(-11)=="<character>"}:{type:"none"};if(k.keys.slice(-11)=="<character>"||k.keys.slice(-10)=="<register>"){var R=wr(u);if(!R||R.length>1)return{type:"clear"};v.selectedCharacter=R}return{type:"full",command:k}},processCommand:function(u,m,v){switch(m.inputState.repeatOverride=v.repeatOverride,v.type){case"motion":this.processMotion(u,m,v);break;case"operator":this.processOperator(u,m,v);break;case"operatorMotion":this.processOperatorMotion(u,m,v);break;case"action":this.processAction(u,m,v);break;case"search":this.processSearch(u,m,v);break;case"ex":case"keyToEx":this.processEx(u,m,v);break}},processMotion:function(u,m,v){m.inputState.motion=v.motion,m.inputState.motionArgs=Br(v.motionArgs),this.evalInput(u,m)},processOperator:function(u,m,v){var b=m.inputState;if(b.operator)if(b.operator==v.operator){b.motion="expandToLine",b.motionArgs={linewise:!0,repeat:1},this.evalInput(u,m);return}else pt(u);b.operator=v.operator,b.operatorArgs=Br(v.operatorArgs),v.keys.length>1&&(b.operatorShortcut=v.keys),v.exitVisualBlock&&(m.visualBlock=!1,Fn(u)),m.visualMode&&this.evalInput(u,m)},processOperatorMotion:function(u,m,v){var b=m.visualMode,x=Br(v.operatorMotionArgs);x&&b&&x.visualLine&&(m.visualLine=!0),this.processOperator(u,m,v),b||this.processMotion(u,m,v)},processAction:function(u,m,v){var b=m.inputState,x=b.getRepeat(),k=!!x,R=Br(v.actionArgs)||{repeat:1};b.selectedCharacter&&(R.selectedCharacter=b.selectedCharacter),v.operator&&this.processOperator(u,m,v),v.motion&&this.processMotion(u,m,v),(v.motion||v.operator)&&this.evalInput(u,m),R.repeat=x||1,R.repeatIsExplicit=k,R.registerName=b.registerName,pt(u),m.lastMotion=null,v.isEdit&&this.recordLastEdit(m,b,v),fn[v.action](u,R,m)},processSearch:function(u,m,v){if(!u.getSearchCursor)return;var b=v.searchArgs.forward,x=v.searchArgs.wholeWordOnly;Kn(u).setReversed(!b);var k=b?"/":"?",R=Kn(u).getQuery(),O=u.getScrollInfo(),L="";function z(Re,Ne,dt){Q.searchHistoryController.pushInput(Re),Q.searchHistoryController.reset();try{_i(u,Re,Ne,dt)}catch{ct(u,"Invalid regex: "+Re),pt(u);return}Pn.processMotion(u,m,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:v.searchArgs.toJumplist}})}function q(Re){u.scrollTo(O.left,O.top),z(Re,!0,!0);var Ne=Q.macroModeState;Ne.isRecording&&Ga(Ne,Re)}function oe(){return be("pcre")?"(JavaScript regexp: set pcre)":"(Vim regexp: set nopcre)"}function ie(Re,Ne,dt){var Je=tn(Re),Nt,Ft;Je=="<Up>"||Je=="<Down>"?(Nt=Je=="<Up>",Ft=Re.target?Re.target.selectionEnd:0,Ne=Q.searchHistoryController.nextMatch(Ne,Nt)||"",dt(Ne),Ft&&Re.target&&(Re.target.selectionEnd=Re.target.selectionStart=Math.min(Ft,Re.target.value.length))):Je&&Je!="<Left>"&&Je!="<Right>"&&Q.searchHistoryController.reset(),L=Ne,X()}function X(){var Re;try{Re=_i(u,L,!0,!0)}catch{}Re?u.scrollIntoView(xi(u,!b,Re),30):(ki(u),u.scrollTo(O.left,O.top))}function Y(Re,Ne,dt){var Je=tn(Re);Je=="<Esc>"||Je=="<C-c>"||Je=="<C-[>"||Je=="<BS>"&&Ne==""?(Q.searchHistoryController.pushInput(Ne),Q.searchHistoryController.reset(),_i(u,(R==null?void 0:R.source)||""),ki(u),u.scrollTo(O.left,O.top),e.e_stop(Re),pt(u),dt(),u.focus()):Je=="<Up>"||Je=="<Down>"?e.e_stop(Re):Je=="<C-u>"&&(e.e_stop(Re),dt(""))}switch(v.searchArgs.querySrc){case"prompt":var xe=Q.macroModeState;xe.isPlaying?z(xe.replaySearchQueries.shift()||"",!0,!1):aa(u,{onClose:q,prefix:k,desc:Nn("span",{$cursor:"pointer",onmousedown:function(Ne){Ne.preventDefault(),J("pcre",!be("pcre")),this.textContent=oe(),X()}},oe()),onKeyUp:ie,onKeyDown:Y});break;case"wordUnderCursor":var _e=Te(u,{noSymbol:!0}),qe=!0;if(_e||(_e=Te(u,{noSymbol:!1}),qe=!1),!_e){ct(u,"No word under cursor"),pt(u);return}let Re=u.getLine(_e.start.line).substring(_e.start.ch,_e.end.ch);Re=qe&&x?"\\b"+Re+"\\b":Mn(Re),Q.jumpList.cachedCursor=u.getCursor(),u.setCursor(_e.start),z(Re,!0,!1);break}},processEx:function(u,m,v){function b(O){Q.exCommandHistoryController.pushInput(O),Q.exCommandHistoryController.reset(),_n.processCommand(u,O),u.state.vim&&pt(u),ki(u)}function x(O,L,z){var q=tn(O),oe,ie;(q=="<Esc>"||q=="<C-c>"||q=="<C-[>"||q=="<BS>"&&L=="")&&(Q.exCommandHistoryController.pushInput(L),Q.exCommandHistoryController.reset(),e.e_stop(O),pt(u),ki(u),z(),u.focus()),q=="<Up>"||q=="<Down>"?(e.e_stop(O),oe=q=="<Up>",ie=O.target?O.target.selectionEnd:0,L=Q.exCommandHistoryController.nextMatch(L,oe)||"",z(L),ie&&O.target&&(O.target.selectionEnd=O.target.selectionStart=Math.min(ie,O.target.value.length))):q=="<C-u>"?(e.e_stop(O),z("")):q&&q!="<Left>"&&q!="<Right>"&&Q.exCommandHistoryController.reset()}function k(O,L){var z=new e.StringStream(L),q={};try{if(_n.parseInput_(u,z,q),q.commandName!="s"){ki(u);return}var oe=_n.matchCommand_(q.commandName);if(!oe||(_n.parseCommandArgs_(z,q,oe),!q.argString))return;var ie=Bs(q.argString.slice(1),!0,!0);ie&&Bo(u,ie)}catch{}}if(v.type=="keyToEx")_n.processCommand(u,v.exArgs.input);else{var R={onClose:b,onKeyDown:x,onKeyUp:k,prefix:":"};m.visualMode&&(R.value="'<,'>",R.selectValueOnOpen=!1),aa(u,R)}},evalInput:function(u,m){var v=m.inputState,b=v.motion,x=v.motionArgs||{repeat:1},k=v.operator,R=v.operatorArgs||{},O=v.registerName,L=m.sel,z=Ge(m.visualMode?zt(u,L.head):u.getCursor("head")),q=Ge(m.visualMode?zt(u,L.anchor):u.getCursor("anchor")),oe=Ge(z),ie=Ge(q),X,Y,xe;if(k&&this.recordLastEdit(m,v),xe=v.repeatOverride===void 0?v.getRepeat():v.repeatOverride,xe>0&&x.explicitRepeat?x.repeatIsExplicit=!0:(x.noRepeat||!x.explicitRepeat&&xe===0)&&(xe=1,x.repeatIsExplicit=!1),v.selectedCharacter&&(x.selectedCharacter=R.selectedCharacter=v.selectedCharacter),x.repeat=xe,pt(u),b){var _e=dn[b](u,z,x,m,v);if(m.lastMotion=dn[b],!_e)return;if(x.toJumplist){var qe=Q.jumpList,Re=qe.cachedCursor;Re?(Ve(u,Re,_e),delete qe.cachedCursor):Ve(u,z,_e)}_e instanceof Array?(Y=_e[0],X=_e[1]):X=_e,X||(X=Ge(z)),m.visualMode?(m.visualBlock&&X.ch===1/0||(X=zt(u,X,oe)),Y&&(Y=zt(u,Y)),Y||(Y=ie),L.anchor=Y,L.head=X,Fn(u),Bn(u,m,"<",xt(Y,X)?Y:X),Bn(u,m,">",xt(Y,X)?X:Y)):k||(X=zt(u,X,oe),u.setCursor(X.line,X.ch))}if(k){if(R.lastSel){Y=ie;var Ne=R.lastSel,dt=Math.abs(Ne.head.line-Ne.anchor.line),Je=Math.abs(Ne.head.ch-Ne.anchor.ch);X=Ne.visualLine?new n(ie.line+dt,ie.ch):Ne.visualBlock?new n(ie.line+dt,ie.ch+Je):Ne.head.line==Ne.anchor.line?new n(ie.line,ie.ch+Je):new n(ie.line+dt,ie.ch),m.visualMode=!0,m.visualLine=Ne.visualLine,m.visualBlock=Ne.visualBlock,L=m.sel={anchor:Y,head:X},Fn(u)}else m.visualMode&&(R.lastSel={anchor:Ge(L.anchor),head:Ge(L.head),visualBlock:m.visualBlock,visualLine:m.visualLine});var Nt,Ft,Ue,$e,$t;if(m.visualMode){Nt=kt(L.head,L.anchor),Ft=zn(L.head,L.anchor),Ue=m.visualLine||R.linewise,$e=m.visualBlock?"block":Ue?"line":"char";var rn=i(u,Nt,Ft);if($t=or(u,{anchor:rn.start,head:rn.end},$e),Ue){var pn=$t.ranges;if($e=="block")for(var Za=0;Za<pn.length;Za++)pn[Za].head.ch=St(u,pn[Za].head.line);else $e=="line"&&(pn[0].head=new n(pn[0].head.line+1,0))}}else{if(Nt=Ge(Y||ie),Ft=Ge(X||oe),xt(Ft,Nt)){var Cc=Nt;Nt=Ft,Ft=Cc}Ue=x.linewise||R.linewise,Ue?te(u,Nt,Ft):x.forward&&j(u,Nt,Ft),$e="char";var Ec=!x.inclusive||Ue,rn=i(u,Nt,Ft);$t=or(u,{anchor:rn.start,head:rn.end},$e,Ec)}u.setSelections($t.ranges,$t.primary),m.lastMotion=null,R.repeat=xe,R.registerName=O,R.linewise=Ue;var Wo=Ut[k](u,R,$t.ranges,ie,X);m.visualMode&&Ye(u,Wo!=null),Wo&&u.setCursor(Wo)}},recordLastEdit:function(u,m,v){var b=Q.macroModeState;b.isPlaying||(u.lastEditInputState=m,u.lastEditActionCommand=v,b.lastInsertModeChanges.changes=[],b.lastInsertModeChanges.expectCursorActivityForChange=!1,b.lastInsertModeChanges.visualBlock=u.visualBlock?u.sel.head.line-u.sel.anchor.line:0)}},dn={moveToTopLine:function(u,m,v){var b=Ka(u).top+v.repeat-1;return new n(b,ve(u.getLine(b)))},moveToMiddleLine:function(u){var m=Ka(u),v=Math.floor((m.top+m.bottom)*.5);return new n(v,ve(u.getLine(v)))},moveToBottomLine:function(u,m,v){var b=Ka(u).bottom-v.repeat+1;return new n(b,ve(u.getLine(b)))},expandToLine:function(u,m,v){return new n(m.line+v.repeat-1,1/0)},findNext:function(u,m,v){var b=Kn(u),x=b.getQuery();if(x){var k=!v.forward;k=b.isReversed()?!k:k,Bo(u,x);var R=xi(u,k,x,v.repeat);return R||ct(u,"No match found "+x+(be("pcre")?" (set nopcre to use Vim regexps)":"")),R}},findAndSelectNextInclusive:function(u,m,v,b,x){var k=Kn(u),R=k.getQuery();if(R){var O=!v.forward;O=k.isReversed()?!O:O;var L=Sf(u,O,R,v.repeat,b);if(L){if(x.operator)return L;var z=L[0],q=new n(L[1].line,L[1].ch-1);if(b.visualMode){(b.visualLine||b.visualBlock)&&(b.visualLine=!1,b.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""}));var oe=b.sel.anchor;if(oe)return k.isReversed()?v.forward?[oe,z]:[oe,q]:v.forward?[oe,q]:[oe,z]}else b.visualMode=!0,b.visualLine=!1,b.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""});return O?[q,z]:[z,q]}}},goToMark:function(u,m,v,b){var x=Ho(u,b,v.selectedCharacter||"");return x?v.linewise?{line:x.line,ch:ve(u.getLine(x.line))}:x:null},moveToOtherHighlightedEnd:function(u,m,v,b){var x=b.sel;return b.visualBlock&&v.sameLine?[zt(u,new n(x.anchor.line,x.head.ch)),zt(u,new n(x.head.line,x.anchor.ch))]:[x.head,x.anchor]},jumpToMark:function(u,m,v,b){for(var x=m,k=0;k<v.repeat;k++){var R=x;for(var O in b.marks)if(N(O)){var L=b.marks[O].find();if(!(v.forward?xt(L,R):xt(R,L))&&!(v.linewise&&L.line==R.line)){var z=gt(R,x),q=v.forward?_r(R,L,x):_r(x,L,R);(z||q)&&(x=L)}}}return v.linewise&&(x=new n(x.line,ve(u.getLine(x.line)))),x},moveByCharacters:function(u,m,v){var b=m,x=v.repeat,k=v.forward?b.ch+x:b.ch-x;return new n(b.line,k)},moveByLines:function(u,m,v,b){var x=m,k=x.ch;switch(b.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:k=b.lastHPos;break;default:b.lastHPos=k}var R=v.repeat+(v.repeatOffset||0),O=v.forward?x.line+R:x.line-R,L=u.firstLine(),z=u.lastLine(),q=u.findPosV(x,v.forward?R:-R,"line",b.lastHSPos);return(v.forward?q.line>O:q.line<O)&&(O=q.line,k=q.ch),O<L&&x.line==L?this.moveToStartOfLine(u,m,v,b):O>z&&x.line==z?wn(u,m,v,b,!0):(v.toFirstChar&&(k=ve(u.getLine(O)),b.lastHPos=k),b.lastHSPos=u.charCoords(new n(O,k),"div").left,new n(O,k))},moveByDisplayLines:function(u,m,v,b){var x=m;switch(b.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:b.lastHSPos=u.charCoords(x,"div").left}var k=v.repeat,R=u.findPosV(x,v.forward?k:-k,"line",b.lastHSPos);if(R.hitSide)if(v.forward){var O={top:u.charCoords(R,"div").top+8,left:b.lastHSPos};R=u.coordsChar(O,"div")}else{var L=u.charCoords(new n(u.firstLine(),0),"div");L.left=b.lastHSPos,R=u.coordsChar(L,"div")}return b.lastHPos=R.ch,R},moveByPage:function(u,m,v){var b=m,x=v.repeat;return u.findPosV(b,v.forward?x:-x,"page")},moveByParagraph:function(u,m,v){var b=v.forward?1:-1;return Xt(u,m,v.repeat,b).start},moveBySentence:function(u,m,v){var b=v.forward?1:-1;return gc(u,m,v.repeat,b)},moveByScroll:function(u,m,v,b){var x=u.getScrollInfo(),k=null,R=v.repeat;R||(R=x.clientHeight/(2*u.defaultTextHeight()));var O=u.charCoords(m,"local");if(v.repeat=R,k=dn.moveByDisplayLines(u,m,v,b),!k)return null;var L=u.charCoords(k,"local");return u.scrollTo(null,x.top+L.top-O.top),k},moveByWords:function(u,m,v){return ut(u,m,v.repeat,!!v.forward,!!v.wordEnd,!!v.bigWord)},moveTillCharacter:function(u,m,v){var b=v.repeat,x=sr(u,b,v.forward,v.selectedCharacter,m),k=v.forward?-1:1;return ot(k,v),x?(x.ch+=k,x):null},moveToCharacter:function(u,m,v){var b=v.repeat;return ot(0,v),sr(u,b,v.forward,v.selectedCharacter,m)||m},moveToSymbol:function(u,m,v){var b=v.repeat;return v.selectedCharacter&&Lt(u,b,v.forward,v.selectedCharacter)||m},moveToColumn:function(u,m,v,b){var x=v.repeat;return b.lastHPos=x-1,b.lastHSPos=u.charCoords(m,"div").left,ii(u,x)},moveToEol:function(u,m,v,b){return wn(u,m,v,b,!1)},moveToFirstNonWhiteSpaceCharacter:function(u,m){var v=m;return new n(v.line,ve(u.getLine(v.line)))},moveToMatchedSymbol:function(u,m){for(var v=m,b=v.line,x=v.ch,k=u.getLine(b),R;x<k.length;x++)if(R=k.charAt(x),R&&K(R)){var O=u.getTokenTypeAt(new n(b,x+1));if(O!=="string"&&O!=="comment")break}if(x<k.length){var L=R==="<"||R===">"?/[(){}[\]<>]/:/[(){}[\]]/;return u.findMatchingBracket(new n(b,x),{bracketRegex:L}).to}else return v},moveToStartOfLine:function(u,m){return new n(m.line,0)},moveToLineOrEdgeOfDocument:function(u,m,v){var b=v.forward?u.lastLine():u.firstLine();return v.repeatIsExplicit&&(b=v.repeat-u.getOption("firstLineNumber")),new n(b,ve(u.getLine(b)))},moveToStartOfDisplayLine:function(u){return u.execCommand("goLineLeft"),u.getCursor()},moveToEndOfDisplayLine:function(u){u.execCommand("goLineRight");var m=u.getCursor();return m.sticky=="before"&&m.ch--,m},textObjectManipulation:function(u,m,v,b){var x={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},k={"'":!0,'"':!0,"`":!0},R=v.selectedCharacter||"";R=="b"?R="(":R=="B"&&(R="{");var O=!v.textObjectInner,L,z;if(x[R]){if(z=!0,L=ai(u,m,R,O),!L){var q=u.getSearchCursor(RegExp("\\"+R,"g"),m);q.find()&&(L=ai(u,q.from(),R,O))}}else if(k[R])z=!0,L=ia(u,m,R,O);else if(R==="W"||R==="w")for(var oe=v.repeat||1;oe-- >0;){var ie=Te(u,{inclusive:O,innerWord:!O,bigWord:R==="W",noSymbol:R==="W",multiline:!0},L&&L.end);ie&&(L||(L=ie),L.end=ie.end)}else if(R==="p")if(L=Xt(u,m,v.repeat,0,O),v.linewise=!0,b.visualMode)b.visualLine||(b.visualLine=!0);else{var X=b.inputState.operatorArgs;X&&(X.linewise=!0),L.end.line--}else if(R==="t")L=He(u,m,O);else if(R==="s"){var Y=u.getLine(m.line);m.ch>0&&W(Y[m.ch])&&--m.ch;var xe=zs(u,m,v.repeat,1,O),_e=zs(u,m,v.repeat,-1,O);A(u.getLine(_e.line)[_e.ch])&&A(u.getLine(xe.line)[xe.ch-1])&&(_e={line:_e.line,ch:_e.ch+1}),L={start:_e,end:xe}}return L?u.state.vim.visualMode?wi(u,L.start,L.end,z):[L.start,L.end]:null},repeatLastCharacterSearch:function(u,m,v){var b=Q.lastCharacterSearch,x=v.repeat,k=v.forward===b.forward,R=(b.increment?1:0)*(k?-1:1);u.moveH(-R,"char"),v.inclusive=!!k;var O=sr(u,x,k,b.selectedCharacter);return O?(O.ch+=R,O):(u.moveH(R,"char"),m)}};function ta(u,m){dn[u]=m}function gi(u,m){for(var v=[],b=0;b<m;b++)v.push(u);return v}var Ut={change:function(u,m,v){var b,x,k=u.state.vim,R=v[0].anchor,O=v[0].head;if(k.visualMode)if(m.fullLine)O.ch=Number.MAX_VALUE,O.line--,u.setSelection(R,O),x=u.getSelection(),u.replaceSelection(""),b=R;else{x=u.getSelection();var L=gi("",v.length);u.replaceSelections(L),b=kt(v[0].head,v[0].anchor)}else{x=u.getRange(R,O);var z=k.lastEditInputState;if((z==null?void 0:z.motion)=="moveByWords"&&!A(x)){var q=/\s+$/.exec(x);q&&z.motionArgs&&z.motionArgs.forward&&(O=_t(O,0,-q[0].length),x=x.slice(0,-q[0].length))}m.linewise&&(R=new n(R.line,ve(u.getLine(R.line))),O.line>R.line&&(O=new n(O.line-1,Number.MAX_VALUE))),u.replaceRange("",R,O),b=R}Q.registerController.pushText(m.registerName,"change",x,m.linewise,v.length>1),fn.enterInsertMode(u,{head:b},u.state.vim)},delete:function(u,m,v){var b,x,k=u.state.vim;if(k.visualBlock){x=u.getSelection();var R=gi("",v.length);u.replaceSelections(R),b=kt(v[0].head,v[0].anchor)}else{var O=v[0].anchor,L=v[0].head;m.linewise&&L.line!=u.firstLine()&&O.line==u.lastLine()&&O.line==L.line-1&&(O.line==u.firstLine()?O.ch=0:O=new n(O.line-1,St(u,O.line-1))),x=u.getRange(O,L),u.replaceRange("",O,L),b=O,m.linewise&&(b=dn.moveToFirstNonWhiteSpaceCharacter(u,O))}return Q.registerController.pushText(m.registerName,"delete",x,m.linewise,k.visualBlock),zt(u,b)},indent:function(u,m,v){var b=u.state.vim,x=b.visualMode&&m.repeat||1;if(b.visualBlock){for(var k=u.getOption("tabSize"),R=u.getOption("indentWithTabs")?" ":" ".repeat(k),O,L=v.length-1;L>=0;L--)if(O=kt(v[L].anchor,v[L].head),m.indentRight)u.replaceRange(R.repeat(x),O,O);else{for(var z=u.getLine(O.line),q=0,oe=0;oe<x;oe++){var ie=z[O.ch+q];if(ie==" ")q++;else if(ie==" "){q++;for(var X=1;X<R.length&&(ie=z[O.ch+q],ie===" ");X++)q++}else break}u.replaceRange("",O,_t(O,0,q))}return O}else if(u.indentMore)for(var oe=0;oe<x;oe++)m.indentRight?u.indentMore():u.indentLess();else{var Y=v[0].anchor.line,xe=b.visualBlock?v[v.length-1].anchor.line:v[0].head.line;m.linewise&&xe--;for(var L=Y;L<=xe;L++)for(var oe=0;oe<x;oe++)u.indentLine(L,m.indentRight)}return dn.moveToFirstNonWhiteSpaceCharacter(u,v[0].anchor)},indentAuto:function(u,m,v){return u.execCommand("indentAuto"),dn.moveToFirstNonWhiteSpaceCharacter(u,v[0].anchor)},hardWrap:function(u,m,v,b){if(u.hardWrap){var x=v[0].anchor.line,k=v[0].head.line;m.linewise&&k--;var R=u.hardWrap({from:x,to:k});return R>x&&m.linewise&&R--,m.keepCursor?b:new n(R,0)}},changeCase:function(u,m,v,b,x){for(var k=u.getSelections(),R=[],O=m.toLower,L=0;L<k.length;L++){var z=k[L],q="";if(O===!0)q=z.toLowerCase();else if(O===!1)q=z.toUpperCase();else for(var oe=0;oe<z.length;oe++){var ie=z.charAt(oe);q+=P(ie)?ie.toLowerCase():ie.toUpperCase()}R.push(q)}return u.replaceSelections(R),m.shouldMoveCursor?x:!u.state.vim.visualMode&&m.linewise&&v[0].anchor.line+1==v[0].head.line?dn.moveToFirstNonWhiteSpaceCharacter(u,b):m.linewise?b:kt(v[0].anchor,v[0].head)},yank:function(u,m,v,b){var x=u.state.vim,k=u.getSelection(),R=x.visualMode?kt(x.sel.anchor,x.sel.head,v[0].head,v[0].anchor):b;return Q.registerController.pushText(m.registerName,"yank",k,m.linewise,x.visualBlock),R},rot13:function(u,m,v,b,x){for(var k=u.getSelections(),R=[],O=0;O<k.length;O++){let L=k[O].split("").map(z=>{let q=z.charCodeAt(0);return q>=65&&q<=90?String.fromCharCode(65+(q-65+13)%26):q>=97&&q<=122?String.fromCharCode(97+(q-97+13)%26):z}).join("");R.push(L)}return u.replaceSelections(R),m.shouldMoveCursor?x:!u.state.vim.visualMode&&m.linewise&&v[0].anchor.line+1==v[0].head.line?dn.moveToFirstNonWhiteSpaceCharacter(u,b):m.linewise?b:kt(v[0].anchor,v[0].head)}};function yi(u,m){Ut[u]=m}var fn={jumpListWalk:function(u,m,v){if(!v.visualMode){var b=m.repeat||1,x=m.forward,k=Q.jumpList.move(u,x?b:-b),R=k?k.find():void 0;R||(R=u.getCursor()),u.setCursor(R)}},scroll:function(u,m,v){if(!v.visualMode){var b=m.repeat||1,x=u.defaultTextHeight(),k=u.getScrollInfo().top,R=x*b,O=m.forward?k+R:k-R,L=Ge(u.getCursor()),z=u.charCoords(L,"local");if(m.forward)O>z.top?(L.line+=(O-z.top)/x,L.line=Math.ceil(L.line),u.setCursor(L),z=u.charCoords(L,"local"),u.scrollTo(null,z.top)):u.scrollTo(null,O);else{var q=O+u.getScrollInfo().clientHeight;q<z.bottom?(L.line-=(z.bottom-q)/x,L.line=Math.floor(L.line),u.setCursor(L),z=u.charCoords(L,"local"),u.scrollTo(null,z.bottom-u.getScrollInfo().clientHeight)):u.scrollTo(null,O)}}},scrollToCursor:function(u,m){var v=u.getCursor().line,b=u.charCoords(new n(v,0),"local"),x=u.getScrollInfo().clientHeight,k=b.top;switch(m.position){case"center":k=b.bottom-x/2;break;case"bottom":var R=new n(v,u.getLine(v).length-1),O=u.charCoords(R,"local").bottom-k;k=k-x+O;break}u.scrollTo(null,k)},replayMacro:function(u,m,v){var b=m.selectedCharacter||"",x=m.repeat||1,k=Q.macroModeState;for(b=="@"?b=k.latestRegister||"":k.latestRegister=b;x--;)Qa(u,v,k,b)},enterMacroRecordMode:function(u,m){var v=Q.macroModeState,b=m.selectedCharacter;Q.registerController.isValidRegister(b)&&v.enterMacroRecordMode(u,b)},toggleOverwrite:function(u){u.state.overwrite?(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})):(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(u,m,v){if(!u.getOption("readOnly")){v.insertMode=!0,v.insertModeRepeat=m&&m.repeat||1;var b=m?m.insertAt:null,x=v.sel,k=m.head||u.getCursor("head"),R=u.listSelections().length;if(b=="eol")k=new n(k.line,St(u,k.line));else if(b=="bol")k=new n(k.line,0);else if(b=="charAfter"){var O=i(u,k,_t(k,0,1));k=O.end}else if(b=="firstNonBlank"){var O=i(u,k,dn.moveToFirstNonWhiteSpaceCharacter(u,k));k=O.end}else if(b=="startOfSelectedArea"){if(!v.visualMode)return;v.visualBlock?(k=new n(Math.min(x.head.line,x.anchor.line),Math.min(x.head.ch,x.anchor.ch)),R=Math.abs(x.head.line-x.anchor.line)+1):k=x.head.line<x.anchor.line?x.head:new n(x.anchor.line,0)}else if(b=="endOfSelectedArea"){if(!v.visualMode)return;v.visualBlock?(k=new n(Math.min(x.head.line,x.anchor.line),Math.max(x.head.ch,x.anchor.ch)+1),R=Math.abs(x.head.line-x.anchor.line)+1):k=x.head.line>=x.anchor.line?_t(x.head,0,1):new n(x.anchor.line,0)}else if(b=="inplace"){if(v.visualMode)return}else b=="lastEdit"&&(k=xc(u)||k);u.setOption("disableInput",!1),m&&m.replace?(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"})):(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})),Q.macroModeState.isPlaying||(u.on("change",Wr),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=u.setBookmark(k,{insertLeft:!0}),e.on(u.getInputField(),"keydown",Ws)),v.visualMode&&Ye(u),ar(u,k,R)}},toggleVisualMode:function(u,m,v){var b=m.repeat,x=u.getCursor(),k;if(v.visualMode)v.visualLine!=!!m.linewise||v.visualBlock!=!!m.blockwise?(v.visualLine=!!m.linewise,v.visualBlock=!!m.blockwise,e.signal(u,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""}),Fn(u)):Ye(u);else{v.visualMode=!0,v.visualLine=!!m.linewise,v.visualBlock=!!m.blockwise,k=zt(u,new n(x.line,x.ch+b-1));var R=i(u,x,k);v.sel={anchor:R.start,head:R.end},e.signal(u,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""}),Fn(u),Bn(u,v,"<",kt(x,k)),Bn(u,v,">",zn(x,k))}},reselectLastSelection:function(u,m,v){var b=v.lastSelection;if(v.visualMode&&Ln(u,v),b){var x=b.anchorMark.find(),k=b.headMark.find();if(!x||!k)return;v.sel={anchor:x,head:k},v.visualMode=!0,v.visualLine=b.visualLine,v.visualBlock=b.visualBlock,Fn(u),Bn(u,v,"<",kt(x,k)),Bn(u,v,">",zn(x,k)),e.signal(u,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""})}},joinLines:function(u,m,v){var b,x;if(v.visualMode){if(b=u.getCursor("anchor"),x=u.getCursor("head"),xt(x,b)){var k=x;x=b,b=k}x.ch=St(u,x.line)-1}else{var R=Math.max(m.repeat,2);b=u.getCursor(),x=zt(u,new n(b.line+R-1,1/0))}for(var O=0,L=b.line;L<x.line;L++){O=St(u,b.line);var z="",q=0;if(!m.keepSpaces){var oe=u.getLine(b.line+1);q=oe.search(/\S/),q==-1?q=oe.length:z=" "}u.replaceRange(z,new n(b.line,O),new n(b.line+1,q))}var ie=zt(u,new n(b.line,O));v.visualMode&&Ye(u,!1),u.setCursor(ie)},newLineAndEnterInsertMode:function(u,m,v){v.insertMode=!0;var b=Ge(u.getCursor());b.line===u.firstLine()&&!m.after?(u.replaceRange(`
96
96
  `,new n(u.firstLine(),0)),u.setCursor(u.firstLine(),0)):(b.line=m.after?b.line:b.line-1,b.ch=St(u,b.line),u.setCursor(b),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(u)),this.enterInsertMode(u,{repeat:m.repeat},v)},paste:function(u,m,v){var b=Q.registerController.getRegister(m.registerName);if(m.registerName==="+")navigator.clipboard.readText().then(k=>{this.continuePaste(u,m,v,k,b)});else{var x=b.toString();this.continuePaste(u,m,v,x,b)}},continuePaste:function(u,m,v,b,x){var k=Ge(u.getCursor());if(b){if(m.matchIndent){var R=u.getOption("tabSize"),O=function($t){var rn=$t.split(" ").length-1,pn=$t.split(" ").length-1;return rn*R+pn*1},L=O(u.getLine(u.getCursor().line).match(/^\s*/)[0]),z=b.replace(/\n$/,""),q=b!==z,oe=O(b.match(/^\s*/)[0]),b=z.replace(/^\s*/gm,function($t){var rn=L+(O($t)-oe);if(rn<0)return"";if(u.getOption("indentWithTabs")){var pn=Math.floor(rn/R);return Array(pn+1).join(" ")}else return Array(rn+1).join(" ")});b+=q?`
97
97
  `:""}m.repeat>1&&(b=Array(m.repeat+1).join(b));var ie=x.linewise,X=x.blockwise,Y=X?b.split(`
98
98
  `):void 0;if(Y){ie&&Y.pop();for(var xe=0;xe<Y.length;xe++)Y[xe]=Y[xe]==""?" ":Y[xe];k.ch+=m.after?1:0,k.ch=Math.min(St(u,k.line),k.ch)}else ie?v.visualMode?b=v.visualLine?b.slice(0,-1):`
99
99
  `+b.slice(0,b.length-1)+`
100
100
  `:m.after?(b=`
101
101
  `+b.slice(0,b.length-1),k.ch=St(u,k.line)):k.ch=0:k.ch+=m.after?1:0;var _e;if(v.visualMode){v.lastPastedText=b;var qe,Re=ri(u),Ne=Re[0],dt=Re[1],Je=u.getSelection(),Nt=u.listSelections(),Ft=Array(Nt.length).join("1").split("1");v.lastSelection&&(qe=v.lastSelection.headMark.find()),Q.registerController.unnamedRegister.setText(Je),X?(u.replaceSelections(Ft),dt=new n(Ne.line+b.length-1,Ne.ch),u.setCursor(Ne),bn(u,dt),u.replaceSelections(b),_e=Ne):v.visualBlock?(u.replaceSelections(Ft),u.setCursor(Ne),u.replaceRange(b,Ne,Ne),_e=Ne):(u.replaceRange(b,Ne,dt),_e=u.posFromIndex(u.indexFromPos(Ne)+b.length-1)),qe&&(v.lastSelection.headMark=u.setBookmark(qe)),ie&&(_e.ch=0)}else if(X&&Y){u.setCursor(k);for(var xe=0;xe<Y.length;xe++){var Ue=k.line+xe;Ue>u.lastLine()&&u.replaceRange(`
102
- `,new n(Ue,0)),St(u,Ue)<k.ch&&Hr(u,Ue,k.ch)}u.setCursor(k),bn(u,new n(k.line+Y.length-1,k.ch)),u.replaceSelections(Y),_e=k}else if(u.replaceRange(b,k),ie){var Ue=m.after?k.line+1:k.line;_e=new n(Ue,ve(u.getLine(Ue)))}else _e=Ge(k),/\n/.test(b)||(_e.ch+=b.length-(m.after?1:0));v.visualMode&&Ye(u,!1),u.setCursor(_e)}},undo:function(u,m){u.operation(function(){Jt(u,e.commands.undo,m.repeat)(),u.setCursor(zt(u,u.getCursor("start")))})},redo:function(u,m){Jt(u,e.commands.redo,m.repeat)()},setRegister:function(u,m,v){v.inputState.registerName=m.selectedCharacter},insertRegister:function(u,m,v){var b=m.selectedCharacter,x=Q.registerController.getRegister(b),k=x&&x.toString();k&&u.replaceSelection(k)},oneNormalCommand:function(u,m,v){Hn(u,!0),v.insertModeReturn=!0,e.on(u,"vim-command-done",function b(){v.visualMode||(v.insertModeReturn&&(v.insertModeReturn=!1,v.insertMode||fn.enterInsertMode(u,{},v)),e.off(u,"vim-command-done",b))})},setMark:function(u,m,v){var b=m.selectedCharacter;b&&Fn(u,v,b,u.getCursor())},replace:function(u,m,v){var b=m.selectedCharacter||"",x=u.getCursor(),k,R,O=u.listSelections();if(v.visualMode)x=u.getCursor("start"),R=u.getCursor("end");else{var L=u.getLine(x.line);k=x.ch+m.repeat,k>L.length&&(k=L.length),R=new n(x.line,k)}var z=i(u,x,R);if(x=z.start,R=z.end,b==`
102
+ `,new n(Ue,0)),St(u,Ue)<k.ch&&Hr(u,Ue,k.ch)}u.setCursor(k),bn(u,new n(k.line+Y.length-1,k.ch)),u.replaceSelections(Y),_e=k}else if(u.replaceRange(b,k),ie){var Ue=m.after?k.line+1:k.line;_e=new n(Ue,ve(u.getLine(Ue)))}else _e=Ge(k),/\n/.test(b)||(_e.ch+=b.length-(m.after?1:0));v.visualMode&&Ye(u,!1),u.setCursor(_e)}},undo:function(u,m){u.operation(function(){Jt(u,e.commands.undo,m.repeat)(),u.setCursor(zt(u,u.getCursor("start")))})},redo:function(u,m){Jt(u,e.commands.redo,m.repeat)()},setRegister:function(u,m,v){v.inputState.registerName=m.selectedCharacter},insertRegister:function(u,m,v){var b=m.selectedCharacter,x=Q.registerController.getRegister(b),k=x&&x.toString();k&&u.replaceSelection(k)},oneNormalCommand:function(u,m,v){Vn(u,!0),v.insertModeReturn=!0,e.on(u,"vim-command-done",function b(){v.visualMode||(v.insertModeReturn&&(v.insertModeReturn=!1,v.insertMode||fn.enterInsertMode(u,{},v)),e.off(u,"vim-command-done",b))})},setMark:function(u,m,v){var b=m.selectedCharacter;b&&Bn(u,v,b,u.getCursor())},replace:function(u,m,v){var b=m.selectedCharacter||"",x=u.getCursor(),k,R,O=u.listSelections();if(v.visualMode)x=u.getCursor("start"),R=u.getCursor("end");else{var L=u.getLine(x.line);k=x.ch+m.repeat,k>L.length&&(k=L.length),R=new n(x.line,k)}var z=i(u,x,R);if(x=z.start,R=z.end,b==`
103
103
  `)v.visualMode||u.replaceRange("",x,R),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(u);else{var q=u.getRange(x,R);if(q=q.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b),q=q.replace(/[^\n]/g,b),v.visualBlock){var oe=Array(u.getOption("tabSize")+1).join(" ");q=u.getSelection(),q=q.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b);var ie=q.replace(/\t/g,oe).replace(/[^\n]/g,b).split(`
104
- `);u.replaceSelections(ie)}else u.replaceRange(q,x,R);v.visualMode?(x=xt(O[0].anchor,O[0].head)?O[0].anchor:O[0].head,u.setCursor(x),Ye(u,!1)):u.setCursor(_t(R,0,-1))}},incrementNumberToken:function(u,m){for(var v=u.getCursor(),b=u.getLine(v.line),x=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,k,R,O,L;(k=x.exec(b))!==null&&(R=k.index,O=R+k[0].length,!(v.ch<O)););if(!(!m.backtrack&&O<=v.ch)){if(k){var z=k[2]||k[4],q=k[3]||k[5],oe=m.increase?1:-1,ie={"0b":2,0:8,"":10,"0x":16}[z.toLowerCase()];L=(parseInt(k[1]+q,ie)+oe*m.repeat).toString(ie);var X=z?Array(q.length-L.length+1+k[1].length).join("0"):"";L=L.charAt(0)==="-"?"-"+z+X+L.substr(1):z+X+L;var Y=new n(v.line,R),xe=new n(v.line,O);u.replaceRange(L,Y,xe)}else return;u.setCursor(new n(v.line,R+L.length-1))}},repeatLastEdit:function(u,m,v){var b=v.lastEditInputState;if(b){var x=m.repeat;x&&m.repeatIsExplicit?b.repeatOverride=x:x=b.repeatOverride||x,Xa(u,v,x,!1)}},indent:function(u,m){u.indentLine(u.getCursor().line,m.indentRight)},exitInsertMode:function(u,m){Hn(u)}};function ni(u,m){fn[u]=m}function zt(u,m,v){var b=u.state.vim,x=b.insertMode||b.visualMode,k=Math.min(Math.max(u.firstLine(),m.line),u.lastLine()),R=u.getLine(k),O=R.length-1+ +!!x,L=Math.min(Math.max(0,m.ch),O),z=R.charCodeAt(L);if(56320<=z&&z<=57343){var q=1;v&&v.line==k&&v.ch>L&&(q=-1),L+=q,L>O&&(L-=2)}return new n(k,L)}function Br(u){var m={};for(var v in u)Object.prototype.hasOwnProperty.call(u,v)&&(m[v]=u[v]);return m}function _t(u,m,v){return typeof m=="object"&&(v=m.ch,m=m.line),new n(u.line+m,u.ch+v)}function vi(u,m,v,b){b.operator&&(v="operatorPending");for(var x,k=[],R=[],O=Pe?m.length-c:0;O<m.length;O++){var L=m[O];v=="insert"&&L.context!="insert"||L.context&&L.context!=v||b.operator&&L.type=="action"||!(x=na(u,L.keys))||(x=="partial"&&k.push(L),x=="full"&&R.push(L))}return{partial:k,full:R}}function na(u,m){let v=m.slice(-11)=="<character>",b=m.slice(-10)=="<register>";if(v||b){var x=m.length-(v?11:10),k=u.slice(0,x),R=m.slice(0,x);return k==R&&u.length>x?"full":R.indexOf(k)==0?"partial":!1}else return u==m?"full":m.indexOf(u)==0?"partial":!1}function wr(u){var m=/^.*(<[^>]+>)$/.exec(u),v=m?m[1]:u.slice(-1);if(v.length>1)switch(v){case"<CR>":case"<S-CR>":v=`
105
- `;break;case"<Space>":case"<S-Space>":v=" ";break;default:v="";break}return v}function Jt(u,m,v){return function(){for(var b=0;b<v;b++)m(u)}}function Ge(u){return new n(u.line,u.ch)}function gt(u,m){return u.ch==m.ch&&u.line==m.line}function xt(u,m){return u.line<m.line||u.line==m.line&&u.ch<m.ch}function kt(u,m){return arguments.length>2&&(m=kt.apply(void 0,Array.prototype.slice.call(arguments,1))),xt(u,m)?u:m}function jn(u,m){return arguments.length>2&&(m=jn.apply(void 0,Array.prototype.slice.call(arguments,1))),xt(u,m)?m:u}function _r(u,m,v){var b=xt(u,m),x=xt(m,v);return b&&x}function St(u,m){return u.getLine(m).length}function ir(u){return u.trim?u.trim():u.replace(/^\s+|\s+$/g,"")}function Mn(u){return u.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Hr(u,m,v){var b=St(u,m),x=Array(v-b+1).join(" ");u.setCursor(new n(m,b)),u.replaceRange(x,u.getCursor())}function bn(u,m){var v=[],b=u.listSelections(),x=Ge(u.clipPos(m)),k=!gt(m,x),R=bi(b,u.getCursor("head")),O=gt(b[R].head,b[R].anchor),L=b.length-1,z=L-R>R?L:0,q=b[z].anchor,oe=Math.min(q.line,x.line),ie=Math.max(q.line,x.line),X=q.ch,Y=x.ch,xe=b[z].head.ch-X,_e=Y-X;xe>0&&_e<=0?(X++,k||Y--):xe<0&&_e>=0?(X--,O||Y++):xe<0&&_e==-1&&(X--,Y++);for(var qe=oe;qe<=ie;qe++){var Re={anchor:new n(qe,X),head:new n(qe,Y)};v.push(Re)}return u.setSelections(v),m.ch=Y,q.ch=X,q}function ar(u,m,v){for(var b=[],x=0;x<v;x++){var k=_t(m,x,0);b.push({anchor:k,head:k})}u.setSelections(b,0)}function bi(u,m,v){for(var b=0;b<u.length;b++){var x=gt(u[b].anchor,m),k=gt(u[b].head,m);if(x||k)return b}return-1}function ri(u,m){var v=u.listSelections(),b=v[0],x=v[v.length-1];return[xt(b.anchor,b.head)?b.anchor:b.head,xt(x.anchor,x.head)?x.head:x.anchor]}function Ln(u,m){var v=m.sel.anchor,b=m.sel.head;m.lastPastedText&&(m.lastPastedText=(b=u.posFromIndex(u.indexFromPos(v)+m.lastPastedText.length),void 0)),m.lastSelection={anchorMark:u.setBookmark(v),headMark:u.setBookmark(b),anchor:Ge(v),head:Ge(b),visualMode:m.visualMode,visualLine:m.visualLine,visualBlock:m.visualBlock}}function wi(u,m,v,b){var x=u.state.vim.sel,k=b?m:x.head,R=b?m:x.anchor,O;return xt(v,m)&&(O=v,v=m,m=O),xt(k,R)?(k=kt(m,k),R=jn(R,v)):(R=kt(m,R),k=jn(k,v),k=_t(k,0,-1),k.ch==-1&&k.line!=u.firstLine()&&(k=new n(k.line-1,St(u,k.line-1)))),[R,k]}function zn(u,m,v){var b=u.state.vim;m||(m=b.sel),v||(v=b.visualLine?"line":b.visualBlock?"block":"char");var x=or(u,m,v);u.setSelections(x.ranges,x.primary)}function or(u,m,v,b){var x=Ge(m.head),k=Ge(m.anchor);if(v=="char"){var R=!b&&!xt(m.head,m.anchor)?1:0,O=xt(m.head,m.anchor)?1:0;return x=_t(m.head,0,R),k=_t(m.anchor,0,O),{ranges:[{anchor:k,head:x}],primary:0}}else if(v=="line"){if(xt(m.head,m.anchor))x.ch=0,k.ch=St(u,k.line);else{k.ch=0;var L=u.lastLine();x.line>L&&(x.line=L),x.ch=St(u,x.line)}return{ranges:[{anchor:k,head:x}],primary:0}}else if(v=="block"){var z=Math.min(k.line,x.line),q=k.ch,oe=Math.max(k.line,x.line),ie=x.ch;q<ie?ie+=1:q+=1;for(var X=oe-z+1,Y=x.line==z?0:X-1,xe=[],_e=0;_e<X;_e++)xe.push({anchor:new n(z+_e,q),head:new n(z+_e,ie)});return{ranges:xe,primary:Y}}throw"never happens"}function M(u){var m=u.getCursor("head");return u.getSelection().length==1&&(m=kt(m,u.getCursor("anchor"))),m}function Ye(u,m){var v=u.state.vim;m!==!1&&u.setCursor(zt(u,v.sel.head)),Ln(u,v),v.visualMode=!1,v.visualLine=!1,v.visualBlock=!1,v.insertMode||e.signal(u,"vim-mode-change",{mode:"normal"})}function j(u,m,v){var b=u.getRange(m,v);if(/\n\s*$/.test(b)){var x=b.split(`
106
- `);x.pop();for(var k=x.pop();x.length>0&&k&&A(k);k=x.pop())v.line--,v.ch=0;k?(v.line--,v.ch=St(u,v.line)):v.ch=0}}function te(u,m,v){m.ch=0,v.ch=0,v.line++}function ve(u){if(!u)return 0;var m=u.search(/\S/);return m==-1?u.length:m}function Te(u,{inclusive:m,innerWord:v,bigWord:b,noSymbol:x,multiline:k},R){var O=R||M(u),L=u.getLine(O.line),z=L,q=O.line,oe=q,ie=O.ch,X,Y=x?C[0]:E[0];if(v&&/\s/.test(L.charAt(ie)))Y=function(dt){return/\s/.test(dt)};else{for(;!Y(L.charAt(ie));)if(ie++,ie>=L.length){if(!k)return null;ie--,X=rt(u,O,!0,b,!0);break}b?Y=E[0]:(Y=C[0],Y(L.charAt(ie))||(Y=C[1]))}for(var xe=ie,_e=ie;Y(L.charAt(_e))&&_e>=0;)_e--;if(_e++,X)xe=X.to,oe=X.line,z=u.getLine(oe),!z&&xe==0&&xe++;else for(;Y(L.charAt(xe))&&xe<L.length;)xe++;if(m){var qe=xe,Re=O.ch<=_e&&/\s/.test(L.charAt(O.ch));if(!Re)for(;/\s/.test(z.charAt(xe))&&xe<z.length;)xe++;if(qe==xe||Re){for(var Ne=_e;/\s/.test(L.charAt(_e-1))&&_e>0;)_e--;!_e&&!Re&&(_e=Ne)}}return{start:new n(q,_e),end:new n(oe,xe)}}function He(u,m,v){var b=m;if(!e.findMatchingTag||!e.findEnclosingTag)return{start:b,end:b};var x=e.findMatchingTag(u,m)||e.findEnclosingTag(u,m);return!x||!x.open||!x.close?{start:b,end:b}:v?{start:x.open.from,end:x.close.to}:{start:x.open.to,end:x.close.from}}function Ve(u,m,v){gt(m,v)||Q.jumpList.add(u,m,v)}function ot(u,m){Q.lastCharacterSearch.increment=u,Q.lastCharacterSearch.forward=m.forward,Q.lastCharacterSearch.selectedCharacter=m.selectedCharacter}var Mt={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},Ze={bracket:{isComplete:function(u){if(u.nextCh===u.symb){if(u.depth++,u.depth>=1)return!0}else u.nextCh===u.reverseSymb&&u.depth--;return!1}},section:{init:function(u){u.curMoveThrough=!0,u.symb=(u.forward?"]":"[")===u.symb?"{":"}"},isComplete:function(u){return u.index===0&&u.nextCh===u.symb}},comment:{isComplete:function(u){var m=u.lastCh==="*"&&u.nextCh==="/";return u.lastCh=u.nextCh,m}},method:{init:function(u){u.symb=u.symb==="m"?"{":"}",u.reverseSymb=u.symb==="{"?"}":"{"},isComplete:function(u){return u.nextCh===u.symb}},preprocess:{init:function(u){u.index=0},isComplete:function(u){var v;if(u.nextCh==="#"){var m=(v=u.lineText.match(/^#(\w+)/))==null?void 0:v[1];if(m==="endif"){if(u.forward&&u.depth===0)return!0;u.depth++}else if(m==="if"){if(!u.forward&&u.depth===0)return!0;u.depth--}if(m==="else"&&u.depth===0)return!0}return!1}}};function Lt(u,m,v,b){var x=Ge(u.getCursor()),k=v?1:-1,R=v?u.lineCount():-1,O=x.ch,L=x.line,z=u.getLine(L),q={lineText:z,nextCh:z.charAt(O),lastCh:null,index:O,symb:b,reverseSymb:(v?{")":"(","}":"{"}:{"(":")","{":"}"})[b],forward:v,depth:0,curMoveThrough:!1},oe=Mt[b];if(!oe)return x;var ie=Ze[oe].init,X=Ze[oe].isComplete;for(ie&&ie(q);L!==R&&m;){if(q.index+=k,q.nextCh=q.lineText.charAt(q.index),!q.nextCh){if(L+=k,q.lineText=u.getLine(L)||"",k>0)q.index=0;else{var Y=q.lineText.length;q.index=Y>0?Y-1:0}q.nextCh=q.lineText.charAt(q.index)}X(q)&&(x.line=L,x.ch=q.index,m--)}return q.nextCh||q.curMoveThrough?new n(L,q.index):x}function rt(u,m,v,b,x){var k=m.line,R=m.ch,O=u.getLine(k),L=v?1:-1,z=b?E:C;if(x&&O==""){if(k+=L,O=u.getLine(k),!F(u,k))return null;R=v?0:O.length}for(;;){if(x&&O=="")return{from:0,to:0,line:k};for(var q=L>0?O.length:-1,oe=q,ie=q;R!=q;){for(var X=!1,Y=0;Y<z.length&&!X;++Y)if(z[Y](O.charAt(R))){for(oe=R;R!=q&&z[Y](O.charAt(R));)R+=L;if(ie=R,X=oe!=ie,oe==m.ch&&k==m.line&&ie==oe+L)continue;return{from:Math.min(oe,ie+1),to:Math.max(oe,ie),line:k}}X||(R+=L)}if(k+=L,!F(u,k))return null;O=u.getLine(k),R=L>0?0:O.length}}function ut(u,m,v,b,x,k){var R=Ge(m),O=[];(b&&!x||!b&&x)&&v++;for(var L=!(b&&x),z=0;z<v;z++){var q=rt(u,m,b,k,L);if(!q){var oe=St(u,u.lastLine());O.push(b?{line:u.lastLine(),from:oe,to:oe}:{line:0,from:0,to:0});break}O.push(q),m=new n(q.line,b?q.to-1:q.from)}var ie=O.length!=v,X=O[0],Y=O.pop();return b&&!x?(!ie&&(X.from!=R.ch||X.line!=R.line)&&(Y=O.pop()),Y&&new n(Y.line,Y.from)):b&&x?Y&&new n(Y.line,Y.to-1):!b&&x?(!ie&&(X.to!=R.ch||X.line!=R.line)&&(Y=O.pop()),Y&&new n(Y.line,Y.to)):Y&&new n(Y.line,Y.from)}function wn(u,m,v,b,x){var k=new n(m.line+v.repeat-1,1/0),R=u.clipPos(k);return R.ch--,x||(b.lastHPos=1/0,b.lastHSPos=u.charCoords(R,"div").left),k}function sr(u,m,v,b,x){if(b){for(var k=x||u.getCursor(),R=k.ch,O,L=0;L<m;L++){var z=u.getLine(k.line);if(O=ra(R,z,b,v),O==-1)return;R=O}if(O!=null)return new n(u.getCursor().line,O)}}function ii(u,m){var v=u.getCursor().line;return zt(u,new n(v,m-1))}function Fn(u,m,v,b){!de(v,T)&&!$.test(v)||(m.marks[v]&&m.marks[v].clear(),m.marks[v]=u.setBookmark(b))}function ra(u,m,v,b,x){return b?m.indexOf(v,u+1):m.lastIndexOf(v,u-1)}function Xt(u,m,v,b,x){var k=m.line,R=u.firstLine(),O=u.lastLine(),L,z,q=k;function oe(_e){return!u.getLine(_e)}function ie(_e,qe,Re){return Re?oe(_e)!=oe(_e+qe):!oe(_e)&&oe(_e+qe)}if(b){for(;R<=q&&q<=O&&v>0;)ie(q,b)&&v--,q+=b;return{start:new n(q,0),end:m}}var X=u.state.vim;if(X.visualLine&&ie(k,1,!0)){var Y=X.sel.anchor;ie(Y.line,-1,!0)&&(!x||Y.line!=k)&&(k+=1)}var xe=oe(k);for(q=k;q<=O&&v;q++)ie(q,1,!0)&&(!x||oe(q)!=xe)&&v--;for(z=new n(q,0),q>O&&!xe?xe=!0:x=!1,q=k;q>R&&!((!x||oe(q)==xe||q==k)&&ie(q,-1,!0));q--);return L=new n(q,0),{start:L,end:z}}function Fs(u,m,v,b,x){function k(z){z.line!==null&&(z.pos+z.dir<0||z.pos+z.dir>=z.line.length?z.line=null:z.pos+=z.dir)}function R(z,q,oe,ie){var X={line:z.getLine(q),ln:q,pos:oe,dir:ie};if(X.line==="")return{ln:X.ln,pos:X.pos};var Y=X.pos;for(k(X);X.line!==null;){if(Y=X.pos,W(X.line[X.pos]))if(x){for(k(X);X.line!==null&&A(X.line[X.pos]);)Y=X.pos,k(X);return{ln:X.ln,pos:Y+1}}else return{ln:X.ln,pos:X.pos+1};k(X)}return{ln:X.ln,pos:Y+1}}function O(z,q,oe,ie){var X=z.getLine(q),Y={line:X,ln:q,pos:oe,dir:ie};if(Y.line==="")return{ln:Y.ln,pos:Y.pos};var xe=Y.pos;for(k(Y);Y.line!==null;){if(!A(Y.line[Y.pos])&&!W(Y.line[Y.pos]))xe=Y.pos;else if(W(Y.line[Y.pos]))return x&&A(Y.line[Y.pos+1])?{ln:Y.ln,pos:Y.pos+1}:{ln:Y.ln,pos:xe};k(Y)}return Y.line=X,x&&A(Y.line[Y.pos])?{ln:Y.ln,pos:Y.pos}:{ln:Y.ln,pos:xe}}for(var L={ln:m.line,pos:m.ch};v>0;)L=b<0?O(u,L.ln,L.pos,b):R(u,L.ln,L.pos,b),v--;return new n(L.ln,L.pos)}function gc(u,m,v,b){function x(L,z){if(z.line!==null)if(z.pos+z.dir<0||z.pos+z.dir>=z.line.length){if(z.ln+=z.dir,!F(L,z.ln)){z.line=null;return}z.line=L.getLine(z.ln),z.pos=z.dir>0?0:z.line.length-1}else z.pos+=z.dir}function k(L,z,q,oe){var _e=L.getLine(z),ie=_e==="",X={line:_e,ln:z,pos:q,dir:oe},Y={ln:X.ln,pos:X.pos},xe=X.line==="";for(x(L,X);X.line!==null;){if(Y.ln=X.ln,Y.pos=X.pos,X.line===""&&!xe||ie&&X.line!==""&&!A(X.line[X.pos]))return{ln:X.ln,pos:X.pos};W(X.line[X.pos])&&!ie&&(X.pos===X.line.length-1||A(X.line[X.pos+1]))&&(ie=!0),x(L,X)}var _e=L.getLine(Y.ln);Y.pos=0;for(var qe=_e.length-1;qe>=0;--qe)if(!A(_e[qe])){Y.pos=qe;break}return Y}function R(L,z,q,oe){var _e=L.getLine(z),ie={line:_e,ln:z,pos:q,dir:oe},X=ie.ln,Y=null,xe=ie.line==="";for(x(L,ie);ie.line!==null;){if(ie.line===""&&!xe)return Y===null?{ln:ie.ln,pos:ie.pos}:{ln:X,pos:Y};if(W(ie.line[ie.pos])&&Y!==null&&!(ie.ln===X&&ie.pos+1===Y))return{ln:X,pos:Y};ie.line!==""&&!A(ie.line[ie.pos])&&(xe=!1,X=ie.ln,Y=ie.pos),x(L,ie)}var _e=L.getLine(X);Y=0;for(var qe=0;qe<_e.length;++qe)if(!A(_e[qe])){Y=qe;break}return{ln:X,pos:Y}}for(var O={ln:m.line,pos:m.ch};v>0;)O=b<0?R(u,O.ln,O.pos,b):k(u,O.ln,O.pos,b),v--;return new n(O.ln,O.pos)}function ai(u,m,v,b){var x=m,k={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[v],R={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[v],O=u.getLine(x.line).charAt(x.ch)===R?1:0,L=u.scanForBracket(new n(x.line,x.ch+O),-1,void 0,{bracketRegex:k}),z=u.scanForBracket(new n(x.line,x.ch+O),1,void 0,{bracketRegex:k});if(!L||!z)return null;var q=L.pos,oe=z.pos;if(q.line==oe.line&&q.ch>oe.ch||q.line>oe.line){var ie=q;q=oe,oe=ie}return b?oe.ch+=1:q.ch+=1,{start:q,end:oe}}function ia(u,m,v,b){var x=Ge(m),k=u.getLine(x.line).split(""),R,O,L,z,q=k.indexOf(v);if(x.ch<q)x.ch=q;else if(q<x.ch&&k[x.ch]==v){var oe=/string/.test(u.getTokenTypeAt(_t(m,0,1))),ie=/string/.test(u.getTokenTypeAt(m));oe&&!ie||(O=x.ch,--x.ch)}if(k[x.ch]==v&&!O)R=x.ch+1;else for(L=x.ch;L>-1&&!R;L--)k[L]==v&&(R=L+1);if(R&&!O)for(L=R,z=k.length;L<z&&!O;L++)k[L]==v&&(O=L);return!R||!O?{start:x,end:x}:(b&&(--R,++O),{start:new n(x.line,R),end:new n(x.line,O)})}we("pcre",!0,"boolean");class xf{constructor(){this.highlightTimeout}getQuery(){return Q.query}setQuery(m){Q.query=m}getOverlay(){return this.searchOverlay}setOverlay(m){this.searchOverlay=m}isReversed(){return Q.isReversed}setReversed(m){Q.isReversed=m}getScrollbarAnnotate(){return this.annotate}setScrollbarAnnotate(m){this.annotate=m}}function Kn(u){var m=u.state.vim;return m.searchState_||(m.searchState_=new xf)}function yc(u){return Wa(u,"/")}function kf(u){return Ua(u,"/")}function Wa(u,m){var v=Ua(u,m)||[];if(!v.length)return[];var b=[];if(v[0]===0){for(var x=0;x<v.length;x++)typeof v[x]=="number"&&b.push(u.substring(v[x]+1,v[x+1]));return b}}function Ua(u,m){m||(m="/");for(var v=!1,b=[],x=0;x<u.length;x++){var k=u.charAt(x);!v&&k==m&&b.push(x),v=!v&&k=="\\"}return b}function Vr(u){var m={V:"|(){+?*.[$^",M:"|(){+?*.[",m:"|(){+?",v:"<>"},v={">":"(?<=[\\w])(?=[^\\w]|$)","<":"(?<=[^\\w]|^)(?=[\\w])"},b=m.m,x=u.replace(/\\.|[\[|(){+*?.$^<>]/g,function(R){if(R[0]==="\\"){var O=R[1];return O==="}"||b.indexOf(O)!=-1?O:O in m?(b=m[O],""):O in v?v[O]:R}else return b.indexOf(R)==-1?R:v[R]||"\\"+R}),k=x.indexOf("\\zs");return k!=-1&&(x="(?<="+x.slice(0,k)+")"+x.slice(k+3)),k=x.indexOf("\\ze"),k!=-1&&(x=x.slice(0,k)+"(?="+x.slice(k+3)+")"),x}var Bn={"\\n":`
107
- `,"\\r":"\r","\\t":" "};function vc(u){for(var m=!1,v=[],b=-1;b<u.length;b++){var x=u.charAt(b)||"",k=u.charAt(b+1)||"";Bn[x+k]?(v.push(Bn[x+k]),b++):m?(v.push(x),m=!1):x==="\\"?(m=!0,pe(k)||k==="$"?v.push("$"):k!=="/"&&k!=="\\"&&v.push("\\")):(x==="$"&&v.push("$"),v.push(x),k==="/"&&v.push("\\"))}return v.join("")}var bc={"\\/":"/","\\\\":"\\","\\n":`
108
- `,"\\r":"\r","\\t":" ","\\&":"&"};function Bs(u){for(var m=new e.StringStream(u),v=[];!m.eol();){for(;m.peek()&&m.peek()!="\\";)v.push(m.next());var b=!1;for(var x in bc)if(m.match(x,!0)){b=!0,v.push(bc[x]);break}b||v.push(m.next())}return v.join("")}function Hs(u,m,v){Q.registerController.getRegister("/").setText(u);var b=kf(u),x,k;return b.length?(x=u.substring(0,b[0]),k=u.substring(b[0]).indexOf("i")!=-1):x=u,x?(be("pcre")||(x=Vr(x)),v&&(m=/^[^A-Z]*$/.test(x)),new RegExp(x,m||k?"im":"m")):null}function Nn(u){typeof u=="string"&&(u=document.createElement(u));for(var m=1;m<arguments.length;m++){var v=arguments[m];if(v)if(typeof v!="object"&&(v=document.createTextNode(v)),v.nodeType)u.appendChild(v);else for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(b[0]==="$"?u.style[b.slice(1)]=v[b]:typeof v[b]=="function"?u[b]=v[b]:u.setAttribute(b,v[b]))}return u}function ct(u,m,v){var b=Nn("div",{$color:"red",$whiteSpace:"pre",class:"cm-vim-message"},m);u.openNotification?v?(b=Nn("div",{},b,Nn("div",{},"Press ENTER or type command to continue")),u.state.closeVimNotification&&u.state.closeVimNotification(),u.state.closeVimNotification=u.openNotification(b,{bottom:!0,duration:0})):u.openNotification(b,{bottom:!0,duration:15e3}):alert(b.innerText)}function lr(u,m){return Nn("div",{$display:"flex",$flex:1},Nn("span",{$fontFamily:"monospace",$whiteSpace:"pre",$flex:1,$display:"flex"},u,Nn("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false",$flex:1})),m&&Nn("span",{$color:"#888"},m))}function aa(u,m){var x;if(je.length){m.value||(m.value=""),Ae=m;return}var v=lr(m.prefix,m.desc);if(u.openDialog)u.openDialog(v,m.onClose,{onKeyDown:m.onKeyDown,onKeyUp:m.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:m.value});else{var b="";typeof m.prefix!="string"&&m.prefix&&(b+=m.prefix.textContent),m.desc&&(b+=" "+m.desc),(x=m.onClose)==null||x.call(m,prompt(b,""))}}function wc(u,m){return u instanceof RegExp&&m instanceof RegExp?u.flags==m.flags&&u.source==m.source:!1}function _i(u,m,v,b){if(m){var x=Kn(u),k=Hs(m,!!v,!!b);if(k)return Bo(u,k),wc(k,x.getQuery())||x.setQuery(k),k}}function oa(u){if(u.source.charAt(0)=="^")var m=!0;return{token:function(v){if(m&&!v.sol()){v.skipToEnd();return}var b=v.match(u,!1);if(b)return b[0].length==0?(v.next(),"searching"):!v.sol()&&(v.backUp(1),!u.exec(v.next()+b[0]))?(v.next(),null):(v.match(u),"searching");for(;!v.eol()&&(v.next(),!v.match(u,!1)););},query:u}}var sa=0;function Bo(u,m){clearTimeout(sa);var v=Kn(u);v.highlightTimeout=sa,sa=setTimeout(function(){if(u.state.vim){var b=Kn(u);b.highlightTimeout=void 0;var x=b.getOverlay();(!x||m!=x.query)&&(x&&u.removeOverlay(x),x=oa(m),u.addOverlay(x),u.showMatchesOnScrollbar&&(b.getScrollbarAnnotate()&&b.getScrollbarAnnotate().clear(),b.setScrollbarAnnotate(u.showMatchesOnScrollbar(m))),b.setOverlay(x))}},50)}function xi(u,m,v,b){return u.operation(function(){b===void 0&&(b=1);for(var x=u.getCursor(),k=u.getSearchCursor(v,x),R=0;R<b;R++){var O=k.find(m);if(R==0&&O&&gt(k.from(),x)){var L=m?k.from():k.to();O=k.find(m),O&&!O[0]&&gt(k.from(),L)&&u.getLine(L.line).length==L.ch&&(O=k.find(m))}if(!O&&(k=u.getSearchCursor(v,m?new n(u.lastLine()):new n(u.firstLine(),0)),!k.find(m)))return}return k.from()})}function Sf(u,m,v,b,x){return u.operation(function(){b===void 0&&(b=1);var k=u.getCursor(),R=u.getSearchCursor(v,k),O=R.find(!m);!x.visualMode&&O&&gt(R.from(),k)&&R.find(!m);for(var L=0;L<b;L++)if(O=R.find(m),!O&&(R=u.getSearchCursor(v,m?new n(u.lastLine()):new n(u.firstLine(),0)),!R.find(m)))return;var z=R.from(),q=R.to();return z&&q&&[z,q]})}function ki(u){var m=Kn(u);m.highlightTimeout&&(m.highlightTimeout=(clearTimeout(m.highlightTimeout),void 0)),u.removeOverlay(Kn(u).getOverlay()),m.setOverlay(null),m.getScrollbarAnnotate()&&(m.getScrollbarAnnotate().clear(),m.setScrollbarAnnotate(null))}function _c(u,m,v){return typeof u!="number"&&(u=u.line),m instanceof Array?de(u,m):typeof v=="number"?u>=m&&u<=v:u==m}function Ka(u){var m=u.getScrollInfo(),v=6,b=10,x=u.coordsChar({left:0,top:v+m.top},"local"),k=m.clientHeight-b+m.top,R=u.coordsChar({left:0,top:k},"local");return{top:x.line,bottom:R.line}}function Ho(u,m,v){if(v=="'"||v=="`")return Q.jumpList.find(u,-1)||new n(0,0);if(v==".")return xc(u);var b=m.marks[v];return b&&b.find()}function xc(u){if(u.getLastEditEnd)return u.getLastEditEnd();for(var m=u.doc.history.done,v=m.length;v--;)if(m[v].changes)return Ge(m[v].changes[0].to)}class Vo{constructor(){this.commandMap_,this.buildCommandMap_()}processCommand(m,v,b){var x=this;m.operation(function(){m.curOp&&(m.curOp.isVimOp=!0),x._processCommand(m,v,b)})}_processCommand(m,v,b){var x=m.state.vim,k=Q.registerController.getRegister(":"),R=k.toString(),O=new e.StringStream(v);k.setText(v);var L=b||{};L.input=v;try{this.parseInput_(m,O,L)}catch(oe){throw ct(m,oe+""),oe}x.visualMode&&Ye(m);var z,q;if(!L.commandName)L.line!==void 0&&(q="move");else if(z=this.matchCommand_(L.commandName),z){if(q=z.name,z.excludeFromCommandHistory&&k.setText(R),this.parseCommandArgs_(O,L,z),z.type=="exToKey"){mt(m,z.toKeys||"",z);return}else if(z.type=="exToEx"){this.processCommand(m,z.toInput||"");return}}if(!q){ct(m,'Not an editor command ":'+v+'"');return}try{xr[q](m,L),(!z||!z.possiblyAsync)&&L.callback&&L.callback()}catch(oe){throw ct(m,oe+""),oe}}parseInput_(m,v,b){var k,R;v.eatWhile(":"),v.eat("%")?(b.line=m.firstLine(),b.lineEnd=m.lastLine()):(b.line=this.parseLineSpec_(m,v),b.line!==void 0&&v.eat(",")&&(b.lineEnd=this.parseLineSpec_(m,v))),b.line==null?m.state.vim.visualMode?(b.selectionLine=(k=Ho(m,m.state.vim,"<"))==null?void 0:k.line,b.selectionLineEnd=(R=Ho(m,m.state.vim,">"))==null?void 0:R.line):b.selectionLine=m.getCursor().line:(b.selectionLine=b.line,b.selectionLineEnd=b.lineEnd);var x=v.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return x?b.commandName=x[1]:b.commandName=(v.match(/.*/)||[""])[0],b}parseLineSpec_(m,v){var b=v.match(/^(\d+)/);if(b)return parseInt(b[1],10)-1;switch(v.next()){case".":return this.parseLineSpecOffset_(v,m.getCursor().line);case"$":return this.parseLineSpecOffset_(v,m.lastLine());case"'":var x=v.next()||"",k=Ho(m,m.state.vim,x);if(!k)throw Error("Mark not set");return this.parseLineSpecOffset_(v,k.line);case"-":case"+":return v.backUp(1),this.parseLineSpecOffset_(v,m.getCursor().line);default:v.backUp(1);return}}parseLineSpecOffset_(m,v){var b=m.match(/^([+-])?(\d+)/);if(b){var x=parseInt(b[2],10);b[1]=="-"?v-=x:v+=x}return v}parseCommandArgs_(m,v,b){var R;if(!m.eol()){v.argString=(R=m.match(/.*/))==null?void 0:R[0];var x=b.argDelimiter||/\s+/,k=ir(v.argString||"").split(x);k.length&&k[0]&&(v.args=k)}}matchCommand_(m){for(var v=m.length;v>0;v--){var b=m.substring(0,v);if(this.commandMap_[b]){var x=this.commandMap_[b];if(x.name.indexOf(m)===0)return x}}}buildCommandMap_(){this.commandMap_={};for(var m=0;m<d.length;m++){var v=d[m],b=v.shortName||v.name;this.commandMap_[b]=v}}map(m,v,b,x){if(m!=":"&&m.charAt(0)==":"){if(b)throw Error("Mode not supported for ex mappings");var k=m.substring(1);v!=":"&&v.charAt(0)==":"?this.commandMap_[k]={name:k,type:"exToEx",toInput:v.substring(1),user:!0}:this.commandMap_[k]={name:k,type:"exToKey",toKeys:v,user:!0}}else{var R={keys:m,type:"keyToKey",toKeys:v,noremap:!!x};b&&(R.context=b),oi(R)}}unmap(m,v){if(m!=":"&&m.charAt(0)==":"){if(v)throw Error("Mode not supported for ex mappings");var b=m.substring(1);if(this.commandMap_[b]&&this.commandMap_[b].user)return delete this.commandMap_[b],!0}else for(var x=m,k=0;k<o.length;k++)if(x==o[k].keys&&o[k].context===v)return o.splice(k,1),$s(x),!0}}var xr={colorscheme:function(u,m){if(!m.args||m.args.length<1){ct(u,u.getOption("theme"));return}u.setOption("theme",m.args[0])},map:function(u,m,v,b){var x=m.args;if(!x||x.length<2){u&&ct(u,"Invalid mapping: "+m.input);return}_n.map(x[0],x[1],v,b)},imap:function(u,m){this.map(u,m,"insert")},nmap:function(u,m){this.map(u,m,"normal")},vmap:function(u,m){this.map(u,m,"visual")},omap:function(u,m){this.map(u,m,"operatorPending")},noremap:function(u,m){this.map(u,m,void 0,!0)},inoremap:function(u,m){this.map(u,m,"insert",!0)},nnoremap:function(u,m){this.map(u,m,"normal",!0)},vnoremap:function(u,m){this.map(u,m,"visual",!0)},onoremap:function(u,m){this.map(u,m,"operatorPending",!0)},unmap:function(u,m,v){var b=m.args;(!b||b.length<1||!_n.unmap(b[0],v))&&u&&ct(u,"No such mapping: "+m.input)},mapclear:function(u,m){Be.mapclear()},imapclear:function(u,m){Be.mapclear("insert")},nmapclear:function(u,m){Be.mapclear("normal")},vmapclear:function(u,m){Be.mapclear("visual")},omapclear:function(u,m){Be.mapclear("operatorPending")},move:function(u,m){Pn.processCommand(u,u.state.vim,{keys:"",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:m.line+1})},set:function(u,m){var v=m.args,b=m.setCfg||{};if(!v||v.length<1){u&&ct(u,"Invalid mapping: "+m.input);return}var x=v[0].split("="),k=x.shift()||"",R=x.length>0?x.join("="):void 0,O=!1,L=!1;if(k.charAt(k.length-1)=="?"){if(R)throw Error("Trailing characters: "+m.argString);k=k.substring(0,k.length-1),O=!0}else k.charAt(k.length-1)=="!"&&(k=k.substring(0,k.length-1),L=!0);R===void 0&&k.substring(0,2)=="no"&&(k=k.substring(2),R=!1);var z=fe[k]&&fe[k].type=="boolean";if(z&&(L?R=!be(k,u,b):R??(R=!0)),!z&&R===void 0||O){var q=be(k,u,b);q instanceof Error?ct(u,q.message):q===!0||q===!1?ct(u," "+(q?"":"no")+k):ct(u," "+k+"="+q)}else{var oe=J(k,R,u,b);oe instanceof Error&&ct(u,oe.message)}},setlocal:function(u,m){m.setCfg={scope:"local"},this.set(u,m)},setglobal:function(u,m){m.setCfg={scope:"global"},this.set(u,m)},registers:function(u,m){var v=m.args,b=Q.registerController.registers,x=`----------Registers----------
104
+ `);u.replaceSelections(ie)}else u.replaceRange(q,x,R);v.visualMode?(x=xt(O[0].anchor,O[0].head)?O[0].anchor:O[0].head,u.setCursor(x),Ye(u,!1)):u.setCursor(_t(R,0,-1))}},incrementNumberToken:function(u,m){for(var v=u.getCursor(),b=u.getLine(v.line),x=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,k,R,O,L;(k=x.exec(b))!==null&&(R=k.index,O=R+k[0].length,!(v.ch<O)););if(!(!m.backtrack&&O<=v.ch)){if(k){var z=k[2]||k[4],q=k[3]||k[5],oe=m.increase?1:-1,ie={"0b":2,0:8,"":10,"0x":16}[z.toLowerCase()];L=(parseInt(k[1]+q,ie)+oe*m.repeat).toString(ie);var X=z?Array(q.length-L.length+1+k[1].length).join("0"):"";L=L.charAt(0)==="-"?"-"+z+X+L.substr(1):z+X+L;var Y=new n(v.line,R),xe=new n(v.line,O);u.replaceRange(L,Y,xe)}else return;u.setCursor(new n(v.line,R+L.length-1))}},repeatLastEdit:function(u,m,v){var b=v.lastEditInputState;if(b){var x=m.repeat;x&&m.repeatIsExplicit?b.repeatOverride=x:x=b.repeatOverride||x,Xa(u,v,x,!1)}},indent:function(u,m){u.indentLine(u.getCursor().line,m.indentRight)},exitInsertMode:function(u,m){Vn(u)}};function ni(u,m){fn[u]=m}function zt(u,m,v){var b=u.state.vim,x=b.insertMode||b.visualMode,k=Math.min(Math.max(u.firstLine(),m.line),u.lastLine()),R=u.getLine(k),O=R.length-1+ +!!x,L=Math.min(Math.max(0,m.ch),O),z=R.charCodeAt(L);if(56320<=z&&z<=57343){var q=1;v&&v.line==k&&v.ch>L&&(q=-1),L+=q,L>O&&(L-=2)}return new n(k,L)}function Br(u){var m={};for(var v in u)Object.prototype.hasOwnProperty.call(u,v)&&(m[v]=u[v]);return m}function _t(u,m,v){return typeof m=="object"&&(v=m.ch,m=m.line),new n(u.line+m,u.ch+v)}function vi(u,m,v,b){b.operator&&(v="operatorPending");for(var x,k=[],R=[],O=Pe?m.length-c:0;O<m.length;O++){var L=m[O];v=="insert"&&L.context!="insert"||L.context&&L.context!=v||b.operator&&L.type=="action"||!(x=na(u,L.keys))||(x=="partial"&&k.push(L),x=="full"&&R.push(L))}return{partial:k,full:R}}function na(u,m){let v=m.slice(-11)=="<character>",b=m.slice(-10)=="<register>";if(v||b){var x=m.length-(v?11:10),k=u.slice(0,x),R=m.slice(0,x);return k==R&&u.length>x?"full":R.indexOf(k)==0?"partial":!1}else return u==m?"full":m.indexOf(u)==0?"partial":!1}function wr(u){var m=/^.*(<[^>]+>)$/.exec(u),v=m?m[1]:u.slice(-1);if(v.length>1)switch(v){case"<CR>":case"<S-CR>":v=`
105
+ `;break;case"<Space>":case"<S-Space>":v=" ";break;default:v="";break}return v}function Jt(u,m,v){return function(){for(var b=0;b<v;b++)m(u)}}function Ge(u){return new n(u.line,u.ch)}function gt(u,m){return u.ch==m.ch&&u.line==m.line}function xt(u,m){return u.line<m.line||u.line==m.line&&u.ch<m.ch}function kt(u,m){return arguments.length>2&&(m=kt.apply(void 0,Array.prototype.slice.call(arguments,1))),xt(u,m)?u:m}function zn(u,m){return arguments.length>2&&(m=zn.apply(void 0,Array.prototype.slice.call(arguments,1))),xt(u,m)?m:u}function _r(u,m,v){var b=xt(u,m),x=xt(m,v);return b&&x}function St(u,m){return u.getLine(m).length}function ir(u){return u.trim?u.trim():u.replace(/^\s+|\s+$/g,"")}function Mn(u){return u.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Hr(u,m,v){var b=St(u,m),x=Array(v-b+1).join(" ");u.setCursor(new n(m,b)),u.replaceRange(x,u.getCursor())}function bn(u,m){var v=[],b=u.listSelections(),x=Ge(u.clipPos(m)),k=!gt(m,x),R=bi(b,u.getCursor("head")),O=gt(b[R].head,b[R].anchor),L=b.length-1,z=L-R>R?L:0,q=b[z].anchor,oe=Math.min(q.line,x.line),ie=Math.max(q.line,x.line),X=q.ch,Y=x.ch,xe=b[z].head.ch-X,_e=Y-X;xe>0&&_e<=0?(X++,k||Y--):xe<0&&_e>=0?(X--,O||Y++):xe<0&&_e==-1&&(X--,Y++);for(var qe=oe;qe<=ie;qe++){var Re={anchor:new n(qe,X),head:new n(qe,Y)};v.push(Re)}return u.setSelections(v),m.ch=Y,q.ch=X,q}function ar(u,m,v){for(var b=[],x=0;x<v;x++){var k=_t(m,x,0);b.push({anchor:k,head:k})}u.setSelections(b,0)}function bi(u,m,v){for(var b=0;b<u.length;b++){var x=gt(u[b].anchor,m),k=gt(u[b].head,m);if(x||k)return b}return-1}function ri(u,m){var v=u.listSelections(),b=v[0],x=v[v.length-1];return[xt(b.anchor,b.head)?b.anchor:b.head,xt(x.anchor,x.head)?x.head:x.anchor]}function Ln(u,m){var v=m.sel.anchor,b=m.sel.head;m.lastPastedText&&(m.lastPastedText=(b=u.posFromIndex(u.indexFromPos(v)+m.lastPastedText.length),void 0)),m.lastSelection={anchorMark:u.setBookmark(v),headMark:u.setBookmark(b),anchor:Ge(v),head:Ge(b),visualMode:m.visualMode,visualLine:m.visualLine,visualBlock:m.visualBlock}}function wi(u,m,v,b){var x=u.state.vim.sel,k=b?m:x.head,R=b?m:x.anchor,O;return xt(v,m)&&(O=v,v=m,m=O),xt(k,R)?(k=kt(m,k),R=zn(R,v)):(R=kt(m,R),k=zn(k,v),k=_t(k,0,-1),k.ch==-1&&k.line!=u.firstLine()&&(k=new n(k.line-1,St(u,k.line-1)))),[R,k]}function Fn(u,m,v){var b=u.state.vim;m||(m=b.sel),v||(v=b.visualLine?"line":b.visualBlock?"block":"char");var x=or(u,m,v);u.setSelections(x.ranges,x.primary)}function or(u,m,v,b){var x=Ge(m.head),k=Ge(m.anchor);if(v=="char"){var R=!b&&!xt(m.head,m.anchor)?1:0,O=xt(m.head,m.anchor)?1:0;return x=_t(m.head,0,R),k=_t(m.anchor,0,O),{ranges:[{anchor:k,head:x}],primary:0}}else if(v=="line"){if(xt(m.head,m.anchor))x.ch=0,k.ch=St(u,k.line);else{k.ch=0;var L=u.lastLine();x.line>L&&(x.line=L),x.ch=St(u,x.line)}return{ranges:[{anchor:k,head:x}],primary:0}}else if(v=="block"){var z=Math.min(k.line,x.line),q=k.ch,oe=Math.max(k.line,x.line),ie=x.ch;q<ie?ie+=1:q+=1;for(var X=oe-z+1,Y=x.line==z?0:X-1,xe=[],_e=0;_e<X;_e++)xe.push({anchor:new n(z+_e,q),head:new n(z+_e,ie)});return{ranges:xe,primary:Y}}throw"never happens"}function M(u){var m=u.getCursor("head");return u.getSelection().length==1&&(m=kt(m,u.getCursor("anchor"))),m}function Ye(u,m){var v=u.state.vim;m!==!1&&u.setCursor(zt(u,v.sel.head)),Ln(u,v),v.visualMode=!1,v.visualLine=!1,v.visualBlock=!1,v.insertMode||e.signal(u,"vim-mode-change",{mode:"normal"})}function j(u,m,v){var b=u.getRange(m,v);if(/\n\s*$/.test(b)){var x=b.split(`
106
+ `);x.pop();for(var k=x.pop();x.length>0&&k&&A(k);k=x.pop())v.line--,v.ch=0;k?(v.line--,v.ch=St(u,v.line)):v.ch=0}}function te(u,m,v){m.ch=0,v.ch=0,v.line++}function ve(u){if(!u)return 0;var m=u.search(/\S/);return m==-1?u.length:m}function Te(u,{inclusive:m,innerWord:v,bigWord:b,noSymbol:x,multiline:k},R){var O=R||M(u),L=u.getLine(O.line),z=L,q=O.line,oe=q,ie=O.ch,X,Y=x?C[0]:E[0];if(v&&/\s/.test(L.charAt(ie)))Y=function(dt){return/\s/.test(dt)};else{for(;!Y(L.charAt(ie));)if(ie++,ie>=L.length){if(!k)return null;ie--,X=rt(u,O,!0,b,!0);break}b?Y=E[0]:(Y=C[0],Y(L.charAt(ie))||(Y=C[1]))}for(var xe=ie,_e=ie;Y(L.charAt(_e))&&_e>=0;)_e--;if(_e++,X)xe=X.to,oe=X.line,z=u.getLine(oe),!z&&xe==0&&xe++;else for(;Y(L.charAt(xe))&&xe<L.length;)xe++;if(m){var qe=xe,Re=O.ch<=_e&&/\s/.test(L.charAt(O.ch));if(!Re)for(;/\s/.test(z.charAt(xe))&&xe<z.length;)xe++;if(qe==xe||Re){for(var Ne=_e;/\s/.test(L.charAt(_e-1))&&_e>0;)_e--;!_e&&!Re&&(_e=Ne)}}return{start:new n(q,_e),end:new n(oe,xe)}}function He(u,m,v){var b=m;if(!e.findMatchingTag||!e.findEnclosingTag)return{start:b,end:b};var x=e.findMatchingTag(u,m)||e.findEnclosingTag(u,m);return!x||!x.open||!x.close?{start:b,end:b}:v?{start:x.open.from,end:x.close.to}:{start:x.open.to,end:x.close.from}}function Ve(u,m,v){gt(m,v)||Q.jumpList.add(u,m,v)}function ot(u,m){Q.lastCharacterSearch.increment=u,Q.lastCharacterSearch.forward=m.forward,Q.lastCharacterSearch.selectedCharacter=m.selectedCharacter}var Mt={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},Ze={bracket:{isComplete:function(u){if(u.nextCh===u.symb){if(u.depth++,u.depth>=1)return!0}else u.nextCh===u.reverseSymb&&u.depth--;return!1}},section:{init:function(u){u.curMoveThrough=!0,u.symb=(u.forward?"]":"[")===u.symb?"{":"}"},isComplete:function(u){return u.index===0&&u.nextCh===u.symb}},comment:{isComplete:function(u){var m=u.lastCh==="*"&&u.nextCh==="/";return u.lastCh=u.nextCh,m}},method:{init:function(u){u.symb=u.symb==="m"?"{":"}",u.reverseSymb=u.symb==="{"?"}":"{"},isComplete:function(u){return u.nextCh===u.symb}},preprocess:{init:function(u){u.index=0},isComplete:function(u){var v;if(u.nextCh==="#"){var m=(v=u.lineText.match(/^#(\w+)/))==null?void 0:v[1];if(m==="endif"){if(u.forward&&u.depth===0)return!0;u.depth++}else if(m==="if"){if(!u.forward&&u.depth===0)return!0;u.depth--}if(m==="else"&&u.depth===0)return!0}return!1}}};function Lt(u,m,v,b){var x=Ge(u.getCursor()),k=v?1:-1,R=v?u.lineCount():-1,O=x.ch,L=x.line,z=u.getLine(L),q={lineText:z,nextCh:z.charAt(O),lastCh:null,index:O,symb:b,reverseSymb:(v?{")":"(","}":"{"}:{"(":")","{":"}"})[b],forward:v,depth:0,curMoveThrough:!1},oe=Mt[b];if(!oe)return x;var ie=Ze[oe].init,X=Ze[oe].isComplete;for(ie&&ie(q);L!==R&&m;){if(q.index+=k,q.nextCh=q.lineText.charAt(q.index),!q.nextCh){if(L+=k,q.lineText=u.getLine(L)||"",k>0)q.index=0;else{var Y=q.lineText.length;q.index=Y>0?Y-1:0}q.nextCh=q.lineText.charAt(q.index)}X(q)&&(x.line=L,x.ch=q.index,m--)}return q.nextCh||q.curMoveThrough?new n(L,q.index):x}function rt(u,m,v,b,x){var k=m.line,R=m.ch,O=u.getLine(k),L=v?1:-1,z=b?E:C;if(x&&O==""){if(k+=L,O=u.getLine(k),!F(u,k))return null;R=v?0:O.length}for(;;){if(x&&O=="")return{from:0,to:0,line:k};for(var q=L>0?O.length:-1,oe=q,ie=q;R!=q;){for(var X=!1,Y=0;Y<z.length&&!X;++Y)if(z[Y](O.charAt(R))){for(oe=R;R!=q&&z[Y](O.charAt(R));)R+=L;if(ie=R,X=oe!=ie,oe==m.ch&&k==m.line&&ie==oe+L)continue;return{from:Math.min(oe,ie+1),to:Math.max(oe,ie),line:k}}X||(R+=L)}if(k+=L,!F(u,k))return null;O=u.getLine(k),R=L>0?0:O.length}}function ut(u,m,v,b,x,k){var R=Ge(m),O=[];(b&&!x||!b&&x)&&v++;for(var L=!(b&&x),z=0;z<v;z++){var q=rt(u,m,b,k,L);if(!q){var oe=St(u,u.lastLine());O.push(b?{line:u.lastLine(),from:oe,to:oe}:{line:0,from:0,to:0});break}O.push(q),m=new n(q.line,b?q.to-1:q.from)}var ie=O.length!=v,X=O[0],Y=O.pop();return b&&!x?(!ie&&(X.from!=R.ch||X.line!=R.line)&&(Y=O.pop()),Y&&new n(Y.line,Y.from)):b&&x?Y&&new n(Y.line,Y.to-1):!b&&x?(!ie&&(X.to!=R.ch||X.line!=R.line)&&(Y=O.pop()),Y&&new n(Y.line,Y.to)):Y&&new n(Y.line,Y.from)}function wn(u,m,v,b,x){var k=new n(m.line+v.repeat-1,1/0),R=u.clipPos(k);return R.ch--,x||(b.lastHPos=1/0,b.lastHSPos=u.charCoords(R,"div").left),k}function sr(u,m,v,b,x){if(b){for(var k=x||u.getCursor(),R=k.ch,O,L=0;L<m;L++){var z=u.getLine(k.line);if(O=ra(R,z,b,v),O==-1)return;R=O}if(O!=null)return new n(u.getCursor().line,O)}}function ii(u,m){var v=u.getCursor().line;return zt(u,new n(v,m-1))}function Bn(u,m,v,b){!de(v,T)&&!$.test(v)||(m.marks[v]&&m.marks[v].clear(),m.marks[v]=u.setBookmark(b))}function ra(u,m,v,b,x){return b?m.indexOf(v,u+1):m.lastIndexOf(v,u-1)}function Xt(u,m,v,b,x){var k=m.line,R=u.firstLine(),O=u.lastLine(),L,z,q=k;function oe(_e){return!u.getLine(_e)}function ie(_e,qe,Re){return Re?oe(_e)!=oe(_e+qe):!oe(_e)&&oe(_e+qe)}if(b){for(;R<=q&&q<=O&&v>0;)ie(q,b)&&v--,q+=b;return{start:new n(q,0),end:m}}var X=u.state.vim;if(X.visualLine&&ie(k,1,!0)){var Y=X.sel.anchor;ie(Y.line,-1,!0)&&(!x||Y.line!=k)&&(k+=1)}var xe=oe(k);for(q=k;q<=O&&v;q++)ie(q,1,!0)&&(!x||oe(q)!=xe)&&v--;for(z=new n(q,0),q>O&&!xe?xe=!0:x=!1,q=k;q>R&&!((!x||oe(q)==xe||q==k)&&ie(q,-1,!0));q--);return L=new n(q,0),{start:L,end:z}}function zs(u,m,v,b,x){function k(z){z.line!==null&&(z.pos+z.dir<0||z.pos+z.dir>=z.line.length?z.line=null:z.pos+=z.dir)}function R(z,q,oe,ie){var X={line:z.getLine(q),ln:q,pos:oe,dir:ie};if(X.line==="")return{ln:X.ln,pos:X.pos};var Y=X.pos;for(k(X);X.line!==null;){if(Y=X.pos,W(X.line[X.pos]))if(x){for(k(X);X.line!==null&&A(X.line[X.pos]);)Y=X.pos,k(X);return{ln:X.ln,pos:Y+1}}else return{ln:X.ln,pos:X.pos+1};k(X)}return{ln:X.ln,pos:Y+1}}function O(z,q,oe,ie){var X=z.getLine(q),Y={line:X,ln:q,pos:oe,dir:ie};if(Y.line==="")return{ln:Y.ln,pos:Y.pos};var xe=Y.pos;for(k(Y);Y.line!==null;){if(!A(Y.line[Y.pos])&&!W(Y.line[Y.pos]))xe=Y.pos;else if(W(Y.line[Y.pos]))return x&&A(Y.line[Y.pos+1])?{ln:Y.ln,pos:Y.pos+1}:{ln:Y.ln,pos:xe};k(Y)}return Y.line=X,x&&A(Y.line[Y.pos])?{ln:Y.ln,pos:Y.pos}:{ln:Y.ln,pos:xe}}for(var L={ln:m.line,pos:m.ch};v>0;)L=b<0?O(u,L.ln,L.pos,b):R(u,L.ln,L.pos,b),v--;return new n(L.ln,L.pos)}function gc(u,m,v,b){function x(L,z){if(z.line!==null)if(z.pos+z.dir<0||z.pos+z.dir>=z.line.length){if(z.ln+=z.dir,!F(L,z.ln)){z.line=null;return}z.line=L.getLine(z.ln),z.pos=z.dir>0?0:z.line.length-1}else z.pos+=z.dir}function k(L,z,q,oe){var _e=L.getLine(z),ie=_e==="",X={line:_e,ln:z,pos:q,dir:oe},Y={ln:X.ln,pos:X.pos},xe=X.line==="";for(x(L,X);X.line!==null;){if(Y.ln=X.ln,Y.pos=X.pos,X.line===""&&!xe||ie&&X.line!==""&&!A(X.line[X.pos]))return{ln:X.ln,pos:X.pos};W(X.line[X.pos])&&!ie&&(X.pos===X.line.length-1||A(X.line[X.pos+1]))&&(ie=!0),x(L,X)}var _e=L.getLine(Y.ln);Y.pos=0;for(var qe=_e.length-1;qe>=0;--qe)if(!A(_e[qe])){Y.pos=qe;break}return Y}function R(L,z,q,oe){var _e=L.getLine(z),ie={line:_e,ln:z,pos:q,dir:oe},X=ie.ln,Y=null,xe=ie.line==="";for(x(L,ie);ie.line!==null;){if(ie.line===""&&!xe)return Y===null?{ln:ie.ln,pos:ie.pos}:{ln:X,pos:Y};if(W(ie.line[ie.pos])&&Y!==null&&!(ie.ln===X&&ie.pos+1===Y))return{ln:X,pos:Y};ie.line!==""&&!A(ie.line[ie.pos])&&(xe=!1,X=ie.ln,Y=ie.pos),x(L,ie)}var _e=L.getLine(X);Y=0;for(var qe=0;qe<_e.length;++qe)if(!A(_e[qe])){Y=qe;break}return{ln:X,pos:Y}}for(var O={ln:m.line,pos:m.ch};v>0;)O=b<0?R(u,O.ln,O.pos,b):k(u,O.ln,O.pos,b),v--;return new n(O.ln,O.pos)}function ai(u,m,v,b){var x=m,k={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[v],R={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[v],O=u.getLine(x.line).charAt(x.ch)===R?1:0,L=u.scanForBracket(new n(x.line,x.ch+O),-1,void 0,{bracketRegex:k}),z=u.scanForBracket(new n(x.line,x.ch+O),1,void 0,{bracketRegex:k});if(!L||!z)return null;var q=L.pos,oe=z.pos;if(q.line==oe.line&&q.ch>oe.ch||q.line>oe.line){var ie=q;q=oe,oe=ie}return b?oe.ch+=1:q.ch+=1,{start:q,end:oe}}function ia(u,m,v,b){var x=Ge(m),k=u.getLine(x.line).split(""),R,O,L,z,q=k.indexOf(v);if(x.ch<q)x.ch=q;else if(q<x.ch&&k[x.ch]==v){var oe=/string/.test(u.getTokenTypeAt(_t(m,0,1))),ie=/string/.test(u.getTokenTypeAt(m));oe&&!ie||(O=x.ch,--x.ch)}if(k[x.ch]==v&&!O)R=x.ch+1;else for(L=x.ch;L>-1&&!R;L--)k[L]==v&&(R=L+1);if(R&&!O)for(L=R,z=k.length;L<z&&!O;L++)k[L]==v&&(O=L);return!R||!O?{start:x,end:x}:(b&&(--R,++O),{start:new n(x.line,R),end:new n(x.line,O)})}we("pcre",!0,"boolean");class xf{constructor(){this.highlightTimeout}getQuery(){return Q.query}setQuery(m){Q.query=m}getOverlay(){return this.searchOverlay}setOverlay(m){this.searchOverlay=m}isReversed(){return Q.isReversed}setReversed(m){Q.isReversed=m}getScrollbarAnnotate(){return this.annotate}setScrollbarAnnotate(m){this.annotate=m}}function Kn(u){var m=u.state.vim;return m.searchState_||(m.searchState_=new xf)}function yc(u){return Wa(u,"/")}function kf(u){return Ua(u,"/")}function Wa(u,m){var v=Ua(u,m)||[];if(!v.length)return[];var b=[];if(v[0]===0){for(var x=0;x<v.length;x++)typeof v[x]=="number"&&b.push(u.substring(v[x]+1,v[x+1]));return b}}function Ua(u,m){m||(m="/");for(var v=!1,b=[],x=0;x<u.length;x++){var k=u.charAt(x);!v&&k==m&&b.push(x),v=!v&&k=="\\"}return b}function Vr(u){var m={V:"|(){+?*.[$^",M:"|(){+?*.[",m:"|(){+?",v:"<>"},v={">":"(?<=[\\w])(?=[^\\w]|$)","<":"(?<=[^\\w]|^)(?=[\\w])"},b=m.m,x=u.replace(/\\.|[\[|(){+*?.$^<>]/g,function(R){if(R[0]==="\\"){var O=R[1];return O==="}"||b.indexOf(O)!=-1?O:O in m?(b=m[O],""):O in v?v[O]:R}else return b.indexOf(R)==-1?R:v[R]||"\\"+R}),k=x.indexOf("\\zs");return k!=-1&&(x="(?<="+x.slice(0,k)+")"+x.slice(k+3)),k=x.indexOf("\\ze"),k!=-1&&(x=x.slice(0,k)+"(?="+x.slice(k+3)+")"),x}var Hn={"\\n":`
107
+ `,"\\r":"\r","\\t":" "};function vc(u){for(var m=!1,v=[],b=-1;b<u.length;b++){var x=u.charAt(b)||"",k=u.charAt(b+1)||"";Hn[x+k]?(v.push(Hn[x+k]),b++):m?(v.push(x),m=!1):x==="\\"?(m=!0,pe(k)||k==="$"?v.push("$"):k!=="/"&&k!=="\\"&&v.push("\\")):(x==="$"&&v.push("$"),v.push(x),k==="/"&&v.push("\\"))}return v.join("")}var bc={"\\/":"/","\\\\":"\\","\\n":`
108
+ `,"\\r":"\r","\\t":" ","\\&":"&"};function Fs(u){for(var m=new e.StringStream(u),v=[];!m.eol();){for(;m.peek()&&m.peek()!="\\";)v.push(m.next());var b=!1;for(var x in bc)if(m.match(x,!0)){b=!0,v.push(bc[x]);break}b||v.push(m.next())}return v.join("")}function Bs(u,m,v){Q.registerController.getRegister("/").setText(u);var b=kf(u),x,k;return b.length?(x=u.substring(0,b[0]),k=u.substring(b[0]).indexOf("i")!=-1):x=u,x?(be("pcre")||(x=Vr(x)),v&&(m=/^[^A-Z]*$/.test(x)),new RegExp(x,m||k?"im":"m")):null}function Nn(u){typeof u=="string"&&(u=document.createElement(u));for(var m=1;m<arguments.length;m++){var v=arguments[m];if(v)if(typeof v!="object"&&(v=document.createTextNode(v)),v.nodeType)u.appendChild(v);else for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(b[0]==="$"?u.style[b.slice(1)]=v[b]:typeof v[b]=="function"?u[b]=v[b]:u.setAttribute(b,v[b]))}return u}function ct(u,m,v){var b=Nn("div",{$color:"red",$whiteSpace:"pre",class:"cm-vim-message"},m);u.openNotification?v?(b=Nn("div",{},b,Nn("div",{},"Press ENTER or type command to continue")),u.state.closeVimNotification&&u.state.closeVimNotification(),u.state.closeVimNotification=u.openNotification(b,{bottom:!0,duration:0})):u.openNotification(b,{bottom:!0,duration:15e3}):alert(b.innerText)}function lr(u,m){return Nn("div",{$display:"flex",$flex:1},Nn("span",{$fontFamily:"monospace",$whiteSpace:"pre",$flex:1,$display:"flex"},u,Nn("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false",$flex:1})),m&&Nn("span",{$color:"#888"},m))}function aa(u,m){var x;if(je.length){m.value||(m.value=""),Ae=m;return}var v=lr(m.prefix,m.desc);if(u.openDialog)u.openDialog(v,m.onClose,{onKeyDown:m.onKeyDown,onKeyUp:m.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:m.value});else{var b="";typeof m.prefix!="string"&&m.prefix&&(b+=m.prefix.textContent),m.desc&&(b+=" "+m.desc),(x=m.onClose)==null||x.call(m,prompt(b,""))}}function wc(u,m){return u instanceof RegExp&&m instanceof RegExp?u.flags==m.flags&&u.source==m.source:!1}function _i(u,m,v,b){if(m){var x=Kn(u),k=Bs(m,!!v,!!b);if(k)return Bo(u,k),wc(k,x.getQuery())||x.setQuery(k),k}}function oa(u){if(u.source.charAt(0)=="^")var m=!0;return{token:function(v){if(m&&!v.sol()){v.skipToEnd();return}var b=v.match(u,!1);if(b)return b[0].length==0?(v.next(),"searching"):!v.sol()&&(v.backUp(1),!u.exec(v.next()+b[0]))?(v.next(),null):(v.match(u),"searching");for(;!v.eol()&&(v.next(),!v.match(u,!1)););},query:u}}var sa=0;function Bo(u,m){clearTimeout(sa);var v=Kn(u);v.highlightTimeout=sa,sa=setTimeout(function(){if(u.state.vim){var b=Kn(u);b.highlightTimeout=void 0;var x=b.getOverlay();(!x||m!=x.query)&&(x&&u.removeOverlay(x),x=oa(m),u.addOverlay(x),u.showMatchesOnScrollbar&&(b.getScrollbarAnnotate()&&b.getScrollbarAnnotate().clear(),b.setScrollbarAnnotate(u.showMatchesOnScrollbar(m))),b.setOverlay(x))}},50)}function xi(u,m,v,b){return u.operation(function(){b===void 0&&(b=1);for(var x=u.getCursor(),k=u.getSearchCursor(v,x),R=0;R<b;R++){var O=k.find(m);if(R==0&&O&&gt(k.from(),x)){var L=m?k.from():k.to();O=k.find(m),O&&!O[0]&&gt(k.from(),L)&&u.getLine(L.line).length==L.ch&&(O=k.find(m))}if(!O&&(k=u.getSearchCursor(v,m?new n(u.lastLine()):new n(u.firstLine(),0)),!k.find(m)))return}return k.from()})}function Sf(u,m,v,b,x){return u.operation(function(){b===void 0&&(b=1);var k=u.getCursor(),R=u.getSearchCursor(v,k),O=R.find(!m);!x.visualMode&&O&&gt(R.from(),k)&&R.find(!m);for(var L=0;L<b;L++)if(O=R.find(m),!O&&(R=u.getSearchCursor(v,m?new n(u.lastLine()):new n(u.firstLine(),0)),!R.find(m)))return;var z=R.from(),q=R.to();return z&&q&&[z,q]})}function ki(u){var m=Kn(u);m.highlightTimeout&&(m.highlightTimeout=(clearTimeout(m.highlightTimeout),void 0)),u.removeOverlay(Kn(u).getOverlay()),m.setOverlay(null),m.getScrollbarAnnotate()&&(m.getScrollbarAnnotate().clear(),m.setScrollbarAnnotate(null))}function _c(u,m,v){return typeof u!="number"&&(u=u.line),m instanceof Array?de(u,m):typeof v=="number"?u>=m&&u<=v:u==m}function Ka(u){var m=u.getScrollInfo(),v=6,b=10,x=u.coordsChar({left:0,top:v+m.top},"local"),k=m.clientHeight-b+m.top,R=u.coordsChar({left:0,top:k},"local");return{top:x.line,bottom:R.line}}function Ho(u,m,v){if(v=="'"||v=="`")return Q.jumpList.find(u,-1)||new n(0,0);if(v==".")return xc(u);var b=m.marks[v];return b&&b.find()}function xc(u){if(u.getLastEditEnd)return u.getLastEditEnd();for(var m=u.doc.history.done,v=m.length;v--;)if(m[v].changes)return Ge(m[v].changes[0].to)}class Vo{constructor(){this.commandMap_,this.buildCommandMap_()}processCommand(m,v,b){var x=this;m.operation(function(){m.curOp&&(m.curOp.isVimOp=!0),x._processCommand(m,v,b)})}_processCommand(m,v,b){var x=m.state.vim,k=Q.registerController.getRegister(":"),R=k.toString(),O=new e.StringStream(v);k.setText(v);var L=b||{};L.input=v;try{this.parseInput_(m,O,L)}catch(oe){throw ct(m,oe+""),oe}x.visualMode&&Ye(m);var z,q;if(!L.commandName)L.line!==void 0&&(q="move");else if(z=this.matchCommand_(L.commandName),z){if(q=z.name,z.excludeFromCommandHistory&&k.setText(R),this.parseCommandArgs_(O,L,z),z.type=="exToKey"){mt(m,z.toKeys||"",z);return}else if(z.type=="exToEx"){this.processCommand(m,z.toInput||"");return}}if(!q){ct(m,'Not an editor command ":'+v+'"');return}try{xr[q](m,L),(!z||!z.possiblyAsync)&&L.callback&&L.callback()}catch(oe){throw ct(m,oe+""),oe}}parseInput_(m,v,b){var k,R;v.eatWhile(":"),v.eat("%")?(b.line=m.firstLine(),b.lineEnd=m.lastLine()):(b.line=this.parseLineSpec_(m,v),b.line!==void 0&&v.eat(",")&&(b.lineEnd=this.parseLineSpec_(m,v))),b.line==null?m.state.vim.visualMode?(b.selectionLine=(k=Ho(m,m.state.vim,"<"))==null?void 0:k.line,b.selectionLineEnd=(R=Ho(m,m.state.vim,">"))==null?void 0:R.line):b.selectionLine=m.getCursor().line:(b.selectionLine=b.line,b.selectionLineEnd=b.lineEnd);var x=v.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return x?b.commandName=x[1]:b.commandName=(v.match(/.*/)||[""])[0],b}parseLineSpec_(m,v){var b=v.match(/^(\d+)/);if(b)return parseInt(b[1],10)-1;switch(v.next()){case".":return this.parseLineSpecOffset_(v,m.getCursor().line);case"$":return this.parseLineSpecOffset_(v,m.lastLine());case"'":var x=v.next()||"",k=Ho(m,m.state.vim,x);if(!k)throw Error("Mark not set");return this.parseLineSpecOffset_(v,k.line);case"-":case"+":return v.backUp(1),this.parseLineSpecOffset_(v,m.getCursor().line);default:v.backUp(1);return}}parseLineSpecOffset_(m,v){var b=m.match(/^([+-])?(\d+)/);if(b){var x=parseInt(b[2],10);b[1]=="-"?v-=x:v+=x}return v}parseCommandArgs_(m,v,b){var R;if(!m.eol()){v.argString=(R=m.match(/.*/))==null?void 0:R[0];var x=b.argDelimiter||/\s+/,k=ir(v.argString||"").split(x);k.length&&k[0]&&(v.args=k)}}matchCommand_(m){for(var v=m.length;v>0;v--){var b=m.substring(0,v);if(this.commandMap_[b]){var x=this.commandMap_[b];if(x.name.indexOf(m)===0)return x}}}buildCommandMap_(){this.commandMap_={};for(var m=0;m<d.length;m++){var v=d[m],b=v.shortName||v.name;this.commandMap_[b]=v}}map(m,v,b,x){if(m!=":"&&m.charAt(0)==":"){if(b)throw Error("Mode not supported for ex mappings");var k=m.substring(1);v!=":"&&v.charAt(0)==":"?this.commandMap_[k]={name:k,type:"exToEx",toInput:v.substring(1),user:!0}:this.commandMap_[k]={name:k,type:"exToKey",toKeys:v,user:!0}}else{var R={keys:m,type:"keyToKey",toKeys:v,noremap:!!x};b&&(R.context=b),oi(R)}}unmap(m,v){if(m!=":"&&m.charAt(0)==":"){if(v)throw Error("Mode not supported for ex mappings");var b=m.substring(1);if(this.commandMap_[b]&&this.commandMap_[b].user)return delete this.commandMap_[b],!0}else for(var x=m,k=0;k<o.length;k++)if(x==o[k].keys&&o[k].context===v)return o.splice(k,1),Vs(x),!0}}var xr={colorscheme:function(u,m){if(!m.args||m.args.length<1){ct(u,u.getOption("theme"));return}u.setOption("theme",m.args[0])},map:function(u,m,v,b){var x=m.args;if(!x||x.length<2){u&&ct(u,"Invalid mapping: "+m.input);return}_n.map(x[0],x[1],v,b)},imap:function(u,m){this.map(u,m,"insert")},nmap:function(u,m){this.map(u,m,"normal")},vmap:function(u,m){this.map(u,m,"visual")},omap:function(u,m){this.map(u,m,"operatorPending")},noremap:function(u,m){this.map(u,m,void 0,!0)},inoremap:function(u,m){this.map(u,m,"insert",!0)},nnoremap:function(u,m){this.map(u,m,"normal",!0)},vnoremap:function(u,m){this.map(u,m,"visual",!0)},onoremap:function(u,m){this.map(u,m,"operatorPending",!0)},unmap:function(u,m,v){var b=m.args;(!b||b.length<1||!_n.unmap(b[0],v))&&u&&ct(u,"No such mapping: "+m.input)},mapclear:function(u,m){Be.mapclear()},imapclear:function(u,m){Be.mapclear("insert")},nmapclear:function(u,m){Be.mapclear("normal")},vmapclear:function(u,m){Be.mapclear("visual")},omapclear:function(u,m){Be.mapclear("operatorPending")},move:function(u,m){Pn.processCommand(u,u.state.vim,{keys:"",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:m.line+1})},set:function(u,m){var v=m.args,b=m.setCfg||{};if(!v||v.length<1){u&&ct(u,"Invalid mapping: "+m.input);return}var x=v[0].split("="),k=x.shift()||"",R=x.length>0?x.join("="):void 0,O=!1,L=!1;if(k.charAt(k.length-1)=="?"){if(R)throw Error("Trailing characters: "+m.argString);k=k.substring(0,k.length-1),O=!0}else k.charAt(k.length-1)=="!"&&(k=k.substring(0,k.length-1),L=!0);R===void 0&&k.substring(0,2)=="no"&&(k=k.substring(2),R=!1);var z=fe[k]&&fe[k].type=="boolean";if(z&&(L?R=!be(k,u,b):R??(R=!0)),!z&&R===void 0||O){var q=be(k,u,b);q instanceof Error?ct(u,q.message):q===!0||q===!1?ct(u," "+(q?"":"no")+k):ct(u," "+k+"="+q)}else{var oe=J(k,R,u,b);oe instanceof Error&&ct(u,oe.message)}},setlocal:function(u,m){m.setCfg={scope:"local"},this.set(u,m)},setglobal:function(u,m){m.setCfg={scope:"global"},this.set(u,m)},registers:function(u,m){var v=m.args,b=Q.registerController.registers,x=`----------Registers----------
109
109
 
110
110
  `;if(v)for(var k=v.join(""),R=0;R<k.length;R++){var O=k.charAt(R);if(Q.registerController.isValidRegister(O)){var L=b[O]||new nn;x+='"'+O+" "+L.toString()+`
111
111
  `}}else for(var O in b){var z=b[O].toString();z.length&&(x+='"'+O+" "+z+`
@@ -116,24 +116,24 @@ mark line col
116
116
  `)}else for(var O in b){var L=b[O]&&b[O].find();L&&(x+=O+" "+L.line+" "+L.ch+`
117
117
  `)}ct(u,x,!0)},sort:function(u,m){var v,b,x,k,R;function O(){if(m.argString){var Ue=new e.StringStream(m.argString);if(Ue.eat("!")&&(v=!0),Ue.eol())return;if(!Ue.eatSpace())return"Invalid arguments";var $e=Ue.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!$e||!Ue.eol())return"Invalid arguments";if($e[1]){b=$e[1].indexOf("i")!=-1,x=$e[1].indexOf("u")!=-1;var $t=$e[1].indexOf("d")!=-1||$e[1].indexOf("n")!=-1,rn=$e[1].indexOf("x")!=-1,pn=$e[1].indexOf("o")!=-1;if(Number($t)+Number(rn)+Number(pn)>1)return"Invalid arguments";k=$t&&"decimal"||rn&&"hex"||pn&&"octal"}$e[2]&&(R=new RegExp($e[2].substr(1,$e[2].length-2),b?"i":""))}}var L=O();if(L){ct(u,L+": "+m.argString);return}var z=m.line||u.firstLine(),q=m.lineEnd||m.line||u.lastLine();if(z==q)return;var oe=new n(z,0),ie=new n(q,St(u,q)),X=u.getRange(oe,ie).split(`
118
118
  `),Y=k=="decimal"?/(-?)([\d]+)/:k=="hex"?/(-?)(?:0x)?([0-9a-f]+)/i:k=="octal"?/([0-7]+)/:null,xe=k=="decimal"?10:k=="hex"?16:k=="octal"?8:void 0,_e=[],qe=[];if(k||R)for(var Re=0;Re<X.length;Re++){var Ne=R?X[Re].match(R):null;Ne&&Ne[0]!=""?_e.push(Ne):Y&&Y.exec(X[Re])?_e.push(X[Re]):qe.push(X[Re])}else qe=X;function dt(Ue,$e){if(v){var $t=Ue;Ue=$e,$e=$t}b&&(Ue=Ue.toLowerCase(),$e=$e.toLowerCase());var rn=Y&&Y.exec(Ue),pn=Y&&Y.exec($e);return!rn||!pn?Ue<$e?-1:1:parseInt((rn[1]+rn[2]).toLowerCase(),xe)-parseInt((pn[1]+pn[2]).toLowerCase(),xe)}function Je(Ue,$e){if(v){var $t=Ue;Ue=$e,$e=$t}return b&&(Ue[0]=Ue[0].toLowerCase(),$e[0]=$e[0].toLowerCase()),Ue[0]<$e[0]?-1:1}if(_e.sort(R?Je:dt),R)for(var Re=0;Re<_e.length;Re++)_e[Re]=_e[Re].input;else k||qe.sort(dt);if(X=v?_e.concat(qe):qe.concat(_e),x){var Nt=X,Ft;X=[];for(var Re=0;Re<Nt.length;Re++)Nt[Re]!=Ft&&X.push(Nt[Re]),Ft=Nt[Re]}u.replaceRange(X.join(`
119
- `),oe,ie)},vglobal:function(u,m){this.global(u,m)},normal:function(u,m){var v=!1,b=m.argString;if(b&&b[0]=="!"&&(b=b.slice(1),v=!0),b=b.trimStart(),!b){ct(u,"Argument is required.");return}var x=m.line;if(typeof x=="number")for(var k=isNaN(m.lineEnd)?x:m.lineEnd,R=x;R<=k;R++)u.setCursor(R,0),mt(u,m.argString.trimStart(),{noremap:v}),u.state.vim.insertMode&&Hn(u,!0);else mt(u,m.argString.trimStart(),{noremap:v}),u.state.vim.insertMode&&Hn(u,!0)},global:function(u,m){var v=m.argString;if(!v){ct(u,"Regular Expression missing from global");return}var b=m.commandName[0]==="v";v[0]==="!"&&m.commandName[0]==="g"&&(b=!0,v=v.slice(1));var x=m.line===void 0?u.firstLine():m.line,k=m.lineEnd||m.line||u.lastLine(),R=yc(v),O=v,L="";if(R&&R.length&&(O=R[0],L=R.slice(1,R.length).join("/")),O)try{_i(u,O,!0,!0)}catch{ct(u,"Invalid regex: "+O);return}for(var z=Kn(u).getQuery(),q=[],oe=x;oe<=k;oe++){var ie=u.getLine(oe);z.test(ie)!==b&&q.push(L?u.getLineHandle(oe):ie)}if(!L){ct(u,q.join(`
120
- `));return}var X=0,Y=function(){if(X<q.length){var xe=q[X++],_e=u.getLineNumber(xe);if(_e==null){Y();return}var qe=_e+1+L;_n.processCommand(u,qe,{callback:Y})}else u.releaseLineHandles&&u.releaseLineHandles()};Y()},substitute:function(u,m){if(!u.getSearchCursor)throw Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var v=m.argString,b=v?Wa(v,v[0]):[],x="",k="",R,O,L,z=!1,q=!1;if(b&&b.length)x=b[0],be("pcre")&&x!==""&&(x=new RegExp(x).source),k=b[1],k!==void 0&&(k=be("pcre")?Bs(k.replace(/([^\\])&/g,"$1$$&")):vc(k),Q.lastSubstituteReplacePart=k),R=b[2]?b[2].split(" "):[];else if(v&&v.length){ct(u,"Substitutions should be of the form :s/pattern/replace/");return}if(R&&(O=R[0],L=parseInt(R[1]),O&&(O.indexOf("c")!=-1&&(z=!0),O.indexOf("g")!=-1&&(q=!0),x=be("pcre")?x+"/"+O:x.replace(/\//g,"\\/")+"/"+O)),x)try{_i(u,x,!0,!0)}catch{ct(u,"Invalid regex: "+x);return}if(k||(k=Q.lastSubstituteReplacePart),k===void 0){ct(u,"No previous substitute regular expression");return}var oe=Kn(u).getQuery(),ie=m.line===void 0?u.getCursor().line:m.line,X=m.lineEnd||ie;ie==u.firstLine()&&X==u.lastLine()&&(X=1/0),L&&(ie=X,X=ie+L-1);var Y=zt(u,new n(ie,0)),xe=u.getSearchCursor(oe,Y);Vs(u,z,q,ie,X,xe,oe,k,m.callback)},startinsert:function(u,m){mt(u,m.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){ki(u)},yank:function(u){var m=Ge(u.getCursor()).line,v=u.getLine(m);Q.registerController.pushText("0","yank",v,!0,!0)},delete:function(u,m){var v=m.selectionLine,b=isNaN(m.selectionLineEnd)?v:m.selectionLineEnd;Ut.delete(u,{linewise:!0},[{anchor:new n(v,0),head:new n(b+1,0)}])},join:function(u,m){var v=m.selectionLine,b=isNaN(m.selectionLineEnd)?v:m.selectionLineEnd;u.setCursor(new n(v,0)),fn.joinLines(u,{repeat:b-v},u.state.vim)},delmarks:function(u,m){if(!m.argString||!ir(m.argString)){ct(u,"Argument required");return}for(var v=u.state.vim,b=new e.StringStream(ir(m.argString));!b.eol();){b.eatSpace();var x=b.pos;if(!b.match(/[a-zA-Z]/,!1)){ct(u,"Invalid argument: "+m.argString.substring(x));return}var k=b.next();if(b.match("-",!0)){if(!b.match(/[a-zA-Z]/,!1)){ct(u,"Invalid argument: "+m.argString.substring(x));return}var R=k,O=b.next();if(R&&O&&N(R)==N(O)){var L=R.charCodeAt(0),z=O.charCodeAt(0);if(L>=z){ct(u,"Invalid argument: "+m.argString.substring(x));return}for(var q=0;q<=z-L;q++){var oe=String.fromCharCode(L+q);delete v.marks[oe]}}else{ct(u,"Invalid argument: "+R+"-");return}}else k&&delete v.marks[k]}}},_n=new Vo;Be.defineEx("version","ve",u=>{ct(u,"Codemirror-vim version: 6.3.0")});function Vs(u,m,v,b,x,k,R,O,L){u.state.vim.exMode=!0;var z=!1,q=0,oe,ie,X;function Y(){u.operation(function(){for(;!z;)xe(),qe();Re()})}function xe(){var dt="",Je=k.match||k.pos&&k.pos.match;dt=Je?O.replace(/\$(\d{1,3}|[$&])/g,function(Ft,Ue){if(Ue=="$")return"$";if(Ue=="&")return Je[0];for(var $e=Ue;parseInt($e)>=Je.length&&$e.length>0;)$e=$e.slice(0,$e.length-1);return $e?Je[$e]+Ue.slice($e.length,Ue.length):Ft}):u.getRange(k.from(),k.to()).replace(R,O);var Nt=k.to().line;k.replace(dt),ie=k.to().line,x+=ie-Nt,X=ie<Nt}function _e(){var dt=oe&&Ge(k.to()),Je=k.findNext();return Je&&!Je[0]&&dt&&gt(k.from(),dt)&&(Je=k.findNext()),Je&&q++,Je}function qe(){for(;_e()&&_c(k.from(),b,x);)if(!(!v&&k.from().line==ie&&!X)){u.scrollIntoView(k.from(),30),u.setSelection(k.from(),k.to()),oe=k.from(),z=!1;return}z=!0}function Re(dt){if(dt&&dt(),u.focus(),oe){u.setCursor(oe);var Je=u.state.vim;Je.exMode=!1,Je.lastHPos=Je.lastHSPos=oe.ch}L?L():z&&ct(u,(q?"Found "+q+" matches":"No matches found")+" for pattern: "+R+(be("pcre")?" (set nopcre to use Vim regexps)":""))}function Ne(dt,Je,Nt){switch(e.e_stop(dt),tn(dt)){case"y":xe(),qe();break;case"n":qe();break;case"a":var Ft=L;L=void 0,u.operation(Y),L=Ft;break;case"l":xe();case"q":case"<Esc>":case"<C-c>":case"<C-[>":Re(Nt);break}return z&&Re(Nt),!0}if(qe(),z){ct(u,"No matches for "+R+(be("pcre")?" (set nopcre to use vim regexps)":""));return}if(!m){Y(),L&&L();return}aa(u,{prefix:Nn("span","replace with ",Nn("strong",O)," (y/n/a/q/l)"),onKeyDown:Ne})}function Hn(u,m){var v=u.state.vim,b=Q.macroModeState,x=Q.registerController.getRegister("."),k=b.isPlaying,R=b.lastInsertModeChanges;k||(u.off("change",Wr),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=void 0,e.off(u.getInputField(),"keydown",Us)),!k&&v.insertModeRepeat&&v.insertModeRepeat>1&&(Xa(u,v,v.insertModeRepeat-1,!0),v.lastEditInputState.repeatOverride=v.insertModeRepeat),delete v.insertModeRepeat,v.insertMode=!1,m||u.setCursor(u.getCursor().line,u.getCursor().ch-1),u.setOption("keyMap","vim"),u.setOption("disableInput",!0),u.toggleOverwrite(!1),x.setText(R.changes.join("")),e.signal(u,"vim-mode-change",{mode:"normal"}),b.isRecording&&Ws(b)}function oi(u){o.unshift(u),u.keys&&kc(u.keys)}function kc(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){m&&(s[m]||(s[m]=0),s[m]++)})}function $s(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){s[m]&&s[m]--})}function Sc(u,m,v,b,x){var k={keys:u,type:m};for(var R in k[m]=v,k[m+"Args"]=b,x)k[R]=x[R];oi(k)}we("insertModeEscKeysTimeout",200,"number");function Qa(u,m,v,b){var x=Q.registerController.getRegister(b);if(b==":"){x.keyBuffer[0]&&_n.processCommand(u,x.keyBuffer[0]),v.isPlaying=!1;return}var k=x.keyBuffer,R=0;v.isPlaying=!0,v.replaySearchQueries=x.searchQueries.slice(0);for(var O=0;O<k.length;O++)for(var L=k[O],z,q,oe=/<(?:[CSMA]-)*\w+>|./gi;z=oe.exec(L);)if(q=z[0],Be.handleKey(u,q,"macro"),m.insertMode){var ie=x.insertModeChanges[R++].changes;Q.macroModeState.lastInsertModeChanges.changes=ie,Ks(u,ie,1),Hn(u)}v.isPlaying=!1}function $r(u,m){if(!u.isPlaying){var v=u.latestRegister,b=Q.registerController.getRegister(v);b&&b.pushText(m)}}function Ws(u){if(!u.isPlaying){var m=u.latestRegister,v=Q.registerController.getRegister(m);v&&v.pushInsertModeChanges&&v.pushInsertModeChanges(u.lastInsertModeChanges)}}function Ga(u,m){if(!u.isPlaying){var v=u.latestRegister,b=Q.registerController.getRegister(v);b&&b.pushSearchQuery&&b.pushSearchQuery(m)}}function Wr(u,m){var v=Q.macroModeState,b=v.lastInsertModeChanges;if(!v.isPlaying)for(var x=u.state.vim;m;){if(b.expectCursorActivityForChange=!0,b.ignoreCount>1)b.ignoreCount--;else if(m.origin=="+input"||m.origin=="paste"||m.origin===void 0){var k=u.listSelections().length;k>1&&(b.ignoreCount=k);var R=m.text.join(`
121
- `);if(b.maybeReset&&(b.maybeReset=(b.changes=[],!1)),R)if(u.state.overwrite&&!/\n/.test(R))b.changes.push([R]);else{if(R.length>1){var O=x&&x.insertEnd&&x.insertEnd.find(),L=u.getCursor();if(O&&O.line==L.line){var z=O.ch-L.ch;z>0&&z<R.length&&(b.changes.push([R,z]),R="")}}R&&b.changes.push(R)}}m=m.next}}function $o(u){var x;var m=u.state.vim;if(m.insertMode){var v=Q.macroModeState;if(v.isPlaying)return;var b=v.lastInsertModeChanges;b.expectCursorActivityForChange?b.expectCursorActivityForChange=!1:(b.maybeReset=!0,m.insertEnd&&m.insertEnd.clear(),m.insertEnd=u.setBookmark(u.getCursor(),{insertLeft:!0}))}else(x=u.curOp)!=null&&x.isVimOp||Ja(u,m)}function Ja(u,m){var v=u.getCursor("anchor"),b=u.getCursor("head");if(m.visualMode&&!u.somethingSelected()?Ye(u,!1):!m.visualMode&&!m.insertMode&&u.somethingSelected()&&(m.visualMode=!0,m.visualLine=!1,e.signal(u,"vim-mode-change",{mode:"visual"})),m.visualMode){var x=xt(b,v)?0:-1,k=xt(b,v)?-1:0;b=_t(b,0,x),v=_t(v,0,k),m.sel={anchor:v,head:b},Fn(u,m,"<",kt(b,v)),Fn(u,m,">",jn(b,v))}else m.insertMode||(m.lastHPos=u.getCursor().ch)}function Us(u){var m=Q.macroModeState.lastInsertModeChanges,v=e.keyName?e.keyName(u):u.key;v&&(v.indexOf("Delete")!=-1||v.indexOf("Backspace")!=-1)&&(m.maybeReset&&(m.maybeReset=(m.changes=[],!1)),m.changes.push(new Fe(v,u)))}function Xa(u,m,v,b){var x=Q.macroModeState;x.isPlaying=!0;var k=m.lastEditActionCommand,R=m.inputState;function O(){k?Pn.processAction(u,m,k):Pn.evalInput(u,m)}function L(q){if(x.lastInsertModeChanges.changes.length>0){q=m.lastEditActionCommand?q:1;var oe=x.lastInsertModeChanges;Ks(u,oe.changes,q)}}if(m.inputState=m.lastEditInputState,k&&k.interlaceInsertRepeat)for(var z=0;z<v;z++)O(),L(1);else b||O(),L(v);m.inputState=R,m.insertMode&&!b&&Hn(u),x.isPlaying=!1}function Ya(u,m){e.lookupKey(m,"vim-insert",function(v){return typeof v=="string"?e.commands[v](u):v(u),!0})}function Ks(u,m,v){var b=u.getCursor("head"),x=Q.macroModeState.lastInsertModeChanges.visualBlock;x&&(ar(u,b,x+1),v=u.listSelections().length,u.setCursor(b));for(var k=0;k<v;k++){x&&u.setCursor(_t(b,k,0));for(var R=0;R<m.length;R++){var O=m[R];if(O instanceof Fe)Ya(u,O.keyName);else if(typeof O=="string")u.replaceSelection(O);else{var L=u.getCursor(),z=_t(L,0,O[0].length-(O[1]||0));u.replaceRange(O[0],L,O[1]?L:z),u.setCursor(z)}}}x&&u.setCursor(_t(b,0,1))}function xn(u){var m=new u.constructor;return Object.keys(u).forEach(function(v){if(v!="insertEnd"){var b=u[v];Array.isArray(b)?b=b.slice():b&&typeof b=="object"&&b.constructor!=Object&&(b=xn(b)),m[v]=b}}),u.sel&&(m.sel={head:u.sel.head&&Ge(u.sel.head),anchor:u.sel.anchor&&Ge(u.sel.anchor)}),m}function Si(u,m,v){var k=se(u),b=u,x=!1,k=Be.maybeInitVimState_(b),R=k.visualBlock||k.wasInVisualBlock;if(b.state.closeVimNotification){var O=b.state.closeVimNotification;if(b.state.closeVimNotification=null,O(),m=="<CR>")return pt(b),!0}var L=b.isInMultiSelectMode();if(k.wasInVisualBlock&&!L?k.wasInVisualBlock=!1:L&&k.visualBlock&&(k.wasInVisualBlock=!0),m=="<Esc>"&&!k.insertMode&&!k.visualMode&&L&&k.status=="<Esc>")pt(b);else if(R||!L||b.inVirtualSelectionMode)x=Be.handleKey(b,m,v);else{var z=xn(k),q=k.inputState.changeQueueList||[];b.operation(function(){var ie;b.curOp&&(b.curOp.isVimOp=!0);var oe=0;b.forEachSelection(function(){b.state.vim.inputState.changeQueue=q[oe];var X=b.getCursor("head"),Y=b.getCursor("anchor"),xe=xt(X,Y)?0:-1,_e=xt(X,Y)?-1:0;X=_t(X,0,xe),Y=_t(Y,0,_e),b.state.vim.sel.head=X,b.state.vim.sel.anchor=Y,x=Be.handleKey(b,m,v),b.virtualSelection&&(q[oe]=b.state.vim.inputState.changeQueue,b.state.vim=xn(z)),oe++}),(ie=b.curOp)!=null&&ie.cursorActivity&&!x&&(b.curOp.cursorActivity=!1),b.state.vim=k,k.inputState.changeQueueList=q,k.inputState.changeQueue=null},!0)}return x&&!k.visualMode&&!k.insertMode&&k.visualMode!=b.somethingSelected()&&Ja(b,k),x}return Le(),Be}function rr(e,n){var i=n.ch,o=n.line+1;o<1&&(o=1,i=0),o>e.lines&&(o=e.lines,i=Number.MAX_VALUE);var s=e.line(o);return Math.min(s.from+Math.max(0,i),s.to)}function qr(e,n){let i=e.lineAt(n);return{line:i.number-1,ch:n-i.from}}var ti=class{constructor(e,n){this.line=e,this.ch=n}};function gy(e,n,i){if(e.addEventListener)e.addEventListener(n,i,!1);else{var o=e._handlers||(e._handlers={});o[n]=(o[n]||[]).concat(i)}}function yy(e,n,i){if(e.removeEventListener)e.removeEventListener(n,i,!1);else{var o=e._handlers,s=o&&o[n];if(s){var c=s.indexOf(i);c>-1&&(o[n]=s.slice(0,c).concat(s.slice(c+1)))}}}function vy(e,n,...i){var c;var o=(c=e._handlers)==null?void 0:c[n];if(o)for(var s=0;s<o.length;++s)o[s](...i)}function by(e,...n){if(e)for(var i=0;i<e.length;++i)e[i](...n)}var Xd;try{Xd=RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch{Xd=/[\w]/}function Ns(e,n){var i=e.cm6;if(!i.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 i.dispatch(n)}}function wy(e,n){var o;e.curOp&&(e.curOp.$changeStart=void 0),(n?B4:H4)(e.cm6);let i=(o=e.curOp)==null?void 0:o.$changeStart;i!=null&&e.cm6.dispatch({selection:{anchor:i}})}var nC={Left:e=>ks(e.cm6,{key:"Left"},"editor"),Right:e=>ks(e.cm6,{key:"Right"},"editor"),Up:e=>ks(e.cm6,{key:"Up"},"editor"),Down:e=>ks(e.cm6,{key:"Down"},"editor"),Backspace:e=>ks(e.cm6,{key:"Backspace"},"editor"),Delete:e=>ks(e.cm6,{key:"Delete"},"editor")},Xe=class _x{openDialog(n,i,o){return iC(this,n,i,o)}openNotification(n,i){return rC(this,n,i)}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,i){gy(this,n,i)}off(n,i){yy(this,n,i)}signal(n,i,o){vy(this,n,i,o)}indexFromPos(n){return rr(this.cm6.state.doc,n)}posFromIndex(n){return qr(this.cm6.state.doc,n)}foldCode(n){let i=this.cm6,o=i.state.selection.ranges,s=this.cm6.state.doc,c=rr(s,n),d=mn.create([mn.range(c,c)],0).ranges;i.state.selection.ranges=d,T4(i),i.state.selection.ranges=o}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(n,i){typeof n=="object"&&(i=n.ch,n=n.line);var o=rr(this.cm6.state.doc,{line:n,ch:i||0});this.cm6.dispatch({selection:{anchor:o}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(n){var i=this.cm6.state.selection.main,o=n=="head"||!n?i.head:n=="anchor"?i.anchor:n=="start"?i.from:n=="end"?i.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(i=>({anchor:qr(n,i.anchor),head:qr(n,i.head)}))}setSelections(n,i){var o=this.cm6.state.doc,s=n.map(c=>{var d=rr(o,c.head),f=rr(o,c.anchor);return d==f?mn.cursor(d,1):mn.range(f,d)});this.cm6.dispatch({selection:mn.create(s,i)})}setSelection(n,i,o){this.setSelections([{anchor:n,head:i}],0),o&&o.origin=="*mouse"&&this.onBeforeEndOperation()}getLine(n){var i=this.cm6.state.doc;return n<0||n>=i.lines?"":this.cm6.state.doc.line(n+1).text}getLineHandle(n){return this.$lineHandleChanges||(this.$lineHandleChanges=[]),{row:n,index:this.indexFromPos(new ti(n,0))}}getLineNumber(n){var i=this.$lineHandleChanges;if(!i)return null;for(var o=n.index,s=0;s<i.length;s++)if(o=i[s].changes.mapPos(o,1,uw.TrackAfter),o==null)return null;var c=this.posFromIndex(o);return c.ch==0?c.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(n,i){var o=this.cm6.state.doc;return this.cm6.state.sliceDoc(rr(o,n),rr(o,i))}replaceRange(n,i,o,s){o||(o=i);var c=this.cm6.state.doc,d=rr(c,i),f=rr(c,o);Ns(this,{changes:{from:d,to:f,insert:n}})}replaceSelection(n){Ns(this,this.cm6.state.replaceSelection(n))}replaceSelections(n){var i=this.cm6.state.selection.ranges.map((o,s)=>({from:o.from,to:o.to,insert:n[s]||""}));Ns(this,{changes:i})}getSelection(){return this.getSelections().join(`
119
+ `),oe,ie)},vglobal:function(u,m){this.global(u,m)},normal:function(u,m){var v=!1,b=m.argString;if(b&&b[0]=="!"&&(b=b.slice(1),v=!0),b=b.trimStart(),!b){ct(u,"Argument is required.");return}var x=m.line;if(typeof x=="number")for(var k=isNaN(m.lineEnd)?x:m.lineEnd,R=x;R<=k;R++)u.setCursor(R,0),mt(u,m.argString.trimStart(),{noremap:v}),u.state.vim.insertMode&&Vn(u,!0);else mt(u,m.argString.trimStart(),{noremap:v}),u.state.vim.insertMode&&Vn(u,!0)},global:function(u,m){var v=m.argString;if(!v){ct(u,"Regular Expression missing from global");return}var b=m.commandName[0]==="v";v[0]==="!"&&m.commandName[0]==="g"&&(b=!0,v=v.slice(1));var x=m.line===void 0?u.firstLine():m.line,k=m.lineEnd||m.line||u.lastLine(),R=yc(v),O=v,L="";if(R&&R.length&&(O=R[0],L=R.slice(1,R.length).join("/")),O)try{_i(u,O,!0,!0)}catch{ct(u,"Invalid regex: "+O);return}for(var z=Kn(u).getQuery(),q=[],oe=x;oe<=k;oe++){var ie=u.getLine(oe);z.test(ie)!==b&&q.push(L?u.getLineHandle(oe):ie)}if(!L){ct(u,q.join(`
120
+ `));return}var X=0,Y=function(){if(X<q.length){var xe=q[X++],_e=u.getLineNumber(xe);if(_e==null){Y();return}var qe=_e+1+L;_n.processCommand(u,qe,{callback:Y})}else u.releaseLineHandles&&u.releaseLineHandles()};Y()},substitute:function(u,m){if(!u.getSearchCursor)throw Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var v=m.argString,b=v?Wa(v,v[0]):[],x="",k="",R,O,L,z=!1,q=!1;if(b&&b.length)x=b[0],be("pcre")&&x!==""&&(x=new RegExp(x).source),k=b[1],k!==void 0&&(k=be("pcre")?Fs(k.replace(/([^\\])&/g,"$1$$&")):vc(k),Q.lastSubstituteReplacePart=k),R=b[2]?b[2].split(" "):[];else if(v&&v.length){ct(u,"Substitutions should be of the form :s/pattern/replace/");return}if(R&&(O=R[0],L=parseInt(R[1]),O&&(O.indexOf("c")!=-1&&(z=!0),O.indexOf("g")!=-1&&(q=!0),x=be("pcre")?x+"/"+O:x.replace(/\//g,"\\/")+"/"+O)),x)try{_i(u,x,!0,!0)}catch{ct(u,"Invalid regex: "+x);return}if(k||(k=Q.lastSubstituteReplacePart),k===void 0){ct(u,"No previous substitute regular expression");return}var oe=Kn(u).getQuery(),ie=m.line===void 0?u.getCursor().line:m.line,X=m.lineEnd||ie;ie==u.firstLine()&&X==u.lastLine()&&(X=1/0),L&&(ie=X,X=ie+L-1);var Y=zt(u,new n(ie,0)),xe=u.getSearchCursor(oe,Y);Hs(u,z,q,ie,X,xe,oe,k,m.callback)},startinsert:function(u,m){mt(u,m.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){ki(u)},yank:function(u){var m=Ge(u.getCursor()).line,v=u.getLine(m);Q.registerController.pushText("0","yank",v,!0,!0)},delete:function(u,m){var v=m.selectionLine,b=isNaN(m.selectionLineEnd)?v:m.selectionLineEnd;Ut.delete(u,{linewise:!0},[{anchor:new n(v,0),head:new n(b+1,0)}])},join:function(u,m){var v=m.selectionLine,b=isNaN(m.selectionLineEnd)?v:m.selectionLineEnd;u.setCursor(new n(v,0)),fn.joinLines(u,{repeat:b-v},u.state.vim)},delmarks:function(u,m){if(!m.argString||!ir(m.argString)){ct(u,"Argument required");return}for(var v=u.state.vim,b=new e.StringStream(ir(m.argString));!b.eol();){b.eatSpace();var x=b.pos;if(!b.match(/[a-zA-Z]/,!1)){ct(u,"Invalid argument: "+m.argString.substring(x));return}var k=b.next();if(b.match("-",!0)){if(!b.match(/[a-zA-Z]/,!1)){ct(u,"Invalid argument: "+m.argString.substring(x));return}var R=k,O=b.next();if(R&&O&&N(R)==N(O)){var L=R.charCodeAt(0),z=O.charCodeAt(0);if(L>=z){ct(u,"Invalid argument: "+m.argString.substring(x));return}for(var q=0;q<=z-L;q++){var oe=String.fromCharCode(L+q);delete v.marks[oe]}}else{ct(u,"Invalid argument: "+R+"-");return}}else k&&delete v.marks[k]}}},_n=new Vo;Be.defineEx("version","ve",u=>{ct(u,"Codemirror-vim version: 6.3.0")});function Hs(u,m,v,b,x,k,R,O,L){u.state.vim.exMode=!0;var z=!1,q=0,oe,ie,X;function Y(){u.operation(function(){for(;!z;)xe(),qe();Re()})}function xe(){var dt="",Je=k.match||k.pos&&k.pos.match;dt=Je?O.replace(/\$(\d{1,3}|[$&])/g,function(Ft,Ue){if(Ue=="$")return"$";if(Ue=="&")return Je[0];for(var $e=Ue;parseInt($e)>=Je.length&&$e.length>0;)$e=$e.slice(0,$e.length-1);return $e?Je[$e]+Ue.slice($e.length,Ue.length):Ft}):u.getRange(k.from(),k.to()).replace(R,O);var Nt=k.to().line;k.replace(dt),ie=k.to().line,x+=ie-Nt,X=ie<Nt}function _e(){var dt=oe&&Ge(k.to()),Je=k.findNext();return Je&&!Je[0]&&dt&&gt(k.from(),dt)&&(Je=k.findNext()),Je&&q++,Je}function qe(){for(;_e()&&_c(k.from(),b,x);)if(!(!v&&k.from().line==ie&&!X)){u.scrollIntoView(k.from(),30),u.setSelection(k.from(),k.to()),oe=k.from(),z=!1;return}z=!0}function Re(dt){if(dt&&dt(),u.focus(),oe){u.setCursor(oe);var Je=u.state.vim;Je.exMode=!1,Je.lastHPos=Je.lastHSPos=oe.ch}L?L():z&&ct(u,(q?"Found "+q+" matches":"No matches found")+" for pattern: "+R+(be("pcre")?" (set nopcre to use Vim regexps)":""))}function Ne(dt,Je,Nt){switch(e.e_stop(dt),tn(dt)){case"y":xe(),qe();break;case"n":qe();break;case"a":var Ft=L;L=void 0,u.operation(Y),L=Ft;break;case"l":xe();case"q":case"<Esc>":case"<C-c>":case"<C-[>":Re(Nt);break}return z&&Re(Nt),!0}if(qe(),z){ct(u,"No matches for "+R+(be("pcre")?" (set nopcre to use vim regexps)":""));return}if(!m){Y(),L&&L();return}aa(u,{prefix:Nn("span","replace with ",Nn("strong",O)," (y/n/a/q/l)"),onKeyDown:Ne})}function Vn(u,m){var v=u.state.vim,b=Q.macroModeState,x=Q.registerController.getRegister("."),k=b.isPlaying,R=b.lastInsertModeChanges;k||(u.off("change",Wr),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=void 0,e.off(u.getInputField(),"keydown",Ws)),!k&&v.insertModeRepeat&&v.insertModeRepeat>1&&(Xa(u,v,v.insertModeRepeat-1,!0),v.lastEditInputState.repeatOverride=v.insertModeRepeat),delete v.insertModeRepeat,v.insertMode=!1,m||u.setCursor(u.getCursor().line,u.getCursor().ch-1),u.setOption("keyMap","vim"),u.setOption("disableInput",!0),u.toggleOverwrite(!1),x.setText(R.changes.join("")),e.signal(u,"vim-mode-change",{mode:"normal"}),b.isRecording&&$s(b)}function oi(u){o.unshift(u),u.keys&&kc(u.keys)}function kc(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){m&&(s[m]||(s[m]=0),s[m]++)})}function Vs(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){s[m]&&s[m]--})}function Sc(u,m,v,b,x){var k={keys:u,type:m};for(var R in k[m]=v,k[m+"Args"]=b,x)k[R]=x[R];oi(k)}we("insertModeEscKeysTimeout",200,"number");function Qa(u,m,v,b){var x=Q.registerController.getRegister(b);if(b==":"){x.keyBuffer[0]&&_n.processCommand(u,x.keyBuffer[0]),v.isPlaying=!1;return}var k=x.keyBuffer,R=0;v.isPlaying=!0,v.replaySearchQueries=x.searchQueries.slice(0);for(var O=0;O<k.length;O++)for(var L=k[O],z,q,oe=/<(?:[CSMA]-)*\w+>|./gi;z=oe.exec(L);)if(q=z[0],Be.handleKey(u,q,"macro"),m.insertMode){var ie=x.insertModeChanges[R++].changes;Q.macroModeState.lastInsertModeChanges.changes=ie,Us(u,ie,1),Vn(u)}v.isPlaying=!1}function $r(u,m){if(!u.isPlaying){var v=u.latestRegister,b=Q.registerController.getRegister(v);b&&b.pushText(m)}}function $s(u){if(!u.isPlaying){var m=u.latestRegister,v=Q.registerController.getRegister(m);v&&v.pushInsertModeChanges&&v.pushInsertModeChanges(u.lastInsertModeChanges)}}function Ga(u,m){if(!u.isPlaying){var v=u.latestRegister,b=Q.registerController.getRegister(v);b&&b.pushSearchQuery&&b.pushSearchQuery(m)}}function Wr(u,m){var v=Q.macroModeState,b=v.lastInsertModeChanges;if(!v.isPlaying)for(var x=u.state.vim;m;){if(b.expectCursorActivityForChange=!0,b.ignoreCount>1)b.ignoreCount--;else if(m.origin=="+input"||m.origin=="paste"||m.origin===void 0){var k=u.listSelections().length;k>1&&(b.ignoreCount=k);var R=m.text.join(`
121
+ `);if(b.maybeReset&&(b.maybeReset=(b.changes=[],!1)),R)if(u.state.overwrite&&!/\n/.test(R))b.changes.push([R]);else{if(R.length>1){var O=x&&x.insertEnd&&x.insertEnd.find(),L=u.getCursor();if(O&&O.line==L.line){var z=O.ch-L.ch;z>0&&z<R.length&&(b.changes.push([R,z]),R="")}}R&&b.changes.push(R)}}m=m.next}}function $o(u){var x;var m=u.state.vim;if(m.insertMode){var v=Q.macroModeState;if(v.isPlaying)return;var b=v.lastInsertModeChanges;b.expectCursorActivityForChange?b.expectCursorActivityForChange=!1:(b.maybeReset=!0,m.insertEnd&&m.insertEnd.clear(),m.insertEnd=u.setBookmark(u.getCursor(),{insertLeft:!0}))}else(x=u.curOp)!=null&&x.isVimOp||Ja(u,m)}function Ja(u,m){var v=u.getCursor("anchor"),b=u.getCursor("head");if(m.visualMode&&!u.somethingSelected()?Ye(u,!1):!m.visualMode&&!m.insertMode&&u.somethingSelected()&&(m.visualMode=!0,m.visualLine=!1,e.signal(u,"vim-mode-change",{mode:"visual"})),m.visualMode){var x=xt(b,v)?0:-1,k=xt(b,v)?-1:0;b=_t(b,0,x),v=_t(v,0,k),m.sel={anchor:v,head:b},Bn(u,m,"<",kt(b,v)),Bn(u,m,">",zn(b,v))}else m.insertMode||(m.lastHPos=u.getCursor().ch)}function Ws(u){var m=Q.macroModeState.lastInsertModeChanges,v=e.keyName?e.keyName(u):u.key;v&&(v.indexOf("Delete")!=-1||v.indexOf("Backspace")!=-1)&&(m.maybeReset&&(m.maybeReset=(m.changes=[],!1)),m.changes.push(new Fe(v,u)))}function Xa(u,m,v,b){var x=Q.macroModeState;x.isPlaying=!0;var k=m.lastEditActionCommand,R=m.inputState;function O(){k?Pn.processAction(u,m,k):Pn.evalInput(u,m)}function L(q){if(x.lastInsertModeChanges.changes.length>0){q=m.lastEditActionCommand?q:1;var oe=x.lastInsertModeChanges;Us(u,oe.changes,q)}}if(m.inputState=m.lastEditInputState,k&&k.interlaceInsertRepeat)for(var z=0;z<v;z++)O(),L(1);else b||O(),L(v);m.inputState=R,m.insertMode&&!b&&Vn(u),x.isPlaying=!1}function Ya(u,m){e.lookupKey(m,"vim-insert",function(v){return typeof v=="string"?e.commands[v](u):v(u),!0})}function Us(u,m,v){var b=u.getCursor("head"),x=Q.macroModeState.lastInsertModeChanges.visualBlock;x&&(ar(u,b,x+1),v=u.listSelections().length,u.setCursor(b));for(var k=0;k<v;k++){x&&u.setCursor(_t(b,k,0));for(var R=0;R<m.length;R++){var O=m[R];if(O instanceof Fe)Ya(u,O.keyName);else if(typeof O=="string")u.replaceSelection(O);else{var L=u.getCursor(),z=_t(L,0,O[0].length-(O[1]||0));u.replaceRange(O[0],L,O[1]?L:z),u.setCursor(z)}}}x&&u.setCursor(_t(b,0,1))}function xn(u){var m=new u.constructor;return Object.keys(u).forEach(function(v){if(v!="insertEnd"){var b=u[v];Array.isArray(b)?b=b.slice():b&&typeof b=="object"&&b.constructor!=Object&&(b=xn(b)),m[v]=b}}),u.sel&&(m.sel={head:u.sel.head&&Ge(u.sel.head),anchor:u.sel.anchor&&Ge(u.sel.anchor)}),m}function Si(u,m,v){var k=se(u),b=u,x=!1,k=Be.maybeInitVimState_(b),R=k.visualBlock||k.wasInVisualBlock;if(b.state.closeVimNotification){var O=b.state.closeVimNotification;if(b.state.closeVimNotification=null,O(),m=="<CR>")return pt(b),!0}var L=b.isInMultiSelectMode();if(k.wasInVisualBlock&&!L?k.wasInVisualBlock=!1:L&&k.visualBlock&&(k.wasInVisualBlock=!0),m=="<Esc>"&&!k.insertMode&&!k.visualMode&&L&&k.status=="<Esc>")pt(b);else if(R||!L||b.inVirtualSelectionMode)x=Be.handleKey(b,m,v);else{var z=xn(k),q=k.inputState.changeQueueList||[];b.operation(function(){var ie;b.curOp&&(b.curOp.isVimOp=!0);var oe=0;b.forEachSelection(function(){b.state.vim.inputState.changeQueue=q[oe];var X=b.getCursor("head"),Y=b.getCursor("anchor"),xe=xt(X,Y)?0:-1,_e=xt(X,Y)?-1:0;X=_t(X,0,xe),Y=_t(Y,0,_e),b.state.vim.sel.head=X,b.state.vim.sel.anchor=Y,x=Be.handleKey(b,m,v),b.virtualSelection&&(q[oe]=b.state.vim.inputState.changeQueue,b.state.vim=xn(z)),oe++}),(ie=b.curOp)!=null&&ie.cursorActivity&&!x&&(b.curOp.cursorActivity=!1),b.state.vim=k,k.inputState.changeQueueList=q,k.inputState.changeQueue=null},!0)}return x&&!k.visualMode&&!k.insertMode&&k.visualMode!=b.somethingSelected()&&Ja(b,k),x}return Le(),Be}function rr(e,n){var i=n.ch,o=n.line+1;o<1&&(o=1,i=0),o>e.lines&&(o=e.lines,i=Number.MAX_VALUE);var s=e.line(o);return Math.min(s.from+Math.max(0,i),s.to)}function qr(e,n){let i=e.lineAt(n);return{line:i.number-1,ch:n-i.from}}var ti=class{constructor(e,n){this.line=e,this.ch=n}};function gy(e,n,i){if(e.addEventListener)e.addEventListener(n,i,!1);else{var o=e._handlers||(e._handlers={});o[n]=(o[n]||[]).concat(i)}}function yy(e,n,i){if(e.removeEventListener)e.removeEventListener(n,i,!1);else{var o=e._handlers,s=o&&o[n];if(s){var c=s.indexOf(i);c>-1&&(o[n]=s.slice(0,c).concat(s.slice(c+1)))}}}function vy(e,n,...i){var c;var o=(c=e._handlers)==null?void 0:c[n];if(o)for(var s=0;s<o.length;++s)o[s](...i)}function by(e,...n){if(e)for(var i=0;i<e.length;++i)e[i](...n)}var Xd;try{Xd=RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch{Xd=/[\w]/}function Ls(e,n){var i=e.cm6;if(!i.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 i.dispatch(n)}}function wy(e,n){var o;e.curOp&&(e.curOp.$changeStart=void 0),(n?B4:H4)(e.cm6);let i=(o=e.curOp)==null?void 0:o.$changeStart;i!=null&&e.cm6.dispatch({selection:{anchor:i}})}var nC={Left:e=>ks(e.cm6,{key:"Left"},"editor"),Right:e=>ks(e.cm6,{key:"Right"},"editor"),Up:e=>ks(e.cm6,{key:"Up"},"editor"),Down:e=>ks(e.cm6,{key:"Down"},"editor"),Backspace:e=>ks(e.cm6,{key:"Backspace"},"editor"),Delete:e=>ks(e.cm6,{key:"Delete"},"editor")},Xe=class _x{openDialog(n,i,o){return iC(this,n,i,o)}openNotification(n,i){return rC(this,n,i)}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,i){gy(this,n,i)}off(n,i){yy(this,n,i)}signal(n,i,o){vy(this,n,i,o)}indexFromPos(n){return rr(this.cm6.state.doc,n)}posFromIndex(n){return qr(this.cm6.state.doc,n)}foldCode(n){let i=this.cm6,o=i.state.selection.ranges,s=this.cm6.state.doc,c=rr(s,n),d=mn.create([mn.range(c,c)],0).ranges;i.state.selection.ranges=d,T4(i),i.state.selection.ranges=o}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(n,i){typeof n=="object"&&(i=n.ch,n=n.line);var o=rr(this.cm6.state.doc,{line:n,ch:i||0});this.cm6.dispatch({selection:{anchor:o}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(n){var i=this.cm6.state.selection.main,o=n=="head"||!n?i.head:n=="anchor"?i.anchor:n=="start"?i.from:n=="end"?i.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(i=>({anchor:qr(n,i.anchor),head:qr(n,i.head)}))}setSelections(n,i){var o=this.cm6.state.doc,s=n.map(c=>{var d=rr(o,c.head),f=rr(o,c.anchor);return d==f?mn.cursor(d,1):mn.range(f,d)});this.cm6.dispatch({selection:mn.create(s,i)})}setSelection(n,i,o){this.setSelections([{anchor:n,head:i}],0),o&&o.origin=="*mouse"&&this.onBeforeEndOperation()}getLine(n){var i=this.cm6.state.doc;return n<0||n>=i.lines?"":this.cm6.state.doc.line(n+1).text}getLineHandle(n){return this.$lineHandleChanges||(this.$lineHandleChanges=[]),{row:n,index:this.indexFromPos(new ti(n,0))}}getLineNumber(n){var i=this.$lineHandleChanges;if(!i)return null;for(var o=n.index,s=0;s<i.length;s++)if(o=i[s].changes.mapPos(o,1,uw.TrackAfter),o==null)return null;var c=this.posFromIndex(o);return c.ch==0?c.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(n,i){var o=this.cm6.state.doc;return this.cm6.state.sliceDoc(rr(o,n),rr(o,i))}replaceRange(n,i,o,s){o||(o=i);var c=this.cm6.state.doc,d=rr(c,i),f=rr(c,o);Ls(this,{changes:{from:d,to:f,insert:n}})}replaceSelection(n){Ls(this,this.cm6.state.replaceSelection(n))}replaceSelections(n){var i=this.cm6.state.selection.ranges.map((o,s)=>({from:o.from,to:o.to,insert:n[s]||""}));Ls(this,{changes:i})}getSelection(){return this.getSelections().join(`
122
122
  `)}getSelections(){var n=this.cm6;return n.state.selection.ranges.map(i=>n.state.sliceDoc(i.from,i.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(n=>!n.empty)}getInputField(){return this.cm6.contentDOM}clipPos(n){var i=this.cm6.state.doc,o=n.ch,s=n.line+1;s<1&&(s=1,o=0),s>i.lines&&(s=i.lines,o=Number.MAX_VALUE);var c=i.line(s);return o=Math.min(Math.max(0,o),c.to-c.from),new ti(s-1,o)}getValue(){return this.cm6.state.doc.toString()}setValue(n){var i=this.cm6;return i.dispatch({changes:{from:0,to:i.state.doc.length,insert:n},selection:mn.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(n,i){var o=this.cm6.state,s=rr(o.doc,n),c=yw(o,s+1,-1);return c&&c.end||(c=yw(o,s,1),c&&c.end)?{to:qr(o.doc,c.end.from)}:{to:void 0}}scanForBracket(n,i,o,s){return sC(this,n,i,o,s)}indentLine(n,i){i?this.indentMore():this.indentLess()}indentMore(){rD(this.cm6)}indentLess(){U4(this.cm6)}execCommand(n){if(n=="indentAuto")_x.commands.indentAuto(this);else if(n=="goLineLeft")G4(this.cm6);else if(n=="goLineRight"){Q4(this.cm6);let i=this.cm6.state,o=i.selection.main.head;o<i.doc.length&&i.sliceDoc(o,o+1)!==`
123
- `&&K4(this.cm6)}else console.log(n+" is not implemented")}setBookmark(n,i){var o=i!=null&&i.insertLeft?1:-1,s=this.indexFromPos(n);return new uC(this,s,o)}addOverlay({query:n}){let i=new J4({regexp:!0,search:n.source,caseSensitive:!/i/.test(n.flags)});if(i.valid){i.forVim=!0,this.cm6Query=i;let o=kh.of(i);return this.cm6.dispatch({effects:o}),i}}removeOverlay(n){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let i=kh.of(this.cm6Query);this.cm6.dispatch({effects:i})}getSearchCursor(n,i){var o=this,s=null,c=null,d=!1;i.ch??(i.ch=Number.MAX_VALUE);var f=rr(o.cm6.state.doc,i),p=n.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(E,T){return T||"\\"+E});function y(E,T=0,I=E.length){return new Z4(E,p,{ignoreCase:n.ignoreCase},T,I)}function w(E){var T=o.cm6.state.doc;if(E>T.length)return null;let I=y(T,E).next();return I.done?null:I.value}var _=1e4;function C(E,T){var I=o.cm6.state.doc;for(let $=1;;$++){let V=Math.max(E,T-$*_),F=y(I,V,T),N=null;for(;!F.next().done;)N=F.value;if(N&&(V==E||N.from>V+10))return N;if(V==E)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(E){var T=o.cm6.state.doc;return s=E?C(0,s?d?s.to-1:s.from:f):w(s?d?s.to+1:s.to:f),c=s&&{from:qr(T,s.from),to:qr(T,s.to),match:s.match},d=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&&(Ns(o,{changes:{from:s.from,to:s.to,insert:E}}),s.to=s.from+E.length,c&&(c.to=qr(o.cm6.state.doc,s.to)))},get match(){return c&&c.match}}}findPosV(n,i,o,s){let{cm6:c}=this,d=c.state.doc,f=o=="page"?c.dom.clientHeight:0,p=rr(d,n),y=mn.cursor(p,1,void 0,s),w=Math.round(Math.abs(i));for(let C=0;C<w;C++)o=="page"?y=c.moveVertically(y,i>0,f):o=="line"&&(y=c.moveVertically(y,i>0));let _=qr(d,y.head);return(i<0&&y.head==0&&s!=0&&n.line==0&&n.ch!=0||i>0&&y.head==d.length&&_.ch!=s&&n.line==_.line)&&(_.hitSide=!0),_}charCoords(n,i){var o=this.cm6.contentDOM.getBoundingClientRect(),s=rr(this.cm6.state.doc,n),c=this.cm6.coordsAtPos(s),d=-o.top;return{left:((c==null?void 0:c.left)||0)-o.left,top:((c==null?void 0:c.top)||0)+d,bottom:((c==null?void 0:c.bottom)||0)+d}}coordsChar(n,i){var o=this.cm6.contentDOM.getBoundingClientRect(),s=this.cm6.posAtCoords({x:n.left+o.left,y:n.top+o.top})||0;return qr(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,i){n!=null&&(this.cm6.scrollDOM.scrollLeft=n),i!=null&&(this.cm6.scrollDOM.scrollTop=i)}scrollIntoView(n,i){if(n){var o=this.indexFromPos(n);this.cm6.dispatch({effects:Kt.scrollIntoView(o)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:"scroll"})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption("mode")}}setSize(n,i){this.cm6.dom.style.width=n+4+"px",this.cm6.dom.style.height=i+"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 i=this.curOp=this.curOp||{};n.changes.iterChanges((o,s,c,d,f)=>{(i.$changeStart==null||i.$changeStart>c)&&(i.$changeStart=c),this.$lastChangeEndOffset=d;var p={text:f.toJSON()};i.lastChange?i.lastChange.next=i.lastChange=p:i.lastChange=i.change=p},!0),i.changeHandlers||(i.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,i){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,i=!1;n&&(n.change&&by(n.changeHandlers,this,n.change),n&&n.cursorActivity&&(by(n.cursorActivityHandlers,this,null),n.isVimOp&&(i=!0)),this.curOp=null),i&&this.scrollIntoView()}moveH(n,i){if(i=="char"){var o=this.getCursor();this.setCursor(o.line,o.ch+n)}}setOption(n,i){switch(n){case"keyMap":this.state.keyMap=i;break;case"textwidth":this.state.textwidth=i;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(dw)==" ";case"indentUnit":return this.cm6.state.facet(dw).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,d;var i=this.indexFromPos(n),o=((d=(c=(s=pw(this.cm6.state,i))==null?void 0:s.resolve(i))==null?void 0:c.type)==null?void 0:d.name)||"";return/comment/i.test(o)?"comment":/string/i.test(o)?"string":""}overWriteSelection(n){var i=this.cm6.state.doc,o=this.cm6.state.selection,s=o.ranges.map(c=>{if(c.empty){var d=c.to<i.length?i.sliceString(c.from,c.to+1):"";if(d&&!/\n/.test(d))return mn.range(c.from,c.to+1)}return c});this.cm6.dispatch({selection:mn.create(s,o.mainIndex)}),this.replaceSelection(n)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(n){var i=this.cm6.state.selection;this.virtualSelection=mn.create(i.ranges,i.mainIndex);for(var o=0;o<this.virtualSelection.ranges.length;o++){var s=this.virtualSelection.ranges[o];s&&(this.cm6.dispatch({selection:mn.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 dC(this,n)}};Xe.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform),Xe.Pos=ti,Xe.StringStream=z4,Xe.commands={cursorCharLeft:function(e){X4(e.cm6)},redo:function(e){wy(e,!1)},undo:function(e){wy(e,!0)},newlineAndIndent:function(e){nD({state:e.cm6.state,dispatch:n=>Ns(e,n)})},indentAuto:function(e){V4(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},Xe.isWordChar=function(e){return Xd.test(e)},Xe.keys=nC,Xe.addClass=function(e,n){},Xe.rmClass=function(e,n){},Xe.e_preventDefault=function(e){e.preventDefault()},Xe.e_stop=function(e){var n,i;(n=e==null?void 0:e.stopPropagation)==null||n.call(e),(i=e==null?void 0:e.preventDefault)==null||i.call(e)},Xe.lookupKey=function(e,n,i){var o=Xe.keys[e];!o&&/^Arrow/.test(e)&&(o=Xe.keys[e.slice(5)]),o&&i(o)},Xe.on=gy,Xe.off=yy,Xe.signal=vy,Xe.findMatchingTag=lC,Xe.findEnclosingTag=cC,Xe.keyName=void 0;function _y(e,n,i){var o=document.createElement("div");return o.appendChild(n),o}function xy(e,n){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=n}function rC(e,n,i){xy(e,f);var o=_y(e,n,i&&i.bottom),s=!1,c,d=i&&i.duration!==void 0?i.duration:5e3;function f(){s||(s=!0,clearTimeout(c),o.remove(),Sy(e,o))}return o.onclick=function(p){p.preventDefault(),f()},ky(e,o),d&&(c=setTimeout(f,d)),f}function ky(e,n){var i=e.state.dialog;e.state.dialog=n,n.style.flex="1",n&&i!==n&&(i&&i.contains(document.activeElement)&&e.focus(),i&&i.parentElement?i.parentElement.replaceChild(n,i):i&&i.remove(),Xe.signal(e,"dialog"))}function Sy(e,n){e.state.dialog==n&&(e.state.dialog=null,Xe.signal(e,"dialog"))}function iC(e,n,i,o){o||(o={}),xy(e,void 0);var s=_y(e,n,o.bottom),c=!1;ky(e,s);function d(p){if(typeof p=="string")f.value=p;else{if(c)return;c=!0,Sy(e,s),e.state.dialog||e.focus(),o.onClose&&o.onClose(s)}}var f=s.getElementsByTagName("input")[0];return f&&(o.value&&(f.value=o.value,o.selectValueOnOpen!==!1&&f.select()),o.onInput&&Xe.on(f,"input",function(p){o.onInput(p,f.value,d)}),o.onKeyUp&&Xe.on(f,"keyup",function(p){o.onKeyUp(p,f.value,d)}),Xe.on(f,"keydown",function(p){o&&o.onKeyDown&&o.onKeyDown(p,f.value,d)||(p.keyCode==13&&i&&i(f.value),(p.keyCode==27||o.closeOnEnter!==!1&&p.keyCode==13)&&(f.blur(),Xe.e_stop(p),d()))}),o.closeOnBlur!==!1&&Xe.on(f,"blur",function(){setTimeout(function(){document.activeElement!==f&&d()})}),f.focus()),d}var aC={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function oC(e){return e&&e.bracketRegex||/[(){}[\]]/}function sC(e,n,i,o,s){for(var c=s&&s.maxScanLineLength||1e4,d=s&&s.maxScanLines||1e3,f=[],p=oC(s),y=i>0?Math.min(n.line+d,e.lastLine()+1):Math.max(e.firstLine()-1,n.line-d),w=n.line;w!=y;w+=i){var _=e.getLine(w);if(_){var C=i>0?0:_.length-1,E=i>0?_.length:-1;if(!(_.length>c))for(w==n.line&&(C=n.ch-(i<0?1:0));C!=E;C+=i){var T=_.charAt(C);if(p.test(T)){var I=aC[T];if(I&&I.charAt(1)==">"==i>0)f.push(T);else if(f.length)f.pop();else return{pos:new ti(w,C),ch:T}}}}}return w-i==(i>0?e.lastLine():e.firstLine())?!1:null}function lC(e,n){return null}function cC(e,n){var c,d,f;var i=e.cm6.state,o=e.indexFromPos(n);o<i.doc.length&&i.sliceDoc(o,o+1)=="<"&&o++;for(var s=((c=pw(i,o))==null?void 0:c.resolve(o))||null;s;){if(((d=s.firstChild)==null?void 0:d.type.name)=="OpenTag"&&((f=s.lastChild)==null?void 0:f.type.name)=="CloseTag")return{open:Cy(i.doc,s.firstChild),close:Cy(i.doc,s.lastChild)};s=s.parent}}function Cy(e,n){return{from:qr(e,n.from),to:qr(e,n.to)}}var uC=class{constructor(e,n,i){this.cm=e,this.id=e.$mid++,this.offset=n,this.assoc=i,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,uw.TrackDel))}};function dC(e,n){var T;for(var i=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 d=e.getLine(s);if(d.length>i){var f=E(d,i,5);if(f){var p=(T=/^\s*/.exec(d))==null?void 0:T[0];e.replaceRange(`
123
+ `&&K4(this.cm6)}else console.log(n+" is not implemented")}setBookmark(n,i){var o=i!=null&&i.insertLeft?1:-1,s=this.indexFromPos(n);return new uC(this,s,o)}addOverlay({query:n}){let i=new J4({regexp:!0,search:n.source,caseSensitive:!/i/.test(n.flags)});if(i.valid){i.forVim=!0,this.cm6Query=i;let o=kh.of(i);return this.cm6.dispatch({effects:o}),i}}removeOverlay(n){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let i=kh.of(this.cm6Query);this.cm6.dispatch({effects:i})}getSearchCursor(n,i){var o=this,s=null,c=null,d=!1;i.ch??(i.ch=Number.MAX_VALUE);var f=rr(o.cm6.state.doc,i),p=n.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(E,T){return T||"\\"+E});function y(E,T=0,I=E.length){return new Z4(E,p,{ignoreCase:n.ignoreCase},T,I)}function w(E){var T=o.cm6.state.doc;if(E>T.length)return null;let I=y(T,E).next();return I.done?null:I.value}var _=1e4;function C(E,T){var I=o.cm6.state.doc;for(let $=1;;$++){let V=Math.max(E,T-$*_),F=y(I,V,T),N=null;for(;!F.next().done;)N=F.value;if(N&&(V==E||N.from>V+10))return N;if(V==E)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(E){var T=o.cm6.state.doc;return s=E?C(0,s?d?s.to-1:s.from:f):w(s?d?s.to+1:s.to:f),c=s&&{from:qr(T,s.from),to:qr(T,s.to),match:s.match},d=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&&(Ls(o,{changes:{from:s.from,to:s.to,insert:E}}),s.to=s.from+E.length,c&&(c.to=qr(o.cm6.state.doc,s.to)))},get match(){return c&&c.match}}}findPosV(n,i,o,s){let{cm6:c}=this,d=c.state.doc,f=o=="page"?c.dom.clientHeight:0,p=rr(d,n),y=mn.cursor(p,1,void 0,s),w=Math.round(Math.abs(i));for(let C=0;C<w;C++)o=="page"?y=c.moveVertically(y,i>0,f):o=="line"&&(y=c.moveVertically(y,i>0));let _=qr(d,y.head);return(i<0&&y.head==0&&s!=0&&n.line==0&&n.ch!=0||i>0&&y.head==d.length&&_.ch!=s&&n.line==_.line)&&(_.hitSide=!0),_}charCoords(n,i){var o=this.cm6.contentDOM.getBoundingClientRect(),s=rr(this.cm6.state.doc,n),c=this.cm6.coordsAtPos(s),d=-o.top;return{left:((c==null?void 0:c.left)||0)-o.left,top:((c==null?void 0:c.top)||0)+d,bottom:((c==null?void 0:c.bottom)||0)+d}}coordsChar(n,i){var o=this.cm6.contentDOM.getBoundingClientRect(),s=this.cm6.posAtCoords({x:n.left+o.left,y:n.top+o.top})||0;return qr(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,i){n!=null&&(this.cm6.scrollDOM.scrollLeft=n),i!=null&&(this.cm6.scrollDOM.scrollTop=i)}scrollIntoView(n,i){if(n){var o=this.indexFromPos(n);this.cm6.dispatch({effects:Kt.scrollIntoView(o)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:"scroll"})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption("mode")}}setSize(n,i){this.cm6.dom.style.width=n+4+"px",this.cm6.dom.style.height=i+"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 i=this.curOp=this.curOp||{};n.changes.iterChanges((o,s,c,d,f)=>{(i.$changeStart==null||i.$changeStart>c)&&(i.$changeStart=c),this.$lastChangeEndOffset=d;var p={text:f.toJSON()};i.lastChange?i.lastChange.next=i.lastChange=p:i.lastChange=i.change=p},!0),i.changeHandlers||(i.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,i){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,i=!1;n&&(n.change&&by(n.changeHandlers,this,n.change),n&&n.cursorActivity&&(by(n.cursorActivityHandlers,this,null),n.isVimOp&&(i=!0)),this.curOp=null),i&&this.scrollIntoView()}moveH(n,i){if(i=="char"){var o=this.getCursor();this.setCursor(o.line,o.ch+n)}}setOption(n,i){switch(n){case"keyMap":this.state.keyMap=i;break;case"textwidth":this.state.textwidth=i;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(dw)==" ";case"indentUnit":return this.cm6.state.facet(dw).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,d;var i=this.indexFromPos(n),o=((d=(c=(s=pw(this.cm6.state,i))==null?void 0:s.resolve(i))==null?void 0:c.type)==null?void 0:d.name)||"";return/comment/i.test(o)?"comment":/string/i.test(o)?"string":""}overWriteSelection(n){var i=this.cm6.state.doc,o=this.cm6.state.selection,s=o.ranges.map(c=>{if(c.empty){var d=c.to<i.length?i.sliceString(c.from,c.to+1):"";if(d&&!/\n/.test(d))return mn.range(c.from,c.to+1)}return c});this.cm6.dispatch({selection:mn.create(s,o.mainIndex)}),this.replaceSelection(n)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(n){var i=this.cm6.state.selection;this.virtualSelection=mn.create(i.ranges,i.mainIndex);for(var o=0;o<this.virtualSelection.ranges.length;o++){var s=this.virtualSelection.ranges[o];s&&(this.cm6.dispatch({selection:mn.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 dC(this,n)}};Xe.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform),Xe.Pos=ti,Xe.StringStream=z4,Xe.commands={cursorCharLeft:function(e){X4(e.cm6)},redo:function(e){wy(e,!1)},undo:function(e){wy(e,!0)},newlineAndIndent:function(e){nD({state:e.cm6.state,dispatch:n=>Ls(e,n)})},indentAuto:function(e){V4(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},Xe.isWordChar=function(e){return Xd.test(e)},Xe.keys=nC,Xe.addClass=function(e,n){},Xe.rmClass=function(e,n){},Xe.e_preventDefault=function(e){e.preventDefault()},Xe.e_stop=function(e){var n,i;(n=e==null?void 0:e.stopPropagation)==null||n.call(e),(i=e==null?void 0:e.preventDefault)==null||i.call(e)},Xe.lookupKey=function(e,n,i){var o=Xe.keys[e];!o&&/^Arrow/.test(e)&&(o=Xe.keys[e.slice(5)]),o&&i(o)},Xe.on=gy,Xe.off=yy,Xe.signal=vy,Xe.findMatchingTag=lC,Xe.findEnclosingTag=cC,Xe.keyName=void 0;function _y(e,n,i){var o=document.createElement("div");return o.appendChild(n),o}function xy(e,n){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=n}function rC(e,n,i){xy(e,f);var o=_y(e,n,i&&i.bottom),s=!1,c,d=i&&i.duration!==void 0?i.duration:5e3;function f(){s||(s=!0,clearTimeout(c),o.remove(),Sy(e,o))}return o.onclick=function(p){p.preventDefault(),f()},ky(e,o),d&&(c=setTimeout(f,d)),f}function ky(e,n){var i=e.state.dialog;e.state.dialog=n,n.style.flex="1",n&&i!==n&&(i&&i.contains(document.activeElement)&&e.focus(),i&&i.parentElement?i.parentElement.replaceChild(n,i):i&&i.remove(),Xe.signal(e,"dialog"))}function Sy(e,n){e.state.dialog==n&&(e.state.dialog=null,Xe.signal(e,"dialog"))}function iC(e,n,i,o){o||(o={}),xy(e,void 0);var s=_y(e,n,o.bottom),c=!1;ky(e,s);function d(p){if(typeof p=="string")f.value=p;else{if(c)return;c=!0,Sy(e,s),e.state.dialog||e.focus(),o.onClose&&o.onClose(s)}}var f=s.getElementsByTagName("input")[0];return f&&(o.value&&(f.value=o.value,o.selectValueOnOpen!==!1&&f.select()),o.onInput&&Xe.on(f,"input",function(p){o.onInput(p,f.value,d)}),o.onKeyUp&&Xe.on(f,"keyup",function(p){o.onKeyUp(p,f.value,d)}),Xe.on(f,"keydown",function(p){o&&o.onKeyDown&&o.onKeyDown(p,f.value,d)||(p.keyCode==13&&i&&i(f.value),(p.keyCode==27||o.closeOnEnter!==!1&&p.keyCode==13)&&(f.blur(),Xe.e_stop(p),d()))}),o.closeOnBlur!==!1&&Xe.on(f,"blur",function(){setTimeout(function(){document.activeElement!==f&&d()})}),f.focus()),d}var aC={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function oC(e){return e&&e.bracketRegex||/[(){}[\]]/}function sC(e,n,i,o,s){for(var c=s&&s.maxScanLineLength||1e4,d=s&&s.maxScanLines||1e3,f=[],p=oC(s),y=i>0?Math.min(n.line+d,e.lastLine()+1):Math.max(e.firstLine()-1,n.line-d),w=n.line;w!=y;w+=i){var _=e.getLine(w);if(_){var C=i>0?0:_.length-1,E=i>0?_.length:-1;if(!(_.length>c))for(w==n.line&&(C=n.ch-(i<0?1:0));C!=E;C+=i){var T=_.charAt(C);if(p.test(T)){var I=aC[T];if(I&&I.charAt(1)==">"==i>0)f.push(T);else if(f.length)f.pop();else return{pos:new ti(w,C),ch:T}}}}}return w-i==(i>0?e.lastLine():e.firstLine())?!1:null}function lC(e,n){return null}function cC(e,n){var c,d,f;var i=e.cm6.state,o=e.indexFromPos(n);o<i.doc.length&&i.sliceDoc(o,o+1)=="<"&&o++;for(var s=((c=pw(i,o))==null?void 0:c.resolve(o))||null;s;){if(((d=s.firstChild)==null?void 0:d.type.name)=="OpenTag"&&((f=s.lastChild)==null?void 0:f.type.name)=="CloseTag")return{open:Cy(i.doc,s.firstChild),close:Cy(i.doc,s.lastChild)};s=s.parent}}function Cy(e,n){return{from:qr(e,n.from),to:qr(e,n.to)}}var uC=class{constructor(e,n,i){this.cm=e,this.id=e.$mid++,this.offset=n,this.assoc=i,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,uw.TrackDel))}};function dC(e,n){var T;for(var i=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 d=e.getLine(s);if(d.length>i){var f=E(d,i,5);if(f){var p=(T=/^\s*/.exec(d))==null?void 0:T[0];e.replaceRange(`
124
124
  `+p,new ti(s,f.start),new ti(s,f.end))}c++}else if(o&&/\S/.test(d)&&s!=c){var y=e.getLine(s+1);if(y&&/\S/.test(y)){var w=d.replace(/\s+$/,""),_=y.replace(/^\s+/,""),C=w+" "+_,f=E(C,i,5);f&&f.start>w.length||C.length<i?(e.replaceRange(" ",new ti(s,w.length),new ti(s+1,y.length-_.length)),s--,c--):w.length<d.length&&e.replaceRange("",new ti(s,w.length),new ti(s,d.length))}}s++}return s;function E(I,$,V){if(!(I.length<$)){var F=I.slice(0,$),N=I.slice($),K=/^(?:(\s+)|(\S+)(\s+))/.exec(N),pe=/(?:(\s+)|(\s+)(\S+))$/.exec(F),P=0,A=0;if(pe&&!pe[2]&&(P=$-pe[1].length,A=$),K&&!K[2]&&(P||(P=$),A=$+K[1].length),P)return{start:P,end:A};if(pe&&pe[2]&&pe.index>V)return{start:pe.index,end:pe.index+pe[2].length};if(K&&K[2])return P=$+K[2].length,{start:P,end:P+K[3].length}}}}var Yd=q4||(function(){let e={cursorBlinkRate:1200};return function(){return e}})(),fC=class{constructor(e,n,i,o,s,c,d,f,p,y){this.left=e,this.top=n,this.height=i,this.fontFamily=o,this.fontSize=s,this.fontWeight=c,this.color=d,this.className=f,this.letter=p,this.partial=y}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}},pC=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=Yd(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"),hC(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,n=[];for(let i of e.selection.ranges){let o=i==e.selection.main,s=yC(this.cm,this.view,i,o);s&&n.push(s)}return{cursors:n}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((n,i)=>!n.eq(this.cursors[i]))){let n=this.cursorLayer.children;if(n.length!==e.length){this.cursorLayer.textContent="";for(let i of e)this.cursorLayer.appendChild(i.draw())}else e.forEach((i,o)=>i.adjust(n[o]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function hC(e){return Yd(e.startState)!=Yd(e.state)}var mC=Nu.highest(Kt.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 gC(e){let n=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==I4.LTR?n.left:n.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:n.top-e.scrollDOM.scrollTop*e.scaleY}}function yC(e,n,i,o){var w,_,C;var s;let c=i.head,d=!1,f=1,p=e.state.vim;if(p&&(!p.insertMode||e.state.overwrite)){if(d=!0,p.visualBlock&&!o)return null;i.anchor<i.head&&(c<n.state.doc.length&&n.state.sliceDoc(c,c+1))!=`
125
125
  `&&c--,e.state.overwrite?f=.2:p.status&&(f=.5)}if(d){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 T=n.coordsAtPos(c,1);if(!T)return null;let I=gC(n),$=n.domAtPos(c),V=$?$.node:n.contentDOM;for(V instanceof Text&&$.offset>=V.data.length&&((w=V.parentElement)==null?void 0:w.nextSibling)&&(V=(_=V.parentElement)==null?void 0:_.nextSibling,$={node:V,offset:0});$&&$.node instanceof HTMLElement;)V=$.node,$={node:$.node.childNodes[$.offset],offset:0};if(!(V instanceof HTMLElement)){if(!V.parentNode)return null;V=V.parentNode}let F=getComputedStyle(V),N=T.left,K=(C=(s=n).coordsForChar)==null?void 0:C.call(s,c);if(K&&(N=K.left),!E||E==`
126
- `||E=="\r")E="\xA0";else if(E==" "){E="\xA0";var y=n.coordsAtPos(c+1,-1);y&&(N=y.left-(y.left-T.left)/parseInt(F.tabSize))}else/[\uD800-\uDBFF]/.test(E)&&c<n.state.doc.length-1&&(E+=n.state.sliceDoc(c+1,c+2));let pe=T.bottom-T.top;return new fC((N-I.left)/n.scaleX,(T.top-I.top+pe*(1-f))/n.scaleY,pe*f/n.scaleY,F.fontFamily,F.fontSize,F.fontWeight,F.color,o?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",E,f!=1)}else return null}let Ey,Ty,Ry,Dy;Ey=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),Wi=tC(Xe),Ty=250,Ry=Kt.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"}}),Dy=Pl.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=Hi.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;let n=this.cm=new Xe(e);Wi.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new pC(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",i=>{n.state.vim&&(n.state.vim.mode=i.mode,i.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:Oy.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=i=>{Wi.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 i of e.transactions)for(let o of i.effects)if(o.is(kh))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 i=this.cm.state.dialog;if(i)i.parentElement!=e&&(e.textContent="",e.appendChild(i));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(){Wi.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=Hi.none;let{view:n}=this,i=new lw;for(let o=0,s=n.visibleRanges,c=s.length;o<c;o++){let{from:d,to:f}=s[o];for(;o<c-1&&f>s[o+1].from-2*Ty;)f=s[++o].to;e.highlight(n.state,d,f,(p,y)=>{i.add(p,y,bC)})}return this.decorations=i.finish()}handleKey(e,n){let i=this.cm,o=i.state.vim;if(!o)return;let s=Wi.vimKeyFromEvent(e,o);if(Xe.signal(this.cm,"inputEvent",{type:"handleKey",key:s}),!s)return;if(s=="<Esc>"&&!o.insertMode&&!o.visualMode&&this.query){let d=o.searchState_;d&&(i.removeOverlay(d.getOverlay()),d.setOverlay(null))}if(s==="<C-c>"&&!Xe.isMac&&i.somethingSelected())return this.waitForCopy=!0,!0;o.status=(o.status||"")+s;let c=Wi.multiSelectHandleKey(i,s,"user");return o=Wi.maybeInitVimState_(i),!c&&o.insertMode&&i.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(c=!0,i.overWriteSelection(e.key)):e.key=="Backspace"&&(c=!0,Xe.commands.cursorCharLeft(i))),c&&(Xe.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 i=this.cm,o=i.state.vim;o&&(o.insertMode?i.setSelection(i.getCursor(),i.getCursor()):i.operation(()=>{i.curOp&&(i.curOp.isVimOp=!0),Wi.handleKey(i,"<Esc>","user")}))}))},compositionstart:function(e,n){this.useNextTextInput=!0,Xe.signal(this.cm,"inputEvent",e)},compositionupdate:function(e,n){Xe.signal(this.cm,"inputEvent",e)},compositionend:function(e,n){Xe.signal(this.cm,"inputEvent",e)},keypress:function(e,n){Xe.signal(this.cm,"inputEvent",e),this.lastKeydown=="Dead"&&this.handleKey(e,n)},keydown:function(e,n){Xe.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:()=>[Kt.inputHandler.of((e,n,i,o)=>{var w,_;var s=Al(e);if(!s)return!1;var c=(w=s.state)==null?void 0:w.vim,d=s.state.vimPlugin;if(c&&!c.insertMode&&!((_=s.curOp)!=null&&_.isVimOp)){if(o==="\0\0")return!0;if(Xe.signal(s,"inputEvent",{type:"text",text:o,from:n,to:i}),o.length==1&&d.useNextTextInput){if(c.expectLiteralNext&&e.composing)return d.compositionText=o,!1;if(d.compositionText){var f=d.compositionText;d.compositionText="";var p=e.state.selection.main.head;if(f===e.state.sliceDoc(p-f.length,p)){var y=s.getCursor();s.replaceRange("",s.posFromIndex(p-f.length),y)}}return d.handleKey({key:o,preventDefault:()=>{},stopPropagation:()=>{}}),vC(e),!0}}return!1})],decorations:e=>e.decorations});function vC(e){var n=e.scrollDOM.parentElement;if(n){if(Ey){e.contentDOM.textContent="\0\0",e.contentDOM.dispatchEvent(new CustomEvent("compositionend"));return}var i=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,i);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 bC=Hi.mark({class:"cm-searchMatch"}),Oy=Bi.define(),wC=xs.define({create:()=>!1,update(e,n){for(let i of n.effects)i.is(Oy)&&(e=i.value);return e},provide:e=>_h.from(e,n=>n?_C:null)});function _C(e){let n=document.createElement("div");n.className="cm-vim-panel";let i=e.cm;return i.state.dialog&&n.appendChild(i.state.dialog),{top:!1,dom:n}}function xC(e){let n=document.createElement("div");n.className="cm-vim-panel";let i=e.cm;return i.state.statusbar=n,i.state.vimPlugin.updateStatus(),{dom:n}}f_=function(e={}){return[Ry,Dy,mC,e.status?_h.of(xC):wC]},Al=function(e){return e.cm||null},zh=function(e){let n=e.state.selection.main;return n.from===0&&n.to===0},am=function(e,n=!1){let i=e.state.selection.main,o=e.state.doc.length;return n&&i.from===o-1&&i.to===o-1?!0:i.from===o&&i.to===o},Vw=function(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})},a_=function(e){var n;return((n=Al(e))==null?void 0:n.state.vim)!=null},l_=function(e){var i;let n=(i=Al(e))==null?void 0:i.state.vim;return n?!n.mode&&!n.insertMode&&!n.visualMode?!0:n.mode==="normal":!1},Kw=function(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})};function Py(e,n){if(!(n!=null&&n.length))return Hi.none;let i=new lw,o=e.facet(Ui),s=n.filter(c=>c.kind==="cell"&&c.cellId===o).sort((c,d)=>c.lineNumber-d.lineNumber);for(let c of s)try{let d=e.doc.line(c.lineNumber),f=Hi.line({class:"cm-error-line"});i.add(d.from,d.from,f)}catch(d){Ee.debug("Invalid line number in error decoration",{error:d})}return i.finish()}function My(e,n){if(!(n!=null&&n.length))return;let i=e.state.facet(Ui),o=n.filter(d=>d.kind==="cell"&&d.cellId===i);if(o.length===0)return;let s=A4(e.state),c=[];for(let d of o)try{let f=e.state.doc.line(d.lineNumber);s.between(f.from,f.to,(p,y)=>{c.push(M4.of({from:p,to:y}))})}catch(f){Ee.debug("Invalid line numbers",{error:f})}c.length>0&&e.dispatch({effects:c})}var kC=class{constructor(e,n){let i=n.get();this.decorations=Py(e.state,i),My(e,i),this.unsubscribe=n.sub(o=>{let s=this.decorations.size;this.decorations=Py(e.state,o),My(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 SC(e){return Pl.define(n=>new kC(n,e),{decorations:n=>n.decorations})}function CC(e){return[SC(e),Kt.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 EC({cellId:e,hotkeys:n}){let i=[];return i.push(...rw({key:n.getHotkey("cell.run").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).onRun(),!0)}),{key:n.getHotkey("cell.runAndNewBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Pt);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})),!0}},...rw({key:n.getHotkey("cell.runAndNewAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Pt);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(Pt).aiCellCompletion()&&o.contentDOM.focus(),!0)}),e!=="__scratch__"&&i.push({key:n.getHotkey("cell.goToDefinition").key,preventDefault:!0,stopPropagation:!0,run:o=>(Zh(o),!0)},{key:n.getHotkey("cell.delete").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.doc.length===0&&o.state.facet(Pt).deleteCell(),!0)},{key:n.getHotkey("cell.moveUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.moveDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.moveLeft").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveCell({cellId:e,before:!0,direction:"left"}),!0)},{key:n.getHotkey("cell.moveRight").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveCell({cellId:e,before:!1,direction:"right"}),!0)},{key:"ArrowUp",preventDefault:!0,stopPropagation:!0,run:o=>xw(o.state)?!1:zh(o)?(o.state.facet(Pt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:"ArrowDown",preventDefault:!0,stopPropagation:!0,run:o=>xw(o.state)?!1:am(o)?(o.state.facet(Pt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0):!1},{key:n.getHotkey("cell.focusDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0)},{key:n.getHotkey("cell.focusUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},{key:n.getHotkey("cell.sendToBottom").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).sendToBottom({cellId:e}),!0)},{key:n.getHotkey("cell.sendToTop").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).sendToTop({cellId:e}),!0)},{key:n.getHotkey("cell.createAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(Pt).createNewCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.createBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(Pt).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(Pt).toggleHideCode();return kw(o),s?(o.contentDOM.blur(),(c=document.getElementById(er.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(Pt);return s.splitCell({cellId:e}),s.moveToNextCell&&requestAnimationFrame(()=>{o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})}),!0}}),[Nu.high(Ra.of(i))]}function TC(e){return[Kt.updateListener.of(n=>{if(n.docChanged){let i=n.transactions.some(d=>d.effects.some(f=>f.is(Ls))),o=Xr(n.view),s=n.view.state.facet(Pt),c=n.view.state.facet(Ui);s.updateCellCode({cellId:c,code:o,formattingChange:i})}}),TS(e)]}function RC({predicate:e}){return Kt.updateListener.of(n=>{n.docChanged&&n.view.hasFocus&&e()&&(n.transactions.some(i=>i.effects.some(o=>o.is(Ls)))||n.view.state.facet(Pt).onRun())})}Nw=function({cellId:e,hotkeys:n,cellActions:i}){return[Pt.of(i),Ui.of(e),EC({cellId:e,hotkeys:n}),TC(n),CC(SS(mT(e),lt))]};const Ly=async e=>{let n=e.state.doc.sliceString(0,e.pos),i=document.activeElement,o=null;if(i!==null){let d=er.findElement(i);d!==null&&(o=er.parse(d.id))}if(o===null)return Ee.error("Failed to find active cell."),null;let s=await fd.request({document:n,cellId:o});if(!s)return null;let c=Gd.asHoverTooltip({position:e.pos,message:s,limitToType:"tooltip"});return c&&lt.set(Xu,{documentation:c.html??null}),c?null:Gd.asCompletionResult(e.pos,s)};function DC(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 i=await PC();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w:]*$/}},PC=di(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,i])=>({shortcode:i[0],label:i.map(o=>`:${o}`).join(" "),emoji:n,displayLabel:`${n} ${i[0].replaceAll("_"," ")}`,apply:n,type:"emoji"}))}),MC=async e=>{let n=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!n)return null;let i=await LC();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w-:]*$/}},LC=di(async()=>{let e=await fetch("https://unpkg.com/lucide-static@0.452.0/tags.json").then(i=>{if(!i.ok)throw Error("Failed to fetch Lucide icon list");return i.json()}).catch(()=>({})),n=i=>`https://cdn.jsdelivr.net/npm/lucide-static@0.452.0/icons/${i}.svg`;return Object.entries(e).map(([i,o])=>({label:`::${i}`,displayLabel:i,type:"lucide-icon",boost:10,apply:`::lucide:${i}::`,detail:o.join(", "),info:()=>{let s=document.createElement("img");return s.src=n(i),s.style.width="24px",s.style.height="24px",s}}))}),NC=e=>{let n=e.matchBefore(/\\\w*$/);return!e.explicit&&!n?null:{from:(n==null?void 0:n.from)??e.pos,options:IC(),validFor:/^[\w\\]*$/}},IC=di(()=>[["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,i])=>({label:`\\${e} ${i}`,displayLabel:e,type:"latex-symbol",boost:10,apply:`\\${e}`,info:()=>{let o=document.createElement("div");return o.textContent=`${n} ${i}`,o},detail:n})));let Ny;Ny=[OC,MC,NC],Xl={isAbsolute:e=>e.startsWith("/")||e.startsWith("\\")||e.startsWith("C:\\"),dirname:e=>Bl.guessDeliminator(e).dirname(e),basename:e=>Bl.guessDeliminator(e).basename(e),rest:(e,n)=>Bl.guessDeliminator(e).rest(e,n),extension:e=>{let n=e.split(".");return n.length===1?"":n.at(-1)??""}};let Iy;Bl=class jm{constructor(n){this.deliminator=n}static guessDeliminator(n){return n.includes("/")?new jm("/"):new jm("\\")}join(...n){return n.filter(Boolean).join(this.deliminator)}basename(n){return n.split(this.deliminator).pop()??""}rest(n,i){let o=n.split(this.deliminator),s=i.split(this.deliminator),c=0;for(;c<o.length&&c<s.length&&o[c]===s[c];++c);return o.slice(c).join(this.deliminator)}dirname(n){let i=n.split(this.deliminator);return i.pop(),i.join(this.deliminator)}},Iy=100;function Io(e){return!e.state.selection.main.empty}function Zd({view:e,selection:n,markup:i}){let o=[],s=!0;for(let c=n.from;c<=n.to;c++)if(!e.state.doc.lineAt(c).text.startsWith(i)){s=!1;break}for(let c=n.from;c<=n.to;){let d=e.state.doc.lineAt(c),f=d.text.startsWith(i);s?o.push({from:d.from,to:d.from+i.length,insert:vo.of([""])}):(f&&o.push({from:d.from,to:d.from+i.length,insert:vo.of([""])}),o.push({from:d.from,insert:vo.of([i])})),c=d.to+1}return o}function ef({view:e,range:n,markupAfter:i,markupBefore:o}){if(n.empty){let y=e.state.wordAt(n.head);y&&(n=y)}let s=e.state.sliceDoc(n.from-o.length,n.from)===o,c=e.state.sliceDoc(n.to,n.to+i.length)===i,d=[];d.push(s?{from:n.from-o.length,to:n.from,insert:vo.of([""])}:{from:n.from,insert:vo.of(o.split(`
126
+ `||E=="\r")E="\xA0";else if(E==" "){E="\xA0";var y=n.coordsAtPos(c+1,-1);y&&(N=y.left-(y.left-T.left)/parseInt(F.tabSize))}else/[\uD800-\uDBFF]/.test(E)&&c<n.state.doc.length-1&&(E+=n.state.sliceDoc(c+1,c+2));let pe=T.bottom-T.top;return new fC((N-I.left)/n.scaleX,(T.top-I.top+pe*(1-f))/n.scaleY,pe*f/n.scaleY,F.fontFamily,F.fontSize,F.fontWeight,F.color,o?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",E,f!=1)}else return null}let Ey,Ty,Ry,Dy;Ey=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),Wi=tC(Xe),Ty=250,Ry=Kt.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"}}),Dy=Ol.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=Hi.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;let n=this.cm=new Xe(e);Wi.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new pC(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",i=>{n.state.vim&&(n.state.vim.mode=i.mode,i.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:Oy.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=i=>{Wi.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 i of e.transactions)for(let o of i.effects)if(o.is(kh))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 i=this.cm.state.dialog;if(i)i.parentElement!=e&&(e.textContent="",e.appendChild(i));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(){Wi.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=Hi.none;let{view:n}=this,i=new lw;for(let o=0,s=n.visibleRanges,c=s.length;o<c;o++){let{from:d,to:f}=s[o];for(;o<c-1&&f>s[o+1].from-2*Ty;)f=s[++o].to;e.highlight(n.state,d,f,(p,y)=>{i.add(p,y,bC)})}return this.decorations=i.finish()}handleKey(e,n){let i=this.cm,o=i.state.vim;if(!o)return;let s=Wi.vimKeyFromEvent(e,o);if(Xe.signal(this.cm,"inputEvent",{type:"handleKey",key:s}),!s)return;if(s=="<Esc>"&&!o.insertMode&&!o.visualMode&&this.query){let d=o.searchState_;d&&(i.removeOverlay(d.getOverlay()),d.setOverlay(null))}if(s==="<C-c>"&&!Xe.isMac&&i.somethingSelected())return this.waitForCopy=!0,!0;o.status=(o.status||"")+s;let c=Wi.multiSelectHandleKey(i,s,"user");return o=Wi.maybeInitVimState_(i),!c&&o.insertMode&&i.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(c=!0,i.overWriteSelection(e.key)):e.key=="Backspace"&&(c=!0,Xe.commands.cursorCharLeft(i))),c&&(Xe.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 i=this.cm,o=i.state.vim;o&&(o.insertMode?i.setSelection(i.getCursor(),i.getCursor()):i.operation(()=>{i.curOp&&(i.curOp.isVimOp=!0),Wi.handleKey(i,"<Esc>","user")}))}))},compositionstart:function(e,n){this.useNextTextInput=!0,Xe.signal(this.cm,"inputEvent",e)},compositionupdate:function(e,n){Xe.signal(this.cm,"inputEvent",e)},compositionend:function(e,n){Xe.signal(this.cm,"inputEvent",e)},keypress:function(e,n){Xe.signal(this.cm,"inputEvent",e),this.lastKeydown=="Dead"&&this.handleKey(e,n)},keydown:function(e,n){Xe.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:()=>[Kt.inputHandler.of((e,n,i,o)=>{var w,_;var s=Il(e);if(!s)return!1;var c=(w=s.state)==null?void 0:w.vim,d=s.state.vimPlugin;if(c&&!c.insertMode&&!((_=s.curOp)!=null&&_.isVimOp)){if(o==="\0\0")return!0;if(Xe.signal(s,"inputEvent",{type:"text",text:o,from:n,to:i}),o.length==1&&d.useNextTextInput){if(c.expectLiteralNext&&e.composing)return d.compositionText=o,!1;if(d.compositionText){var f=d.compositionText;d.compositionText="";var p=e.state.selection.main.head;if(f===e.state.sliceDoc(p-f.length,p)){var y=s.getCursor();s.replaceRange("",s.posFromIndex(p-f.length),y)}}return d.handleKey({key:o,preventDefault:()=>{},stopPropagation:()=>{}}),vC(e),!0}}return!1})],decorations:e=>e.decorations});function vC(e){var n=e.scrollDOM.parentElement;if(n){if(Ey){e.contentDOM.textContent="\0\0",e.contentDOM.dispatchEvent(new CustomEvent("compositionend"));return}var i=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,i);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 bC=Hi.mark({class:"cm-searchMatch"}),Oy=Bi.define(),wC=xs.define({create:()=>!1,update(e,n){for(let i of n.effects)i.is(Oy)&&(e=i.value);return e},provide:e=>_h.from(e,n=>n?_C:null)});function _C(e){let n=document.createElement("div");n.className="cm-vim-panel";let i=e.cm;return i.state.dialog&&n.appendChild(i.state.dialog),{top:!1,dom:n}}function xC(e){let n=document.createElement("div");n.className="cm-vim-panel";let i=e.cm;return i.state.statusbar=n,i.state.vimPlugin.updateStatus(),{dom:n}}f_=function(e={}){return[Ry,Dy,mC,e.status?_h.of(xC):wC]},Il=function(e){return e.cm||null},zh=function(e){let n=e.state.selection.main;return n.from===0&&n.to===0},am=function(e,n=!1){let i=e.state.selection.main,o=e.state.doc.length;return n&&i.from===o-1&&i.to===o-1?!0:i.from===o&&i.to===o},Vw=function(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})},a_=function(e){var n;return((n=Il(e))==null?void 0:n.state.vim)!=null},l_=function(e){var i;let n=(i=Il(e))==null?void 0:i.state.vim;return n?!n.mode&&!n.insertMode&&!n.visualMode?!0:n.mode==="normal":!1},Kw=function(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})};function Py(e,n){if(!(n!=null&&n.length))return Hi.none;let i=new lw,o=e.facet(Ui),s=n.filter(c=>c.kind==="cell"&&c.cellId===o).sort((c,d)=>c.lineNumber-d.lineNumber);for(let c of s)try{let d=e.doc.line(c.lineNumber),f=Hi.line({class:"cm-error-line"});i.add(d.from,d.from,f)}catch(d){Se.debug("Invalid line number in error decoration",{error:d})}return i.finish()}function My(e,n){if(!(n!=null&&n.length))return;let i=e.state.facet(Ui),o=n.filter(d=>d.kind==="cell"&&d.cellId===i);if(o.length===0)return;let s=A4(e.state),c=[];for(let d of o)try{let f=e.state.doc.line(d.lineNumber);s.between(f.from,f.to,(p,y)=>{c.push(M4.of({from:p,to:y}))})}catch(f){Se.debug("Invalid line numbers",{error:f})}c.length>0&&e.dispatch({effects:c})}var kC=class{constructor(e,n){let i=n.get();this.decorations=Py(e.state,i),My(e,i),this.unsubscribe=n.sub(o=>{let s=this.decorations.size;this.decorations=Py(e.state,o),My(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 SC(e){return Ol.define(n=>new kC(n,e),{decorations:n=>n.decorations})}function CC(e){return[SC(e),Kt.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 EC({cellId:e,hotkeys:n}){let i=[];return i.push(...rw({key:n.getHotkey("cell.run").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).onRun(),!0)}),{key:n.getHotkey("cell.runAndNewBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Pt);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})),!0}},...rw({key:n.getHotkey("cell.runAndNewAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Pt);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(Pt).aiCellCompletion()&&o.contentDOM.focus(),!0)}),e!=="__scratch__"&&i.push({key:n.getHotkey("cell.goToDefinition").key,preventDefault:!0,stopPropagation:!0,run:o=>(Zh(o),!0)},{key:n.getHotkey("cell.delete").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.doc.length===0&&o.state.facet(Pt).deleteCell(),!0)},{key:n.getHotkey("cell.moveUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.moveDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.moveLeft").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveCell({cellId:e,before:!0,direction:"left"}),!0)},{key:n.getHotkey("cell.moveRight").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveCell({cellId:e,before:!1,direction:"right"}),!0)},{key:"ArrowUp",preventDefault:!0,stopPropagation:!0,run:o=>xw(o.state)?!1:zh(o)?(o.state.facet(Pt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:"ArrowDown",preventDefault:!0,stopPropagation:!0,run:o=>xw(o.state)?!1:am(o)?(o.state.facet(Pt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0):!1},{key:n.getHotkey("cell.focusDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0)},{key:n.getHotkey("cell.focusUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},{key:n.getHotkey("cell.sendToBottom").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).sendToBottom({cellId:e}),!0)},{key:n.getHotkey("cell.sendToTop").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).sendToTop({cellId:e}),!0)},{key:n.getHotkey("cell.createAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(Pt).createNewCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.createBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(Pt).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(Pt).toggleHideCode();return kw(o),s?(o.contentDOM.blur(),(c=document.getElementById(er.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(Pt);return s.splitCell({cellId:e}),s.moveToNextCell&&requestAnimationFrame(()=>{o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})}),!0}}),[Nu.high(Ra.of(i))]}function TC(e){return[Kt.updateListener.of(n=>{if(n.docChanged){let i=n.transactions.some(d=>d.effects.some(f=>f.is(Ms))),o=Xr(n.view),s=n.view.state.facet(Pt),c=n.view.state.facet(Ui);s.updateCellCode({cellId:c,code:o,formattingChange:i})}}),TS(e)]}function RC({predicate:e}){return Kt.updateListener.of(n=>{n.docChanged&&n.view.hasFocus&&e()&&(n.transactions.some(i=>i.effects.some(o=>o.is(Ms)))||n.view.state.facet(Pt).onRun())})}Nw=function({cellId:e,hotkeys:n,cellActions:i}){return[Pt.of(i),Ui.of(e),EC({cellId:e,hotkeys:n}),TC(n),CC(SS(mT(e),lt))]};const Ly=async e=>{let n=e.state.doc.sliceString(0,e.pos),i=document.activeElement,o=null;if(i!==null){let d=er.findElement(i);d!==null&&(o=er.parse(d.id))}if(o===null)return Se.error("Failed to find active cell."),null;let s=await fd.request({document:n,cellId:o});if(!s)return null;let c=Gd.asHoverTooltip({position:e.pos,message:s,limitToType:"tooltip"});return c&&lt.set(Xu,{documentation:c.html??null}),c?null:Gd.asCompletionResult(e.pos,s)};function DC(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 i=await PC();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w:]*$/}},PC=di(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,i])=>({shortcode:i[0],label:i.map(o=>`:${o}`).join(" "),emoji:n,displayLabel:`${n} ${i[0].replaceAll("_"," ")}`,apply:n,type:"emoji"}))}),MC=async e=>{let n=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!n)return null;let i=await LC();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w-:]*$/}},LC=di(async()=>{let e=await fetch("https://unpkg.com/lucide-static@0.452.0/tags.json").then(i=>{if(!i.ok)throw Error("Failed to fetch Lucide icon list");return i.json()}).catch(()=>({})),n=i=>`https://cdn.jsdelivr.net/npm/lucide-static@0.452.0/icons/${i}.svg`;return Object.entries(e).map(([i,o])=>({label:`::${i}`,displayLabel:i,type:"lucide-icon",boost:10,apply:`::lucide:${i}::`,detail:o.join(", "),info:()=>{let s=document.createElement("img");return s.src=n(i),s.style.width="24px",s.style.height="24px",s}}))}),NC=e=>{let n=e.matchBefore(/\\\w*$/);return!e.explicit&&!n?null:{from:(n==null?void 0:n.from)??e.pos,options:IC(),validFor:/^[\w\\]*$/}},IC=di(()=>[["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,i])=>({label:`\\${e} ${i}`,displayLabel:e,type:"latex-symbol",boost:10,apply:`\\${e}`,info:()=>{let o=document.createElement("div");return o.textContent=`${n} ${i}`,o},detail:n})));let Ny;Ny=[OC,MC,NC],Jl={isAbsolute:e=>e.startsWith("/")||e.startsWith("\\")||e.startsWith("C:\\"),dirname:e=>Fl.guessDeliminator(e).dirname(e),basename:e=>Fl.guessDeliminator(e).basename(e),rest:(e,n)=>Fl.guessDeliminator(e).rest(e,n),extension:e=>{let n=e.split(".");return n.length===1?"":n.at(-1)??""}};let Iy;Fl=class jm{constructor(n){this.deliminator=n}static guessDeliminator(n){return n.includes("/")?new jm("/"):new jm("\\")}join(...n){return n.filter(Boolean).join(this.deliminator)}basename(n){return n.split(this.deliminator).pop()??""}rest(n,i){let o=n.split(this.deliminator),s=i.split(this.deliminator),c=0;for(;c<o.length&&c<s.length&&o[c]===s[c];++c);return o.slice(c).join(this.deliminator)}dirname(n){let i=n.split(this.deliminator);return i.pop(),i.join(this.deliminator)}},Iy=100;function Io(e){return!e.state.selection.main.empty}function Zd({view:e,selection:n,markup:i}){let o=[],s=!0;for(let c=n.from;c<=n.to;c++)if(!e.state.doc.lineAt(c).text.startsWith(i)){s=!1;break}for(let c=n.from;c<=n.to;){let d=e.state.doc.lineAt(c),f=d.text.startsWith(i);s?o.push({from:d.from,to:d.from+i.length,insert:vo.of([""])}):(f&&o.push({from:d.from,to:d.from+i.length,insert:vo.of([""])}),o.push({from:d.from,insert:vo.of([i])})),c=d.to+1}return o}function ef({view:e,range:n,markupAfter:i,markupBefore:o}){if(n.empty){let y=e.state.wordAt(n.head);y&&(n=y)}let s=e.state.sliceDoc(n.from-o.length,n.from)===o,c=e.state.sliceDoc(n.to,n.to+i.length)===i,d=[];d.push(s?{from:n.from-o.length,to:n.from,insert:vo.of([""])}:{from:n.from,insert:vo.of(o.split(`
127
127
  `))},c?{from:n.to,to:n.to+i.length,insert:vo.of([""])}:{from:n.to,insert:vo.of(i.split(`
128
- `))});let f=s?-o.length:o.length,p=c?-i.length:i.length;return{changes:d,range:mn.range(n.from+f,n.to+p)}}function AC(e){if(!Io(e))return!1;let n=Zd({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 qC(e){if(!Io(e))return!1;let n=e.state.changeByRange(i=>{if(i.empty){let o=e.state.wordAt(i.head);o&&(i=o)}return ef({view:e,range:i,markupBefore:"**",markupAfter:"**"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0}function Ay(e){if(!Io(e))return!1;let n=e.state.changeByRange(i=>{if(i.empty){let s=e.state.wordAt(i.head);s&&(i=s)}let o=e.state.doc.lineAt(i.from).number!==e.state.doc.lineAt(i.to).number;return ef({view:e,range:i,markupBefore:o?"```\n":"`",markupAfter:o?"\n```":"`"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0}function jC(e){let n=e.state.changeByRange(i=>{if(i.empty){let o=e.state.wordAt(i.head);o&&(i=o)}return ef({view:e,range:i,markupBefore:"_",markupAfter:"_"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0}function qy(e,n="http://"){if(!Io(e))return!1;let i=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(i,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")}));let{to:o}=i.selection.main;try{e.dispatch({selection:mn.create([mn.range(o+3,o+3+n.length),mn.cursor(o+3+n.length)])})}catch{}return e.focus(),!0}Bh=async function(e,n){var f;let i=new FileReader,o=await new Promise(p=>{i.onload=()=>p(i.result),i.readAsDataURL(n)}),s;try{if(o.startsWith("data:")){let p=o.split(",")[1],y=prompt("We can save your image as a file. Enter a filename.",n.name),w=n.type.split("/")[1];if(y===null){let _=Math.round(o.length/1024);if(_>Iy){Nl({title:"Content too large",description:`The content size is ${_} KB, which is too large to paste directly into the document.`});return}}else{y.trim()===""?y=n.name:y.endsWith(`.${w}`)||(y=`${y}.${w}`);let _=lt.get(Es),C=_?Xl.dirname(_):null,E=C?`${C}/public`:"public",T=await Vi().sendCreateFileOrFolder({path:E,type:"file",name:y,contents:p});T.success?(s=(f=T.info)==null?void 0:f.path,s&&C&&s.startsWith(C)&&(s=Xl.rest(s,C)),Nl({title:"Image uploaded successfully",description:`We've uploaded your image at ${s}`})):Nl({title:"Failed to upload image. Using raw base64 string."})}}}catch{Nl({title:"Failed to upload image. Using raw base64 string."})}let c=e.state.changeByRange(p=>{let y=e.state.sliceDoc(p.from,p.to);return y.trim()===""&&(y="alt"),{changes:[{from:p.from,to:p.to,insert:`![${y}](${s??o})`}],range:p}});e.dispatch(e.state.update(c,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")}));let{to:d}=c.selection.main;try{e.dispatch({selection:mn.create([mn.range(d+4,d+4+o.length),mn.cursor(d+4+o.length)])})}catch{}return e.focus(),!0},Kh=async function(e,n){let i=await n.text(),o=e.state.changeByRange(s=>({changes:[{from:s.from,to:s.from,insert:i}],range:s}));return e.dispatch(e.state.update(o,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0};function zC(e){if(!Io(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:Zd({view:e,selection:i,markup:e.state.sliceDoc(i.from,i.to+2).startsWith("* ")?"* ":"- "})}));return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function FC(e){if(!Io(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:Zd({view:e,selection:i,markup:"1. "})}));return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function BC(e){return[Nu.highest(Ra.of([{key:e.getHotkey("markdown.bold").key,stopPropagation:!0,run:qC},{key:e.getHotkey("markdown.italic").key,stopPropagation:!0,run:jC},{key:e.getHotkey("markdown.link").key,stopPropagation:!0,run:n=>qy(n)},{key:e.getHotkey("markdown.orderedList").key,run:FC},{key:e.getHotkey("markdown.unorderedList").key,run:zC},{key:e.getHotkey("markdown.blockquote").key,run:AC},{key:e.getHotkey("markdown.code").key,run:Ay},{key:"`",run:Ay}])),Kt.domEventHandlers({paste:(n,i)=>{var s;if(i.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(),qy(i,o))}}),Kt.domEventHandlers({paste:(n,i)=>{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(),Bh(i,o),!0;if(o.type.startsWith("text/"))return n.preventDefault(),Kh(i,o),!0}})]}function HC(e,n,i=3,o=""){return Object.values(e).flatMap(s=>n.has(s.name)?[]:{label:`${o}${s.name}`,displayLabel:s.name,detail:s.dataType??"",boost:i,type:"variable",apply:`${o}${s.name}`,section:"Variable",info:()=>Ah(s)})}Ah=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 i=document.createElement("div");i.classList.add("flex","items-center","gap-2");let o=document.createElement("span");if(o.classList.add("font-bold","text-base"),o.textContent=e.name,i.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,i.append(s)}if(n.append(i),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 d=document.createElement("div");d.classList.add("text-xs","font-mono","bg-muted","p-2","rounded","overflow-auto","max-h-40"),d.textContent=e.value,s.append(d),n.append(s)}return n};var Ao="Python",tf=123,jy=125,nf=1,VC={mark:`${Ao}Mark`,resolve:Ao};function $C(e,n){return{defineNodes:[{name:Ao,style:Mu.emphasis},{name:`${Ao}Mark`,style:Mu.processingInstruction}],parseInline:[{name:Ao,parse(i,o,s){return!n()||o!==tf&&o!==jy||o===tf&&i.slice(s-1,s)==="{"?-1:i.addDelimiter(VC,s,s+nf,o===tf,o===jy)}}],wrap:mw(i=>{if(!n()||i.type.name!==Ao)return null;let o=i.from+nf,s=i.to-nf;return o>=s||o<0||s<0?null:{parser:e,overlay:[{from:o,to:s}],extensions:[Rw().support]}})}}const WC=e=>{let n=e.state.doc.sliceString(0,e.pos),i=n.lastIndexOf("{");if(n.at(i-1)==="{"||i===-1||n.indexOf("}",i)>i)return null;let o=e.matchBefore(/\w*$/);if(!o)return null;let s=HC(lt.get(Ma),new Set,99);return{from:o.from,options:s,validFor:/^\w*$/}};var cc="InlineMathDollar",qo="InlineMathBracket",uc="BlockMathDollar",jo="BlockMathBracket",Ba={[cc]:1,[qo]:3,[uc]:2,[jo]:3},At={DOLLAR:36,BACKSLASH:92,OPEN_PAREN:40,CLOSE_PAREN:41,OPEN_BRACKET:91,CLOSE_BRACKET:93},zo=Object.keys(Ba).reduce((e,n)=>(e[n]={mark:`${n}Mark`,resolve:n},e),{});function UC(e){let n=[];return Object.keys(Ba).forEach(i=>{n.push({name:i,style:Mu.emphasis},{name:`${i}Mark`,style:Mu.processingInstruction})}),{defineNodes:n,parseInline:[{name:uc,parse(i,o,s){return o!==At.DOLLAR||i.char(s+1)!==At.DOLLAR?-1:i.addDelimiter(zo[uc],s,s+Ba[uc],!0,!0)}},{name:cc,parse(i,o,s){return o!==At.DOLLAR||i.char(s+1)===At.DOLLAR?-1:i.addDelimiter(zo[cc],s,s+Ba[cc],!0,!0)}},{name:qo,before:"Escape",parse(i,o,s){return o!==At.BACKSLASH||i.char(s+1)!==At.BACKSLASH||![At.OPEN_PAREN,At.CLOSE_PAREN].includes(i.char(s+2))?-1:i.addDelimiter(zo[qo],s,s+Ba[qo],i.char(s+2)===At.OPEN_PAREN,i.char(s+2)===At.CLOSE_PAREN)}},{name:jo,before:"Escape",parse(i,o,s){return o!==At.BACKSLASH||i.char(s+1)!==At.BACKSLASH||![At.OPEN_BRACKET,At.CLOSE_BRACKET].includes(i.char(s+2))?-1:i.addDelimiter(zo[jo],s,s+Ba[jo],i.char(s+2)===At.OPEN_BRACKET,i.char(s+2)===At.CLOSE_BRACKET)}},{name:qo,before:"Escape",parse(i,o,s){return o!==At.BACKSLASH||![At.OPEN_PAREN,At.CLOSE_PAREN].includes(i.char(s+1))?-1:i.addDelimiter(zo[qo],s,s+2,i.char(s+1)===At.OPEN_PAREN,i.char(s+1)===At.CLOSE_PAREN)}},{name:jo,before:"Escape",parse(i,o,s){return o!==At.BACKSLASH||![At.OPEN_BRACKET,At.CLOSE_BRACKET].includes(i.char(s+1))?-1:i.addDelimiter(zo[jo],s,s+2,i.char(s+1)===At.OPEN_BRACKET,i.char(s+1)===At.CLOSE_BRACKET)}}],wrap:mw(i=>{let o=Ba[i.type.name];if(o){let s=i.from+o,c=i.to-o;return s>=c||s<0||c<0?null:{parser:e,overlay:[{from:s,to:c}]}}return null})}}$u=Bi.define(),Uu=Bi.define(),fi=xs.define({create:()=>({}),update:(e,n)=>{for(let i of n.effects){if(i.is($u))return i.value;if(i.is(Uu))return{...e,...i.value}}return e}}),ad=class{constructor(){ke(this,"parser",new ty);ke(this,"type","markdown");ke(this,"defaultCode",this.parser.defaultCode);ke(this,"defaultMetadata",this.parser.defaultMetadata)}static fromMarkdown(e){return ty.fromMarkdown(e)}transformIn(e){let n=this.parser.transformIn(e);return[n.code,n.offset,n.metadata]}transformOut(e,n){let i=this.parser.transformOut(e,n);return[i.code,i.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,i,o){let s=Tw().language.data,c,d=()=>{var p;if(!c)return!0;let f=c==null?void 0:c.state.field(fi);return f===void 0?!1:((p=f.quotePrefix)==null?void 0:p.includes("f"))??!1};return[Pl.define(f=>(c=f,{})),Tw({base:PD,codeLanguages:Zk,extensions:[UC(hw.define(ID).parser),$C(Oh.parser,d)]}),BC(i),Ny.map(f=>s.of({autocomplete:f})),Rw().language.data.of({autocomplete:DC({completion:Ly,predicate:d})}),Iu({defaultKeymap:!1,activateOnTyping:!0}),RC({predicate:()=>!d()})]}};function zy(){return`file://${Fl()??"/__marimo_notebook__.py"}`}function rf(){return`file://${Xl.dirname(Fl()??"/")}`}function KC(e){return ui.filter(e,n=>n!==!1&&n!==null)}function Fy(e){let n=e.map(KC);return Object.assign({},...n)}var QC=class{constructor(e){ke(this,"clients",[]);this.clients=e,this.documentUri=zy()}onNotification(e){let n=[];for(let i of this.clients)n.push(i.onNotification(e));return()=>{for(let i of n)i();return!0}}get clientCapabilities(){return Fy(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 Fy(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 i;return(i=n.capabilities)==null?void 0:i[e]})}clientsWithCapability(e){return this.clients.filter(n=>{var i;return(i=n.capabilities)==null?void 0:i[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 GC(await Promise.allSettled(n.map(i=>i.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 i of this.clients){if(!((n=i.capabilities)!=null&&n.hoverProvider))continue;let o=await i.textDocumentHover(e);if(o)return o}return{contents:[]}}};function GC(e){let n=[],i=!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),i||(i=s.isIncomplete))}return{items:n,isIncomplete:i}}Mw=function(e){return[...JC(e),e].join(`
128
+ `))});let f=s?-o.length:o.length,p=c?-i.length:i.length;return{changes:d,range:mn.range(n.from+f,n.to+p)}}function AC(e){if(!Io(e))return!1;let n=Zd({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 qC(e){if(!Io(e))return!1;let n=e.state.changeByRange(i=>{if(i.empty){let o=e.state.wordAt(i.head);o&&(i=o)}return ef({view:e,range:i,markupBefore:"**",markupAfter:"**"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0}function Ay(e){if(!Io(e))return!1;let n=e.state.changeByRange(i=>{if(i.empty){let s=e.state.wordAt(i.head);s&&(i=s)}let o=e.state.doc.lineAt(i.from).number!==e.state.doc.lineAt(i.to).number;return ef({view:e,range:i,markupBefore:o?"```\n":"`",markupAfter:o?"\n```":"`"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0}function jC(e){let n=e.state.changeByRange(i=>{if(i.empty){let o=e.state.wordAt(i.head);o&&(i=o)}return ef({view:e,range:i,markupBefore:"_",markupAfter:"_"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0}function qy(e,n="http://"){if(!Io(e))return!1;let i=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(i,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")}));let{to:o}=i.selection.main;try{e.dispatch({selection:mn.create([mn.range(o+3,o+3+n.length),mn.cursor(o+3+n.length)])})}catch{}return e.focus(),!0}Bh=async function(e,n){var f;let i=new FileReader,o=await new Promise(p=>{i.onload=()=>p(i.result),i.readAsDataURL(n)}),s;try{if(o.startsWith("data:")){let p=o.split(",")[1],y=prompt("We can save your image as a file. Enter a filename.",n.name),w=n.type.split("/")[1];if(y===null){let _=Math.round(o.length/1024);if(_>Iy){Ll({title:"Content too large",description:`The content size is ${_} KB, which is too large to paste directly into the document.`});return}}else{y.trim()===""?y=n.name:y.endsWith(`.${w}`)||(y=`${y}.${w}`);let _=lt.get(Es),C=_?Jl.dirname(_):null,E=C?`${C}/public`:"public",T=await Vi().sendCreateFileOrFolder({path:E,type:"file",name:y,contents:p});T.success?(s=(f=T.info)==null?void 0:f.path,s&&C&&s.startsWith(C)&&(s=Jl.rest(s,C)),Ll({title:"Image uploaded successfully",description:`We've uploaded your image at ${s}`})):Ll({title:"Failed to upload image. Using raw base64 string."})}}}catch{Ll({title:"Failed to upload image. Using raw base64 string."})}let c=e.state.changeByRange(p=>{let y=e.state.sliceDoc(p.from,p.to);return y.trim()===""&&(y="alt"),{changes:[{from:p.from,to:p.to,insert:`![${y}](${s??o})`}],range:p}});e.dispatch(e.state.update(c,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")}));let{to:d}=c.selection.main;try{e.dispatch({selection:mn.create([mn.range(d+4,d+4+o.length),mn.cursor(d+4+o.length)])})}catch{}return e.focus(),!0},Kh=async function(e,n){let i=await n.text(),o=e.state.changeByRange(s=>({changes:[{from:s.from,to:s.from,insert:i}],range:s}));return e.dispatch(e.state.update(o,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0};function zC(e){if(!Io(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:Zd({view:e,selection:i,markup:e.state.sliceDoc(i.from,i.to+2).startsWith("* ")?"* ":"- "})}));return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function FC(e){if(!Io(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:Zd({view:e,selection:i,markup:"1. "})}));return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function BC(e){return[Nu.highest(Ra.of([{key:e.getHotkey("markdown.bold").key,stopPropagation:!0,run:qC},{key:e.getHotkey("markdown.italic").key,stopPropagation:!0,run:jC},{key:e.getHotkey("markdown.link").key,stopPropagation:!0,run:n=>qy(n)},{key:e.getHotkey("markdown.orderedList").key,run:FC},{key:e.getHotkey("markdown.unorderedList").key,run:zC},{key:e.getHotkey("markdown.blockquote").key,run:AC},{key:e.getHotkey("markdown.code").key,run:Ay},{key:"`",run:Ay}])),Kt.domEventHandlers({paste:(n,i)=>{var s;if(i.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(),qy(i,o))}}),Kt.domEventHandlers({paste:(n,i)=>{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(),Bh(i,o),!0;if(o.type.startsWith("text/"))return n.preventDefault(),Kh(i,o),!0}})]}function HC(e,n,i=3,o=""){return Object.values(e).flatMap(s=>n.has(s.name)?[]:{label:`${o}${s.name}`,displayLabel:s.name,detail:s.dataType??"",boost:i,type:"variable",apply:`${o}${s.name}`,section:"Variable",info:()=>Ah(s)})}Ah=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 i=document.createElement("div");i.classList.add("flex","items-center","gap-2");let o=document.createElement("span");if(o.classList.add("font-bold","text-base"),o.textContent=e.name,i.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,i.append(s)}if(n.append(i),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 d=document.createElement("div");d.classList.add("text-xs","font-mono","bg-muted","p-2","rounded","overflow-auto","max-h-40"),d.textContent=e.value,s.append(d),n.append(s)}return n};var Ao="Python",tf=123,jy=125,nf=1,VC={mark:`${Ao}Mark`,resolve:Ao};function $C(e,n){return{defineNodes:[{name:Ao,style:Mu.emphasis},{name:`${Ao}Mark`,style:Mu.processingInstruction}],parseInline:[{name:Ao,parse(i,o,s){return!n()||o!==tf&&o!==jy||o===tf&&i.slice(s-1,s)==="{"?-1:i.addDelimiter(VC,s,s+nf,o===tf,o===jy)}}],wrap:mw(i=>{if(!n()||i.type.name!==Ao)return null;let o=i.from+nf,s=i.to-nf;return o>=s||o<0||s<0?null:{parser:e,overlay:[{from:o,to:s}],extensions:[Rw().support]}})}}const WC=e=>{let n=e.state.doc.sliceString(0,e.pos),i=n.lastIndexOf("{");if(n.at(i-1)==="{"||i===-1||n.indexOf("}",i)>i)return null;let o=e.matchBefore(/\w*$/);if(!o)return null;let s=HC(lt.get(Ma),new Set,99);return{from:o.from,options:s,validFor:/^\w*$/}};var cc="InlineMathDollar",qo="InlineMathBracket",uc="BlockMathDollar",jo="BlockMathBracket",Ba={[cc]:1,[qo]:3,[uc]:2,[jo]:3},At={DOLLAR:36,BACKSLASH:92,OPEN_PAREN:40,CLOSE_PAREN:41,OPEN_BRACKET:91,CLOSE_BRACKET:93},zo=Object.keys(Ba).reduce((e,n)=>(e[n]={mark:`${n}Mark`,resolve:n},e),{});function UC(e){let n=[];return Object.keys(Ba).forEach(i=>{n.push({name:i,style:Mu.emphasis},{name:`${i}Mark`,style:Mu.processingInstruction})}),{defineNodes:n,parseInline:[{name:uc,parse(i,o,s){return o!==At.DOLLAR||i.char(s+1)!==At.DOLLAR?-1:i.addDelimiter(zo[uc],s,s+Ba[uc],!0,!0)}},{name:cc,parse(i,o,s){return o!==At.DOLLAR||i.char(s+1)===At.DOLLAR?-1:i.addDelimiter(zo[cc],s,s+Ba[cc],!0,!0)}},{name:qo,before:"Escape",parse(i,o,s){return o!==At.BACKSLASH||i.char(s+1)!==At.BACKSLASH||![At.OPEN_PAREN,At.CLOSE_PAREN].includes(i.char(s+2))?-1:i.addDelimiter(zo[qo],s,s+Ba[qo],i.char(s+2)===At.OPEN_PAREN,i.char(s+2)===At.CLOSE_PAREN)}},{name:jo,before:"Escape",parse(i,o,s){return o!==At.BACKSLASH||i.char(s+1)!==At.BACKSLASH||![At.OPEN_BRACKET,At.CLOSE_BRACKET].includes(i.char(s+2))?-1:i.addDelimiter(zo[jo],s,s+Ba[jo],i.char(s+2)===At.OPEN_BRACKET,i.char(s+2)===At.CLOSE_BRACKET)}},{name:qo,before:"Escape",parse(i,o,s){return o!==At.BACKSLASH||![At.OPEN_PAREN,At.CLOSE_PAREN].includes(i.char(s+1))?-1:i.addDelimiter(zo[qo],s,s+2,i.char(s+1)===At.OPEN_PAREN,i.char(s+1)===At.CLOSE_PAREN)}},{name:jo,before:"Escape",parse(i,o,s){return o!==At.BACKSLASH||![At.OPEN_BRACKET,At.CLOSE_BRACKET].includes(i.char(s+1))?-1:i.addDelimiter(zo[jo],s,s+2,i.char(s+1)===At.OPEN_BRACKET,i.char(s+1)===At.CLOSE_BRACKET)}}],wrap:mw(i=>{let o=Ba[i.type.name];if(o){let s=i.from+o,c=i.to-o;return s>=c||s<0||c<0?null:{parser:e,overlay:[{from:s,to:c}]}}return null})}}$u=Bi.define(),Uu=Bi.define(),fi=xs.define({create:()=>({}),update:(e,n)=>{for(let i of n.effects){if(i.is($u))return i.value;if(i.is(Uu))return{...e,...i.value}}return e}}),ad=class{constructor(){ke(this,"parser",new ty);ke(this,"type","markdown");ke(this,"defaultCode",this.parser.defaultCode);ke(this,"defaultMetadata",this.parser.defaultMetadata)}static fromMarkdown(e){return ty.fromMarkdown(e)}transformIn(e){let n=this.parser.transformIn(e);return[n.code,n.offset,n.metadata]}transformOut(e,n){let i=this.parser.transformOut(e,n);return[i.code,i.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,i,o){let s=Tw().language.data,c,d=()=>{var p;if(!c)return!0;let f=c==null?void 0:c.state.field(fi);return f===void 0?!1:((p=f.quotePrefix)==null?void 0:p.includes("f"))??!1};return[Ol.define(f=>(c=f,{})),Tw({base:PD,codeLanguages:Zk,extensions:[UC(hw.define(ID).parser),$C(Oh.parser,d)]}),BC(i),Ny.map(f=>s.of({autocomplete:f})),Rw().language.data.of({autocomplete:DC({completion:Ly,predicate:d})}),Iu({defaultKeymap:!1,activateOnTyping:!0}),RC({predicate:()=>!d()})]}};function zy(){return`file://${zl()??"/__marimo_notebook__.py"}`}function rf(){return`file://${Jl.dirname(zl()??"/")}`}function KC(e){return ui.filter(e,n=>n!==!1&&n!==null)}function Fy(e){let n=e.map(KC);return Object.assign({},...n)}var QC=class{constructor(e){ke(this,"clients",[]);this.clients=e,this.documentUri=zy()}onNotification(e){let n=[];for(let i of this.clients)n.push(i.onNotification(e));return()=>{for(let i of n)i();return!0}}get clientCapabilities(){return Fy(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 Fy(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 i;return(i=n.capabilities)==null?void 0:i[e]})}clientsWithCapability(e){return this.clients.filter(n=>{var i;return(i=n.capabilities)==null?void 0:i[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 GC(await Promise.allSettled(n.map(i=>i.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 i of this.clients){if(!((n=i.capabilities)!=null&&n.hoverProvider))continue;let o=await i.textDocumentHover(e);if(o)return o}return{contents:[]}}};function GC(e){let n=[],i=!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),i||(i=s.isIncomplete))}return{items:n,isIncomplete:i}}Mw=function(e){return[...JC(e),e].join(`
129
129
  `)};function JC(e){return Om().map(n=>{let i=Xr(n);return i===e?null:i}).filter(Boolean).sort((n,i)=>n.startsWith("import")&&!i.startsWith("import")?-1:!n.startsWith("import")&&i.startsWith("import")?1:0)}var XC=ze(e=>{let n=e(bt);return ui.fromEntries(n.cellIds.inOrderIds.map(i=>{let o=n.cellHandles[i];return[i,o!=null&&o.current?Xr(o.current.editorView):""]}))}),YC=ze(e=>e(bt).cellIds.inOrderIds),ZC=ze(e=>tE(e(YC),e(Ma)));const eE=ze(e=>({cellIds:e(ZC),codes:e(XC)}));function tE(e,n){var p,y;let i=new Map;e.forEach(w=>i.set(w,[]));let o=new Set(e),s=new Set(e);for(let{declaredBy:w,usedBy:_}of Object.values(n))for(let C of w){o.delete(C);for(let E of _)s.delete(E),E!==C&&((p=i.get(C))==null||p.push(E))}let c=new Map;e.forEach(w=>c.set(w,0)),i.forEach(w=>{w.forEach(_=>{c.set(_,(c.get(_)||0)+1)})});let d=[];c.forEach((w,_)=>{w===0&&d.push(_)});let f=[];for(;d.length>0;){let w=d.shift();if(!w)break;f.push(w),(y=i.get(w))==null||y.forEach(_=>{c.set(_,(c.get(_)||0)-1),c.get(_)===0&&d.push(_)})}return[...f.filter(w=>!o.has(w)),...o]}function nE(e,n){let i=new Map,o=0;e.forEach(d=>{i.set(d,o),o+=n[d].split(`
130
- `).length});function s(d){return i.has(d)||Ee.warn("[lsp] no cell line offsets for",d),i.get(d)??0}let c=e.map(d=>n[d]).join(`
130
+ `).length});function s(d){return i.has(d)||Se.warn("[lsp] no cell line offsets for",d),i.get(d)??0}let c=e.map(d=>n[d]).join(`
131
131
  `);return{cellIds:e,mergedText:c,transformRange:(d,f)=>By(d,s(f)),reverseRange:(d,f)=>By(d,-s(f)),isInRange:(d,f)=>{let p=n[f].split(`
132
- `).length,y=i.get(f)||0,w=d.start.line-y,_=d.end.line-y,C=w>=0&&w<p,E=_>=0&&_<p;return C&&!E&&Ee.warn("[lsp] Cross-cell diagnostic detected: range starts in cell but ends outside",{cellId:f,range:d,cellLines:p,offset:y}),C&&E},getEditsForNewText:d=>{let f=d.split(`
132
+ `).length,y=i.get(f)||0,w=d.start.line-y,_=d.end.line-y,C=w>=0&&w<p,E=_>=0&&_<p;return C&&!E&&Se.warn("[lsp] Cross-cell diagnostic detected: range starts in cell but ends outside",{cellId:f,range:d,cellLines:p,offset:y}),C&&E},getEditsForNewText:d=>{let f=d.split(`
133
133
  `),p=c.split(`
134
- `);if(f.length!==p.length)throw Ee.warn("[lsp] cannot apply rename with new lines",f,p),Error("Cannot apply rename when there are new lines");let y=[];for(let[w,_]of ui.entries(n)){if(!i.has(w))continue;let C=i.get(w)??0,E=_.split(`
134
+ `);if(f.length!==p.length)throw Se.warn("[lsp] cannot apply rename with new lines",f,p),Error("Cannot apply rename when there are new lines");let y=[];for(let[w,_]of ui.entries(n)){if(!i.has(w))continue;let C=i.get(w)??0,E=_.split(`
135
135
  `).length,T=f.slice(C,C+E);y.push({cellId:w,text:T.join(`
136
- `)})}return y},transformPosition:(d,f)=>dc(d,s(f)),reversePosition:(d,f)=>dc(d,-s(f))}}function By(e,n){return{start:dc(e.start,n),end:dc(e.end,n)}}function dc(e,n){return{line:e.line+n,character:e.character}}const Un={PREFIX:"file:///",of(e){return`${this.PREFIX}${e}`},is(e){return e.startsWith(this.PREFIX)},parse(e){return In(this.is(e),`Invalid cell document URI: ${e}`),e.slice(this.PREFIX.length)}};function Hy(e){return"notify"in e}function rE(e){return e.startsWith("_")&&!e.startsWith("__")}var iE=class{constructor(e){ke(this,"documentVersion",0);ke(this,"versionToCellNumberAndVersion",new Ps(20));ke(this,"lastSnapshot",null);this.getNotebookCode=e}snapshot(){var i;let e=this.getLens(),n=((i=this.lastSnapshot)==null?void 0:i.mergedText)!==e.mergedText;return n?(this.documentVersion++,this.lastSnapshot=e,{lens:e,didChange:n,version:this.documentVersion}):{lens:e,didChange:n,version:this.documentVersion}}getSnapshot(e){let n=this.versionToCellNumberAndVersion.get(e);if(!n)throw Error(`No snapshot for version ${e}`);return n}getLatestSnapshot(){if(!this.lastSnapshot)throw Error("No snapshots");return{lens:this.lastSnapshot,version:this.documentVersion}}getLens(){let{cellIds:e,codes:n}=this.getNotebookCode();return nE(e,n)}},aE=()=>{let e=od().cellHandles;return ui.mapValues(e,n=>{var i;return(i=n.current)==null?void 0:i.editorViewOrNull})},af=(zr=class{constructor(n,i,o=aE){ke(this,"completionItemCache",new Ps(10));this.documentUri=zy(),this.getNotebookEditors=o,this.initialSettings=i,this.client=n,this.patchProcessNotification(),this.initializePromise.then(()=>{In(Hy(this.client),"notify is not a method on the client"),this.client.notify("workspace/didChangeConfiguration",{settings:i})}),this.snapshotter=new iE(this.getNotebookCode.bind(this))}static pruneSeenCellUris(n){for(let i of zr.SEEN_CELL_DOCUMENT_URIS){let o=Un.parse(i);n.has(o)||zr.SEEN_CELL_DOCUMENT_URIS.delete(i)}}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(){In(Hy(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:i}=this.snapshotter.snapshot();await this.client.textDocumentDidOpen({textDocument:{languageId:"python",text:n.mergedText,uri:this.documentUri,version:i}}),Ee.log("[lsp] Document re-synchronization complete")}getNotebookCode(){return lt.get(eE)}assertCellDocumentUri(n){In(Un.is(n),"Execpted URI to be CellDocumentUri")}async textDocumentDidOpen(n){Ee.debug("[lsp] textDocumentDidOpen",n);let i=n.textDocument.uri;this.assertCellDocumentUri(i);let{lens:o,version:s}=this.snapshotter.snapshot();zr.SEEN_CELL_DOCUMENT_URIS.add(i);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:i,didChange:o}=this.snapshotter.snapshot(),s={textDocument:{uri:this.documentUri,version:i},contentChanges:[{text:n.mergedText}]};return o&&await this.client.textDocumentDidChange(s),{params:s,lens:n}}async textDocumentDidChange(n){if(Ee.debug("[lsp] textDocumentDidChange",n),n.contentChanges.length===1){let{params:i}=await this.sync();return i}return Ee.warn("[lsp] Unhandled textDocumentDidChange",n),this.client.textDocumentDidChange(n)}async textDocumentDefinition(n){let i=n.textDocument.uri;if(!Un.is(i))return Ee.warn("Invalid cell document URI",i),null;let{lens:o}=await this.sync(),s=Un.parse(i);return this.client.textDocumentDefinition({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentSignatureHelp(n){let i=n.textDocument.uri;if(!Un.is(i))return Ee.warn("Invalid cell document URI",i),null;let{lens:o}=await this.sync(),s=Un.parse(i);return await this.client.textDocumentSignatureHelp({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})||null}textDocumentCodeAction(n){return Promise.resolve(null)}async textDocumentRename(n){var $;let i=n.textDocument.uri;if(!Un.is(i))return Ee.warn("Invalid cell document URI",i),null;let o=Un.parse(i),{lens:s}=await this.sync(),c=s.transformPosition(n.position,o),d=await this.client.textDocumentRename({...n,textDocument:{uri:this.documentUri},position:c});if(!d)return null;let f=($=d.documentChanges)==null?void 0:$.flatMap(V=>"edits"in V?V.edits:[]);if(!f||f.length!==1)return Ee.warn("Expected exactly one edit",f),d;let p=f[0];if(!("newText"in p))return Ee.warn("Expected newText in edit",p),d;let y=s.getEditsForNewText(p.newText),w=new Map(y.map(V=>[V.cellId,V.text])),_=this.getNotebookEditors(),C=_[o],E=!1;if(C){let V=C.state.doc.line(n.position.line+1).from+n.position.character,{startToken:F,endToken:N}=Jd(C.state.doc,V),K=C.state.doc.sliceString(F,N);E=rE(K),E&&Ee.debug("[lsp] Private variable rename detected, limiting to current cell",K)}let T=[],I=0;for(let[V,F]of ui.entries(_)){if(E&&V!==o)continue;let N=w.get(V);if(N==null){Ee.warn("[lsp] No new code for cell during rename",V),T.push(V);continue}if(!F){Ee.warn("[lsp] No editor view for cell during rename",V),T.push(V);continue}Xr(F)!==N&&(xo(F,N),I++)}return T.length>0&&Ee.error(`[lsp] Rename partially failed: could not update ${T.length} cell(s)`,T),Ee.debug(`[lsp] Rename completed: updated ${I} cell(s)`),{...d,documentChanges:[{edits:[],textDocument:{uri:i,version:0}}]}}async completionItemResolve(n){let i=JSON.stringify(n),o=this.completionItemCache.get(i);if(o)return o;let s=this.client.completionItemResolve(n);return this.completionItemCache.set(i,s),s}async textDocumentPrepareRename(n){let i=n.textDocument.uri;if(!Un.is(i))return Ee.warn("Invalid cell document URI",i),null;let{lens:o}=await this.sync(),s=Un.parse(i);return this.client.textDocumentPrepareRename({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentHover(n){Ee.debug("[lsp] textDocumentHover",n);let{lens:i}=await this.sync(),o=Un.parse(n.textDocument.uri),s=await this.client.textDocumentHover({...n,textDocument:{uri:this.documentUri},position:i.transformPosition(n.position,o)});return s?(typeof s.contents=="object"&&"kind"in s.contents&&(s.contents={kind:"markdown",value:s.contents.value}),s.contents===""?null:(s.range&&(s.range=i.reverseRange(s.range,o)),s)):(Ee.debug("[lsp] no hover result"),s)}async textDocumentCompletion(n){let{lens:i}=this.snapshotter.getLatestSnapshot(),o=Un.parse(n.textDocument.uri);return this.client.textDocumentCompletion({...n,textDocument:{uri:this.documentUri},position:i.transformPosition(n.position,o)})}patchProcessNotification(){In("processNotification"in this.client,"processNotification is not a method on the client");let n=this.client.processNotification.bind(this.client),i=o=>{if(o.method==="textDocument/publishDiagnostics"){Ee.debug("[lsp] handling diagnostics",o);let s=this.snapshotter.getLatestSnapshot(),c=o.params.diagnostics,{lens:d,version:f}=s,p=new Map;for(let _ of c)for(let C of d.cellIds)if(d.isInRange(_.range,C)){p.has(C)||p.set(C,[]);let E={..._,range:d.reverseRange(_.range,C)};p.get(C).push(E);break}let y=new Set(d.cellIds);zr.pruneSeenCellUris(y);let w=new Set(zr.SEEN_CELL_DOCUMENT_URIS);for(let[_,C]of p.entries()){Ee.debug("[lsp] diagnostics for cell",_,C);let E=Un.of(_);w.delete(E),n({...o,params:{...o.params,uri:E,version:f,diagnostics:C}})}if(w.size>0){Ee.debug("[lsp] clearing diagnostics",w);for(let _ of w)n({method:"textDocument/publishDiagnostics",params:{uri:_,diagnostics:[]}})}return}return n(o)};this.client.processNotification=i}},ke(zr,"SEEN_CELL_DOCUMENT_URIS",new Set),zr),oE=zl(),sE=Oa(),lE=class extends sE.Transport{constructor(n){super();ke(this,"isClosed",!1);ke(this,"hasConnectedBefore",!1);ke(this,"pendingSubscriptions",[]);this.options=n,this.delegate=void 0}createDelegate(){if(this.delegate)try{this.delegate.close()}catch(n){Ee.warn("Error closing old WebSocket delegate",n)}this.delegate=new oE.WebSocketTransport(this.options.getWsUrl());for(let{event:n,handler:i}of this.pendingSubscriptions)this.delegate.subscribe(n,i);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(),Ee.log("WebSocket transport connected successfully");let i=this.hasConnectedBefore;this.hasConnectedBefore=!0,i&&this.options.onReconnect&&(Ee.log("Calling onReconnect callback to re-synchronize state"),await this.options.onReconnect())}catch(n){throw Ee.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[i,o]=n;this.pendingSubscriptions.push({event:i,handler:o}),this.delegate&&this.delegate.subscribe(i,o)}unsubscribe(...n){let i=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),i}async sendData(n,i){var o;if(this.isDelegateClosedOrClosing()){Ee.warn("WebSocket is closed or closing, attempting to reconnect");try{await this.connect()}catch(s){throw Ee.error("Failed to reconnect WebSocket",s),s}}return(o=this.delegate)==null?void 0:o.sendData(n,i)}};function of(e,n){let i=x4();return new lE({getWsUrl:()=>i.getLSPURL(e).toString(),waitForConnection:async()=>{await _4()},onReconnect:n})}Bi.define(),new Lu;function cE(e){return e.facet(E4.readOnly)}function uE(e){return[sw(e),Ra.of([{key:"ArrowRight",preventDefault:!0,run:n=>Vy(n,e)},{key:"Tab",preventDefault:!0,run:n=>Vy(n,e)}])]}function Vy(e,n){if(cE(e.state))return!1;let i=e.state.doc.length;return i===0?(e.dispatch({changes:{from:0,to:i,insert:n},selection:{head:n.length,anchor:n.length}}),!0):!1}function dE(e){let{beforeText:n,linkText:i,afterText:o,onClick:s}=e;return[sw(c=>{let d=document.createElement("span");d.append(document.createTextNode(n));let f=document.createElement("span");return f.textContent=i,f.classList.add("cm-clickable-placeholder"),f.onclick=p=>{p.stopPropagation(),s(c)},d.append(f),d.append(document.createTextNode(o)),d}),Kt.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 fE=di(e=>{let n,i={transport:of("pylsp",async()=>{await(n==null?void 0:n())}),rootUri:rf(),workspaceFolders:[]},o=e==null?void 0:e.pylsp,s=["D100","D103"],c=["W292","E402"],d=["B018","I001"],f={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,...d]},signature:{formatter:o!=null&&o.enable_ruff?"ruff":"black",line_length:88}}}},p=new af(new jl({...i}),f);return n=()=>p.resyncAllDocuments(),p}),pE=di(e=>{let n,i=new af(new jl({transport:of("ty",async()=>{await(n==null?void 0:n())}),rootUri:rf(),workspaceFolders:[],getWorkspaceConfiguration:o=>[{disableLanguageServices:!0}]}),{});return n=()=>i.resyncAllDocuments(),i}),hE=di(e=>{let n,i=new af(new jl({transport:of("basedpyright",async()=>{await(n==null?void 0:n())}),rootUri:rf(),workspaceFolders:[]}),{});return n=()=>i.resyncAllDocuments(),i}),mE=class{constructor(){ke(this,"parser",new _S);ke(this,"type","python");ke(this,"defaultCode",this.parser.defaultCode);ke(this,"defaultMetadata",this.parser.defaultMetadata)}transformIn(e){let n=this.parser.transformIn(e);return[n.code,n.offset,n.metadata]}transformOut(e,n){let i=this.parser.transformOut(e,n);return[i.code,i.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,i,o,s){return[(()=>{var w,_,C,E;let c={defaultKeymap:!1,activateOnTyping:n.activate_on_typing,closeOnBlur:!1},d={hideOnChange:!0},f=[];(w=s==null?void 0:s.pylsp)!=null&&w.enabled&&lc("pylsp")&&f.push(fE(s)),(_=s==null?void 0:s.ty)!=null&&_.enabled&&lc("ty")&&f.push(pE(s)),(C=s==null?void 0:s.basedpyright)!=null&&C.enabled&&lc("basedpyright")&&f.push(hE(s));let p=n.signature_hint_on_typing,y=p?/(\w+|\w+\.|\/)$/:/(\w+|\w+\.|\(|\/|,)$/;if(f.length>0){let T=f.length===1?f[0]:new QC(f);return[bm({client:T,languageId:"python",allowHTMLContent:!0,useSnippetOnCompletion:!1,hoverConfig:d,completionConfig:c,diagnosticsEnabled:((E=s.diagnostics)==null?void 0:E.enabled)??!1,sendIncrementalChanges:!1,signatureHelpEnabled:!0,signatureActivateOnTyping:p,signatureHelpOptions:{position:"above"},keyboardShortcuts:{signatureHelp:i.getHotkey("cell.signatureHelp").key,goToDefinition:i.getHotkey("cell.goToDefinition").key,rename:i.getHotkey("cell.renameSymbol").key},completionMatchBefore:y,onGoToDefinition:I=>{Ee.debug("onGoToDefinition",I),T.documentUri!==I.uri&&Vi().openFile({path:I.uri.replace("file://","")})}}),bg.of(Un.of(e))]}return Iu({...c,override:[Ly]})})(),wm(),gE(o)]}};function gE(e){return e==="marimo-import"?Nu.highest(uE("import marimo as mo")):e==="ai"?dE({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:n=>{n.state.facet(Pt).aiCellCompletion()}}):[]}var sf=Oh.configure({props:[R4.add({ParenthesizedExpression:fw,ArgList:fw})]});wm=function(){return new gw(sf,[sf.data.of({autocomplete:LD}),sf.data.of({autocomplete:ND})])};const yE=e=>{let n;return async()=>(n||(n=e()),await n)};var fc=class{constructor(e={}){ke(this,"opts");ke(this,"parser",null);ke(this,"offsetRecord",{});ke(this,"getParser",yE(async()=>{if(this.parser)return this.parser;let e=await ce(()=>import("./node-sql-parser-DYAIp20j.js").then(async i=>(await i.__tla,i)).then(YR(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 i=(c=(s=this.opts).getParserOptions)==null?void 0:c.call(s,n.state),o=await this.sanitizeSql(e,i);try{let d=await this.getParser();return(i==null?void 0:i.database)==="DuckDB"?this.parseWithDuckDBSupport(o,i):{success:!0,errors:[],ast:d.astify(o,i)}}catch(d){return{success:!1,errors:[this.extractErrorInfo(d,o)]}}}async sanitizeSql(e,n){if(n!=null&&n.ignoreBrackets){let{sql:i,offsetRecord:o}=wE(e);return this.offsetRecord=o,i}return e}async parseWithDuckDBSupport(e,n){let i=await this.getParser(),o=vE(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:i.astify(s,c)}}catch(c){return{success:!1,errors:[this.extractErrorInfo(c,e)]}}}extractErrorInfo(e,n){var d,f,p;let i=1,o=1,s=(e==null?void 0:e.message)||"SQL parsing error",c=e;if(c!=null&&c.location)i=((d=c.location.start)==null?void 0:d.line)||1,o=((f=c.location.start)==null?void 0:f.column)||1;else if(c!=null&&c.hash)i=c.hash.line||1,o=((p=c.hash.loc)==null?void 0:p.first_column)||1;else{let y=s.match(/line (\d+)/i),w=s.match(/column (\d+)/i);y!=null&&y[1]&&(i=parseInt(y[1],10)),w!=null&&w[1]&&(o=parseInt(w[1],10))}for(let[y,w]of Object.entries(this.offsetRecord))o>parseInt(y,10)&&(o-=w);return o>n.length&&(o=n.length),{message:this.cleanErrorMessage(s),line:Math.max(1,i),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 i=n?(s=(o=this.opts).getParserOptions)==null?void 0:s.call(o,n.state):void 0;try{return(await this.getParser()).tableList(e,i).map(c=>{let d=c.split("::");return d[d.length-1]||c})}catch{return[]}}async extractColumnReferences(e,n){var o,s;let i=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,i).map(c=>{let d=c.split("::");return d[d.length-1]||c})}catch{return[]}}};function vE(e,n=["/*","--"]){let i=[];if(n.includes("/*")&&i.push("/\\*[\\s\\S]*?\\*/"),n.includes("--")&&i.push("--[^\\n]*"),i.length===0)return e;let o=RegExp(`^\\s*(${i.join("|")})\\s*`,""),s=e,c="";for(;s!==c;)c=s,s=s.replace(o,"");return s}var bE=2;function wE(e){let n={};return{sql:e.replace(/("(?:[^"\\]|\\.)*")|('(?:[^'\\]|\\.)*')|(\{[^}]*\})/g,(i,o,s,c,d)=>o||s?i:c?(n[d]=bE,`'${c}'`):i),offsetRecord:n}}var _E=750;function xE(e,n){let i=n.line(e.line).from+Math.max(0,e.column-1);return{from:i,to:i+1,severity:e.severity,message:e.message,source:"sql-parser"}}function kE(e={}){let n=e.parser||new fc;return eD(async i=>{let o=i.state.doc,s=o.toString();return s.trim()?(await n.validateSql(s,{state:i.state})).map(c=>xE(c,o)):[]},{delay:e.delay||_E})}function Ha(e){return typeof e=="object"&&!Array.isArray(e)&&!("self"in e)}function hi(e){return typeof e=="object"&&!Array.isArray(e)&&"self"in e&&"children"in e}function jr(e){return Array.isArray(e)}function qn(e,n,i,o){let s=e.length;if(n==="string"||n==="completion"&&o&&jr(o))return"column";if(n==="namespace"&&i){if(jr(i))return"table";if(Ha(i))return Object.values(i).some(c=>jr(c)||hi(c)&&jr(c.children))?s<=1?"database":"schema":s===0?"database":"namespace"}if(n==="completion"&&i)return jr(i)?"table":(Ha(i)&&Object.values(i).some(c=>jr(c)||hi(c)&&jr(c.children)),s<=1?"database":"schema");switch(s){case 0:return"database";case 1:return"schema";default:return"namespace"}}function $y(e,n,i={}){let{maxDepth:o=10}=i;if(n===""&&hi(e)){let c=qn([],"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:lf(e,s,[],i)}function lf(e,n,i,o,s){if(n.length===0){if(hi(e)){let p=qn(i,"completion",e.children,s);return{completion:e.self,path:i,type:"completion",semanticType:p,namespace:e.children}}return{path:i,type:"namespace",semanticType:qn(i,"namespace",e,s),namespace:e}}let[c,...d]=n,{caseSensitive:f=!1}=o;if(!c)return null;if(Ha(e)){let p=f?Object.keys(e).find(y=>y===c):Object.keys(e).find(y=>y.toLowerCase()===c.toLowerCase());if(p){let y=e[p];if(y)return lf(y,d,[...i,p],o,e)}}else{if(hi(e))return lf(e.children,n,i,o,e);if(jr(e)){for(let p of e)if(typeof p=="string"){if((f?p===c:p.toLowerCase()===c.toLowerCase())&&d.length===0){let y=qn([...i,p],"string",void 0,e);return{value:p,path:[...i,p],type:"string",semanticType:y}}}else if((f?p.label===c:p.label.toLowerCase()===c.toLowerCase())&&d.length===0){let y=qn([...i,p.label],"completion",void 0,e);return{completion:p,path:[...i,p.label],type:"completion",semanticType:y}}}}return null}function SE(e,n,i={}){let o=[];if(n.includes(".")){let s=n.lastIndexOf("."),c=n.substring(0,s),d=n.substring(s+1),f=$y(e,c,i);if(f!=null&&f.namespace)return cf(f.namespace,d,f.path,i)}else return cf(e,n,[],i);return o}function cf(e,n,i,o){let s=[],{caseSensitive:c=!1,allowPartialMatch:d=!0}=o;if(Ha(e)){for(let[f,p]of Object.entries(e))if(d?c?f.startsWith(n):f.toLowerCase().startsWith(n.toLowerCase()):c?f===n:f.toLowerCase()===n.toLowerCase())if(hi(p)){let y=qn([...i,f],"completion",p.children,e);s.push({completion:p.self,path:[...i,f],type:"completion",semanticType:y,namespace:p.children})}else{let y=qn([...i,f],"namespace",p,e);s.push({path:[...i,f],type:"namespace",semanticType:y,namespace:p})}}else if(hi(e)){if(d?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 f=qn([...i,e.self.label],"completion",e.children);s.push({completion:e.self,path:[...i,e.self.label],type:"completion",semanticType:f,namespace:e.children})}s.push(...cf(e.children,n,i,o))}else if(jr(e)){for(let f of e)if(typeof f=="string"){if(d?c?f.startsWith(n):f.toLowerCase().startsWith(n.toLowerCase()):c?f===n:f.toLowerCase()===n.toLowerCase()){let p=qn([...i,f],"string",void 0,e);s.push({value:f,path:[...i,f],type:"string",semanticType:p})}}else if(d?c?f.label.startsWith(n):f.label.toLowerCase().startsWith(n.toLowerCase()):c?f.label===n:f.label.toLowerCase()===n.toLowerCase()){let p=qn([...i,f.label],"completion",void 0,e);s.push({completion:f,path:[...i,f.label],type:"completion",semanticType:p})}}return s}function CE(e,n,i={}){let o=[],{maxDepth:s=10}=i;pc(e,[],o,s);let{caseSensitive:c=!1}=i;return o.filter(d=>d.path.some(f=>c?f===n:f.toLowerCase()===n.toLowerCase())).sort((d,f)=>{var w,_;let p=c?d.path[d.path.length-1]===n:((w=d.path[d.path.length-1])==null?void 0:w.toLowerCase())===n.toLowerCase(),y=c?f.path[f.path.length-1]===n:((_=f.path[f.path.length-1])==null?void 0:_.toLowerCase())===n.toLowerCase();return p&&!y?-1:!p&&y?1:d.path.length-f.path.length})}function pc(e,n,i,o){if(!(n.length>=o)){if(Ha(e))for(let[s,c]of Object.entries(e)){let d=[...n,s];if(hi(c)){let f=qn(d,"completion",c.children,e);i.push({completion:c.self,path:d,type:"completion",semanticType:f,namespace:c.children}),pc(c.children,d,i,o)}else{let f=qn(d,"namespace",c,e);i.push({path:d,type:"namespace",semanticType:f,namespace:c}),pc(c,d,i,o)}}else if(hi(e)){let s=qn(n,"completion",e.children);i.push({completion:e.self,path:n,type:"completion",semanticType:s,namespace:e.children}),pc(e.children,n,i,o)}else if(jr(e))for(let s of e)if(typeof s=="string"){let c=qn([...n,s],"string",void 0,e);i.push({value:s,path:[...n,s],type:"string",semanticType:c})}else{let c=qn([...n,s.label],"completion",void 0,e);i.push({completion:s,path:[...n,s.label],type:"completion",semanticType:c})}}}function Wy(e,n,i={}){let{enableFuzzySearch:o=!1}=i,s=$y(e,n,i);if(s)return s;let c=SE(e,n,i);if(c.length>0)return c[0]||null;if(o){let d=CE(e,n,i);if(d.length>0)return d[0]||null}return null}function Uy(e,n){if(n.size===0)return{};if(Ha(e)){let i={};for(let[o,s]of Object.entries(e))if(Array.from(n).some(c=>c.toLowerCase()===o.toLowerCase()))i[o]=s;else if(Ha(s)){let c=Uy(s,n);Object.keys(c).length>0&&(i[o]=c)}return i}return e}function EE(e={}){let{schema:n={},keywords:i={},hoverTime:o=300,enableKeywords:s=!0,enableTables:c=!0,enableColumns:d=!0,enableFuzzySearch:f=!0,parser:p=new fc,tooltipRender:y,tooltipRenderers:w={}}=e,_=null;return xh(async(C,E,T)=>{let{from:I,to:$,text:V}=C.state.doc.lineAt(E),F=E,N=E;_===null&&(_=typeof i=="function"?i(C):Promise.resolve(i));let K=await _;for(;F>I&&/[\w.]/.test(V[F-I-1]??"");)F--;for(;N<$&&/[\w.]/.test(V[N-I]??"");)N++;if(F===E&&T<0||N===E&&T>0)return null;let pe=V.slice(F-I,N-I).toLowerCase();if(!pe||pe.length===0)return null;let P=typeof n=="function"?n(C):n,A=null;if(`${pe}`,!A&&s&&K[pe]&&(K[pe],A={word:pe,view:C,pos:E,tooltipType:"keyword",keywordData:{keyword:pe,info:K[pe]}}),!A&&(c||d)&&P){let W=C.state.doc.toString(),de=await p.extractTableReferences(W),fe=new Set(de.map(be=>be.toLowerCase())),we=Uy(P,fe),J=Wy(we,pe,{enableFuzzySearch:f});!J&&fe.size===0&&(J=Wy(P,pe,{enableFuzzySearch:f})),J&&(Array.from(fe),A={word:pe,view:C,pos:E,tooltipType:"namespace",namespaceData:{item:J,word:pe,resolvedSchema:fe.size>0?we:P}})}return A?{pos:F,end:N,above:!0,create(W){if(y){let we=y(pe,W,E);if(we)return{dom:we}}let de=null;if(A.tooltipType==="keyword"&&A.keywordData)de=w.keyword?w.keyword(A.keywordData):Qy(A.keywordData);else if(A.tooltipType==="namespace"&&A.namespaceData){let we=A.namespaceData,{semanticType:J}=we.item;de=J==="table"&&w.table?w.table(we):J==="column"&&w.column?w.column(we):(J==="database"||J==="schema"||J==="namespace")&&w.namespace?w.namespace(we):Ky(we.item)}if(!de)return{dom:document.createElement("div")};let fe=document.createElement("div");return fe.className="cm-sql-hover-tooltip",fe.innerHTML=de,{dom:fe}}}:null},{hoverTime:o})}function Ky(e){var s,c,d,f,p,y,w;let n=e.path.join("."),i=((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>${i}</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 _=hc(e.namespace);_>0&&(o+=`<div class="sql-hover-children">Contains ${_} schema${_===1?"":"s"}</div>`)}break;case"schema":if(o+=`<div class="sql-hover-description">Schema${(d=e.completion)!=null&&d.detail?`: ${e.completion.detail}`:""}</div>`,n&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let _=hc(e.namespace);_>0&&(o+=`<div class="sql-hover-children">Contains ${_} table${_===1?"":"s"}</div>`)}break;case"table":if(o+=`<div class="sql-hover-description">Table${(f=e.completion)!=null&&f.detail?`: ${e.completion.detail}`:""}</div>`,n){let _=e.path;_.length>1&&(o+=`<div class="sql-hover-path"><strong>Schema:</strong> <code>${_.slice(0,-1).join(".")}</code></div>`)}if(e.namespace&&jr(e.namespace)){let _=e.namespace;if(_.length>0){o+=`<div class="sql-hover-columns"><strong>Columns (${_.length}):</strong><br>`;let C=_.slice(0,8).map(E=>typeof E=="string"?E:E.label);o+=C.map(E=>`<code>${E}</code>`).join(", "),_.length>8&&(o+=`, <em>and ${_.length-8} more...</em>`),o+="</div>"}}break;case"column":if(o+=`<div class="sql-hover-description">Column${(p=e.completion)!=null&&p.detail?`: ${e.completion.detail}`:""}</div>`,n){let _=e.path;_.length>1&&(o+=`<div class="sql-hover-path"><strong>Table:</strong> <code>${_.slice(0,-1).join(".")}</code></div>`)}break;default:if(o+=`<div class="sql-hover-description">Namespace${(y=e.completion)!=null&&y.detail?`: ${e.completion.detail}`:""}</div>`,n&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let _=hc(e.namespace);_>0&&(o+=`<div class="sql-hover-children">Contains ${_} item${_===1?"":"s"}</div>`)}break}return(w=e.completion)!=null&&w.info&&typeof e.completion.info=="string"&&(o+=`<div class="sql-hover-info">${e.completion.info}</div>`),o+="</div>",o}function hc(e){return Array.isArray(e)?e.length:typeof e=="object"&&e?"self"in e&&"children"in e?1+hc(e.children):Object.keys(e).length:0}function Qy(e){let{keyword:n,info:i}=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">${i.description}</div>`,i.syntax&&(o+=`<div class="sql-hover-syntax"><strong>Syntax:</strong> <code>${i.syntax}</code></div>`),i.example&&(o+=`<div class="sql-hover-example"><strong>Example:</strong><br><code>${i.example}</code></div>`),i.metadata&&typeof i.metadata=="object"&&Object.keys(i.metadata).length>0){o+='<div class="sql-hover-metadata">';for(let[s,c]of Object.entries(i.metadata))o+=`<span class="sql-hover-tag" title="${s}">${c}</span> `;o+="</div>"}return o+="</div>",o}function TE(e){let{tableName:n,columns:i,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 ${i.length} column${i.length===1?"":"s"}</div>`,i.length>0){s+='<div class="sql-hover-columns"><strong>Columns:</strong><br>';let c=i.slice(0,10);s+=c.map(d=>`<code>${d}</code>`).join(", "),i.length>10&&(s+=`, <em>and ${i.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,d]of Object.entries(o))s+=`<span class="sql-hover-tag" title="${c}">${d}</span> `;s+="</div>"}return s+="</div>",s}function RE(e){let{tableName:n,columnName:i,schema:o,metadata:s}=e,c='<div class="sql-hover-column">';c+=`<div class="sql-hover-header"><strong>${i}</strong> <span class="sql-hover-type">column</span></div>`,c+=`<div class="sql-hover-description">Column in table <code>${n}</code></div>`;let d=o[n];if(d&&d.length>1){let f=d.filter(p=>p!==i);if(f.length>0){c+=`<div class="sql-hover-related"><strong>Other columns in ${n}:</strong><br>`;let p=f.slice(0,8);c+=p.map(y=>`<code>${y}</code>`).join(", "),f.length>8&&(c+=`, <em>and ${f.length-8} more...</em>`),c+="</div>"}}if(s&&typeof s=="object"&&Object.keys(s).length>0){c+='<div class="sql-hover-metadata">';for(let[f,p]of Object.entries(s))c+=`<span class="sql-hover-tag" title="${f}">${p}</span> `;c+="</div>"}return c+="</div>",c}const DE={keyword:Qy,table:TE,column:RE,namespace:Ky},Gy=(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 Kt.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 OE=class{constructor(e){ke(this,"parser");ke(this,"cache",new Map);ke(this,"MAX_CACHE_SIZE",10);this.parser=e}async analyzeDocument(e){let n=e.doc.toString(),i=this.generateCacheKey(n),o=this.cache.get(i);if(o)return o;let s=await this.extractStatements(n,e);if(this.cache.set(i,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(i=>n>=i.from&&n<=i.to)||null}async getStatementsInRange(e,n,i){return(await this.analyzeDocument(e)).filter(o=>o.from<=i&&o.to>=n)}async extractStatements(e,n){let i=[],o=this.splitByStatementSeparators(e),s=0;for(let c of o){let d=c.trim();if(d.length===0){s+=c.length;continue}let f=s+c.indexOf(d),p=f+d.length,y=n.doc.lineAt(f),w=n.doc.lineAt(p),_=this.stripComments(d);if(_.trim().length===0||_.trim()===";"){s+=c.length;continue}let C=await this.parser.parse(_,{state:n}),E=this.determineStatementType(_),T=_.endsWith(";")?_.slice(0,-1).trim():_.trim();i.push({from:f,to:p,lineFrom:y.number,lineTo:w.number,content:T,type:E,isValid:C.success}),s+=c.length}return i}splitByStatementSeparators(e){let n=[],i="",o=!1,s="",c=!1,d=!1,f=0;for(;f<e.length;){let p=e[f],y=e[f+1];if(!o&&!d&&p==="-"&&y==="-"){c=!0,i+=p+y,f+=2;continue}if(!o&&!c&&p==="/"&&y==="*"){d=!0,i+=p+y,f+=2;continue}if(d&&p==="*"&&y==="/"){d=!1,i+=p+y,f+=2;continue}if(c&&(p===`
136
+ `)})}return y},transformPosition:(d,f)=>dc(d,s(f)),reversePosition:(d,f)=>dc(d,-s(f))}}function By(e,n){return{start:dc(e.start,n),end:dc(e.end,n)}}function dc(e,n){return{line:e.line+n,character:e.character}}const qn={PREFIX:"file:///",of(e){return`${this.PREFIX}${e}`},is(e){return e.startsWith(this.PREFIX)},parse(e){return In(this.is(e),`Invalid cell document URI: ${e}`),e.slice(this.PREFIX.length)}};function Hy(e){return"notify"in e}function rE(e){return e.startsWith("_")&&!e.startsWith("__")}var iE=class{constructor(e){ke(this,"documentVersion",0);ke(this,"lastSnapshot",null);this.getNotebookCode=e}snapshot(){var i;let e=this.getLens(),n=((i=this.lastSnapshot)==null?void 0:i.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 nE(e,n)}},aE=()=>{let e=od().cellHandles;return ui.mapValues(e,n=>{var i;return(i=n.current)==null?void 0:i.editorViewOrNull})},af=(zr=class{constructor(n,i,o=aE){ke(this,"completionItemCache",new ac(10));this.documentUri=zy(),this.getNotebookEditors=o,this.initialSettings=i,this.client=n,this.patchProcessNotification(),this.initializePromise.then(()=>{In(Hy(this.client),"notify is not a method on the client"),this.client.notify("workspace/didChangeConfiguration",{settings:i})}),this.snapshotter=new iE(this.getNotebookCode.bind(this))}static pruneSeenCellUris(n){for(let i of zr.SEEN_CELL_DOCUMENT_URIS){let o=qn.parse(i);n.has(o)||zr.SEEN_CELL_DOCUMENT_URIS.delete(i)}}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(){In(Hy(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:i}=this.snapshotter.snapshot();await this.client.textDocumentDidOpen({textDocument:{languageId:"python",text:n.mergedText,uri:this.documentUri,version:i}}),Se.log("[lsp] Document re-synchronization complete")}getNotebookCode(){return lt.get(eE)}assertCellDocumentUri(n){In(qn.is(n),"Execpted URI to be CellDocumentUri")}async textDocumentDidOpen(n){Se.debug("[lsp] textDocumentDidOpen",n);let i=n.textDocument.uri;this.assertCellDocumentUri(i);let{lens:o,version:s}=this.snapshotter.snapshot();zr.SEEN_CELL_DOCUMENT_URIS.add(i);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:i,didChange:o}=this.snapshotter.snapshot(),s={textDocument:{uri:this.documentUri,version:i},contentChanges:[{text:n.mergedText}]};return o&&await this.client.textDocumentDidChange(s),{params:s,lens:n}}async textDocumentDidChange(n){if(Se.debug("[lsp] textDocumentDidChange",n),n.contentChanges.length===1){let{params:i}=await this.sync();return i}return Se.warn("[lsp] Unhandled textDocumentDidChange",n),this.client.textDocumentDidChange(n)}async textDocumentDefinition(n){let i=n.textDocument.uri;if(!qn.is(i))return Se.warn("Invalid cell document URI",i),null;let{lens:o}=await this.sync(),s=qn.parse(i);return this.client.textDocumentDefinition({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentSignatureHelp(n){let i=n.textDocument.uri;if(!qn.is(i))return Se.warn("Invalid cell document URI",i),null;let{lens:o}=await this.sync(),s=qn.parse(i);return await this.client.textDocumentSignatureHelp({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})||null}textDocumentCodeAction(n){return Promise.resolve(null)}async textDocumentRename(n){var $;let i=n.textDocument.uri;if(!qn.is(i))return Se.warn("Invalid cell document URI",i),null;let o=qn.parse(i),{lens:s}=await this.sync(),c=s.transformPosition(n.position,o),d=await this.client.textDocumentRename({...n,textDocument:{uri:this.documentUri},position:c});if(!d)return null;let f=($=d.documentChanges)==null?void 0:$.flatMap(V=>"edits"in V?V.edits:[]);if(!f||f.length!==1)return Se.warn("Expected exactly one edit",f),d;let p=f[0];if(!("newText"in p))return Se.warn("Expected newText in edit",p),d;let y=s.getEditsForNewText(p.newText),w=new Map(y.map(V=>[V.cellId,V.text])),_=this.getNotebookEditors(),C=_[o],E=!1;if(C){let V=C.state.doc.line(n.position.line+1).from+n.position.character,{startToken:F,endToken:N}=Jd(C.state.doc,V),K=C.state.doc.sliceString(F,N);E=rE(K),E&&Se.debug("[lsp] Private variable rename detected, limiting to current cell",K)}let T=[],I=0;for(let[V,F]of ui.entries(_)){if(E&&V!==o)continue;let N=w.get(V);if(N==null){Se.warn("[lsp] No new code for cell during rename",V),T.push(V);continue}if(!F){Se.warn("[lsp] No editor view for cell during rename",V),T.push(V);continue}Xr(F)!==N&&(xo(F,N),I++)}return T.length>0&&Se.error(`[lsp] Rename partially failed: could not update ${T.length} cell(s)`,T),Se.debug(`[lsp] Rename completed: updated ${I} cell(s)`),{...d,documentChanges:[{edits:[],textDocument:{uri:i,version:0}}]}}async completionItemResolve(n){let i=JSON.stringify(n),o=this.completionItemCache.get(i);if(o)return o;let s=this.client.completionItemResolve(n);return this.completionItemCache.set(i,s),s}async textDocumentPrepareRename(n){let i=n.textDocument.uri;if(!qn.is(i))return Se.warn("Invalid cell document URI",i),null;let{lens:o}=await this.sync(),s=qn.parse(i);return this.client.textDocumentPrepareRename({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentHover(n){Se.debug("[lsp] textDocumentHover",n);let{lens:i}=await this.sync(),o=qn.parse(n.textDocument.uri),s=await this.client.textDocumentHover({...n,textDocument:{uri:this.documentUri},position:i.transformPosition(n.position,o)});return s?(typeof s.contents=="object"&&"kind"in s.contents&&(s.contents={kind:"markdown",value:s.contents.value}),s.contents===""?null:(s.range&&(s.range=i.reverseRange(s.range,o)),s)):(Se.debug("[lsp] no hover result"),s)}async textDocumentCompletion(n){let{lens:i}=this.snapshotter.getLatestSnapshot();if(!qn.is(n.textDocument.uri))return Se.error("[lsp] Invalid cell document URI in completion request",n.textDocument.uri),null;let o=qn.parse(n.textDocument.uri);if(!o||o==="undefined")return Se.error("[lsp] Invalid cellId 'undefined' in completion request",{cellId:o,uri:n.textDocument.uri,availableCellIds:i.cellIds}),null;i.cellIds.includes(o)||Se.warn("[lsp] CellId in completion request not found in current lens",{cellId:o,uri:n.textDocument.uri,availableCellIds:i.cellIds});let s=i.transformPosition(n.position,o);return this.client.textDocumentCompletion({...n,textDocument:{uri:this.documentUri},position:s})}patchProcessNotification(){In("processNotification"in this.client,"processNotification is not a method on the client");let n=this.client.processNotification.bind(this.client),i=o=>{if(o.method==="textDocument/publishDiagnostics"){Se.debug("[lsp] handling diagnostics",o);let s=this.snapshotter.getLatestSnapshot(),c=o.params.diagnostics,{lens:d,version:f}=s,p=new Map;for(let _ of c)for(let C of d.cellIds)if(d.isInRange(_.range,C)){p.has(C)||p.set(C,[]);let E={..._,range:d.reverseRange(_.range,C)};p.get(C).push(E);break}let y=new Set(d.cellIds);zr.pruneSeenCellUris(y);let w=new Set(zr.SEEN_CELL_DOCUMENT_URIS);for(let[_,C]of p.entries()){Se.debug("[lsp] diagnostics for cell",_,C);let E=qn.of(_);w.delete(E),n({...o,params:{...o.params,uri:E,version:f,diagnostics:C}})}if(w.size>0){Se.debug("[lsp] clearing diagnostics",w);for(let _ of w)n({method:"textDocument/publishDiagnostics",params:{uri:_,diagnostics:[]}})}return}return n(o)};this.client.processNotification=i}},ke(zr,"SEEN_CELL_DOCUMENT_URIS",new Set),zr),oE=jl(),sE=Oa(),lE=class extends sE.Transport{constructor(n){super();ke(this,"isClosed",!1);ke(this,"hasConnectedBefore",!1);ke(this,"pendingSubscriptions",[]);this.options=n,this.delegate=void 0}createDelegate(){if(this.delegate)try{this.delegate.close()}catch(n){Se.warn("Error closing old WebSocket delegate",n)}this.delegate=new oE.WebSocketTransport(this.options.getWsUrl());for(let{event:n,handler:i}of this.pendingSubscriptions)this.delegate.subscribe(n,i);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(),Se.log("WebSocket transport connected successfully");let i=this.hasConnectedBefore;this.hasConnectedBefore=!0,i&&this.options.onReconnect&&(Se.log("Calling onReconnect callback to re-synchronize state"),await this.options.onReconnect())}catch(n){throw Se.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[i,o]=n;this.pendingSubscriptions.push({event:i,handler:o}),this.delegate&&this.delegate.subscribe(i,o)}unsubscribe(...n){let i=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),i}async sendData(n,i){var o;if(this.isDelegateClosedOrClosing()){Se.warn("WebSocket is closed or closing, attempting to reconnect");try{await this.connect()}catch(s){throw Se.error("Failed to reconnect WebSocket",s),s}}return(o=this.delegate)==null?void 0:o.sendData(n,i)}};function of(e,n){let i=x4();return new lE({getWsUrl:()=>i.getLSPURL(e).toString(),waitForConnection:async()=>{await _4()},onReconnect:n})}Bi.define(),new Lu;function cE(e){return e.facet(E4.readOnly)}function uE(e){return[sw(e),Ra.of([{key:"ArrowRight",preventDefault:!0,run:n=>Vy(n,e)},{key:"Tab",preventDefault:!0,run:n=>Vy(n,e)}])]}function Vy(e,n){if(cE(e.state))return!1;let i=e.state.doc.length;return i===0?(e.dispatch({changes:{from:0,to:i,insert:n},selection:{head:n.length,anchor:n.length}}),!0):!1}function dE(e){let{beforeText:n,linkText:i,afterText:o,onClick:s}=e;return[sw(c=>{let d=document.createElement("span");d.append(document.createTextNode(n));let f=document.createElement("span");return f.textContent=i,f.classList.add("cm-clickable-placeholder"),f.onclick=p=>{p.stopPropagation(),s(c)},d.append(f),d.append(document.createTextNode(o)),d}),Kt.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 fE=di(e=>{let n,i={transport:of("pylsp",async()=>{await(n==null?void 0:n())}),rootUri:rf(),workspaceFolders:[]},o=e==null?void 0:e.pylsp,s=["D100","D103"],c=["W292","E402"],d=["B018","I001"],f={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,...d]},signature:{formatter:o!=null&&o.enable_ruff?"ruff":"black",line_length:88}}}},p=new af(new ql({...i}),f);return n=()=>p.resyncAllDocuments(),p}),pE=di(e=>{let n,i=new af(new ql({transport:of("ty",async()=>{await(n==null?void 0:n())}),rootUri:rf(),workspaceFolders:[],getWorkspaceConfiguration:o=>[{disableLanguageServices:!0}]}),{});return n=()=>i.resyncAllDocuments(),i}),hE=di(e=>{let n,i=new af(new ql({transport:of("basedpyright",async()=>{await(n==null?void 0:n())}),rootUri:rf(),workspaceFolders:[]}),{});return n=()=>i.resyncAllDocuments(),i}),mE=class{constructor(){ke(this,"parser",new _S);ke(this,"type","python");ke(this,"defaultCode",this.parser.defaultCode);ke(this,"defaultMetadata",this.parser.defaultMetadata)}transformIn(e){let n=this.parser.transformIn(e);return[n.code,n.offset,n.metadata]}transformOut(e,n){let i=this.parser.transformOut(e,n);return[i.code,i.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,i,o,s){return[(()=>{var w,_,C,E;let c={defaultKeymap:!1,activateOnTyping:n.activate_on_typing,closeOnBlur:!1},d={hideOnChange:!0},f=[];(w=s==null?void 0:s.pylsp)!=null&&w.enabled&&lc("pylsp")&&f.push(fE(s)),(_=s==null?void 0:s.ty)!=null&&_.enabled&&lc("ty")&&f.push(pE(s)),(C=s==null?void 0:s.basedpyright)!=null&&C.enabled&&lc("basedpyright")&&f.push(hE(s));let p=n.signature_hint_on_typing,y=p?/(\w+|\w+\.|\/)$/:/(\w+|\w+\.|\(|\/|,)$/;if(f.length>0){let T=f.length===1?f[0]:new QC(f);return[bm({client:T,languageId:"python",allowHTMLContent:!0,useSnippetOnCompletion:!0,hoverConfig:d,completionConfig:c,diagnosticsEnabled:((E=s.diagnostics)==null?void 0:E.enabled)??!1,sendIncrementalChanges:!1,signatureHelpEnabled:!0,signatureActivateOnTyping:p,signatureHelpOptions:{position:"above"},keyboardShortcuts:{signatureHelp:i.getHotkey("cell.signatureHelp").key,goToDefinition:i.getHotkey("cell.goToDefinition").key,rename:i.getHotkey("cell.renameSymbol").key},completionMatchBefore:y,onGoToDefinition:I=>{Se.debug("onGoToDefinition",I),T.documentUri!==I.uri&&Vi().openFile({path:I.uri.replace("file://","")})}}),bg.of(qn.of(e))]}return Iu({...c,override:[Ly]})})(),wm(),gE(o)]}};function gE(e){return e==="marimo-import"?Nu.highest(uE("import marimo as mo")):e==="ai"?dE({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:n=>{n.state.facet(Pt).aiCellCompletion()}}):[]}var sf=Oh.configure({props:[R4.add({ParenthesizedExpression:fw,ArgList:fw})]});wm=function(){return new gw(sf,[sf.data.of({autocomplete:LD}),sf.data.of({autocomplete:ND})])};const yE=e=>{let n;return async()=>(n||(n=e()),await n)};var fc=class{constructor(e={}){ke(this,"opts");ke(this,"parser",null);ke(this,"offsetRecord",{});ke(this,"getParser",yE(async()=>{if(this.parser)return this.parser;let e=await ce(()=>import("./node-sql-parser-DYAIp20j.js").then(async i=>(await i.__tla,i)).then(YR(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 i=(c=(s=this.opts).getParserOptions)==null?void 0:c.call(s,n.state),o=await this.sanitizeSql(e,i);try{let d=await this.getParser();return(i==null?void 0:i.database)==="DuckDB"?this.parseWithDuckDBSupport(o,i):{success:!0,errors:[],ast:d.astify(o,i)}}catch(d){return{success:!1,errors:[this.extractErrorInfo(d,o)]}}}async sanitizeSql(e,n){if(n!=null&&n.ignoreBrackets){let{sql:i,offsetRecord:o}=wE(e);return this.offsetRecord=o,i}return e}async parseWithDuckDBSupport(e,n){let i=await this.getParser(),o=vE(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:i.astify(s,c)}}catch(c){return{success:!1,errors:[this.extractErrorInfo(c,e)]}}}extractErrorInfo(e,n){var d,f,p;let i=1,o=1,s=(e==null?void 0:e.message)||"SQL parsing error",c=e;if(c!=null&&c.location)i=((d=c.location.start)==null?void 0:d.line)||1,o=((f=c.location.start)==null?void 0:f.column)||1;else if(c!=null&&c.hash)i=c.hash.line||1,o=((p=c.hash.loc)==null?void 0:p.first_column)||1;else{let y=s.match(/line (\d+)/i),w=s.match(/column (\d+)/i);y!=null&&y[1]&&(i=parseInt(y[1],10)),w!=null&&w[1]&&(o=parseInt(w[1],10))}for(let[y,w]of Object.entries(this.offsetRecord))o>parseInt(y,10)&&(o-=w);return o>n.length&&(o=n.length),{message:this.cleanErrorMessage(s),line:Math.max(1,i),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 i=n?(s=(o=this.opts).getParserOptions)==null?void 0:s.call(o,n.state):void 0;try{return(await this.getParser()).tableList(e,i).map(c=>{let d=c.split("::");return d[d.length-1]||c})}catch{return[]}}async extractColumnReferences(e,n){var o,s;let i=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,i).map(c=>{let d=c.split("::");return d[d.length-1]||c})}catch{return[]}}};function vE(e,n=["/*","--"]){let i=[];if(n.includes("/*")&&i.push("/\\*[\\s\\S]*?\\*/"),n.includes("--")&&i.push("--[^\\n]*"),i.length===0)return e;let o=RegExp(`^\\s*(${i.join("|")})\\s*`,""),s=e,c="";for(;s!==c;)c=s,s=s.replace(o,"");return s}var bE=2;function wE(e){let n={};return{sql:e.replace(/("(?:[^"\\]|\\.)*")|('(?:[^'\\]|\\.)*')|(\{[^}]*\})/g,(i,o,s,c,d)=>o||s?i:c?(n[d]=bE,`'${c}'`):i),offsetRecord:n}}var _E=750;function xE(e,n){let i=n.line(e.line).from+Math.max(0,e.column-1);return{from:i,to:i+1,severity:e.severity,message:e.message,source:"sql-parser"}}function kE(e={}){let n=e.parser||new fc;return eD(async i=>{let o=i.state.doc,s=o.toString();return s.trim()?(await n.validateSql(s,{state:i.state})).map(c=>xE(c,o)):[]},{delay:e.delay||_E})}function Ha(e){return typeof e=="object"&&!Array.isArray(e)&&!("self"in e)}function hi(e){return typeof e=="object"&&!Array.isArray(e)&&"self"in e&&"children"in e}function jr(e){return Array.isArray(e)}function jn(e,n,i,o){let s=e.length;if(n==="string"||n==="completion"&&o&&jr(o))return"column";if(n==="namespace"&&i){if(jr(i))return"table";if(Ha(i))return Object.values(i).some(c=>jr(c)||hi(c)&&jr(c.children))?s<=1?"database":"schema":s===0?"database":"namespace"}if(n==="completion"&&i)return jr(i)?"table":(Ha(i)&&Object.values(i).some(c=>jr(c)||hi(c)&&jr(c.children)),s<=1?"database":"schema");switch(s){case 0:return"database";case 1:return"schema";default:return"namespace"}}function $y(e,n,i={}){let{maxDepth:o=10}=i;if(n===""&&hi(e)){let c=jn([],"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:lf(e,s,[],i)}function lf(e,n,i,o,s){if(n.length===0){if(hi(e)){let p=jn(i,"completion",e.children,s);return{completion:e.self,path:i,type:"completion",semanticType:p,namespace:e.children}}return{path:i,type:"namespace",semanticType:jn(i,"namespace",e,s),namespace:e}}let[c,...d]=n,{caseSensitive:f=!1}=o;if(!c)return null;if(Ha(e)){let p=f?Object.keys(e).find(y=>y===c):Object.keys(e).find(y=>y.toLowerCase()===c.toLowerCase());if(p){let y=e[p];if(y)return lf(y,d,[...i,p],o,e)}}else{if(hi(e))return lf(e.children,n,i,o,e);if(jr(e)){for(let p of e)if(typeof p=="string"){if((f?p===c:p.toLowerCase()===c.toLowerCase())&&d.length===0){let y=jn([...i,p],"string",void 0,e);return{value:p,path:[...i,p],type:"string",semanticType:y}}}else if((f?p.label===c:p.label.toLowerCase()===c.toLowerCase())&&d.length===0){let y=jn([...i,p.label],"completion",void 0,e);return{completion:p,path:[...i,p.label],type:"completion",semanticType:y}}}}return null}function SE(e,n,i={}){let o=[];if(n.includes(".")){let s=n.lastIndexOf("."),c=n.substring(0,s),d=n.substring(s+1),f=$y(e,c,i);if(f!=null&&f.namespace)return cf(f.namespace,d,f.path,i)}else return cf(e,n,[],i);return o}function cf(e,n,i,o){let s=[],{caseSensitive:c=!1,allowPartialMatch:d=!0}=o;if(Ha(e)){for(let[f,p]of Object.entries(e))if(d?c?f.startsWith(n):f.toLowerCase().startsWith(n.toLowerCase()):c?f===n:f.toLowerCase()===n.toLowerCase())if(hi(p)){let y=jn([...i,f],"completion",p.children,e);s.push({completion:p.self,path:[...i,f],type:"completion",semanticType:y,namespace:p.children})}else{let y=jn([...i,f],"namespace",p,e);s.push({path:[...i,f],type:"namespace",semanticType:y,namespace:p})}}else if(hi(e)){if(d?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 f=jn([...i,e.self.label],"completion",e.children);s.push({completion:e.self,path:[...i,e.self.label],type:"completion",semanticType:f,namespace:e.children})}s.push(...cf(e.children,n,i,o))}else if(jr(e)){for(let f of e)if(typeof f=="string"){if(d?c?f.startsWith(n):f.toLowerCase().startsWith(n.toLowerCase()):c?f===n:f.toLowerCase()===n.toLowerCase()){let p=jn([...i,f],"string",void 0,e);s.push({value:f,path:[...i,f],type:"string",semanticType:p})}}else if(d?c?f.label.startsWith(n):f.label.toLowerCase().startsWith(n.toLowerCase()):c?f.label===n:f.label.toLowerCase()===n.toLowerCase()){let p=jn([...i,f.label],"completion",void 0,e);s.push({completion:f,path:[...i,f.label],type:"completion",semanticType:p})}}return s}function CE(e,n,i={}){let o=[],{maxDepth:s=10}=i;pc(e,[],o,s);let{caseSensitive:c=!1}=i;return o.filter(d=>d.path.some(f=>c?f===n:f.toLowerCase()===n.toLowerCase())).sort((d,f)=>{var w,_;let p=c?d.path[d.path.length-1]===n:((w=d.path[d.path.length-1])==null?void 0:w.toLowerCase())===n.toLowerCase(),y=c?f.path[f.path.length-1]===n:((_=f.path[f.path.length-1])==null?void 0:_.toLowerCase())===n.toLowerCase();return p&&!y?-1:!p&&y?1:d.path.length-f.path.length})}function pc(e,n,i,o){if(!(n.length>=o)){if(Ha(e))for(let[s,c]of Object.entries(e)){let d=[...n,s];if(hi(c)){let f=jn(d,"completion",c.children,e);i.push({completion:c.self,path:d,type:"completion",semanticType:f,namespace:c.children}),pc(c.children,d,i,o)}else{let f=jn(d,"namespace",c,e);i.push({path:d,type:"namespace",semanticType:f,namespace:c}),pc(c,d,i,o)}}else if(hi(e)){let s=jn(n,"completion",e.children);i.push({completion:e.self,path:n,type:"completion",semanticType:s,namespace:e.children}),pc(e.children,n,i,o)}else if(jr(e))for(let s of e)if(typeof s=="string"){let c=jn([...n,s],"string",void 0,e);i.push({value:s,path:[...n,s],type:"string",semanticType:c})}else{let c=jn([...n,s.label],"completion",void 0,e);i.push({completion:s,path:[...n,s.label],type:"completion",semanticType:c})}}}function Wy(e,n,i={}){let{enableFuzzySearch:o=!1}=i,s=$y(e,n,i);if(s)return s;let c=SE(e,n,i);if(c.length>0)return c[0]||null;if(o){let d=CE(e,n,i);if(d.length>0)return d[0]||null}return null}function Uy(e,n){if(n.size===0)return{};if(Ha(e)){let i={};for(let[o,s]of Object.entries(e))if(Array.from(n).some(c=>c.toLowerCase()===o.toLowerCase()))i[o]=s;else if(Ha(s)){let c=Uy(s,n);Object.keys(c).length>0&&(i[o]=c)}return i}return e}function EE(e={}){let{schema:n={},keywords:i={},hoverTime:o=300,enableKeywords:s=!0,enableTables:c=!0,enableColumns:d=!0,enableFuzzySearch:f=!0,parser:p=new fc,tooltipRender:y,tooltipRenderers:w={}}=e,_=null;return xh(async(C,E,T)=>{let{from:I,to:$,text:V}=C.state.doc.lineAt(E),F=E,N=E;_===null&&(_=typeof i=="function"?i(C):Promise.resolve(i));let K=await _;for(;F>I&&/[\w.]/.test(V[F-I-1]??"");)F--;for(;N<$&&/[\w.]/.test(V[N-I]??"");)N++;if(F===E&&T<0||N===E&&T>0)return null;let pe=V.slice(F-I,N-I).toLowerCase();if(!pe||pe.length===0)return null;let P=typeof n=="function"?n(C):n,A=null;if(`${pe}`,!A&&s&&K[pe]&&(K[pe],A={word:pe,view:C,pos:E,tooltipType:"keyword",keywordData:{keyword:pe,info:K[pe]}}),!A&&(c||d)&&P){let W=C.state.doc.toString(),de=await p.extractTableReferences(W),fe=new Set(de.map(be=>be.toLowerCase())),we=Uy(P,fe),J=Wy(we,pe,{enableFuzzySearch:f});!J&&fe.size===0&&(J=Wy(P,pe,{enableFuzzySearch:f})),J&&(Array.from(fe),A={word:pe,view:C,pos:E,tooltipType:"namespace",namespaceData:{item:J,word:pe,resolvedSchema:fe.size>0?we:P}})}return A?{pos:F,end:N,above:!0,create(W){if(y){let we=y(pe,W,E);if(we)return{dom:we}}let de=null;if(A.tooltipType==="keyword"&&A.keywordData)de=w.keyword?w.keyword(A.keywordData):Qy(A.keywordData);else if(A.tooltipType==="namespace"&&A.namespaceData){let we=A.namespaceData,{semanticType:J}=we.item;de=J==="table"&&w.table?w.table(we):J==="column"&&w.column?w.column(we):(J==="database"||J==="schema"||J==="namespace")&&w.namespace?w.namespace(we):Ky(we.item)}if(!de)return{dom:document.createElement("div")};let fe=document.createElement("div");return fe.className="cm-sql-hover-tooltip",fe.innerHTML=de,{dom:fe}}}:null},{hoverTime:o})}function Ky(e){var s,c,d,f,p,y,w;let n=e.path.join("."),i=((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>${i}</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 _=hc(e.namespace);_>0&&(o+=`<div class="sql-hover-children">Contains ${_} schema${_===1?"":"s"}</div>`)}break;case"schema":if(o+=`<div class="sql-hover-description">Schema${(d=e.completion)!=null&&d.detail?`: ${e.completion.detail}`:""}</div>`,n&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let _=hc(e.namespace);_>0&&(o+=`<div class="sql-hover-children">Contains ${_} table${_===1?"":"s"}</div>`)}break;case"table":if(o+=`<div class="sql-hover-description">Table${(f=e.completion)!=null&&f.detail?`: ${e.completion.detail}`:""}</div>`,n){let _=e.path;_.length>1&&(o+=`<div class="sql-hover-path"><strong>Schema:</strong> <code>${_.slice(0,-1).join(".")}</code></div>`)}if(e.namespace&&jr(e.namespace)){let _=e.namespace;if(_.length>0){o+=`<div class="sql-hover-columns"><strong>Columns (${_.length}):</strong><br>`;let C=_.slice(0,8).map(E=>typeof E=="string"?E:E.label);o+=C.map(E=>`<code>${E}</code>`).join(", "),_.length>8&&(o+=`, <em>and ${_.length-8} more...</em>`),o+="</div>"}}break;case"column":if(o+=`<div class="sql-hover-description">Column${(p=e.completion)!=null&&p.detail?`: ${e.completion.detail}`:""}</div>`,n){let _=e.path;_.length>1&&(o+=`<div class="sql-hover-path"><strong>Table:</strong> <code>${_.slice(0,-1).join(".")}</code></div>`)}break;default:if(o+=`<div class="sql-hover-description">Namespace${(y=e.completion)!=null&&y.detail?`: ${e.completion.detail}`:""}</div>`,n&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let _=hc(e.namespace);_>0&&(o+=`<div class="sql-hover-children">Contains ${_} item${_===1?"":"s"}</div>`)}break}return(w=e.completion)!=null&&w.info&&typeof e.completion.info=="string"&&(o+=`<div class="sql-hover-info">${e.completion.info}</div>`),o+="</div>",o}function hc(e){return Array.isArray(e)?e.length:typeof e=="object"&&e?"self"in e&&"children"in e?1+hc(e.children):Object.keys(e).length:0}function Qy(e){let{keyword:n,info:i}=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">${i.description}</div>`,i.syntax&&(o+=`<div class="sql-hover-syntax"><strong>Syntax:</strong> <code>${i.syntax}</code></div>`),i.example&&(o+=`<div class="sql-hover-example"><strong>Example:</strong><br><code>${i.example}</code></div>`),i.metadata&&typeof i.metadata=="object"&&Object.keys(i.metadata).length>0){o+='<div class="sql-hover-metadata">';for(let[s,c]of Object.entries(i.metadata))o+=`<span class="sql-hover-tag" title="${s}">${c}</span> `;o+="</div>"}return o+="</div>",o}function TE(e){let{tableName:n,columns:i,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 ${i.length} column${i.length===1?"":"s"}</div>`,i.length>0){s+='<div class="sql-hover-columns"><strong>Columns:</strong><br>';let c=i.slice(0,10);s+=c.map(d=>`<code>${d}</code>`).join(", "),i.length>10&&(s+=`, <em>and ${i.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,d]of Object.entries(o))s+=`<span class="sql-hover-tag" title="${c}">${d}</span> `;s+="</div>"}return s+="</div>",s}function RE(e){let{tableName:n,columnName:i,schema:o,metadata:s}=e,c='<div class="sql-hover-column">';c+=`<div class="sql-hover-header"><strong>${i}</strong> <span class="sql-hover-type">column</span></div>`,c+=`<div class="sql-hover-description">Column in table <code>${n}</code></div>`;let d=o[n];if(d&&d.length>1){let f=d.filter(p=>p!==i);if(f.length>0){c+=`<div class="sql-hover-related"><strong>Other columns in ${n}:</strong><br>`;let p=f.slice(0,8);c+=p.map(y=>`<code>${y}</code>`).join(", "),f.length>8&&(c+=`, <em>and ${f.length-8} more...</em>`),c+="</div>"}}if(s&&typeof s=="object"&&Object.keys(s).length>0){c+='<div class="sql-hover-metadata">';for(let[f,p]of Object.entries(s))c+=`<span class="sql-hover-tag" title="${f}">${p}</span> `;c+="</div>"}return c+="</div>",c}const DE={keyword:Qy,table:TE,column:RE,namespace:Ky},Gy=(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 Kt.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 OE=class{constructor(e){ke(this,"parser");ke(this,"cache",new Map);ke(this,"MAX_CACHE_SIZE",10);this.parser=e}async analyzeDocument(e){let n=e.doc.toString(),i=this.generateCacheKey(n),o=this.cache.get(i);if(o)return o;let s=await this.extractStatements(n,e);if(this.cache.set(i,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(i=>n>=i.from&&n<=i.to)||null}async getStatementsInRange(e,n,i){return(await this.analyzeDocument(e)).filter(o=>o.from<=i&&o.to>=n)}async extractStatements(e,n){let i=[],o=this.splitByStatementSeparators(e),s=0;for(let c of o){let d=c.trim();if(d.length===0){s+=c.length;continue}let f=s+c.indexOf(d),p=f+d.length,y=n.doc.lineAt(f),w=n.doc.lineAt(p),_=this.stripComments(d);if(_.trim().length===0||_.trim()===";"){s+=c.length;continue}let C=await this.parser.parse(_,{state:n}),E=this.determineStatementType(_),T=_.endsWith(";")?_.slice(0,-1).trim():_.trim();i.push({from:f,to:p,lineFrom:y.number,lineTo:w.number,content:T,type:E,isValid:C.success}),s+=c.length}return i}splitByStatementSeparators(e){let n=[],i="",o=!1,s="",c=!1,d=!1,f=0;for(;f<e.length;){let p=e[f],y=e[f+1];if(!o&&!d&&p==="-"&&y==="-"){c=!0,i+=p+y,f+=2;continue}if(!o&&!c&&p==="/"&&y==="*"){d=!0,i+=p+y,f+=2;continue}if(d&&p==="*"&&y==="/"){d=!1,i+=p+y,f+=2;continue}if(c&&(p===`
137
137
  `||p==="\r")){c=!1,i+=p,f++;continue}if(c||d){i+=p,f++;continue}if(!o&&(p==="'"||p==='"'||p==="`"))o=!0,s=p,i+=p;else if(o&&p===s){if(y===s){i+=p+y,f+=2;continue}o=!1,s="",i+=p}else!o&&p===";"?(i+=p,n.push(i),i=""):i+=p;f++}return i.trim()&&n.push(i),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="",i=!1,o="",s=!1,c=!1,d=0;for(;d<e.length;){let f=e[d],p=e[d+1];if(!i&&!c&&f==="-"&&p==="-"){s=!0,d+=2;continue}if(!i&&!s&&f==="/"&&p==="*"){c=!0,d+=2;continue}if(c&&f==="*"&&p==="/"){c=!1,d+=2;continue}if(s&&(f===`
138
138
  `||f==="\r")){s=!1,n+=f,d++;continue}if(s||c){d++;continue}if(!i&&(f==="'"||f==='"'||f==="`"))i=!0,o=f,n+=f;else if(i&&f===o){if(p===o){n+=f+p,d+=2;continue}i=!1,o="",n+=f}else n+=f;d++}return n}generateCacheKey(e){let n=0;for(let i=0;i<e.length;i++){let o=e.charCodeAt(i);n=(n<<5)-n+o,n&=n}return n.toString()}clearCache(){this.cache.clear()}},Jy=Bi.define(),Xy=xs.define({create(){return{currentStatement:null,allStatements:[],cursorPosition:0,isFocused:!0}},update(e,n){for(let i of n.effects)if(i.is(Jy))return i.value;return e}}),PE=class extends j4{constructor(n,i,o=!0,s=!0){super();ke(this,"config");ke(this,"isCurrent");ke(this,"isValid");ke(this,"isFocused");this.config=n,this.isCurrent=i,this.isValid=o,this.isFocused=s}toDOM(){let n=document.createElement("div");n.className="cm-sql-gutter-marker";let i=this.config.backgroundColor||"#3b82f6";!this.isValid&&this.config.showInvalid!==!1&&(i=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=`
139
139
  background: ${i};
@@ -142,12 +142,12 @@ mark line col
142
142
  opacity: ${o};
143
143
  transition: opacity 150ms ease-in-out;
144
144
  border-radius: 1px;
145
- `,n}eq(n){return this.isCurrent===n.isCurrent&&this.isValid===n.isValid&&this.isFocused===n.isFocused&&this.config===n.config}};function ME(e,n){var f;let i=L4.empty;if((f=n.whenHide)!=null&&f.call(n,e))return i;let o=e.state.field(Xy,!1);if(!o)return i;let{currentStatement:s,allStatements:c,isFocused:d}=o;try{for(let p of c){let y=(s==null?void 0:s.from)===p.from&&(s==null?void 0:s.to)===p.to;if(!p.isValid&&n.showInvalid===!1)continue;let w=new PE(n,y,p.isValid,d);for(let _=p.lineFrom;_<=p.lineTo;_++)try{if(_<1||_>e.state.doc.lines)continue;let C=e.state.doc.line(_);i=i.update({add:[w.range(C.from)]})}catch(C){console.warn("SqlGutter: Invalid line number",_,C)}}}catch(p){console.warn("SqlGutter: Error creating markers",p)}return i}function LE(e){return Kt.updateListener.of(async n=>{if(!n.docChanged&&!n.selectionSet&&!n.focusChanged)return;let{state:i}=n.view,{main:o}=i.selection,s=o.head,c=await e.analyzeDocument(i),d={currentStatement:await e.getStatementAtPosition(i,s),allStatements:c,cursorPosition:s,isFocused:n.view.hasFocus};n.view.dispatch({effects:Jy.of(d)})})}function NE(e){let n=e.width||3;return Kt.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 IE(e){return N4({class:`cm-sql-gutter ${e.className||""}`,markers:n=>ME(n,e)})}function AE(e={}){return[Xy,LE(new OE(e.parser||new fc)),NE(e),IE(e)]}function qE(e={}){let n=[],{enableLinting:i=!0,enableGutterMarkers:o=!0,enableHover:s=!0,linterConfig:c,gutterConfig:d,hoverConfig:f}=e;return i&&n.push(kE(c)),o&&n.push(AE(d)),s&&(n.push(EE(f)),f!=null&&f.theme?n.push(f.theme):n.push(Gy())),n}var jE=class xx{static jsonStringifySortKeys(){return n=>typeof n!="object"||!n?String(n):JSON.stringify(n,Object.keys(n).sort(),2)}constructor(n,i={}){this.delegate=n,this.toKey=i.toKey??xx.jsonStringifySortKeys(),this.cache=new Ps(i.maxSize??128)}request(n){let i=this.toKey(n),o=this.cache.get(i);if(o!==void 0)return o;let s=this.delegate.request(n);return this.cache.set(i,s),s.catch(c=>{throw this.cache.delete(i),c})}resolve(n,i){this.delegate.resolve(n,i)}reject(n,i){this.delegate.reject(n,i)}};Hw=new Au("sql-table-preview",async(e,n)=>{await Vi().previewSQLTable({requestId:e,...n})}),zw=new Au("sql-table-list-preview",async(e,n)=>{await Vi().previewSQLTableList({requestId:e,...n})}),Gh=new jE(new Au("validate-sql",async(e,n)=>{await Vi().validateSQL({requestId:e,...n})}),{maxSize:3});var zE=Jr();let Va;Va=ze(new Map),r_=e=>{let n=(0,zE.c)(3),i=Zn(Va),o;return n[0]!==e||n[1]!==i?(o=i.get(e),n[0]=e,n[1]=i,n[2]=o):o=n[2],o};function Yy(e){let n=lt.get(Va),i=new Map(n);i.delete(e),lt.set(Va,i)}function FE(){lt.set(Va,new Map)}function BE({cellId:e,errorMessage:n,dialect:i}){let o=lt.get(Va),s=new Map(o),c=i==="DuckDB"?HE(n):Zy(n);s.set(e,c),lt.set(Va,s)}function HE(e){let{errorType:n,errorMessage:i}=Zy(e),o=i,s,c=i.indexOf("LINE ");return c!==-1&&(s=i.slice(Math.max(0,c)).trim(),o=i.slice(0,Math.max(0,c)).trim()),{errorType:n,errorMessage:o,codeblock:s}}function Zy(e){return{errorType:e.split(":")[0].trim(),errorMessage:e.split(":").slice(1).join(":").trim()}}function ev(e){return e.field(fi)}function VE(){return e=>{let n=ev(e.state).engine,i=Fa.getCompletionSource(n);return i&&fD(i)(e)||null}}function $E(){return e=>{let n=ev(e.state).engine,i=Fa.getDialect(n);return e.matchBefore(/\.\w*/)?null:vD(i,!0,(o,s)=>({label:o,type:s,info:async()=>{let c=(await WE())[o.toLocaleLowerCase()];if(!c)return null;let d=document.createElement("div");return d.innerHTML=DE.keyword({keyword:o,info:c}),d}}))(e)}}var WE=di(async()=>{let e=await ce(()=>import("./common-keywords-DHn1q5re.js").then(async i=>(await i.__tla,i)),[],import.meta.url),n=await ce(()=>import("./duckdb-keywords-usZbJ-Dr.js").then(async i=>(await i.__tla,i)),[],import.meta.url);return{...e.default.keywords,...n.default.keywords}}),UE=Jr(),tv=$l("marimo:notebook-sql-mode","default",Wl);function KE(){let e=(0,UE.c)(3),[n,i]=Y2(tv),o;return e[0]!==i||e[1]!==n?(o={sqlMode:n,setSQLMode:i},e[0]=i,e[1]=n,e[2]=o):o=e[2],o}function nv(){return lt.get(tv)}var QE=Eg,GE="DuckDB",rv=new Lu;function uf(){return lt.get(So).latestEngineSelected}let iv;hd=(_f=class{constructor(){ke(this,"parser",new ny);ke(this,"type","sql");this.sqlModeEnabled=!0}get defaultMetadata(){return{...this.parser.defaultMetadata,engine:uf()||"__marimo_duckdb"}}get defaultCode(){let e=uf();return e&&e!=="__marimo_duckdb"?`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`:this.parser.defaultCode}transformIn(e){this.parser.defaultMetadata.engine=uf()||"__marimo_duckdb";let n=this.parser.transformIn(e),i=n.metadata;return i.engine&&i.engine!=="__marimo_duckdb"&&Dg(i.engine),[n.code,n.offset,i]}transformOut(e,n){let i=this.parser.transformOut(e,n);return[i.code,i.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,i,o,s){var d;let c=[rv.of(Cw({dialect:QE})),Ra.of([{key:"Tab",run:f=>sD(f)||$4(f),preventDefault:!0}]),Iu({defaultKeymap:!1,activateOnTyping:!0,override:[VE(),WC,$E()]})];if(((d=s==null?void 0:s.diagnostics)==null?void 0:d.sql_linter)??!1){let f=lt.get(AD),p=new iv({getParserOptions:y=>({database:ov(y)??GE})});c.push(qE({enableLinting:!0,linterConfig:{delay:250,parser:p},enableGutterMarkers:!0,gutterConfig:{backgroundColor:"#3b82f6",errorBackgroundColor:"#ef4444",hideWhenNotFocused:!0,parser:p},hoverConfig:{schema:YE,hoverTime:300,enableKeywords:!0,enableTables:!0,enableColumns:!0,parser:p,theme:Gy(f)}}),Kt.updateListener.of(y=>{y.focusChanged&&p.setFocusState(y.view.hasFocus)}))}return this.sqlModeEnabled&&c.push(e3()),c}},ke(_f,"fromQuery",e=>ny.fromQuery(e)),_f),iv=class extends fc{constructor(){super(...arguments);ke(this,"validationTimeout",null);ke(this,"VALIDATION_DELAY_MS",300);ke(this,"isFocused",!1)}setFocusState(n){this.isFocused=n}async validateWithDelay(n,i,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 d=await lv(n,i,o,nv());if(d.error){Ee.error("Failed to validate SQL",{error:d.error}),s([]);return}s(((c=d.parse_result)==null?void 0:c.errors)??[])}catch(d){Ee.error("Failed to validate SQL",{error:d}),s([])}},this.VALIDATION_DELAY_MS)})}async validateSql(n,i){let o=Fo(i.state);if(!this.isFocused)return[];if(!ko.has(o.engine))return super.validateSql(n,i);let s=ov(i.state);return this.validateWithDelay(n,o.engine,s)}async parse(n,i){return Fo(i.state).engine==="__marimo_duckdb"?{success:!0,errors:[]}:super.parse(n,i)}};function av(e,n){e.dispatch({effects:rv.reconfigure(Cw({dialect:n}))})}function JE(e,n){av(e,Fa.getDialect(n))}function XE(e){let n=Fo(e.state).engine;av(e,Fa.getDialect(n))}function Fo(e){return e.field(fi)}function YE(e){let n=Fo(e.state).engine,i=Fa.getCompletionSource(n);return i!=null&&i.schema?i.schema:{}}function ov(e){let n=Fo(e).engine;return sv(n)}function sv(e){var i;let n=(i=Fa.getInternalDialect(e))==null?void 0:i.toLowerCase();if(!n||!ac(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 Ee.debug("Unsupported dialect",{dialect:n}),null;default:return _s(n),null}}var ZE=300;function e3(){let e,n=null;return Kt.updateListener.of(i=>{if(!i.docChanged)return;let o=nv();if(o==="default")return;let s=Fo(i.state).engine;if(!ko.has(s))return;let c=i.state.doc.toString();e&&window.clearTimeout(e),e=window.setTimeout(async()=>{if(n===c)return;n=c;let d=i.view.state.facet(Ui);if(c===""){Yy(d);return}try{let f=sv(s),p=(await lv(c,s,f,o)).validate_result;p!=null&&p.error_message?BE({cellId:d,errorMessage:p.error_message,dialect:f}):Yy(d)}catch(f){Ee.error("Failed to validate SQL",{error:f})}},ZE)})}async function lv(e,n,i,o){let s=await Gh.request({onlyParse:o==="default",engine:n,dialect:i,query:e});if(s.error)throw Error(s.error);return s}var t3=di(()=>new mE),n3=di(()=>new ad),r3=di(()=>new hd);gr={get python(){return t3()},get markdown(){return n3()},get sql(){return r3()}};function i3(){return Object.values(gr)}var jt=vh(Ou(),1),mc="Checkbox",[a3,WD]=qD(mc),[o3,df]=a3(mc);function s3(e){let{__scopeCheckbox:n,checked:i,children:o,defaultChecked:s,disabled:c,form:d,name:f,onCheckedChange:p,required:y,value:w="on",internal_do_not_use_render:_}=e,[C,E]=jD({prop:i,defaultProp:s??!1,onChange:p,caller:mc}),[T,I]=jt.useState(null),[$,V]=jt.useState(null),F=jt.useRef(!1),N=T?!!d||!!T.closest("form"):!0,K={checked:C,disabled:c,setChecked:E,control:T,setControl:I,name:f,form:d,value:w,hasConsumerStoppedPropagationRef:F,required:y,defaultChecked:ea(s)?!1:s,isFormControl:N,bubbleInput:$,setBubbleInput:V};return(0,B.jsx)(o3,{scope:n,...K,children:l3(_)?_(K):o})}var cv="CheckboxTrigger",uv=jt.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:i,...o},s)=>{let{control:c,value:d,disabled:f,checked:p,required:y,setControl:w,setChecked:_,hasConsumerStoppedPropagationRef:C,isFormControl:E,bubbleInput:T}=df(cv,e),I=aw(s,w),$=jt.useRef(p);return jt.useEffect(()=>{let V=c==null?void 0:c.form;if(V){let F=()=>_($.current);return V.addEventListener("reset",F),()=>V.removeEventListener("reset",F)}},[c,_]),(0,B.jsx)(Ph.button,{type:"button",role:"checkbox","aria-checked":ea(p)?"mixed":p,"aria-required":y,"data-state":mv(p),"data-disabled":f?"":void 0,disabled:f,value:d,...o,ref:I,onKeyDown:Dw(n,V=>{V.key==="Enter"&&V.preventDefault()}),onClick:Dw(i,V=>{_(F=>ea(F)?!0:!F),T&&E&&(C.current=V.isPropagationStopped(),C.current||V.stopPropagation())})})});uv.displayName=cv;var ff=jt.forwardRef((e,n)=>{let{__scopeCheckbox:i,name:o,checked:s,defaultChecked:c,required:d,disabled:f,value:p,onCheckedChange:y,form:w,..._}=e;return(0,B.jsx)(s3,{__scopeCheckbox:i,checked:s,defaultChecked:c,disabled:f,required:d,onCheckedChange:y,name:o,form:w,value:p,internal_do_not_use_render:({isFormControl:C})=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(uv,{..._,ref:n,__scopeCheckbox:i}),C&&(0,B.jsx)(hv,{__scopeCheckbox:i})]})})});ff.displayName=mc;var dv="CheckboxIndicator",fv=jt.forwardRef((e,n)=>{let{__scopeCheckbox:i,forceMount:o,...s}=e,c=df(dv,i);return(0,B.jsx)(zD,{present:o||ea(c.checked)||c.checked===!0,children:(0,B.jsx)(Ph.span,{"data-state":mv(c.checked),"data-disabled":c.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})});fv.displayName=dv;var pv="CheckboxBubbleInput",hv=jt.forwardRef(({__scopeCheckbox:e,...n},i)=>{let{control:o,hasConsumerStoppedPropagationRef:s,checked:c,defaultChecked:d,required:f,disabled:p,name:y,value:w,form:_,bubbleInput:C,setBubbleInput:E}=df(pv,e),T=aw(i,E),I=xD(c),$=FD(o);jt.useEffect(()=>{let F=C;if(!F)return;let N=window.HTMLInputElement.prototype,K=Object.getOwnPropertyDescriptor(N,"checked").set,pe=!s.current;if(I!==c&&K){let P=new Event("click",{bubbles:pe});F.indeterminate=ea(c),K.call(F,ea(c)?!1:c),F.dispatchEvent(P)}},[C,I,c,s]);let V=jt.useRef(ea(c)?!1:c);return(0,B.jsx)(Ph.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??V.current,required:f,disabled:p,name:y,value:w,form:_,...n,tabIndex:-1,ref:T,style:{...n.style,...$,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});hv.displayName=pv;function l3(e){return typeof e=="function"}function ea(e){return e==="indeterminate"}function mv(e){return ea(e)?"indeterminate":e?"checked":"unchecked"}let gv;gv=Jr(),Hl=jt.forwardRef((e,n)=>{let i=(0,gv.c)(10),o,s;i[0]===e?(o=i[1],s=i[2]):({className:o,...s}=e,i[0]=e,i[1]=o,i[2]=s);let c;i[3]===o?c=i[4]:(c=Pu("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),i[3]=o,i[4]=c);let d;i[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,B.jsx)(fv,{className:Pu("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),children:(0,B.jsx)(bD,{className:"h-4 w-4"})}),i[5]=d):d=i[5];let f;return i[6]!==s||i[7]!==n||i[8]!==c?(f=(0,B.jsx)(ff,{ref:n,className:c,...s,children:d}),i[6]=s,i[7]=n,i[8]=c,i[9]=f):f=i[9],f}),Hl.displayName=ff.displayName,h_="_";var c3=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("."));Lm=function(e,n=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,"_"),n?e.toLowerCase():e):"_"},mx=function(e,n){let i=new Set(n),o=e,s=d=>!i.has(d)&&!c3.has(d);if(s(e))return e;let c=1;for(;!s(o);)o=`${e}_${c}`,c++;return o},cx=function(e,n){return hm(e)?`cell-${n}`:e},hm=function(e){return e?e==="_"||e==="__":!0};var u3=Jr();function d3(e){let n=(0,u3.c)(15),{minWidth:i,padding:o}=e,s=i===void 0?70:i,c=o===void 0?15:o,[d,f]=(0,jt.useState)(50),p=(0,jt.useRef)(null),y=(0,jt.useRef)(null),w;n[0]===c?w=n[1]:(w=P=>{if(y.current&&p.current){let A=y.current;A.style.fontSize=window.getComputedStyle(p.current).fontSize,A.style.fontFamily=window.getComputedStyle(p.current).fontFamily,A.textContent=P;let W=A.offsetWidth;f(W+c)}},n[0]=c,n[1]=w);let _=w,C;n[2]===_?C=n[3]:(C=()=>{var P;_(((P=p.current)==null?void 0:P.value)??"")},n[2]=_,n[3]=C),y4(C);let E;n[4]===_?E=n[5]:(E=P=>{_(P.target.value)},n[4]=_,n[5]=E);let T=`${d}px`,I=`${s}px`,$;n[6]!==T||n[7]!==I?($={width:T,minWidth:I},n[6]=T,n[7]=I,n[8]=$):$=n[8];let V;n[9]!==E||n[10]!==$?(V={ref:p,type:"text",onChange:E,style:$},n[9]=E,n[10]=$,n[11]=V):V=n[11];let F=V,N;n[12]===Symbol.for("react.memo_cache_sentinel")?(N={ref:y,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},n[12]=N):N=n[12];let K=N,pe;return n[13]===F?pe=n[14]:(pe={inputProps:F,spanProps:K},n[13]=F,n[14]=pe),pe}var f3=Jr();function p3({currentQuotePrefix:e,checked:n,prefix:i}){let o=e;return n?e===""?o=i:e!=="rf"&&i!==e&&(o="rf"):e===i?o="":e==="rf"&&(o=i==="r"?"f":"r"),o}let yv;yv=()=>{let e=(0,f3.c)(2),n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,B.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,B.jsxs)("header",{className:"flex items-center gap-1",children:[(0,B.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"r"}),(0,B.jsx)("span",{className:"font-semibold",children:"Raw String"})]}),(0,B.jsx)("p",{className:"text-sm text-muted-foreground",children:"Write LaTeX without escaping special characters"}),(0,B.jsx)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:"\\alpha \\beta"})]}),e[0]=n):n=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=(0,B.jsxs)("div",{className:"flex flex-col gap-3.5",children:[n,(0,B.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,B.jsxs)("header",{className:"flex items-center gap-1",children:[(0,B.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"f"}),(0,B.jsx)("span",{className:"font-semibold",children:"Format String"})]}),(0,B.jsx)("p",{className:"text-sm text-muted-foreground",children:"Interpolate Python values"}),(0,B.jsxs)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:["Hello ","{name}","! \u{1F601}"]})]})]}),e[1]=i):i=e[1],i},Tm="data-cell-id",D_=function(e){return{[Tm]:e}},xm="data-for-cell-id",td=function(e){return{[xm]:e}};var h3="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",m3="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",g3="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==",y3="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",v3="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",b3=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,w3="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",_3="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",vv=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,x3="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",k3="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",S3="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",C3="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",E3="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",T3="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",R3=""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,D3=Jr(),O3={sqlite:C3,duckdb:y3,motherduck:w3,postgres:vv,postgresql:vv,mysql:_3,snowflake:k3,databricks:m3,clickhouse:h3,timeplus:T3,bigquery:v3,trino:R3,iceberg:b3,datafusion:g3,pyspark:S3,redshift:x3,supabase:E3};vm=e=>{let n=(0,D3.c)(11),{name:i,className:o}=e,s=O3[i.toLowerCase()];if(!s){let f;n[0]===o?f=n[1]:(f=Pu("mt-0.5",o),n[0]=o,n[1]=f);let p;return n[2]===f?p=n[3]:(p=(0,B.jsx)(Cs,{className:f}),n[2]=f,n[3]=p),p}let c;n[4]!==o||n[5]!==s?(c=Pu("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 d;return n[7]!==i||n[8]!==c||n[9]!==s?(d=(0,B.jsx)("img",{src:s,alt:i,className:c}),n[7]=i,n[8]=c,n[9]=s,n[10]=d):d=n[10],d};var pf=Jr();const P3=e=>{let n=(0,pf.c)(34),{selectedEngine:i,onChange:o,cellId:s}=e,c=Zn(ld),d=[],f=[];for(let[Se,Z]of c.entries())ko.has(Se)?d.push(Z):f.push(Z);let p=cD(),y=i&&!c.has(i),w;n[0]!==c||n[1]!==o||n[2]!==p?(w=Se=>{if(Se===bv){window.open(wv,"_blank");return}let Z=c.get(Se);Z&&(p(),o(Z.name),Dg(Z.name))},n[0]=c,n[1]=o,n[2]=p,n[3]=w):w=n[3];let _=w,C=A3,E=ED,T;n[4]===s?T=n[5]:(T=td(s),n[4]=s,n[5]=T);let I;n[6]===Symbol.for("react.memo_cache_sentinel")?(I=(0,B.jsx)(_D,{placeholder:"Select an engine"}),n[6]=I):I=n[6];let $;n[7]===T?$=n[8]:($=(0,B.jsx)(L3,{...T,children:I}),n[7]=T,n[8]=$);let V=kD,F;n[9]===s?F=n[10]:(F=td(s),n[9]=s,n[10]=F);let N=SD,K;n[11]===Symbol.for("react.memo_cache_sentinel")?(K=(0,B.jsx)(wD,{children:"Database connections"}),n[11]=K):K=n[11];let pe;n[12]!==y||n[13]!==i?(pe=y&&(0,B.jsx)(Dh,{value:i,children:(0,B.jsxs)("div",{className:"flex items-center gap-1 opacity-50",children:[(0,B.jsx)(cm,{className:"h-3 w-3"}),(0,B.jsx)("span",{className:"truncate",children:Ng(i)})]})},i),n[12]=y,n[13]=i,n[14]=pe):pe=n[14];let P=C(f),A=f.length>0&&(0,B.jsx)(Ew,{}),W=C(d),de;n[15]===Symbol.for("react.memo_cache_sentinel")?(de=(0,B.jsx)(Ew,{}),n[15]=de):de=n[15];let fe;n[16]===Symbol.for("react.memo_cache_sentinel")?(fe=(0,B.jsx)(Dh,{className:"text-muted-foreground",value:bv,children:(0,B.jsxs)("a",{className:"flex items-center gap-1",href:wv,target:"_blank",rel:"noreferrer",children:[(0,B.jsx)(RD,{className:"h-3 w-3"}),(0,B.jsx)("span",{children:"How to add a database connection"})]})}),n[16]=fe):fe=n[16];let we;n[17]!==N||n[18]!==A||n[19]!==W||n[20]!==K||n[21]!==pe||n[22]!==P?(we=(0,B.jsxs)(N,{children:[K,pe,P,A,W,de,fe]}),n[17]=N,n[18]=A,n[19]=W,n[20]=K,n[21]=pe,n[22]=P,n[23]=we):we=n[23];let J;n[24]!==V||n[25]!==we||n[26]!==F?(J=(0,B.jsx)(V,{...F,children:we}),n[24]=V,n[25]=we,n[26]=F,n[27]=J):J=n[27];let be;return n[28]!==E||n[29]!==_||n[30]!==i||n[31]!==J||n[32]!==$?(be=(0,B.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,B.jsxs)(E,{value:i,onValueChange:_,children:[$,J]})}),n[28]=E,n[29]=_,n[30]=i,n[31]=J,n[32]=$,n[33]=be):be=n[33],be};var bv="__help__",wv="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";const M3=()=>{let e=(0,pf.c)(16),{sqlMode:n,setSQLMode:i}=KE(),o;e[0]!==i||e[1]!==n?(o=()=>{let E=n==="validate"?"default":"validate";E==="default"&&FE(),i(E)},e[0]=i,e[1]=n,e[2]=o):o=e[2];let s=o,c=q3,d=j3,f;e[3]===n?f=e[4]:(f=d(n),e[3]=n,e[4]=f);let p;e[5]===n?p=e[6]:(p=c(n),e[5]=n,e[6]=p);let y=n==="validate"?"Validate":"Default",w;e[7]===y?w=e[8]:(w=(0,B.jsx)("span",{className:"ml-1",children:y}),e[7]=y,e[8]=w);let _;e[9]!==s||e[10]!==p||e[11]!==w?(_=(0,B.jsxs)(ow,{variant:"ghost",size:"sm",onClick:s,className:"h-5 px-1.5 text-xs border-border shadow-none hover:bg-accent",children:[p,w]}),e[9]=s,e[10]=p,e[11]=w,e[12]=_):_=e[12];let C;return e[13]!==f||e[14]!==_?(C=(0,B.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,B.jsx)(Mh,{delayDuration:300,content:f,children:_})}),e[13]=f,e[14]=_,e[15]=C):C=e[15],C};var L3=e=>{let n=(0,pf.c)(6),i,o;n[0]===e?(i=n[1],o=n[2]):({children:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let s;return n[3]!==i||n[4]!==o?(s=(0,B.jsx)(CD,{className:"text-xs border-border shadow-none! ring-0! h-5 px-1.5 hover:bg-accent transition-colors",...o,children:i}),n[3]=i,n[4]=o,n[5]=s):s=n[5],s};function N3(e){return e.source!=="iceberg"}function I3(e){return(0,B.jsx)(Dh,{value:e.name,children:(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[(0,B.jsx)(vm,{className:"h-3 w-3",name:e.dialect}),(0,B.jsx)("span",{className:"truncate ml-0.5",children:Ng(e.display_name)})]})},e.name)}function A3(e){return e=e.filter(N3),e.map(I3)}function q3(e){return e==="validate"?(0,B.jsx)(Hd,{className:"h-3 w-3"}):(0,B.jsx)(Bd,{className:"h-3 w-3"})}function j3(e){return e==="validate"?(0,B.jsxs)("div",{className:"text-xs",children:[(0,B.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,B.jsx)(Hd,{className:"h-3 w-3"}),"Validate Mode"]}),(0,B.jsx)("p",{children:"Queries are validated as you write them"})]}):(0,B.jsxs)("div",{className:"text-xs",children:[(0,B.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,B.jsx)(Bd,{className:"h-3 w-3"}),"Default Mode"]}),(0,B.jsx)("p",{children:"Standard editing"})]})}var _v=Jr(),xv=()=>{let e=(0,_v.c)(1),n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,B.jsx)("div",{className:"h-4 border-r border-border"}),e[0]=n):n=e[0],n};const z3=e=>{let n=(0,_v.c)(102),{view:i}=e,o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o={minWidth:50},n[0]=o):o=n[0];let{spanProps:s,inputProps:c}=d3(o),d;n[1]===i.state?d=n[2]:(d=i.state.field(Lr),n[1]=i.state,n[2]=d);let f=d,p;n[3]===i.state?p=n[4]:(p=i.state.facet(Ui),n[3]=i.state,n[4]=p);let y=p,w;n[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,B.jsx)("div",{}),n[5]=w):w=n[5];let _=w,C=!1,E;n[6]===i?E=n[7]:(E=V=>{i.dispatch({effects:Uu.of(V),changes:{from:0,to:i.state.doc.length,insert:i.state.doc.toString()}})},n[6]=i,n[7]=E);let T=E;if(f instanceof hd){let V;n[8]===i.state?V=n[9]:(V=i.state.field(fi),n[8]=i.state,n[9]=V);let F=V;C=!0;let N;n[10]===T?N=n[11]:(N=ft=>{let mt=Lm(ft.currentTarget.value,!1);ft.currentTarget.value=mt,T({dataframeName:mt})},n[10]=T,n[11]=N);let K=N,pe;n[12]!==T||n[13]!==i?(pe=ft=>{T({engine:ft}),JE(i,ft)},n[12]=T,n[13]=i,n[14]=pe):pe=n[14];let P=pe,A;n[15]===Symbol.for("react.memo_cache_sentinel")?(A=(0,B.jsx)("span",{className:"select-none",children:"Output variable: "}),n[15]=A):A=n[15];let W;n[16]===c?W=n[17]:(W=ft=>{var mt;(mt=c.onChange)==null||mt.call(c,ft)},n[16]=c,n[17]=W);let de;n[18]===K?de=n[19]:(de=ft=>{ft.key==="Enter"&&ft.shiftKey&&K(ft)},n[18]=K,n[19]=de);let fe;n[20]!==c||n[21]!==F.dataframeName||n[22]!==K||n[23]!==W||n[24]!==de?(fe=(0,B.jsx)("input",{...c,defaultValue:F.dataframeName,onChange:W,onBlur:K,onKeyDown:de,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]=F.dataframeName,n[22]=K,n[23]=W,n[24]=de,n[25]=fe):fe=n[25];let we;n[26]===s?we=n[27]:(we=(0,B.jsx)("span",{...s}),n[26]=s,n[27]=we);let J;n[28]!==fe||n[29]!==we?(J=(0,B.jsxs)("label",{className:"flex gap-2 items-center",children:[A,fe,we]}),n[28]=fe,n[29]=we,n[30]=J):J=n[30];let be;n[31]!==y||n[32]!==F.engine||n[33]!==P?(be=(0,B.jsx)(P3,{selectedEngine:F.engine,onChange:P,cellId:y}),n[31]=y,n[32]=F.engine,n[33]=P,n[34]=be):be=n[34];let Se;n[35]===F.engine?Se=n[36]:(Se=F.engine==="__marimo_duckdb"&&(0,B.jsx)(M3,{}),n[35]=F.engine,n[36]=Se);let Z;n[37]!==F.engine||n[38]!==i?(Z=async()=>{await Gk(i,F.engine)},n[37]=F.engine,n[38]=i,n[39]=Z):Z=n[39];let re;n[40]===Symbol.for("react.memo_cache_sentinel")?(re=(0,B.jsx)(em,{className:"h-3 w-3"}),n[40]=re):re=n[40];let se;n[41]===Z?se=n[42]:(se=(0,B.jsx)(Mh,{content:"Format SQL",children:(0,B.jsx)(ow,{variant:"text",size:"icon",onClick:Z,children:re})}),n[41]=Z,n[42]=se);let Q;n[43]===Symbol.for("react.memo_cache_sentinel")?(Q=(0,B.jsx)(xv,{}),n[43]=Q):Q=n[43];let Le;n[44]===T?Le=n[45]:(Le=ft=>{T({showOutput:!ft.target.checked})},n[44]=T,n[45]=Le);let Fe=!F.showOutput,et;n[46]!==Le||n[47]!==Fe?(et=(0,B.jsx)("input",{type:"checkbox",onChange:Le,checked:Fe}),n[46]=Le,n[47]=Fe,n[48]=et):et=n[48];let Be;n[49]===Symbol.for("react.memo_cache_sentinel")?(Be=(0,B.jsx)("span",{className:"select-none",children:"Hide output"}),n[49]=Be):Be=n[49];let je;n[50]===et?je=n[51]:(je=(0,B.jsxs)("label",{className:"flex items-center gap-2",children:[et,Be]}),n[50]=et,n[51]=je);let Pe;n[52]!==Se||n[53]!==se||n[54]!==je?(Pe=(0,B.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[Se,se,Q,je]}),n[52]=Se,n[53]=se,n[54]=je,n[55]=Pe):Pe=n[55];let Ae;n[56]!==J||n[57]!==be||n[58]!==Pe?(Ae=(0,B.jsxs)("div",{className:"flex flex-1 gap-2 items-center",children:[J,be,Pe]}),n[56]=J,n[57]=be,n[58]=Pe,n[59]=Ae):Ae=n[59],_=Ae}if(f instanceof ad){C=!0;let V,F,N,K,pe,P,A,W,de,fe;if(n[60]!==T||n[61]!==i.state){let{quotePrefix:Le}=i.state.field(fi);F=Le,F===void 0&&(F="r",T({quotePrefix:F})),fe=(Fe,et)=>{typeof et=="boolean"&&T({quotePrefix:p3({currentQuotePrefix:F,checked:et,prefix:Fe})})},K="flex flex-row w-full justify-end gap-1.5 items-center",de="flex items-center gap-1.5",n[72]===Symbol.for("react.memo_cache_sentinel")?(N=(0,B.jsx)("span",{children:"r"}),n[72]=N):N=n[72],V=Hl,P="Toggle raw string",A="w-3 h-3",W=F.includes("r"),pe=Fe=>{fe("r",Fe)},n[60]=T,n[61]=i.state,n[62]=V,n[63]=F,n[64]=N,n[65]=K,n[66]=pe,n[67]=P,n[68]=A,n[69]=W,n[70]=de,n[71]=fe}else V=n[62],F=n[63],N=n[64],K=n[65],pe=n[66],P=n[67],A=n[68],W=n[69],de=n[70],fe=n[71];let we;n[73]!==V||n[74]!==pe||n[75]!==P||n[76]!==A||n[77]!==W?(we=(0,B.jsx)(V,{"aria-label":P,className:A,checked:W,onCheckedChange:pe}),n[73]=V,n[74]=pe,n[75]=P,n[76]=A,n[77]=W,n[78]=we):we=n[78];let J;n[79]!==N||n[80]!==we||n[81]!==de?(J=(0,B.jsxs)("div",{className:de,children:[N,we]}),n[79]=N,n[80]=we,n[81]=de,n[82]=J):J=n[82];let be;n[83]===Symbol.for("react.memo_cache_sentinel")?(be=(0,B.jsx)("span",{children:"f"}),n[83]=be):be=n[83];let Se;n[84]===F?Se=n[85]:(Se=F.includes("f"),n[84]=F,n[85]=Se);let Z;n[86]===fe?Z=n[87]:(Z=Le=>{fe("f",Le)},n[86]=fe,n[87]=Z);let re;n[88]!==Se||n[89]!==Z?(re=(0,B.jsxs)("div",{className:"flex items-center gap-1.5",children:[be,(0,B.jsx)(Hl,{"aria-label":"Toggle f-string",className:"w-3 h-3",checked:Se,onCheckedChange:Z})]}),n[88]=Se,n[89]=Z,n[90]=re):re=n[90];let se;n[91]===Symbol.for("react.memo_cache_sentinel")?(se=(0,B.jsx)(Mh,{content:(0,B.jsx)(yv,{}),children:(0,B.jsx)(Hu,{className:"w-3 h-3"})}),n[91]=se):se=n[91];let Q;n[92]!==K||n[93]!==J||n[94]!==re?(Q=(0,B.jsxs)("div",{className:K,children:[J,re,se]}),n[92]=K,n[93]=J,n[94]=re,n[95]=Q):Q=n[95],_=Q}let I;n[96]===C?I=n[97]:(I=C&&(0,B.jsx)(xv,{}),n[96]=C,n[97]=I);let $;return n[98]!==_||n[99]!==f.type||n[100]!==I?($=(0,B.jsx)(BD,{children:(0,B.jsxs)("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[_,I,f.type]})}),n[98]=_,n[99]=f.type,n[100]=I,n[101]=$):$=n[101],$};var hf=new Lu;pd=Bi.define(),Lr=xs.define({create(){return gr.python},update(e,n){for(let i of n.effects)if(i.is(pd))return i.value;return e},provide:e=>_h.from(e,n=>n.type==="python"?null:i=>Yk(i,z3))});function F3(){let e=i3(),n=(i,o)=>{let s=e[o%e.length];return s.isSupported(i)?s:n(i,o+1)};return[Ra.of([{key:"F4",preventDefault:!0,run:i=>{let o=i.state.field(Lr),s=e.findIndex(d=>d.type===o.type),c=n(i.state.doc.toString(),s+1);return o===c?!1:(kv({view:i,nextLanguage:c,opts:{keepCodeAsIs:!1}}),!0)}}])]}function kv({view:e,nextLanguage:n,opts:i}){let o=e.state.field(Lr),s=e.state.doc.toString(),c=e.state.facet(xg),d=e.state.facet(kg),f=e.state.facet(zd),p=e.state.facet(ic),y=e.state.facet(Sg),w=e.state.field(fi),_=e.state.selection.main.head,C;if(i.keepCodeAsIs)C=s,o.type!==n.type&&(w={...n.defaultMetadata});else{let[E,T]=o.transformOut(s,w),[I,$,V]=n.transformIn(E);_+=T,_-=$,_=Sh(_,0,I.length),C=I,w=V}e.dispatch({effects:[pd.of(n),$u.of(w),hf.reconfigure(n.getExtension(p,c,d,f,y)),Qu.reconfigure([]),Ls.of(!0)],changes:i.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:C},selection:i.keepCodeAsIs?void 0:mn.cursor(_)}),e.dispatch({effects:[Qu.reconfigure([W4()])]}),n.type==="sql"&&XE(e)}U_=function(e){let{placeholderType:n,completionConfig:i,hotkeys:o,cellId:s,lspConfig:c}=e;return[F3(),hf.of(gr.python.getExtension(s,i,o,n,c)),Lr,fi]},ex=function(e){return B3(Xr({state:e}).trim())};function B3(e){return e?gr.markdown.isSupported(e)?gr.markdown:gr.sql.isSupported(e)?gr.sql:gr.python:gr.python}gm=function(e,n){e.state.field(Lr).type!==n.language&&kv({view:e,nextLanguage:gr[n.language],opts:{keepCodeAsIs:n.keepCodeAsIs??!1}})},F_=function(e,{completionConfig:n,hotkeysProvider:i,lspConfig:o}){let s=e.state.field(Lr),c=e.state.facet(zd),d=e.state.facet(ic);return d===void 0&&Ee.error("Cell ID is undefined in reconfigureLanguageEffect"),c===void 0&&Ee.error("Placeholder type is undefined in reconfigureLanguageEffect"),n===void 0&&Ee.error("Completion config is undefined in reconfigureLanguageEffect"),hf.reconfigure(s.getExtension(d,n,i,c,o))},Xr=function(e,n,i){let o=e.state.field(Lr),s=e.state.field(fi),c=e.state.doc.toString();return n===void 0?o.transformOut(c,s)[0]:o.transformOut(c.slice(n,i),s)[0]},xo=function(e,n){let[i]=e.state.field(Lr).transformIn(n);return Wu(e,i),i};function H3(e){let n=e.state.selection.main.head,i=e.state.doc.toString(),o=i.length>0&&i[n-1]===`
145
+ `,n}eq(n){return this.isCurrent===n.isCurrent&&this.isValid===n.isValid&&this.isFocused===n.isFocused&&this.config===n.config}};function ME(e,n){var f;let i=L4.empty;if((f=n.whenHide)!=null&&f.call(n,e))return i;let o=e.state.field(Xy,!1);if(!o)return i;let{currentStatement:s,allStatements:c,isFocused:d}=o;try{for(let p of c){let y=(s==null?void 0:s.from)===p.from&&(s==null?void 0:s.to)===p.to;if(!p.isValid&&n.showInvalid===!1)continue;let w=new PE(n,y,p.isValid,d);for(let _=p.lineFrom;_<=p.lineTo;_++)try{if(_<1||_>e.state.doc.lines)continue;let C=e.state.doc.line(_);i=i.update({add:[w.range(C.from)]})}catch(C){console.warn("SqlGutter: Invalid line number",_,C)}}}catch(p){console.warn("SqlGutter: Error creating markers",p)}return i}function LE(e){return Kt.updateListener.of(async n=>{if(!n.docChanged&&!n.selectionSet&&!n.focusChanged)return;let{state:i}=n.view,{main:o}=i.selection,s=o.head,c=await e.analyzeDocument(i),d={currentStatement:await e.getStatementAtPosition(i,s),allStatements:c,cursorPosition:s,isFocused:n.view.hasFocus};n.view.dispatch({effects:Jy.of(d)})})}function NE(e){let n=e.width||3;return Kt.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 IE(e){return N4({class:`cm-sql-gutter ${e.className||""}`,markers:n=>ME(n,e)})}function AE(e={}){return[Xy,LE(new OE(e.parser||new fc)),NE(e),IE(e)]}function qE(e={}){let n=[],{enableLinting:i=!0,enableGutterMarkers:o=!0,enableHover:s=!0,linterConfig:c,gutterConfig:d,hoverConfig:f}=e;return i&&n.push(kE(c)),o&&n.push(AE(d)),s&&(n.push(EE(f)),f!=null&&f.theme?n.push(f.theme):n.push(Gy())),n}var jE=class xx{static jsonStringifySortKeys(){return n=>typeof n!="object"||!n?String(n):JSON.stringify(n,Object.keys(n).sort(),2)}constructor(n,i={}){this.delegate=n,this.toKey=i.toKey??xx.jsonStringifySortKeys(),this.cache=new ac(i.maxSize??128)}request(n){let i=this.toKey(n),o=this.cache.get(i);if(o!==void 0)return o;let s=this.delegate.request(n);return this.cache.set(i,s),s.catch(c=>{throw this.cache.delete(i),c})}resolve(n,i){this.delegate.resolve(n,i)}reject(n,i){this.delegate.reject(n,i)}};Hw=new Au("sql-table-preview",async(e,n)=>{await Vi().previewSQLTable({requestId:e,...n})}),zw=new Au("sql-table-list-preview",async(e,n)=>{await Vi().previewSQLTableList({requestId:e,...n})}),Gh=new jE(new Au("validate-sql",async(e,n)=>{await Vi().validateSQL({requestId:e,...n})}),{maxSize:3});var zE=Jr();let Va;Va=ze(new Map),r_=e=>{let n=(0,zE.c)(3),i=Zn(Va),o;return n[0]!==e||n[1]!==i?(o=i.get(e),n[0]=e,n[1]=i,n[2]=o):o=n[2],o};function Yy(e){let n=lt.get(Va),i=new Map(n);i.delete(e),lt.set(Va,i)}function FE(){lt.set(Va,new Map)}function BE({cellId:e,errorMessage:n,dialect:i}){let o=lt.get(Va),s=new Map(o),c=i==="DuckDB"?HE(n):Zy(n);s.set(e,c),lt.set(Va,s)}function HE(e){let{errorType:n,errorMessage:i}=Zy(e),o=i,s,c=i.indexOf("LINE ");return c!==-1&&(s=i.slice(Math.max(0,c)).trim(),o=i.slice(0,Math.max(0,c)).trim()),{errorType:n,errorMessage:o,codeblock:s}}function Zy(e){return{errorType:e.split(":")[0].trim(),errorMessage:e.split(":").slice(1).join(":").trim()}}function ev(e){return e.field(fi)}function VE(){return e=>{let n=ev(e.state).engine,i=Fa.getCompletionSource(n);return i&&fD(i)(e)||null}}function $E(){return e=>{let n=ev(e.state).engine,i=Fa.getDialect(n);return e.matchBefore(/\.\w*/)?null:vD(i,!0,(o,s)=>({label:o,type:s,info:async()=>{let c=(await WE())[o.toLocaleLowerCase()];if(!c)return null;let d=document.createElement("div");return d.innerHTML=DE.keyword({keyword:o,info:c}),d}}))(e)}}var WE=di(async()=>{let e=await ce(()=>import("./common-keywords-DHn1q5re.js").then(async i=>(await i.__tla,i)),[],import.meta.url),n=await ce(()=>import("./duckdb-keywords-usZbJ-Dr.js").then(async i=>(await i.__tla,i)),[],import.meta.url);return{...e.default.keywords,...n.default.keywords}}),UE=Jr(),tv=Vl("marimo:notebook-sql-mode","default",$l);function KE(){let e=(0,UE.c)(3),[n,i]=Y2(tv),o;return e[0]!==i||e[1]!==n?(o={sqlMode:n,setSQLMode:i},e[0]=i,e[1]=n,e[2]=o):o=e[2],o}function nv(){return lt.get(tv)}var QE=Eg,GE="DuckDB",rv=new Lu;function uf(){return lt.get(So).latestEngineSelected}let iv;hd=(_f=class{constructor(){ke(this,"parser",new ny);ke(this,"type","sql");this.sqlModeEnabled=!0}get defaultMetadata(){return{...this.parser.defaultMetadata,engine:uf()||"__marimo_duckdb"}}get defaultCode(){let e=uf();return e&&e!=="__marimo_duckdb"?`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`:this.parser.defaultCode}transformIn(e){this.parser.defaultMetadata.engine=uf()||"__marimo_duckdb";let n=this.parser.transformIn(e),i=n.metadata;return i.engine&&i.engine!=="__marimo_duckdb"&&Dg(i.engine),[n.code,n.offset,i]}transformOut(e,n){let i=this.parser.transformOut(e,n);return[i.code,i.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,i,o,s){var d;let c=[rv.of(Cw({dialect:QE})),Ra.of([{key:"Tab",run:f=>sD(f)||$4(f),preventDefault:!0}]),Iu({defaultKeymap:!1,activateOnTyping:!0,override:[VE(),WC,$E()]})];if(((d=s==null?void 0:s.diagnostics)==null?void 0:d.sql_linter)??!1){let f=lt.get(AD),p=new iv({getParserOptions:y=>({database:ov(y)??GE})});c.push(qE({enableLinting:!0,linterConfig:{delay:250,parser:p},enableGutterMarkers:!0,gutterConfig:{backgroundColor:"#3b82f6",errorBackgroundColor:"#ef4444",hideWhenNotFocused:!0,parser:p},hoverConfig:{schema:YE,hoverTime:300,enableKeywords:!0,enableTables:!0,enableColumns:!0,parser:p,theme:Gy(f)}}),Kt.updateListener.of(y=>{y.focusChanged&&p.setFocusState(y.view.hasFocus)}))}return this.sqlModeEnabled&&c.push(e3()),c}},ke(_f,"fromQuery",e=>ny.fromQuery(e)),_f),iv=class extends fc{constructor(){super(...arguments);ke(this,"validationTimeout",null);ke(this,"VALIDATION_DELAY_MS",300);ke(this,"isFocused",!1)}setFocusState(n){this.isFocused=n}async validateWithDelay(n,i,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 d=await lv(n,i,o,nv());if(d.error){Se.error("Failed to validate SQL",{error:d.error}),s([]);return}s(((c=d.parse_result)==null?void 0:c.errors)??[])}catch(d){Se.error("Failed to validate SQL",{error:d}),s([])}},this.VALIDATION_DELAY_MS)})}async validateSql(n,i){let o=Fo(i.state);if(!this.isFocused)return[];if(!ko.has(o.engine))return super.validateSql(n,i);let s=ov(i.state);return this.validateWithDelay(n,o.engine,s)}async parse(n,i){return Fo(i.state).engine==="__marimo_duckdb"?{success:!0,errors:[]}:super.parse(n,i)}};function av(e,n){e.dispatch({effects:rv.reconfigure(Cw({dialect:n}))})}function JE(e,n){av(e,Fa.getDialect(n))}function XE(e){let n=Fo(e.state).engine;av(e,Fa.getDialect(n))}function Fo(e){return e.field(fi)}function YE(e){let n=Fo(e.state).engine,i=Fa.getCompletionSource(n);return i!=null&&i.schema?i.schema:{}}function ov(e){let n=Fo(e).engine;return sv(n)}function sv(e){var i;let n=(i=Fa.getInternalDialect(e))==null?void 0:i.toLowerCase();if(!n||!ic(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 Se.debug("Unsupported dialect",{dialect:n}),null;default:return _s(n),null}}var ZE=300;function e3(){let e,n=null;return Kt.updateListener.of(i=>{if(!i.docChanged)return;let o=nv();if(o==="default")return;let s=Fo(i.state).engine;if(!ko.has(s))return;let c=i.state.doc.toString();e&&window.clearTimeout(e),e=window.setTimeout(async()=>{if(n===c)return;n=c;let d=i.view.state.facet(Ui);if(c===""){Yy(d);return}try{let f=sv(s),p=(await lv(c,s,f,o)).validate_result;p!=null&&p.error_message?BE({cellId:d,errorMessage:p.error_message,dialect:f}):Yy(d)}catch(f){Se.error("Failed to validate SQL",{error:f})}},ZE)})}async function lv(e,n,i,o){let s=await Gh.request({onlyParse:o==="default",engine:n,dialect:i,query:e});if(s.error)throw Error(s.error);return s}var t3=di(()=>new mE),n3=di(()=>new ad),r3=di(()=>new hd);gr={get python(){return t3()},get markdown(){return n3()},get sql(){return r3()}};function i3(){return Object.values(gr)}var jt=vh(Ou(),1),mc="Checkbox",[a3,WD]=qD(mc),[o3,df]=a3(mc);function s3(e){let{__scopeCheckbox:n,checked:i,children:o,defaultChecked:s,disabled:c,form:d,name:f,onCheckedChange:p,required:y,value:w="on",internal_do_not_use_render:_}=e,[C,E]=jD({prop:i,defaultProp:s??!1,onChange:p,caller:mc}),[T,I]=jt.useState(null),[$,V]=jt.useState(null),F=jt.useRef(!1),N=T?!!d||!!T.closest("form"):!0,K={checked:C,disabled:c,setChecked:E,control:T,setControl:I,name:f,form:d,value:w,hasConsumerStoppedPropagationRef:F,required:y,defaultChecked:ea(s)?!1:s,isFormControl:N,bubbleInput:$,setBubbleInput:V};return(0,B.jsx)(o3,{scope:n,...K,children:l3(_)?_(K):o})}var cv="CheckboxTrigger",uv=jt.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:i,...o},s)=>{let{control:c,value:d,disabled:f,checked:p,required:y,setControl:w,setChecked:_,hasConsumerStoppedPropagationRef:C,isFormControl:E,bubbleInput:T}=df(cv,e),I=aw(s,w),$=jt.useRef(p);return jt.useEffect(()=>{let V=c==null?void 0:c.form;if(V){let F=()=>_($.current);return V.addEventListener("reset",F),()=>V.removeEventListener("reset",F)}},[c,_]),(0,B.jsx)(Ph.button,{type:"button",role:"checkbox","aria-checked":ea(p)?"mixed":p,"aria-required":y,"data-state":mv(p),"data-disabled":f?"":void 0,disabled:f,value:d,...o,ref:I,onKeyDown:Dw(n,V=>{V.key==="Enter"&&V.preventDefault()}),onClick:Dw(i,V=>{_(F=>ea(F)?!0:!F),T&&E&&(C.current=V.isPropagationStopped(),C.current||V.stopPropagation())})})});uv.displayName=cv;var ff=jt.forwardRef((e,n)=>{let{__scopeCheckbox:i,name:o,checked:s,defaultChecked:c,required:d,disabled:f,value:p,onCheckedChange:y,form:w,..._}=e;return(0,B.jsx)(s3,{__scopeCheckbox:i,checked:s,defaultChecked:c,disabled:f,required:d,onCheckedChange:y,name:o,form:w,value:p,internal_do_not_use_render:({isFormControl:C})=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(uv,{..._,ref:n,__scopeCheckbox:i}),C&&(0,B.jsx)(hv,{__scopeCheckbox:i})]})})});ff.displayName=mc;var dv="CheckboxIndicator",fv=jt.forwardRef((e,n)=>{let{__scopeCheckbox:i,forceMount:o,...s}=e,c=df(dv,i);return(0,B.jsx)(zD,{present:o||ea(c.checked)||c.checked===!0,children:(0,B.jsx)(Ph.span,{"data-state":mv(c.checked),"data-disabled":c.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})});fv.displayName=dv;var pv="CheckboxBubbleInput",hv=jt.forwardRef(({__scopeCheckbox:e,...n},i)=>{let{control:o,hasConsumerStoppedPropagationRef:s,checked:c,defaultChecked:d,required:f,disabled:p,name:y,value:w,form:_,bubbleInput:C,setBubbleInput:E}=df(pv,e),T=aw(i,E),I=xD(c),$=FD(o);jt.useEffect(()=>{let F=C;if(!F)return;let N=window.HTMLInputElement.prototype,K=Object.getOwnPropertyDescriptor(N,"checked").set,pe=!s.current;if(I!==c&&K){let P=new Event("click",{bubbles:pe});F.indeterminate=ea(c),K.call(F,ea(c)?!1:c),F.dispatchEvent(P)}},[C,I,c,s]);let V=jt.useRef(ea(c)?!1:c);return(0,B.jsx)(Ph.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??V.current,required:f,disabled:p,name:y,value:w,form:_,...n,tabIndex:-1,ref:T,style:{...n.style,...$,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});hv.displayName=pv;function l3(e){return typeof e=="function"}function ea(e){return e==="indeterminate"}function mv(e){return ea(e)?"indeterminate":e?"checked":"unchecked"}let gv;gv=Jr(),Bl=jt.forwardRef((e,n)=>{let i=(0,gv.c)(10),o,s;i[0]===e?(o=i[1],s=i[2]):({className:o,...s}=e,i[0]=e,i[1]=o,i[2]=s);let c;i[3]===o?c=i[4]:(c=Pu("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),i[3]=o,i[4]=c);let d;i[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,B.jsx)(fv,{className:Pu("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),children:(0,B.jsx)(bD,{className:"h-4 w-4"})}),i[5]=d):d=i[5];let f;return i[6]!==s||i[7]!==n||i[8]!==c?(f=(0,B.jsx)(ff,{ref:n,className:c,...s,children:d}),i[6]=s,i[7]=n,i[8]=c,i[9]=f):f=i[9],f}),Bl.displayName=ff.displayName,h_="_";var c3=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("."));Lm=function(e,n=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,"_"),n?e.toLowerCase():e):"_"},mx=function(e,n){let i=new Set(n),o=e,s=d=>!i.has(d)&&!c3.has(d);if(s(e))return e;let c=1;for(;!s(o);)o=`${e}_${c}`,c++;return o},cx=function(e,n){return hm(e)?`cell-${n}`:e},hm=function(e){return e?e==="_"||e==="__":!0};var u3=Jr();function d3(e){let n=(0,u3.c)(15),{minWidth:i,padding:o}=e,s=i===void 0?70:i,c=o===void 0?15:o,[d,f]=(0,jt.useState)(50),p=(0,jt.useRef)(null),y=(0,jt.useRef)(null),w;n[0]===c?w=n[1]:(w=P=>{if(y.current&&p.current){let A=y.current;A.style.fontSize=window.getComputedStyle(p.current).fontSize,A.style.fontFamily=window.getComputedStyle(p.current).fontFamily,A.textContent=P;let W=A.offsetWidth;f(W+c)}},n[0]=c,n[1]=w);let _=w,C;n[2]===_?C=n[3]:(C=()=>{var P;_(((P=p.current)==null?void 0:P.value)??"")},n[2]=_,n[3]=C),y4(C);let E;n[4]===_?E=n[5]:(E=P=>{_(P.target.value)},n[4]=_,n[5]=E);let T=`${d}px`,I=`${s}px`,$;n[6]!==T||n[7]!==I?($={width:T,minWidth:I},n[6]=T,n[7]=I,n[8]=$):$=n[8];let V;n[9]!==E||n[10]!==$?(V={ref:p,type:"text",onChange:E,style:$},n[9]=E,n[10]=$,n[11]=V):V=n[11];let F=V,N;n[12]===Symbol.for("react.memo_cache_sentinel")?(N={ref:y,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},n[12]=N):N=n[12];let K=N,pe;return n[13]===F?pe=n[14]:(pe={inputProps:F,spanProps:K},n[13]=F,n[14]=pe),pe}var f3=Jr();function p3({currentQuotePrefix:e,checked:n,prefix:i}){let o=e;return n?e===""?o=i:e!=="rf"&&i!==e&&(o="rf"):e===i?o="":e==="rf"&&(o=i==="r"?"f":"r"),o}let yv;yv=()=>{let e=(0,f3.c)(2),n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,B.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,B.jsxs)("header",{className:"flex items-center gap-1",children:[(0,B.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"r"}),(0,B.jsx)("span",{className:"font-semibold",children:"Raw String"})]}),(0,B.jsx)("p",{className:"text-sm text-muted-foreground",children:"Write LaTeX without escaping special characters"}),(0,B.jsx)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:"\\alpha \\beta"})]}),e[0]=n):n=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=(0,B.jsxs)("div",{className:"flex flex-col gap-3.5",children:[n,(0,B.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,B.jsxs)("header",{className:"flex items-center gap-1",children:[(0,B.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"f"}),(0,B.jsx)("span",{className:"font-semibold",children:"Format String"})]}),(0,B.jsx)("p",{className:"text-sm text-muted-foreground",children:"Interpolate Python values"}),(0,B.jsxs)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:["Hello ","{name}","! \u{1F601}"]})]})]}),e[1]=i):i=e[1],i},Tm="data-cell-id",D_=function(e){return{[Tm]:e}},xm="data-for-cell-id",td=function(e){return{[xm]:e}};var h3="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",m3="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",g3="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==",y3="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",v3="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",b3=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,w3="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",_3="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",vv=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,x3="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",k3="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",S3="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",C3="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",E3="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",T3="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",R3=""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,D3=Jr(),O3={sqlite:C3,duckdb:y3,motherduck:w3,postgres:vv,postgresql:vv,mysql:_3,snowflake:k3,databricks:m3,clickhouse:h3,timeplus:T3,bigquery:v3,trino:R3,iceberg:b3,datafusion:g3,pyspark:S3,redshift:x3,supabase:E3};vm=e=>{let n=(0,D3.c)(11),{name:i,className:o}=e,s=O3[i.toLowerCase()];if(!s){let f;n[0]===o?f=n[1]:(f=Pu("mt-0.5",o),n[0]=o,n[1]=f);let p;return n[2]===f?p=n[3]:(p=(0,B.jsx)(Cs,{className:f}),n[2]=f,n[3]=p),p}let c;n[4]!==o||n[5]!==s?(c=Pu("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 d;return n[7]!==i||n[8]!==c||n[9]!==s?(d=(0,B.jsx)("img",{src:s,alt:i,className:c}),n[7]=i,n[8]=c,n[9]=s,n[10]=d):d=n[10],d};var pf=Jr();const P3=e=>{let n=(0,pf.c)(34),{selectedEngine:i,onChange:o,cellId:s}=e,c=Zn(ld),d=[],f=[];for(let[Ce,Z]of c.entries())ko.has(Ce)?d.push(Z):f.push(Z);let p=cD(),y=i&&!c.has(i),w;n[0]!==c||n[1]!==o||n[2]!==p?(w=Ce=>{if(Ce===bv){window.open(wv,"_blank");return}let Z=c.get(Ce);Z&&(p(),o(Z.name),Dg(Z.name))},n[0]=c,n[1]=o,n[2]=p,n[3]=w):w=n[3];let _=w,C=A3,E=ED,T;n[4]===s?T=n[5]:(T=td(s),n[4]=s,n[5]=T);let I;n[6]===Symbol.for("react.memo_cache_sentinel")?(I=(0,B.jsx)(_D,{placeholder:"Select an engine"}),n[6]=I):I=n[6];let $;n[7]===T?$=n[8]:($=(0,B.jsx)(L3,{...T,children:I}),n[7]=T,n[8]=$);let V=kD,F;n[9]===s?F=n[10]:(F=td(s),n[9]=s,n[10]=F);let N=SD,K;n[11]===Symbol.for("react.memo_cache_sentinel")?(K=(0,B.jsx)(wD,{children:"Database connections"}),n[11]=K):K=n[11];let pe;n[12]!==y||n[13]!==i?(pe=y&&(0,B.jsx)(Dh,{value:i,children:(0,B.jsxs)("div",{className:"flex items-center gap-1 opacity-50",children:[(0,B.jsx)(cm,{className:"h-3 w-3"}),(0,B.jsx)("span",{className:"truncate",children:Ng(i)})]})},i),n[12]=y,n[13]=i,n[14]=pe):pe=n[14];let P=C(f),A=f.length>0&&(0,B.jsx)(Ew,{}),W=C(d),de;n[15]===Symbol.for("react.memo_cache_sentinel")?(de=(0,B.jsx)(Ew,{}),n[15]=de):de=n[15];let fe;n[16]===Symbol.for("react.memo_cache_sentinel")?(fe=(0,B.jsx)(Dh,{className:"text-muted-foreground",value:bv,children:(0,B.jsxs)("a",{className:"flex items-center gap-1",href:wv,target:"_blank",rel:"noreferrer",children:[(0,B.jsx)(RD,{className:"h-3 w-3"}),(0,B.jsx)("span",{children:"How to add a database connection"})]})}),n[16]=fe):fe=n[16];let we;n[17]!==N||n[18]!==A||n[19]!==W||n[20]!==K||n[21]!==pe||n[22]!==P?(we=(0,B.jsxs)(N,{children:[K,pe,P,A,W,de,fe]}),n[17]=N,n[18]=A,n[19]=W,n[20]=K,n[21]=pe,n[22]=P,n[23]=we):we=n[23];let J;n[24]!==V||n[25]!==we||n[26]!==F?(J=(0,B.jsx)(V,{...F,children:we}),n[24]=V,n[25]=we,n[26]=F,n[27]=J):J=n[27];let be;return n[28]!==E||n[29]!==_||n[30]!==i||n[31]!==J||n[32]!==$?(be=(0,B.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,B.jsxs)(E,{value:i,onValueChange:_,children:[$,J]})}),n[28]=E,n[29]=_,n[30]=i,n[31]=J,n[32]=$,n[33]=be):be=n[33],be};var bv="__help__",wv="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";const M3=()=>{let e=(0,pf.c)(16),{sqlMode:n,setSQLMode:i}=KE(),o;e[0]!==i||e[1]!==n?(o=()=>{let E=n==="validate"?"default":"validate";E==="default"&&FE(),i(E)},e[0]=i,e[1]=n,e[2]=o):o=e[2];let s=o,c=q3,d=j3,f;e[3]===n?f=e[4]:(f=d(n),e[3]=n,e[4]=f);let p;e[5]===n?p=e[6]:(p=c(n),e[5]=n,e[6]=p);let y=n==="validate"?"Validate":"Default",w;e[7]===y?w=e[8]:(w=(0,B.jsx)("span",{className:"ml-1",children:y}),e[7]=y,e[8]=w);let _;e[9]!==s||e[10]!==p||e[11]!==w?(_=(0,B.jsxs)(ow,{variant:"ghost",size:"sm",onClick:s,className:"h-5 px-1.5 text-xs border-border shadow-none hover:bg-accent",children:[p,w]}),e[9]=s,e[10]=p,e[11]=w,e[12]=_):_=e[12];let C;return e[13]!==f||e[14]!==_?(C=(0,B.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,B.jsx)(Mh,{delayDuration:300,content:f,children:_})}),e[13]=f,e[14]=_,e[15]=C):C=e[15],C};var L3=e=>{let n=(0,pf.c)(6),i,o;n[0]===e?(i=n[1],o=n[2]):({children:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let s;return n[3]!==i||n[4]!==o?(s=(0,B.jsx)(CD,{className:"text-xs border-border shadow-none! ring-0! h-5 px-1.5 hover:bg-accent transition-colors",...o,children:i}),n[3]=i,n[4]=o,n[5]=s):s=n[5],s};function N3(e){return e.source!=="iceberg"}function I3(e){return(0,B.jsx)(Dh,{value:e.name,children:(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[(0,B.jsx)(vm,{className:"h-3 w-3",name:e.dialect}),(0,B.jsx)("span",{className:"truncate ml-0.5",children:Ng(e.display_name)})]})},e.name)}function A3(e){return e=e.filter(N3),e.map(I3)}function q3(e){return e==="validate"?(0,B.jsx)(Hd,{className:"h-3 w-3"}):(0,B.jsx)(Bd,{className:"h-3 w-3"})}function j3(e){return e==="validate"?(0,B.jsxs)("div",{className:"text-xs",children:[(0,B.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,B.jsx)(Hd,{className:"h-3 w-3"}),"Validate Mode"]}),(0,B.jsx)("p",{children:"Queries are validated as you write them"})]}):(0,B.jsxs)("div",{className:"text-xs",children:[(0,B.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,B.jsx)(Bd,{className:"h-3 w-3"}),"Default Mode"]}),(0,B.jsx)("p",{children:"Standard editing"})]})}var _v=Jr(),xv=()=>{let e=(0,_v.c)(1),n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,B.jsx)("div",{className:"h-4 border-r border-border"}),e[0]=n):n=e[0],n};const z3=e=>{let n=(0,_v.c)(102),{view:i}=e,o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o={minWidth:50},n[0]=o):o=n[0];let{spanProps:s,inputProps:c}=d3(o),d;n[1]===i.state?d=n[2]:(d=i.state.field(Lr),n[1]=i.state,n[2]=d);let f=d,p;n[3]===i.state?p=n[4]:(p=i.state.facet(Ui),n[3]=i.state,n[4]=p);let y=p,w;n[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,B.jsx)("div",{}),n[5]=w):w=n[5];let _=w,C=!1,E;n[6]===i?E=n[7]:(E=V=>{i.dispatch({effects:Uu.of(V),changes:{from:0,to:i.state.doc.length,insert:i.state.doc.toString()}})},n[6]=i,n[7]=E);let T=E;if(f instanceof hd){let V;n[8]===i.state?V=n[9]:(V=i.state.field(fi),n[8]=i.state,n[9]=V);let F=V;C=!0;let N;n[10]===T?N=n[11]:(N=ft=>{let mt=Lm(ft.currentTarget.value,!1);ft.currentTarget.value=mt,T({dataframeName:mt})},n[10]=T,n[11]=N);let K=N,pe;n[12]!==T||n[13]!==i?(pe=ft=>{T({engine:ft}),JE(i,ft)},n[12]=T,n[13]=i,n[14]=pe):pe=n[14];let P=pe,A;n[15]===Symbol.for("react.memo_cache_sentinel")?(A=(0,B.jsx)("span",{className:"select-none",children:"Output variable: "}),n[15]=A):A=n[15];let W;n[16]===c?W=n[17]:(W=ft=>{var mt;(mt=c.onChange)==null||mt.call(c,ft)},n[16]=c,n[17]=W);let de;n[18]===K?de=n[19]:(de=ft=>{ft.key==="Enter"&&ft.shiftKey&&K(ft)},n[18]=K,n[19]=de);let fe;n[20]!==c||n[21]!==F.dataframeName||n[22]!==K||n[23]!==W||n[24]!==de?(fe=(0,B.jsx)("input",{...c,defaultValue:F.dataframeName,onChange:W,onBlur:K,onKeyDown:de,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]=F.dataframeName,n[22]=K,n[23]=W,n[24]=de,n[25]=fe):fe=n[25];let we;n[26]===s?we=n[27]:(we=(0,B.jsx)("span",{...s}),n[26]=s,n[27]=we);let J;n[28]!==fe||n[29]!==we?(J=(0,B.jsxs)("label",{className:"flex gap-2 items-center",children:[A,fe,we]}),n[28]=fe,n[29]=we,n[30]=J):J=n[30];let be;n[31]!==y||n[32]!==F.engine||n[33]!==P?(be=(0,B.jsx)(P3,{selectedEngine:F.engine,onChange:P,cellId:y}),n[31]=y,n[32]=F.engine,n[33]=P,n[34]=be):be=n[34];let Ce;n[35]===F.engine?Ce=n[36]:(Ce=F.engine==="__marimo_duckdb"&&(0,B.jsx)(M3,{}),n[35]=F.engine,n[36]=Ce);let Z;n[37]!==F.engine||n[38]!==i?(Z=async()=>{await Gk(i,F.engine)},n[37]=F.engine,n[38]=i,n[39]=Z):Z=n[39];let re;n[40]===Symbol.for("react.memo_cache_sentinel")?(re=(0,B.jsx)(em,{className:"h-3 w-3"}),n[40]=re):re=n[40];let se;n[41]===Z?se=n[42]:(se=(0,B.jsx)(Mh,{content:"Format SQL",children:(0,B.jsx)(ow,{variant:"text",size:"icon",onClick:Z,children:re})}),n[41]=Z,n[42]=se);let Q;n[43]===Symbol.for("react.memo_cache_sentinel")?(Q=(0,B.jsx)(xv,{}),n[43]=Q):Q=n[43];let Le;n[44]===T?Le=n[45]:(Le=ft=>{T({showOutput:!ft.target.checked})},n[44]=T,n[45]=Le);let Fe=!F.showOutput,et;n[46]!==Le||n[47]!==Fe?(et=(0,B.jsx)("input",{type:"checkbox",onChange:Le,checked:Fe}),n[46]=Le,n[47]=Fe,n[48]=et):et=n[48];let Be;n[49]===Symbol.for("react.memo_cache_sentinel")?(Be=(0,B.jsx)("span",{className:"select-none",children:"Hide output"}),n[49]=Be):Be=n[49];let je;n[50]===et?je=n[51]:(je=(0,B.jsxs)("label",{className:"flex items-center gap-2",children:[et,Be]}),n[50]=et,n[51]=je);let Pe;n[52]!==Ce||n[53]!==se||n[54]!==je?(Pe=(0,B.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[Ce,se,Q,je]}),n[52]=Ce,n[53]=se,n[54]=je,n[55]=Pe):Pe=n[55];let Ae;n[56]!==J||n[57]!==be||n[58]!==Pe?(Ae=(0,B.jsxs)("div",{className:"flex flex-1 gap-2 items-center",children:[J,be,Pe]}),n[56]=J,n[57]=be,n[58]=Pe,n[59]=Ae):Ae=n[59],_=Ae}if(f instanceof ad){C=!0;let V,F,N,K,pe,P,A,W,de,fe;if(n[60]!==T||n[61]!==i.state){let{quotePrefix:Le}=i.state.field(fi);F=Le,F===void 0&&(F="r",T({quotePrefix:F})),fe=(Fe,et)=>{typeof et=="boolean"&&T({quotePrefix:p3({currentQuotePrefix:F,checked:et,prefix:Fe})})},K="flex flex-row w-full justify-end gap-1.5 items-center",de="flex items-center gap-1.5",n[72]===Symbol.for("react.memo_cache_sentinel")?(N=(0,B.jsx)("span",{children:"r"}),n[72]=N):N=n[72],V=Bl,P="Toggle raw string",A="w-3 h-3",W=F.includes("r"),pe=Fe=>{fe("r",Fe)},n[60]=T,n[61]=i.state,n[62]=V,n[63]=F,n[64]=N,n[65]=K,n[66]=pe,n[67]=P,n[68]=A,n[69]=W,n[70]=de,n[71]=fe}else V=n[62],F=n[63],N=n[64],K=n[65],pe=n[66],P=n[67],A=n[68],W=n[69],de=n[70],fe=n[71];let we;n[73]!==V||n[74]!==pe||n[75]!==P||n[76]!==A||n[77]!==W?(we=(0,B.jsx)(V,{"aria-label":P,className:A,checked:W,onCheckedChange:pe}),n[73]=V,n[74]=pe,n[75]=P,n[76]=A,n[77]=W,n[78]=we):we=n[78];let J;n[79]!==N||n[80]!==we||n[81]!==de?(J=(0,B.jsxs)("div",{className:de,children:[N,we]}),n[79]=N,n[80]=we,n[81]=de,n[82]=J):J=n[82];let be;n[83]===Symbol.for("react.memo_cache_sentinel")?(be=(0,B.jsx)("span",{children:"f"}),n[83]=be):be=n[83];let Ce;n[84]===F?Ce=n[85]:(Ce=F.includes("f"),n[84]=F,n[85]=Ce);let Z;n[86]===fe?Z=n[87]:(Z=Le=>{fe("f",Le)},n[86]=fe,n[87]=Z);let re;n[88]!==Ce||n[89]!==Z?(re=(0,B.jsxs)("div",{className:"flex items-center gap-1.5",children:[be,(0,B.jsx)(Bl,{"aria-label":"Toggle f-string",className:"w-3 h-3",checked:Ce,onCheckedChange:Z})]}),n[88]=Ce,n[89]=Z,n[90]=re):re=n[90];let se;n[91]===Symbol.for("react.memo_cache_sentinel")?(se=(0,B.jsx)(Mh,{content:(0,B.jsx)(yv,{}),children:(0,B.jsx)(Hu,{className:"w-3 h-3"})}),n[91]=se):se=n[91];let Q;n[92]!==K||n[93]!==J||n[94]!==re?(Q=(0,B.jsxs)("div",{className:K,children:[J,re,se]}),n[92]=K,n[93]=J,n[94]=re,n[95]=Q):Q=n[95],_=Q}let I;n[96]===C?I=n[97]:(I=C&&(0,B.jsx)(xv,{}),n[96]=C,n[97]=I);let $;return n[98]!==_||n[99]!==f.type||n[100]!==I?($=(0,B.jsx)(BD,{children:(0,B.jsxs)("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[_,I,f.type]})}),n[98]=_,n[99]=f.type,n[100]=I,n[101]=$):$=n[101],$};var hf=new Lu;pd=Bi.define(),Lr=xs.define({create(){return gr.python},update(e,n){for(let i of n.effects)if(i.is(pd))return i.value;return e},provide:e=>_h.from(e,n=>n.type==="python"?null:i=>Yk(i,z3))});function F3(){let e=i3(),n=(i,o)=>{let s=e[o%e.length];return s.isSupported(i)?s:n(i,o+1)};return[Ra.of([{key:"F4",preventDefault:!0,run:i=>{let o=i.state.field(Lr),s=e.findIndex(d=>d.type===o.type),c=n(i.state.doc.toString(),s+1);return o===c?!1:(kv({view:i,nextLanguage:c,opts:{keepCodeAsIs:!1}}),!0)}}])]}function kv({view:e,nextLanguage:n,opts:i}){let o=e.state.field(Lr),s=e.state.doc.toString(),c=e.state.facet(xg),d=e.state.facet(kg),f=e.state.facet(zd),p=e.state.facet(rc),y=e.state.facet(Sg),w=e.state.field(fi),_=e.state.selection.main.head,C;if(i.keepCodeAsIs)C=s,o.type!==n.type&&(w={...n.defaultMetadata});else{let[E,T]=o.transformOut(s,w),[I,$,V]=n.transformIn(E);_+=T,_-=$,_=Sh(_,0,I.length),C=I,w=V}e.dispatch({effects:[pd.of(n),$u.of(w),hf.reconfigure(n.getExtension(p,c,d,f,y)),Qu.reconfigure([]),Ms.of(!0)],changes:i.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:C},selection:i.keepCodeAsIs?void 0:mn.cursor(_)}),e.dispatch({effects:[Qu.reconfigure([W4()])]}),n.type==="sql"&&XE(e)}U_=function(e){let{placeholderType:n,completionConfig:i,hotkeys:o,cellId:s,lspConfig:c}=e;return[F3(),hf.of(gr.python.getExtension(s,i,o,n,c)),Lr,fi]},ex=function(e){return B3(Xr({state:e}).trim())};function B3(e){return e?gr.markdown.isSupported(e)?gr.markdown:gr.sql.isSupported(e)?gr.sql:gr.python:gr.python}gm=function(e,n){e.state.field(Lr).type!==n.language&&kv({view:e,nextLanguage:gr[n.language],opts:{keepCodeAsIs:n.keepCodeAsIs??!1}})},F_=function(e,{completionConfig:n,hotkeysProvider:i,lspConfig:o}){let s=e.state.field(Lr),c=e.state.facet(zd),d=e.state.facet(rc);return d===void 0&&Se.error("Cell ID is undefined in reconfigureLanguageEffect"),c===void 0&&Se.error("Placeholder type is undefined in reconfigureLanguageEffect"),n===void 0&&Se.error("Completion config is undefined in reconfigureLanguageEffect"),hf.reconfigure(s.getExtension(d,n,i,c,o))},Xr=function(e,n,i){let o=e.state.field(Lr),s=e.state.field(fi),c=e.state.doc.toString();return n===void 0?o.transformOut(c,s)[0]:o.transformOut(c.slice(n,i),s)[0]},xo=function(e,n){let[i]=e.state.field(Lr).transformIn(n);return Wu(e,i),i};function H3(e){let n=e.state.selection.main.head,i=e.state.doc.toString(),o=i.length>0&&i[n-1]===`
146
146
  `,s=i.length>0&&i[n]===`
147
- `,c=o?n-1:n,d=s?n+1:n;return{beforeCursorCode:Xr(e,0,c),afterCursorCode:Xr(e,d)}}var V3=["marimo-carousel","marimo-tabs","marimo-accordion"],$3="h1, h2, h3, h4, h5, h6";function W3(e){if(typeof DOMParser>"u")return null;let n=[],i=new DOMParser().parseFromString(e,"text/html").querySelectorAll($3);for(let o of Array.from(i)){let s=o.textContent;if(V3.some(d=>o.closest(d))||!s)continue;let c=Number.parseInt(o.tagName[1],10);n.push({name:s,level:c,by:Sm(o)})}return{items:n}}Sm=function(e){let n=e.id;if(n)return{id:n};let i=e.textContent;return{path:`//${e.tagName}[contains(., "${i}")]`}};function U3(e){return{items:e.filter(Boolean).flatMap(n=>n.items)}}Dm=function(e){if(e==null||e.mimetype!=="text/html"&&e.mimetype!=="text/markdown"||e.data==null)return null;try{return In(typeof e.data=="string","expected string"),W3(e.data)}catch{return Ee.error("Failed to parse outline"),null}},ix=function(e){return e==null?!1:e.items.some(n=>n.level<=3)};function Sv(e,n){let i=d=>d.items.length===0?7:Math.min(...d.items.map(f=>f.level)),o=n[e];if(o==null||o.items.length===0)return Ee.warn("Failed to find a starting outline"),null;let s=i(o),c=e+1;for(;c<n.length;){let d=n[c];if(d&&i(d)<=s)return[e,c-1];c++}return[e,n.length-1]}Zu=function(e){return e==="application/vnd.marimo+error"||e==="application/vnd.marimo+traceback"},Ow=$l("marimo:rtc:username","",Wl),Xh=_m(()=>Ql("rtc_v2"));let mf,Cv,gf,Is;um=class gd{static fromMilliseconds(n){return n==null?null:new gd(n)}static fromSeconds(n){return n==null?null:new gd(n*1e3)}static now(){return new gd(Date.now())}constructor(n){this.ms=n}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}},mf=($a=class{constructor(){ke(this,"lines",[""]);ke(this,"cursor",{row:0,col:0})}ensureLine(n){for(;this.lines.length<=n;)this.lines.push("")}moveCursor(n,i){let o=this.cursor.row;this.cursor.row=Math.max(0,this.cursor.row+n),this.cursor.col=Math.max(0,this.cursor.col+i),this.ensureLine(this.cursor.row),n<0&&this.cursor.row<o&&this.lines.splice(this.cursor.row+1)}setCursor(n,i){this.cursor.row=Math.max(0,n),this.cursor.col=Math.max(0,i),this.ensureLine(this.cursor.row)}writeChar(n){this.ensureLine(this.cursor.row);let i=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=i.slice(0,this.cursor.col)+n+i.slice(this.cursor.col+1),this.cursor.col++}writeString(n){if(n.length===0)return;this.ensureLine(this.cursor.row);let i=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=i.slice(0,this.cursor.col)+n+i.slice(this.cursor.col+n.length),this.cursor.col+=n.length}control(n){switch(n){case`
147
+ `,c=o?n-1:n,d=s?n+1:n;return{beforeCursorCode:Xr(e,0,c),afterCursorCode:Xr(e,d)}}var V3=["marimo-carousel","marimo-tabs","marimo-accordion"],$3="h1, h2, h3, h4, h5, h6";function W3(e){if(typeof DOMParser>"u")return null;let n=[],i=new DOMParser().parseFromString(e,"text/html").querySelectorAll($3);for(let o of Array.from(i)){let s=o.textContent;if(V3.some(d=>o.closest(d))||!s)continue;let c=Number.parseInt(o.tagName[1],10);n.push({name:s,level:c,by:Sm(o)})}return{items:n}}Sm=function(e){let n=e.id;if(n)return{id:n};let i=e.textContent;return{path:`//${e.tagName}[contains(., "${i}")]`}};function U3(e){return{items:e.filter(Boolean).flatMap(n=>n.items)}}Dm=function(e){if(e==null||e.mimetype!=="text/html"&&e.mimetype!=="text/markdown"||e.data==null)return null;try{return In(typeof e.data=="string","expected string"),W3(e.data)}catch{return Se.error("Failed to parse outline"),null}},ix=function(e){return e==null?!1:e.items.some(n=>n.level<=3)};function Sv(e,n){let i=d=>d.items.length===0?7:Math.min(...d.items.map(f=>f.level)),o=n[e];if(o==null||o.items.length===0)return Se.warn("Failed to find a starting outline"),null;let s=i(o),c=e+1;for(;c<n.length;){let d=n[c];if(d&&i(d)<=s)return[e,c-1];c++}return[e,n.length-1]}Zu=function(e){return e==="application/vnd.marimo+error"||e==="application/vnd.marimo+traceback"},Ow=Vl("marimo:rtc:username","",$l),Xh=_m(()=>Kl("rtc_v2"));let mf,Cv,gf,Ns;um=class gd{static fromMilliseconds(n){return n==null?null:new gd(n)}static fromSeconds(n){return n==null?null:new gd(n*1e3)}static now(){return new gd(Date.now())}constructor(n){this.ms=n}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}},mf=($a=class{constructor(){ke(this,"lines",[""]);ke(this,"cursor",{row:0,col:0})}ensureLine(n){for(;this.lines.length<=n;)this.lines.push("")}moveCursor(n,i){let o=this.cursor.row;this.cursor.row=Math.max(0,this.cursor.row+n),this.cursor.col=Math.max(0,this.cursor.col+i),this.ensureLine(this.cursor.row),n<0&&this.cursor.row<o&&this.lines.splice(this.cursor.row+1)}setCursor(n,i){this.cursor.row=Math.max(0,n),this.cursor.col=Math.max(0,i),this.ensureLine(this.cursor.row)}writeChar(n){this.ensureLine(this.cursor.row);let i=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=i.slice(0,this.cursor.col)+n+i.slice(this.cursor.col+1),this.cursor.col++}writeString(n){if(n.length===0)return;this.ensureLine(this.cursor.row);let i=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=i.slice(0,this.cursor.col)+n+i.slice(this.cursor.col+n.length),this.cursor.col+=n.length}control(n){switch(n){case`
148
148
  `: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 i=$a.ESCAPE_REGEX.exec(n);if(!i){this.writeString(n);return}let o=i[1].split(";").map(s=>s===""?1:Number.parseInt(s,10));switch(i[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(`
149
149
  `)}},ke($a,"ESCAPE_REGEX",/\u001B\[([0-9;]*)([A-DJKH])/u),$a),Cv=class{constructor(){ke(this,"ESC_REGEX",/\u001B(?:\[[0-9;]*[A-Za-z]|\([0-9A-Za-z])/gu)}parse(e){let n=[],i=0;for(let o of e.matchAll(this.ESC_REGEX)){let s=o.index??0;s>i&&n.push({type:"text",value:e.slice(i,s)}),n.push({type:"escape",value:o[0]}),i=s+o[0].length}return i<e.length&&n.push({type:"text",value:e.slice(i)}),n}},gf=class{constructor(){ke(this,"parser",new Cv);ke(this,"buffer",new mf)}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 i=n[0].value;if(!this.hasControlChars(i)){this.buffer.writeString(i);return}}for(let i of n)i.type==="text"?this.processText(i.value):this.buffer.handleEscape(i.value)}reset(){this.buffer=new mf}render(){return this.buffer.render()}hasControlChars(e){for(let n of e)if(n<" ")return!0;return!1}processText(e){let n=0,i=e.length;for(let o=0;o<i;o++){let s=e[o];if(s===`
150
- `||s==="\r"||s===" "||s==="\b"||s==="\v"){if(o>n){let c=e.slice(n,o),d=this.filterControlChars(c);d.length>0&&this.buffer.writeString(d)}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<i){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 i="";for(let o of e)o>=" "&&(i+=o);return i}},Is=class zm{constructor(n,i,o,s){ke(this,"ansiReducer",new gf);this.mimetype=n,this.channel=i,this.timestamp=o,this.ansiReducer=s,this._data=this.ansiReducer.render()}get data(){return this._data}static create(n){let i=new gf;return i.append(n.data),new zm(n.mimetype,n.channel,n.timestamp,i)}appendData(n){return this.ansiReducer.append(n),new zm(this.mimetype,this.channel,this.timestamp,this.ansiReducer)}toJSON(){return{mimetype:this.mimetype,channel:this.channel,timestamp:this.timestamp,data:this.data}}};function K3(e,n=5e3){let i=[...e];if(i.length<2)return Tv(i.map(G3),n);let o=i[i.length-1],s=i[i.length-2];return Q3(o,s)&&(Ev(o),Ev(s),i[i.length-2]=J3(s,o),i.pop()),Tv(i,n)}function Q3(e,n){let i=e.mimetype==="text/plain"&&n.mimetype==="text/plain";if(!i)return!1;let o=e.channel===n.channel,s=e.channel!=="stdin";return i&&o&&s}function G3(e){return e instanceof Is?e:typeof e.data=="string"?Is.create(e):e}function J3(e,n){return e instanceof Is?e.appendData(n.data):Is.create(e).appendData(n.data)}function Ev(e){In(typeof e.data=="string","expected string output")}function Tv(e,n){let i=0,o;for(o=e.length-1;o>=0&&i<n;o--){let f=e[o];f.mimetype==="text/plain"?(In(typeof f.data=="string","expected string"),i+=f.data.split(`
150
+ `||s==="\r"||s===" "||s==="\b"||s==="\v"){if(o>n){let c=e.slice(n,o),d=this.filterControlChars(c);d.length>0&&this.buffer.writeString(d)}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<i){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 i="";for(let o of e)o>=" "&&(i+=o);return i}},Ns=class zm{constructor(n,i,o,s){ke(this,"ansiReducer",new gf);this.mimetype=n,this.channel=i,this.timestamp=o,this.ansiReducer=s,this._data=this.ansiReducer.render()}get data(){return this._data}static create(n){let i=new gf;return i.append(n.data),new zm(n.mimetype,n.channel,n.timestamp,i)}appendData(n){return this.ansiReducer.append(n),new zm(this.mimetype,this.channel,this.timestamp,this.ansiReducer)}toJSON(){return{mimetype:this.mimetype,channel:this.channel,timestamp:this.timestamp,data:this.data}}};function K3(e,n=5e3){let i=[...e];if(i.length<2)return Tv(i.map(G3),n);let o=i[i.length-1],s=i[i.length-2];return Q3(o,s)&&(Ev(o),Ev(s),i[i.length-2]=J3(s,o),i.pop()),Tv(i,n)}function Q3(e,n){let i=e.mimetype==="text/plain"&&n.mimetype==="text/plain";if(!i)return!1;let o=e.channel===n.channel,s=e.channel!=="stdin";return i&&o&&s}function G3(e){return e instanceof Ns?e:typeof e.data=="string"?Ns.create(e):e}function J3(e,n){return e instanceof Ns?e.appendData(n.data):Ns.create(e).appendData(n.data)}function Ev(e){In(typeof e.data=="string","expected string output")}function Tv(e,n){let i=0,o;for(o=e.length-1;o>=0&&i<n;o--){let f=e[o];f.mimetype==="text/plain"?(In(typeof f.data=="string","expected string"),i+=f.data.split(`
151
151
  `).length):i++}if(i<n)return e;let s=o+1,c={channel:"stderr",mimetype:"text/html",data:`<pre>Streaming output truncated to last ${n} lines.
152
152
  </pre>`,timestamp:-1},d=e[s];if(d.mimetype==="text/plain"){In(typeof d.data=="string","expected string");let f=d.data.split(`
153
153
  `),p=n-(i-f.length);return[c,{...d,data:f.slice(-p).join(`
@@ -250,5 +250,5 @@ mark line col
250
250
  )
251
251
  `]))));let c=this._buffer.match(this._osc_regex);if(c===null)return e.kind=qt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;e.kind=qt.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=qt.Unknown,this._buffer=this._buffer.slice(3),e}}ansi_to_html(e){this.append_buffer(e);for(var n=[];;){var i=this.get_next_packet();if(i.kind==qt.EOS||i.kind==qt.Incomplete)break;i.kind==qt.ESC||i.kind==qt.Unknown||(i.kind==qt.Text?n.push(this.transform_to_html(this.with_state(i))):i.kind==qt.SGR?this.process_ansi(i):i.kind==qt.OSCURL&&n.push(this.process_hyperlink(i)))}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 i=n.shift(),o=parseInt(i,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 d=parseInt(n.shift(),10);d>=0&&d<=255&&(s?this.fg=this.palette_256[d]:this.bg=this.palette_256[d])}if(c==="2"&&n.length>2){let d=parseInt(n.shift(),10),f=parseInt(n.shift(),10),p=parseInt(n.shift(),10);if(d>=0&&d<=255&&f>=0&&f<=255&&p>=0&&p<=255){let y={rgb:[d,f,p],class_name:"truecolor"};s?this.fg=y:this.bg=y}}}}}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 i=[],o=[],s=e.fg,c=e.bg;e.bold&&i.push(this._boldStyle),e.faint&&i.push(this._faintStyle),e.italic&&i.push(this._italicStyle),e.underline&&i.push(this._underlineStyle),this._use_classes?(s&&(s.class_name==="truecolor"?i.push(`color:rgb(${s.rgb.join(",")})`):o.push(`${s.class_name}-fg`)),c&&(c.class_name==="truecolor"?i.push(`background-color:rgb(${c.rgb.join(",")})`):o.push(`${c.class_name}-bg`))):(s&&i.push(`color:rgb(${s.rgb.join(",")})`),c&&i.push(`background-color:rgb(${c.rgb})`));let d="",f="";return o.length&&(d=` class="${o.join(" ")}"`),i.length&&(f=` style="${i.join(";")}"`),`<span${f}${d}>${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 Rv(e,...n){let i=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(i)}function eT(e,...n){let i=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(i,"g")}var tT,nT,rT,iT=new Hh;cd=function(e){try{let n=document.createElement("div");return n.innerHTML=e,(n.textContent||n.innerText||"").split(`
252
252
  `).map(i=>i.trimEnd()).join(`
253
- `)}catch(n){return Ee.error("Error parsing HTML content:",n),e}},Uw=function(e){if(!e)return"";try{return cd(iT.ansi_to_html(e))}catch(n){return Ee.error("Error converting ANSI to plain text:",n),e}},qh={startCase:e=>{if(!e)return"";if(typeof e!="string")throw Ee.error(e),TypeError(`Expected string, got ${typeof e}`);return/[A-Za-z]/.test(e)?g4(e):e},htmlEscape:e=>e&&e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;").replaceAll(`
254
- `," "),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 Dv=!1;function aT(e){var o;let n=[],i=[e.console].filter(Boolean).flat();for(let s of i){let c=s.mimetype==="text/plain",d=s.mimetype==="text/html"||s.mimetype==="application/vnd.marimo+traceback";if(c||d){let f=s.channel==="stderr"||s.channel==="marimo-error";switch(s.channel){case"stdout":case"stderr":case"marimo-error":{let p=qh.asString(s.data),y=d?cd(p):p;n.push({timestamp:s.timestamp||Date.now(),level:f?"stderr":"stdout",message:y,cellId:e.cell_id});break}default:break}}}if(n.forEach(Ov.log),i.length===0&&Zu((o=e.output)==null?void 0:o.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(c=>{Ov.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");!Dv&&s&&(Dv=!0,Nl({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 Ov={log:e=>{let n=e.level==="stdout"?"gray":e.level==="stderr"?"red":"orange",i=e.level.toUpperCase();console.log(`%c[${i}]`,`color:${n}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${om(e.timestamp)}]`,`(${e.cellId}) ${e.message}`)}};om=function(e){try{return Z3(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},o_=function(e,n){let i=ed(n);i?i.focus():Ee.warn(`[CellFocusManager] focusCellEditor: element not found: ${n}`)},Lw=function(e){let n=document.getElementById(er.create(e));n?vf(n):Ee.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},i_=function(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})},jh=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function vf(e){try{e.focus()}catch{Ee.warn("[CellFocusManager] element may not be focusable",e)}}Im=function(e,n){let{retries:i,delay:o,initialDelay:s=0}=n,c=0,d=()=>{if(c<i){try{if(e())return}catch(f){Ee.error(`Error executing function on attempt ${c+1}, retrying`,{error:f})}c++,setTimeout(d,o)}};s>0?setTimeout(d,s):d()};function As({cellId:e,cell:n,isCodeHidden:i,codeFocus:o,variableName:s}){var d;if(!n)return;let c=document.getElementById(er.create(e));if(!c){Ee.warn("scrollCellIntoView: element not found");return}if(jh()){vf(c);return}if(i)vf(c);else{let f=(d=n.current)==null?void 0:d.editorView;if(!f){Ee.warn("scrollCellIntoView: editor not found",e);return}if(f.hasFocus||!document.hasFocus())return;if(Im(()=>(f.focus(),f.hasFocus),{retries:5,delay:20}),o==="top")f.dispatch({selection:{anchor:0,head:0}});else if(o==="bottom"){let p=f.state.doc.line(f.state.doc.lines);f.dispatch({selection:{anchor:p.from,head:p.from}})}else s&&ju(f,s)}c.scrollIntoView({behavior:"smooth",block:"nearest"})}Qw=function(e){let n=document.getElementById(er.create(e));if(!n){Ee.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 oT(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function sT(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}Zw=function(e){let n=ed(e);if(n!=null&&n.hasFocus){iy(n,{behavior:"instant"});return}let i=document.getElementById(er.create(e));i?i.scrollIntoView({behavior:"instant",block:"nearest"}):Ee.warn(`[CellFocusManager] scrollCellIntoView: element not found: ${e}`)},Pr=function({id:e,name:n="_",code:i="",lastCodeRun:o=null,lastExecutionTime:s=null,edited:c=!1,config:d,serializedEditorState:f=null}){return{id:e,config:d||{hide_code:!1,disabled:!1,column:null},name:n,code:i,edited:c,lastCodeRun:o,lastExecutionTime:s,serializedEditorState:f}};function lT(e){return{hide_code:!1,disabled:!1,column:null,...e}}Mr=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 bf=Jr();function Pv(e){let n={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[Rs]:Pr({id:Rs,config:n}),...e.cellData},cellRuntime:{[Rs]:Mr(),...e.cellRuntime},cellHandles:{[Rs]:(0,jt.createRef)(),...e.cellHandles}}}function cT(){return Pv({cellIds:Vl.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let uT,dT,Mv;({reducer:uT,createActions:dT,useActions:Mv,valueAtom:bt}=Ll(cT,{createNewCell:(e,n)=>{var T;let{cellId:i,before:o,code:s,lastCodeRun:c=null,lastExecutionTime:d=null,autoFocus:f=!0,skipIfCodeExists:p=!1,hideCode:y=!1}=n,w,_;if(p){for(let I of e.cellIds.inOrderIds)if(((T=e.cellData[I])==null?void 0:T.code)===s)return e}if(i==="__end__"){let I=e.cellIds.atOrThrow(0);w=I.id,_=I.length}else if(typeof i=="string"){let I=e.cellIds.findWithId(i);w=I.id,_=I.topLevelIds.indexOf(i)}else if(i.type==="__end__"){let I=e.cellIds.get(i.columnId)||e.cellIds.atOrThrow(0);w=I.id,_=I.length}else throw Error("Invalid cellId");let C=n.newCellId||La.create(),E=o?_:_+1;return{...e,cellIds:e.cellIds.insertId(C,w,E),cellData:{...e.cellData,[C]:Pr({id:C,code:s,lastCodeRun:c,config:lT({hide_code:y}),lastExecutionTime:d,edited:!!s&&s!==c})},cellRuntime:{...e.cellRuntime,[C]:Mr()},cellHandles:{...e.cellHandles,[C]:(0,jt.createRef)()},scrollKey:f?C:null,untouchedNewCells:y?new Set([...e.untouchedNewCells,C]):e.untouchedNewCells}},moveCell:(e,n)=>{let{cellId:i,before:o,direction:s}=n;if(o!==void 0&&s!==void 0&&Ee.warn("Both before and direction specified for moveCell. Ignoring one."),s){let f=e.cellIds.findWithId(i),p=e.cellIds.indexOf(f),y=s==="left"?p-1:p+1,w=e.cellIds.at(y);return w?{...e,cellIds:e.cellIds.moveAcrossColumns(f.id,i,w.id,void 0),scrollKey:i}:e}let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i);return o&&d===0?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,0),scrollKey:i}:!o&&d===c.length-1?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,c.length-1),scrollKey:i}:o?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d-1),scrollKey:i}:{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d+1),scrollKey:i}},dropCellOverCell:(e,n)=>{let{cellId:i,overCellId:o}=n,s=e.cellIds.findWithId(i),c=e.cellIds.findWithId(o),d=s.indexOfOrThrow(i),f=c.indexOfOrThrow(o);return s.id===c.id?d===f?e:{...e,cellIds:e.cellIds.moveWithinColumn(s.id,d,f),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,c.id,o),scrollKey:null}},dropCellOverColumn:(e,n)=>{let{cellId:i,columnId:o}=n,s=e.cellIds.findWithId(i);return{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,o,void 0)}},dropOverNewColumn:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.moveToNewColumn(i)}},moveColumn:(e,n)=>n.column===n.overColumn?e:{...e,cellIds:e.cellIds.moveColumn(n.column,n.overColumn)},focusCell:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,where:s}=n,c=i.indexOfOrThrow(o),d;d=s==="before"?Sh(c-1,0,i.length-1):s==="after"?Sh(c+1,0,i.length-1):c;let f=i.atOrThrow(d);return As({cellId:f,cell:e.cellHandles[f],isCodeHidden:qs(e,f),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 i=n.first();return As({cellId:i,cell:e.cellHandles[i],isCodeHidden:qs(e,i),codeFocus:void 0,variableName:void 0}),sT(),e},focusBottomCell:e=>{let n=e.cellIds.getColumns().at(-1);if(n===void 0||n.length===0)return e;let i=n.last();return As({cellId:i,cell:e.cellHandles[i],isCodeHidden:qs(e,i),codeFocus:void 0,variableName:void 0}),oT(),e},sendToTop:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=i.indexOfOrThrow(o);return c===0?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,0),scrollKey:s?o:null}},sendToBottom:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=i.indexOfOrThrow(o),d=i.length-1;return c===d?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,d),scrollKey:s?o:null}},addColumn:(e,n)=>{let i=La.create();return{...e,cellIds:e.cellIds.addColumn(n.columnId,[i]),cellData:{...e.cellData,[i]:Pr({id:i})},cellRuntime:{...e.cellRuntime,[i]:Mr()},cellHandles:{...e.cellHandles,[i]:(0,jt.createRef)()},scrollKey:i}},addColumnBreakpoint:(e,n)=>{let{cellId:i}=n;return e.cellIds.getColumns()[0].inOrderIds[0]===i?e:{...e,cellIds:e.cellIds.insertBreakpoint(i)}},deleteColumn:(e,n)=>{let{columnId:i}=n;return{...e,cellIds:e.cellIds.delete(i)}},mergeAllColumns:e=>({...e,cellIds:e.cellIds.mergeAllColumns()}),compactColumns:e=>({...e,cellIds:e.cellIds.compact()}),deleteCell:(e,n)=>{var p,y;let i=n.cellId;if(e.cellIds.hasOnlyOneId())return e;let o=e.cellIds.findWithId(i),s=o.indexOfOrThrow(i),c=s===0?1:s-1,d=null;o.length>1&&(d=o.atOrThrow(c));let f=(y=(p=e.cellHandles[i].current)==null?void 0:p.editorView)==null?void 0:y.state.toJSON({history:tD});return f.doc=e.cellData[i].code,hT(i),{...e,cellIds:e.cellIds.deleteById(i),history:[...e.history,{name:e.cellData[i].name,serializedEditorState:f,column:o.id,index:s,isSetupCell:i===yr}],scrollKey:d}},undoDeleteCell:e=>{if(e.history.length===0)return e;let{name:n,serializedEditorState:i={doc:""},column:o,index:s,isSetupCell:c}=e.history[e.history.length-1],d=c?yr:La.create(),f=Pr({id:d,name:n,code:i.doc,edited:i.doc.trim().length>0,serializedEditorState:i});return{...e,cellIds:e.cellIds.insertId(d,o,s),cellData:{...e.cellData,[d]:f},cellRuntime:{...e.cellRuntime,[d]:Mr()},cellHandles:{...e.cellHandles,[d]:(0,jt.createRef)()},history:e.history.slice(0,-1),scrollKey:d}},clearSerializedEditorState:(e,n)=>{let{cellId:i}=n;return zs({state:e,cellId:i,cellReducer:o=>({...o,serializedEditorState:null})})},updateCellCode:(e,n)=>{let{cellId:i,code:o,formattingChange:s}=n;return e.cellData[i]?zs({state:e,cellId:i,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:i,name:o}=n;return zs({state:e,cellId:i,cellReducer:s=>({...s,name:o})})},updateCellConfig:(e,n)=>{let{cellId:i,config:o}=n;return zs({state:e,cellId:i,cellReducer:s=>({...s,config:{...s.config,...o}})})},prepareForRun:(e,n)=>zs({state:js({state:e,cellId:n.cellId,cellReducer:i=>Y3(i)}),cellId:n.cellId,cellReducer:i=>({...i,edited:!1,lastCodeRun:i.code.trim()})}),handleCellMessage:(e,n)=>{let i=n.cell_id,o=js({state:e,cellId:i,cellReducer:s=>X3(s,n)});return{...o,cellLogs:[...o.cellLogs,...aT(n)]}},setCellIds:(e,n)=>{if(t4(e.cellIds.inOrderIds,n.cellIds))return e;let i={...e.cellData},o={...e.cellRuntime},s={...e.cellHandles};for(let c of n.cellIds)c in e.cellData||(i[c]=Pr({id:c})),c in e.cellRuntime||(o[c]=Mr()),c in e.cellHandles||(s[c]=(0,jt.createRef)());return{...e,cellIds:Vl.fromWithPreviousShape(n.cellIds,e.cellIds),cellData:i,cellRuntime:o,cellHandles:s}},setCellCodes:(e,n)=>{In(n.codes.length===n.ids.length,"Expected codes and ids to have the same length");let i={...e},o=({cell:s,code:c,cellId:d})=>{if(!s)return Pr({id:d,code:c,lastCodeRun:n.codeIsStale?null:c,edited:n.codeIsStale&&c.trim().length>0});let f=n.codeIsStale?s.lastCodeRun:c,p=f?f.trim()!==c.trim():!!c;if(s.code.trim()===c.trim())return{...s,code:c,edited:p,lastCodeRun:f};if(!Xh()){let y=i.cellHandles[d].current;y!=null&&y.editorViewOrNull&&xo(y.editorViewOrNull,c)}return{...s,code:c,edited:p,lastCodeRun:f}};for(let[s,c]of Tx(n.ids,n.codes))s===void 0||c===void 0||(i={...i,cellData:{...i.cellData,[s]:o({cell:i.cellData[s],code:c,cellId:s})}});return i},setStdinResponse:(e,n)=>{let{cellId:i,response:o,outputIndex:s}=n;return js({state:e,cellId:i,cellReducer:c=>{let d=[...c.consoleOutputs],f=d[s];return f.channel==="stdin"?(d[s]={channel:"stdin",mimetype:f.mimetype,data:f.data,timestamp:f.timestamp,response:o},{...c,interrupted:!1,consoleOutputs:d}):(Ee.warn("Expected stdin output"),c)}})},setCells:(e,n)=>{let i=Object.fromEntries(n.map(s=>[s.id,s])),o=Object.fromEntries(n.map(s=>[s.id,Mr()]));return Pv({...e,cellIds:Vl.fromIdsAndColumns(n.map(s=>[s.id,s.config.column])),cellData:i,cellRuntime:o,cellHandles:Object.fromEntries(n.map(s=>[s.id,(0,jt.createRef)()]))})},moveToNextCell:(e,n)=>{let{cellId:i,before:o,noCreate:s=!1}=n;if(i==="__scratch__")return e;let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i),f=o?d-1:d+1,p=f===c.length,y=f===-1;if(p&&!s){let w=La.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,f),cellData:{...e.cellData,[w]:Pr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Mr()},cellHandles:{...e.cellHandles,[w]:(0,jt.createRef)()},scrollKey:w}}if(y&&!s){let w=La.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,0),cellData:{...e.cellData,[w]:Pr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Mr()},cellHandles:{...e.cellHandles,[w]:(0,jt.createRef)()},scrollKey:w}}if((p||y)&&s)return e;if(f>=0&&f<c.length){let w=c.atOrThrow(f);As({cellId:w,cell:e.cellHandles[w],isCodeHidden:qs(e,w),codeFocus:o?"bottom":"top",variableName:void 0})}return e},markTouched:(e,n)=>{let{cellId:i}=n;if(e.untouchedNewCells.has(i)){let o=new Set(e.untouchedNewCells);return o.delete(i),{...e,untouchedNewCells:o}}return e},scrollToTarget:e=>{let n=e.scrollKey;if(n===null)return e;let i=e.cellIds.findWithId(n),o=i.indexOfOrThrow(n),s=o===i.length-1?i.last():i.atOrThrow(o);return As({cellId:s,cell:e.cellHandles[s],isCodeHidden:qs(e,s),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(Wx(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),unfoldAll:e=>(Ux(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),clearLogs:e=>({...e,cellLogs:[]}),collapseCell:(e,n)=>{let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o.topLevelIds.map(f=>e.cellRuntime[f].outline),c=Sv(o.indexOfOrThrow(i),s);if(!c)return e;let d=o.atOrThrow(c[1]);return{...e,cellIds:e.cellIds.transformWithCellId(i,f=>f.collapse(i,d)),scrollKey:i}},expandCell:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.transformWithCellId(i,o=>o.expand(i)),scrollKey:i}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>{let i=n.topLevelIds.map(p=>e.cellRuntime[p].outline),o=[...n.nodes],s=[],c=[],d=o.length-1;for(;d>=0;){let p=Sv(d,i);if(p){let y=d,w=p[1],_=s.find(T=>T.start<=w&&T.end===w);_&&(w=_.start),s.push({start:y,end:w});let C=n.atOrThrow(y),E=n.atOrThrow(w);c.push({id:C,until:E})}else c.push(null);d--}let f=c.reverse();return n.collapseAll(f)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>n.expandAll())}),showCellIfHidden:(e,n)=>{let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o,c=o.findAndExpandDeep(i);return c.equals(s)?e:{...e,cellIds:e.cellIds.transformWithCellId(i,()=>c)}},splitCell:(e,n)=>{var w;let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o.indexOfOrThrow(i),c=e.cellData[i],d=e.cellHandles[i].current;if((d==null?void 0:d.editorView)==null)return e;let{beforeCursorCode:f,afterCursorCode:p}=H3(d.editorView);xo(d.editorView,f);let y=La.create();return{...e,cellIds:e.cellIds.insertId(y,o.id,s+1),cellData:{...e.cellData,[i]:{...c,code:f,edited:!!f&&f.trim()!==((w=c.lastCodeRun)==null?void 0:w.trim())},[y]:Pr({id:y,code:p,edited:!!p})},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]},[y]:Mr()},cellHandles:{...e.cellHandles,[y]:(0,jt.createRef)()},scrollKey:y}},undoSplitCell:(e,n)=>{var d;let{cellId:i,snapshot:o}=n,s=e.cellData[i],c=e.cellHandles[i].current;return(c==null?void 0:c.editorView)==null?e:(xo(c.editorView,o),{...e,cellIds:e.cellIds.transformWithCellId(i,f=>{let p=f.indexOfOrThrow(i)+1;return f.deleteAtIndex(p)}),cellData:{...e.cellData,[i]:{...s,code:o,edited:!!o&&(o==null?void 0:o.trim())!==((d=s.lastCodeRun)==null?void 0:d.trim())}},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]}},cellHandles:{...e.cellHandles}})},clearCellOutput:(e,n)=>{let{cellId:i}=n;return js({state:e,cellId:i,cellReducer:o=>({...o,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,n)=>{let{cellId:i}=n;return js({state:e,cellId:i,cellReducer:o=>({...o,consoleOutputs:o.consoleOutputs.filter(s=>s.channel==="stdin"&&s.response==null)})})},clearAllCellOutputs:e=>{let n={...e.cellRuntime};for(let i of e.cellIds.inOrderIds)n[i]={...n[i],output:null,consoleOutputs:[]};return{...e,cellRuntime:n}},addSetupCellIfDoesntExist:(e,n)=>{let{code:i}=n;return e.cellIds.setupCellExists()?{...e,scrollKey:yr}:{...e,cellIds:e.cellIds.insertId(yr,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[yr]:Pr({id:yr,name:yr,code:i,edited:!!i})},cellRuntime:{...e.cellRuntime,[yr]:Mr()},cellHandles:{...e.cellHandles,[yr]:(0,jt.createRef)()},scrollKey:yr}}}));function qs(e,n){return!!e.cellData[n].config.hide_code&&!e.untouchedNewCells.has(n)}function js({state:e,cellId:n,cellReducer:i}){return n in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[n]:i(e.cellRuntime[n])}}:(Ee.warn(`Cell ${n} not found in state`),e)}function zs({state:e,cellId:n,cellReducer:i}){return n in e.cellData?{...e,cellData:{...e.cellData,[n]:i(e.cellData[n])}}:(Ee.warn(`Cell ${n} not found in state`),e)}b_=function(e){let n=e.cellData,i={column:null};return e.cellIds.getColumns().length>1?e.cellIds.getColumns().flatMap((o,s)=>o.inOrderIds.map((c,d)=>{let f={...i};return d===0&&(f.column=s),{...n[c].config,...f}})):e.cellIds.getColumns().flatMap(o=>o.inOrderIds.map(s=>({...n[s].config,...i})))},Ju=ze(e=>e(bt).cellIds),p_=ze(e=>e(Ju).hasOnlyOneId()),E_=ze(e=>Nm(e(bt)).length>0),ze(e=>pm(e(bt)).length>0);let Lv;tx=ze(e=>Ek(e(bt))),sx=ze(e=>Sk(e(bt))),rd=ze(e=>{let{cellIds:n,cellRuntime:i,cellData:o}=e(bt);return n.inOrderIds.map(s=>{var f;let c=i[s],{name:d}=o[s];if(Zu((f=c.output)==null?void 0:f.mimetype)){In(Array.isArray(c.output.data),"Expected array data");let p=c.output.data.filter(y=>!y.type.includes("ancestor"));if(p.length>0)return{output:{...c.output,data:p},cellId:s,cellName:d}}return null}).filter(Boolean)}),dx=ze(e=>{let{cellIds:n,cellRuntime:i}=e(bt);return U3(n.inOrderIds.map(o=>i[o].outline))}),X_=ze(e=>e(rd).length),Lv=e4(ze(e=>{let{cellIds:n,cellData:i}=e(bt);return ui.fromEntries(n.inOrderIds.map(o=>{var s;return[o,(s=i[o])==null?void 0:s.name]}))}));var fT=ze(e=>e(bt).scrollKey);Jw=()=>Zn(bt),N_=()=>Zn(Ju),M_=()=>Zn(Lv),qw=()=>Zn(rd),Pw=()=>Zn(bt).cellLogs,Yw=()=>Zn(fT),od=()=>lt.get(bt),K_=()=>{let{cellIds:e,cellData:n}=lt.get(bt);return e.inOrderIds.map(i=>{var o;return(o=n[i])==null?void 0:o.name}).filter(Boolean)};var pT=jx(Lx(bt,e=>e.cellIds.inOrderIds.map(n=>e.cellData[n])));Fw=()=>Y2(pT),$_=ze(e=>e(bt).cellRuntime),g_=ze(e=>xk(e(bt))),e_=ze(e=>kk(e(bt))),Iw=ze(e=>e(bt).cellIds.colLength),R_=ze(e=>e(bt).cellIds.idLength>0),Z_=ze(e=>e(bt).cellIds.getColumnIds()),sd=vd(e=>ze(n=>n(bt).cellData[e]));var wf=vd(e=>ze(n=>n(bt).cellRuntime[e]));const Nv=vd(e=>ze(n=>n(bt).cellHandles[e]));function hT(e){sd.remove(e),wf.remove(e),Nv.remove(e)}t_=e=>{let n=(0,bf.c)(2),i;return n[0]===e?i=n[1]:(i=sd(e),n[0]=e,n[1]=i),Zn(i)},Gw=e=>{let n=(0,bf.c)(2),i;return n[0]===e?i=n[1]:(i=wf(e),n[0]=e,n[1]=i),Zn(i)},Xw=e=>{let n=(0,bf.c)(2),i;return n[0]===e?i=n[1]:(i=Nv(e),n[0]=e,n[1]=i),Zn(i)},Om=()=>{let{cellIds:e,cellHandles:n}=lt.get(bt);return e.inOrderIds.map(i=>{var o,s;return(s=(o=n[i])==null?void 0:o.current)==null?void 0:s.editorViewOrNull}).filter(Boolean)},ed=e=>{var i;let{cellHandles:n}=lt.get(bt);return(i=n[e].current)==null?void 0:i.editorView},A_=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.getColumns().flatMap(s=>s.topLevelIds.map(c=>({...i[c],...o[c]})))},y_=function(e){return ze(n=>n(bt).untouchedNewCells.has(e))};function mT(e){let n=wf(e);return ze(i=>{let o=i(n);if(!o||o.status==="queued"||o.status==="running")return;let s=[],c=o.consoleOutputs;if(c&&c.length>0){let f=c.find(p=>p.mimetype==="application/vnd.marimo+traceback");if(f){let p=f.data;s.push(...Uh(p))}}let d=o.output;if((d==null?void 0:d.mimetype)==="application/vnd.marimo+error"){let f=d.data;if(Array.isArray(f))for(let p of f)p.type==="syntax"&&p.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:p.lineno}),p.type==="import-star"&&p.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:p.lineno})}return s.length>0?s:void 0})}ux=function(){return Mv()}})();export{Ow as $,Lh as $n,qu as $r,ju as $t,Pw as A,zu as An,Il as Ar,Mw as At,Lw as B,Nh as Bn,Da as Br,Nw as Bt,Iw as C,Ih as Cn,Aw as Cr,gr as Ct,qw as D,jw as Dn,bo as Dr,zw as Dt,Fw as E,Fu as En,Bw as Er,Hw as Et,Pr as F,wo as Fn,Oa as Fr,Ah as Ft,qh as G,Cs as Gn,Bu as Gr,Vw as Gt,jh as H,Hu as Hn,$w as Hr,zh as Ht,Mr as I,Fh as In,Ww as Ir,Bh as It,Hh as J,Vh as Jn,Es as Jr,Al as Jt,Uw as K,$h as Kn,Ts as Kr,Kw as Kt,Qw as L,Wh as Ln,Uh as Lr,Kh as Lt,Gw as M,ql as Mn,jl as Mr,fi as Mt,Jw as N,Qh as Nn,Vu as Nr,$u as Nt,Xw as O,Pa as On,Wu as Or,Gh as Ot,Yw as P,Jh as Pn,zl as Pr,Uu as Pt,Xh as Q,Yh as Qn,Fl as Qr,Zh as Qt,Zw as R,em as Rn,tm as Rr,Bl as Rt,e_ as S,Ku as Sn,nm as Sr,Hl as St,t_ as T,n_ as Tn,Qu as Tr,r_ as Tt,i_ as U,rm as Un,im as Ur,a_ as Ut,o_ as V,_o as Vn,Vl as Vr,am as Vt,om as W,Gu as Wn,s_ as Wr,l_ as Wt,c_ as X,sm as Xn,u_ as Xr,d_ as Xt,lm as Y,cm as Yn,$n as Yr,f_ as Yt,um as Z,dm as Zn,$l as Zr,fm as Zt,p_ as _,HD as __tla,Wl as _n,Pt as _r,h_ as _t,Ju as a,er as ai,Xu as an,m_ as ar,xo as at,g_ as b,Ma as bn,pm as br,hm as bt,y_ as c,Yu as ci,mm as cn,v_ as cr,Lr as ct,b_ as d,w_ as di,Ul as dn,__ as dr,gm as dt,x_ as ei,k_ as en,ym as er,Zu as et,ed as f,S_ as fi,C_ as fn,Kl as fr,vm as ft,E_ as g,T_ as gn,ko as gr,td as gt,R_ as h,nd as hi,Ql as hn,$i as hr,D_ as ht,rd as i,O_ as ii,id as in,P_ as ir,Xr as it,M_ as j,L_ as jn,Gl as jr,ad as jt,N_ as k,I_ as kn,bm as kr,wm as kt,A_ as l,q_ as li,j_ as ln,z_ as lr,F_ as lt,od as m,_m as mi,B_ as mn,H_ as mr,xm as mt,sd as n,km as ni,V_ as nn,ld as nr,Sm as nt,$_ as o,Rs as oi,Cm as on,W_ as or,U_ as ot,K_ as p,Em as pi,Q_ as pn,G_ as pr,Tm as pt,cd as q,Rm as qn,J_ as qr,Wi as qt,X_ as r,La as ri,Y_ as rn,So as rr,Dm as rt,Z_ as s,yr as si,ud as sn,dd as sr,ex as st,tx as t,nx as ti,fd as tn,rx as tr,ix as tt,Om as u,Pm as ui,ax as un,ox as ur,pd as ut,sx as v,lx as vn,Ui as vr,cx as vt,ux as w,Jl as wn,Mm as wr,hd as wt,dx as x,fx as xn,px as xr,Lm as xt,bt as y,hx as yn,Nm as yr,mx as yt,Im as z,Am as zn,qm as zr,Xl as zt};
253
+ `)}catch(n){return Se.error("Error parsing HTML content:",n),e}},Uw=function(e){if(!e)return"";try{return cd(iT.ansi_to_html(e))}catch(n){return Se.error("Error converting ANSI to plain text:",n),e}},qh={startCase:e=>{if(!e)return"";if(typeof e!="string")throw Se.error(e),TypeError(`Expected string, got ${typeof e}`);return/[A-Za-z]/.test(e)?g4(e):e},htmlEscape:e=>e&&e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;").replaceAll(`
254
+ `," "),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 Dv=!1;function aT(e){var o;let n=[],i=[e.console].filter(Boolean).flat();for(let s of i){let c=s.mimetype==="text/plain",d=s.mimetype==="text/html"||s.mimetype==="application/vnd.marimo+traceback";if(c||d){let f=s.channel==="stderr"||s.channel==="marimo-error";switch(s.channel){case"stdout":case"stderr":case"marimo-error":{let p=qh.asString(s.data),y=d?cd(p):p;n.push({timestamp:s.timestamp||Date.now(),level:f?"stderr":"stdout",message:y,cellId:e.cell_id});break}default:break}}}if(n.forEach(Ov.log),i.length===0&&Zu((o=e.output)==null?void 0:o.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(c=>{Ov.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");!Dv&&s&&(Dv=!0,Ll({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 Ov={log:e=>{let n=e.level==="stdout"?"gray":e.level==="stderr"?"red":"orange",i=e.level.toUpperCase();console.log(`%c[${i}]`,`color:${n}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${om(e.timestamp)}]`,`(${e.cellId}) ${e.message}`)}};om=function(e){try{return Z3(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},o_=function(e,n){let i=ed(n);i?i.focus():Se.warn(`[CellFocusManager] focusCellEditor: element not found: ${n}`)},Lw=function(e){let n=document.getElementById(er.create(e));n?vf(n):Se.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},i_=function(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})},jh=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function vf(e){try{e.focus()}catch{Se.warn("[CellFocusManager] element may not be focusable",e)}}Im=function(e,n){let{retries:i,delay:o,initialDelay:s=0}=n,c=0,d=()=>{if(c<i){try{if(e())return}catch(f){Se.error(`Error executing function on attempt ${c+1}, retrying`,{error:f})}c++,setTimeout(d,o)}};s>0?setTimeout(d,s):d()};function Is({cellId:e,cell:n,isCodeHidden:i,codeFocus:o,variableName:s}){var d;if(!n)return;let c=document.getElementById(er.create(e));if(!c){Se.warn("scrollCellIntoView: element not found");return}if(jh()){vf(c);return}if(i)vf(c);else{let f=(d=n.current)==null?void 0:d.editorView;if(!f){Se.warn("scrollCellIntoView: editor not found",e);return}if(f.hasFocus||!document.hasFocus())return;if(Im(()=>(f.focus(),f.hasFocus),{retries:5,delay:20}),o==="top")f.dispatch({selection:{anchor:0,head:0}});else if(o==="bottom"){let p=f.state.doc.line(f.state.doc.lines);f.dispatch({selection:{anchor:p.from,head:p.from}})}else s&&ju(f,s)}c.scrollIntoView({behavior:"smooth",block:"nearest"})}Qw=function(e){let n=document.getElementById(er.create(e));if(!n){Se.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 oT(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function sT(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}Zw=function(e){let n=ed(e);if(n!=null&&n.hasFocus){iy(n,{behavior:"instant"});return}let i=document.getElementById(er.create(e));i?i.scrollIntoView({behavior:"instant",block:"nearest"}):Se.warn(`[CellFocusManager] scrollCellIntoView: element not found: ${e}`)},Pr=function({id:e,name:n="_",code:i="",lastCodeRun:o=null,lastExecutionTime:s=null,edited:c=!1,config:d,serializedEditorState:f=null}){return{id:e,config:d||{hide_code:!1,disabled:!1,column:null},name:n,code:i,edited:c,lastCodeRun:o,lastExecutionTime:s,serializedEditorState:f}};function lT(e){return{hide_code:!1,disabled:!1,column:null,...e}}Mr=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 bf=Jr();function Pv(e){let n={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[Rs]:Pr({id:Rs,config:n}),...e.cellData},cellRuntime:{[Rs]:Mr(),...e.cellRuntime},cellHandles:{[Rs]:(0,jt.createRef)(),...e.cellHandles}}}function cT(){return Pv({cellIds:Hl.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let uT,dT,Mv;({reducer:uT,createActions:dT,useActions:Mv,valueAtom:bt}=Ml(cT,{createNewCell:(e,n)=>{var T;let{cellId:i,before:o,code:s,lastCodeRun:c=null,lastExecutionTime:d=null,autoFocus:f=!0,skipIfCodeExists:p=!1,hideCode:y=!1}=n,w,_;if(p){for(let I of e.cellIds.inOrderIds)if(((T=e.cellData[I])==null?void 0:T.code)===s)return e}if(i==="__end__"){let I=e.cellIds.atOrThrow(0);w=I.id,_=I.length}else if(typeof i=="string"){let I=e.cellIds.findWithId(i);w=I.id,_=I.topLevelIds.indexOf(i)}else if(i.type==="__end__"){let I=e.cellIds.get(i.columnId)||e.cellIds.atOrThrow(0);w=I.id,_=I.length}else throw Error("Invalid cellId");let C=n.newCellId||La.create(),E=o?_:_+1;return{...e,cellIds:e.cellIds.insertId(C,w,E),cellData:{...e.cellData,[C]:Pr({id:C,code:s,lastCodeRun:c,config:lT({hide_code:y}),lastExecutionTime:d,edited:!!s&&s!==c})},cellRuntime:{...e.cellRuntime,[C]:Mr()},cellHandles:{...e.cellHandles,[C]:(0,jt.createRef)()},scrollKey:f?C:null,untouchedNewCells:y?new Set([...e.untouchedNewCells,C]):e.untouchedNewCells}},moveCell:(e,n)=>{let{cellId:i,before:o,direction:s}=n;if(o!==void 0&&s!==void 0&&Se.warn("Both before and direction specified for moveCell. Ignoring one."),s){let f=e.cellIds.findWithId(i),p=e.cellIds.indexOf(f),y=s==="left"?p-1:p+1,w=e.cellIds.at(y);return w?{...e,cellIds:e.cellIds.moveAcrossColumns(f.id,i,w.id,void 0),scrollKey:i}:e}let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i);return o&&d===0?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,0),scrollKey:i}:!o&&d===c.length-1?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,c.length-1),scrollKey:i}:o?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d-1),scrollKey:i}:{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d+1),scrollKey:i}},dropCellOverCell:(e,n)=>{let{cellId:i,overCellId:o}=n,s=e.cellIds.findWithId(i),c=e.cellIds.findWithId(o),d=s.indexOfOrThrow(i),f=c.indexOfOrThrow(o);return s.id===c.id?d===f?e:{...e,cellIds:e.cellIds.moveWithinColumn(s.id,d,f),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,c.id,o),scrollKey:null}},dropCellOverColumn:(e,n)=>{let{cellId:i,columnId:o}=n,s=e.cellIds.findWithId(i);return{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,o,void 0)}},dropOverNewColumn:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.moveToNewColumn(i)}},moveColumn:(e,n)=>n.column===n.overColumn?e:{...e,cellIds:e.cellIds.moveColumn(n.column,n.overColumn)},focusCell:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,where:s}=n,c=i.indexOfOrThrow(o),d;d=s==="before"?Sh(c-1,0,i.length-1):s==="after"?Sh(c+1,0,i.length-1):c;let f=i.atOrThrow(d);return Is({cellId:f,cell:e.cellHandles[f],isCodeHidden:As(e,f),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 i=n.first();return Is({cellId:i,cell:e.cellHandles[i],isCodeHidden:As(e,i),codeFocus:void 0,variableName:void 0}),sT(),e},focusBottomCell:e=>{let n=e.cellIds.getColumns().at(-1);if(n===void 0||n.length===0)return e;let i=n.last();return Is({cellId:i,cell:e.cellHandles[i],isCodeHidden:As(e,i),codeFocus:void 0,variableName:void 0}),oT(),e},sendToTop:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=i.indexOfOrThrow(o);return c===0?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,0),scrollKey:s?o:null}},sendToBottom:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=i.indexOfOrThrow(o),d=i.length-1;return c===d?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,d),scrollKey:s?o:null}},addColumn:(e,n)=>{let i=La.create();return{...e,cellIds:e.cellIds.addColumn(n.columnId,[i]),cellData:{...e.cellData,[i]:Pr({id:i})},cellRuntime:{...e.cellRuntime,[i]:Mr()},cellHandles:{...e.cellHandles,[i]:(0,jt.createRef)()},scrollKey:i}},addColumnBreakpoint:(e,n)=>{let{cellId:i}=n;return e.cellIds.getColumns()[0].inOrderIds[0]===i?e:{...e,cellIds:e.cellIds.insertBreakpoint(i)}},deleteColumn:(e,n)=>{let{columnId:i}=n;return{...e,cellIds:e.cellIds.delete(i)}},mergeAllColumns:e=>({...e,cellIds:e.cellIds.mergeAllColumns()}),compactColumns:e=>({...e,cellIds:e.cellIds.compact()}),deleteCell:(e,n)=>{var p,y;let i=n.cellId;if(e.cellIds.hasOnlyOneId())return e;let o=e.cellIds.findWithId(i),s=o.indexOfOrThrow(i),c=s===0?1:s-1,d=null;o.length>1&&(d=o.atOrThrow(c));let f=(y=(p=e.cellHandles[i].current)==null?void 0:p.editorView)==null?void 0:y.state.toJSON({history:tD});return f.doc=e.cellData[i].code,hT(i),{...e,cellIds:e.cellIds.deleteById(i),history:[...e.history,{name:e.cellData[i].name,serializedEditorState:f,column:o.id,index:s,isSetupCell:i===yr}],scrollKey:d}},undoDeleteCell:e=>{if(e.history.length===0)return e;let{name:n,serializedEditorState:i={doc:""},column:o,index:s,isSetupCell:c}=e.history[e.history.length-1],d=c?yr:La.create(),f=Pr({id:d,name:n,code:i.doc,edited:i.doc.trim().length>0,serializedEditorState:i});return{...e,cellIds:e.cellIds.insertId(d,o,s),cellData:{...e.cellData,[d]:f},cellRuntime:{...e.cellRuntime,[d]:Mr()},cellHandles:{...e.cellHandles,[d]:(0,jt.createRef)()},history:e.history.slice(0,-1),scrollKey:d}},clearSerializedEditorState:(e,n)=>{let{cellId:i}=n;return js({state:e,cellId:i,cellReducer:o=>({...o,serializedEditorState:null})})},updateCellCode:(e,n)=>{let{cellId:i,code:o,formattingChange:s}=n;return e.cellData[i]?js({state:e,cellId:i,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:i,name:o}=n;return js({state:e,cellId:i,cellReducer:s=>({...s,name:o})})},updateCellConfig:(e,n)=>{let{cellId:i,config:o}=n;return js({state:e,cellId:i,cellReducer:s=>({...s,config:{...s.config,...o}})})},prepareForRun:(e,n)=>js({state:qs({state:e,cellId:n.cellId,cellReducer:i=>Y3(i)}),cellId:n.cellId,cellReducer:i=>({...i,edited:!1,lastCodeRun:i.code.trim()})}),handleCellMessage:(e,n)=>{let i=n.cell_id,o=qs({state:e,cellId:i,cellReducer:s=>X3(s,n)});return{...o,cellLogs:[...o.cellLogs,...aT(n)]}},setCellIds:(e,n)=>{if(t4(e.cellIds.inOrderIds,n.cellIds))return e;let i={...e.cellData},o={...e.cellRuntime},s={...e.cellHandles};for(let c of n.cellIds)c in e.cellData||(i[c]=Pr({id:c})),c in e.cellRuntime||(o[c]=Mr()),c in e.cellHandles||(s[c]=(0,jt.createRef)());return{...e,cellIds:Hl.fromWithPreviousShape(n.cellIds,e.cellIds),cellData:i,cellRuntime:o,cellHandles:s}},setCellCodes:(e,n)=>{In(n.codes.length===n.ids.length,"Expected codes and ids to have the same length");let i={...e},o=({cell:s,code:c,cellId:d})=>{if(!s)return Pr({id:d,code:c,lastCodeRun:n.codeIsStale?null:c,edited:n.codeIsStale&&c.trim().length>0});let f=n.codeIsStale?s.lastCodeRun:c,p=f?f.trim()!==c.trim():!!c;if(s.code.trim()===c.trim())return{...s,code:c,edited:p,lastCodeRun:f};if(!Xh()){let y=i.cellHandles[d].current;y!=null&&y.editorViewOrNull&&xo(y.editorViewOrNull,c)}return{...s,code:c,edited:p,lastCodeRun:f}};for(let[s,c]of Tx(n.ids,n.codes))s===void 0||c===void 0||(i={...i,cellData:{...i.cellData,[s]:o({cell:i.cellData[s],code:c,cellId:s})}});return i},setStdinResponse:(e,n)=>{let{cellId:i,response:o,outputIndex:s}=n;return qs({state:e,cellId:i,cellReducer:c=>{let d=[...c.consoleOutputs],f=d[s];return f.channel==="stdin"?(d[s]={channel:"stdin",mimetype:f.mimetype,data:f.data,timestamp:f.timestamp,response:o},{...c,interrupted:!1,consoleOutputs:d}):(Se.warn("Expected stdin output"),c)}})},setCells:(e,n)=>{let i=Object.fromEntries(n.map(s=>[s.id,s])),o=Object.fromEntries(n.map(s=>[s.id,Mr()]));return Pv({...e,cellIds:Hl.fromIdsAndColumns(n.map(s=>[s.id,s.config.column])),cellData:i,cellRuntime:o,cellHandles:Object.fromEntries(n.map(s=>[s.id,(0,jt.createRef)()]))})},moveToNextCell:(e,n)=>{let{cellId:i,before:o,noCreate:s=!1}=n;if(i==="__scratch__")return e;let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i),f=o?d-1:d+1,p=f===c.length,y=f===-1;if(p&&!s){let w=La.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,f),cellData:{...e.cellData,[w]:Pr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Mr()},cellHandles:{...e.cellHandles,[w]:(0,jt.createRef)()},scrollKey:w}}if(y&&!s){let w=La.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,0),cellData:{...e.cellData,[w]:Pr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Mr()},cellHandles:{...e.cellHandles,[w]:(0,jt.createRef)()},scrollKey:w}}if((p||y)&&s)return e;if(f>=0&&f<c.length){let w=c.atOrThrow(f);Is({cellId:w,cell:e.cellHandles[w],isCodeHidden:As(e,w),codeFocus:o?"bottom":"top",variableName:void 0})}return e},markTouched:(e,n)=>{let{cellId:i}=n;if(e.untouchedNewCells.has(i)){let o=new Set(e.untouchedNewCells);return o.delete(i),{...e,untouchedNewCells:o}}return e},scrollToTarget:e=>{let n=e.scrollKey;if(n===null)return e;let i=e.cellIds.findWithId(n),o=i.indexOfOrThrow(n),s=o===i.length-1?i.last():i.atOrThrow(o);return Is({cellId:s,cell:e.cellHandles[s],isCodeHidden:As(e,s),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(Wx(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),unfoldAll:e=>(Ux(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),clearLogs:e=>({...e,cellLogs:[]}),collapseCell:(e,n)=>{let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o.topLevelIds.map(f=>e.cellRuntime[f].outline),c=Sv(o.indexOfOrThrow(i),s);if(!c)return e;let d=o.atOrThrow(c[1]);return{...e,cellIds:e.cellIds.transformWithCellId(i,f=>f.collapse(i,d)),scrollKey:i}},expandCell:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.transformWithCellId(i,o=>o.expand(i)),scrollKey:i}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>{let i=n.topLevelIds.map(p=>e.cellRuntime[p].outline),o=[...n.nodes],s=[],c=[],d=o.length-1;for(;d>=0;){let p=Sv(d,i);if(p){let y=d,w=p[1],_=s.find(T=>T.start<=w&&T.end===w);_&&(w=_.start),s.push({start:y,end:w});let C=n.atOrThrow(y),E=n.atOrThrow(w);c.push({id:C,until:E})}else c.push(null);d--}let f=c.reverse();return n.collapseAll(f)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>n.expandAll())}),showCellIfHidden:(e,n)=>{let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o,c=o.findAndExpandDeep(i);return c.equals(s)?e:{...e,cellIds:e.cellIds.transformWithCellId(i,()=>c)}},splitCell:(e,n)=>{var w;let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o.indexOfOrThrow(i),c=e.cellData[i],d=e.cellHandles[i].current;if((d==null?void 0:d.editorView)==null)return e;let{beforeCursorCode:f,afterCursorCode:p}=H3(d.editorView);xo(d.editorView,f);let y=La.create();return{...e,cellIds:e.cellIds.insertId(y,o.id,s+1),cellData:{...e.cellData,[i]:{...c,code:f,edited:!!f&&f.trim()!==((w=c.lastCodeRun)==null?void 0:w.trim())},[y]:Pr({id:y,code:p,edited:!!p})},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]},[y]:Mr()},cellHandles:{...e.cellHandles,[y]:(0,jt.createRef)()},scrollKey:y}},undoSplitCell:(e,n)=>{var d;let{cellId:i,snapshot:o}=n,s=e.cellData[i],c=e.cellHandles[i].current;return(c==null?void 0:c.editorView)==null?e:(xo(c.editorView,o),{...e,cellIds:e.cellIds.transformWithCellId(i,f=>{let p=f.indexOfOrThrow(i)+1;return f.deleteAtIndex(p)}),cellData:{...e.cellData,[i]:{...s,code:o,edited:!!o&&(o==null?void 0:o.trim())!==((d=s.lastCodeRun)==null?void 0:d.trim())}},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]}},cellHandles:{...e.cellHandles}})},clearCellOutput:(e,n)=>{let{cellId:i}=n;return qs({state:e,cellId:i,cellReducer:o=>({...o,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,n)=>{let{cellId:i}=n;return qs({state:e,cellId:i,cellReducer:o=>({...o,consoleOutputs:o.consoleOutputs.filter(s=>s.channel==="stdin"&&s.response==null)})})},clearAllCellOutputs:e=>{let n={...e.cellRuntime};for(let i of e.cellIds.inOrderIds)n[i]={...n[i],output:null,consoleOutputs:[]};return{...e,cellRuntime:n}},addSetupCellIfDoesntExist:(e,n)=>{let{code:i}=n;return e.cellIds.setupCellExists()?{...e,scrollKey:yr}:{...e,cellIds:e.cellIds.insertId(yr,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[yr]:Pr({id:yr,name:yr,code:i,edited:!!i})},cellRuntime:{...e.cellRuntime,[yr]:Mr()},cellHandles:{...e.cellHandles,[yr]:(0,jt.createRef)()},scrollKey:yr}}}));function As(e,n){return!!e.cellData[n].config.hide_code&&!e.untouchedNewCells.has(n)}function qs({state:e,cellId:n,cellReducer:i}){return n in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[n]:i(e.cellRuntime[n])}}:(Se.warn(`Cell ${n} not found in state`),e)}function js({state:e,cellId:n,cellReducer:i}){return n in e.cellData?{...e,cellData:{...e.cellData,[n]:i(e.cellData[n])}}:(Se.warn(`Cell ${n} not found in state`),e)}b_=function(e){let n=e.cellData,i={column:null};return e.cellIds.getColumns().length>1?e.cellIds.getColumns().flatMap((o,s)=>o.inOrderIds.map((c,d)=>{let f={...i};return d===0&&(f.column=s),{...n[c].config,...f}})):e.cellIds.getColumns().flatMap(o=>o.inOrderIds.map(s=>({...n[s].config,...i})))},Ju=ze(e=>e(bt).cellIds),p_=ze(e=>e(Ju).hasOnlyOneId()),E_=ze(e=>Nm(e(bt)).length>0),ze(e=>pm(e(bt)).length>0);let Lv;tx=ze(e=>Ek(e(bt))),sx=ze(e=>Sk(e(bt))),rd=ze(e=>{let{cellIds:n,cellRuntime:i,cellData:o}=e(bt);return n.inOrderIds.map(s=>{var f;let c=i[s],{name:d}=o[s];if(Zu((f=c.output)==null?void 0:f.mimetype)){In(Array.isArray(c.output.data),"Expected array data");let p=c.output.data.filter(y=>!y.type.includes("ancestor"));if(p.length>0)return{output:{...c.output,data:p},cellId:s,cellName:d}}return null}).filter(Boolean)}),dx=ze(e=>{let{cellIds:n,cellRuntime:i}=e(bt);return U3(n.inOrderIds.map(o=>i[o].outline))}),X_=ze(e=>e(rd).length),Lv=e4(ze(e=>{let{cellIds:n,cellData:i}=e(bt);return ui.fromEntries(n.inOrderIds.map(o=>{var s;return[o,(s=i[o])==null?void 0:s.name]}))}));var fT=ze(e=>e(bt).scrollKey);Jw=()=>Zn(bt),N_=()=>Zn(Ju),M_=()=>Zn(Lv),qw=()=>Zn(rd),Pw=()=>Zn(bt).cellLogs,Yw=()=>Zn(fT),od=()=>lt.get(bt),K_=()=>{let{cellIds:e,cellData:n}=lt.get(bt);return e.inOrderIds.map(i=>{var o;return(o=n[i])==null?void 0:o.name}).filter(Boolean)};var pT=jx(Lx(bt,e=>e.cellIds.inOrderIds.map(n=>e.cellData[n])));Fw=()=>Y2(pT),$_=ze(e=>e(bt).cellRuntime),g_=ze(e=>xk(e(bt))),e_=ze(e=>kk(e(bt))),Iw=ze(e=>e(bt).cellIds.colLength),R_=ze(e=>e(bt).cellIds.idLength>0),Z_=ze(e=>e(bt).cellIds.getColumnIds()),sd=vd(e=>ze(n=>n(bt).cellData[e]));var wf=vd(e=>ze(n=>n(bt).cellRuntime[e]));const Nv=vd(e=>ze(n=>n(bt).cellHandles[e]));function hT(e){sd.remove(e),wf.remove(e),Nv.remove(e)}t_=e=>{let n=(0,bf.c)(2),i;return n[0]===e?i=n[1]:(i=sd(e),n[0]=e,n[1]=i),Zn(i)},Gw=e=>{let n=(0,bf.c)(2),i;return n[0]===e?i=n[1]:(i=wf(e),n[0]=e,n[1]=i),Zn(i)},Xw=e=>{let n=(0,bf.c)(2),i;return n[0]===e?i=n[1]:(i=Nv(e),n[0]=e,n[1]=i),Zn(i)},Om=()=>{let{cellIds:e,cellHandles:n}=lt.get(bt);return e.inOrderIds.map(i=>{var o,s;return(s=(o=n[i])==null?void 0:o.current)==null?void 0:s.editorViewOrNull}).filter(Boolean)},ed=e=>{var i;let{cellHandles:n}=lt.get(bt);return(i=n[e].current)==null?void 0:i.editorView},A_=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.getColumns().flatMap(s=>s.topLevelIds.map(c=>({...i[c],...o[c]})))},y_=function(e){return ze(n=>n(bt).untouchedNewCells.has(e))};function mT(e){let n=wf(e);return ze(i=>{let o=i(n);if(!o||o.status==="queued"||o.status==="running")return;let s=[],c=o.consoleOutputs;if(c&&c.length>0){let f=c.find(p=>p.mimetype==="application/vnd.marimo+traceback");if(f){let p=f.data;s.push(...Uh(p))}}let d=o.output;if((d==null?void 0:d.mimetype)==="application/vnd.marimo+error"){let f=d.data;if(Array.isArray(f))for(let p of f)p.type==="syntax"&&p.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:p.lineno}),p.type==="import-star"&&p.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:p.lineno})}return s.length>0?s:void 0})}ux=function(){return Mv()}})();export{Ow as $,Lh as $n,qu as $r,ju as $t,Pw as A,zu as An,Nl as Ar,Mw as At,Lw as B,Nh as Bn,Da as Br,Nw as Bt,Iw as C,Ih as Cn,Aw as Cr,gr as Ct,qw as D,jw as Dn,bo as Dr,zw as Dt,Fw as E,Fu as En,Bw as Er,Hw as Et,Pr as F,wo as Fn,Oa as Fr,Ah as Ft,qh as G,Cs as Gn,Bu as Gr,Vw as Gt,jh as H,Hu as Hn,$w as Hr,zh as Ht,Mr as I,Fh as In,Ww as Ir,Bh as It,Hh as J,Vh as Jn,Es as Jr,Il as Jt,Uw as K,$h as Kn,Ts as Kr,Kw as Kt,Qw as L,Wh as Ln,Uh as Lr,Kh as Lt,Gw as M,Al as Mn,ql as Mr,fi as Mt,Jw as N,Qh as Nn,Vu as Nr,$u as Nt,Xw as O,Pa as On,Wu as Or,Gh as Ot,Yw as P,Jh as Pn,jl as Pr,Uu as Pt,Xh as Q,Yh as Qn,zl as Qr,Zh as Qt,Zw as R,em as Rn,tm as Rr,Fl as Rt,e_ as S,Ku as Sn,nm as Sr,Bl as St,t_ as T,n_ as Tn,Qu as Tr,r_ as Tt,i_ as U,rm as Un,im as Ur,a_ as Ut,o_ as V,_o as Vn,Hl as Vr,am as Vt,om as W,Gu as Wn,s_ as Wr,l_ as Wt,c_ as X,sm as Xn,u_ as Xr,d_ as Xt,lm as Y,cm as Yn,Wn as Yr,f_ as Yt,um as Z,dm as Zn,Vl as Zr,fm as Zt,p_ as _,HD as __tla,$l as _n,Pt as _r,h_ as _t,Ju as a,er as ai,Xu as an,m_ as ar,xo as at,g_ as b,Ma as bn,pm as br,hm as bt,y_ as c,Yu as ci,mm as cn,v_ as cr,Lr as ct,b_ as d,w_ as di,Wl as dn,__ as dr,gm as dt,x_ as ei,k_ as en,ym as er,Zu as et,ed as f,S_ as fi,C_ as fn,Ul as fr,vm as ft,E_ as g,T_ as gn,ko as gr,td as gt,R_ as h,nd as hi,Kl as hn,$i as hr,D_ as ht,rd as i,O_ as ii,id as in,P_ as ir,Xr as it,M_ as j,L_ as jn,Ql as jr,ad as jt,N_ as k,I_ as kn,bm as kr,wm as kt,A_ as l,q_ as li,j_ as ln,z_ as lr,F_ as lt,od as m,_m as mi,B_ as mn,H_ as mr,xm as mt,sd as n,km as ni,V_ as nn,ld as nr,Sm as nt,$_ as o,Rs as oi,Cm as on,W_ as or,U_ as ot,K_ as p,Em as pi,Q_ as pn,G_ as pr,Tm as pt,cd as q,Rm as qn,J_ as qr,Wi as qt,X_ as r,La as ri,Y_ as rn,So as rr,Dm as rt,Z_ as s,yr as si,ud as sn,dd as sr,ex as st,tx as t,nx as ti,fd as tn,rx as tr,ix as tt,Om as u,Pm as ui,ax as un,ox as ur,pd as ut,sx as v,lx as vn,Ui as vr,cx as vt,ux as w,Gl as wn,Mm as wr,hd as wt,dx as x,fx as xn,px as xr,Lm as xt,bt as y,hx as yn,Nm as yr,mx as yt,Im as z,Am as zn,qm as zr,Jl as zt};