@marimo-team/frontend 0.18.5-dev186 → 0.18.5-dev187

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 (75) hide show
  1. package/dist/assets/{CellStatus-DqLx71xI.js → CellStatus-Bo1x1B6n.js} +1 -1
  2. package/dist/assets/{JsonOutput-3u2O9mUd.js → JsonOutput-BCHaEg3R.js} +1 -1
  3. package/dist/assets/MarimoErrorOutput-BIIhR96K.js +7 -0
  4. package/dist/assets/{RenderHTML-Dp8s4Bzr.js → RenderHTML-BUhX0rkG.js} +1 -1
  5. package/dist/assets/{add-cell-with-ai-DTIq0l6h.js → add-cell-with-ai-CLrEdPGH.js} +1 -1
  6. package/dist/assets/{add-database-form-C20ZnUUx.js → add-database-form-DkSxzOXk.js} +1 -1
  7. package/dist/assets/{agent-panel-D08HI0-X.js → agent-panel-Bz7HLWO3.js} +2 -2
  8. package/dist/assets/{ai-model-dropdown-CK5sei5N.js → ai-model-dropdown-ea-cOLAL.js} +1 -1
  9. package/dist/assets/{app-config-button-Ce5Tkr5O.js → app-config-button-BFjdAlTt.js} +1 -1
  10. package/dist/assets/{cell-link-B7EjqLUL.js → cell-link-DNVmmRzI.js} +1 -1
  11. package/dist/assets/{cells-BLhvmrVl.js → cells-Dk_j8HX9.js} +50 -50
  12. package/dist/assets/{chat-components-DHkUyXWV.js → chat-components-BMWBGknq.js} +1 -1
  13. package/dist/assets/{chat-display-DZMIiHZy.js → chat-display-CEYX5MXY.js} +1 -1
  14. package/dist/assets/{chat-panel-Bm-_lPiR.js → chat-panel-DmUjYxAt.js} +1 -1
  15. package/dist/assets/{client-hHcgVFo7.js → client-D08Rbi3p.js} +1 -1
  16. package/dist/assets/{column-preview-B1AyyIgE.js → column-preview-Cqovvoyb.js} +1 -1
  17. package/dist/assets/{command-CDWT71Ts.js → command-gUA-HncX.js} +1 -1
  18. package/dist/assets/{command-palette-BcPZK2Wg.js → command-palette-Dt43cGFk.js} +1 -1
  19. package/dist/assets/{common-4ZdFNk6L.js → common-BWR26KIv.js} +1 -1
  20. package/dist/assets/{datasource-DNy_uzDr.js → datasource-i415crE1.js} +1 -1
  21. package/dist/assets/{dependency-graph-panel-B6oPfRTp.js → dependency-graph-panel-BwaKuCE7.js} +1 -1
  22. package/dist/assets/{documentation-panel-BRHbbFlV.js → documentation-panel-C4aTmugE.js} +1 -1
  23. package/dist/assets/{download-DPiYP-j0.js → download-Dsuja3On.js} +1 -1
  24. package/dist/assets/edit-page-sCQCmucY.js +12 -0
  25. package/dist/assets/{error-panel-qGIXpWqc.js → error-panel-DCozbyWc.js} +1 -1
  26. package/dist/assets/{es-CR1H2K7u.js → es-DjCjT1hB.js} +1 -1
  27. package/dist/assets/{file-explorer-panel-DdOLBo1H.js → file-explorer-panel-BvRpCXWv.js} +1 -1
  28. package/dist/assets/{floating-outline-foC3RCPc.js → floating-outline-DYdnwTX9.js} +1 -1
  29. package/dist/assets/{focus-CgHW_IRL.js → focus-U1ePwk4d.js} +1 -1
  30. package/dist/assets/{form-NWifpNWT.js → form-D8BW7hlS.js} +1 -1
  31. package/dist/assets/{globals-CiRTn5Vt.js → globals-BBskDqJi.js} +1 -1
  32. package/dist/assets/{home-page-WElJkZm5.js → home-page-c43aYnLs.js} +1 -1
  33. package/dist/assets/{index-CBtg35hI.js → index-DuCNx6yI.js} +3 -3
  34. package/dist/assets/{kiosk-mode-vS4t3di8.js → kiosk-mode-C23fjW_G.js} +1 -1
  35. package/dist/assets/{layout-D1qNIXxE.js → layout-DenYhPfS.js} +1 -1
  36. package/dist/assets/{logs-panel-BUqhCH8r.js → logs-panel-CmImbuAp.js} +1 -1
  37. package/dist/assets/{markdown-renderer-DgV_KnEf.js → markdown-renderer-COkLQ1b5.js} +1 -1
  38. package/dist/assets/{mode-BeOhz3YE.js → mode-BOijHAOc.js} +1 -1
  39. package/dist/assets/{name-cell-input-lVGcUDBb.js → name-cell-input-Cf2CUXDm.js} +1 -1
  40. package/dist/assets/{outline-panel-DHLUaY4X.js → outline-panel-CdaUT0TE.js} +1 -1
  41. package/dist/assets/{packages-panel-DhVyvWkj.js → packages-panel-CghFsvM0.js} +1 -1
  42. package/dist/assets/{panel-context-B3nGD1_W.js → panel-context-DUUPei-R.js} +1 -1
  43. package/dist/assets/{panels-BMfGXS7h.js → panels-CymS0QU-.js} +1 -1
  44. package/dist/assets/{process-output-C2mignv4.js → process-output-BAfpcew-.js} +1 -1
  45. package/dist/assets/{readonly-python-code-C3URGhHv.js → readonly-python-code-B8gfuyX1.js} +1 -1
  46. package/dist/assets/{run-page-BqTaOWHL.js → run-page-rr9Ilre7.js} +1 -1
  47. package/dist/assets/{scratchpad-panel-5FCgSkW8.js → scratchpad-panel-fzQUjA3o.js} +1 -1
  48. package/dist/assets/{session-panel-6od-_OeM.js → session-panel-BsMBi24k.js} +1 -1
  49. package/dist/assets/{snippets-panel-CAAC62vz.js → snippets-panel-DW6lWuPh.js} +1 -1
  50. package/dist/assets/{state-CGIjjAWG.js → state-DWEWL_KV.js} +1 -1
  51. package/dist/assets/{state-CoslvOiH.js → state-HUtu_wpA.js} +1 -1
  52. package/dist/assets/{switch-BLEwkiUl.js → switch-Cd5iA-KH.js} +1 -1
  53. package/dist/assets/{textarea-S24k5l8r.js → textarea-jTWtOsHe.js} +1 -1
  54. package/dist/assets/{tracing-Cl31yJ-W.js → tracing-CDJRdFd4.js} +1 -1
  55. package/dist/assets/{tracing-panel-Cw103_Tm.js → tracing-panel-BrBmQCJr.js} +2 -2
  56. package/dist/assets/{types-DiksLxkJ.js → types-CiMSegk1.js} +1 -1
  57. package/dist/assets/{useAddCell-DGhb_PpU.js → useAddCell-FisWjOQO.js} +1 -1
  58. package/dist/assets/{useCellActionButton-COxDEyF8.js → useCellActionButton-DLwn_yx9.js} +1 -1
  59. package/dist/assets/{useDeleteCell-BVWdwuvc.js → useDeleteCell-CFtiNna2.js} +1 -1
  60. package/dist/assets/{useDependencyPanelTab-DgtlzfpF.js → useDependencyPanelTab-DWfKzMhf.js} +1 -1
  61. package/dist/assets/{useNotebookActions-BeEH92nn.js → useNotebookActions-B4HR9n-p.js} +1 -1
  62. package/dist/assets/{useRunCells-Buew9vMX.js → useRunCells-DLQFWY1L.js} +1 -1
  63. package/dist/assets/{useSplitCell-LsoCeBEb.js → useSplitCell-DDFoE9WM.js} +1 -1
  64. package/dist/assets/{utilities.esm-BAGxBLhu.js → utilities.esm-DlnAwGsz.js} +1 -1
  65. package/dist/index.html +31 -31
  66. package/package.json +1 -1
  67. package/src/components/editor/chrome/state.ts +62 -24
  68. package/src/components/editor/chrome/wrapper/app-chrome.tsx +4 -8
  69. package/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx +1 -1
  70. package/src/components/editor/chrome/wrapper/footer.tsx +5 -13
  71. package/src/components/editor/chrome/wrapper/sidebar.tsx +2 -3
  72. package/src/components/editor/output/MarimoErrorOutput.tsx +2 -2
  73. package/src/components/terminal/hooks.ts +2 -2
  74. package/dist/assets/MarimoErrorOutput-HLzwepOd.js +0 -7
  75. package/dist/assets/edit-page-BNwlX8qM.js +0 -12
@@ -1,23 +1,23 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./esm-D2sDl0Fj.js","./chunk-LvLJmgfZ.js","./dist-Cs61SvFK.js","./dist-BuhT82Xx.js","./dist-DKNOF5xd.js","./dist-CAcX026F.js","./dist-DZH5tKVw.js","./dist-BRZzJw_5.js","./dist-D9Fiuh_3.js","./dist-BVf1IY4_.js","./dist-JWnLTASV.js","./dist-P7JHert4.js","./dist-BRKKmf0q.js","./dist-CVj-_Iiz.js","./dist-Cq_4nPfh.js","./dist-ByhoBCLE.js","./dist-CoiWxjLF.js","./dist-BmJp4tX0.js","./dist-BNNp07CX.js","./dist-DrrmBmzm.js","./dist-C4et3kHY.js","./dist-cVYW_wBR.js","./dist-DBfLs40b.js","./dist-Cv7ifwsi.js","./dist-B3_wJGK3.js","./dist-ChHsi1N7.js","./dist-BDE62V06.js","./dist-HGZzCB0y.js","./dist-CZt2oGGQ.js","./dist-BAmo7Mv9.js","./dist-CoibEXVK.js","./dist-RKnr9SNh.js","./dist-CXOfu6B_.js","./dist-3oAtECdQ.js","./dist-PikrGYIK.js","./dist-D6Pwf0VF.js","./dist-DUTVmHc-.js","./dist-DxRoHFaH.js","./dist-DN9Eyqh1.js","./dist-D9HMoxdZ.js","./dist-CPwcyFg3.js","./dist-JtCdI6tY.js","./apl-Bl4yyYus.js","./apl-iXnrDoYq.js","./asciiarmor-BlzLkEza.js","./asciiarmor-CK-aFa78.js","./asn1-Khb778U5.js","./asn1-DWJdxrMP.js","./brainfuck-BzHxpB_u.js","./brainfuck-0bMZHpH_.js","./cobol-Cs8YSzaw.js","./cobol-C9SsG--s.js","./clike-TW9KXOmZ.js","./clike-5SQqmvx2.js","./clojure-C_sT-_CQ.js","./clojure-B0kIwyv8.js","./css-BJpII9DZ.js","./css-aQ-Krb7T.js","./cmake-BjrhHx8m.js","./cmake-CLXeINvH.js","./coffeescript-juXyFkA0.js","./coffeescript-UIQG6RnU.js","./commonlisp-Cmn_5nuv.js","./commonlisp-BBPumpJY.js","./cypher-D549BT6Q.js","./cypher-DEE4_Yec.js","./python-DGMqnM8m.js","./python-UQl3_T6H.js","./crystal-DJrWmXfk.js","./crystal-CGN1wsuY.js","./d-CQplIm4C.js","./d-CgJ8N-gL.js","./diff-Dz2enOOE.js","./diff-B8e18dKs.js","./dockerfile-BfBmz-1M.js","./simple-mode-CZ1ts7NY.js","./dtd-DxzWHAng.js","./dtd-DtwMcoo9.js","./dylan-Bj1NVjKa.js","./dylan-Be6i1K-V.js","./ecl-Ch-B_r8E.js","./ecl-D5tlhe8s.js","./eiffel-CICk6vIb.js","./eiffel-8SQWO4xP.js","./elm-C1O6zP9K.js","./elm-CtGe_7Jw.js","./erlang-BwL41NIP.js","./erlang-CNwX3Z_M.js","./factor-DjzhghfA.js","./factor-DgyyQiBQ.js","./forth-D9Pm6H-4.js","./forth-CaVwPSxM.js","./fortran-Bkmw-ITl.js","./fortran-B28t9xoj.js","./mllike-sRDGjaMs.js","./mllike-CB0tp4Bz.js","./gas-hS11Npqh.js","./gas-BSiJHAcz.js","./gherkin-HvvvGZ2_.js","./gherkin-1QurHPOF.js","./groovy-BymCZpo_.js","./groovy-DFOLwJLv.js","./haskell-D1PB_nO2.js","./haskell-CUN2jxPH.js","./haxe-BbvC3Y-d.js","./haxe-BYzKptPQ.js","./idl-Do8pA7p2.js","./idl-cdmrQY5J.js","./javascript-C0HGxgJT.js","./javascript-l5LYdpfx.js","./julia-B-Inh9cI.js","./julia-DxiTohY8.js","./livescript-C6P4ddCY.js","./livescript-BZkzGFkJ.js","./lua-DTvhQBWH.js","./lua-rVV1vLen.js","./mirc-D0yC5rBL.js","./mirc-CdWws4At.js","./mathematica-wRwDN36m.js","./mathematica-DktJ0aJB.js","./modelica-CTTCwBwt.js","./modelica-DQGg_xsi.js","./mumps-eJkJqAKw.js","./mumps-BzlVzIzl.js","./mbox-BeQS3Xo8.js","./mbox-Ch6IVA7h.js","./nsis-B3ap5r7i.js","./nsis-bDE8IZXy.js","./ntriples-B2LCbtl9.js","./ntriples-BndMB6TK.js","./octave-DhLlnMzQ.js","./octave-DhnkL0CH.js","./oz-CLovtD0B.js","./oz-DbZmNL9y.js","./pascal-BJwozZXL.js","./pascal-DhE1sEjD.js","./perl-B3rIP59U.js","./perl-BOZHK4Y3.js","./pig-BQrpamWX.js","./pig-eswHTOE9.js","./powershell-Crqgmja1.js","./powershell-pm9G_Qg5.js","./properties-BMPI0iSd.js","./properties-7VoeFdHR.js","./protobuf-BMPWl2Em.js","./protobuf-BAsuCsmK.js","./pug-BvTKD58f.js","./pug-CcL3ml0F.js","./puppet-B1rTmaHH.js","./puppet-DUYPK8CV.js","./q-BNL1PH4D.js","./q-CnvA_jxT.js","./r-DOvfvYEk.js","./r-fM1OLzJB.js","./rpm-B7R9RTHE.js","./rpm-D62D_dq6.js","./ruby-BGJp-XLA.js","./ruby-DemvBD0m.js","./sas-CZmYq1Si.js","./sas-CZjYQi4h.js","./scheme-CdW_eMia.js","./scheme-nPNaP0Qp.js","./shell-oPdLMo8m.js","./shell-BE2ANxN1.js","./sieve-DEd8Bmn8.js","./sieve-DXFUN4C7.js","./smalltalk-CnqQIV2W.js","./smalltalk-DwXXlSAY.js","./sparql-DKyVXlni.js","./sparql-CgejAdiJ.js","./stylus-Dk_-yu_w.js","./stylus-CslB9TS3.js","./swift-CjrgUbUd.js","./swift-5t7SQPo8.js","./stex-BBWVYm-R.js","./stex-0ac7Aukl.js","./verilog-CqmLdpPq.js","./verilog-CIyPdzYJ.js","./tcl-DCmY87p6.js","./tcl-Ddpe8YBc.js","./textile-C_0nHQXl.js","./textile-D_Db33mq.js","./toml-DRTXXEvh.js","./toml-CgkLq_pv.js","./troff-Cc6RCKwc.js","./troff-6nX9d05T.js","./ttcn-B_hjyyZd.js","./ttcn-Dd4SMoHT.js","./ttcn-cfg-C9kHEAnH.js","./ttcn-cfg-ByNDYolW.js","./turtle-BpKw2L0C.js","./turtle-LDF8uFGv.js","./webidl-I7JvNTQ0.js","./webidl-C23hA3Le.js","./vb-DrexAmUA.js","./vb-DaLxM60T.js","./vbscript-BxgSn4mU.js","./vbscript-CwitZ57u.js","./velocity-FfkCaLcE.js","./velocity-D6bc4mrP.js","./vhdl-Brd1jg5j.js","./vhdl-DfyhlM4K.js","./xquery-DryU6qzU.js","./xquery-BAVQXrAf.js","./yacas-CxNmk6Uw.js","./yacas-DrybVty2.js","./z80-CIIYHJij.js","./z80-8KI6AMtY.js","./mscgen-D9NVglDL.js","./mscgen-vDSxnAXy.js","./dist-C-lY0RYt.js","./dist-Cd0uZhiN.js","./dist-B_4eJv27.js","./node-sql-parser-DFzvtOsy.js"])))=>i.map(i=>d[i]);
2
- var VR=Object.defineProperty;var $R=(Wi,Xr,Na)=>Xr in Wi?VR(Wi,Xr,{enumerable:!0,configurable:!0,writable:!0,value:Na}):Wi[Xr]=Na;var ke=(Wi,Xr,Na)=>$R(Wi,typeof Xr!="symbol"?Xr+"":Xr,Na);import{a as Ru,n as W2,o as WR,r as UR,s as yh,t as Se}from"./chunk-LvLJmgfZ.js";import{c as U2,i as ct,l as K2,p as Be,r as KR,s as QR,u as Yn}from"./useEvent-DlWF5OMa.js";import{t as Du}from"./react-BGmjiNul.js";import{t as GR}from"./react-dom-C9fstfnp.js";import{B as JR,N as XR,P as Q2,R as G2,T as J2,k as YR,w as ZR}from"./zod-Cg4WLWh2.js";import{t as Gr}from"./compiler-runtime-DeeZ7FnK.js";import{f as e4}from"./_Uint8Array-BGESiCQL.js";import{n as t4}from"./toString-DlRqgfqz.js";import{t as n4}from"./toInteger-CDcO32Gx.js";import{n as r4,u as i4}from"./merge-BBX6ug-N.js";import{l as a4}from"./_baseIsEqual-Cz9Tt_-E.js";import{i as _s,t as o4}from"./useLifecycle-CmDXEyIC.js";import{a as s4,i as l4,n as c4,r as vh,t as u4}from"./type-BdyvjzTI.js";import{t as d4}from"./_baseProperty-DuoFhI7N.js";import{t as X2}from"./debounce-BbFlGgjv.js";import{a as ci,d as Re,o as Y2,s as f4}from"./hotkeys-uKX61F1_.js";import{t as In}from"./invariant-C6yE60hi.js";import{d as Z2,t as p4}from"./utils-CJJIceVn.js";import{M as bh,k as h4,r as m4}from"./config-babG4OBR.js";import{r as ew}from"./useEventListener-COkmyg1v.js";import{t as g4}from"./jsx-runtime-DN_bIXfG.js";import{t as tw}from"./button-DuYGqRtX.js";import{t as Ou}from"./cn-C1rgT0yh.js";import{A as y4,At as v4,Bt as b4,C as w4,D as _4,Et as nw,Gt as rw,H as iw,Ht as aw,I as ow,J as Pu,Jt as xs,Ot as ks,Pt as x4,Rt as Mu,S as k4,St as Ta,T as sw,U as S4,Ut as Lu,Vt as Pl,W as C4,Wt as E4,Xt as Ss,Yt as vo,_t as T4,at as Ut,b as lw,ct as Ml,f as cw,it as R4,k as D4,kt as wh,l as le,mt as O4,nt as uw,ot as P4,p as M4,qt as Fi,rt as Bi,u as dw,ut as L4,xt as _h,z as fw,zt as hn}from"./dist-CAcX026F.js";import{A as N4,E as I4,S as A4,T as q4,_ as j4,b as z4,d as pw,f as F4,h as B4,m as H4,n as V4,o as xh,p as $4,s as W4,t as U4,u as K4,v as Q4,w as G4,x as J4}from"./dist-CI6_zMIl.js";import{a as hw,i as X4,n as ui,o as mw,p as kh,s as Ll}from"./once-CTiSlR1m.js";import{t as Y4}from"./capabilities-BmAOeMOK.js";import{t as Z4}from"./cjs-Bj40p_Np.js";import{t as Nl}from"./createReducer-DDa-hVe3.js";import{d as gw,l as yw,n as eD,o as vw,p as tD,r as Nu}from"./dist-DKNOF5xd.js";import{i as Sh,r as Ch}from"./main-CwSdzVhm.js";import{n as bw,t as nD}from"./useNonce-EAuSVK-5.js";import{t as Hi}from"./requests-C0HaHO6a.js";import{a as rD,c as iD,d as aD,f as ww,i as oD,l as sD,n as lD,o as Eh,r as cD,s as Th,t as uD,u as dD}from"./dist-BuhT82Xx.js";import{t as Ct}from"./createLucideIcon-CW2xpJ57.js";import{t as fD}from"./check-CrAQug3q.js";import{a as pD,c as hD,i as Rh,m as mD,n as gD,o as _w,r as yD,s as vD,t as bD}from"./select-D0g5GnIs.js";import{t as wD,u as _D}from"./toDate-5JckKRQn.js";import{t as xD}from"./database-zap-CaVvnK_o.js";import{n as kD,t as Iu}from"./DeferredRequestRegistry-B3BENoUa.js";import{t as mr}from"./badge-DAnNhy3O.js";import{t as ce}from"./preload-helper-BW0IMuFq.js";import{a as xw,s as SD}from"./dist-HGZzCB0y.js";import{a as CD,i as Dh,n as ED,r as kw,t as TD}from"./dist-RKnr9SNh.js";import{n as RD}from"./stex-0ac7Aukl.js";import{t as Il}from"./use-toast-Bzf3rpev.js";import{n as DD}from"./useTheme-DfP1CWaW.js";import{E as OD,S as PD,_ as Oh,w as Sw,x as MD}from"./Combination-D1TsGrBC.js";import{l as LD}from"./dist-CBrDuocE.js";import{i as ND,t as Ph}from"./tooltip-CvjcEpZC.js";let Au,Cw,Ew,qu,Tw,bo,Ra,Mh,Rw,Cs,ju,Dw,Ow,Da,zu,Lh,Pw,Al,ql,di,Mw,Lw,jl,Fu,Pr,Nh,Oa,Nw,Iw,Ih,Aw,qw,jw,Ah,zw,Vi,Fw,wo,zl,qh,jh,zh,Bu,Hu,Vu,Fh,Fl,Bh,Bw,$u,Hw,Hh,Vw,Vh,$h,Wh,$w,Uh,Kh,Bl,Ww,Qh,Wu,Uu,Mr,Gh,Jh,Hl,Uw,_o,Pa,Kw,Xh,Yh,Zh,Qw,Gw,Jw,xo,Xw,Yw,Ku,Vl,Zw,em,tm,Es,$l,nm,rm,Ts,e_,im,am,$n,t_,om,n_,r_,Qu,i_,sm,a_,o_,lm,Gu,cm,s_,l_,Ju,um,Wl,Xu,dm,Ul,c_,u_,d_,f_,Yu,p_,h_,fm,m_,g_,y_,Zu,v_,ko,pm,Zn,ed,b_,w_,__,Kl,Dt,x_,k_,S_,C_,hm,E_,Ma,mm,gm,td,T_,R_,D_,So,O_,ym,P_,vm,M_,bm,Ql,nd,wm,_m,Gl,L_,rd,N_,I_,xm,A_,id,gr,q_,ad,km,j_,z_,F_,B_,H_,od,V_,La,$_,Sm,Cm,Jl,Em,W_,sd,U_,K_,Jr,Q_,G_,ld,Xl,Lr,J_,Rs,cd,X_,Tm,Y_,ud,Rm,$i,Dm,yt,Om,Z_,yr,ex,tx,Pm,Mm,nx,dd,rx,ix,ax,Yl,Lm,fd,ox,pd,sx,lx,ID=(async()=>{var Zi,wf,$a;let Wi,Xr,Na,Am;Wi=Se((e=>{function n(ie,se){var K=ie.length;ie.push(se);e:for(;0<K;){var Le=K-1>>>1,$e=ie[Le];if(0<s($e,se))ie[Le]=se,ie[K]=$e,K=Le;else break e}}function i(ie){return ie.length===0?null:ie[0]}function o(ie){if(ie.length===0)return null;var se=ie[0],K=ie.pop();if(K!==se){ie[0]=K;e:for(var Le=0,$e=ie.length,st=$e>>>1;Le<st;){var je=2*(Le+1)-1,He=ie[je],Oe=je+1,Ne=ie[Oe];if(0>s(He,K))Oe<$e&&0>s(Ne,He)?(ie[Le]=Ne,ie[Oe]=K,Le=Oe):(ie[Le]=He,ie[je]=K,Le=je);else if(Oe<$e&&0>s(Ne,K))ie[Le]=Ne,ie[Oe]=K,Le=Oe;else break e}}return se}function s(ie,se){var K=ie.sortIndex-se.sortIndex;return K===0?ie.id-se.id:K}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,L=!1,z=!1,U=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function G(ie){for(var se=i(y);se!==null;){if(se.callback===null)o(y);else if(se.startTime<=ie)o(y),se.sortIndex=se.expirationTime,n(p,se);else break;se=i(y)}}function pe(ie){if(L=!1,G(ie),!T)if(i(p)!==null)T=!0,P||(P=!0,J());else{var se=i(y);se!==null&&ne(pe,se.startTime-ie)}}var P=!1,A=-1,V=5,de=-1;function fe(){return z?!0:!(e.unstable_now()-de<V)}function be(){if(z=!1,P){var ie=e.unstable_now();de=ie;var se=!0;try{e:{T=!1,L&&(L=!1,$(A),A=-1),E=!0;var K=C;try{t:{for(G(ie),_=i(p);_!==null&&!(_.expirationTime>ie&&fe());){var Le=_.callback;if(typeof Le=="function"){_.callback=null,C=_.priorityLevel;var $e=Le(_.expirationTime<=ie);if(ie=e.unstable_now(),typeof $e=="function"){_.callback=$e,G(ie),se=!0;break t}_===i(p)&&o(p),G(ie)}else o(p);_=i(p)}if(_!==null)se=!0;else{var st=i(y);st!==null&&ne(pe,st.startTime-ie),se=!1}}break e}finally{_=null,C=K,E=!1}se=void 0}}finally{se?J():P=!1}}}var J;if(typeof I=="function")J=function(){I(be)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,Ee=we.port2;we.port1.onmessage=be,J=function(){Ee.postMessage(null)}}else J=function(){U(be,0)};function ne(ie,se){A=U(function(){ie(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(ie){ie.callback=null},e.unstable_forceFrameRate=function(ie){0>ie||125<ie?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<ie?Math.floor(1e3/ie):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(ie){switch(C){case 1:case 2:case 3:var se=3;break;default:se=C}var K=C;C=se;try{return ie()}finally{C=K}},e.unstable_requestPaint=function(){z=!0},e.unstable_runWithPriority=function(ie,se){switch(ie){case 1:case 2:case 3:case 4:case 5:break;default:ie=3}var K=C;C=ie;try{return se()}finally{C=K}},e.unstable_scheduleCallback=function(ie,se,K){var Le=e.unstable_now();switch(typeof K=="object"&&K?(K=K.delay,K=typeof K=="number"&&0<K?Le+K:Le):K=Le,ie){case 1:var $e=-1;break;case 2:$e=250;break;case 5:$e=1073741823;break;case 4:$e=1e4;break;default:$e=5e3}return $e=K+$e,ie={id:w++,callback:se,priorityLevel:ie,startTime:K,expirationTime:$e,sortIndex:-1},K>Le?(ie.sortIndex=K,n(y,ie),i(p)===null&&ie===i(y)&&(L?($(A),A=-1):L=!0,ne(pe,K-Le))):(ie.sortIndex=$e,n(p,ie),T||E||(T=!0,P||(P=!0,J()))),ie},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(ie){var se=C;return function(){var K=C;C=se;try{return ie.apply(this,arguments)}finally{C=K}}}})),Xr=Se(((e,n)=>{n.exports=Wi()})),Na=Se((e=>{var n=Xr(),i=Du(),o=GR();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"),L=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),G=Symbol.for("react.context"),pe=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),de=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),be=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function we(t){return typeof t!="object"||!t?null:(t=J&&t[J]||t["@@iterator"],typeof t=="function"?t:null)}var Ee=Symbol.for("react.client.reference");function ne(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ee?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case z:return"Fragment";case $:return"Profiler";case U:return"StrictMode";case P:return"Suspense";case A:return"SuspenseList";case fe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case L:return"Portal";case G:return t.displayName||"Context";case I: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 V:return r=t.displayName||null,r===null?ne(t.type)||"Memo":r;case de:r=t._payload,t=t._init;try{return ne(t(r))}catch{}}return null}var ie=Array.isArray,se=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Le={pending:!1,data:null,method:null,action:null},$e=[],st=-1;function je(t){return{current:t}}function He(t){0>st||(t.current=$e[st],$e[st]=null,st--)}function Oe(t,r){st++,$e[st]=t.current,t.current=r}var Ne=je(null),yn=je(null),qt=je(null),Dn=je(null);function cn(t,r){switch(Oe(qt,r),Oe(yn,t),Oe(Ne,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?y2(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=y2(r),t=v2(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}He(Ne),Oe(Ne,t)}function We(){He(Ne),He(yn),He(qt)}function en(t){t.memoizedState!==null&&Oe(Dn,t);var r=Ne.current,a=v2(r,t.type);r!==a&&(Oe(yn,t),Oe(Ne,a))}function vt(t){yn.current===t&&(He(Ne),He(yn)),Dn.current===t&&(He(Dn),Tl._currentValue=Le)}var vn,vr;function ft(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 $R=Object.defineProperty;var WR=(Wi,Xr,Na)=>Xr in Wi?$R(Wi,Xr,{enumerable:!0,configurable:!0,writable:!0,value:Na}):Wi[Xr]=Na;var ke=(Wi,Xr,Na)=>WR(Wi,typeof Xr!="symbol"?Xr+"":Xr,Na);import{a as Ru,n as K2,o as UR,r as KR,s as yh,t as Se}from"./chunk-LvLJmgfZ.js";import{c as Q2,i as st,l as G2,p as Be,r as QR,s as GR,u as Yn}from"./useEvent-DlWF5OMa.js";import{t as Du}from"./react-BGmjiNul.js";import{t as JR}from"./react-dom-C9fstfnp.js";import{B as XR,N as YR,P as J2,R as X2,T as Y2,k as ZR,w as e4}from"./zod-Cg4WLWh2.js";import{t as Gr}from"./compiler-runtime-DeeZ7FnK.js";import{f as t4}from"./_Uint8Array-BGESiCQL.js";import{n as n4}from"./toString-DlRqgfqz.js";import{t as r4}from"./toInteger-CDcO32Gx.js";import{n as i4,u as a4}from"./merge-BBX6ug-N.js";import{l as o4}from"./_baseIsEqual-Cz9Tt_-E.js";import{i as _s,t as s4}from"./useLifecycle-CmDXEyIC.js";import{a as l4,i as c4,n as u4,r as vh,t as d4}from"./type-BdyvjzTI.js";import{t as f4}from"./_baseProperty-DuoFhI7N.js";import{t as Z2}from"./debounce-BbFlGgjv.js";import{a as ci,d as Re,o as ew,s as p4}from"./hotkeys-uKX61F1_.js";import{t as In}from"./invariant-C6yE60hi.js";import{d as tw,t as h4}from"./utils-CJJIceVn.js";import{M as bh,k as m4,r as g4}from"./config-babG4OBR.js";import{r as nw}from"./useEventListener-COkmyg1v.js";import{t as y4}from"./jsx-runtime-DN_bIXfG.js";import{t as rw}from"./button-DuYGqRtX.js";import{t as Ou}from"./cn-C1rgT0yh.js";import{A as v4,At as b4,Bt as w4,C as _4,D as x4,Et as iw,Gt as aw,H as ow,Ht as sw,I as lw,J as Pu,Jt as xs,Ot as ks,Pt as k4,Rt as Mu,S as S4,St as Ta,T as cw,U as C4,Ut as Lu,Vt as Pl,W as E4,Wt as T4,Xt as Ss,Yt as vo,_t as R4,at as Ut,b as uw,ct as Ml,f as dw,it as D4,k as O4,kt as wh,l as le,mt as P4,nt as fw,ot as M4,p as L4,qt as Fi,rt as Bi,u as pw,ut as N4,xt as _h,z as hw,zt as hn}from"./dist-CAcX026F.js";import{A as I4,E as A4,S as q4,T as j4,_ as z4,b as F4,d as mw,f as B4,h as H4,m as V4,n as $4,o as xh,p as W4,s as U4,t as K4,u as Q4,v as G4,w as J4,x as X4}from"./dist-CI6_zMIl.js";import{a as gw,i as Y4,n as ui,o as yw,p as kh,s as Ll}from"./once-CTiSlR1m.js";import{t as Z4}from"./capabilities-BmAOeMOK.js";import{t as eD}from"./cjs-Bj40p_Np.js";import{t as Nl}from"./createReducer-DDa-hVe3.js";import{d as vw,l as bw,n as tD,o as ww,p as nD,r as Nu}from"./dist-DKNOF5xd.js";import{i as Sh,r as Ch}from"./main-CwSdzVhm.js";import{n as _w,t as rD}from"./useNonce-EAuSVK-5.js";import{t as Hi}from"./requests-C0HaHO6a.js";import{a as iD,c as aD,d as oD,f as xw,i as sD,l as lD,n as cD,o as Eh,r as uD,s as Th,t as dD,u as fD}from"./dist-BuhT82Xx.js";import{t as Ct}from"./createLucideIcon-CW2xpJ57.js";import{t as pD}from"./check-CrAQug3q.js";import{a as hD,c as mD,i as Rh,m as gD,n as yD,o as kw,r as vD,s as bD,t as wD}from"./select-D0g5GnIs.js";import{t as _D,u as xD}from"./toDate-5JckKRQn.js";import{t as kD}from"./database-zap-CaVvnK_o.js";import{n as SD,t as Iu}from"./DeferredRequestRegistry-B3BENoUa.js";import{t as mr}from"./badge-DAnNhy3O.js";import{t as ce}from"./preload-helper-BW0IMuFq.js";import{a as Sw,s as CD}from"./dist-HGZzCB0y.js";import{a as ED,i as Dh,n as TD,r as Cw,t as RD}from"./dist-RKnr9SNh.js";import{n as DD}from"./stex-0ac7Aukl.js";import{t as Il}from"./use-toast-Bzf3rpev.js";import{n as OD}from"./useTheme-DfP1CWaW.js";import{E as PD,S as MD,_ as Oh,w as Ew,x as LD}from"./Combination-D1TsGrBC.js";import{l as ND}from"./dist-CBrDuocE.js";import{i as ID,t as Ph}from"./tooltip-CvjcEpZC.js";let Au,Tw,Rw,qu,Dw,bo,Ra,Mh,Ow,Cs,ju,Pw,Mw,Da,zu,Lh,Lw,Al,ql,di,Nw,Iw,jl,Fu,Pr,Nh,Oa,Aw,qw,Ih,jw,zw,Fw,Ah,Bw,Vi,Hw,wo,zl,qh,jh,zh,Bu,Hu,Vu,Fh,Fl,Bh,Vw,$u,$w,Hh,Ww,Vh,$h,Wh,Uw,Uh,Kh,Bl,Kw,Qh,Wu,Uu,Mr,Gh,Jh,Hl,Qw,_o,Pa,Gw,Xh,Yh,Zh,Jw,Xw,Yw,xo,Zw,e_,Ku,Vl,t_,em,tm,Es,$l,nm,rm,Ts,n_,im,am,$n,r_,om,i_,a_,Qu,o_,sm,s_,l_,lm,Gu,cm,c_,u_,Ju,um,Wl,Xu,dm,Ul,d_,f_,p_,h_,Yu,m_,g_,fm,y_,v_,b_,Zu,w_,ko,pm,Zn,ed,__,x_,k_,Kl,Dt,S_,C_,E_,T_,hm,R_,Ma,mm,gm,td,D_,O_,P_,So,M_,ym,L_,vm,N_,bm,Ql,nd,wm,_m,Gl,I_,rd,A_,q_,xm,j_,id,gr,km,ad,Sm,z_,F_,B_,H_,V_,od,$_,La,W_,Cm,Em,Jl,Tm,U_,sd,K_,Q_,Jr,G_,J_,ld,Xl,Lr,X_,Rs,cd,Y_,Rm,Z_,ud,Dm,$i,Om,yt,Pm,ex,yr,tx,nx,Mm,Lm,rx,dd,ix,ax,ox,Yl,Nm,fd,sx,pd,lx,cx,AD=(async()=>{var Zi,wf,$a;let Wi,Xr,Na,qm;Wi=Se((e=>{function n(ie,se){var K=ie.length;ie.push(se);e:for(;0<K;){var Le=K-1>>>1,$e=ie[Le];if(0<s($e,se))ie[Le]=se,ie[K]=$e,K=Le;else break e}}function i(ie){return ie.length===0?null:ie[0]}function o(ie){if(ie.length===0)return null;var se=ie[0],K=ie.pop();if(K!==se){ie[0]=K;e:for(var Le=0,$e=ie.length,lt=$e>>>1;Le<lt;){var je=2*(Le+1)-1,He=ie[je],Oe=je+1,Ne=ie[Oe];if(0>s(He,K))Oe<$e&&0>s(Ne,He)?(ie[Le]=Ne,ie[Oe]=K,Le=Oe):(ie[Le]=He,ie[je]=K,Le=je);else if(Oe<$e&&0>s(Ne,K))ie[Le]=Ne,ie[Oe]=K,Le=Oe;else break e}}return se}function s(ie,se){var K=ie.sortIndex-se.sortIndex;return K===0?ie.id-se.id:K}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,L=!1,z=!1,U=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function G(ie){for(var se=i(y);se!==null;){if(se.callback===null)o(y);else if(se.startTime<=ie)o(y),se.sortIndex=se.expirationTime,n(p,se);else break;se=i(y)}}function pe(ie){if(L=!1,G(ie),!T)if(i(p)!==null)T=!0,P||(P=!0,J());else{var se=i(y);se!==null&&ne(pe,se.startTime-ie)}}var P=!1,A=-1,V=5,de=-1;function fe(){return z?!0:!(e.unstable_now()-de<V)}function be(){if(z=!1,P){var ie=e.unstable_now();de=ie;var se=!0;try{e:{T=!1,L&&(L=!1,$(A),A=-1),E=!0;var K=C;try{t:{for(G(ie),_=i(p);_!==null&&!(_.expirationTime>ie&&fe());){var Le=_.callback;if(typeof Le=="function"){_.callback=null,C=_.priorityLevel;var $e=Le(_.expirationTime<=ie);if(ie=e.unstable_now(),typeof $e=="function"){_.callback=$e,G(ie),se=!0;break t}_===i(p)&&o(p),G(ie)}else o(p);_=i(p)}if(_!==null)se=!0;else{var lt=i(y);lt!==null&&ne(pe,lt.startTime-ie),se=!1}}break e}finally{_=null,C=K,E=!1}se=void 0}}finally{se?J():P=!1}}}var J;if(typeof I=="function")J=function(){I(be)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,Ee=we.port2;we.port1.onmessage=be,J=function(){Ee.postMessage(null)}}else J=function(){U(be,0)};function ne(ie,se){A=U(function(){ie(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(ie){ie.callback=null},e.unstable_forceFrameRate=function(ie){0>ie||125<ie?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<ie?Math.floor(1e3/ie):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(ie){switch(C){case 1:case 2:case 3:var se=3;break;default:se=C}var K=C;C=se;try{return ie()}finally{C=K}},e.unstable_requestPaint=function(){z=!0},e.unstable_runWithPriority=function(ie,se){switch(ie){case 1:case 2:case 3:case 4:case 5:break;default:ie=3}var K=C;C=ie;try{return se()}finally{C=K}},e.unstable_scheduleCallback=function(ie,se,K){var Le=e.unstable_now();switch(typeof K=="object"&&K?(K=K.delay,K=typeof K=="number"&&0<K?Le+K:Le):K=Le,ie){case 1:var $e=-1;break;case 2:$e=250;break;case 5:$e=1073741823;break;case 4:$e=1e4;break;default:$e=5e3}return $e=K+$e,ie={id:w++,callback:se,priorityLevel:ie,startTime:K,expirationTime:$e,sortIndex:-1},K>Le?(ie.sortIndex=K,n(y,ie),i(p)===null&&ie===i(y)&&(L?($(A),A=-1):L=!0,ne(pe,K-Le))):(ie.sortIndex=$e,n(p,ie),T||E||(T=!0,P||(P=!0,J()))),ie},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(ie){var se=C;return function(){var K=C;C=se;try{return ie.apply(this,arguments)}finally{C=K}}}})),Xr=Se(((e,n)=>{n.exports=Wi()})),Na=Se((e=>{var n=Xr(),i=Du(),o=JR();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"),L=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),G=Symbol.for("react.context"),pe=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),de=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),be=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function we(t){return typeof t!="object"||!t?null:(t=J&&t[J]||t["@@iterator"],typeof t=="function"?t:null)}var Ee=Symbol.for("react.client.reference");function ne(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ee?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case z:return"Fragment";case $:return"Profiler";case U:return"StrictMode";case P:return"Suspense";case A:return"SuspenseList";case fe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case L:return"Portal";case G:return t.displayName||"Context";case I: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 V:return r=t.displayName||null,r===null?ne(t.type)||"Memo":r;case de:r=t._payload,t=t._init;try{return ne(t(r))}catch{}}return null}var ie=Array.isArray,se=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Le={pending:!1,data:null,method:null,action:null},$e=[],lt=-1;function je(t){return{current:t}}function He(t){0>lt||(t.current=$e[lt],$e[lt]=null,lt--)}function Oe(t,r){lt++,$e[lt]=t.current,t.current=r}var Ne=je(null),yn=je(null),qt=je(null),Dn=je(null);function cn(t,r){switch(Oe(qt,r),Oe(yn,t),Oe(Ne,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?b2(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=b2(r),t=w2(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}He(Ne),Oe(Ne,t)}function We(){He(Ne),He(yn),He(qt)}function en(t){t.memoizedState!==null&&Oe(Dn,t);var r=Ne.current,a=w2(r,t.type);r!==a&&(Oe(yn,t),Oe(Ne,a))}function vt(t){yn.current===t&&(He(Ne),He(yn)),Dn.current===t&&(He(Dn),Tl._currentValue=Le)}var vn,vr;function ft(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 zr=!1;function tn(t,r){if(!t||zr)return"";zr=!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
  `),te=D.split(`
6
6
  `);for(h=l=0;l<H.length&&!H[l].includes("DetermineComponentFrameRoot");)l++;for(;h<te.length&&!te[h].includes("DetermineComponentFrameRoot");)h++;if(l===H.length||h===te.length)for(l=H.length-1,h=te.length-1;1<=l&&0<=h&&H[l]!==te[h];)h--;for(;1<=l&&0<=h;l--,h--)if(H[l]!==te[h]){if(l!==1||h!==1)do if(l--,h--,0>h||H[l]!==te[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{zr=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?ft(a):""}function hi(t,r){switch(t.tag){case 26:case 27:case 5:return ft(t.type);case 16:return ft("Lazy");case 13:return t.child!==r&&r!==null?ft("Suspense Fallback"):ft("Suspense");case 19:return ft("SuspenseList");case 0:case 15:return tn(t.type,!1);case 11:return tn(t.type.render,!1);case 1:return tn(t.type,!0);case 31:return ft("Activity");default:return""}}function On(t){try{var r="",a=null;do r+=hi(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,un=n.unstable_cancelCallback,ea=n.unstable_shouldYield,mi=n.unstable_requestPaint,Wt=n.unstable_now,gi=n.unstable_getCurrentPriorityLevel,dn=n.unstable_ImmediatePriority,ti=n.unstable_UserBlockingPriority,jt=n.unstable_NormalPriority,Fr=n.unstable_LowPriority,bt=n.unstable_IdlePriority,yi=n.log,ta=n.unstable_setDisableYieldValue,wr=null,Gt=null;function Ge(t){if(typeof yi=="function"&&ta(t),Gt&&typeof Gt.setStrictMode=="function")try{Gt.setStrictMode(wr,t)}catch{}}var ht=Math.clz32?Math.clz32:jn,wt=Math.log,_t=Math.LN2;function jn(t){return t>>>=0,t===0?32:31-(wt(t)/_t|0)|0}var _r=256,xt=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 Br(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 vi(){var t=ir;return ir<<=1,!(ir&62914560)&&(ir=4194304),t}function ni(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 bi(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,te=t.hiddenUpdates;for(a=S&~a;0<a;){var he=31-ht(a),ge=1<<he;D[he]=0,H[he]=-1;var ae=te[he];if(ae!==null)for(te[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-ht(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-ht(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 ee(){var t=K.p;return t===0?(t=window.event,t===void 0?32:z2(t.type)):t}function ve(t,r){var a=K.p;try{return K.p=t,r()}finally{K.p=a}}var Ce=Math.random().toString(36).slice(2),ze="__reactFiber$"+Ce,Fe="__reactProps$"+Ce,at="__reactContainer$"+Ce,Ot="__reactEvents$"+Ce,Ze="__reactListeners$"+Ce,Pt="__reactHandles$"+Ce,nt="__reactResources$"+Ce,ut="__reactMarker$"+Ce;function wn(t){delete t[ze],delete t[Fe],delete t[Ot],delete t[Ze],delete t[Pt]}function sr(t){var r=t[ze];if(r)return r;for(var a=t.parentNode;a;){if(r=a[at]||a[ze]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=C2(t);t!==null;){if(a=t[ze])return a;t=C2(t)}return r}t=a,a=t.parentNode}return null}function ri(t){if(t=t[ze]||t[at]){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 na(t){var r=t[nt];return r||(r=t[nt]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Jt(t){t[ut]=!0}var Bs=new Set,mc={};function ii(t,r){ra(t,r),ra(t+"Capture",r)}function ra(t,r){for(mc[t]=r,t=0;t<r.length;t++)Bs.add(r[t])}var _f=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]*$"),Un={},gc={};function xf(t){return br.call(gc,t)?!0:br.call(Un,t)?!1:_f.test(t)?gc[t]=!0:(Un[t]=!0,!1)}function Wa(t,r,a){if(xf(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 Hr(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 yc(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function vc(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 Hs(t){if(!t._valueTracker){var r=yc(t)?"checked":"value";t._valueTracker=vc(t,r,""+t[r])}}function Vs(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),l="";return t&&(l=yc(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 lt=/[\n"\\]/g;function lr(t){return t.replace(lt,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function ia(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"):wi(t,S,Bn(a)):wi(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 bc(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)){Hs(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),Hs(t)}function wi(t,r,a){r==="number"&&Nn(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function aa(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 oa(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(ie(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),Hs(t)}function _i(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var kf=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 xi(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||kf.has(r)?r==="float"?t.cssFloat=a:t[r]=(""+a).trim():t[r]=a+"px"}function wc(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&&xi(t,h,l)}else for(var g in r)r.hasOwnProperty(g)&&xi(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"]]),_c=/^[\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 _c.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function xr(){}var _n=null;function $s(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Hn=null,ai=null;function xc(t){var r=ri(t);if(r&&(t=r.stateNode)){var a=t[Fe]||null;e:switch(t=r.stateNode,r.type){case"input":if(ia(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[Fe]||null;if(!h)throw Error(s(90));ia(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&&Vs(l)}break e;case"textarea":oa(t,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&aa(t,!!a.multiple,r,!1)}}}var Ws=!1;function kc(t,r,a){if(Ws)return t(r,a);Ws=!0;try{return t(r)}finally{if(Ws=!1,(Hn!==null||ai!==null)&&(su(),Hn&&(r=Hn,t=ai,ai=Hn=null,xc(r),t)))for(r=0;r<t.length;r++)xc(t[r])}}function Qa(t,r){var a=t.stateNode;if(a===null)return null;var l=a[Fe]||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 Vr=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0),Us=!1;if(Vr)try{var Ga={};Object.defineProperty(Ga,"passive",{get:function(){Us=!0}}),window.addEventListener("test",Ga,Ga),window.removeEventListener("test",Ga,Ga)}catch{Us=!1}var $r=null,$o=null,Ja=null;function Ks(){if(Ja)return Ja;var t,r=$o,a=r.length,l,h="value"in $r?$r.value:$r.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 Qs(){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:Qs,this.isPropagationStopped=Qs,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 ki={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},u=xn(ki),m=C({},ki,{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),N=xn(C({},R,{dataTransfer:0})),F=xn(C({},m,{relatedTarget:0})),q=xn(C({},ki,{animationName:0,elapsedTime:0,pseudoElement:0})),oe=xn(C({},ki,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}})),re=xn(C({},ki,{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 Te=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}})),Ie=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({},ki,{propertyName:0,elapsedTime:0,pseudoElement:0})),Mt=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})),zt=xn(C({},ki,{newState:0,oldState:0})),Ue=[9,13,27,32],Ve=Vr&&"CompositionEvent"in window,Vt=null;Vr&&"documentMode"in document&&(Vt=document.documentMode);var nn=Vr&&"TextEvent"in window&&!Vt,fn=Vr&&(!Ve||Vt&&8<Vt&&11>=Vt),Za=" ",Sc=!1;function Cc(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 cT(t,r){switch(t){case"compositionend":return Wo(r);case"keypress":return r.which===32?(Sc=!0,Za):null;case"textInput":return t=r.data,t===Za&&Sc?null:t;default:return null}}function uT(t,r){if(Uo)return t==="compositionend"||!Ve&&Cc(t,r)?(t=Ks(),Ja=$o=$r=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 fn&&r.locale!=="ko"?null:r.data;default:return null}}var dT={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 Ov(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!dT[t.type]:r==="textarea"}function Pv(t,r,a,l){Hn?ai?ai.push(l):ai=[l]:Hn=l,r=hu(r,"onChange"),0<r.length&&(a=new u("onChange","change",null,a,l),t.push({event:a,listeners:r}))}var Gs=null,Js=null;function fT(t){u2(t,0)}function Ec(t){if(Vs(Fn(t)))return t}function Mv(t,r){if(t==="change")return r}var Lv=!1;if(Vr){var Sf;if(Vr){var Cf="oninput"in document;if(!Cf){var Nv=document.createElement("div");Nv.setAttribute("oninput","return;"),Cf=typeof Nv.oninput=="function"}Sf=Cf}else Sf=!1;Lv=Sf&&(!document.documentMode||9<document.documentMode)}function Iv(){Gs&&(Gs.detachEvent("onpropertychange",Av),Js=Gs=null)}function Av(t){if(t.propertyName==="value"&&Ec(Js)){var r=[];Pv(r,Js,t,$s(t)),kc(fT,r)}}function pT(t,r,a){t==="focusin"?(Iv(),Gs=r,Js=a,Gs.attachEvent("onpropertychange",Av)):t==="focusout"&&Iv()}function hT(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ec(Js)}function mT(t,r){if(t==="click")return Ec(r)}function gT(t,r){if(t==="input"||t==="change")return Ec(r)}function yT(t,r){return t===r&&(t!==0||1/t==1/r)||t!==t&&r!==r}var cr=typeof Object.is=="function"?Object.is:yT;function Xs(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 qv(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function jv(t,r){var a=qv(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=qv(a)}}function zv(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?zv(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Fv(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 Ef(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 vT=Vr&&"documentMode"in document&&11>=document.documentMode,Ko=null,Tf=null,Ys=null,Rf=!1;function Bv(t,r,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Rf||Ko==null||Ko!==Nn(l)||(l=Ko,"selectionStart"in l&&Ef(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}),Ys&&Xs(Ys,l)||(Ys=l,l=hu(Tf,"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")},Df={},Hv={};Vr&&(Hv=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(Df[t])return Df[t];if(!Qo[t])return t;var r=Qo[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in Hv)return Df[t]=r[a];return t}var Vv=to("animationend"),$v=to("animationiteration"),Wv=to("animationstart"),bT=to("transitionrun"),wT=to("transitionstart"),_T=to("transitioncancel"),Uv=to("transitionend"),Kv=new Map,Of="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Of.push("scrollEnd");function Wr(t,r){Kv.set(t,r),ii(r,[t])}var Tc=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,Pf=0;function Rc(){for(var t=Go,r=Pf=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&&Qv(a,h,g)}}function Dc(t,r,a,l){kr[Go++]=t,kr[Go++]=r,kr[Go++]=a,kr[Go++]=l,Pf|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Mf(t,r,a,l){return Dc(t,r,a,l),Oc(t)}function no(t,r){return Dc(t,null,null,r),Oc(t)}function Qv(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-ht(a),t=g.hiddenUpdates,l=t[h],l===null?t[h]=[r]:l.push(r),r.lane=a|536870912),g):null}function Oc(t){if(50<wl)throw wl=0,Bp=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Jo={};function xT(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 xT(t,r,a,l)}function Lf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Si(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 Gv(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 Pc(t,r,a,l,h,g){var S=0;if(l=t,typeof t=="function")Lf(t)&&(S=1);else if(typeof t=="string")S=RR(t,a,Ne.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 z:return ro(a.children,h,g,r);case U:S=8,h|=24;break;case $:return t=ur(12,a,r,h|2),t.elementType=$,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 G:S=10;break e;case I:S=9;break e;case pe:S=11;break e;case V: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 Nf(t,r,a){return t=ur(6,t,null,r),t.lanes=a,t}function Jv(t){var r=ur(18,null,null,0);return r.stateNode=t,r}function If(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 Xv=new WeakMap;function Sr(t,r){if(typeof t=="object"&&t){var a=Xv.get(t);return a===void 0?(r={value:t,source:r,stack:On(r)},Xv.set(t,r),r):a}return{value:t,source:r,stack:On(r)}}var Xo=[],Yo=0,Mc=null,Zs=0,Cr=[],Er=0,sa=null,oi=1,si="";function Ci(t,r){Xo[Yo++]=Zs,Xo[Yo++]=Mc,Mc=t,Zs=r}function Yv(t,r,a){Cr[Er++]=oi,Cr[Er++]=si,Cr[Er++]=sa,sa=t;var l=oi;t=si;var h=32-ht(l)-1;l&=~(1<<h),a+=1;var g=32-ht(r)+h;if(30<g){var S=h-h%5;g=(l&(1<<S)-1).toString(32),l>>=S,h-=S,oi=1<<32-ht(r)+h|a<<h|l,si=g+t}else oi=1<<g|a<<h|l,si=t}function Af(t){t.return!==null&&(Ci(t,1),Yv(t,1,0))}function qf(t){for(;t===Mc;)Mc=Xo[--Yo],Xo[Yo]=null,Zs=Xo[--Yo],Xo[Yo]=null;for(;t===sa;)sa=Cr[--Er],Cr[Er]=null,si=Cr[--Er],Cr[Er]=null,oi=Cr[--Er],Cr[Er]=null}function Zv(t,r){Cr[Er++]=oi,Cr[Er++]=si,Cr[Er++]=sa,oi=r.id,si=r.overflow,sa=t}var Sn=null,Ft=null,ot=!1,la=null,Tr=!1,jf=Error(s(519));function ca(t){throw el(Sr(Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML","")),t)),jf}function e1(t){var r=t.stateNode,a=t.type,l=t.memoizedProps;switch(r[ze]=t,r[Fe]=l,a){case"dialog":tt("cancel",r),tt("close",r);break;case"iframe":case"object":case"embed":tt("load",r);break;case"video":case"audio":for(a=0;a<xl.length;a++)tt(xl[a],r);break;case"source":tt("error",r);break;case"img":case"image":case"link":tt("error",r),tt("load",r);break;case"details":tt("toggle",r);break;case"input":tt("invalid",r),bc(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":tt("invalid",r);break;case"textarea":tt("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||m2(r.textContent,a)?(l.popover!=null&&(tt("beforetoggle",r),tt("toggle",r)),l.onScroll!=null&&tt("scroll",r),l.onScrollEnd!=null&&tt("scrollend",r),l.onClick!=null&&(r.onclick=xr),r=!0):r=!1,r||ca(t,!0)}function t1(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(!ot)return t1(t),ot=!0,!1;var r=t.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||th(t.type,t.memoizedProps)),a=!a),a&&Ft&&ca(t),t1(t),r===13){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));Ft=S2(t)}else if(r===31){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));Ft=S2(t)}else r===27?(r=Ft,_a(t.type)?(t=oh,oh=null,Ft=t):Ft=r):Ft=Sn?Dr(t.stateNode.nextSibling):null;return!0}function io(){Ft=Sn=null,ot=!1}function zf(){var t=la;return t!==null&&(Jn===null?Jn=t:Jn.push.apply(Jn,t),la=null),t}function el(t){la===null?la=[t]:la.push(t)}var Ff=je(null),ao=null,Ei=null;function ua(t,r,a){Oe(Ff,r._currentValue),r._currentValue=a}function Ti(t){t._currentValue=Ff.current,He(Ff)}function Bf(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 Hf(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),Bf(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),Bf(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=[Tl]:t.push(Tl))}h=h.return}t!==null&&Hf(r,t,a,l),r.flags|=262144}function Lc(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,Ei=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Cn(t){return n1(ao,t)}function Nc(t,r){return ao===null&&oo(t),n1(t,r)}function n1(t,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},Ei===null){if(t===null)throw Error(s(308));Ei=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else Ei=Ei.next=r;return a}var kT=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()})}},ST=n.unstable_scheduleCallback,CT=n.unstable_NormalPriority,rn={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vf(){return{controller:new kT,data:new Map,refCount:0}}function tl(t){t.refCount--,t.refCount===0&&ST(CT,function(){t.controller.abort()})}var nl=null,$f=0,ts=0,ns=null;function ET(t,r){if(nl===null){var a=nl=[];$f=0,ts=Kp(),ns={status:"pending",value:void 0,then:function(l){a.push(l)}}}return $f++,r.then(r1,r1),r}function r1(){if(--$f===0&&nl!==null){ns!==null&&(ns.status="fulfilled");var t=nl;nl=null,ts=0,ns=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function TT(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 i1=se.S;se.S=function(t,r){jb=Wt(),typeof r=="object"&&r&&typeof r.then=="function"&&ET(t,r),i1!==null&&i1(t,r)};var so=je(null);function Wf(){var t=so.current;return t===null?Lt.pooledCache:t}function Ic(t,r){r===null?Oe(so,so.current):Oe(so,r.pool)}function a1(){var t=Wf();return t===null?null:{parent:rn._currentValue,pool:t}}var rs=Error(s(460)),Uf=Error(s(474)),Ac=Error(s(542)),qc={then:function(){}};function o1(t){return t=t.status,t==="fulfilled"||t==="rejected"}function s1(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,c1(t),t;default:if(typeof r.status=="string")r.then(xr,xr);else{if(t=Lt,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,c1(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 l1(){if(co===null)throw Error(s(459));var t=co;return co=null,t}function c1(t){if(t===rs||t===Ac)throw Error(s(483))}var is=null,rl=0;function jc(t){var r=rl;return rl+=1,is===null&&(is=[]),s1(is,t,r)}function il(t,r){r=r.props.ref,t.ref=r===void 0?null:r}function zc(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 u1(t){function r(Q,W){if(t){var Z=Q.deletions;Z===null?(Q.deletions=[W],Q.flags|=16):Z.push(W)}}function a(Q,W){if(!t)return null;for(;W!==null;)r(Q,W),W=W.sibling;return null}function l(Q){for(var W=new Map;Q!==null;)Q.key===null?W.set(Q.index,Q):W.set(Q.key,Q),Q=Q.sibling;return W}function h(Q,W){return Q=Si(Q,W),Q.index=0,Q.sibling=null,Q}function g(Q,W,Z){return Q.index=Z,t?(Z=Q.alternate,Z===null?(Q.flags|=67108866,W):(Z=Z.index,Z<W?(Q.flags|=67108866,W):Z)):(Q.flags|=1048576,W)}function S(Q){return t&&Q.alternate===null&&(Q.flags|=67108866),Q}function D(Q,W,Z,me){return W===null||W.tag!==6?(W=Nf(Z,Q.mode,me),W.return=Q,W):(W=h(W,Z),W.return=Q,W)}function H(Q,W,Z,me){var Me=Z.type;return Me===z?he(Q,W,Z.props.children,me,Z.key):W!==null&&(W.elementType===Me||typeof Me=="object"&&Me&&Me.$$typeof===de&&lo(Me)===W.type)?(W=h(W,Z.props),il(W,Z),W.return=Q,W):(W=Pc(Z.type,Z.key,Z.props,null,Q.mode,me),il(W,Z),W.return=Q,W)}function te(Q,W,Z,me){return W===null||W.tag!==4||W.stateNode.containerInfo!==Z.containerInfo||W.stateNode.implementation!==Z.implementation?(W=If(Z,Q.mode,me),W.return=Q,W):(W=h(W,Z.children||[]),W.return=Q,W)}function he(Q,W,Z,me,Me){return W===null||W.tag!==7?(W=ro(Z,Q.mode,me,Me),W.return=Q,W):(W=h(W,Z),W.return=Q,W)}function ge(Q,W,Z){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=Nf(""+W,Q.mode,Z),W.return=Q,W;if(typeof W=="object"&&W){switch(W.$$typeof){case T:return Z=Pc(W.type,W.key,W.props,null,Q.mode,Z),il(Z,W),Z.return=Q,Z;case L:return W=If(W,Q.mode,Z),W.return=Q,W;case de:return W=lo(W),ge(Q,W,Z)}if(ie(W)||we(W))return W=ro(W,Q.mode,Z,null),W.return=Q,W;if(typeof W.then=="function")return ge(Q,jc(W),Z);if(W.$$typeof===G)return ge(Q,Nc(Q,W),Z);zc(Q,W)}return null}function ae(Q,W,Z,me){var Me=W===null?null:W.key;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Me===null?D(Q,W,""+Z,me):null;if(typeof Z=="object"&&Z){switch(Z.$$typeof){case T:return Z.key===Me?H(Q,W,Z,me):null;case L:return Z.key===Me?te(Q,W,Z,me):null;case de:return Z=lo(Z),ae(Q,W,Z,me)}if(ie(Z)||we(Z))return Me===null?he(Q,W,Z,me,null):null;if(typeof Z.then=="function")return ae(Q,W,jc(Z),me);if(Z.$$typeof===G)return ae(Q,W,Nc(Q,Z),me);zc(Q,Z)}return null}function ue(Q,W,Z,me,Me){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return Q=Q.get(Z)||null,D(W,Q,""+me,Me);if(typeof me=="object"&&me){switch(me.$$typeof){case T:return Q=Q.get(me.key===null?Z:me.key)||null,H(W,Q,me,Me);case L:return Q=Q.get(me.key===null?Z:me.key)||null,te(W,Q,me,Me);case de:return me=lo(me),ue(Q,W,Z,me,Me)}if(ie(me)||we(me))return Q=Q.get(Z)||null,he(W,Q,me,Me,null);if(typeof me.then=="function")return ue(Q,W,Z,jc(me),Me);if(me.$$typeof===G)return ue(Q,W,Z,Nc(W,me),Me);zc(W,me)}return null}function De(Q,W,Z,me){for(var Me=null,gt=null,Pe=W,Qe=W=0,it=null;Pe!==null&&Qe<Z.length;Qe++){Pe.index>Qe?(it=Pe,Pe=null):it=Pe.sibling;var pt=ae(Q,Pe,Z[Qe],me);if(pt===null){Pe===null&&(Pe=it);break}t&&Pe&&pt.alternate===null&&r(Q,Pe),W=g(pt,W,Qe),gt===null?Me=pt:gt.sibling=pt,gt=pt,Pe=it}if(Qe===Z.length)return a(Q,Pe),ot&&Ci(Q,Qe),Me;if(Pe===null){for(;Qe<Z.length;Qe++)Pe=ge(Q,Z[Qe],me),Pe!==null&&(W=g(Pe,W,Qe),gt===null?Me=Pe:gt.sibling=Pe,gt=Pe);return ot&&Ci(Q,Qe),Me}for(Pe=l(Pe);Qe<Z.length;Qe++)it=ue(Pe,Q,Qe,Z[Qe],me),it!==null&&(t&&it.alternate!==null&&Pe.delete(it.key===null?Qe:it.key),W=g(it,W,Qe),gt===null?Me=it:gt.sibling=it,gt=it);return t&&Pe.forEach(function(Ea){return r(Q,Ea)}),ot&&Ci(Q,Qe),Me}function Ae(Q,W,Z,me){if(Z==null)throw Error(s(151));for(var Me=null,gt=null,Pe=W,Qe=W=0,it=null,pt=Z.next();Pe!==null&&!pt.done;Qe++,pt=Z.next()){Pe.index>Qe?(it=Pe,Pe=null):it=Pe.sibling;var Ea=ae(Q,Pe,pt.value,me);if(Ea===null){Pe===null&&(Pe=it);break}t&&Pe&&Ea.alternate===null&&r(Q,Pe),W=g(Ea,W,Qe),gt===null?Me=Ea:gt.sibling=Ea,gt=Ea,Pe=it}if(pt.done)return a(Q,Pe),ot&&Ci(Q,Qe),Me;if(Pe===null){for(;!pt.done;Qe++,pt=Z.next())pt=ge(Q,pt.value,me),pt!==null&&(W=g(pt,W,Qe),gt===null?Me=pt:gt.sibling=pt,gt=pt);return ot&&Ci(Q,Qe),Me}for(Pe=l(Pe);!pt.done;Qe++,pt=Z.next())pt=ue(Pe,Q,Qe,pt.value,me),pt!==null&&(t&&pt.alternate!==null&&Pe.delete(pt.key===null?Qe:pt.key),W=g(pt,W,Qe),gt===null?Me=pt:gt.sibling=pt,gt=pt);return t&&Pe.forEach(function(HR){return r(Q,HR)}),ot&&Ci(Q,Qe),Me}function Rt(Q,W,Z,me){if(typeof Z=="object"&&Z&&Z.type===z&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z){switch(Z.$$typeof){case T:e:{for(var Me=Z.key;W!==null;){if(W.key===Me){if(Me=Z.type,Me===z){if(W.tag===7){a(Q,W.sibling),me=h(W,Z.props.children),me.return=Q,Q=me;break e}}else if(W.elementType===Me||typeof Me=="object"&&Me&&Me.$$typeof===de&&lo(Me)===W.type){a(Q,W.sibling),me=h(W,Z.props),il(me,Z),me.return=Q,Q=me;break e}a(Q,W);break}else r(Q,W);W=W.sibling}Z.type===z?(me=ro(Z.props.children,Q.mode,me,Z.key),me.return=Q,Q=me):(me=Pc(Z.type,Z.key,Z.props,null,Q.mode,me),il(me,Z),me.return=Q,Q=me)}return S(Q);case L:e:{for(Me=Z.key;W!==null;){if(W.key===Me)if(W.tag===4&&W.stateNode.containerInfo===Z.containerInfo&&W.stateNode.implementation===Z.implementation){a(Q,W.sibling),me=h(W,Z.children||[]),me.return=Q,Q=me;break e}else{a(Q,W);break}else r(Q,W);W=W.sibling}me=If(Z,Q.mode,me),me.return=Q,Q=me}return S(Q);case de:return Z=lo(Z),Rt(Q,W,Z,me)}if(ie(Z))return De(Q,W,Z,me);if(we(Z)){if(Me=we(Z),typeof Me!="function")throw Error(s(150));return Z=Me.call(Z),Ae(Q,W,Z,me)}if(typeof Z.then=="function")return Rt(Q,W,jc(Z),me);if(Z.$$typeof===G)return Rt(Q,W,Nc(Q,Z),me);zc(Q,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,W!==null&&W.tag===6?(a(Q,W.sibling),me=h(W,Z),me.return=Q,Q=me):(a(Q,W),me=Nf(Z,Q.mode,me),me.return=Q,Q=me),S(Q)):a(Q,W)}return function(Q,W,Z,me){try{rl=0;var Me=Rt(Q,W,Z,me);return is=null,Me}catch(Pe){if(Pe===rs||Pe===Ac)throw Pe;var gt=ur(29,Pe,null,Q.mode);return gt.lanes=me,gt.return=Q,gt}}}var uo=u1(!0),d1=u1(!1),da=!1;function Kf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qf(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,mt&2){var h=l.pending;return h===null?r.next=r:(r.next=h.next,h.next=r),l.pending=r,r=Oc(t),Qv(t,null,a),r}return Dc(t,l,r,a),Oc(t)}function al(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 Gf(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 Jf=!1;function ol(){if(Jf){var t=ns;if(t!==null)throw t}}function sl(t,r,a,l){Jf=!1;var h=t.updateQueue;da=!1;var g=h.firstBaseUpdate,S=h.lastBaseUpdate,D=h.shared.pending;if(D!==null){h.shared.pending=null;var H=D,te=H.next;H.next=null,S===null?g=te:S.next=te,S=H;var he=t.alternate;he!==null&&(he=he.updateQueue,D=he.lastBaseUpdate,D!==S&&(D===null?he.firstBaseUpdate=te:D.next=te,he.lastBaseUpdate=H))}if(g!==null){var ge=h.baseState;S=0,he=te=H=null,D=g;do{var ae=D.lane&-536870913,ue=ae!==D.lane;if(ue?(rt&ae)===ae:(l&ae)===ae){ae!==0&&ae===ts&&(Jf=!0),he!==null&&(he=he.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var De=t,Ae=D;ae=r;var Rt=a;switch(Ae.tag){case 1:if(De=Ae.payload,typeof De=="function"){ge=De.call(Rt,ge,ae);break e}ge=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Ae.payload,ae=typeof De=="function"?De.call(Rt,ge,ae):De,ae==null)break e;ge=C({},ge,ae);break e;case 2:da=!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?(te=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=te,h.lastBaseUpdate=he,g===null&&(h.shared.lanes=0),ga|=S,t.lanes=S,t.memoizedState=ge}}function f1(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function p1(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)f1(a[t],r)}var as=je(null),Fc=je(0);function h1(t,r){t=Ai,Oe(Fc,t),Oe(as,r),Ai=t|r.baseLanes}function Xf(){Oe(Fc,Ai),Oe(as,as.current)}function Yf(){Ai=Fc.current,He(as),He(Fc)}var dr=je(null),Ur=null;function fa(t){var r=t.alternate;Oe(Xt,Xt.current&1),Oe(dr,t),Ur===null&&(r===null||as.current!==null||r.memoizedState!==null)&&(Ur=t)}function Zf(t){Oe(Xt,Xt.current),Oe(dr,t),Ur===null&&(Ur=t)}function m1(t){t.tag===22?(Oe(Xt,Xt.current),Oe(dr,t),Ur===null&&(Ur=t)):pa(t)}function pa(){Oe(Xt,Xt.current),Oe(dr,dr.current)}function fr(t){He(dr),Ur===t&&(Ur=null),He(Xt)}var Xt=je(0);function Bc(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||ih(a)||ah(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 Ri=0,Ke=null,Et=null,an=null,Hc=!1,os=!1,ho=!1,Vc=0,ll=0,ss=null,RT=0;function Kt(){throw Error(s(321))}function ep(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 tp(t,r,a,l,h,g){return Ri=g,Ke=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,se.H=t===null||t.memoizedState===null?Y1:gp,ho=!1,g=a(l,h),ho=!1,os&&(g=y1(r,a,l,h)),g1(t),g}function g1(t){se.H=dl;var r=Et!==null&&Et.next!==null;if(Ri=0,an=Et=Ke=null,Hc=!1,ll=0,ss=null,r)throw Error(s(300));t===null||on||(t=t.dependencies,t!==null&&Lc(t)&&(on=!0))}function y1(t,r,a,l){Ke=t;var h=0;do{if(os&&(ss=null),ll=0,os=!1,25<=h)throw Error(s(301));if(h+=1,an=Et=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=Z1,g=r(a,l)}while(os);return g}function DT(){var t=se.H,r=t.useState()[0];return r=typeof r.then=="function"?cl(r):r,t=t.useState()[0],(Et===null?null:Et.memoizedState)!==t&&(Ke.flags|=1024),r}function np(){var t=Vc!==0;return Vc=0,t}function rp(t,r,a){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~a}function ip(t){if(Hc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Hc=!1}Ri=0,an=Et=Ke=null,os=!1,ll=Vc=0,ss=null}function Vn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return an===null?Ke.memoizedState=an=t:an=an.next=t,an}function Yt(){if(Et===null){var t=Ke.alternate;t=t===null?null:t.memoizedState}else t=Et.next;var r=an===null?Ke.memoizedState:an.next;if(r!==null)an=r,Et=t;else{if(t===null)throw Ke.alternate===null?Error(s(467)):Error(s(310));Et=t,t={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},an===null?Ke.memoizedState=an=t:an=an.next=t}return an}function $c(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cl(t){var r=ll;return ll+=1,ss===null&&(ss=[]),t=s1(ss,t,r),r=Ke,(an===null?r.memoizedState:an.next)===null&&(r=r.alternate,se.H=r===null||r.memoizedState===null?Y1:gp),t}function Wc(t){if(typeof t=="object"&&t){if(typeof t.then=="function")return cl(t);if(t.$$typeof===G)return Cn(t)}throw Error(s(438,String(t)))}function ap(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=$c(),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]=be;return r.index++,a}function Di(t,r){return typeof r=="function"?r(t):r}function Uc(t){return op(Yt(),Et,t)}function op(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,te=r,he=!1;do{var ge=te.lane&-536870913;if(ge===te.lane?(Ri&ge)===ge:(rt&ge)===ge){var ae=te.revertLane;if(ae===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),ge===ts&&(he=!0);else if((Ri&ae)===ae){te=te.next,ae===ts&&(he=!0);continue}else ge={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},H===null?(D=H=ge,S=g):H=H.next=ge,Ke.lanes|=ae,ga|=ae;ge=te.action,ho&&a(g,ge),g=te.hasEagerState?te.eagerState:a(g,ge)}else ae={lane:ge,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},H===null?(D=H=ae,S=g):H=H.next=ae,Ke.lanes|=ge,ga|=ge;te=te.next}while(te!==null&&te!==r);if(H===null?S=g:H.next=D,!cr(g,t.memoizedState)&&(on=!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 sp(t){var r=Yt(),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)||(on=!0),r.memoizedState=g,r.baseQueue===null&&(r.baseState=g),a.lastRenderedState=g}return[g,l]}function v1(t,r,a){var l=Ke,h=Yt(),g=ot;if(g){if(a===void 0)throw Error(s(407));a=a()}else a=r();var S=!cr((Et||h).memoizedState,a);if(S&&(h.memoizedState=a,on=!0),h=h.queue,up(_1.bind(null,l,h,t),[t]),h.getSnapshot!==r||S||an!==null&&an.memoizedState.tag&1){if(l.flags|=2048,ls(9,{destroy:void 0},w1.bind(null,l,h,a,r),null),Lt===null)throw Error(s(349));g||Ri&127||b1(l,r,a)}return a}function b1(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=Ke.updateQueue,r===null?(r=$c(),Ke.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function w1(t,r,a,l){r.value=a,r.getSnapshot=l,x1(r)&&k1(t)}function _1(t,r,a){return a(function(){x1(r)&&k1(t)})}function x1(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!cr(t,a)}catch{return!0}}function k1(t){var r=no(t,2);r!==null&&Xn(r,t,2)}function lp(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:Di,lastRenderedState:t},r}function S1(t,r,a,l){return t.baseState=a,op(t,Et,typeof l=="function"?l:Di)}function OT(t,r,a,l,h){if(Gc(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,C1(r,g)):(g.next=a.next,r.pending=a.next=g)}}function C1(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),E1(t,r,D)}catch(te){cp(t,r,te)}finally{g!==null&&S.types!==null&&(g.types=S.types),se.T=g}}else try{g=a(h,l),E1(t,r,g)}catch(te){cp(t,r,te)}}function E1(t,r,a){typeof a=="object"&&a&&typeof a.then=="function"?a.then(function(l){T1(t,r,l)},function(l){return cp(t,r,l)}):T1(t,r,a)}function T1(t,r,a){r.status="fulfilled",r.value=a,R1(r),t.state=a,r=t.pending,r!==null&&(a=r.next,a===r?t.pending=null:(a=a.next,r.next=a,C1(t,a)))}function cp(t,r,a){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=a,R1(r),r=r.next;while(r!==l)}t.action=null}function R1(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function D1(t,r){return r}function O1(t,r){if(ot){var a=Lt.formState;if(a!==null){e:{var l=Ke;if(ot){if(Ft){t:{for(var h=Ft,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){Ft=Dr(h.nextSibling),l=h.data==="F!";break e}}ca(l)}l=!1}l&&(r=a[0])}}return a=Vn(),a.memoizedState=a.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:D1,lastRenderedState:r},a.queue=l,a=G1.bind(null,Ke,l),l.dispatch=a,l=lp(!1),g=mp.bind(null,Ke,!1,l.queue),l=Vn(),h={state:r,dispatch:null,action:t,pending:null},l.queue=h,a=OT.bind(null,Ke,h,g,a),h.dispatch=a,l.memoizedState=t,[r,a,!1]}function P1(t){return M1(Yt(),Et,t)}function M1(t,r,a){if(r=op(t,r,D1)[0],t=Uc(Di)[0],typeof r=="object"&&r&&typeof r.then=="function")try{var l=cl(r)}catch(S){throw S===rs?Ac:S}else l=r;r=Yt();var h=r.queue,g=h.dispatch;return a!==r.memoizedState&&(Ke.flags|=2048,ls(9,{destroy:void 0},PT.bind(null,h,a),null)),[l,g,t]}function PT(t,r){t.action=r}function L1(t){var r=Yt(),a=Et;if(a!==null)return M1(r,a,t);Yt(),r=r.memoizedState,a=Yt();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=$c(),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 N1(){return Yt().memoizedState}function Kc(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 Qc(t,r,a,l){var h=Yt();l=l===void 0?null:l;var g=h.memoizedState.inst;Et!==null&&l!==null&&ep(l,Et.memoizedState.deps)?h.memoizedState=ls(r,g,a,l):(Ke.flags|=t,h.memoizedState=ls(1|r,g,a,l))}function I1(t,r){Kc(8390656,8,t,r)}function up(t,r){Qc(2048,8,t,r)}function MT(t){Ke.flags|=4;var r=Ke.updateQueue;if(r===null)r=$c(),Ke.updateQueue=r,r.events=[t];else{var a=r.events;a===null?r.events=[t]:a.push(t)}}function A1(t){var r=Yt().memoizedState;return MT({ref:r,nextImpl:t}),function(){if(mt&2)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function q1(t,r){return Qc(4,2,t,r)}function j1(t,r){return Qc(4,4,t,r)}function z1(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 F1(t,r,a){a=a==null?null:a.concat([t]),Qc(4,4,z1.bind(null,r,t),a)}function dp(){}function B1(t,r){var a=Yt();r=r===void 0?null:r;var l=a.memoizedState;return r!==null&&ep(r,l[1])?l[0]:(a.memoizedState=[t,r],t)}function H1(t,r){var a=Yt();r=r===void 0?null:r;var l=a.memoizedState;if(r!==null&&ep(r,l[1]))return l[0];if(l=t(),ho){Ge(!0);try{t()}finally{Ge(!1)}}return a.memoizedState=[l,r],l}function fp(t,r,a){return a===void 0||Ri&1073741824&&!(rt&261930)?t.memoizedState=r:(t.memoizedState=a,t=Fb(),Ke.lanes|=t,ga|=t,a)}function V1(t,r,a,l){return cr(a,r)?a:as.current===null?!(Ri&42)||Ri&1073741824&&!(rt&261930)?(on=!0,t.memoizedState=a):(t=Fb(),Ke.lanes|=t,ga|=t,r):(t=fp(t,a,l),cr(t,r)||(on=!0),t)}function $1(t,r,a,l,h){var g=K.p;K.p=g!==0&&8>g?g:8;var S=se.T,D={};se.T=D,mp(t,!1,r,a);try{var H=h(),te=se.S;te!==null&&te(D,H),typeof H=="object"&&H&&typeof H.then=="function"?ul(t,r,TT(H,l),Rr(t)):ul(t,r,l,Rr(t))}catch(he){ul(t,r,{then:function(){},status:"rejected",reason:he},Rr())}finally{K.p=g,S!==null&&D.types!==null&&(S.types=D.types),se.T=S}}function LT(){}function pp(t,r,a,l){if(t.tag!==5)throw Error(s(476));var h=W1(t).queue;$1(t,h,r,Le,a===null?LT:function(){return U1(t),a(l)})}function W1(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:Di,lastRenderedState:Le},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function U1(t){var r=W1(t);r.next===null&&(r=t.alternate.memoizedState),ul(t,r.next.queue,{},Rr())}function hp(){return Cn(Tl)}function K1(){return Yt().memoizedState}function Q1(){return Yt().memoizedState}function NT(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&&(Xn(l,r,a),al(l,r,a)),r={cache:Vf()},t.payload=r;return}r=r.return}}function IT(t,r,a){var l=Rr();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Gc(t)?J1(r,a):(a=Mf(t,r,a,l),a!==null&&(Xn(a,t,l),X1(a,r,l)))}function G1(t,r,a){ul(t,r,a,Rr())}function ul(t,r,a,l){var h={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Gc(t))J1(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 Dc(t,r,h,0),Lt===null&&Rc(),!1}catch{}if(a=Mf(t,r,h,l),a!==null)return Xn(a,t,l),X1(a,r,l),!0}return!1}function mp(t,r,a,l){if(l={lane:2,revertLane:Kp(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Gc(t)){if(r)throw Error(s(479))}else r=Mf(t,a,l,2),r!==null&&Xn(r,t,2)}function Gc(t){var r=t.alternate;return t===Ke||r!==null&&r===Ke}function J1(t,r){os=Hc=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function X1(t,r,a){if(a&4194048){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,or(t,a)}}var dl={readContext:Cn,use:Wc,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt};dl.useEffectEvent=Kt;var Y1={readContext:Cn,use:Wc,useCallback:function(t,r){return Vn().memoizedState=[t,r===void 0?null:r],t},useContext:Cn,useEffect:I1,useImperativeHandle:function(t,r,a){a=a==null?null:a.concat([t]),Kc(4194308,4,z1.bind(null,r,t),a)},useLayoutEffect:function(t,r){return Kc(4194308,4,t,r)},useInsertionEffect:function(t,r){Kc(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=IT.bind(null,Ke,t),[l.memoizedState,t]},useRef:function(t){var r=Vn();return t={current:t},r.memoizedState=t},useState:function(t){t=lp(t);var r=t.queue,a=G1.bind(null,Ke,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:dp,useDeferredValue:function(t,r){return fp(Vn(),t,r)},useTransition:function(){var t=lp(!1);return t=$1.bind(null,Ke,t.queue,!0,!1),Vn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var l=Ke,h=Vn();if(ot){if(a===void 0)throw Error(s(407));a=a()}else{if(a=r(),Lt===null)throw Error(s(349));rt&127||b1(l,r,a)}h.memoizedState=a;var g={value:a,getSnapshot:r};return h.queue=g,I1(_1.bind(null,l,g,t),[t]),l.flags|=2048,ls(9,{destroy:void 0},w1.bind(null,l,g,a,r),null),a},useId:function(){var t=Vn(),r=Lt.identifierPrefix;if(ot){var a=si,l=oi;a=(l&~(1<<32-ht(l)-1)).toString(32)+a,r="_"+r+"R_"+a,a=Vc++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=RT++,r="_"+r+"r_"+a.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:hp,useFormState:O1,useActionState:O1,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=mp.bind(null,Ke,!0,a),a.dispatch=r,[t,r]},useMemoCache:ap,useCacheRefresh:function(){return Vn().memoizedState=NT.bind(null,Ke)},useEffectEvent:function(t){var r=Vn(),a={impl:t};return r.memoizedState=a,function(){if(mt&2)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},gp={readContext:Cn,use:Wc,useCallback:B1,useContext:Cn,useEffect:up,useImperativeHandle:F1,useInsertionEffect:q1,useLayoutEffect:j1,useMemo:H1,useReducer:Uc,useRef:N1,useState:function(){return Uc(Di)},useDebugValue:dp,useDeferredValue:function(t,r){return V1(Yt(),Et.memoizedState,t,r)},useTransition:function(){var t=Uc(Di)[0],r=Yt().memoizedState;return[typeof t=="boolean"?t:cl(t),r]},useSyncExternalStore:v1,useId:K1,useHostTransitionStatus:hp,useFormState:P1,useActionState:P1,useOptimistic:function(t,r){return S1(Yt(),Et,t,r)},useMemoCache:ap,useCacheRefresh:Q1};gp.useEffectEvent=A1;var Z1={readContext:Cn,use:Wc,useCallback:B1,useContext:Cn,useEffect:up,useImperativeHandle:F1,useInsertionEffect:q1,useLayoutEffect:j1,useMemo:H1,useReducer:sp,useRef:N1,useState:function(){return sp(Di)},useDebugValue:dp,useDeferredValue:function(t,r){var a=Yt();return Et===null?fp(a,t,r):V1(a,Et.memoizedState,t,r)},useTransition:function(){var t=sp(Di)[0],r=Yt().memoizedState;return[typeof t=="boolean"?t:cl(t),r]},useSyncExternalStore:v1,useId:K1,useHostTransitionStatus:hp,useFormState:L1,useActionState:L1,useOptimistic:function(t,r){var a=Yt();return Et===null?(a.baseState=t,[t,a.queue.dispatch]):S1(a,Et,t,r)},useMemoCache:ap,useCacheRefresh:Q1};Z1.useEffectEvent=A1;function yp(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 vp={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&&(Xn(r,t,l),al(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&&(Xn(r,t,l),al(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&&(Xn(r,t,a),al(r,t,a))}};function eb(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?!Xs(a,l)||!Xs(h,g):!0}function tb(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&&vp.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 AT(t){Tc(t)}function qT(t){console.error(t)}function jT(t){Tc(t)}function Jc(t,r){try{var a=t.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function nb(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 bp(t,r,a){return a=fo(a),a.tag=3,a.payload={element:null},a.callback=function(){Jc(t,r)},a}function rb(t){return t=fo(t),t.tag=3,t}function ib(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(){nb(r,a,l)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){nb(r,a,l),typeof h!="function"&&(ya===null?ya=new Set([this]):ya.add(this));var D=l.stack;this.componentDidCatch(l.value,{componentStack:D===null?"":D})})}function zT(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 Ur===null?lu():a.alternate===null&&Qt===0&&(Qt=3),a.flags&=-257,a.flags|=65536,a.lanes=h,l===qc?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([l]):r.add(l),$p(t,l,h)),!1;case 22:return a.flags|=65536,l===qc?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)),$p(t,l,h)),!1}throw Error(s(435,a.tag))}return $p(t,l,h),lu(),!1}if(ot)return r=dr.current,r===null?(l!==jf&&(r=Error(s(423),{cause:l}),el(Sr(r,a))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,l=Sr(l,a),h=bp(t.stateNode,l,h),Gf(t,h),Qt!==4&&(Qt=2)):(!(r.flags&65536)&&(r.flags|=256),r.flags|=65536,r.lanes=h,l!==jf&&(t=Error(s(422),{cause:l}),el(Sr(t,a)))),!1;var g=Error(s(520),{cause:l});if(g=Sr(g,a),bl===null?bl=[g]:bl.push(g),Qt!==4&&(Qt=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=bp(a.stateNode,l,t),Gf(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"&&(ya===null||!ya.has(g))))return a.flags|=65536,h&=-h,a.lanes|=h,h=rb(h),ib(h,t,a,l),Gf(a,h),!1}a=a.return}while(a!==null);return!1}var wp=Error(s(461)),on=!1;function En(t,r,a,l){r.child=t===null?d1(r,null,a,l):uo(r,t.child,a,l)}function ab(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=tp(t,r,a,S,g,h),D=np(),t!==null&&!on?(rp(t,r,h),Oi(t,r,h)):(ot&&D&&Af(r),r.flags|=1,En(t,r,l,h),r.child)}function ob(t,r,a,l,h){if(t===null){var g=a.type;return typeof g=="function"&&!Lf(g)&&g.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=g,sb(t,r,g,l,h)):(t=Pc(a.type,null,l,r,r.mode,h),t.ref=r.ref,t.return=r,r.child=t)}if(g=t.child,!Rp(t,h)){var S=g.memoizedProps;if(a=a.compare,a=a===null?Xs:a,a(S,l)&&t.ref===r.ref)return Oi(t,r,h)}return r.flags|=1,t=Si(g,l),t.ref=r.ref,t.return=r,r.child=t}function sb(t,r,a,l,h){if(t!==null){var g=t.memoizedProps;if(Xs(g,l)&&t.ref===r.ref)if(on=!1,r.pendingProps=l=g,Rp(t,h))t.flags&131072&&(on=!0);else return r.lanes=t.lanes,Oi(t,r,h)}return _p(t,r,a,l,h)}function lb(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 cb(t,r,g,a,l)}if(a&536870912)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ic(r,g===null?null:g.cachePool),g===null?Xf():h1(r,g),m1(r);else return l=r.lanes=536870912,cb(t,r,g===null?a:g.baseLanes|a,a,l)}else g===null?(t!==null&&Ic(r,null),Xf(),pa(r)):(Ic(r,g.cachePool),h1(r,g),pa(r),r.memoizedState=null);return En(t,r,h,a),r.child}function fl(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function cb(t,r,a,l,h){var g=Wf();return g=g===null?null:{parent:rn._currentValue,pool:g},r.memoizedState={baseLanes:a,cachePool:g},t!==null&&Ic(r,null),Xf(),m1(r),t!==null&&es(t,r,l,!0),r.childLanes=h,null}function Xc(t,r){return r=Zc({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function ub(t,r,a){return uo(r,t.child,null,a),t=Xc(r,r.pendingProps),t.flags|=2,fr(r),r.memoizedState=null,t}function FT(t,r,a){var l=r.pendingProps,h=(r.flags&128)!=0;if(r.flags&=-129,t===null){if(ot){if(l.mode==="hidden")return t=Xc(r,l),r.lanes=536870912,fl(null,t);if(Zf(r),(t=Ft)?(t=k2(t,Tr),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:sa===null?null:{id:oi,overflow:si},retryLane:536870912,hydrationErrors:null},a=Jv(t),a.return=r,r.child=a,Sn=r,Ft=null)):t=null,t===null)throw ca(r);return r.lanes=536870912,null}return Xc(r,l)}var g=t.memoizedState;if(g!==null){var S=g.dehydrated;if(Zf(r),h)if(r.flags&256)r.flags&=-257,r=ub(t,r,a);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(s(558));else if(on||es(t,r,a,!1),h=(a&t.childLanes)!==0,on||h){if(l=Lt,l!==null&&(S=M(l,a),S!==0&&S!==g.retryLane))throw g.retryLane=S,no(t,S),Xn(l,t,S),wp;lu(),r=ub(t,r,a)}else t=g.treeContext,Ft=Dr(S.nextSibling),Sn=r,ot=!0,la=null,Tr=!1,t!==null&&Zv(r,t),r=Xc(r,l),r.flags|=4096;return r}return t=Si(t.child,{mode:l.mode,children:l.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Yc(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 _p(t,r,a,l,h){return oo(r),a=tp(t,r,a,l,void 0,h),l=np(),t!==null&&!on?(rp(t,r,h),Oi(t,r,h)):(ot&&l&&Af(r),r.flags|=1,En(t,r,a,h),r.child)}function db(t,r,a,l,h,g){return oo(r),r.updateQueue=null,a=y1(r,l,a,h),g1(t),l=np(),t!==null&&!on?(rp(t,r,g),Oi(t,r,g)):(ot&&l&&Af(r),r.flags|=1,En(t,r,a,g),r.child)}function fb(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=vp,r.stateNode=g,g._reactInternals=r,g=r.stateNode,g.props=l,g.state=r.memoizedState,g.refs={},Kf(r),S=a.contextType,g.context=typeof S=="object"&&S?Cn(S):Jo,g.state=r.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(yp(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&&vp.enqueueReplaceState(g,g.state,null),sl(r,l,g,h),ol(),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 te=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||te!==S)&&tb(r,g,l,S),da=!1;var ae=r.memoizedState;g.state=ae,sl(r,l,g,h),ol(),te=r.memoizedState,D||ae!==te||da?(typeof ge=="function"&&(yp(r,a,ge,l),te=r.memoizedState),(H=da||eb(r,a,H,l,ae,te,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=te),g.props=l,g.state=te,g.context=S,l=H):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{g=r.stateNode,Qf(t,r),S=r.memoizedProps,he=mo(a,S),g.props=he,ge=r.pendingProps,ae=g.context,te=a.contextType,H=Jo,typeof te=="object"&&te&&(H=Cn(te)),D=a.getDerivedStateFromProps,(te=typeof D=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S!==ge||ae!==H)&&tb(r,g,l,H),da=!1,ae=r.memoizedState,g.state=ae,sl(r,l,g,h),ol();var ue=r.memoizedState;S!==ge||ae!==ue||da||t!==null&&t.dependencies!==null&&Lc(t.dependencies)?(typeof D=="function"&&(yp(r,a,D,l),ue=r.memoizedState),(he=da||eb(r,a,he,l,ae,ue,H)||t!==null&&t.dependencies!==null&&Lc(t.dependencies))?(te||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,Yc(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=Oi(t,r,h),t}function pb(t,r,a,l){return io(),r.flags|=256,En(t,r,a,l),r.child}var xp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function kp(t){return{baseLanes:t,cachePool:a1()}}function Sp(t,r,a){return t=t===null?0:t.childLanes&~a,r&&(t|=hr),t}function hb(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:(Xt.current&2)!=0),S&&(h=!0,r.flags&=-129),S=(r.flags&32)!=0,r.flags&=-33,t===null){if(ot){if(h?fa(r):pa(r),(t=Ft)?(t=k2(t,Tr),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:sa===null?null:{id:oi,overflow:si},retryLane:536870912,hydrationErrors:null},a=Jv(t),a.return=r,r.child=a,Sn=r,Ft=null)):t=null,t===null)throw ca(r);return ah(t)?r.lanes=32:r.lanes=536870912,null}var D=l.children;return l=l.fallback,h?(pa(r),h=r.mode,D=Zc({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=kp(a),l.childLanes=Sp(t,S,a),r.memoizedState=xp,fl(null,l)):(fa(r),Cp(r,D))}var H=t.memoizedState;if(H!==null&&(D=H.dehydrated,D!==null)){if(g)r.flags&256?(fa(r),r.flags&=-257,r=Ep(t,r,a)):r.memoizedState===null?(pa(r),D=l.fallback,h=r.mode,l=Zc({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=kp(a),l.childLanes=Sp(t,S,a),r.memoizedState=xp,r=fl(null,l)):(pa(r),r.child=t.child,r.flags|=128,r=null);else if(fa(r),ah(D)){if(S=D.nextSibling&&D.nextSibling.dataset,S)var te=S.dgst;S=te,l=Error(s(419)),l.stack="",l.digest=S,el({value:l,source:null,stack:null}),r=Ep(t,r,a)}else if(on||es(t,r,a,!1),S=(a&t.childLanes)!==0,on||S){if(S=Lt,S!==null&&(l=M(S,a),l!==0&&l!==H.retryLane))throw H.retryLane=l,no(t,l),Xn(S,t,l),wp;ih(D)||lu(),r=Ep(t,r,a)}else ih(D)?(r.flags|=192,r.child=t.child,r=null):(t=H.treeContext,Ft=Dr(D.nextSibling),Sn=r,ot=!0,la=null,Tr=!1,t!==null&&Zv(r,t),r=Cp(r,l.children),r.flags|=4096);return r}return h?(pa(r),D=l.fallback,h=r.mode,H=t.child,te=H.sibling,l=Si(H,{mode:"hidden",children:l.children}),l.subtreeFlags=H.subtreeFlags&65011712,te===null?(D=ro(D,h,a,null),D.flags|=2):D=Si(te,D),D.return=r,l.return=r,l.sibling=D,r.child=l,fl(null,l),l=r.child,D=t.child.memoizedState,D===null?D=kp(a):(h=D.cachePool,h===null?h=a1():(H=rn._currentValue,h=h.parent===H?h:{parent:H,pool:H}),D={baseLanes:D.baseLanes|a,cachePool:h}),l.memoizedState=D,l.childLanes=Sp(t,S,a),r.memoizedState=xp,fl(t.child,l)):(fa(r),a=t.child,t=a.sibling,a=Si(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 Cp(t,r){return r=Zc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Zc(t,r){return t=ur(22,t,null,r),t.lanes=0,t}function Ep(t,r,a){return uo(r,t.child,null,a),t=Cp(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function mb(t,r,a){t.lanes|=r;var l=t.alternate;l!==null&&(l.lanes|=r),Bf(t.return,r,a)}function Tp(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 gb(t,r,a){var l=r.pendingProps,h=l.revealOrder,g=l.tail;l=l.children;var S=Xt.current,D=(S&2)!=0;if(D?(S=S&1|2,r.flags|=128):S&=1,Oe(Xt,S),En(t,r,l,a),l=ot?Zs:0,!D&&t!==null&&t.flags&128)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&mb(t,a,r);else if(t.tag===19)mb(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&&Bc(t)===null&&(h=a),a=a.sibling;a=h,a===null?(h=r.child,r.child=null):(h=a.sibling,a.sibling=null),Tp(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&&Bc(t)===null){r.child=h;break}t=h.sibling,h.sibling=a,a=h,h=t}Tp(r,!0,a,null,g,l);break;case"together":Tp(r,!1,null,null,void 0,l);break;default:r.memoizedState=null}return r.child}function Oi(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),ga|=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=Si(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=Si(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function Rp(t,r){return(t.lanes&r)===0?(t=t.dependencies,!!(t!==null&&Lc(t))):!0}function BT(t,r,a){switch(r.tag){case 3:cn(r,r.stateNode.containerInfo),ua(r,rn,t.memoizedState.cache),io();break;case 27:case 5:en(r);break;case 4:cn(r,r.stateNode.containerInfo);break;case 10:ua(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Zf(r),null;break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated===null?(a&r.child.childLanes)===0?(fa(r),t=Oi(t,r,a),t===null?null:t.sibling):hb(t,r,a):(fa(r),r.flags|=128,null);fa(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 gb(t,r,a);r.flags|=128}if(h=r.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Oe(Xt,Xt.current),l)break;return null;case 22:return r.lanes=0,lb(t,r,a,r.pendingProps);case 24:ua(r,rn,t.memoizedState.cache)}return Oi(t,r,a)}function yb(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps)on=!0;else{if(!Rp(t,a)&&!(r.flags&128))return on=!1,BT(t,r,a);on=!!(t.flags&131072)}else on=!1,ot&&r.flags&1048576&&Yv(r,Zs,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")Lf(t)?(l=mo(t,l),r.tag=1,r=fb(null,r,t,l,a)):(r.tag=0,r=_p(null,r,t,l,a));else{if(t!=null){var h=t.$$typeof;if(h===pe){r.tag=11,r=ab(null,r,t,l,a);break e}else if(h===V){r.tag=14,r=ob(null,r,t,l,a);break e}}throw r=ne(t)||t,Error(s(306,r,""))}}return r;case 0:return _p(t,r,r.type,r.pendingProps,a);case 1:return l=r.type,h=mo(l,r.pendingProps),fb(t,r,l,h,a);case 3:e:{if(cn(r,r.stateNode.containerInfo),t===null)throw Error(s(387));l=r.pendingProps;var g=r.memoizedState;h=g.element,Qf(t,r),sl(r,l,null,a);var S=r.memoizedState;if(l=S.cache,ua(r,rn,l),l!==g.cache&&Hf(r,[rn],a,!0),ol(),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=pb(t,r,l,a);break e}else if(l!==h){h=Sr(Error(s(424)),r),el(h),r=pb(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,Ft=Dr(t.firstChild),Sn=r,ot=!0,la=null,Tr=!0,a=d1(r,null,l,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(io(),l===h){r=Oi(t,r,a);break e}En(t,r,l,a)}r=r.child}return r;case 26:return Yc(t,r),t===null?(a=D2(r.type,null,r.pendingProps,null))?r.memoizedState=a:ot||(a=r.type,t=r.pendingProps,l=mu(qt.current).createElement(a),l[ze]=r,l[Fe]=t,Tn(l,a,t),Jt(l),r.stateNode=l):r.memoizedState=D2(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return en(r),t===null&&ot&&(l=r.stateNode=E2(r.type,r.pendingProps,qt.current),Sn=r,Tr=!0,h=Ft,_a(r.type)?(oh=h,Ft=Dr(l.firstChild)):Ft=h),En(t,r,r.pendingProps.children,a),Yc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&ot&&((h=l=Ft)&&(l=mR(l,r.type,r.pendingProps,Tr),l===null?h=!1:(r.stateNode=l,Sn=r,Ft=Dr(l.firstChild),Tr=!1,h=!0)),h||ca(r)),en(r),h=r.type,g=r.pendingProps,S=t===null?null:t.memoizedProps,l=g.children,th(h,g)?l=null:S!==null&&th(h,S)&&(r.flags|=32),r.memoizedState!==null&&(h=tp(t,r,DT,null,null,a),Tl._currentValue=h),Yc(t,r),En(t,r,l,a),r.child;case 6:return t===null&&ot&&((t=a=Ft)&&(a=gR(a,r.pendingProps,Tr),a===null?t=!1:(r.stateNode=a,Sn=r,Ft=null,t=!0)),t||ca(r)),null;case 13:return hb(t,r,a);case 4:return cn(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 ab(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,ua(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 ob(t,r,r.type,r.pendingProps,a);case 15:return sb(t,r,r.type,r.pendingProps,a);case 19:return gb(t,r,a);case 31:return FT(t,r,a);case 22:return lb(t,r,a,r.pendingProps);case 24:return oo(r),l=Cn(rn),t===null?(h=Wf(),h===null&&(h=Lt,g=Vf(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=a),h=g),r.memoizedState={parent:l,cache:h},Kf(r),ua(r,rn,h)):((t.lanes&a)!==0&&(Qf(t,r),sl(r,null,null,a),ol()),h=t.memoizedState,g=r.memoizedState,h.parent===l?(l=g.cache,ua(r,rn,l),l!==h.cache&&Hf(r,[rn],a,!0)):(h={parent:l,cache:l},r.memoizedState=h,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=h),ua(r,rn,l))),En(t,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Pi(t){t.flags|=4}function Dp(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($b())t.flags|=8192;else throw co=qc,Uf}else t.flags&=-16777217}function vb(t,r){if(r.type!=="stylesheet"||r.state.loading&4)t.flags&=-16777217;else if(t.flags|=16777216,!N2(r))if($b())t.flags|=8192;else throw co=qc,Uf}function eu(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag===22?536870912:vi(),t.lanes|=r,fs|=r)}function pl(t,r){if(!ot)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 Bt(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 HT(t,r,a){var l=r.pendingProps;switch(qf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bt(r),null;case 1:return Bt(r),null;case 3:return a=r.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),Ti(rn),We(),a.pendingContext&&(a.pendingContext=(a.context=a.pendingContext,null)),(t===null||t.child===null)&&(Zo(r)?Pi(r):t===null||t.memoizedState.isDehydrated&&!(r.flags&256)||(r.flags|=1024,zf())),Bt(r),null;case 26:var h=r.type,g=r.memoizedState;return t===null?(Pi(r),g===null?(Bt(r),Dp(r,h,null,l,a)):(Bt(r),vb(r,g))):g?g===t.memoizedState?(Bt(r),r.flags&=-16777217):(Pi(r),Bt(r),vb(r,g)):(t=t.memoizedProps,t!==l&&Pi(r),Bt(r),Dp(r,h,t,l,a)),null;case 27:if(vt(r),a=qt.current,h=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Pi(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Bt(r),null}t=Ne.current,Zo(r)?e1(r,t):(t=E2(h,l,a),r.stateNode=t,Pi(r))}return Bt(r),null;case 5:if(vt(r),h=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Pi(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Bt(r),null}if(g=Ne.current,Zo(r))e1(r,g);else{var S=mu(qt.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[ze]=r,g[Fe]=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&&Pi(r)}}return Bt(r),Dp(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,a),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==l&&Pi(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(t=qt.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[ze]=r,t=!!(t.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||m2(t.nodeValue,a)),t||ca(r,!0)}else t=mu(t).createTextNode(l),t[ze]=r,r.stateNode=t}return Bt(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[ze]=r}else io(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Bt(r),t=!1}else a=zf(),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 Bt(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[ze]=r}else io(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Bt(r),h=!1}else h=zf(),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),eu(r,r.updateQueue),Bt(r),null);case 4:return We(),t===null&&d2(r.stateNode.containerInfo),Bt(r),null;case 10:return Ti(r.type),Bt(r),null;case 19:if(He(Xt),l=r.memoizedState,l===null)return Bt(r),null;if(h=(r.flags&128)!=0,g=l.rendering,g===null)if(h)pl(l,!1);else{if(Qt!==0||t!==null&&t.flags&128)for(t=r.child;t!==null;){if(g=Bc(t),g!==null){for(r.flags|=128,pl(l,!1),t=g.updateQueue,r.updateQueue=t,eu(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)Gv(a,t),a=a.sibling;return Oe(Xt,Xt.current&1|2),ot&&Ci(r,l.treeForkCount),r.child}t=t.sibling}l.tail!==null&&Wt()>au&&(r.flags|=128,h=!0,pl(l,!1),r.lanes=4194304)}else{if(!h)if(t=Bc(g),t!==null){if(r.flags|=128,h=!0,t=t.updateQueue,r.updateQueue=t,eu(r,t),pl(l,!0),l.tail===null&&l.tailMode==="hidden"&&!g.alternate&&!ot)return Bt(r),null}else 2*Wt()-l.renderingStartTime>au&&a!==536870912&&(r.flags|=128,h=!0,pl(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?(Bt(r),null):(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Wt(),t.sibling=null,a=Xt.current,Oe(Xt,h?a&1|2:a&1),ot&&Ci(r,l.treeForkCount),t);case 22:case 23:return fr(r),Yf(),l=r.memoizedState!==null,t===null?l&&(r.flags|=8192):t.memoizedState!==null!==l&&(r.flags|=8192),l?a&536870912&&!(r.flags&128)&&(Bt(r),r.subtreeFlags&6&&(r.flags|=8192)):Bt(r),a=r.updateQueue,a!==null&&eu(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&&He(so),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Ti(rn),Bt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function VT(t,r){switch(qf(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Ti(rn),We(),t=r.flags,t&65536&&!(t&128)?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return vt(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 He(Xt),null;case 4:return We(),null;case 10:return Ti(r.type),null;case 22:case 23:return fr(r),Yf(),t!==null&&He(so),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Ti(rn),null;case 25:return null;default:return null}}function bb(t,r){switch(qf(r),r.tag){case 3:Ti(rn),We();break;case 26:case 27:case 5:vt(r);break;case 4:We();break;case 31:r.memoizedState!==null&&fr(r);break;case 13:fr(r);break;case 19:He(Xt);break;case 10:Ti(r.type);break;case 22:case 23:fr(r),Yf(),t!==null&&He(so);break;case 24:Ti(rn)}}function hl(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){St(r,r.return,D)}}function ha(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,te=D;try{te()}catch(he){St(h,H,he)}}}l=l.next}while(l!==g)}}catch(he){St(r,r.return,he)}}function wb(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{p1(r,a)}catch(l){St(t,t.return,l)}}}function _b(t,r,a){a.props=mo(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(l){St(t,r,l)}}function ml(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){St(t,r,h)}}function li(t,r){var a=t.ref,l=t.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(h){St(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){St(t,r,h)}else a.current=null}function xb(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){St(t,t.return,h)}}function Op(t,r,a){try{var l=t.stateNode;cR(l,t.type,a,r),l[Fe]=r}catch(h){St(t,t.return,h)}}function kb(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&_a(t.type)||t.tag===4}function Pp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||kb(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&&_a(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 Mp(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&&_a(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(Mp(t,r,a),t=t.sibling;t!==null;)Mp(t,r,a),t=t.sibling}function tu(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&&_a(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(tu(t,r,a),t=t.sibling;t!==null;)tu(t,r,a),t=t.sibling}function Sb(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[ze]=t,r[Fe]=a}catch(g){St(t,t.return,g)}}var Mi=!1,sn=!1,Lp=!1,Cb=typeof WeakSet=="function"?WeakSet:Set,kn=null;function $T(t,r){if(t=t.containerInfo,Zp=xu,t=Fv(t),Ef(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,te=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&&++te===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(eh={focusedElem:t,selectionRange:a},xu=!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(Ae){St(a,a.return,Ae)}}break;case 3:if(t&1024){if(t=r.stateNode.containerInfo,a=t.nodeType,a===9)rh(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":rh(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 Eb(t,r,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Ni(t,a),l&4&&hl(5,a);break;case 1:if(Ni(t,a),l&4)if(t=a.stateNode,r===null)try{t.componentDidMount()}catch(S){St(a,a.return,S)}else{var h=mo(a.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(h,r,t.__reactInternalSnapshotBeforeUpdate)}catch(S){St(a,a.return,S)}}l&64&&wb(a),l&512&&ml(a,a.return);break;case 3:if(Ni(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{p1(t,r)}catch(S){St(a,a.return,S)}}break;case 27:r===null&&l&4&&Sb(a);case 26:case 5:Ni(t,a),r===null&&l&4&&xb(a),l&512&&ml(a,a.return);break;case 12:Ni(t,a);break;case 31:Ni(t,a),l&4&&Db(t,a);break;case 13:Ni(t,a),l&4&&Ob(t,a),l&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=ZT.bind(null,a),yR(t,a))));break;case 22:if(l=a.memoizedState!==null||Mi,!l){r=r!==null&&r.memoizedState!==null||sn,h=Mi;var g=sn;Mi=l,(sn=r)&&!g?Ii(t,a,(a.subtreeFlags&8772)!=0):Ni(t,a),Mi=h,sn=g}break;case 30:break;default:Ni(t,a)}}function Tb(t){var r=t.alternate;r!==null&&(t.alternate=null,Tb(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 $t=null,Kn=!1;function Li(t,r,a){for(a=a.child;a!==null;)Rb(t,r,a),a=a.sibling}function Rb(t,r,a){if(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount(wr,a)}catch{}switch(a.tag){case 26:sn||li(a,r),Li(t,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:sn||li(a,r);var l=$t,h=Kn;_a(a.type)&&($t=a.stateNode,Kn=!1),Li(t,r,a),Sl(a.stateNode),$t=l,Kn=h;break;case 5:sn||li(a,r);case 6:if(l=$t,h=Kn,$t=null,Li(t,r,a),$t=l,Kn=h,$t!==null)if(Kn)try{($t.nodeType===9?$t.body:$t.nodeName==="HTML"?$t.ownerDocument.body:$t).removeChild(a.stateNode)}catch(g){St(a,r,g)}else try{$t.removeChild(a.stateNode)}catch(g){St(a,r,g)}break;case 18:$t!==null&&(Kn?(t=$t,_2(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ws(t)):_2($t,a.stateNode));break;case 4:l=$t,h=Kn,$t=a.stateNode.containerInfo,Kn=!0,Li(t,r,a),$t=l,Kn=h;break;case 0:case 11:case 14:case 15:ha(2,a,r),sn||ha(4,a,r),Li(t,r,a);break;case 1:sn||(li(a,r),l=a.stateNode,typeof l.componentWillUnmount=="function"&&_b(a,r,l)),Li(t,r,a);break;case 21:Li(t,r,a);break;case 22:sn=(l=sn)||a.memoizedState!==null,Li(t,r,a),sn=l;break;default:Li(t,r,a)}}function Db(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ws(t)}catch(a){St(r,r.return,a)}}}function Ob(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){St(r,r.return,a)}}function WT(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new Cb),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new Cb),r;default:throw Error(s(435,t.tag))}}function nu(t,r){var a=WT(t);r.forEach(function(l){if(!a.has(l)){a.add(l);var h=eR.bind(null,t,l);l.then(h,h)}})}function Qn(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(_a(D.type)){$t=D.stateNode,Kn=!1;break e}break;case 5:$t=D.stateNode,Kn=!1;break e;case 3:case 4:$t=D.stateNode.containerInfo,Kn=!0;break e}D=D.return}if($t===null)throw Error(s(160));Rb(g,S,h),$t=null,Kn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Pb(r,t),r=r.sibling}var Kr=null;function Pb(t,r){var a=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Qn(r,t),Gn(t),l&4&&(ha(3,t,t.return),hl(3,t),ha(5,t,t.return));break;case 1:Qn(r,t),Gn(t),l&512&&(sn||a===null||li(a,a.return)),l&64&&Mi&&(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=Kr;if(Qn(r,t),Gn(t),l&512&&(sn||a===null||li(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[ze]||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[ze]=t,Jt(g),l=g;break e;case"link":var S=M2("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=M2("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[ze]=t,Jt(g),l=g}t.stateNode=l}else L2(h,t.type,t.stateNode);else t.stateNode=P2(h,l,t.memoizedProps);else g===l?l===null&&t.stateNode!==null&&Op(t,t.memoizedProps,a.memoizedProps):(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,l===null?L2(h,t.type,t.stateNode):P2(h,l,t.memoizedProps))}break;case 27:Qn(r,t),Gn(t),l&512&&(sn||a===null||li(a,a.return)),a!==null&&l&4&&Op(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Qn(r,t),Gn(t),l&512&&(sn||a===null||li(a,a.return)),t.flags&32){h=t.stateNode;try{_i(h,"")}catch(De){St(t,t.return,De)}}l&4&&t.stateNode!=null&&(h=t.memoizedProps,Op(t,h,a===null?h:a.memoizedProps)),l&1024&&(Lp=!0);break;case 6:if(Qn(r,t),Gn(t),l&4){if(t.stateNode===null)throw Error(s(162));l=t.memoizedProps,a=t.stateNode;try{a.nodeValue=l}catch(De){St(t,t.return,De)}}break;case 3:if(vu=null,h=Kr,Kr=gu(r.containerInfo),Qn(r,t),Kr=h,Gn(t),l&4&&a!==null&&a.memoizedState.isDehydrated)try{ws(r.containerInfo)}catch(De){St(t,t.return,De)}Lp&&(Lp=!1,Mb(t));break;case 4:l=Kr,Kr=gu(t.stateNode.containerInfo),Qn(r,t),Gn(t),Kr=l;break;case 12:Qn(r,t),Gn(t);break;case 31:Qn(r,t),Gn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,nu(t,l)));break;case 13:Qn(r,t),Gn(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(iu=Wt()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,nu(t,l)));break;case 22:h=t.memoizedState!==null;var H=a!==null&&a.memoizedState!==null,te=Mi,he=sn;if(Mi=te||h,sn=he||H,Qn(r,t),sn=he,Mi=te,Gn(t),l&8192)e:for(r=t.stateNode,r._visibility=h?r._visibility&-2:r._visibility|1,h&&(a===null||H||Mi||sn||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){St(H,H.return,De)}}}else if(r.tag===6){if(a===null){H=r;try{H.stateNode.nodeValue=h?"":H.memoizedProps}catch(De){St(H,H.return,De)}}}else if(r.tag===18){if(a===null){H=r;try{var ue=H.stateNode;h?x2(ue,!0):x2(H.stateNode,!1)}catch(De){St(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,nu(t,a))));break;case 19:Qn(r,t),Gn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,nu(t,l)));break;case 30:break;case 21:break;default:Qn(r,t),Gn(t)}}function Gn(t){var r=t.flags;if(r&2){try{for(var a,l=t.return;l!==null;){if(kb(l)){a=l;break}l=l.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var h=a.stateNode;tu(t,Pp(t),h);break;case 5:var g=a.stateNode;a.flags&32&&(_i(g,""),a.flags&=-33),tu(t,Pp(t),g);break;case 3:case 4:var S=a.stateNode.containerInfo;Mp(t,Pp(t),S);break;default:throw Error(s(161))}}catch(D){St(t,t.return,D)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function Mb(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;Mb(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Ni(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Eb(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:ha(4,r,r.return),go(r);break;case 1:li(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&_b(r,r.return,a),go(r);break;case 27:Sl(r.stateNode);case 26:case 5:li(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 Ii(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:Ii(h,g,a),hl(4,g);break;case 1:if(Ii(h,g,a),l=g,h=l.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(te){St(l,l.return,te)}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++)f1(H[h],D)}catch(te){St(l,l.return,te)}}a&&S&64&&wb(g),ml(g,g.return);break;case 27:Sb(g);case 26:case 5:Ii(h,g,a),a&&l===null&&S&4&&xb(g),ml(g,g.return);break;case 12:Ii(h,g,a);break;case 31:Ii(h,g,a),a&&S&4&&Db(h,g);break;case 13:Ii(h,g,a),a&&S&4&&Ob(h,g);break;case 22:g.memoizedState===null&&Ii(h,g,a),ml(g,g.return);break;case 30:break;default:Ii(h,g,a)}r=r.sibling}}function Np(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&&tl(a))}function Ip(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&tl(t))}function Qr(t,r,a,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Lb(t,r,a,l),r=r.sibling}function Lb(t,r,a,l){var h=r.flags;switch(r.tag){case 0:case 11:case 15:Qr(t,r,a,l),h&2048&&hl(9,r);break;case 1:Qr(t,r,a,l);break;case 3:Qr(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&&tl(t)));break;case 12:if(h&2048){Qr(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){St(r,r.return,H)}}else Qr(t,r,a,l);break;case 31:Qr(t,r,a,l);break;case 13:Qr(t,r,a,l);break;case 23:break;case 22:g=r.stateNode,S=r.alternate,r.memoizedState===null?g._visibility&2?Qr(t,r,a,l):(g._visibility|=2,cs(t,r,a,l,(r.subtreeFlags&10256)!=0||!1)):g._visibility&2?Qr(t,r,a,l):gl(t,r),h&2048&&Np(S,r);break;case 24:Qr(t,r,a,l),h&2048&&Ip(r.alternate,r);break;default:Qr(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,te=S.flags;switch(S.tag){case 0:case 11:case 15:cs(g,S,D,H,h),hl(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):gl(g,S),h&&te&2048&&Np(S.alternate,S);break;case 24:cs(g,S,D,H,h),h&&te&2048&&Ip(S.alternate,S);break;default:cs(g,S,D,H,h)}r=r.sibling}}function gl(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:gl(a,l),h&2048&&Np(l.alternate,l);break;case 24:gl(a,l),h&2048&&Ip(l.alternate,l);break;default:gl(a,l)}r=r.sibling}}var yl=8192;function us(t,r,a){if(t.subtreeFlags&yl)for(t=t.child;t!==null;)Nb(t,r,a),t=t.sibling}function Nb(t,r,a){switch(t.tag){case 26:us(t,r,a),t.flags&yl&&t.memoizedState!==null&&DR(a,Kr,t.memoizedState,t.memoizedProps);break;case 5:us(t,r,a);break;case 3:case 4:var l=Kr;Kr=gu(t.stateNode.containerInfo),us(t,r,a),Kr=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=yl,yl=16777216,us(t,r,a),yl=l):us(t,r,a));break;default:us(t,r,a)}}function Ib(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 vl(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,qb(l,t)}Ib(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ab(t),t=t.sibling}function Ab(t){switch(t.tag){case 0:case 11:case 15:vl(t),t.flags&2048&&ha(9,t,t.return);break;case 3:vl(t);break;case 12:vl(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,ru(t)):vl(t);break;default:vl(t)}}function ru(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,qb(l,t)}Ib(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:ha(8,r,r.return),ru(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,ru(r));break;default:ru(r)}t=t.sibling}}function qb(t,r){for(;kn!==null;){var a=kn;switch(a.tag){case 0:case 11:case 15:ha(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:tl(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(Tb(l),l===a){kn=null;break e}if(h!==null){h.return=g,kn=h;break e}kn=g}}}var UT={getCacheForType:function(t){var r=Cn(rn),a=r.data.get(t);return a===void 0&&(a=t(),r.data.set(t,a)),a},cacheSignal:function(){return Cn(rn).controller.signal}},KT=typeof WeakMap=="function"?WeakMap:Map,mt=0,Lt=null,et=null,rt=0,kt=0,pr=null,ma=!1,ds=!1,Ap=!1,Ai=0,Qt=0,ga=0,yo=0,qp=0,hr=0,fs=0,bl=null,Jn=null,jp=!1,iu=0,jb=0,au=1/0,ou=null,ya=null,pn=0,va=null,ps=null,qi=0,zp=0,Fp=null,zb=null,wl=0,Bp=null;function Rr(){return mt&2&&rt!==0?rt&-rt:se.T===null?ee():Kp()}function Fb(){if(hr===0)if(!(rt&536870912)||ot){var t=xt;xt<<=1,!(xt&3932160)&&(xt=262144),hr=t}else hr=536870912;return t=dr.current,t!==null&&(t.flags|=32),hr}function Xn(t,r,a){(t===Lt&&(kt===2||kt===9)||t.cancelPendingCommit!==null)&&(hs(t,0),ba(t,rt,hr,!1)),Ln(t,a),(!(mt&2)||t!==Lt)&&(t===Lt&&(!(mt&2)&&(yo|=a),Qt===4&&ba(t,rt,hr,!1)),ji(t))}function Bb(t,r,a){if(mt&6)throw Error(s(327));var l=!a&&(r&127)==0&&(r&t.expiredLanes)===0||bn(t,r),h=l?JT(t,r):Vp(t,r,!0),g=l;do{if(h===0){ds&&!l&&ba(t,r,0,!1);break}else{if(a=t.current.alternate,g&&!QT(a)){h=Vp(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=bl;var H=D.current.memoizedState.isDehydrated;if(H&&(hs(D,S).flags|=256),S=Vp(D,S,!1),S!==2){if(Ap&&!H){D.errorRecoveryDisabledLanes|=g,yo|=g,h=4;break e}g=Jn,Jn=h,g!==null&&(Jn===null?Jn=g:Jn.push.apply(Jn,g))}h=S}if(g=!1,h!==2)continue}}if(h===1){hs(t,0),ba(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:ba(l,r,hr,!ma);break e;case 2:Jn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(h=iu+300-Wt(),10<h)){if(ba(l,r,hr,!ma),Br(l,0,!0)!==0)break e;qi=r,l.timeoutHandle=b2(Hb.bind(null,l,a,Jn,ou,jp,r,hr,yo,fs,ma,g,"Throttled",-0,0),h);break e}Hb(l,a,Jn,ou,jp,r,hr,yo,fs,ma,g,null,-0,0)}}break}while(!0);ji(t)}function Hb(t,r,a,l,h,g,S,D,H,te,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},Nb(r,g,ge);var De=(g&62914560)===g?iu-Wt():(g&4194048)===g?jb-Wt():0;if(De=OR(ge,De),De!==null){qi=g,t.cancelPendingCommit=De(Jb.bind(null,t,r,g,a,l,h,S,D,H,he,ge,null,ae,ue)),ba(t,g,S,!te);return}}Jb(t,r,g,a,l,h,S,D,H)}function QT(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 ba(t,r,a,l){r&=~qp,r&=~yo,t.suspendedLanes|=r,t.pingedLanes&=~r,l&&(t.warmLanes|=r),l=t.expirationTimes;for(var h=r;0<h;){var g=31-ht(h),S=1<<g;l[g]=-1,h&=~S}a!==0&&zn(t,a,r)}function su(){return mt&6?!0:(_l(0,!1),!1)}function Hp(){if(et!==null){if(kt===0)var t=et.return;else t=et,Ei=ao=null,ip(t),is=null,rl=0,t=et;for(;t!==null;)bb(t.alternate,t),t=t.return;et=null}}function hs(t,r){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,fR(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),qi=0,Hp(),Lt=t,et=a=Si(t.current,null),rt=r,kt=0,pr=null,ma=!1,ds=bn(t,r),Ap=!1,fs=hr=qp=yo=ga=Qt=0,Jn=bl=null,jp=!1,r&8&&(r|=r&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=r;0<l;){var h=31-ht(l),g=1<<h;r|=t[h],l&=~g}return Ai=r,Rc(),a}function Vb(t,r){Ke=null,se.H=dl,r===rs||r===Ac?(r=l1(),kt=3):r===Uf?(r=l1(),kt=4):kt=r===wp?8:typeof r=="object"&&r&&typeof r.then=="function"?6:1,pr=r,et===null&&(Qt=1,Jc(t,Sr(r,t.current)))}function $b(){var t=dr.current;return t===null?!0:(rt&4194048)===rt?Ur===null:(rt&62914560)===rt||rt&536870912?t===Ur:!1}function Wb(){var t=se.H;return se.H=dl,t===null?dl:t}function Ub(){var t=se.A;return se.A=UT,t}function lu(){Qt=4,ma||(rt&4194048)!==rt&&dr.current!==null||(ds=!0),!(ga&134217727)&&!(yo&134217727)||Lt===null||ba(Lt,rt,hr,!1)}function Vp(t,r,a){var l=mt;mt|=2;var h=Wb(),g=Ub();(Lt!==t||rt!==r)&&(ou=null,hs(t,r)),r=!1;var S=Qt;e:do try{if(kt!==0&&et!==null){var D=et,H=pr;switch(kt){case 8:Hp(),S=6;break e;case 3:case 2:case 9:case 6:dr.current===null&&(r=!0);var te=kt;if(kt=0,pr=null,ms(t,D,H,te),a&&ds){S=0;break e}break;default:te=kt,kt=0,pr=null,ms(t,D,H,te)}}GT(),S=Qt;break}catch(he){Vb(t,he)}while(!0);return r&&t.shellSuspendCounter++,Ei=ao=null,mt=l,se.H=h,se.A=g,et===null&&(Lt=null,rt=0,Rc()),S}function GT(){for(;et!==null;)Kb(et)}function JT(t,r){var a=mt;mt|=2;var l=Wb(),h=Ub();Lt!==t||rt!==r?(ou=null,au=Wt()+500,hs(t,r)):ds=bn(t,r);e:do try{if(kt!==0&&et!==null){r=et;var g=pr;t:switch(kt){case 1:kt=0,pr=null,ms(t,r,g,1);break;case 2:case 9:if(o1(g)){kt=0,pr=null,Qb(r);break}r=function(){kt!==2&&kt!==9||Lt!==t||(kt=7),ji(t)},g.then(r,r);break e;case 3:kt=7;break e;case 4:kt=5;break e;case 7:o1(g)?(kt=0,pr=null,Qb(r)):(kt=0,pr=null,ms(t,r,g,7));break;case 5:var S=null;switch(et.tag){case 26:S=et.memoizedState;case 5:case 27:var D=et;if(S?N2(S):D.stateNode.complete){kt=0,pr=null;var H=D.sibling;if(H!==null)et=H;else{var te=D.return;te===null?et=null:(et=te,cu(te))}break t}}kt=0,pr=null,ms(t,r,g,5);break;case 6:kt=0,pr=null,ms(t,r,g,6);break;case 8:Hp(),Qt=6;break e;default:throw Error(s(462))}}XT();break}catch(he){Vb(t,he)}while(!0);return Ei=ao=null,se.H=l,se.A=h,mt=a,et===null?(Lt=null,rt=0,Rc(),Qt):0}function XT(){for(;et!==null&&!ea();)Kb(et)}function Kb(t){var r=yb(t.alternate,t,Ai);t.memoizedProps=t.pendingProps,r===null?cu(t):et=r}function Qb(t){var r=t,a=r.alternate;switch(r.tag){case 15:case 0:r=db(a,r,r.pendingProps,r.type,void 0,rt);break;case 11:r=db(a,r,r.pendingProps,r.type.render,r.ref,rt);break;case 5:ip(r);default:bb(a,r),r=et=Gv(r,Ai),r=yb(a,r,Ai)}t.memoizedProps=t.pendingProps,r===null?cu(t):et=r}function ms(t,r,a,l){Ei=ao=null,ip(r),is=null,rl=0;var h=r.return;try{if(zT(t,h,r,a,rt)){Qt=1,Jc(t,Sr(a,t.current)),et=null;return}}catch(g){if(h!==null)throw et=h,g;Qt=1,Jc(t,Sr(a,t.current)),et=null;return}r.flags&32768?(ot||l===1?t=!0:ds||rt&536870912?t=!1:(ma=t=!0,(l===2||l===9||l===3||l===6)&&(l=dr.current,l!==null&&l.tag===13&&(l.flags|=16384))),Gb(r,t)):cu(r)}function cu(t){var r=t;do{if(r.flags&32768){Gb(r,ma);return}t=r.return;var a=HT(r.alternate,r,Ai);if(a!==null){et=a;return}if(r=r.sibling,r!==null){et=r;return}et=r=t}while(r!==null);Qt===0&&(Qt=5)}function Gb(t,r){do{var a=VT(t.alternate,t);if(a!==null){a.flags&=32767,et=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(t=t.sibling,t!==null)){et=t;return}et=t=a}while(t!==null);Qt=6,et=null}function Jb(t,r,a,l,h,g,S,D,H){t.cancelPendingCommit=null;do uu();while(pn!==0);if(mt&6)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(g=r.lanes|r.childLanes,g|=Pf,bi(t,a,g,S,D,H),t===Lt&&(et=Lt=null,rt=0),ps=r,va=t,qi=a,zp=g,Fp=h,zb=l,r.subtreeFlags&10256||r.flags&10256?(t.callbackNode=null,t.callbackPriority=0,tR(jt,function(){return t2(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(r.flags&13878)!=0,r.subtreeFlags&13878||l){l=se.T,se.T=null,h=K.p,K.p=2,S=mt,mt|=4;try{$T(t,r,a)}finally{mt=S,K.p=h,se.T=l}}pn=1,Xb(),Yb(),Zb()}}function Xb(){if(pn===1){pn=0;var t=va,r=ps,a=(r.flags&13878)!=0;if(r.subtreeFlags&13878||a){a=se.T,se.T=null;var l=K.p;K.p=2;var h=mt;mt|=4;try{Pb(r,t);var g=eh,S=Fv(t.containerInfo),D=g.focusedElem,H=g.selectionRange;if(S!==D&&D&&D.ownerDocument&&zv(D.ownerDocument.documentElement,D)){if(H!==null&&Ef(D)){var te=H.start,he=H.end;if(he===void 0&&(he=te),"selectionStart"in D)D.selectionStart=te,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,Ae=Math.min(H.start,De),Rt=H.end===void 0?Ae:Math.min(H.end,De);!ue.extend&&Ae>Rt&&(S=Rt,Rt=Ae,Ae=S);var Q=jv(D,Ae),W=jv(D,Rt);if(Q&&W&&(ue.rangeCount!==1||ue.anchorNode!==Q.node||ue.anchorOffset!==Q.offset||ue.focusNode!==W.node||ue.focusOffset!==W.offset)){var Z=ge.createRange();Z.setStart(Q.node,Q.offset),ue.removeAllRanges(),Ae>Rt?(ue.addRange(Z),ue.extend(W.node,W.offset)):(Z.setEnd(W.node,W.offset),ue.addRange(Z))}}}}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}}xu=!!Zp,eh=Zp=null}finally{mt=h,K.p=l,se.T=a}}t.current=r,pn=2}}function Yb(){if(pn===2){pn=0;var t=va,r=ps,a=(r.flags&8772)!=0;if(r.subtreeFlags&8772||a){a=se.T,se.T=null;var l=K.p;K.p=2;var h=mt;mt|=4;try{Eb(t,r.alternate,r)}finally{mt=h,K.p=l,se.T=a}}pn=3}}function Zb(){if(pn===4||pn===3){pn=0,mi();var t=va,r=ps,a=qi,l=zb;r.subtreeFlags&10256||r.flags&10256?pn=5:(pn=0,ps=va=null,e2(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(ya=null),j(a),r=r.stateNode,Gt&&typeof Gt.onCommitFiberRoot=="function")try{Gt.onCommitFiberRoot(wr,r,void 0,(r.current.flags&128)==128)}catch{}if(l!==null){r=se.T,h=K.p,K.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,K.p=h}}qi&3&&uu(),ji(t),h=t.pendingLanes,a&261930&&h&42?t===Bp?wl++:(wl=0,Bp=t):wl=0,_l(0,!1)}}function e2(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,tl(r)))}function uu(){return Xb(),Yb(),Zb(),t2()}function t2(){if(pn!==5)return!1;var t=va,r=zp;zp=0;var a=j(qi),l=se.T,h=K.p;try{K.p=32>a?32:a,se.T=null,a=Fp,Fp=null;var g=va,S=qi;if(pn=0,ps=va=null,qi=0,mt&6)throw Error(s(331));var D=mt;if(mt|=4,Ab(g.current),Lb(g,g.current,S,a),mt=D,_l(0,!1),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot(wr,g)}catch{}return!0}finally{K.p=h,se.T=l,e2(t,r)}}function n2(t,r,a){r=Sr(a,r),r=bp(t.stateNode,r,2),t=po(t,r,2),t!==null&&(Ln(t,2),ji(t))}function St(t,r,a){if(t.tag===3)n2(t,t,a);else for(;r!==null;){if(r.tag===3){n2(r,t,a);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ya===null||!ya.has(l))){t=Sr(a,t),a=rb(2),l=po(r,a,2),l!==null&&(ib(a,l,r,t),Ln(l,2),ji(l));break}}r=r.return}}function $p(t,r,a){var l=t.pingCache;if(l===null){l=t.pingCache=new KT;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)||(Ap=!0,h.add(a),t=YT.bind(null,t,r,a),r.then(t,t))}function YT(t,r,a){var l=t.pingCache;l!==null&&l.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Lt===t&&(rt&a)===a&&(Qt===4||Qt===3&&(rt&62914560)===rt&&300>Wt()-iu?!(mt&2)&&hs(t,0):qp|=a,fs===rt&&(fs=0)),ji(t)}function r2(t,r){r===0&&(r=vi()),t=no(t,r),t!==null&&(Ln(t,r),ji(t))}function ZT(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),r2(t,a)}function eR(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),r2(t,a)}function tR(t,r){return Pn(t,r)}var du=null,gs=null,Wp=!1,fu=!1,Up=!1,wa=0;function ji(t){t!==gs&&t.next===null&&(gs===null?du=gs=t:gs=gs.next=t),fu=!0,Wp||(Wp=!0,rR())}function _l(t,r){if(!Up&&fu){Up=!0;do for(var a=!1,l=du;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-ht(42|t)+1)-1,g&=h&~(S&~D),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,s2(l,g))}else g=rt,g=Br(l,l===Lt?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),!(g&3)||bn(l,g)||(a=!0,s2(l,g));l=l.next}while(a);Up=!1}}function nR(){i2()}function i2(){fu=Wp=!1;var t=0;wa!==0&&dR()&&(t=wa);for(var r=Wt(),a=null,l=du;l!==null;){var h=l.next,g=a2(l,r);g===0?(l.next=null,a===null?du=h:a.next=h,h===null&&(gs=a)):(a=l,(t!==0||g&3)&&(fu=!0)),l=h}pn!==0&&pn!==5||_l(t,!1),wa!==0&&(wa=0)}function a2(t,r){for(var a=t.suspendedLanes,l=t.pingedLanes,h=t.expirationTimes,g=t.pendingLanes&-62914561;0<g;){var S=31-ht(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=Lt,a=rt,a=Br(t,t===r?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,a===0||t===r&&(kt===2||kt===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&un(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&&un(l),j(a)){case 2:case 8:a=ti;break;case 32:a=jt;break;case 268435456:a=bt;break;default:a=jt}return l=o2.bind(null,t),a=Pn(a,l),t.callbackPriority=r,t.callbackNode=a,r}return l!==null&&l!==null&&un(l),t.callbackPriority=2,t.callbackNode=null,2}function o2(t,r){if(pn!==0&&pn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(uu()&&t.callbackNode!==a)return null;var l=rt;return l=Br(t,t===Lt?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(Bb(t,l,r),a2(t,Wt()),t.callbackNode!=null&&t.callbackNode===a?o2.bind(null,t):null)}function s2(t,r){if(uu())return null;Bb(t,r,!0)}function rR(){pR(function(){mt&6?Pn(dn,nR):i2()})}function Kp(){if(wa===0){var t=ts;t===0&&(t=_r,_r<<=1,!(_r&261888)&&(_r=256)),wa=t}return wa}function l2(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Vo(""+t)}function c2(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 iR(t,r,a,l,h){if(r==="submit"&&a&&a.stateNode===h){var g=l2((h[Fe]||null).action),S=l.submitter;S&&(r=(r=S[Fe]||null)?l2(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(wa!==0){var H=S?c2(h,S):new FormData(h);pp(a,{pending:!0,data:H,method:h.method,action:g},null,H)}}else typeof g=="function"&&(D.preventDefault(),H=S?c2(h,S):new FormData(h),pp(a,{pending:!0,data:H,method:h.method,action:g},g,H))},currentTarget:h}]})}}for(var Qp=0;Qp<Of.length;Qp++){var Gp=Of[Qp];Wr(Gp.toLowerCase(),"on"+(Gp[0].toUpperCase()+Gp.slice(1)))}Wr(Vv,"onAnimationEnd"),Wr($v,"onAnimationIteration"),Wr(Wv,"onAnimationStart"),Wr("dblclick","onDoubleClick"),Wr("focusin","onFocus"),Wr("focusout","onBlur"),Wr(bT,"onTransitionRun"),Wr(wT,"onTransitionStart"),Wr(_T,"onTransitionCancel"),Wr(Uv,"onTransitionEnd"),ra("onMouseEnter",["mouseout","mouseover"]),ra("onMouseLeave",["mouseout","mouseover"]),ra("onPointerEnter",["pointerout","pointerover"]),ra("onPointerLeave",["pointerout","pointerover"]),ii("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ii("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ii("onBeforeInput",["compositionend","keypress","textInput","paste"]),ii("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xl="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(" "),aR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xl));function u2(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,te=D.currentTarget;if(D=D.listener,H!==g&&h.isPropagationStopped())break e;g=D,h.currentTarget=te;try{g(h)}catch(he){Tc(he)}h.currentTarget=null,g=H}else for(S=0;S<l.length;S++){if(D=l[S],H=D.instance,te=D.currentTarget,D=D.listener,H!==g&&h.isPropagationStopped())break e;g=D,h.currentTarget=te;try{g(h)}catch(he){Tc(he)}h.currentTarget=null,g=H}}}}function tt(t,r){var a=r[Ot];a===void 0&&(a=r[Ot]=new Set);var l=t+"__bubble";a.has(l)||(f2(r,t,2,!1),a.add(l))}function Jp(t,r,a){var l=0;r&&(l|=4),f2(a,t,l,r)}var pu="_reactListening"+Math.random().toString(36).slice(2);function d2(t){if(!t[pu]){t[pu]=!0,Bs.forEach(function(a){a!=="selectionchange"&&(aR.has(a)||Jp(a,!1,t),Jp(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[pu]||(r[pu]=!0,Jp("selectionchange",!1,r))}}function f2(t,r,a,l){switch(z2(r)){case 2:var h=IR;break;case 8:h=AR;break;default:h=dh}a=h.bind(null,r,a,t),h=void 0,!Us||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 Xp(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}kc(function(){var te=g,he=$s(a),ge=[];e:{var ae=Kv.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=Te;break;case"focusin":De="focus",ue=F;break;case"focusout":De="blur",ue=F;break;case"beforeblur":case"afterblur":ue=F;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=N;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=dt;break;case Vv:case $v:case Wv:ue=q;break;case Uv:ue=Je;break;case"scroll":case"scrollend":ue=v;break;case"wheel":ue=Mt;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=Ie;break;case"toggle":case"beforetoggle":ue=zt}var Ae=(r&4)!=0,Rt=!Ae&&(t==="scroll"||t==="scrollend"),Q=Ae?ae===null?null:ae+"Capture":ae;Ae=[];for(var W=te,Z;W!==null;){var me=W;if(Z=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||Z===null||Q===null||(me=Qa(W,Q),me!=null&&Ae.push(kl(W,me,Z))),Rt)break;W=W.return}0<Ae.length&&(ae=new ue(ae,De,null,a,he),ge.push({event:ae,listeners:Ae}))}}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[at]))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=te,De=De?sr(De):null,De!==null&&(Rt=d(De),Ae=De.tag,De!==Rt||Ae!==5&&Ae!==27&&Ae!==6)&&(De=null)):(ue=null,De=te),ue!==De)){if(Ae=O,me="onMouseLeave",Q="onMouseEnter",W="mouse",(t==="pointerout"||t==="pointerover")&&(Ae=Ie,me="onPointerLeave",Q="onPointerEnter",W="pointer"),Rt=ue==null?ae:Fn(ue),Z=De==null?ae:Fn(De),ae=new Ae(me,W+"leave",ue,a,he),ae.target=Rt,ae.relatedTarget=Z,me=null,sr(he)===te&&(Ae=new Ae(Q,W+"enter",De,a,he),Ae.target=Z,Ae.relatedTarget=Rt,me=Ae),Rt=me,ue&&De)t:{for(Ae=oR,Q=ue,W=De,Z=0,me=Q;me;me=Ae(me))Z++;me=0;for(var Me=W;Me;Me=Ae(Me))me++;for(;0<Z-me;)Q=Ae(Q),Z--;for(;0<me-Z;)W=Ae(W),me--;for(;Z--;){if(Q===W||W!==null&&Q===W.alternate){Ae=Q;break t}Q=Ae(Q),W=Ae(W)}Ae=null}else Ae=null;ue!==null&&p2(ge,ae,ue,Ae,!1),De!==null&&Rt!==null&&p2(ge,Rt,De,Ae,!0)}}e:{if(ae=te?Fn(te):window,ue=ae.nodeName&&ae.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ae.type==="file")var gt=Mv;else if(Ov(ae))if(Lv)gt=gT;else{gt=hT;var Pe=pT}else ue=ae.nodeName,!ue||ue.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?te&&Ka(te.elementType)&&(gt=Mv):gt=mT;if(gt&&(gt=gt(t,te))){Pv(ge,gt,a,he);break e}Pe&&Pe(t,ae,te),t==="focusout"&&te&&ae.type==="number"&&te.memoizedProps.value!=null&&wi(ae,"number",ae.value)}switch(Pe=te?Fn(te):window,t){case"focusin":(Ov(Pe)||Pe.contentEditable==="true")&&(Ko=Pe,Tf=te,Ys=null);break;case"focusout":Ys=Tf=Ko=null;break;case"mousedown":Rf=!0;break;case"contextmenu":case"mouseup":case"dragend":Rf=!1,Bv(ge,a,he);break;case"selectionchange":if(vT)break;case"keydown":case"keyup":Bv(ge,a,he)}var Qe;if(Ve)e:{switch(t){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else Uo?Cc(t,a)&&(it="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(it="onCompositionStart");it&&(fn&&a.locale!=="ko"&&(Uo||it!=="onCompositionStart"?it==="onCompositionEnd"&&Uo&&(Qe=Ks()):($r=he,$o="value"in $r?$r.value:$r.textContent,Uo=!0)),Pe=hu(te,it),0<Pe.length&&(it=new re(it,t,null,a,he),ge.push({event:it,listeners:Pe}),Qe?it.data=Qe:(Qe=Wo(a),Qe!==null&&(it.data=Qe)))),(Qe=nn?cT(t,a):uT(t,a))&&(it=hu(te,"onBeforeInput"),0<it.length&&(Pe=new re("onBeforeInput","beforeinput",null,a,he),ge.push({event:Pe,listeners:it}),Pe.data=Qe)),iR(ge,t,te,a,he)}u2(ge,r)})}function kl(t,r,a){return{instance:t,listener:r,currentTarget:a}}function hu(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(kl(t,h,g)),h=Qa(t,r),h!=null&&l.push(kl(t,h,g))),t.tag===3)return l;t=t.return}return[]}function oR(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function p2(t,r,a,l,h){for(var g=r._reactName,S=[];a!==null&&a!==l;){var D=a,H=D.alternate,te=D.stateNode;if(D=D.tag,H!==null&&H===l)break;D!==5&&D!==26&&D!==27||te===null||(H=te,h?(te=Qa(a,g),te!=null&&S.unshift(kl(a,te,H))):h||(te=Qa(a,g),te!=null&&S.push(kl(a,te,H)))),a=a.return}S.length!==0&&t.push({event:r,listeners:S})}var sR=/\r\n?/g,lR=/\u0000|\uFFFD/g;function h2(t){return(typeof t=="string"?t:""+t).replace(sR,`
10
- `).replace(lR,"")}function m2(t,r){return r=h2(r),h2(t)===r}function Tt(t,r,a,l,h,g){switch(a){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||_i(t,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&_i(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":wc(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"&&Tt(t,r,"name",h.name,h,null),Tt(t,r,"formEncType",h.formEncType,h,null),Tt(t,r,"formMethod",h.formMethod,h,null),Tt(t,r,"formTarget",h.formTarget,h,null)):(Tt(t,r,"encType",h.encType,h,null),Tt(t,r,"method",h.method,h,null),Tt(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&&tt("scroll",t);break;case"onScrollEnd":l!=null&&tt("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":tt("beforetoggle",t),tt("toggle",t),Wa(t,"popover",l);break;case"xlinkActuate":Hr(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Hr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Hr(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Hr(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Hr(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Hr(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Hr(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Hr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Hr(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 Yp(t,r,a,l,h,g){switch(a){case"style":wc(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"?_i(t,l):(typeof l=="number"||typeof l=="bigint")&&_i(t,""+l);break;case"onScroll":l!=null&&tt("scroll",t);break;case"onScrollEnd":l!=null&&tt("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(!mc.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[Fe]||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":tt("error",t),tt("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:Tt(t,r,g,S,a,null)}}h&&Tt(t,r,"srcSet",a.srcSet,a,null),l&&Tt(t,r,"src",a.src,a,null);return;case"input":tt("invalid",t);var D=g=S=h=null,H=null,te=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":te=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:Tt(t,r,l,he,a,null)}}bc(t,g,D,H,te,S,h,!1);return;case"select":for(h in tt("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:Tt(t,r,h,D,a,null)}r=g,a=S,t.multiple=!!l,r==null?a!=null&&aa(t,!!l,a,!0):aa(t,!!l,r,!1);return;case"textarea":for(S in tt("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:Tt(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":Tt(t,r,H,l,a,null));return;case"dialog":tt("beforetoggle",t),tt("toggle",t),tt("cancel",t),tt("close",t);break;case"iframe":case"object":tt("load",t);break;case"video":case"audio":for(l=0;l<xl.length;l++)tt(xl[l],t);break;case"image":tt("error",t),tt("load",t);break;case"details":tt("toggle",t);break;case"embed":case"source":case"link":tt("error",t),tt("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(te in a)if(a.hasOwnProperty(te)&&(l=a[te],l!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Tt(t,r,te,l,a,null)}return;default:if(Ka(r)){for(he in a)a.hasOwnProperty(he)&&(l=a[he],l!==void 0&&Yp(t,r,he,l,a,void 0));return}}for(D in a)a.hasOwnProperty(D)&&(l=a[D],l!=null&&Tt(t,r,D,l,a,null))}function cR(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,te=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)||Tt(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":te=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&&Tt(t,r,ae,ue,l,ge)}}ia(t,S,D,H,te,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)||Tt(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&&Tt(t,r,h,g,l,H)}r=D,a=S,l=ue,ae==null?!!l!=!!a&&(r==null?aa(t,!!a,a?[]:"",!1):aa(t,!!a,r,!0)):aa(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:Tt(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&&Tt(t,r,S,h,l,g)}oa(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:Tt(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":Tt(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 Ae in a)ae=a[Ae],a.hasOwnProperty(Ae)&&ae!=null&&!l.hasOwnProperty(Ae)&&Tt(t,r,Ae,null,l,ae);for(te in l)if(ae=l[te],ue=a[te],l.hasOwnProperty(te)&&ae!==ue&&(ae!=null||ue!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(s(137,r));break;default:Tt(t,r,te,ae,l,ue)}return;default:if(Ka(r)){for(var Rt in a)ae=a[Rt],a.hasOwnProperty(Rt)&&ae!==void 0&&!l.hasOwnProperty(Rt)&&Yp(t,r,Rt,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||Yp(t,r,he,ae,l,ue);return}}for(var Q in a)ae=a[Q],a.hasOwnProperty(Q)&&ae!=null&&!l.hasOwnProperty(Q)&&Tt(t,r,Q,null,l,ae);for(ge in l)ae=l[ge],ue=a[ge],!l.hasOwnProperty(ge)||ae===ue||ae==null&&ue==null||Tt(t,r,ge,ae,l,ue)}function g2(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uR(){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&&g2(S)){for(S=0,D=h.responseEnd,l+=1;l<a.length;l++){var H=a[l],te=H.startTime;if(te>D)break;var he=H.transferSize,ge=H.initiatorType;he&&g2(ge)&&(H=H.responseEnd,S+=he*(H<D?1:(D-te)/(H-te)))}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 Zp=null,eh=null;function mu(t){return t.nodeType===9?t:t.ownerDocument}function y2(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 v2(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 th(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 nh=null;function dR(){var t=window.event;return t&&t.type==="popstate"?t===nh?!1:(nh=t,!0):(nh=null,!1)}var b2=typeof setTimeout=="function"?setTimeout:void 0,fR=typeof clearTimeout=="function"?clearTimeout:void 0,w2=typeof Promise=="function"?Promise:void 0,pR=typeof queueMicrotask=="function"?queueMicrotask:w2===void 0?b2:function(t){return w2.resolve(null).then(t).catch(hR)};function hR(t){setTimeout(function(){throw t})}function _a(t){return t==="head"}function _2(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")Sl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Sl(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"&&Sl(t.ownerDocument.body);a=h}while(a);ws(r)}function x2(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 rh(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":rh(a),wn(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function mR(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 gR(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 k2(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 ih(t){return t.data==="$?"||t.data==="$~"}function ah(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function yR(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 oh=null;function S2(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 C2(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 E2(t,r,a){switch(r=mu(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 Sl(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);wn(t)}var Or=new Map,T2=new Set;function gu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var zi=K.d;K.d={f:vR,r:bR,D:wR,C:_R,L:xR,m:kR,X:CR,S:SR,M:ER};function vR(){var t=zi.f(),r=su();return t||r}function bR(t){var r=ri(t);r!==null&&r.tag===5&&r.type==="form"?U1(r):zi.r(t)}var ys=typeof document>"u"?null:document;function R2(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+'"]'),T2.has(h)||(T2.add(h),t={rel:t,crossOrigin:a,href:r},l.querySelector(h)===null&&(r=l.createElement("link"),Tn(r,"link",t),Jt(r),l.head.appendChild(r)))}}function wR(t){zi.D(t),R2("dns-prefetch",t,null)}function _R(t,r){zi.C(t,r),R2("preconnect",t,r)}function xR(t,r,a){zi.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(Cl(g))||r==="script"&&l.querySelector(El(g))||(r=l.createElement("link"),Tn(r,"link",t),Jt(r),l.head.appendChild(r)))}}function kR(t,r){zi.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(El(g)))return}l=a.createElement("link"),Tn(l,"link",t),Jt(l),a.head.appendChild(l)}}}function SR(t,r,a){zi.S(t,r,a);var l=ys;if(l&&t){var h=na(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(Cl(g)))D.loading=5;else{t=C({rel:"stylesheet",href:t,"data-precedence":r},a),(a=Or.get(g))&&sh(t,a);var H=S=l.createElement("link");Jt(H),Tn(H,"link",t),H._p=new Promise(function(te,he){H.onload=te,H.onerror=he}),H.addEventListener("load",function(){D.loading|=1}),H.addEventListener("error",function(){D.loading|=2}),D.loading|=4,yu(S,r,l)}S={type:"stylesheet",instance:S,count:1,state:D},h.set(g,S)}}}function CR(t,r){zi.X(t,r);var a=ys;if(a&&t){var l=na(a).hoistableScripts,h=bs(t),g=l.get(h);g||(g=a.querySelector(El(h)),g||(t=C({src:t,async:!0},r),(r=Or.get(h))&&lh(t,r),g=a.createElement("script"),Jt(g),Tn(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(h,g))}}function ER(t,r){zi.M(t,r);var a=ys;if(a&&t){var l=na(a).hoistableScripts,h=bs(t),g=l.get(h);g||(g=a.querySelector(El(h)),g||(t=C({src:t,async:!0,type:"module"},r),(r=Or.get(h))&&lh(t,r),g=a.createElement("script"),Jt(g),Tn(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(h,g))}}function D2(t,r,a,l){var h=(h=qt.current)?gu(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=na(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=na(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(Cl(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||TR(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=na(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 Cl(t){return'link[rel="stylesheet"]['+t+"]"}function O2(t){return C({},t,{"data-precedence":t.precedence,precedence:null})}function TR(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),Jt(r),t.head.appendChild(r))}function bs(t){return'[src="'+lr(t)+'"]'}function El(t){return"script[async]"+t}function P2(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,Jt(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"),Jt(l),Tn(l,"style",h),yu(l,a.precedence,t),r.instance=l;case"stylesheet":h=vs(a.href);var g=t.querySelector(Cl(h));if(g)return r.state.loading|=4,r.instance=g,Jt(g),g;l=O2(a),(h=Or.get(h))&&sh(l,h),g=(t.ownerDocument||t).createElement("link"),Jt(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,yu(g,a.precedence,t),r.instance=g;case"script":return g=bs(a.src),(h=t.querySelector(El(g)))?(r.instance=h,Jt(h),h):(l=a,(h=Or.get(g))&&(l=C({},a),lh(l,h)),t=t.ownerDocument||t,h=t.createElement("script"),Jt(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,yu(l,a.precedence,t));return r.instance}function yu(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 sh(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.title??(t.title=r.title)}function lh(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.integrity??(t.integrity=r.integrity)}var vu=null;function M2(t,r,a){if(vu===null){var l=new Map,h=vu=new Map;h.set(a,l)}else h=vu,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[ze]||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 L2(t,r,a){t=t.ownerDocument||t,t.head.insertBefore(a,r==="title"?t.querySelector("head > title"):null)}function RR(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 N2(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function DR(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(Cl(h));if(g){r=g._p,typeof r=="object"&&r&&typeof r.then=="function"&&(t.count++,t=bu.bind(t),r.then(t,t)),a.state.loading|=4,a.instance=g,Jt(g);return}g=r.ownerDocument||r,l=O2(l),(h=Or.get(h))&&sh(l,h),g=g.createElement("link"),Jt(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=bu.bind(t),r.addEventListener("load",a),r.addEventListener("error",a))}}var ch=0;function OR(t,r){return t.stylesheets&&t.count===0&&_u(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var l=setTimeout(function(){if(t.stylesheets&&_u(t,t.stylesheets),t.unsuspend){var g=t.unsuspend;t.unsuspend=null,g()}},6e4+r);0<t.imgBytes&&ch===0&&(ch=62500*uR());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&_u(t,t.stylesheets),t.unsuspend)){var g=t.unsuspend;t.unsuspend=null,g()}},(t.imgBytes>ch?50:800)+r);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(h)}}:null}function bu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_u(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var wu=null;function _u(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,wu=new Map,r.forEach(PR,t),wu=null,bu.call(t))}function PR(t,r){if(!(r.state.loading&4)){var a=wu.get(t);if(a)var l=a.get(null);else{a=new Map,wu.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=bu.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 Tl={$$typeof:G,Provider:null,Consumer:null,_currentValue:Le,_currentValue2:Le,_threadCount:0};function MR(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=ni(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ni(0),this.hiddenUpdates=ni(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 LR(t,r,a,l,h,g,S,D,H,te,he,ge){return t=new MR(t,r,a,S,H,te,he,ge,D),r=1,g===!0&&(r|=24),g=ur(3,null,null,r),t.current=g,g.stateNode=t,r=Vf(),r.refCount++,t.pooledCache=r,r.refCount++,g.memoizedState={element:l,isDehydrated:a,cache:r},Kf(g),t}function NR(t){return t?(t=Jo,t):Jo}function I2(t,r,a,l,h,g){h=NR(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&&(Xn(a,t,r),al(a,t,r))}function A2(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function uh(t,r){A2(t,r),(t=t.alternate)&&A2(t,r)}function q2(t){if(t.tag===13||t.tag===31){var r=no(t,67108864);r!==null&&Xn(r,t,67108864),uh(t,67108864)}}function j2(t){if(t.tag===13||t.tag===31){var r=Rr();r=Ye(r);var a=no(t,r);a!==null&&Xn(a,t,r),uh(t,r)}}var xu=!0;function IR(t,r,a,l){var h=se.T;se.T=null;var g=K.p;try{K.p=2,dh(t,r,a,l)}finally{K.p=g,se.T=h}}function AR(t,r,a,l){var h=se.T;se.T=null;var g=K.p;try{K.p=8,dh(t,r,a,l)}finally{K.p=g,se.T=h}}function dh(t,r,a,l){if(xu){var h=fh(l);if(h===null)Xp(t,r,l,ku,a),F2(t,l);else if(jR(h,t,r,a,l))l.stopPropagation();else if(F2(t,l),r&4&&-1<qR.indexOf(t)){for(;h!==null;){var g=ri(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-ht(S);D.entanglements[1]|=H,S&=~H}ji(g),!(mt&6)&&(au=Wt()+500,_l(0,!1))}}break;case 31:case 13:D=no(g,2),D!==null&&Xn(D,g,2),su(),uh(g,2)}if(g=fh(l),g===null&&Xp(t,r,l,ku,a),g===h)break;h=g}h!==null&&l.stopPropagation()}else Xp(t,r,l,null,a)}}function fh(t){return t=$s(t),ph(t)}var ku=null;function ph(t){if(ku=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 ku=t,null}function z2(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(gi()){case dn:return 2;case ti:return 8;case jt:case Fr:return 32;case bt:return 268435456;default:return 32}default:return 32}}var hh=!1,xa=null,ka=null,Sa=null,Rl=new Map,Dl=new Map,Ca=[],qR="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 F2(t,r){switch(t){case"focusin":case"focusout":xa=null;break;case"dragenter":case"dragleave":ka=null;break;case"mouseover":case"mouseout":Sa=null;break;case"pointerover":case"pointerout":Rl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dl.delete(r.pointerId)}}function Ol(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=ri(r),r!==null&&q2(r)),t):(t.eventSystemFlags|=l,r=t.targetContainers,h!==null&&r.indexOf(h)===-1&&r.push(h),t)}function jR(t,r,a,l,h){switch(r){case"focusin":return xa=Ol(xa,t,r,a,l,h),!0;case"dragenter":return ka=Ol(ka,t,r,a,l,h),!0;case"mouseover":return Sa=Ol(Sa,t,r,a,l,h),!0;case"pointerover":var g=h.pointerId;return Rl.set(g,Ol(Rl.get(g)||null,t,r,a,l,h)),!0;case"gotpointercapture":return g=h.pointerId,Dl.set(g,Ol(Dl.get(g)||null,t,r,a,l,h)),!0}return!1}function B2(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(){j2(a)});return}}else if(r===31){if(r=p(a),r!==null){t.blockedOn=r,ve(t.priority,function(){j2(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 Su(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=fh(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=ri(a),r!==null&&q2(r),t.blockedOn=a,!1;r.shift()}return!0}function H2(t,r,a){Su(t)&&a.delete(r)}function zR(){hh=!1,xa!==null&&Su(xa)&&(xa=null),ka!==null&&Su(ka)&&(ka=null),Sa!==null&&Su(Sa)&&(Sa=null),Rl.forEach(H2),Dl.forEach(H2)}function Cu(t,r){t.blockedOn===r&&(t.blockedOn=null,hh||(hh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,zR)))}var Eu=null;function V2(t){Eu!==t&&(Eu=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Eu===t&&(Eu=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(ph(l||a)===null)continue;break}var g=ri(a);g!==null&&(t.splice(r,3),r-=3,pp(g,{pending:!0,data:h,method:a.method,action:l},l,h))}}))}function ws(t){function r(H){return Cu(H,t)}xa!==null&&Cu(xa,t),ka!==null&&Cu(ka,t),Sa!==null&&Cu(Sa,t),Rl.forEach(r),Dl.forEach(r);for(var a=0;a<Ca.length;a++){var l=Ca[a];l.blockedOn===t&&(l.blockedOn=null)}for(;0<Ca.length&&(a=Ca[0],a.blockedOn===null);)B2(a),a.blockedOn===null&&Ca.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[Fe]||null;if(typeof g=="function")S||V2(a);else if(S){var D=null;if(g&&g.hasAttribute("formAction")){if(h=g,S=g[Fe]||null)D=S.formAction;else if(ph(h)!==null)continue}else D=S.action;typeof D=="function"?a[l+1]=D:(a.splice(l,3),l-=3),V2(a)}}}function FR(){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 mh(t){this._internalRoot=t}gh.prototype.render=mh.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var a=r.current;I2(a,Rr(),t,r,null,null)},gh.prototype.unmount=mh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;I2(t.current,2,null,t,null,null),su(),r[at]=null}};function gh(t){this._internalRoot=t}gh.prototype.unstable_scheduleHydration=function(t){if(t){var r=ee();t={blockedOn:null,target:t,priority:r};for(var a=0;a<Ca.length&&r!==0&&r<Ca[a].priority;a++);Ca.splice(a,0,t),a===0&&B2(t)}};var $2=i.version;if($2!=="19.2.3")throw Error(s(527,$2,"19.2.3"));K.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 BR={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:se,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Tu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tu.isDisabled&&Tu.supportsFiber)try{wr=Tu.inject(BR),Gt=Tu}catch{}}e.createRoot=function(t,r){if(!c(t))throw Error(s(299));var a=!1,l="",h=AT,g=qT,S=jT;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=LR(t,1,!1,null,null,a,l,null,h,g,S,FR),t[at]=r.current,d2(t),new mh(r)}})),ud=Se(((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()})),Am="Expected a function";function gx(e,n){var i;if(typeof n!="function")throw TypeError(Am);return e=n4(e),function(){return--e>0&&(i=n.apply(this,arguments)),e<=1&&(n=void 0),i}}var yx=gx;function vx(e){return yx(2,e)}let qm;_m=vx,qm=Math.max;function bx(e){if(!(e&&e.length))return[];var n=0;return e=a4(e,function(i){if(r4(i))return n=qm(i.length,n),!0}),e4(n,function(i){return t4(e,d4(i))})}var wx=i4(bx);fm=function(e,n){if(e==null)throw Error(n||`Expected value but got ${e}`)},BigInt.prototype.toJSON=function(){return JSON.rawJSON(this.toString())},dm=function(e){try{return JSON.parse(e,(n,i)=>gd(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:gd(i):gd(i))}catch{return{}}};function _x(e,n){return e==null?"":typeof e=="number"&&!Number.isNaN(e)?e.toLocaleString(n,{useGrouping:!1,maximumFractionDigits:20}):String(e)}G_=function(e,n){if(e.length===0)return"";let i=Object.keys(e[0]),o=e.map(s=>i.map(c=>_x(s[c],n)).join(" "));return`${i.join(" ")}
9
+ `+l.stack}}var br=Object.prototype.hasOwnProperty,Pn=n.unstable_scheduleCallback,un=n.unstable_cancelCallback,ea=n.unstable_shouldYield,mi=n.unstable_requestPaint,Wt=n.unstable_now,gi=n.unstable_getCurrentPriorityLevel,dn=n.unstable_ImmediatePriority,ti=n.unstable_UserBlockingPriority,jt=n.unstable_NormalPriority,Fr=n.unstable_LowPriority,bt=n.unstable_IdlePriority,yi=n.log,ta=n.unstable_setDisableYieldValue,wr=null,Gt=null;function Ge(t){if(typeof yi=="function"&&ta(t),Gt&&typeof Gt.setStrictMode=="function")try{Gt.setStrictMode(wr,t)}catch{}}var ht=Math.clz32?Math.clz32:jn,wt=Math.log,_t=Math.LN2;function jn(t){return t>>>=0,t===0?32:31-(wt(t)/_t|0)|0}var _r=256,xt=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 Br(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 vi(){var t=ir;return ir<<=1,!(ir&62914560)&&(ir=4194304),t}function ni(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 bi(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,te=t.hiddenUpdates;for(a=S&~a;0<a;){var he=31-ht(a),ge=1<<he;D[he]=0,H[he]=-1;var ae=te[he];if(ae!==null)for(te[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-ht(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-ht(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 ee(){var t=K.p;return t===0?(t=window.event,t===void 0?32:B2(t.type)):t}function ve(t,r){var a=K.p;try{return K.p=t,r()}finally{K.p=a}}var Ce=Math.random().toString(36).slice(2),ze="__reactFiber$"+Ce,Fe="__reactProps$"+Ce,at="__reactContainer$"+Ce,Ot="__reactEvents$"+Ce,Ze="__reactListeners$"+Ce,Pt="__reactHandles$"+Ce,nt="__reactResources$"+Ce,ut="__reactMarker$"+Ce;function wn(t){delete t[ze],delete t[Fe],delete t[Ot],delete t[Ze],delete t[Pt]}function sr(t){var r=t[ze];if(r)return r;for(var a=t.parentNode;a;){if(r=a[at]||a[ze]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=T2(t);t!==null;){if(a=t[ze])return a;t=T2(t)}return r}t=a,a=t.parentNode}return null}function ri(t){if(t=t[ze]||t[at]){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 na(t){var r=t[nt];return r||(r=t[nt]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Jt(t){t[ut]=!0}var Bs=new Set,mc={};function ii(t,r){ra(t,r),ra(t+"Capture",r)}function ra(t,r){for(mc[t]=r,t=0;t<r.length;t++)Bs.add(r[t])}var _f=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]*$"),Un={},gc={};function xf(t){return br.call(gc,t)?!0:br.call(Un,t)?!1:_f.test(t)?gc[t]=!0:(Un[t]=!0,!1)}function Wa(t,r,a){if(xf(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 Hr(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 yc(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function vc(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 Hs(t){if(!t._valueTracker){var r=yc(t)?"checked":"value";t._valueTracker=vc(t,r,""+t[r])}}function Vs(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),l="";return t&&(l=yc(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 ia(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"):wi(t,S,Bn(a)):wi(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 bc(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)){Hs(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),Hs(t)}function wi(t,r,a){r==="number"&&Nn(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function aa(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 oa(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(ie(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),Hs(t)}function _i(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var kf=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 xi(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||kf.has(r)?r==="float"?t.cssFloat=a:t[r]=(""+a).trim():t[r]=a+"px"}function wc(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&&xi(t,h,l)}else for(var g in r)r.hasOwnProperty(g)&&xi(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"]]),_c=/^[\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 _c.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function xr(){}var _n=null;function $s(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Hn=null,ai=null;function xc(t){var r=ri(t);if(r&&(t=r.stateNode)){var a=t[Fe]||null;e:switch(t=r.stateNode,r.type){case"input":if(ia(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[Fe]||null;if(!h)throw Error(s(90));ia(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&&Vs(l)}break e;case"textarea":oa(t,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&aa(t,!!a.multiple,r,!1)}}}var Ws=!1;function kc(t,r,a){if(Ws)return t(r,a);Ws=!0;try{return t(r)}finally{if(Ws=!1,(Hn!==null||ai!==null)&&(su(),Hn&&(r=Hn,t=ai,ai=Hn=null,xc(r),t)))for(r=0;r<t.length;r++)xc(t[r])}}function Qa(t,r){var a=t.stateNode;if(a===null)return null;var l=a[Fe]||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 Vr=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0),Us=!1;if(Vr)try{var Ga={};Object.defineProperty(Ga,"passive",{get:function(){Us=!0}}),window.addEventListener("test",Ga,Ga),window.removeEventListener("test",Ga,Ga)}catch{Us=!1}var $r=null,$o=null,Ja=null;function Ks(){if(Ja)return Ja;var t,r=$o,a=r.length,l,h="value"in $r?$r.value:$r.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 Qs(){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:Qs,this.isPropagationStopped=Qs,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 ki={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},u=xn(ki),m=C({},ki,{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),N=xn(C({},R,{dataTransfer:0})),F=xn(C({},m,{relatedTarget:0})),q=xn(C({},ki,{animationName:0,elapsedTime:0,pseudoElement:0})),oe=xn(C({},ki,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}})),re=xn(C({},ki,{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 Te=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}})),Ie=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({},ki,{propertyName:0,elapsedTime:0,pseudoElement:0})),Mt=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})),zt=xn(C({},ki,{newState:0,oldState:0})),Ue=[9,13,27,32],Ve=Vr&&"CompositionEvent"in window,Vt=null;Vr&&"documentMode"in document&&(Vt=document.documentMode);var nn=Vr&&"TextEvent"in window&&!Vt,fn=Vr&&(!Ve||Vt&&8<Vt&&11>=Vt),Za=" ",Sc=!1;function Cc(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 uT(t,r){switch(t){case"compositionend":return Wo(r);case"keypress":return r.which===32?(Sc=!0,Za):null;case"textInput":return t=r.data,t===Za&&Sc?null:t;default:return null}}function dT(t,r){if(Uo)return t==="compositionend"||!Ve&&Cc(t,r)?(t=Ks(),Ja=$o=$r=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 fn&&r.locale!=="ko"?null:r.data;default:return null}}var fT={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 Mv(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!fT[t.type]:r==="textarea"}function Lv(t,r,a,l){Hn?ai?ai.push(l):ai=[l]:Hn=l,r=hu(r,"onChange"),0<r.length&&(a=new u("onChange","change",null,a,l),t.push({event:a,listeners:r}))}var Gs=null,Js=null;function pT(t){f2(t,0)}function Ec(t){if(Vs(Fn(t)))return t}function Nv(t,r){if(t==="change")return r}var Iv=!1;if(Vr){var Sf;if(Vr){var Cf="oninput"in document;if(!Cf){var Av=document.createElement("div");Av.setAttribute("oninput","return;"),Cf=typeof Av.oninput=="function"}Sf=Cf}else Sf=!1;Iv=Sf&&(!document.documentMode||9<document.documentMode)}function qv(){Gs&&(Gs.detachEvent("onpropertychange",jv),Js=Gs=null)}function jv(t){if(t.propertyName==="value"&&Ec(Js)){var r=[];Lv(r,Js,t,$s(t)),kc(pT,r)}}function hT(t,r,a){t==="focusin"?(qv(),Gs=r,Js=a,Gs.attachEvent("onpropertychange",jv)):t==="focusout"&&qv()}function mT(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ec(Js)}function gT(t,r){if(t==="click")return Ec(r)}function yT(t,r){if(t==="input"||t==="change")return Ec(r)}function vT(t,r){return t===r&&(t!==0||1/t==1/r)||t!==t&&r!==r}var cr=typeof Object.is=="function"?Object.is:vT;function Xs(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 zv(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Fv(t,r){var a=zv(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=zv(a)}}function Bv(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Bv(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Hv(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 Ef(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 bT=Vr&&"documentMode"in document&&11>=document.documentMode,Ko=null,Tf=null,Ys=null,Rf=!1;function Vv(t,r,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Rf||Ko==null||Ko!==Nn(l)||(l=Ko,"selectionStart"in l&&Ef(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}),Ys&&Xs(Ys,l)||(Ys=l,l=hu(Tf,"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")},Df={},$v={};Vr&&($v=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(Df[t])return Df[t];if(!Qo[t])return t;var r=Qo[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in $v)return Df[t]=r[a];return t}var Wv=to("animationend"),Uv=to("animationiteration"),Kv=to("animationstart"),wT=to("transitionrun"),_T=to("transitionstart"),xT=to("transitioncancel"),Qv=to("transitionend"),Gv=new Map,Of="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Of.push("scrollEnd");function Wr(t,r){Gv.set(t,r),ii(r,[t])}var Tc=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,Pf=0;function Rc(){for(var t=Go,r=Pf=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&&Jv(a,h,g)}}function Dc(t,r,a,l){kr[Go++]=t,kr[Go++]=r,kr[Go++]=a,kr[Go++]=l,Pf|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Mf(t,r,a,l){return Dc(t,r,a,l),Oc(t)}function no(t,r){return Dc(t,null,null,r),Oc(t)}function Jv(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-ht(a),t=g.hiddenUpdates,l=t[h],l===null?t[h]=[r]:l.push(r),r.lane=a|536870912),g):null}function Oc(t){if(50<wl)throw wl=0,Bp=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Jo={};function kT(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 kT(t,r,a,l)}function Lf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Si(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 Xv(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 Pc(t,r,a,l,h,g){var S=0;if(l=t,typeof t=="function")Lf(t)&&(S=1);else if(typeof t=="string")S=DR(t,a,Ne.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 z:return ro(a.children,h,g,r);case U:S=8,h|=24;break;case $:return t=ur(12,a,r,h|2),t.elementType=$,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 G:S=10;break e;case I:S=9;break e;case pe:S=11;break e;case V: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 Nf(t,r,a){return t=ur(6,t,null,r),t.lanes=a,t}function Yv(t){var r=ur(18,null,null,0);return r.stateNode=t,r}function If(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 Zv=new WeakMap;function Sr(t,r){if(typeof t=="object"&&t){var a=Zv.get(t);return a===void 0?(r={value:t,source:r,stack:On(r)},Zv.set(t,r),r):a}return{value:t,source:r,stack:On(r)}}var Xo=[],Yo=0,Mc=null,Zs=0,Cr=[],Er=0,sa=null,oi=1,si="";function Ci(t,r){Xo[Yo++]=Zs,Xo[Yo++]=Mc,Mc=t,Zs=r}function e1(t,r,a){Cr[Er++]=oi,Cr[Er++]=si,Cr[Er++]=sa,sa=t;var l=oi;t=si;var h=32-ht(l)-1;l&=~(1<<h),a+=1;var g=32-ht(r)+h;if(30<g){var S=h-h%5;g=(l&(1<<S)-1).toString(32),l>>=S,h-=S,oi=1<<32-ht(r)+h|a<<h|l,si=g+t}else oi=1<<g|a<<h|l,si=t}function Af(t){t.return!==null&&(Ci(t,1),e1(t,1,0))}function qf(t){for(;t===Mc;)Mc=Xo[--Yo],Xo[Yo]=null,Zs=Xo[--Yo],Xo[Yo]=null;for(;t===sa;)sa=Cr[--Er],Cr[Er]=null,si=Cr[--Er],Cr[Er]=null,oi=Cr[--Er],Cr[Er]=null}function t1(t,r){Cr[Er++]=oi,Cr[Er++]=si,Cr[Er++]=sa,oi=r.id,si=r.overflow,sa=t}var Sn=null,Ft=null,ot=!1,la=null,Tr=!1,jf=Error(s(519));function ca(t){throw el(Sr(Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML","")),t)),jf}function n1(t){var r=t.stateNode,a=t.type,l=t.memoizedProps;switch(r[ze]=t,r[Fe]=l,a){case"dialog":tt("cancel",r),tt("close",r);break;case"iframe":case"object":case"embed":tt("load",r);break;case"video":case"audio":for(a=0;a<xl.length;a++)tt(xl[a],r);break;case"source":tt("error",r);break;case"img":case"image":case"link":tt("error",r),tt("load",r);break;case"details":tt("toggle",r);break;case"input":tt("invalid",r),bc(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":tt("invalid",r);break;case"textarea":tt("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||y2(r.textContent,a)?(l.popover!=null&&(tt("beforetoggle",r),tt("toggle",r)),l.onScroll!=null&&tt("scroll",r),l.onScrollEnd!=null&&tt("scrollend",r),l.onClick!=null&&(r.onclick=xr),r=!0):r=!1,r||ca(t,!0)}function r1(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(!ot)return r1(t),ot=!0,!1;var r=t.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||th(t.type,t.memoizedProps)),a=!a),a&&Ft&&ca(t),r1(t),r===13){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));Ft=E2(t)}else if(r===31){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));Ft=E2(t)}else r===27?(r=Ft,_a(t.type)?(t=oh,oh=null,Ft=t):Ft=r):Ft=Sn?Dr(t.stateNode.nextSibling):null;return!0}function io(){Ft=Sn=null,ot=!1}function zf(){var t=la;return t!==null&&(Jn===null?Jn=t:Jn.push.apply(Jn,t),la=null),t}function el(t){la===null?la=[t]:la.push(t)}var Ff=je(null),ao=null,Ei=null;function ua(t,r,a){Oe(Ff,r._currentValue),r._currentValue=a}function Ti(t){t._currentValue=Ff.current,He(Ff)}function Bf(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 Hf(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),Bf(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),Bf(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=[Tl]:t.push(Tl))}h=h.return}t!==null&&Hf(r,t,a,l),r.flags|=262144}function Lc(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,Ei=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Cn(t){return i1(ao,t)}function Nc(t,r){return ao===null&&oo(t),i1(t,r)}function i1(t,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},Ei===null){if(t===null)throw Error(s(308));Ei=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else Ei=Ei.next=r;return a}var ST=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()})}},CT=n.unstable_scheduleCallback,ET=n.unstable_NormalPriority,rn={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vf(){return{controller:new ST,data:new Map,refCount:0}}function tl(t){t.refCount--,t.refCount===0&&CT(ET,function(){t.controller.abort()})}var nl=null,$f=0,ts=0,ns=null;function TT(t,r){if(nl===null){var a=nl=[];$f=0,ts=Kp(),ns={status:"pending",value:void 0,then:function(l){a.push(l)}}}return $f++,r.then(a1,a1),r}function a1(){if(--$f===0&&nl!==null){ns!==null&&(ns.status="fulfilled");var t=nl;nl=null,ts=0,ns=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function RT(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 o1=se.S;se.S=function(t,r){Fb=Wt(),typeof r=="object"&&r&&typeof r.then=="function"&&TT(t,r),o1!==null&&o1(t,r)};var so=je(null);function Wf(){var t=so.current;return t===null?Lt.pooledCache:t}function Ic(t,r){r===null?Oe(so,so.current):Oe(so,r.pool)}function s1(){var t=Wf();return t===null?null:{parent:rn._currentValue,pool:t}}var rs=Error(s(460)),Uf=Error(s(474)),Ac=Error(s(542)),qc={then:function(){}};function l1(t){return t=t.status,t==="fulfilled"||t==="rejected"}function c1(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,d1(t),t;default:if(typeof r.status=="string")r.then(xr,xr);else{if(t=Lt,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,d1(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 u1(){if(co===null)throw Error(s(459));var t=co;return co=null,t}function d1(t){if(t===rs||t===Ac)throw Error(s(483))}var is=null,rl=0;function jc(t){var r=rl;return rl+=1,is===null&&(is=[]),c1(is,t,r)}function il(t,r){r=r.props.ref,t.ref=r===void 0?null:r}function zc(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 f1(t){function r(Q,W){if(t){var Z=Q.deletions;Z===null?(Q.deletions=[W],Q.flags|=16):Z.push(W)}}function a(Q,W){if(!t)return null;for(;W!==null;)r(Q,W),W=W.sibling;return null}function l(Q){for(var W=new Map;Q!==null;)Q.key===null?W.set(Q.index,Q):W.set(Q.key,Q),Q=Q.sibling;return W}function h(Q,W){return Q=Si(Q,W),Q.index=0,Q.sibling=null,Q}function g(Q,W,Z){return Q.index=Z,t?(Z=Q.alternate,Z===null?(Q.flags|=67108866,W):(Z=Z.index,Z<W?(Q.flags|=67108866,W):Z)):(Q.flags|=1048576,W)}function S(Q){return t&&Q.alternate===null&&(Q.flags|=67108866),Q}function D(Q,W,Z,me){return W===null||W.tag!==6?(W=Nf(Z,Q.mode,me),W.return=Q,W):(W=h(W,Z),W.return=Q,W)}function H(Q,W,Z,me){var Me=Z.type;return Me===z?he(Q,W,Z.props.children,me,Z.key):W!==null&&(W.elementType===Me||typeof Me=="object"&&Me&&Me.$$typeof===de&&lo(Me)===W.type)?(W=h(W,Z.props),il(W,Z),W.return=Q,W):(W=Pc(Z.type,Z.key,Z.props,null,Q.mode,me),il(W,Z),W.return=Q,W)}function te(Q,W,Z,me){return W===null||W.tag!==4||W.stateNode.containerInfo!==Z.containerInfo||W.stateNode.implementation!==Z.implementation?(W=If(Z,Q.mode,me),W.return=Q,W):(W=h(W,Z.children||[]),W.return=Q,W)}function he(Q,W,Z,me,Me){return W===null||W.tag!==7?(W=ro(Z,Q.mode,me,Me),W.return=Q,W):(W=h(W,Z),W.return=Q,W)}function ge(Q,W,Z){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=Nf(""+W,Q.mode,Z),W.return=Q,W;if(typeof W=="object"&&W){switch(W.$$typeof){case T:return Z=Pc(W.type,W.key,W.props,null,Q.mode,Z),il(Z,W),Z.return=Q,Z;case L:return W=If(W,Q.mode,Z),W.return=Q,W;case de:return W=lo(W),ge(Q,W,Z)}if(ie(W)||we(W))return W=ro(W,Q.mode,Z,null),W.return=Q,W;if(typeof W.then=="function")return ge(Q,jc(W),Z);if(W.$$typeof===G)return ge(Q,Nc(Q,W),Z);zc(Q,W)}return null}function ae(Q,W,Z,me){var Me=W===null?null:W.key;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Me===null?D(Q,W,""+Z,me):null;if(typeof Z=="object"&&Z){switch(Z.$$typeof){case T:return Z.key===Me?H(Q,W,Z,me):null;case L:return Z.key===Me?te(Q,W,Z,me):null;case de:return Z=lo(Z),ae(Q,W,Z,me)}if(ie(Z)||we(Z))return Me===null?he(Q,W,Z,me,null):null;if(typeof Z.then=="function")return ae(Q,W,jc(Z),me);if(Z.$$typeof===G)return ae(Q,W,Nc(Q,Z),me);zc(Q,Z)}return null}function ue(Q,W,Z,me,Me){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return Q=Q.get(Z)||null,D(W,Q,""+me,Me);if(typeof me=="object"&&me){switch(me.$$typeof){case T:return Q=Q.get(me.key===null?Z:me.key)||null,H(W,Q,me,Me);case L:return Q=Q.get(me.key===null?Z:me.key)||null,te(W,Q,me,Me);case de:return me=lo(me),ue(Q,W,Z,me,Me)}if(ie(me)||we(me))return Q=Q.get(Z)||null,he(W,Q,me,Me,null);if(typeof me.then=="function")return ue(Q,W,Z,jc(me),Me);if(me.$$typeof===G)return ue(Q,W,Z,Nc(W,me),Me);zc(W,me)}return null}function De(Q,W,Z,me){for(var Me=null,gt=null,Pe=W,Qe=W=0,it=null;Pe!==null&&Qe<Z.length;Qe++){Pe.index>Qe?(it=Pe,Pe=null):it=Pe.sibling;var pt=ae(Q,Pe,Z[Qe],me);if(pt===null){Pe===null&&(Pe=it);break}t&&Pe&&pt.alternate===null&&r(Q,Pe),W=g(pt,W,Qe),gt===null?Me=pt:gt.sibling=pt,gt=pt,Pe=it}if(Qe===Z.length)return a(Q,Pe),ot&&Ci(Q,Qe),Me;if(Pe===null){for(;Qe<Z.length;Qe++)Pe=ge(Q,Z[Qe],me),Pe!==null&&(W=g(Pe,W,Qe),gt===null?Me=Pe:gt.sibling=Pe,gt=Pe);return ot&&Ci(Q,Qe),Me}for(Pe=l(Pe);Qe<Z.length;Qe++)it=ue(Pe,Q,Qe,Z[Qe],me),it!==null&&(t&&it.alternate!==null&&Pe.delete(it.key===null?Qe:it.key),W=g(it,W,Qe),gt===null?Me=it:gt.sibling=it,gt=it);return t&&Pe.forEach(function(Ea){return r(Q,Ea)}),ot&&Ci(Q,Qe),Me}function Ae(Q,W,Z,me){if(Z==null)throw Error(s(151));for(var Me=null,gt=null,Pe=W,Qe=W=0,it=null,pt=Z.next();Pe!==null&&!pt.done;Qe++,pt=Z.next()){Pe.index>Qe?(it=Pe,Pe=null):it=Pe.sibling;var Ea=ae(Q,Pe,pt.value,me);if(Ea===null){Pe===null&&(Pe=it);break}t&&Pe&&Ea.alternate===null&&r(Q,Pe),W=g(Ea,W,Qe),gt===null?Me=Ea:gt.sibling=Ea,gt=Ea,Pe=it}if(pt.done)return a(Q,Pe),ot&&Ci(Q,Qe),Me;if(Pe===null){for(;!pt.done;Qe++,pt=Z.next())pt=ge(Q,pt.value,me),pt!==null&&(W=g(pt,W,Qe),gt===null?Me=pt:gt.sibling=pt,gt=pt);return ot&&Ci(Q,Qe),Me}for(Pe=l(Pe);!pt.done;Qe++,pt=Z.next())pt=ue(Pe,Q,Qe,pt.value,me),pt!==null&&(t&&pt.alternate!==null&&Pe.delete(pt.key===null?Qe:pt.key),W=g(pt,W,Qe),gt===null?Me=pt:gt.sibling=pt,gt=pt);return t&&Pe.forEach(function(VR){return r(Q,VR)}),ot&&Ci(Q,Qe),Me}function Rt(Q,W,Z,me){if(typeof Z=="object"&&Z&&Z.type===z&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z){switch(Z.$$typeof){case T:e:{for(var Me=Z.key;W!==null;){if(W.key===Me){if(Me=Z.type,Me===z){if(W.tag===7){a(Q,W.sibling),me=h(W,Z.props.children),me.return=Q,Q=me;break e}}else if(W.elementType===Me||typeof Me=="object"&&Me&&Me.$$typeof===de&&lo(Me)===W.type){a(Q,W.sibling),me=h(W,Z.props),il(me,Z),me.return=Q,Q=me;break e}a(Q,W);break}else r(Q,W);W=W.sibling}Z.type===z?(me=ro(Z.props.children,Q.mode,me,Z.key),me.return=Q,Q=me):(me=Pc(Z.type,Z.key,Z.props,null,Q.mode,me),il(me,Z),me.return=Q,Q=me)}return S(Q);case L:e:{for(Me=Z.key;W!==null;){if(W.key===Me)if(W.tag===4&&W.stateNode.containerInfo===Z.containerInfo&&W.stateNode.implementation===Z.implementation){a(Q,W.sibling),me=h(W,Z.children||[]),me.return=Q,Q=me;break e}else{a(Q,W);break}else r(Q,W);W=W.sibling}me=If(Z,Q.mode,me),me.return=Q,Q=me}return S(Q);case de:return Z=lo(Z),Rt(Q,W,Z,me)}if(ie(Z))return De(Q,W,Z,me);if(we(Z)){if(Me=we(Z),typeof Me!="function")throw Error(s(150));return Z=Me.call(Z),Ae(Q,W,Z,me)}if(typeof Z.then=="function")return Rt(Q,W,jc(Z),me);if(Z.$$typeof===G)return Rt(Q,W,Nc(Q,Z),me);zc(Q,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,W!==null&&W.tag===6?(a(Q,W.sibling),me=h(W,Z),me.return=Q,Q=me):(a(Q,W),me=Nf(Z,Q.mode,me),me.return=Q,Q=me),S(Q)):a(Q,W)}return function(Q,W,Z,me){try{rl=0;var Me=Rt(Q,W,Z,me);return is=null,Me}catch(Pe){if(Pe===rs||Pe===Ac)throw Pe;var gt=ur(29,Pe,null,Q.mode);return gt.lanes=me,gt.return=Q,gt}}}var uo=f1(!0),p1=f1(!1),da=!1;function Kf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qf(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,mt&2){var h=l.pending;return h===null?r.next=r:(r.next=h.next,h.next=r),l.pending=r,r=Oc(t),Jv(t,null,a),r}return Dc(t,l,r,a),Oc(t)}function al(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 Gf(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 Jf=!1;function ol(){if(Jf){var t=ns;if(t!==null)throw t}}function sl(t,r,a,l){Jf=!1;var h=t.updateQueue;da=!1;var g=h.firstBaseUpdate,S=h.lastBaseUpdate,D=h.shared.pending;if(D!==null){h.shared.pending=null;var H=D,te=H.next;H.next=null,S===null?g=te:S.next=te,S=H;var he=t.alternate;he!==null&&(he=he.updateQueue,D=he.lastBaseUpdate,D!==S&&(D===null?he.firstBaseUpdate=te:D.next=te,he.lastBaseUpdate=H))}if(g!==null){var ge=h.baseState;S=0,he=te=H=null,D=g;do{var ae=D.lane&-536870913,ue=ae!==D.lane;if(ue?(rt&ae)===ae:(l&ae)===ae){ae!==0&&ae===ts&&(Jf=!0),he!==null&&(he=he.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var De=t,Ae=D;ae=r;var Rt=a;switch(Ae.tag){case 1:if(De=Ae.payload,typeof De=="function"){ge=De.call(Rt,ge,ae);break e}ge=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Ae.payload,ae=typeof De=="function"?De.call(Rt,ge,ae):De,ae==null)break e;ge=C({},ge,ae);break e;case 2:da=!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?(te=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=te,h.lastBaseUpdate=he,g===null&&(h.shared.lanes=0),ga|=S,t.lanes=S,t.memoizedState=ge}}function h1(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function m1(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)h1(a[t],r)}var as=je(null),Fc=je(0);function g1(t,r){t=Ai,Oe(Fc,t),Oe(as,r),Ai=t|r.baseLanes}function Xf(){Oe(Fc,Ai),Oe(as,as.current)}function Yf(){Ai=Fc.current,He(as),He(Fc)}var dr=je(null),Ur=null;function fa(t){var r=t.alternate;Oe(Xt,Xt.current&1),Oe(dr,t),Ur===null&&(r===null||as.current!==null||r.memoizedState!==null)&&(Ur=t)}function Zf(t){Oe(Xt,Xt.current),Oe(dr,t),Ur===null&&(Ur=t)}function y1(t){t.tag===22?(Oe(Xt,Xt.current),Oe(dr,t),Ur===null&&(Ur=t)):pa(t)}function pa(){Oe(Xt,Xt.current),Oe(dr,dr.current)}function fr(t){He(dr),Ur===t&&(Ur=null),He(Xt)}var Xt=je(0);function Bc(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||ih(a)||ah(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 Ri=0,Ke=null,Et=null,an=null,Hc=!1,os=!1,ho=!1,Vc=0,ll=0,ss=null,DT=0;function Kt(){throw Error(s(321))}function ep(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 tp(t,r,a,l,h,g){return Ri=g,Ke=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,se.H=t===null||t.memoizedState===null?eb:gp,ho=!1,g=a(l,h),ho=!1,os&&(g=b1(r,a,l,h)),v1(t),g}function v1(t){se.H=dl;var r=Et!==null&&Et.next!==null;if(Ri=0,an=Et=Ke=null,Hc=!1,ll=0,ss=null,r)throw Error(s(300));t===null||on||(t=t.dependencies,t!==null&&Lc(t)&&(on=!0))}function b1(t,r,a,l){Ke=t;var h=0;do{if(os&&(ss=null),ll=0,os=!1,25<=h)throw Error(s(301));if(h+=1,an=Et=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=tb,g=r(a,l)}while(os);return g}function OT(){var t=se.H,r=t.useState()[0];return r=typeof r.then=="function"?cl(r):r,t=t.useState()[0],(Et===null?null:Et.memoizedState)!==t&&(Ke.flags|=1024),r}function np(){var t=Vc!==0;return Vc=0,t}function rp(t,r,a){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~a}function ip(t){if(Hc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Hc=!1}Ri=0,an=Et=Ke=null,os=!1,ll=Vc=0,ss=null}function Vn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return an===null?Ke.memoizedState=an=t:an=an.next=t,an}function Yt(){if(Et===null){var t=Ke.alternate;t=t===null?null:t.memoizedState}else t=Et.next;var r=an===null?Ke.memoizedState:an.next;if(r!==null)an=r,Et=t;else{if(t===null)throw Ke.alternate===null?Error(s(467)):Error(s(310));Et=t,t={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},an===null?Ke.memoizedState=an=t:an=an.next=t}return an}function $c(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cl(t){var r=ll;return ll+=1,ss===null&&(ss=[]),t=c1(ss,t,r),r=Ke,(an===null?r.memoizedState:an.next)===null&&(r=r.alternate,se.H=r===null||r.memoizedState===null?eb:gp),t}function Wc(t){if(typeof t=="object"&&t){if(typeof t.then=="function")return cl(t);if(t.$$typeof===G)return Cn(t)}throw Error(s(438,String(t)))}function ap(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=$c(),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]=be;return r.index++,a}function Di(t,r){return typeof r=="function"?r(t):r}function Uc(t){return op(Yt(),Et,t)}function op(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,te=r,he=!1;do{var ge=te.lane&-536870913;if(ge===te.lane?(Ri&ge)===ge:(rt&ge)===ge){var ae=te.revertLane;if(ae===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),ge===ts&&(he=!0);else if((Ri&ae)===ae){te=te.next,ae===ts&&(he=!0);continue}else ge={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},H===null?(D=H=ge,S=g):H=H.next=ge,Ke.lanes|=ae,ga|=ae;ge=te.action,ho&&a(g,ge),g=te.hasEagerState?te.eagerState:a(g,ge)}else ae={lane:ge,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},H===null?(D=H=ae,S=g):H=H.next=ae,Ke.lanes|=ge,ga|=ge;te=te.next}while(te!==null&&te!==r);if(H===null?S=g:H.next=D,!cr(g,t.memoizedState)&&(on=!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 sp(t){var r=Yt(),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)||(on=!0),r.memoizedState=g,r.baseQueue===null&&(r.baseState=g),a.lastRenderedState=g}return[g,l]}function w1(t,r,a){var l=Ke,h=Yt(),g=ot;if(g){if(a===void 0)throw Error(s(407));a=a()}else a=r();var S=!cr((Et||h).memoizedState,a);if(S&&(h.memoizedState=a,on=!0),h=h.queue,up(k1.bind(null,l,h,t),[t]),h.getSnapshot!==r||S||an!==null&&an.memoizedState.tag&1){if(l.flags|=2048,ls(9,{destroy:void 0},x1.bind(null,l,h,a,r),null),Lt===null)throw Error(s(349));g||Ri&127||_1(l,r,a)}return a}function _1(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=Ke.updateQueue,r===null?(r=$c(),Ke.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function x1(t,r,a,l){r.value=a,r.getSnapshot=l,S1(r)&&C1(t)}function k1(t,r,a){return a(function(){S1(r)&&C1(t)})}function S1(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!cr(t,a)}catch{return!0}}function C1(t){var r=no(t,2);r!==null&&Xn(r,t,2)}function lp(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:Di,lastRenderedState:t},r}function E1(t,r,a,l){return t.baseState=a,op(t,Et,typeof l=="function"?l:Di)}function PT(t,r,a,l,h){if(Gc(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,T1(r,g)):(g.next=a.next,r.pending=a.next=g)}}function T1(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),R1(t,r,D)}catch(te){cp(t,r,te)}finally{g!==null&&S.types!==null&&(g.types=S.types),se.T=g}}else try{g=a(h,l),R1(t,r,g)}catch(te){cp(t,r,te)}}function R1(t,r,a){typeof a=="object"&&a&&typeof a.then=="function"?a.then(function(l){D1(t,r,l)},function(l){return cp(t,r,l)}):D1(t,r,a)}function D1(t,r,a){r.status="fulfilled",r.value=a,O1(r),t.state=a,r=t.pending,r!==null&&(a=r.next,a===r?t.pending=null:(a=a.next,r.next=a,T1(t,a)))}function cp(t,r,a){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=a,O1(r),r=r.next;while(r!==l)}t.action=null}function O1(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function P1(t,r){return r}function M1(t,r){if(ot){var a=Lt.formState;if(a!==null){e:{var l=Ke;if(ot){if(Ft){t:{for(var h=Ft,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){Ft=Dr(h.nextSibling),l=h.data==="F!";break e}}ca(l)}l=!1}l&&(r=a[0])}}return a=Vn(),a.memoizedState=a.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:P1,lastRenderedState:r},a.queue=l,a=X1.bind(null,Ke,l),l.dispatch=a,l=lp(!1),g=mp.bind(null,Ke,!1,l.queue),l=Vn(),h={state:r,dispatch:null,action:t,pending:null},l.queue=h,a=PT.bind(null,Ke,h,g,a),h.dispatch=a,l.memoizedState=t,[r,a,!1]}function L1(t){return N1(Yt(),Et,t)}function N1(t,r,a){if(r=op(t,r,P1)[0],t=Uc(Di)[0],typeof r=="object"&&r&&typeof r.then=="function")try{var l=cl(r)}catch(S){throw S===rs?Ac:S}else l=r;r=Yt();var h=r.queue,g=h.dispatch;return a!==r.memoizedState&&(Ke.flags|=2048,ls(9,{destroy:void 0},MT.bind(null,h,a),null)),[l,g,t]}function MT(t,r){t.action=r}function I1(t){var r=Yt(),a=Et;if(a!==null)return N1(r,a,t);Yt(),r=r.memoizedState,a=Yt();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=$c(),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 A1(){return Yt().memoizedState}function Kc(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 Qc(t,r,a,l){var h=Yt();l=l===void 0?null:l;var g=h.memoizedState.inst;Et!==null&&l!==null&&ep(l,Et.memoizedState.deps)?h.memoizedState=ls(r,g,a,l):(Ke.flags|=t,h.memoizedState=ls(1|r,g,a,l))}function q1(t,r){Kc(8390656,8,t,r)}function up(t,r){Qc(2048,8,t,r)}function LT(t){Ke.flags|=4;var r=Ke.updateQueue;if(r===null)r=$c(),Ke.updateQueue=r,r.events=[t];else{var a=r.events;a===null?r.events=[t]:a.push(t)}}function j1(t){var r=Yt().memoizedState;return LT({ref:r,nextImpl:t}),function(){if(mt&2)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function z1(t,r){return Qc(4,2,t,r)}function F1(t,r){return Qc(4,4,t,r)}function B1(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 H1(t,r,a){a=a==null?null:a.concat([t]),Qc(4,4,B1.bind(null,r,t),a)}function dp(){}function V1(t,r){var a=Yt();r=r===void 0?null:r;var l=a.memoizedState;return r!==null&&ep(r,l[1])?l[0]:(a.memoizedState=[t,r],t)}function $1(t,r){var a=Yt();r=r===void 0?null:r;var l=a.memoizedState;if(r!==null&&ep(r,l[1]))return l[0];if(l=t(),ho){Ge(!0);try{t()}finally{Ge(!1)}}return a.memoizedState=[l,r],l}function fp(t,r,a){return a===void 0||Ri&1073741824&&!(rt&261930)?t.memoizedState=r:(t.memoizedState=a,t=Hb(),Ke.lanes|=t,ga|=t,a)}function W1(t,r,a,l){return cr(a,r)?a:as.current===null?!(Ri&42)||Ri&1073741824&&!(rt&261930)?(on=!0,t.memoizedState=a):(t=Hb(),Ke.lanes|=t,ga|=t,r):(t=fp(t,a,l),cr(t,r)||(on=!0),t)}function U1(t,r,a,l,h){var g=K.p;K.p=g!==0&&8>g?g:8;var S=se.T,D={};se.T=D,mp(t,!1,r,a);try{var H=h(),te=se.S;te!==null&&te(D,H),typeof H=="object"&&H&&typeof H.then=="function"?ul(t,r,RT(H,l),Rr(t)):ul(t,r,l,Rr(t))}catch(he){ul(t,r,{then:function(){},status:"rejected",reason:he},Rr())}finally{K.p=g,S!==null&&D.types!==null&&(S.types=D.types),se.T=S}}function NT(){}function pp(t,r,a,l){if(t.tag!==5)throw Error(s(476));var h=K1(t).queue;U1(t,h,r,Le,a===null?NT:function(){return Q1(t),a(l)})}function K1(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:Di,lastRenderedState:Le},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function Q1(t){var r=K1(t);r.next===null&&(r=t.alternate.memoizedState),ul(t,r.next.queue,{},Rr())}function hp(){return Cn(Tl)}function G1(){return Yt().memoizedState}function J1(){return Yt().memoizedState}function IT(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&&(Xn(l,r,a),al(l,r,a)),r={cache:Vf()},t.payload=r;return}r=r.return}}function AT(t,r,a){var l=Rr();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Gc(t)?Y1(r,a):(a=Mf(t,r,a,l),a!==null&&(Xn(a,t,l),Z1(a,r,l)))}function X1(t,r,a){ul(t,r,a,Rr())}function ul(t,r,a,l){var h={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Gc(t))Y1(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 Dc(t,r,h,0),Lt===null&&Rc(),!1}catch{}if(a=Mf(t,r,h,l),a!==null)return Xn(a,t,l),Z1(a,r,l),!0}return!1}function mp(t,r,a,l){if(l={lane:2,revertLane:Kp(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Gc(t)){if(r)throw Error(s(479))}else r=Mf(t,a,l,2),r!==null&&Xn(r,t,2)}function Gc(t){var r=t.alternate;return t===Ke||r!==null&&r===Ke}function Y1(t,r){os=Hc=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function Z1(t,r,a){if(a&4194048){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,or(t,a)}}var dl={readContext:Cn,use:Wc,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt};dl.useEffectEvent=Kt;var eb={readContext:Cn,use:Wc,useCallback:function(t,r){return Vn().memoizedState=[t,r===void 0?null:r],t},useContext:Cn,useEffect:q1,useImperativeHandle:function(t,r,a){a=a==null?null:a.concat([t]),Kc(4194308,4,B1.bind(null,r,t),a)},useLayoutEffect:function(t,r){return Kc(4194308,4,t,r)},useInsertionEffect:function(t,r){Kc(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=AT.bind(null,Ke,t),[l.memoizedState,t]},useRef:function(t){var r=Vn();return t={current:t},r.memoizedState=t},useState:function(t){t=lp(t);var r=t.queue,a=X1.bind(null,Ke,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:dp,useDeferredValue:function(t,r){return fp(Vn(),t,r)},useTransition:function(){var t=lp(!1);return t=U1.bind(null,Ke,t.queue,!0,!1),Vn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var l=Ke,h=Vn();if(ot){if(a===void 0)throw Error(s(407));a=a()}else{if(a=r(),Lt===null)throw Error(s(349));rt&127||_1(l,r,a)}h.memoizedState=a;var g={value:a,getSnapshot:r};return h.queue=g,q1(k1.bind(null,l,g,t),[t]),l.flags|=2048,ls(9,{destroy:void 0},x1.bind(null,l,g,a,r),null),a},useId:function(){var t=Vn(),r=Lt.identifierPrefix;if(ot){var a=si,l=oi;a=(l&~(1<<32-ht(l)-1)).toString(32)+a,r="_"+r+"R_"+a,a=Vc++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=DT++,r="_"+r+"r_"+a.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:hp,useFormState:M1,useActionState:M1,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=mp.bind(null,Ke,!0,a),a.dispatch=r,[t,r]},useMemoCache:ap,useCacheRefresh:function(){return Vn().memoizedState=IT.bind(null,Ke)},useEffectEvent:function(t){var r=Vn(),a={impl:t};return r.memoizedState=a,function(){if(mt&2)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},gp={readContext:Cn,use:Wc,useCallback:V1,useContext:Cn,useEffect:up,useImperativeHandle:H1,useInsertionEffect:z1,useLayoutEffect:F1,useMemo:$1,useReducer:Uc,useRef:A1,useState:function(){return Uc(Di)},useDebugValue:dp,useDeferredValue:function(t,r){return W1(Yt(),Et.memoizedState,t,r)},useTransition:function(){var t=Uc(Di)[0],r=Yt().memoizedState;return[typeof t=="boolean"?t:cl(t),r]},useSyncExternalStore:w1,useId:G1,useHostTransitionStatus:hp,useFormState:L1,useActionState:L1,useOptimistic:function(t,r){return E1(Yt(),Et,t,r)},useMemoCache:ap,useCacheRefresh:J1};gp.useEffectEvent=j1;var tb={readContext:Cn,use:Wc,useCallback:V1,useContext:Cn,useEffect:up,useImperativeHandle:H1,useInsertionEffect:z1,useLayoutEffect:F1,useMemo:$1,useReducer:sp,useRef:A1,useState:function(){return sp(Di)},useDebugValue:dp,useDeferredValue:function(t,r){var a=Yt();return Et===null?fp(a,t,r):W1(a,Et.memoizedState,t,r)},useTransition:function(){var t=sp(Di)[0],r=Yt().memoizedState;return[typeof t=="boolean"?t:cl(t),r]},useSyncExternalStore:w1,useId:G1,useHostTransitionStatus:hp,useFormState:I1,useActionState:I1,useOptimistic:function(t,r){var a=Yt();return Et===null?(a.baseState=t,[t,a.queue.dispatch]):E1(a,Et,t,r)},useMemoCache:ap,useCacheRefresh:J1};tb.useEffectEvent=j1;function yp(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 vp={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&&(Xn(r,t,l),al(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&&(Xn(r,t,l),al(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&&(Xn(r,t,a),al(r,t,a))}};function nb(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?!Xs(a,l)||!Xs(h,g):!0}function rb(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&&vp.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 qT(t){Tc(t)}function jT(t){console.error(t)}function zT(t){Tc(t)}function Jc(t,r){try{var a=t.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function ib(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 bp(t,r,a){return a=fo(a),a.tag=3,a.payload={element:null},a.callback=function(){Jc(t,r)},a}function ab(t){return t=fo(t),t.tag=3,t}function ob(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(){ib(r,a,l)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){ib(r,a,l),typeof h!="function"&&(ya===null?ya=new Set([this]):ya.add(this));var D=l.stack;this.componentDidCatch(l.value,{componentStack:D===null?"":D})})}function FT(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 Ur===null?lu():a.alternate===null&&Qt===0&&(Qt=3),a.flags&=-257,a.flags|=65536,a.lanes=h,l===qc?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([l]):r.add(l),$p(t,l,h)),!1;case 22:return a.flags|=65536,l===qc?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)),$p(t,l,h)),!1}throw Error(s(435,a.tag))}return $p(t,l,h),lu(),!1}if(ot)return r=dr.current,r===null?(l!==jf&&(r=Error(s(423),{cause:l}),el(Sr(r,a))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,l=Sr(l,a),h=bp(t.stateNode,l,h),Gf(t,h),Qt!==4&&(Qt=2)):(!(r.flags&65536)&&(r.flags|=256),r.flags|=65536,r.lanes=h,l!==jf&&(t=Error(s(422),{cause:l}),el(Sr(t,a)))),!1;var g=Error(s(520),{cause:l});if(g=Sr(g,a),bl===null?bl=[g]:bl.push(g),Qt!==4&&(Qt=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=bp(a.stateNode,l,t),Gf(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"&&(ya===null||!ya.has(g))))return a.flags|=65536,h&=-h,a.lanes|=h,h=ab(h),ob(h,t,a,l),Gf(a,h),!1}a=a.return}while(a!==null);return!1}var wp=Error(s(461)),on=!1;function En(t,r,a,l){r.child=t===null?p1(r,null,a,l):uo(r,t.child,a,l)}function sb(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=tp(t,r,a,S,g,h),D=np(),t!==null&&!on?(rp(t,r,h),Oi(t,r,h)):(ot&&D&&Af(r),r.flags|=1,En(t,r,l,h),r.child)}function lb(t,r,a,l,h){if(t===null){var g=a.type;return typeof g=="function"&&!Lf(g)&&g.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=g,cb(t,r,g,l,h)):(t=Pc(a.type,null,l,r,r.mode,h),t.ref=r.ref,t.return=r,r.child=t)}if(g=t.child,!Rp(t,h)){var S=g.memoizedProps;if(a=a.compare,a=a===null?Xs:a,a(S,l)&&t.ref===r.ref)return Oi(t,r,h)}return r.flags|=1,t=Si(g,l),t.ref=r.ref,t.return=r,r.child=t}function cb(t,r,a,l,h){if(t!==null){var g=t.memoizedProps;if(Xs(g,l)&&t.ref===r.ref)if(on=!1,r.pendingProps=l=g,Rp(t,h))t.flags&131072&&(on=!0);else return r.lanes=t.lanes,Oi(t,r,h)}return _p(t,r,a,l,h)}function ub(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 db(t,r,g,a,l)}if(a&536870912)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ic(r,g===null?null:g.cachePool),g===null?Xf():g1(r,g),y1(r);else return l=r.lanes=536870912,db(t,r,g===null?a:g.baseLanes|a,a,l)}else g===null?(t!==null&&Ic(r,null),Xf(),pa(r)):(Ic(r,g.cachePool),g1(r,g),pa(r),r.memoizedState=null);return En(t,r,h,a),r.child}function fl(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function db(t,r,a,l,h){var g=Wf();return g=g===null?null:{parent:rn._currentValue,pool:g},r.memoizedState={baseLanes:a,cachePool:g},t!==null&&Ic(r,null),Xf(),y1(r),t!==null&&es(t,r,l,!0),r.childLanes=h,null}function Xc(t,r){return r=Zc({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function fb(t,r,a){return uo(r,t.child,null,a),t=Xc(r,r.pendingProps),t.flags|=2,fr(r),r.memoizedState=null,t}function BT(t,r,a){var l=r.pendingProps,h=(r.flags&128)!=0;if(r.flags&=-129,t===null){if(ot){if(l.mode==="hidden")return t=Xc(r,l),r.lanes=536870912,fl(null,t);if(Zf(r),(t=Ft)?(t=C2(t,Tr),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:sa===null?null:{id:oi,overflow:si},retryLane:536870912,hydrationErrors:null},a=Yv(t),a.return=r,r.child=a,Sn=r,Ft=null)):t=null,t===null)throw ca(r);return r.lanes=536870912,null}return Xc(r,l)}var g=t.memoizedState;if(g!==null){var S=g.dehydrated;if(Zf(r),h)if(r.flags&256)r.flags&=-257,r=fb(t,r,a);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(s(558));else if(on||es(t,r,a,!1),h=(a&t.childLanes)!==0,on||h){if(l=Lt,l!==null&&(S=M(l,a),S!==0&&S!==g.retryLane))throw g.retryLane=S,no(t,S),Xn(l,t,S),wp;lu(),r=fb(t,r,a)}else t=g.treeContext,Ft=Dr(S.nextSibling),Sn=r,ot=!0,la=null,Tr=!1,t!==null&&t1(r,t),r=Xc(r,l),r.flags|=4096;return r}return t=Si(t.child,{mode:l.mode,children:l.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Yc(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 _p(t,r,a,l,h){return oo(r),a=tp(t,r,a,l,void 0,h),l=np(),t!==null&&!on?(rp(t,r,h),Oi(t,r,h)):(ot&&l&&Af(r),r.flags|=1,En(t,r,a,h),r.child)}function pb(t,r,a,l,h,g){return oo(r),r.updateQueue=null,a=b1(r,l,a,h),v1(t),l=np(),t!==null&&!on?(rp(t,r,g),Oi(t,r,g)):(ot&&l&&Af(r),r.flags|=1,En(t,r,a,g),r.child)}function hb(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=vp,r.stateNode=g,g._reactInternals=r,g=r.stateNode,g.props=l,g.state=r.memoizedState,g.refs={},Kf(r),S=a.contextType,g.context=typeof S=="object"&&S?Cn(S):Jo,g.state=r.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(yp(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&&vp.enqueueReplaceState(g,g.state,null),sl(r,l,g,h),ol(),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 te=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||te!==S)&&rb(r,g,l,S),da=!1;var ae=r.memoizedState;g.state=ae,sl(r,l,g,h),ol(),te=r.memoizedState,D||ae!==te||da?(typeof ge=="function"&&(yp(r,a,ge,l),te=r.memoizedState),(H=da||nb(r,a,H,l,ae,te,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=te),g.props=l,g.state=te,g.context=S,l=H):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{g=r.stateNode,Qf(t,r),S=r.memoizedProps,he=mo(a,S),g.props=he,ge=r.pendingProps,ae=g.context,te=a.contextType,H=Jo,typeof te=="object"&&te&&(H=Cn(te)),D=a.getDerivedStateFromProps,(te=typeof D=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S!==ge||ae!==H)&&rb(r,g,l,H),da=!1,ae=r.memoizedState,g.state=ae,sl(r,l,g,h),ol();var ue=r.memoizedState;S!==ge||ae!==ue||da||t!==null&&t.dependencies!==null&&Lc(t.dependencies)?(typeof D=="function"&&(yp(r,a,D,l),ue=r.memoizedState),(he=da||nb(r,a,he,l,ae,ue,H)||t!==null&&t.dependencies!==null&&Lc(t.dependencies))?(te||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,Yc(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=Oi(t,r,h),t}function mb(t,r,a,l){return io(),r.flags|=256,En(t,r,a,l),r.child}var xp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function kp(t){return{baseLanes:t,cachePool:s1()}}function Sp(t,r,a){return t=t===null?0:t.childLanes&~a,r&&(t|=hr),t}function gb(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:(Xt.current&2)!=0),S&&(h=!0,r.flags&=-129),S=(r.flags&32)!=0,r.flags&=-33,t===null){if(ot){if(h?fa(r):pa(r),(t=Ft)?(t=C2(t,Tr),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:sa===null?null:{id:oi,overflow:si},retryLane:536870912,hydrationErrors:null},a=Yv(t),a.return=r,r.child=a,Sn=r,Ft=null)):t=null,t===null)throw ca(r);return ah(t)?r.lanes=32:r.lanes=536870912,null}var D=l.children;return l=l.fallback,h?(pa(r),h=r.mode,D=Zc({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=kp(a),l.childLanes=Sp(t,S,a),r.memoizedState=xp,fl(null,l)):(fa(r),Cp(r,D))}var H=t.memoizedState;if(H!==null&&(D=H.dehydrated,D!==null)){if(g)r.flags&256?(fa(r),r.flags&=-257,r=Ep(t,r,a)):r.memoizedState===null?(pa(r),D=l.fallback,h=r.mode,l=Zc({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=kp(a),l.childLanes=Sp(t,S,a),r.memoizedState=xp,r=fl(null,l)):(pa(r),r.child=t.child,r.flags|=128,r=null);else if(fa(r),ah(D)){if(S=D.nextSibling&&D.nextSibling.dataset,S)var te=S.dgst;S=te,l=Error(s(419)),l.stack="",l.digest=S,el({value:l,source:null,stack:null}),r=Ep(t,r,a)}else if(on||es(t,r,a,!1),S=(a&t.childLanes)!==0,on||S){if(S=Lt,S!==null&&(l=M(S,a),l!==0&&l!==H.retryLane))throw H.retryLane=l,no(t,l),Xn(S,t,l),wp;ih(D)||lu(),r=Ep(t,r,a)}else ih(D)?(r.flags|=192,r.child=t.child,r=null):(t=H.treeContext,Ft=Dr(D.nextSibling),Sn=r,ot=!0,la=null,Tr=!1,t!==null&&t1(r,t),r=Cp(r,l.children),r.flags|=4096);return r}return h?(pa(r),D=l.fallback,h=r.mode,H=t.child,te=H.sibling,l=Si(H,{mode:"hidden",children:l.children}),l.subtreeFlags=H.subtreeFlags&65011712,te===null?(D=ro(D,h,a,null),D.flags|=2):D=Si(te,D),D.return=r,l.return=r,l.sibling=D,r.child=l,fl(null,l),l=r.child,D=t.child.memoizedState,D===null?D=kp(a):(h=D.cachePool,h===null?h=s1():(H=rn._currentValue,h=h.parent===H?h:{parent:H,pool:H}),D={baseLanes:D.baseLanes|a,cachePool:h}),l.memoizedState=D,l.childLanes=Sp(t,S,a),r.memoizedState=xp,fl(t.child,l)):(fa(r),a=t.child,t=a.sibling,a=Si(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 Cp(t,r){return r=Zc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Zc(t,r){return t=ur(22,t,null,r),t.lanes=0,t}function Ep(t,r,a){return uo(r,t.child,null,a),t=Cp(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function yb(t,r,a){t.lanes|=r;var l=t.alternate;l!==null&&(l.lanes|=r),Bf(t.return,r,a)}function Tp(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 vb(t,r,a){var l=r.pendingProps,h=l.revealOrder,g=l.tail;l=l.children;var S=Xt.current,D=(S&2)!=0;if(D?(S=S&1|2,r.flags|=128):S&=1,Oe(Xt,S),En(t,r,l,a),l=ot?Zs:0,!D&&t!==null&&t.flags&128)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&yb(t,a,r);else if(t.tag===19)yb(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&&Bc(t)===null&&(h=a),a=a.sibling;a=h,a===null?(h=r.child,r.child=null):(h=a.sibling,a.sibling=null),Tp(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&&Bc(t)===null){r.child=h;break}t=h.sibling,h.sibling=a,a=h,h=t}Tp(r,!0,a,null,g,l);break;case"together":Tp(r,!1,null,null,void 0,l);break;default:r.memoizedState=null}return r.child}function Oi(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),ga|=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=Si(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=Si(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function Rp(t,r){return(t.lanes&r)===0?(t=t.dependencies,!!(t!==null&&Lc(t))):!0}function HT(t,r,a){switch(r.tag){case 3:cn(r,r.stateNode.containerInfo),ua(r,rn,t.memoizedState.cache),io();break;case 27:case 5:en(r);break;case 4:cn(r,r.stateNode.containerInfo);break;case 10:ua(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Zf(r),null;break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated===null?(a&r.child.childLanes)===0?(fa(r),t=Oi(t,r,a),t===null?null:t.sibling):gb(t,r,a):(fa(r),r.flags|=128,null);fa(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 vb(t,r,a);r.flags|=128}if(h=r.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Oe(Xt,Xt.current),l)break;return null;case 22:return r.lanes=0,ub(t,r,a,r.pendingProps);case 24:ua(r,rn,t.memoizedState.cache)}return Oi(t,r,a)}function bb(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps)on=!0;else{if(!Rp(t,a)&&!(r.flags&128))return on=!1,HT(t,r,a);on=!!(t.flags&131072)}else on=!1,ot&&r.flags&1048576&&e1(r,Zs,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")Lf(t)?(l=mo(t,l),r.tag=1,r=hb(null,r,t,l,a)):(r.tag=0,r=_p(null,r,t,l,a));else{if(t!=null){var h=t.$$typeof;if(h===pe){r.tag=11,r=sb(null,r,t,l,a);break e}else if(h===V){r.tag=14,r=lb(null,r,t,l,a);break e}}throw r=ne(t)||t,Error(s(306,r,""))}}return r;case 0:return _p(t,r,r.type,r.pendingProps,a);case 1:return l=r.type,h=mo(l,r.pendingProps),hb(t,r,l,h,a);case 3:e:{if(cn(r,r.stateNode.containerInfo),t===null)throw Error(s(387));l=r.pendingProps;var g=r.memoizedState;h=g.element,Qf(t,r),sl(r,l,null,a);var S=r.memoizedState;if(l=S.cache,ua(r,rn,l),l!==g.cache&&Hf(r,[rn],a,!0),ol(),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=mb(t,r,l,a);break e}else if(l!==h){h=Sr(Error(s(424)),r),el(h),r=mb(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,Ft=Dr(t.firstChild),Sn=r,ot=!0,la=null,Tr=!0,a=p1(r,null,l,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(io(),l===h){r=Oi(t,r,a);break e}En(t,r,l,a)}r=r.child}return r;case 26:return Yc(t,r),t===null?(a=P2(r.type,null,r.pendingProps,null))?r.memoizedState=a:ot||(a=r.type,t=r.pendingProps,l=mu(qt.current).createElement(a),l[ze]=r,l[Fe]=t,Tn(l,a,t),Jt(l),r.stateNode=l):r.memoizedState=P2(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return en(r),t===null&&ot&&(l=r.stateNode=R2(r.type,r.pendingProps,qt.current),Sn=r,Tr=!0,h=Ft,_a(r.type)?(oh=h,Ft=Dr(l.firstChild)):Ft=h),En(t,r,r.pendingProps.children,a),Yc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&ot&&((h=l=Ft)&&(l=gR(l,r.type,r.pendingProps,Tr),l===null?h=!1:(r.stateNode=l,Sn=r,Ft=Dr(l.firstChild),Tr=!1,h=!0)),h||ca(r)),en(r),h=r.type,g=r.pendingProps,S=t===null?null:t.memoizedProps,l=g.children,th(h,g)?l=null:S!==null&&th(h,S)&&(r.flags|=32),r.memoizedState!==null&&(h=tp(t,r,OT,null,null,a),Tl._currentValue=h),Yc(t,r),En(t,r,l,a),r.child;case 6:return t===null&&ot&&((t=a=Ft)&&(a=yR(a,r.pendingProps,Tr),a===null?t=!1:(r.stateNode=a,Sn=r,Ft=null,t=!0)),t||ca(r)),null;case 13:return gb(t,r,a);case 4:return cn(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 sb(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,ua(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 lb(t,r,r.type,r.pendingProps,a);case 15:return cb(t,r,r.type,r.pendingProps,a);case 19:return vb(t,r,a);case 31:return BT(t,r,a);case 22:return ub(t,r,a,r.pendingProps);case 24:return oo(r),l=Cn(rn),t===null?(h=Wf(),h===null&&(h=Lt,g=Vf(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=a),h=g),r.memoizedState={parent:l,cache:h},Kf(r),ua(r,rn,h)):((t.lanes&a)!==0&&(Qf(t,r),sl(r,null,null,a),ol()),h=t.memoizedState,g=r.memoizedState,h.parent===l?(l=g.cache,ua(r,rn,l),l!==h.cache&&Hf(r,[rn],a,!0)):(h={parent:l,cache:l},r.memoizedState=h,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=h),ua(r,rn,l))),En(t,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Pi(t){t.flags|=4}function Dp(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(Ub())t.flags|=8192;else throw co=qc,Uf}else t.flags&=-16777217}function wb(t,r){if(r.type!=="stylesheet"||r.state.loading&4)t.flags&=-16777217;else if(t.flags|=16777216,!A2(r))if(Ub())t.flags|=8192;else throw co=qc,Uf}function eu(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag===22?536870912:vi(),t.lanes|=r,fs|=r)}function pl(t,r){if(!ot)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 Bt(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 VT(t,r,a){var l=r.pendingProps;switch(qf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bt(r),null;case 1:return Bt(r),null;case 3:return a=r.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),Ti(rn),We(),a.pendingContext&&(a.pendingContext=(a.context=a.pendingContext,null)),(t===null||t.child===null)&&(Zo(r)?Pi(r):t===null||t.memoizedState.isDehydrated&&!(r.flags&256)||(r.flags|=1024,zf())),Bt(r),null;case 26:var h=r.type,g=r.memoizedState;return t===null?(Pi(r),g===null?(Bt(r),Dp(r,h,null,l,a)):(Bt(r),wb(r,g))):g?g===t.memoizedState?(Bt(r),r.flags&=-16777217):(Pi(r),Bt(r),wb(r,g)):(t=t.memoizedProps,t!==l&&Pi(r),Bt(r),Dp(r,h,t,l,a)),null;case 27:if(vt(r),a=qt.current,h=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Pi(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Bt(r),null}t=Ne.current,Zo(r)?n1(r,t):(t=R2(h,l,a),r.stateNode=t,Pi(r))}return Bt(r),null;case 5:if(vt(r),h=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Pi(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Bt(r),null}if(g=Ne.current,Zo(r))n1(r,g);else{var S=mu(qt.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[ze]=r,g[Fe]=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&&Pi(r)}}return Bt(r),Dp(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,a),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==l&&Pi(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(t=qt.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[ze]=r,t=!!(t.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||y2(t.nodeValue,a)),t||ca(r,!0)}else t=mu(t).createTextNode(l),t[ze]=r,r.stateNode=t}return Bt(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[ze]=r}else io(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Bt(r),t=!1}else a=zf(),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 Bt(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[ze]=r}else io(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Bt(r),h=!1}else h=zf(),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),eu(r,r.updateQueue),Bt(r),null);case 4:return We(),t===null&&p2(r.stateNode.containerInfo),Bt(r),null;case 10:return Ti(r.type),Bt(r),null;case 19:if(He(Xt),l=r.memoizedState,l===null)return Bt(r),null;if(h=(r.flags&128)!=0,g=l.rendering,g===null)if(h)pl(l,!1);else{if(Qt!==0||t!==null&&t.flags&128)for(t=r.child;t!==null;){if(g=Bc(t),g!==null){for(r.flags|=128,pl(l,!1),t=g.updateQueue,r.updateQueue=t,eu(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)Xv(a,t),a=a.sibling;return Oe(Xt,Xt.current&1|2),ot&&Ci(r,l.treeForkCount),r.child}t=t.sibling}l.tail!==null&&Wt()>au&&(r.flags|=128,h=!0,pl(l,!1),r.lanes=4194304)}else{if(!h)if(t=Bc(g),t!==null){if(r.flags|=128,h=!0,t=t.updateQueue,r.updateQueue=t,eu(r,t),pl(l,!0),l.tail===null&&l.tailMode==="hidden"&&!g.alternate&&!ot)return Bt(r),null}else 2*Wt()-l.renderingStartTime>au&&a!==536870912&&(r.flags|=128,h=!0,pl(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?(Bt(r),null):(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Wt(),t.sibling=null,a=Xt.current,Oe(Xt,h?a&1|2:a&1),ot&&Ci(r,l.treeForkCount),t);case 22:case 23:return fr(r),Yf(),l=r.memoizedState!==null,t===null?l&&(r.flags|=8192):t.memoizedState!==null!==l&&(r.flags|=8192),l?a&536870912&&!(r.flags&128)&&(Bt(r),r.subtreeFlags&6&&(r.flags|=8192)):Bt(r),a=r.updateQueue,a!==null&&eu(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&&He(so),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Ti(rn),Bt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function $T(t,r){switch(qf(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Ti(rn),We(),t=r.flags,t&65536&&!(t&128)?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return vt(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 He(Xt),null;case 4:return We(),null;case 10:return Ti(r.type),null;case 22:case 23:return fr(r),Yf(),t!==null&&He(so),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Ti(rn),null;case 25:return null;default:return null}}function _b(t,r){switch(qf(r),r.tag){case 3:Ti(rn),We();break;case 26:case 27:case 5:vt(r);break;case 4:We();break;case 31:r.memoizedState!==null&&fr(r);break;case 13:fr(r);break;case 19:He(Xt);break;case 10:Ti(r.type);break;case 22:case 23:fr(r),Yf(),t!==null&&He(so);break;case 24:Ti(rn)}}function hl(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){St(r,r.return,D)}}function ha(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,te=D;try{te()}catch(he){St(h,H,he)}}}l=l.next}while(l!==g)}}catch(he){St(r,r.return,he)}}function xb(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{m1(r,a)}catch(l){St(t,t.return,l)}}}function kb(t,r,a){a.props=mo(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(l){St(t,r,l)}}function ml(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){St(t,r,h)}}function li(t,r){var a=t.ref,l=t.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(h){St(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){St(t,r,h)}else a.current=null}function Sb(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){St(t,t.return,h)}}function Op(t,r,a){try{var l=t.stateNode;uR(l,t.type,a,r),l[Fe]=r}catch(h){St(t,t.return,h)}}function Cb(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&_a(t.type)||t.tag===4}function Pp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Cb(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&&_a(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 Mp(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&&_a(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(Mp(t,r,a),t=t.sibling;t!==null;)Mp(t,r,a),t=t.sibling}function tu(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&&_a(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(tu(t,r,a),t=t.sibling;t!==null;)tu(t,r,a),t=t.sibling}function Eb(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[ze]=t,r[Fe]=a}catch(g){St(t,t.return,g)}}var Mi=!1,sn=!1,Lp=!1,Tb=typeof WeakSet=="function"?WeakSet:Set,kn=null;function WT(t,r){if(t=t.containerInfo,Zp=xu,t=Hv(t),Ef(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,te=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&&++te===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(eh={focusedElem:t,selectionRange:a},xu=!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(Ae){St(a,a.return,Ae)}}break;case 3:if(t&1024){if(t=r.stateNode.containerInfo,a=t.nodeType,a===9)rh(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":rh(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 Rb(t,r,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Ni(t,a),l&4&&hl(5,a);break;case 1:if(Ni(t,a),l&4)if(t=a.stateNode,r===null)try{t.componentDidMount()}catch(S){St(a,a.return,S)}else{var h=mo(a.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(h,r,t.__reactInternalSnapshotBeforeUpdate)}catch(S){St(a,a.return,S)}}l&64&&xb(a),l&512&&ml(a,a.return);break;case 3:if(Ni(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{m1(t,r)}catch(S){St(a,a.return,S)}}break;case 27:r===null&&l&4&&Eb(a);case 26:case 5:Ni(t,a),r===null&&l&4&&Sb(a),l&512&&ml(a,a.return);break;case 12:Ni(t,a);break;case 31:Ni(t,a),l&4&&Pb(t,a);break;case 13:Ni(t,a),l&4&&Mb(t,a),l&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=eR.bind(null,a),vR(t,a))));break;case 22:if(l=a.memoizedState!==null||Mi,!l){r=r!==null&&r.memoizedState!==null||sn,h=Mi;var g=sn;Mi=l,(sn=r)&&!g?Ii(t,a,(a.subtreeFlags&8772)!=0):Ni(t,a),Mi=h,sn=g}break;case 30:break;default:Ni(t,a)}}function Db(t){var r=t.alternate;r!==null&&(t.alternate=null,Db(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 $t=null,Kn=!1;function Li(t,r,a){for(a=a.child;a!==null;)Ob(t,r,a),a=a.sibling}function Ob(t,r,a){if(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount(wr,a)}catch{}switch(a.tag){case 26:sn||li(a,r),Li(t,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:sn||li(a,r);var l=$t,h=Kn;_a(a.type)&&($t=a.stateNode,Kn=!1),Li(t,r,a),Sl(a.stateNode),$t=l,Kn=h;break;case 5:sn||li(a,r);case 6:if(l=$t,h=Kn,$t=null,Li(t,r,a),$t=l,Kn=h,$t!==null)if(Kn)try{($t.nodeType===9?$t.body:$t.nodeName==="HTML"?$t.ownerDocument.body:$t).removeChild(a.stateNode)}catch(g){St(a,r,g)}else try{$t.removeChild(a.stateNode)}catch(g){St(a,r,g)}break;case 18:$t!==null&&(Kn?(t=$t,k2(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ws(t)):k2($t,a.stateNode));break;case 4:l=$t,h=Kn,$t=a.stateNode.containerInfo,Kn=!0,Li(t,r,a),$t=l,Kn=h;break;case 0:case 11:case 14:case 15:ha(2,a,r),sn||ha(4,a,r),Li(t,r,a);break;case 1:sn||(li(a,r),l=a.stateNode,typeof l.componentWillUnmount=="function"&&kb(a,r,l)),Li(t,r,a);break;case 21:Li(t,r,a);break;case 22:sn=(l=sn)||a.memoizedState!==null,Li(t,r,a),sn=l;break;default:Li(t,r,a)}}function Pb(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ws(t)}catch(a){St(r,r.return,a)}}}function Mb(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){St(r,r.return,a)}}function UT(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new Tb),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new Tb),r;default:throw Error(s(435,t.tag))}}function nu(t,r){var a=UT(t);r.forEach(function(l){if(!a.has(l)){a.add(l);var h=tR.bind(null,t,l);l.then(h,h)}})}function Qn(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(_a(D.type)){$t=D.stateNode,Kn=!1;break e}break;case 5:$t=D.stateNode,Kn=!1;break e;case 3:case 4:$t=D.stateNode.containerInfo,Kn=!0;break e}D=D.return}if($t===null)throw Error(s(160));Ob(g,S,h),$t=null,Kn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Lb(r,t),r=r.sibling}var Kr=null;function Lb(t,r){var a=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Qn(r,t),Gn(t),l&4&&(ha(3,t,t.return),hl(3,t),ha(5,t,t.return));break;case 1:Qn(r,t),Gn(t),l&512&&(sn||a===null||li(a,a.return)),l&64&&Mi&&(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=Kr;if(Qn(r,t),Gn(t),l&512&&(sn||a===null||li(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[ze]||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[ze]=t,Jt(g),l=g;break e;case"link":var S=N2("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=N2("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[ze]=t,Jt(g),l=g}t.stateNode=l}else I2(h,t.type,t.stateNode);else t.stateNode=L2(h,l,t.memoizedProps);else g===l?l===null&&t.stateNode!==null&&Op(t,t.memoizedProps,a.memoizedProps):(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,l===null?I2(h,t.type,t.stateNode):L2(h,l,t.memoizedProps))}break;case 27:Qn(r,t),Gn(t),l&512&&(sn||a===null||li(a,a.return)),a!==null&&l&4&&Op(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Qn(r,t),Gn(t),l&512&&(sn||a===null||li(a,a.return)),t.flags&32){h=t.stateNode;try{_i(h,"")}catch(De){St(t,t.return,De)}}l&4&&t.stateNode!=null&&(h=t.memoizedProps,Op(t,h,a===null?h:a.memoizedProps)),l&1024&&(Lp=!0);break;case 6:if(Qn(r,t),Gn(t),l&4){if(t.stateNode===null)throw Error(s(162));l=t.memoizedProps,a=t.stateNode;try{a.nodeValue=l}catch(De){St(t,t.return,De)}}break;case 3:if(vu=null,h=Kr,Kr=gu(r.containerInfo),Qn(r,t),Kr=h,Gn(t),l&4&&a!==null&&a.memoizedState.isDehydrated)try{ws(r.containerInfo)}catch(De){St(t,t.return,De)}Lp&&(Lp=!1,Nb(t));break;case 4:l=Kr,Kr=gu(t.stateNode.containerInfo),Qn(r,t),Gn(t),Kr=l;break;case 12:Qn(r,t),Gn(t);break;case 31:Qn(r,t),Gn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,nu(t,l)));break;case 13:Qn(r,t),Gn(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(iu=Wt()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,nu(t,l)));break;case 22:h=t.memoizedState!==null;var H=a!==null&&a.memoizedState!==null,te=Mi,he=sn;if(Mi=te||h,sn=he||H,Qn(r,t),sn=he,Mi=te,Gn(t),l&8192)e:for(r=t.stateNode,r._visibility=h?r._visibility&-2:r._visibility|1,h&&(a===null||H||Mi||sn||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){St(H,H.return,De)}}}else if(r.tag===6){if(a===null){H=r;try{H.stateNode.nodeValue=h?"":H.memoizedProps}catch(De){St(H,H.return,De)}}}else if(r.tag===18){if(a===null){H=r;try{var ue=H.stateNode;h?S2(ue,!0):S2(H.stateNode,!1)}catch(De){St(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,nu(t,a))));break;case 19:Qn(r,t),Gn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,nu(t,l)));break;case 30:break;case 21:break;default:Qn(r,t),Gn(t)}}function Gn(t){var r=t.flags;if(r&2){try{for(var a,l=t.return;l!==null;){if(Cb(l)){a=l;break}l=l.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var h=a.stateNode;tu(t,Pp(t),h);break;case 5:var g=a.stateNode;a.flags&32&&(_i(g,""),a.flags&=-33),tu(t,Pp(t),g);break;case 3:case 4:var S=a.stateNode.containerInfo;Mp(t,Pp(t),S);break;default:throw Error(s(161))}}catch(D){St(t,t.return,D)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function Nb(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;Nb(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Ni(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Rb(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:ha(4,r,r.return),go(r);break;case 1:li(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&kb(r,r.return,a),go(r);break;case 27:Sl(r.stateNode);case 26:case 5:li(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 Ii(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:Ii(h,g,a),hl(4,g);break;case 1:if(Ii(h,g,a),l=g,h=l.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(te){St(l,l.return,te)}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++)h1(H[h],D)}catch(te){St(l,l.return,te)}}a&&S&64&&xb(g),ml(g,g.return);break;case 27:Eb(g);case 26:case 5:Ii(h,g,a),a&&l===null&&S&4&&Sb(g),ml(g,g.return);break;case 12:Ii(h,g,a);break;case 31:Ii(h,g,a),a&&S&4&&Pb(h,g);break;case 13:Ii(h,g,a),a&&S&4&&Mb(h,g);break;case 22:g.memoizedState===null&&Ii(h,g,a),ml(g,g.return);break;case 30:break;default:Ii(h,g,a)}r=r.sibling}}function Np(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&&tl(a))}function Ip(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&tl(t))}function Qr(t,r,a,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Ib(t,r,a,l),r=r.sibling}function Ib(t,r,a,l){var h=r.flags;switch(r.tag){case 0:case 11:case 15:Qr(t,r,a,l),h&2048&&hl(9,r);break;case 1:Qr(t,r,a,l);break;case 3:Qr(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&&tl(t)));break;case 12:if(h&2048){Qr(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){St(r,r.return,H)}}else Qr(t,r,a,l);break;case 31:Qr(t,r,a,l);break;case 13:Qr(t,r,a,l);break;case 23:break;case 22:g=r.stateNode,S=r.alternate,r.memoizedState===null?g._visibility&2?Qr(t,r,a,l):(g._visibility|=2,cs(t,r,a,l,(r.subtreeFlags&10256)!=0||!1)):g._visibility&2?Qr(t,r,a,l):gl(t,r),h&2048&&Np(S,r);break;case 24:Qr(t,r,a,l),h&2048&&Ip(r.alternate,r);break;default:Qr(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,te=S.flags;switch(S.tag){case 0:case 11:case 15:cs(g,S,D,H,h),hl(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):gl(g,S),h&&te&2048&&Np(S.alternate,S);break;case 24:cs(g,S,D,H,h),h&&te&2048&&Ip(S.alternate,S);break;default:cs(g,S,D,H,h)}r=r.sibling}}function gl(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:gl(a,l),h&2048&&Np(l.alternate,l);break;case 24:gl(a,l),h&2048&&Ip(l.alternate,l);break;default:gl(a,l)}r=r.sibling}}var yl=8192;function us(t,r,a){if(t.subtreeFlags&yl)for(t=t.child;t!==null;)Ab(t,r,a),t=t.sibling}function Ab(t,r,a){switch(t.tag){case 26:us(t,r,a),t.flags&yl&&t.memoizedState!==null&&OR(a,Kr,t.memoizedState,t.memoizedProps);break;case 5:us(t,r,a);break;case 3:case 4:var l=Kr;Kr=gu(t.stateNode.containerInfo),us(t,r,a),Kr=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=yl,yl=16777216,us(t,r,a),yl=l):us(t,r,a));break;default:us(t,r,a)}}function qb(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 vl(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,zb(l,t)}qb(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jb(t),t=t.sibling}function jb(t){switch(t.tag){case 0:case 11:case 15:vl(t),t.flags&2048&&ha(9,t,t.return);break;case 3:vl(t);break;case 12:vl(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,ru(t)):vl(t);break;default:vl(t)}}function ru(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,zb(l,t)}qb(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:ha(8,r,r.return),ru(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,ru(r));break;default:ru(r)}t=t.sibling}}function zb(t,r){for(;kn!==null;){var a=kn;switch(a.tag){case 0:case 11:case 15:ha(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:tl(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(Db(l),l===a){kn=null;break e}if(h!==null){h.return=g,kn=h;break e}kn=g}}}var KT={getCacheForType:function(t){var r=Cn(rn),a=r.data.get(t);return a===void 0&&(a=t(),r.data.set(t,a)),a},cacheSignal:function(){return Cn(rn).controller.signal}},QT=typeof WeakMap=="function"?WeakMap:Map,mt=0,Lt=null,et=null,rt=0,kt=0,pr=null,ma=!1,ds=!1,Ap=!1,Ai=0,Qt=0,ga=0,yo=0,qp=0,hr=0,fs=0,bl=null,Jn=null,jp=!1,iu=0,Fb=0,au=1/0,ou=null,ya=null,pn=0,va=null,ps=null,qi=0,zp=0,Fp=null,Bb=null,wl=0,Bp=null;function Rr(){return mt&2&&rt!==0?rt&-rt:se.T===null?ee():Kp()}function Hb(){if(hr===0)if(!(rt&536870912)||ot){var t=xt;xt<<=1,!(xt&3932160)&&(xt=262144),hr=t}else hr=536870912;return t=dr.current,t!==null&&(t.flags|=32),hr}function Xn(t,r,a){(t===Lt&&(kt===2||kt===9)||t.cancelPendingCommit!==null)&&(hs(t,0),ba(t,rt,hr,!1)),Ln(t,a),(!(mt&2)||t!==Lt)&&(t===Lt&&(!(mt&2)&&(yo|=a),Qt===4&&ba(t,rt,hr,!1)),ji(t))}function Vb(t,r,a){if(mt&6)throw Error(s(327));var l=!a&&(r&127)==0&&(r&t.expiredLanes)===0||bn(t,r),h=l?XT(t,r):Vp(t,r,!0),g=l;do{if(h===0){ds&&!l&&ba(t,r,0,!1);break}else{if(a=t.current.alternate,g&&!GT(a)){h=Vp(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=bl;var H=D.current.memoizedState.isDehydrated;if(H&&(hs(D,S).flags|=256),S=Vp(D,S,!1),S!==2){if(Ap&&!H){D.errorRecoveryDisabledLanes|=g,yo|=g,h=4;break e}g=Jn,Jn=h,g!==null&&(Jn===null?Jn=g:Jn.push.apply(Jn,g))}h=S}if(g=!1,h!==2)continue}}if(h===1){hs(t,0),ba(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:ba(l,r,hr,!ma);break e;case 2:Jn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(h=iu+300-Wt(),10<h)){if(ba(l,r,hr,!ma),Br(l,0,!0)!==0)break e;qi=r,l.timeoutHandle=_2($b.bind(null,l,a,Jn,ou,jp,r,hr,yo,fs,ma,g,"Throttled",-0,0),h);break e}$b(l,a,Jn,ou,jp,r,hr,yo,fs,ma,g,null,-0,0)}}break}while(!0);ji(t)}function $b(t,r,a,l,h,g,S,D,H,te,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},Ab(r,g,ge);var De=(g&62914560)===g?iu-Wt():(g&4194048)===g?Fb-Wt():0;if(De=PR(ge,De),De!==null){qi=g,t.cancelPendingCommit=De(Yb.bind(null,t,r,g,a,l,h,S,D,H,he,ge,null,ae,ue)),ba(t,g,S,!te);return}}Yb(t,r,g,a,l,h,S,D,H)}function GT(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 ba(t,r,a,l){r&=~qp,r&=~yo,t.suspendedLanes|=r,t.pingedLanes&=~r,l&&(t.warmLanes|=r),l=t.expirationTimes;for(var h=r;0<h;){var g=31-ht(h),S=1<<g;l[g]=-1,h&=~S}a!==0&&zn(t,a,r)}function su(){return mt&6?!0:(_l(0,!1),!1)}function Hp(){if(et!==null){if(kt===0)var t=et.return;else t=et,Ei=ao=null,ip(t),is=null,rl=0,t=et;for(;t!==null;)_b(t.alternate,t),t=t.return;et=null}}function hs(t,r){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,pR(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),qi=0,Hp(),Lt=t,et=a=Si(t.current,null),rt=r,kt=0,pr=null,ma=!1,ds=bn(t,r),Ap=!1,fs=hr=qp=yo=ga=Qt=0,Jn=bl=null,jp=!1,r&8&&(r|=r&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=r;0<l;){var h=31-ht(l),g=1<<h;r|=t[h],l&=~g}return Ai=r,Rc(),a}function Wb(t,r){Ke=null,se.H=dl,r===rs||r===Ac?(r=u1(),kt=3):r===Uf?(r=u1(),kt=4):kt=r===wp?8:typeof r=="object"&&r&&typeof r.then=="function"?6:1,pr=r,et===null&&(Qt=1,Jc(t,Sr(r,t.current)))}function Ub(){var t=dr.current;return t===null?!0:(rt&4194048)===rt?Ur===null:(rt&62914560)===rt||rt&536870912?t===Ur:!1}function Kb(){var t=se.H;return se.H=dl,t===null?dl:t}function Qb(){var t=se.A;return se.A=KT,t}function lu(){Qt=4,ma||(rt&4194048)!==rt&&dr.current!==null||(ds=!0),!(ga&134217727)&&!(yo&134217727)||Lt===null||ba(Lt,rt,hr,!1)}function Vp(t,r,a){var l=mt;mt|=2;var h=Kb(),g=Qb();(Lt!==t||rt!==r)&&(ou=null,hs(t,r)),r=!1;var S=Qt;e:do try{if(kt!==0&&et!==null){var D=et,H=pr;switch(kt){case 8:Hp(),S=6;break e;case 3:case 2:case 9:case 6:dr.current===null&&(r=!0);var te=kt;if(kt=0,pr=null,ms(t,D,H,te),a&&ds){S=0;break e}break;default:te=kt,kt=0,pr=null,ms(t,D,H,te)}}JT(),S=Qt;break}catch(he){Wb(t,he)}while(!0);return r&&t.shellSuspendCounter++,Ei=ao=null,mt=l,se.H=h,se.A=g,et===null&&(Lt=null,rt=0,Rc()),S}function JT(){for(;et!==null;)Gb(et)}function XT(t,r){var a=mt;mt|=2;var l=Kb(),h=Qb();Lt!==t||rt!==r?(ou=null,au=Wt()+500,hs(t,r)):ds=bn(t,r);e:do try{if(kt!==0&&et!==null){r=et;var g=pr;t:switch(kt){case 1:kt=0,pr=null,ms(t,r,g,1);break;case 2:case 9:if(l1(g)){kt=0,pr=null,Jb(r);break}r=function(){kt!==2&&kt!==9||Lt!==t||(kt=7),ji(t)},g.then(r,r);break e;case 3:kt=7;break e;case 4:kt=5;break e;case 7:l1(g)?(kt=0,pr=null,Jb(r)):(kt=0,pr=null,ms(t,r,g,7));break;case 5:var S=null;switch(et.tag){case 26:S=et.memoizedState;case 5:case 27:var D=et;if(S?A2(S):D.stateNode.complete){kt=0,pr=null;var H=D.sibling;if(H!==null)et=H;else{var te=D.return;te===null?et=null:(et=te,cu(te))}break t}}kt=0,pr=null,ms(t,r,g,5);break;case 6:kt=0,pr=null,ms(t,r,g,6);break;case 8:Hp(),Qt=6;break e;default:throw Error(s(462))}}YT();break}catch(he){Wb(t,he)}while(!0);return Ei=ao=null,se.H=l,se.A=h,mt=a,et===null?(Lt=null,rt=0,Rc(),Qt):0}function YT(){for(;et!==null&&!ea();)Gb(et)}function Gb(t){var r=bb(t.alternate,t,Ai);t.memoizedProps=t.pendingProps,r===null?cu(t):et=r}function Jb(t){var r=t,a=r.alternate;switch(r.tag){case 15:case 0:r=pb(a,r,r.pendingProps,r.type,void 0,rt);break;case 11:r=pb(a,r,r.pendingProps,r.type.render,r.ref,rt);break;case 5:ip(r);default:_b(a,r),r=et=Xv(r,Ai),r=bb(a,r,Ai)}t.memoizedProps=t.pendingProps,r===null?cu(t):et=r}function ms(t,r,a,l){Ei=ao=null,ip(r),is=null,rl=0;var h=r.return;try{if(FT(t,h,r,a,rt)){Qt=1,Jc(t,Sr(a,t.current)),et=null;return}}catch(g){if(h!==null)throw et=h,g;Qt=1,Jc(t,Sr(a,t.current)),et=null;return}r.flags&32768?(ot||l===1?t=!0:ds||rt&536870912?t=!1:(ma=t=!0,(l===2||l===9||l===3||l===6)&&(l=dr.current,l!==null&&l.tag===13&&(l.flags|=16384))),Xb(r,t)):cu(r)}function cu(t){var r=t;do{if(r.flags&32768){Xb(r,ma);return}t=r.return;var a=VT(r.alternate,r,Ai);if(a!==null){et=a;return}if(r=r.sibling,r!==null){et=r;return}et=r=t}while(r!==null);Qt===0&&(Qt=5)}function Xb(t,r){do{var a=$T(t.alternate,t);if(a!==null){a.flags&=32767,et=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(t=t.sibling,t!==null)){et=t;return}et=t=a}while(t!==null);Qt=6,et=null}function Yb(t,r,a,l,h,g,S,D,H){t.cancelPendingCommit=null;do uu();while(pn!==0);if(mt&6)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(g=r.lanes|r.childLanes,g|=Pf,bi(t,a,g,S,D,H),t===Lt&&(et=Lt=null,rt=0),ps=r,va=t,qi=a,zp=g,Fp=h,Bb=l,r.subtreeFlags&10256||r.flags&10256?(t.callbackNode=null,t.callbackPriority=0,nR(jt,function(){return r2(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(r.flags&13878)!=0,r.subtreeFlags&13878||l){l=se.T,se.T=null,h=K.p,K.p=2,S=mt,mt|=4;try{WT(t,r,a)}finally{mt=S,K.p=h,se.T=l}}pn=1,Zb(),e2(),t2()}}function Zb(){if(pn===1){pn=0;var t=va,r=ps,a=(r.flags&13878)!=0;if(r.subtreeFlags&13878||a){a=se.T,se.T=null;var l=K.p;K.p=2;var h=mt;mt|=4;try{Lb(r,t);var g=eh,S=Hv(t.containerInfo),D=g.focusedElem,H=g.selectionRange;if(S!==D&&D&&D.ownerDocument&&Bv(D.ownerDocument.documentElement,D)){if(H!==null&&Ef(D)){var te=H.start,he=H.end;if(he===void 0&&(he=te),"selectionStart"in D)D.selectionStart=te,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,Ae=Math.min(H.start,De),Rt=H.end===void 0?Ae:Math.min(H.end,De);!ue.extend&&Ae>Rt&&(S=Rt,Rt=Ae,Ae=S);var Q=Fv(D,Ae),W=Fv(D,Rt);if(Q&&W&&(ue.rangeCount!==1||ue.anchorNode!==Q.node||ue.anchorOffset!==Q.offset||ue.focusNode!==W.node||ue.focusOffset!==W.offset)){var Z=ge.createRange();Z.setStart(Q.node,Q.offset),ue.removeAllRanges(),Ae>Rt?(ue.addRange(Z),ue.extend(W.node,W.offset)):(Z.setEnd(W.node,W.offset),ue.addRange(Z))}}}}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}}xu=!!Zp,eh=Zp=null}finally{mt=h,K.p=l,se.T=a}}t.current=r,pn=2}}function e2(){if(pn===2){pn=0;var t=va,r=ps,a=(r.flags&8772)!=0;if(r.subtreeFlags&8772||a){a=se.T,se.T=null;var l=K.p;K.p=2;var h=mt;mt|=4;try{Rb(t,r.alternate,r)}finally{mt=h,K.p=l,se.T=a}}pn=3}}function t2(){if(pn===4||pn===3){pn=0,mi();var t=va,r=ps,a=qi,l=Bb;r.subtreeFlags&10256||r.flags&10256?pn=5:(pn=0,ps=va=null,n2(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(ya=null),j(a),r=r.stateNode,Gt&&typeof Gt.onCommitFiberRoot=="function")try{Gt.onCommitFiberRoot(wr,r,void 0,(r.current.flags&128)==128)}catch{}if(l!==null){r=se.T,h=K.p,K.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,K.p=h}}qi&3&&uu(),ji(t),h=t.pendingLanes,a&261930&&h&42?t===Bp?wl++:(wl=0,Bp=t):wl=0,_l(0,!1)}}function n2(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,tl(r)))}function uu(){return Zb(),e2(),t2(),r2()}function r2(){if(pn!==5)return!1;var t=va,r=zp;zp=0;var a=j(qi),l=se.T,h=K.p;try{K.p=32>a?32:a,se.T=null,a=Fp,Fp=null;var g=va,S=qi;if(pn=0,ps=va=null,qi=0,mt&6)throw Error(s(331));var D=mt;if(mt|=4,jb(g.current),Ib(g,g.current,S,a),mt=D,_l(0,!1),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot(wr,g)}catch{}return!0}finally{K.p=h,se.T=l,n2(t,r)}}function i2(t,r,a){r=Sr(a,r),r=bp(t.stateNode,r,2),t=po(t,r,2),t!==null&&(Ln(t,2),ji(t))}function St(t,r,a){if(t.tag===3)i2(t,t,a);else for(;r!==null;){if(r.tag===3){i2(r,t,a);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ya===null||!ya.has(l))){t=Sr(a,t),a=ab(2),l=po(r,a,2),l!==null&&(ob(a,l,r,t),Ln(l,2),ji(l));break}}r=r.return}}function $p(t,r,a){var l=t.pingCache;if(l===null){l=t.pingCache=new QT;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)||(Ap=!0,h.add(a),t=ZT.bind(null,t,r,a),r.then(t,t))}function ZT(t,r,a){var l=t.pingCache;l!==null&&l.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Lt===t&&(rt&a)===a&&(Qt===4||Qt===3&&(rt&62914560)===rt&&300>Wt()-iu?!(mt&2)&&hs(t,0):qp|=a,fs===rt&&(fs=0)),ji(t)}function a2(t,r){r===0&&(r=vi()),t=no(t,r),t!==null&&(Ln(t,r),ji(t))}function eR(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),a2(t,a)}function tR(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),a2(t,a)}function nR(t,r){return Pn(t,r)}var du=null,gs=null,Wp=!1,fu=!1,Up=!1,wa=0;function ji(t){t!==gs&&t.next===null&&(gs===null?du=gs=t:gs=gs.next=t),fu=!0,Wp||(Wp=!0,iR())}function _l(t,r){if(!Up&&fu){Up=!0;do for(var a=!1,l=du;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-ht(42|t)+1)-1,g&=h&~(S&~D),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,c2(l,g))}else g=rt,g=Br(l,l===Lt?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),!(g&3)||bn(l,g)||(a=!0,c2(l,g));l=l.next}while(a);Up=!1}}function rR(){o2()}function o2(){fu=Wp=!1;var t=0;wa!==0&&fR()&&(t=wa);for(var r=Wt(),a=null,l=du;l!==null;){var h=l.next,g=s2(l,r);g===0?(l.next=null,a===null?du=h:a.next=h,h===null&&(gs=a)):(a=l,(t!==0||g&3)&&(fu=!0)),l=h}pn!==0&&pn!==5||_l(t,!1),wa!==0&&(wa=0)}function s2(t,r){for(var a=t.suspendedLanes,l=t.pingedLanes,h=t.expirationTimes,g=t.pendingLanes&-62914561;0<g;){var S=31-ht(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=Lt,a=rt,a=Br(t,t===r?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,a===0||t===r&&(kt===2||kt===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&un(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&&un(l),j(a)){case 2:case 8:a=ti;break;case 32:a=jt;break;case 268435456:a=bt;break;default:a=jt}return l=l2.bind(null,t),a=Pn(a,l),t.callbackPriority=r,t.callbackNode=a,r}return l!==null&&l!==null&&un(l),t.callbackPriority=2,t.callbackNode=null,2}function l2(t,r){if(pn!==0&&pn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(uu()&&t.callbackNode!==a)return null;var l=rt;return l=Br(t,t===Lt?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(Vb(t,l,r),s2(t,Wt()),t.callbackNode!=null&&t.callbackNode===a?l2.bind(null,t):null)}function c2(t,r){if(uu())return null;Vb(t,r,!0)}function iR(){hR(function(){mt&6?Pn(dn,rR):o2()})}function Kp(){if(wa===0){var t=ts;t===0&&(t=_r,_r<<=1,!(_r&261888)&&(_r=256)),wa=t}return wa}function u2(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Vo(""+t)}function d2(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 aR(t,r,a,l,h){if(r==="submit"&&a&&a.stateNode===h){var g=u2((h[Fe]||null).action),S=l.submitter;S&&(r=(r=S[Fe]||null)?u2(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(wa!==0){var H=S?d2(h,S):new FormData(h);pp(a,{pending:!0,data:H,method:h.method,action:g},null,H)}}else typeof g=="function"&&(D.preventDefault(),H=S?d2(h,S):new FormData(h),pp(a,{pending:!0,data:H,method:h.method,action:g},g,H))},currentTarget:h}]})}}for(var Qp=0;Qp<Of.length;Qp++){var Gp=Of[Qp];Wr(Gp.toLowerCase(),"on"+(Gp[0].toUpperCase()+Gp.slice(1)))}Wr(Wv,"onAnimationEnd"),Wr(Uv,"onAnimationIteration"),Wr(Kv,"onAnimationStart"),Wr("dblclick","onDoubleClick"),Wr("focusin","onFocus"),Wr("focusout","onBlur"),Wr(wT,"onTransitionRun"),Wr(_T,"onTransitionStart"),Wr(xT,"onTransitionCancel"),Wr(Qv,"onTransitionEnd"),ra("onMouseEnter",["mouseout","mouseover"]),ra("onMouseLeave",["mouseout","mouseover"]),ra("onPointerEnter",["pointerout","pointerover"]),ra("onPointerLeave",["pointerout","pointerover"]),ii("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ii("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ii("onBeforeInput",["compositionend","keypress","textInput","paste"]),ii("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xl="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(" "),oR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xl));function f2(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,te=D.currentTarget;if(D=D.listener,H!==g&&h.isPropagationStopped())break e;g=D,h.currentTarget=te;try{g(h)}catch(he){Tc(he)}h.currentTarget=null,g=H}else for(S=0;S<l.length;S++){if(D=l[S],H=D.instance,te=D.currentTarget,D=D.listener,H!==g&&h.isPropagationStopped())break e;g=D,h.currentTarget=te;try{g(h)}catch(he){Tc(he)}h.currentTarget=null,g=H}}}}function tt(t,r){var a=r[Ot];a===void 0&&(a=r[Ot]=new Set);var l=t+"__bubble";a.has(l)||(h2(r,t,2,!1),a.add(l))}function Jp(t,r,a){var l=0;r&&(l|=4),h2(a,t,l,r)}var pu="_reactListening"+Math.random().toString(36).slice(2);function p2(t){if(!t[pu]){t[pu]=!0,Bs.forEach(function(a){a!=="selectionchange"&&(oR.has(a)||Jp(a,!1,t),Jp(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[pu]||(r[pu]=!0,Jp("selectionchange",!1,r))}}function h2(t,r,a,l){switch(B2(r)){case 2:var h=AR;break;case 8:h=qR;break;default:h=dh}a=h.bind(null,r,a,t),h=void 0,!Us||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 Xp(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}kc(function(){var te=g,he=$s(a),ge=[];e:{var ae=Gv.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=Te;break;case"focusin":De="focus",ue=F;break;case"focusout":De="blur",ue=F;break;case"beforeblur":case"afterblur":ue=F;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=N;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=dt;break;case Wv:case Uv:case Kv:ue=q;break;case Qv:ue=Je;break;case"scroll":case"scrollend":ue=v;break;case"wheel":ue=Mt;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=Ie;break;case"toggle":case"beforetoggle":ue=zt}var Ae=(r&4)!=0,Rt=!Ae&&(t==="scroll"||t==="scrollend"),Q=Ae?ae===null?null:ae+"Capture":ae;Ae=[];for(var W=te,Z;W!==null;){var me=W;if(Z=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||Z===null||Q===null||(me=Qa(W,Q),me!=null&&Ae.push(kl(W,me,Z))),Rt)break;W=W.return}0<Ae.length&&(ae=new ue(ae,De,null,a,he),ge.push({event:ae,listeners:Ae}))}}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[at]))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=te,De=De?sr(De):null,De!==null&&(Rt=d(De),Ae=De.tag,De!==Rt||Ae!==5&&Ae!==27&&Ae!==6)&&(De=null)):(ue=null,De=te),ue!==De)){if(Ae=O,me="onMouseLeave",Q="onMouseEnter",W="mouse",(t==="pointerout"||t==="pointerover")&&(Ae=Ie,me="onPointerLeave",Q="onPointerEnter",W="pointer"),Rt=ue==null?ae:Fn(ue),Z=De==null?ae:Fn(De),ae=new Ae(me,W+"leave",ue,a,he),ae.target=Rt,ae.relatedTarget=Z,me=null,sr(he)===te&&(Ae=new Ae(Q,W+"enter",De,a,he),Ae.target=Z,Ae.relatedTarget=Rt,me=Ae),Rt=me,ue&&De)t:{for(Ae=sR,Q=ue,W=De,Z=0,me=Q;me;me=Ae(me))Z++;me=0;for(var Me=W;Me;Me=Ae(Me))me++;for(;0<Z-me;)Q=Ae(Q),Z--;for(;0<me-Z;)W=Ae(W),me--;for(;Z--;){if(Q===W||W!==null&&Q===W.alternate){Ae=Q;break t}Q=Ae(Q),W=Ae(W)}Ae=null}else Ae=null;ue!==null&&m2(ge,ae,ue,Ae,!1),De!==null&&Rt!==null&&m2(ge,Rt,De,Ae,!0)}}e:{if(ae=te?Fn(te):window,ue=ae.nodeName&&ae.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ae.type==="file")var gt=Nv;else if(Mv(ae))if(Iv)gt=yT;else{gt=mT;var Pe=hT}else ue=ae.nodeName,!ue||ue.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?te&&Ka(te.elementType)&&(gt=Nv):gt=gT;if(gt&&(gt=gt(t,te))){Lv(ge,gt,a,he);break e}Pe&&Pe(t,ae,te),t==="focusout"&&te&&ae.type==="number"&&te.memoizedProps.value!=null&&wi(ae,"number",ae.value)}switch(Pe=te?Fn(te):window,t){case"focusin":(Mv(Pe)||Pe.contentEditable==="true")&&(Ko=Pe,Tf=te,Ys=null);break;case"focusout":Ys=Tf=Ko=null;break;case"mousedown":Rf=!0;break;case"contextmenu":case"mouseup":case"dragend":Rf=!1,Vv(ge,a,he);break;case"selectionchange":if(bT)break;case"keydown":case"keyup":Vv(ge,a,he)}var Qe;if(Ve)e:{switch(t){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else Uo?Cc(t,a)&&(it="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(it="onCompositionStart");it&&(fn&&a.locale!=="ko"&&(Uo||it!=="onCompositionStart"?it==="onCompositionEnd"&&Uo&&(Qe=Ks()):($r=he,$o="value"in $r?$r.value:$r.textContent,Uo=!0)),Pe=hu(te,it),0<Pe.length&&(it=new re(it,t,null,a,he),ge.push({event:it,listeners:Pe}),Qe?it.data=Qe:(Qe=Wo(a),Qe!==null&&(it.data=Qe)))),(Qe=nn?uT(t,a):dT(t,a))&&(it=hu(te,"onBeforeInput"),0<it.length&&(Pe=new re("onBeforeInput","beforeinput",null,a,he),ge.push({event:Pe,listeners:it}),Pe.data=Qe)),aR(ge,t,te,a,he)}f2(ge,r)})}function kl(t,r,a){return{instance:t,listener:r,currentTarget:a}}function hu(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(kl(t,h,g)),h=Qa(t,r),h!=null&&l.push(kl(t,h,g))),t.tag===3)return l;t=t.return}return[]}function sR(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function m2(t,r,a,l,h){for(var g=r._reactName,S=[];a!==null&&a!==l;){var D=a,H=D.alternate,te=D.stateNode;if(D=D.tag,H!==null&&H===l)break;D!==5&&D!==26&&D!==27||te===null||(H=te,h?(te=Qa(a,g),te!=null&&S.unshift(kl(a,te,H))):h||(te=Qa(a,g),te!=null&&S.push(kl(a,te,H)))),a=a.return}S.length!==0&&t.push({event:r,listeners:S})}var lR=/\r\n?/g,cR=/\u0000|\uFFFD/g;function g2(t){return(typeof t=="string"?t:""+t).replace(lR,`
10
+ `).replace(cR,"")}function y2(t,r){return r=g2(r),g2(t)===r}function Tt(t,r,a,l,h,g){switch(a){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||_i(t,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&_i(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":wc(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"&&Tt(t,r,"name",h.name,h,null),Tt(t,r,"formEncType",h.formEncType,h,null),Tt(t,r,"formMethod",h.formMethod,h,null),Tt(t,r,"formTarget",h.formTarget,h,null)):(Tt(t,r,"encType",h.encType,h,null),Tt(t,r,"method",h.method,h,null),Tt(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&&tt("scroll",t);break;case"onScrollEnd":l!=null&&tt("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":tt("beforetoggle",t),tt("toggle",t),Wa(t,"popover",l);break;case"xlinkActuate":Hr(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Hr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Hr(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Hr(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Hr(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Hr(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Hr(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Hr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Hr(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 Yp(t,r,a,l,h,g){switch(a){case"style":wc(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"?_i(t,l):(typeof l=="number"||typeof l=="bigint")&&_i(t,""+l);break;case"onScroll":l!=null&&tt("scroll",t);break;case"onScrollEnd":l!=null&&tt("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(!mc.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[Fe]||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":tt("error",t),tt("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:Tt(t,r,g,S,a,null)}}h&&Tt(t,r,"srcSet",a.srcSet,a,null),l&&Tt(t,r,"src",a.src,a,null);return;case"input":tt("invalid",t);var D=g=S=h=null,H=null,te=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":te=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:Tt(t,r,l,he,a,null)}}bc(t,g,D,H,te,S,h,!1);return;case"select":for(h in tt("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:Tt(t,r,h,D,a,null)}r=g,a=S,t.multiple=!!l,r==null?a!=null&&aa(t,!!l,a,!0):aa(t,!!l,r,!1);return;case"textarea":for(S in tt("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:Tt(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":Tt(t,r,H,l,a,null));return;case"dialog":tt("beforetoggle",t),tt("toggle",t),tt("cancel",t),tt("close",t);break;case"iframe":case"object":tt("load",t);break;case"video":case"audio":for(l=0;l<xl.length;l++)tt(xl[l],t);break;case"image":tt("error",t),tt("load",t);break;case"details":tt("toggle",t);break;case"embed":case"source":case"link":tt("error",t),tt("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(te in a)if(a.hasOwnProperty(te)&&(l=a[te],l!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Tt(t,r,te,l,a,null)}return;default:if(Ka(r)){for(he in a)a.hasOwnProperty(he)&&(l=a[he],l!==void 0&&Yp(t,r,he,l,a,void 0));return}}for(D in a)a.hasOwnProperty(D)&&(l=a[D],l!=null&&Tt(t,r,D,l,a,null))}function uR(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,te=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)||Tt(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":te=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&&Tt(t,r,ae,ue,l,ge)}}ia(t,S,D,H,te,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)||Tt(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&&Tt(t,r,h,g,l,H)}r=D,a=S,l=ue,ae==null?!!l!=!!a&&(r==null?aa(t,!!a,a?[]:"",!1):aa(t,!!a,r,!0)):aa(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:Tt(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&&Tt(t,r,S,h,l,g)}oa(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:Tt(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":Tt(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 Ae in a)ae=a[Ae],a.hasOwnProperty(Ae)&&ae!=null&&!l.hasOwnProperty(Ae)&&Tt(t,r,Ae,null,l,ae);for(te in l)if(ae=l[te],ue=a[te],l.hasOwnProperty(te)&&ae!==ue&&(ae!=null||ue!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(s(137,r));break;default:Tt(t,r,te,ae,l,ue)}return;default:if(Ka(r)){for(var Rt in a)ae=a[Rt],a.hasOwnProperty(Rt)&&ae!==void 0&&!l.hasOwnProperty(Rt)&&Yp(t,r,Rt,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||Yp(t,r,he,ae,l,ue);return}}for(var Q in a)ae=a[Q],a.hasOwnProperty(Q)&&ae!=null&&!l.hasOwnProperty(Q)&&Tt(t,r,Q,null,l,ae);for(ge in l)ae=l[ge],ue=a[ge],!l.hasOwnProperty(ge)||ae===ue||ae==null&&ue==null||Tt(t,r,ge,ae,l,ue)}function v2(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function dR(){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&&v2(S)){for(S=0,D=h.responseEnd,l+=1;l<a.length;l++){var H=a[l],te=H.startTime;if(te>D)break;var he=H.transferSize,ge=H.initiatorType;he&&v2(ge)&&(H=H.responseEnd,S+=he*(H<D?1:(D-te)/(H-te)))}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 Zp=null,eh=null;function mu(t){return t.nodeType===9?t:t.ownerDocument}function b2(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 w2(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 th(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 nh=null;function fR(){var t=window.event;return t&&t.type==="popstate"?t===nh?!1:(nh=t,!0):(nh=null,!1)}var _2=typeof setTimeout=="function"?setTimeout:void 0,pR=typeof clearTimeout=="function"?clearTimeout:void 0,x2=typeof Promise=="function"?Promise:void 0,hR=typeof queueMicrotask=="function"?queueMicrotask:x2===void 0?_2:function(t){return x2.resolve(null).then(t).catch(mR)};function mR(t){setTimeout(function(){throw t})}function _a(t){return t==="head"}function k2(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")Sl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Sl(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"&&Sl(t.ownerDocument.body);a=h}while(a);ws(r)}function S2(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 rh(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":rh(a),wn(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function gR(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 yR(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 C2(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 ih(t){return t.data==="$?"||t.data==="$~"}function ah(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function vR(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 oh=null;function E2(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 T2(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 R2(t,r,a){switch(r=mu(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 Sl(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);wn(t)}var Or=new Map,D2=new Set;function gu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var zi=K.d;K.d={f:bR,r:wR,D:_R,C:xR,L:kR,m:SR,X:ER,S:CR,M:TR};function bR(){var t=zi.f(),r=su();return t||r}function wR(t){var r=ri(t);r!==null&&r.tag===5&&r.type==="form"?Q1(r):zi.r(t)}var ys=typeof document>"u"?null:document;function O2(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+'"]'),D2.has(h)||(D2.add(h),t={rel:t,crossOrigin:a,href:r},l.querySelector(h)===null&&(r=l.createElement("link"),Tn(r,"link",t),Jt(r),l.head.appendChild(r)))}}function _R(t){zi.D(t),O2("dns-prefetch",t,null)}function xR(t,r){zi.C(t,r),O2("preconnect",t,r)}function kR(t,r,a){zi.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(Cl(g))||r==="script"&&l.querySelector(El(g))||(r=l.createElement("link"),Tn(r,"link",t),Jt(r),l.head.appendChild(r)))}}function SR(t,r){zi.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(El(g)))return}l=a.createElement("link"),Tn(l,"link",t),Jt(l),a.head.appendChild(l)}}}function CR(t,r,a){zi.S(t,r,a);var l=ys;if(l&&t){var h=na(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(Cl(g)))D.loading=5;else{t=C({rel:"stylesheet",href:t,"data-precedence":r},a),(a=Or.get(g))&&sh(t,a);var H=S=l.createElement("link");Jt(H),Tn(H,"link",t),H._p=new Promise(function(te,he){H.onload=te,H.onerror=he}),H.addEventListener("load",function(){D.loading|=1}),H.addEventListener("error",function(){D.loading|=2}),D.loading|=4,yu(S,r,l)}S={type:"stylesheet",instance:S,count:1,state:D},h.set(g,S)}}}function ER(t,r){zi.X(t,r);var a=ys;if(a&&t){var l=na(a).hoistableScripts,h=bs(t),g=l.get(h);g||(g=a.querySelector(El(h)),g||(t=C({src:t,async:!0},r),(r=Or.get(h))&&lh(t,r),g=a.createElement("script"),Jt(g),Tn(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(h,g))}}function TR(t,r){zi.M(t,r);var a=ys;if(a&&t){var l=na(a).hoistableScripts,h=bs(t),g=l.get(h);g||(g=a.querySelector(El(h)),g||(t=C({src:t,async:!0,type:"module"},r),(r=Or.get(h))&&lh(t,r),g=a.createElement("script"),Jt(g),Tn(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(h,g))}}function P2(t,r,a,l){var h=(h=qt.current)?gu(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=na(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=na(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(Cl(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||RR(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=na(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 Cl(t){return'link[rel="stylesheet"]['+t+"]"}function M2(t){return C({},t,{"data-precedence":t.precedence,precedence:null})}function RR(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),Jt(r),t.head.appendChild(r))}function bs(t){return'[src="'+lr(t)+'"]'}function El(t){return"script[async]"+t}function L2(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,Jt(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"),Jt(l),Tn(l,"style",h),yu(l,a.precedence,t),r.instance=l;case"stylesheet":h=vs(a.href);var g=t.querySelector(Cl(h));if(g)return r.state.loading|=4,r.instance=g,Jt(g),g;l=M2(a),(h=Or.get(h))&&sh(l,h),g=(t.ownerDocument||t).createElement("link"),Jt(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,yu(g,a.precedence,t),r.instance=g;case"script":return g=bs(a.src),(h=t.querySelector(El(g)))?(r.instance=h,Jt(h),h):(l=a,(h=Or.get(g))&&(l=C({},a),lh(l,h)),t=t.ownerDocument||t,h=t.createElement("script"),Jt(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,yu(l,a.precedence,t));return r.instance}function yu(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 sh(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.title??(t.title=r.title)}function lh(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.integrity??(t.integrity=r.integrity)}var vu=null;function N2(t,r,a){if(vu===null){var l=new Map,h=vu=new Map;h.set(a,l)}else h=vu,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[ze]||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 I2(t,r,a){t=t.ownerDocument||t,t.head.insertBefore(a,r==="title"?t.querySelector("head > title"):null)}function DR(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 A2(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function OR(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(Cl(h));if(g){r=g._p,typeof r=="object"&&r&&typeof r.then=="function"&&(t.count++,t=bu.bind(t),r.then(t,t)),a.state.loading|=4,a.instance=g,Jt(g);return}g=r.ownerDocument||r,l=M2(l),(h=Or.get(h))&&sh(l,h),g=g.createElement("link"),Jt(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=bu.bind(t),r.addEventListener("load",a),r.addEventListener("error",a))}}var ch=0;function PR(t,r){return t.stylesheets&&t.count===0&&_u(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var l=setTimeout(function(){if(t.stylesheets&&_u(t,t.stylesheets),t.unsuspend){var g=t.unsuspend;t.unsuspend=null,g()}},6e4+r);0<t.imgBytes&&ch===0&&(ch=62500*dR());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&_u(t,t.stylesheets),t.unsuspend)){var g=t.unsuspend;t.unsuspend=null,g()}},(t.imgBytes>ch?50:800)+r);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(h)}}:null}function bu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_u(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var wu=null;function _u(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,wu=new Map,r.forEach(MR,t),wu=null,bu.call(t))}function MR(t,r){if(!(r.state.loading&4)){var a=wu.get(t);if(a)var l=a.get(null);else{a=new Map,wu.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=bu.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 Tl={$$typeof:G,Provider:null,Consumer:null,_currentValue:Le,_currentValue2:Le,_threadCount:0};function LR(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=ni(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ni(0),this.hiddenUpdates=ni(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 NR(t,r,a,l,h,g,S,D,H,te,he,ge){return t=new LR(t,r,a,S,H,te,he,ge,D),r=1,g===!0&&(r|=24),g=ur(3,null,null,r),t.current=g,g.stateNode=t,r=Vf(),r.refCount++,t.pooledCache=r,r.refCount++,g.memoizedState={element:l,isDehydrated:a,cache:r},Kf(g),t}function IR(t){return t?(t=Jo,t):Jo}function q2(t,r,a,l,h,g){h=IR(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&&(Xn(a,t,r),al(a,t,r))}function j2(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function uh(t,r){j2(t,r),(t=t.alternate)&&j2(t,r)}function z2(t){if(t.tag===13||t.tag===31){var r=no(t,67108864);r!==null&&Xn(r,t,67108864),uh(t,67108864)}}function F2(t){if(t.tag===13||t.tag===31){var r=Rr();r=Ye(r);var a=no(t,r);a!==null&&Xn(a,t,r),uh(t,r)}}var xu=!0;function AR(t,r,a,l){var h=se.T;se.T=null;var g=K.p;try{K.p=2,dh(t,r,a,l)}finally{K.p=g,se.T=h}}function qR(t,r,a,l){var h=se.T;se.T=null;var g=K.p;try{K.p=8,dh(t,r,a,l)}finally{K.p=g,se.T=h}}function dh(t,r,a,l){if(xu){var h=fh(l);if(h===null)Xp(t,r,l,ku,a),H2(t,l);else if(zR(h,t,r,a,l))l.stopPropagation();else if(H2(t,l),r&4&&-1<jR.indexOf(t)){for(;h!==null;){var g=ri(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-ht(S);D.entanglements[1]|=H,S&=~H}ji(g),!(mt&6)&&(au=Wt()+500,_l(0,!1))}}break;case 31:case 13:D=no(g,2),D!==null&&Xn(D,g,2),su(),uh(g,2)}if(g=fh(l),g===null&&Xp(t,r,l,ku,a),g===h)break;h=g}h!==null&&l.stopPropagation()}else Xp(t,r,l,null,a)}}function fh(t){return t=$s(t),ph(t)}var ku=null;function ph(t){if(ku=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 ku=t,null}function B2(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(gi()){case dn:return 2;case ti:return 8;case jt:case Fr:return 32;case bt:return 268435456;default:return 32}default:return 32}}var hh=!1,xa=null,ka=null,Sa=null,Rl=new Map,Dl=new Map,Ca=[],jR="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 H2(t,r){switch(t){case"focusin":case"focusout":xa=null;break;case"dragenter":case"dragleave":ka=null;break;case"mouseover":case"mouseout":Sa=null;break;case"pointerover":case"pointerout":Rl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dl.delete(r.pointerId)}}function Ol(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=ri(r),r!==null&&z2(r)),t):(t.eventSystemFlags|=l,r=t.targetContainers,h!==null&&r.indexOf(h)===-1&&r.push(h),t)}function zR(t,r,a,l,h){switch(r){case"focusin":return xa=Ol(xa,t,r,a,l,h),!0;case"dragenter":return ka=Ol(ka,t,r,a,l,h),!0;case"mouseover":return Sa=Ol(Sa,t,r,a,l,h),!0;case"pointerover":var g=h.pointerId;return Rl.set(g,Ol(Rl.get(g)||null,t,r,a,l,h)),!0;case"gotpointercapture":return g=h.pointerId,Dl.set(g,Ol(Dl.get(g)||null,t,r,a,l,h)),!0}return!1}function V2(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(){F2(a)});return}}else if(r===31){if(r=p(a),r!==null){t.blockedOn=r,ve(t.priority,function(){F2(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 Su(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=fh(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=ri(a),r!==null&&z2(r),t.blockedOn=a,!1;r.shift()}return!0}function $2(t,r,a){Su(t)&&a.delete(r)}function FR(){hh=!1,xa!==null&&Su(xa)&&(xa=null),ka!==null&&Su(ka)&&(ka=null),Sa!==null&&Su(Sa)&&(Sa=null),Rl.forEach($2),Dl.forEach($2)}function Cu(t,r){t.blockedOn===r&&(t.blockedOn=null,hh||(hh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,FR)))}var Eu=null;function W2(t){Eu!==t&&(Eu=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Eu===t&&(Eu=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(ph(l||a)===null)continue;break}var g=ri(a);g!==null&&(t.splice(r,3),r-=3,pp(g,{pending:!0,data:h,method:a.method,action:l},l,h))}}))}function ws(t){function r(H){return Cu(H,t)}xa!==null&&Cu(xa,t),ka!==null&&Cu(ka,t),Sa!==null&&Cu(Sa,t),Rl.forEach(r),Dl.forEach(r);for(var a=0;a<Ca.length;a++){var l=Ca[a];l.blockedOn===t&&(l.blockedOn=null)}for(;0<Ca.length&&(a=Ca[0],a.blockedOn===null);)V2(a),a.blockedOn===null&&Ca.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[Fe]||null;if(typeof g=="function")S||W2(a);else if(S){var D=null;if(g&&g.hasAttribute("formAction")){if(h=g,S=g[Fe]||null)D=S.formAction;else if(ph(h)!==null)continue}else D=S.action;typeof D=="function"?a[l+1]=D:(a.splice(l,3),l-=3),W2(a)}}}function BR(){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 mh(t){this._internalRoot=t}gh.prototype.render=mh.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var a=r.current;q2(a,Rr(),t,r,null,null)},gh.prototype.unmount=mh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;q2(t.current,2,null,t,null,null),su(),r[at]=null}};function gh(t){this._internalRoot=t}gh.prototype.unstable_scheduleHydration=function(t){if(t){var r=ee();t={blockedOn:null,target:t,priority:r};for(var a=0;a<Ca.length&&r!==0&&r<Ca[a].priority;a++);Ca.splice(a,0,t),a===0&&V2(t)}};var U2=i.version;if(U2!=="19.2.3")throw Error(s(527,U2,"19.2.3"));K.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 HR={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:se,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Tu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tu.isDisabled&&Tu.supportsFiber)try{wr=Tu.inject(HR),Gt=Tu}catch{}}e.createRoot=function(t,r){if(!c(t))throw Error(s(299));var a=!1,l="",h=qT,g=jT,S=zT;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=NR(t,1,!1,null,null,a,l,null,h,g,S,BR),t[at]=r.current,p2(t),new mh(r)}})),ud=Se(((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()})),qm="Expected a function";function yx(e,n){var i;if(typeof n!="function")throw TypeError(qm);return e=r4(e),function(){return--e>0&&(i=n.apply(this,arguments)),e<=1&&(n=void 0),i}}var vx=yx;function bx(e){return vx(2,e)}let jm;_m=bx,jm=Math.max;function wx(e){if(!(e&&e.length))return[];var n=0;return e=o4(e,function(i){if(i4(i))return n=jm(i.length,n),!0}),t4(n,function(i){return n4(e,f4(i))})}var _x=a4(wx);fm=function(e,n){if(e==null)throw Error(n||`Expected value but got ${e}`)},BigInt.prototype.toJSON=function(){return JSON.rawJSON(this.toString())},dm=function(e){try{return JSON.parse(e,(n,i)=>gd(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:gd(i):gd(i))}catch{return{}}};function xx(e,n){return e==null?"":typeof e=="number"&&!Number.isNaN(e)?e.toLocaleString(n,{useGrouping:!1,maximumFractionDigits:20}):String(e)}J_=function(e,n){if(e.length===0)return"";let i=Object.keys(e[0]),o=e.map(s=>i.map(c=>xx(s[c],n)).join(" "));return`${i.join(" ")}
11
11
  ${o.join(`
12
- `)}`},z_=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=>xx(i[o])).join(" | ")} |`)].join(`
13
- `)};function xx(e){if(e==null)return"";if(Array.isArray(e)||typeof e=="object")return jm(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 jm(n)}function jm(e){return e.replaceAll("\\","\\\\").replaceAll("|","\\|").replaceAll(`
14
- `," ").replaceAll("\r","")}function gd(e){return typeof e=="object"&&e&&"$bigint"in e&&typeof e.$bigint=="string"?BigInt(e.$bigint):e}var zm="abcdefghijklmnopqrstuvwxyz",Fm=zm+zm.toUpperCase(),Bm=new Set;Rs="__scratch__",gr="setup",Pa={create(){let e=0,n;do{let i="";for(let o=0;o<4;o++)i+=Fm[Math.floor(Math.random()*Fm.length)];n=i,e++}while(Bm.has(n)&&e<100);if(e>=100)throw Error("Failed to generate unique CellId after 100 attempts");return Bm.add(n),n}},Zn={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=Zn.findElement(n);if(i)return i;let o=n.getRootNode();if(n=o instanceof ShadowRoot?o.host:n.parentElement,n===o)break}return null}},T_=function(e){let n=null,i=Zn.findElementThroughShadowDOMs(e);return i&&(n=Zn.parse(i.id)),n},sd={parse(e){return e.getAttribute("object-id")},parseOrThrow(e){let n=sd.parse(e);return In(n,"<marimo-ui-element/> missing object-id attribute"),n}},Ew={create(e){return`output-${e}`}},cm=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)}},Bu=function(e){return dm(e??"")},a_=function(e){return ci.mapValues(e.dataset,n=>typeof n=="string"?Bu(n):n)},r_=function(e,n){let i=e.parentElement?sd.parse(e.parentElement):void 0;return i&&n.has(i)?n.lookupValue(i):Bu(e.dataset.initialValue)},Jl=function(){if(p4())return document.title||null;if(bh()){let i=cm.getFilename();if(i)return i}let e=document.querySelector("marimo-filename");fm(e,"marimo-filename tag not found");let n=e.innerHTML;return n.length===0?null:n};var kx=Symbol("");Aw=function(e,n){return Be(e,function(i,o,s){o(this,n(i(this),s))})};function yd(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 vd=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),Sx=new WeakMap,Cx=(e,n,i,o)=>vd(e,vd(()=>new WeakMap,vd(()=>new WeakMap,Sx,n),i),o);function Ex(e,n,i=Object.is){return Cx(()=>{let o=Symbol(),s=([d,f])=>{if(f===o)return n(d);let p=n(d,f);return i(f,p)?f:p},c=Be(d=>{let f=d(c);return s([d(e),f])});return c.init=o,c},e,n,i)}var Hm=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),Tx=new WeakMap,Rx=(e,n,i)=>Hm(e,Hm(()=>new WeakMap,Tx,n),i),Dx={},Vm=e=>!!e.write,Ox=e=>typeof e=="function";function Px(e,n){return Rx(()=>{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 L=y&&y.atomList[y.keyList.indexOf(T)];if(L){w[E]=L;return}let z=U=>{let $=U(s),I=U(e),G=o(I,$==null?void 0:$.arr).keyList.indexOf(T);if(G<0||G>=I.length){let pe=d[o(d).keyList.indexOf(T)];if(pe)return pe;throw Error("splitAtom: index out of bounds for read")}return I[G]};w[E]=Vm(e)?Be(z,(U,$,I)=>{let G=U(s),pe=U(e),P=o(pe,G==null?void 0:G.arr).keyList.indexOf(T);if(P<0||P>=pe.length)throw Error("splitAtom: index out of bounds for write");let A=Ox(I)?I(pe[P]):I;Object.is(pe[P],A)||$(e,[...pe.slice(0,P),A,...pe.slice(P+1)])}):Be(z)}),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=Be(d=>{let f=d(s);return o(d(e),f==null?void 0:f.arr)});s.init=void 0;let c=Vm(e)?Be(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}}}):Be(d=>d(s).atomList);return c},e,n||Dx)}var $m=e=>typeof(e==null?void 0:e.then)=="function";function Wm(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 $m(_)?_.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 Mx=Wm();Fl=function(e,n,i=Mx,o){let s=Be(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},Be(c=>c(s),(c,d,f)=>{let p=typeof f=="function"?f(c(s)):f;return p===kx?(d(s,n),i.removeItem(e)):$m(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=Um(d.value,n,i,o);else if(d.get!=null)d.get=Um(d.get,n,i,o);else throw"Only put a Memoize() decorator on a method or get accessor."}};var bd=new Map;function Um(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)bd.has(p)?bd.get(p).push(f):bd.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=Be(Jl()),zw=Be(void 0);var Lx=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 Nx(){let{hasLocalStorage:e,hasSessionStorage:n}=Y4();return e?window.localStorage:n?window.sessionStorage:new Lx}Ts=Nx();let Ui;sx=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)}},ju=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:(Re.warn("Error parsing zod local storage",i.error),this.getDefaultValue())}catch(n){return Re.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)}},Zh=class extends ju{constructor(e,n,i){let o=ct.get(Es);super(n,i),this.filename=o;try{this.unsubscribeFromFilename=ct.sub(Es,()=>{let s=ct.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))}},Ui="marimo:notebook-col-sizes";function Ix(){return{widths:[]}}var Eo=new Zh(Ui,Q2({widths:ZR(JR([XR(),YR("contentWidth")]).default("contentWidth"))}),Ix);Hw={getColumnWidth:e=>Eo.get(Ui).widths[e]??"contentWidth",saveColumnWidth:(e,n)=>{let i=Eo.get(Ui).widths;if(i[e])i[e]=n;else{for(;i.length<=e;)i.push("contentWidth");i[e]=n}Eo.set(Ui,{widths:i})},clearStorage:()=>{Eo.remove(Ui)}};function Ax(e,n){let i=Eo.get(Ui).widths,o=Ll(i,e,n);Eo.set(Ui,{widths:o})}var Km,Qm,Gm,Nr,Jm,Xm,Ym,Zm,Wn,e0,t0,n0,r0,i0,a0,Zt;function er(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=(Km=$n(),Qm=$n(),Gm=$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}},er(Nr.prototype,"geDescendantCount",[Km],Object.getOwnPropertyDescriptor(Nr.prototype,"geDescendantCount"),Nr.prototype),er(Nr.prototype,"getDescendants",[Qm],Object.getOwnPropertyDescriptor(Nr.prototype,"getDescendants"),Nr.prototype),er(Nr.prototype,"inOrderIds",[Gm],Object.getOwnPropertyDescriptor(Nr.prototype,"inOrderIds"),Nr.prototype),Nr);var qx=0;let To;To=(Jm=$n(),Xm=$n(),Ym=$n(),Zm=$n(),Wn=class Co{constructor(n,i){this.nodes=n,this.id=i}static from(n){let i=`tree_${qx++}`;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():(Re.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),[])}isCollapsed(n){let i=this._nodeMap.get(n);return i?i.isCollapsed:(Re.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(Ll(this.nodes,i,0))}moveToBack(n){let i=this.indexOfOrThrow(n);return this.withNodes(Ll(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=mw(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=mw(n,i+1,o.children)),i++}return this.withNodes(n)}move(n,i){return this.withNodes(Ll(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(hw(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(X4(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}},er(Wn.prototype,"topLevelIds",[Jm],Object.getOwnPropertyDescriptor(Wn.prototype,"topLevelIds"),Wn.prototype),er(Wn.prototype,"inOrderIds",[Xm],Object.getOwnPropertyDescriptor(Wn.prototype,"inOrderIds"),Wn.prototype),er(Wn.prototype,"idSet",[Ym],Object.getOwnPropertyDescriptor(Wn.prototype,"idSet"),Wn.prototype),er(Wn.prototype,"_nodeMap",[Zm],Object.getOwnPropertyDescriptor(Wn.prototype,"_nodeMap"),Wn.prototype),Wn),zl=(e0=$n(),t0=$n(),n0=$n(),r0=$n(),i0=$n(),a0=$n(),Zt=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(hw(_.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 Ax(o,s),new An(Ll([...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 Re.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(gr))}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 Re.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}},er(Zt.prototype,"isEmpty",[e0],Object.getOwnPropertyDescriptor(Zt.prototype,"isEmpty"),Zt.prototype),er(Zt.prototype,"topLevelIds",[t0],Object.getOwnPropertyDescriptor(Zt.prototype,"topLevelIds"),Zt.prototype),er(Zt.prototype,"inOrderIds",[n0],Object.getOwnPropertyDescriptor(Zt.prototype,"inOrderIds"),Zt.prototype),er(Zt.prototype,"idLength",[r0],Object.getOwnPropertyDescriptor(Zt.prototype,"idLength"),Zt.prototype),er(Zt.prototype,"_columnMap",[i0],Object.getOwnPropertyDescriptor(Zt.prototype,"_columnMap"),Zt.prototype),er(Zt.prototype,"getColumnIds",[a0],Object.getOwnPropertyDescriptor(Zt.prototype,"getColumnIds"),Zt.prototype),Zt);let wd,_d,xd,o0,kd,s0,l0,c0,u0,Sd,Cd,d0,Ed,Td;wd=Se((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})),_d=Se((e=>{var n=e&&e.__extends||(function(){var P=function(A,V){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(de,fe){de.__proto__=fe}||function(de,fe){for(var be in fe)Object.prototype.hasOwnProperty.call(fe,be)&&(de[be]=fe[be])},P(A,V)};return function(A,V){if(typeof V!="function"&&V!==null)throw TypeError("Class extends value "+String(V)+" is not a constructor or null");P(A,V);function de(){this.constructor=A}A.prototype=V===null?Object.create(V):(de.prototype=V.prototype,new de)}})(),i=e&&e.__assign||function(){return i=Object.assign||function(P){for(var A,V=1,de=arguments.length;V<de;V++)for(var fe in A=arguments[V],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=wd(),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),G(this,A)},P})();e.Node=s;var c=(function(P){n(A,P);function A(V){var de=P.call(this)||this;return de.data=V,de}return Object.defineProperty(A.prototype,"nodeValue",{get:function(){return this.data},set:function(V){this.data=V},enumerable:!1,configurable:!0}),A})(s);e.DataNode=c;var d=(function(P){n(A,P);function A(){var V=P!==null&&P.apply(this,arguments)||this;return V.type=o.ElementType.Text,V}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 V=P!==null&&P.apply(this,arguments)||this;return V.type=o.ElementType.Comment,V}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(V,de){var fe=P.call(this,de)||this;return fe.name=V,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(V){var de=P.call(this)||this;return de.children=V,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(V){this.children=V},enumerable:!1,configurable:!0}),A})(s);e.NodeWithChildren=y;var w=(function(P){n(A,P);function A(){var V=P!==null&&P.apply(this,arguments)||this;return V.type=o.ElementType.CDATA,V}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 V=P!==null&&P.apply(this,arguments)||this;return V.type=o.ElementType.Root,V}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(V,de,fe,be){fe===void 0&&(fe=[]),be===void 0&&(be=V==="script"?o.ElementType.Script:V==="style"?o.ElementType.Style:o.ElementType.Tag);var J=P.call(this,fe)||this;return J.name=V,J.attribs=de,J.type=be,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(V){this.name=V},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"attributes",{get:function(){var V=this;return Object.keys(this.attribs).map(function(de){var fe,be;return{name:de,value:V.attribs[de],namespace:(fe=V["x-attribsNamespace"])==null?void 0:fe[de],prefix:(be=V["x-attribsPrefix"])==null?void 0:be[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 L(P){return P.type===o.ElementType.Text}e.isText=L;function z(P){return P.type===o.ElementType.Comment}e.isComment=z;function U(P){return P.type===o.ElementType.Directive}e.isDirective=U;function $(P){return P.type===o.ElementType.Root}e.isDocument=$;function I(P){return Object.prototype.hasOwnProperty.call(P,"children")}e.hasChildren=I;function G(P,A){A===void 0&&(A=!1);var V;if(L(P))V=new d(P.data);else if(z(P))V=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(Ee){return Ee.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"])),V=fe}else if(T(P)){var de=A?pe(P.children):[],be=new w(de);de.forEach(function(ne){return ne.parent=be}),V=be}else if($(P)){var de=A?pe(P.children):[],J=new _(de);de.forEach(function(ne){return ne.parent=J}),P["x-mode"]&&(J["x-mode"]=P["x-mode"]),V=J}else if(U(P)){var we=new p(P.name,P.data);P["x-name"]!=null&&(we["x-name"]=P["x-name"],we["x-publicId"]=P["x-publicId"],we["x-systemId"]=P["x-systemId"]),V=we}else throw Error(`Not implemented yet: ${P.type}`);return V.startIndex=P.startIndex,V.endIndex=P.endIndex,P.sourceCodeLocation!=null&&(V.sourceCodeLocation=P.sourceCodeLocation),V}e.cloneNode=G;function pe(P){for(var A=P.map(function(de){return G(de,!0)}),V=1;V<A.length;V++)A[V].prev=A[V-1],A[V-1].next=A[V];return A}})),xd=Se((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=wd(),s=_d();i(_d(),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})),o0=Se((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")})),kd=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=s,e.escapeSpecialCharacters=d,e.revertEscapedCharacters=f,e.formatDOM=p;var n=xd(),i=o0();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,L=y.length;T<L;T++){var z=y[T];switch(z.nodeType){case 1:var U=c(z.nodeName);E=new n.Element(U,s(z.attributes)),E.children=p(U==="template"?z.content.childNodes:z.childNodes,E);break;case 3:E=new n.Text(f(z.nodeValue));break;case 8:E=new n.Comment(z.nodeValue);break;default:continue}var $=C[T-1]||null;$&&($.next=E),E.parent=w,E.prev=$,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}})),s0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=z;var n=kd(),i="html",o="head",s="body",c=/<([a-zA-Z]+[0-9]?)/,d=/<head[^]*>/i,f=/<body[^]*>/i,p=function(U,$){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},y=function(U,$){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(U,$){return $&&(U=`<${$}>${U}</${$}>`),_.parseFromString(U,C)},p=y}if(typeof document=="object"&&document.implementation){var E=document.implementation.createHTMLDocument();p=function(U,$){if($){var I=E.documentElement.querySelector($);return I&&(I.innerHTML=U),E}return E.documentElement.innerHTML=U,E}}var T=typeof document=="object"&&document.createElement("template"),L;T&&T.content&&(L=function(U){return T.innerHTML=U,T.content.childNodes});function z(U){var $,I;U=(0,n.escapeSpecialCharacters)(U);var G=U.match(c),pe=G&&G[1]?G[1].toLowerCase():"";switch(pe){case i:var P=y(U);if(!d.test(U)){var V=P.querySelector(o);($=V==null?void 0:V.parentNode)==null||$.removeChild(V)}if(!f.test(U)){var V=P.querySelector(s);(I=V==null?void 0:V.parentNode)==null||I.removeChild(V)}return P.querySelectorAll(i);case o:case s:var A=p(U).querySelectorAll(pe);return f.test(U)&&d.test(U)?A[0].parentNode.childNodes:A;default:if(L)return L(U);var V=p(U,s).querySelector(s);return V.childNodes}}})),l0=Se((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(s0()),o=kd(),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)}})),c0=Se((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}})),u0=Se((e=>{var n=0,i=1,o=2,s=3,c=4,d=5,f=6;function p(I){return w.hasOwnProperty(I)?w[I]:null}function y(I,G,pe,P,A,V,de){this.acceptsBooleans=G===o||G===s||G===c,this.attributeName=P,this.attributeNamespace=A,this.mustUseProperty=pe,this.propertyName=I,this.type=G,this.sanitizeURL=V,this.removeEmptyString=de}var w={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(I=>{w[I]=new y(I,n,!1,I,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([I,G])=>{w[I]=new y(I,i,!1,G,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(I=>{w[I]=new y(I,o,!1,I.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(I=>{w[I]=new y(I,o,!1,I,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(I=>{w[I]=new y(I,s,!1,I.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(I=>{w[I]=new y(I,s,!0,I,null,!1,!1)}),["capture","download"].forEach(I=>{w[I]=new y(I,c,!1,I,null,!1,!1)}),["cols","rows","size","span"].forEach(I=>{w[I]=new y(I,f,!1,I,null,!1,!1)}),["rowSpan","start"].forEach(I=>{w[I]=new y(I,d,!1,I.toLowerCase(),null,!1,!1)});var _=/[\-\:]([a-z])/g,C=I=>I[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(I=>{let G=I.replace(_,C);w[G]=new y(G,i,!1,I,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(I=>{let G=I.replace(_,C);w[G]=new y(G,i,!1,I,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(I=>{let G=I.replace(_,C);w[G]=new y(G,i,!1,I,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(I=>{w[I]=new y(I,i,!1,I.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(I=>{w[I]=new y(I,i,!1,I.toLowerCase(),null,!0,!0)});var{CAMELCASE:T,SAME:L,possibleStandardNames:z}=c0(),U=RegExp.prototype.test.bind(RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),$=Object.keys(z).reduce((I,G)=>{let pe=z[G];return pe===L?I[G]=G:pe===T?I[G.toLowerCase()]=G:I[G]=pe,I},{});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=U,e.possibleStandardNames=$})),Sd=Se((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=Du(),o=n(Z4()),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}})),Cd=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var n=u0(),i=Sd(),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(),L=f(T);if(L){var z=(0,n.getPropertyInfo)(L);switch(o.includes(L)&&s.includes(y)&&!_&&(L=f("default"+T)),w[L]=E,z&&z.type){case n.BOOLEAN:w[L]=!0;break;case n.OVERLOADED_BOOLEAN:E===""&&(w[L]=!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]}})),d0=Se((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=Du(),o=n(Cd()),s=Sd(),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,L=E.createElement,z=E.isValidElement,U=p.length,$=0;$<U;$++){var I=p[$];if(_){var G=y.replace(I,$);if(z(G)){U>1&&(G=T(G,{key:G.key||$})),w.push(C(G,I,$));continue}}if(I.type==="text"){var pe=!I.data.trim().length;if(pe&&I.parent&&!(0,s.canTextBeChildOfNode)(I.parent)||y.trim&&pe)continue;w.push(C(I.data,I,$));continue}var P=I,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 V=void 0;switch(I.type){case"script":case"style":I.children[0]&&(A.dangerouslySetInnerHTML={__html:I.children[0].data});break;case"tag":I.name==="textarea"&&I.children[0]?A.defaultValue=I.children[0].data:I.children&&I.children.length&&(V=d(I.children,y));break;default:continue}U>1&&(A.key=$),w.push(C(L(I.name,A,V),I,$))}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)}})),Ed=Se((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(l0());e.htmlToDOM=i.default,e.attributesToProps=n(Cd()).default;var o=n(d0());e.domToReact=o.default;var s=xd();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):[]}})),Td=yh(Ed(),1),Oa=Ed(),Jh=Td.default.default||Td.default;let Zl;Zl=(e,n)=>{let[i,...o]=n.split("."),s=(e.attribs.class||"").split(" ");return e.tagName===i&&o.every(c=>s.includes(c))},P_=e=>{var n;return e&&Zl(e,"span.nb")&&e.firstChild instanceof Oa.Text&&((n=e.firstChild.nodeValue)==null?void 0:n.includes("__marimo__"))},Kh=function(e){var n,i,o;if(e instanceof Oa.Element&&e.firstChild instanceof Oa.Text&&Zl(e,"span.nb")){let s=e.next;if(s&&s instanceof Oa.Text){let c=s.next;if(c&&c instanceof Oa.Element&&c.firstChild instanceof Oa.Text&&Zl(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},$h=function(e){let n=[];return Jh(e,{replace:i=>{let o=Kh(i);if(o)return n.push(o),"dummy"}}),n};function f0(e){return n=>{let i=!1;for(let o of n)o&&(i=e(o)||i);return i}}const jx=f0(k4),zx=f0(S4);let Rd,p0,Ro,h0,Do,m0;Rd=Se(((e,n)=>{var i=typeof Reflect=="object"?Reflect:null,o=i&&typeof i.apply=="function"?i.apply:function(P,A,V){return Function.prototype.apply.call(P,A,V)},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=I,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=[],V=1;V<arguments.length;V++)A.push(arguments[V]);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 be;if(A.length>0&&(be=A[0]),be instanceof Error)throw be;var J=Error("Unhandled error."+(be?" ("+be.message+")":""));throw J.context=be,J}var we=fe[P];if(we===void 0)return!1;if(typeof we=="function")o(we,this,A);else for(var Ee=we.length,ne=z(we,Ee),V=0;V<Ee;++V)o(ne[V],this,A);return!0};function _(P,A,V,de){var fe,be,J;if(y(V),be=P._events,be===void 0?(be=P._events=Object.create(null),P._eventsCount=0):(be.newListener!==void 0&&(P.emit("newListener",A,V.listener?V.listener:V),be=P._events),J=be[A]),J===void 0)J=be[A]=V,++P._eventsCount;else if(typeof J=="function"?J=be[A]=de?[V,J]:[J,V]:de?J.unshift(V):J.push(V),fe=w(P),fe>0&&J.length>fe&&!J.warned){J.warned=!0;var we=Error("Possible EventEmitter memory leak detected. "+J.length+" "+String(A)+" listeners added. Use emitter.setMaxListeners() to increase limit");we.name="MaxListenersExceededWarning",we.emitter=P,we.type=A,we.count=J.length,c(we)}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,V){var de={fired:!1,wrapFn:void 0,target:P,type:A,listener:V},fe=C.bind(de);return fe.listener=V,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 V,de,fe,be,J;if(y(A),de=this._events,de===void 0||(V=de[P],V===void 0))return this;if(V===A||V.listener===A)--this._eventsCount===0?this._events=Object.create(null):(delete de[P],de.removeListener&&this.emit("removeListener",P,V.listener||A));else if(typeof V!="function"){for(fe=-1,be=V.length-1;be>=0;be--)if(V[be]===A||V[be].listener===A){J=V[be].listener,fe=be;break}if(fe<0)return this;fe===0?V.shift():U(V,fe),V.length===1&&(de[P]=V[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,V=this._events,de;if(V===void 0)return this;if(V.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):V[P]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete V[P]),this;if(arguments.length===0){var fe=Object.keys(V),be;for(de=0;de<fe.length;++de)be=fe[de],be!=="removeListener"&&this.removeAllListeners(be);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(A=V[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,V){var de=P._events;if(de===void 0)return[];var fe=de[A];return fe===void 0?[]:typeof fe=="function"?V?[fe.listener||fe]:[fe]:V?$(fe):z(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):L.call(P,A)},f.prototype.listenerCount=L;function L(P){var A=this._events;if(A!==void 0){var V=A[P];if(typeof V=="function")return 1;if(V!==void 0)return V.length}return 0}f.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function z(P,A){for(var V=Array(A),de=0;de<A;++de)V[de]=P[de];return V}function U(P,A){for(;A+1<P.length;A++)P[A]=P[A+1];P.pop()}function $(P){for(var A=Array(P.length),V=0;V<A.length;++V)A[V]=P[V].listener||P[V];return A}function I(P,A){return new Promise(function(V,de){function fe(J){P.removeListener(A,be),de(J)}function be(){typeof P.removeListener=="function"&&P.removeListener("error",fe),V([].slice.call(arguments))}pe(P,A,be,{once:!0}),A!=="error"&&G(P,fe,{once:!0})})}function G(P,A,V){typeof P.on=="function"&&pe(P,"error",A,V)}function pe(P,A,V,de){if(typeof P.on=="function")de.once?P.once(A,V):P.on(A,V);else if(typeof P.addEventListener=="function")P.addEventListener(A,function fe(be){de.once&&P.removeEventListener(A,fe),V(be)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof P)}})),p0=Se((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(L){w(L)}}function C(T){try{E(f.throw(T))}catch(L){w(L)}}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=Rd();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,L){C.batch.push({resolve:T,reject:L,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=Se((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)}})),h0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TransportRequestManager=void 0;var n=Rd(),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})()})),Ra=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Transport=void 0;var n=h0();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=Se((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]:[]}})),m0=Se((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=Ra(),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 Fx(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 Dd(e){return typeof e!="string"&&(e=String(e)),e}function Od(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 ln(e){this.map={},e instanceof ln?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 Pd(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function g0(e){return new Promise(function(n,i){e.onload=function(){n(e.result)},e.onerror=function(){i(e.error)}})}function Bx(e){var n=new FileReader,i=g0(n);return n.readAsArrayBuffer(e),i}function Hx(e){var n=new FileReader,i=g0(n),o=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=o?o[1]:"utf-8";return n.readAsText(e,s),i}function Vx(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 y0(e){if(e.slice)return e.slice(0);var n=new Uint8Array(e.byteLength);return n.set(new Uint8Array(e)),n.buffer}function v0(){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&&Fx(e)?(this._bodyArrayBuffer=y0(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Rn.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||_0(e))?this._bodyArrayBuffer=y0(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=Pd(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 Pd(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(Bx);throw Error("could not read as ArrayBuffer")},this.text=function(){var e=Pd(this);if(e)return e;if(this._bodyBlob)return Hx(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Vx(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(Wx)}),this.json=function(){return this.text().then(JSON.parse)},this}function $x(e){var n=e.toUpperCase();return x0.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 ln(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 ln(n.headers)),this.method=$x(n.method||this.method||"GET"),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal||(function(){if("AbortController"in mn)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 Wx(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 Ux(e){var n=new ln;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 Yr(e,n){if(!(this instanceof Yr))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 ln(n.headers),this.url=n.url||"",this._initBody(e)}function b0(e,n){return new Promise(function(i,o){var s=new Aa(e,n);if(s.signal&&s.signal.aborted)return o(new Ki("Aborted","AbortError"));var c=new XMLHttpRequest;function d(){c.abort()}c.onload=function(){var y={statusText:c.statusText,headers:Ux(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 Yr(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 Ki("Aborted","AbortError"))},0)};function f(y){try{return y===""&&mn.location.href?mn.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 ln||mn.Headers&&n.headers instanceof mn.Headers)){var p=[];Object.getOwnPropertyNames(n.headers).forEach(function(y){p.push(Oo(y)),c.setRequestHeader(y,Dd(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 mn,Rn,w0,_0,x0,k0,Ki,S0,C0,E0,T0,qa,R0,D0,O0,P0,M0,L0,Po,Md,Ld,N0,Qi,Mo,ec,I0,Nd,A0,q0,j0,z0,tc,F0,ja,Id,Ht,nc,B0,H0,V0,$0,W0,U0,K0,Q0,G0,J0,X0,Y0,Z0,eg,tg,ng,rg,ig,ag,og,sg,lg,cg,ug;S0=W2((()=>{mn=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},Rn={searchParams:"URLSearchParams"in mn,iterable:"Symbol"in mn&&"iterator"in Symbol,blob:"FileReader"in mn&&"Blob"in mn&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in mn,arrayBuffer:"ArrayBuffer"in mn},Rn.arrayBuffer&&(w0=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],_0=ArrayBuffer.isView||function(e){return e&&w0.indexOf(Object.prototype.toString.call(e))>-1}),ln.prototype.append=function(e,n){e=Oo(e),n=Dd(n);var i=this.map[e];this.map[e]=i?i+", "+n:n},ln.prototype.delete=function(e){delete this.map[Oo(e)]},ln.prototype.get=function(e){return e=Oo(e),this.has(e)?this.map[e]:null},ln.prototype.has=function(e){return this.map.hasOwnProperty(Oo(e))},ln.prototype.set=function(e,n){this.map[Oo(e)]=Dd(n)},ln.prototype.forEach=function(e,n){for(var i in this.map)this.map.hasOwnProperty(i)&&e.call(n,this.map[i],i,this)},ln.prototype.keys=function(){var e=[];return this.forEach(function(n,i){e.push(i)}),Od(e)},ln.prototype.values=function(){var e=[];return this.forEach(function(n){e.push(n)}),Od(e)},ln.prototype.entries=function(){var e=[];return this.forEach(function(n,i){e.push([i,n])}),Od(e)},Rn.iterable&&(ln.prototype[Symbol.iterator]=ln.prototype.entries),x0=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],Aa.prototype.clone=function(){return new Aa(this,{body:this._bodyInit})},v0.call(Aa.prototype),v0.call(Yr.prototype),Yr.prototype.clone=function(){return new Yr(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new ln(this.headers),url:this.url})},Yr.error=function(){var e=new Yr(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e},k0=[301,302,303,307,308],Yr.redirect=function(e,n){if(k0.indexOf(n)===-1)throw RangeError("Invalid status code");return new Yr(null,{status:n,headers:{location:e}})},Ki=mn.DOMException;try{new Ki}catch{Ki=function(e,n){this.message=e,this.name=n,this.stack=Error(e).stack},Ki.prototype=Object.create(Error.prototype),Ki.prototype.constructor=Ki}b0.polyfill=!0,mn.fetch||(mn.fetch=b0,mn.Headers=ln,mn.Request=Aa,mn.Response=Yr)})),C0=Se(((e,n)=>{S0(),n.exports=self.fetch.bind(self)})),E0=Se((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 L in T)T.hasOwnProperty(L)&&(E[L]=T[L])},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(L){return L instanceof C?L:new C(function(z){z(L)})}return new(C||(C=Promise))(function(L,z){function U(G){try{I(E.next(G))}catch(pe){z(pe)}}function $(G){try{I(E.throw(G))}catch(pe){z(pe)}}function I(G){G.done?L(G.value):T(G.value).then(U,$)}I((E=E.apply(w,_||[])).next())})},o=e&&e.__generator||function(w,_){var C={label:0,sent:function(){if(L[0]&1)throw L[1];return L[1]},trys:[],ops:[]},E,T,L,z;return z={next:U(0),throw:U(1),return:U(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function U(I){return function(G){return $([I,G])}}function $(I){if(E)throw TypeError("Generator is already executing.");for(;C;)try{if(E=1,T&&(L=I[0]&2?T.return:I[0]?T.throw||((L=T.return)&&L.call(T),0):T.next)&&!(L=L.call(T,I[1])).done)return L;switch(T=0,L&&(I=[I[0]&2,L.value]),I[0]){case 0:case 1:L=I;break;case 4:return C.label++,{value:I[1],done:!1};case 5:C.label++,T=I[1],I=[0];continue;case 7:I=C.ops.pop(),C.trys.pop();continue;default:if(L=C.trys,!(L=L.length>0&&L[L.length-1])&&(I[0]===6||I[0]===2)){C=0;continue}if(I[0]===3&&(!L||I[1]>L[0]&&I[1]<L[3])){C.label=I[1];break}if(I[0]===6&&C.label<L[1]){C.label=L[1],L=I;break}if(L&&C.label<L[2]){C.label=L[2],C.ops.push(I);break}L[2]&&C.ops.pop(),C.trys.pop();continue}I=_.call(w,C)}catch(G){I=[6,G],T=0}finally{E=L=0}if(I[0]&5)throw I[1];return{value:I[0]?I[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(C0()),d=Ra(),f=Do(),p=Ro(),y=(function(w){n(_,w);function _(C,E){var T=w.call(this)||this;return T.onlyNotifications=function(L){return L instanceof Array?L.every(function(z){return z.request.request.id===null||z.request.request.id===void 0}):L.request.id===null||L.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,L,z,U,$,I,pe,G,pe;return o(this,function(P){switch(P.label){case 0:T=this.transportRequestManager.addRequest(C,E),L=f.getNotifications(C),z=f.getBatchRequests(C),U=this.injectedFetcher||c.default,P.label=1;case 1:return P.trys.push([1,4,,5]),[4,U(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(C)),credentials:this.credentials})];case 2:return $=P.sent(),this.transportRequestManager.settlePendingRequest(L),this.onlyNotifications(C)?[2,Promise.resolve()]:[4,$.text()];case 3:return I=P.sent(),pe=this.transportRequestManager.resolveResponse(I),pe?(this.transportRequestManager.settlePendingRequest(z,pe),[2,Promise.reject(pe)]):[3,5];case 4:return G=P.sent(),pe=new p.JSONRPCError(G.message,p.ERR_UNKNOWN,G),this.transportRequestManager.settlePendingRequest(L,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})),T0=UR({default:()=>R0},1),D0=W2((()=>{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),R0=qa})),O0=Se((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(L){L(T)})}return new(_||(_=Promise))(function(T,L){function z(I){try{$(C.next(I))}catch(G){L(G)}}function U(I){try{$(C.throw(I))}catch(G){L(G)}}function $(I){I.done?T(I.value):E(I.value).then(z,U)}$((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,L;return L={next:z(0),throw:z(1),return:z(2)},typeof Symbol=="function"&&(L[Symbol.iterator]=function(){return this}),L;function z($){return function(I){return U([$,I])}}function U($){if(C)throw TypeError("Generator is already executing.");for(;_;)try{if(C=1,E&&(T=$[0]&2?E.return:$[0]?E.throw||((T=E.return)&&T.call(E),0):E.next)&&!(T=T.call(E,$[1])).done)return T;switch(E=0,T&&($=[$[0]&2,T.value]),$[0]){case 0:case 1:T=$;break;case 4:return _.label++,{value:$[1],done:!1};case 5:_.label++,E=$[1],$=[0];continue;case 7:$=_.ops.pop(),_.trys.pop();continue;default:if(T=_.trys,!(T=T.length>0&&T[T.length-1])&&($[0]===6||$[0]===2)){_=0;continue}if($[0]===3&&(!T||$[1]>T[0]&&$[1]<T[3])){_.label=$[1];break}if($[0]===6&&_.label<T[1]){_.label=T[1],T=$;break}if(T&&_.label<T[2]){_.label=T[2],_.ops.push($);break}T[2]&&_.ops.pop(),_.trys.pop();continue}$=w.call(y,_)}catch(I){$=[6,I],E=0}finally{C=T=0}if($[0]&5)throw $[1];return{value:$[0]?$[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((D0(),Ru(T0))),d=Ra(),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(L){var z=L.data;_.transportRequestManager.resolveResponse(z)})})},w.prototype.sendData=function(_,C){return C===void 0&&(C=5e3),i(this,void 0,void 0,function(){var E,T,L;return o(this,function(z){E=this.transportRequestManager.addRequest(_,C),T=f.getNotifications(_);try{this.connection.send(JSON.stringify(this.parseData(_))),this.transportRequestManager.settlePendingRequest(T)}catch(U){L=new p.JSONRPCError(U.message,p.ERR_UNKNOWN,U),this.transportRequestManager.settlePendingRequest(T,L),this.transportRequestManager.settlePendingRequest(f.getBatchRequests(_),L),E=Promise.reject(L)}return[2,E]})})},w.prototype.close=function(){this.connection.close()},w})(d.Transport)})),P0=Se((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(U){try{z(w.next(U))}catch($){E($)}}function L(U){try{z(w.throw(U))}catch($){E($)}}function z(U){U.done?C(U.value):_(U.value).then(T,L)}z((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(z){return function(U){return L([z,U])}}function L(z){if(w)throw TypeError("Generator is already executing.");for(;y;)try{if(w=1,_&&(C=z[0]&2?_.return:z[0]?_.throw||((C=_.return)&&C.call(_),0):_.next)&&!(C=C.call(_,z[1])).done)return C;switch(_=0,C&&(z=[z[0]&2,C.value]),z[0]){case 0:case 1:C=z;break;case 4:return y.label++,{value:z[1],done:!1};case 5:y.label++,_=z[1],z=[0];continue;case 7:z=y.ops.pop(),y.trys.pop();continue;default:if(C=y.trys,!(C=C.length>0&&C[C.length-1])&&(z[0]===6||z[0]===2)){y=0;continue}if(z[0]===3&&(!C||z[1]>C[0]&&z[1]<C[3])){y.label=z[1];break}if(z[0]===6&&y.label<C[1]){y.label=C[1],C=z;break}if(C&&y.label<C[2]){y.label=C[2],y.ops.push(z);break}C[2]&&y.ops.pop(),y.trys.pop();continue}z=p.call(f,y)}catch(U){z=[6,U],_=0}finally{w=C=0}if(z[0]&5)throw z[1];return{value:z[0]?z[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=Ra(),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)})),M0=Se((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(z){try{L(y.next(z))}catch(U){C(U)}}function T(z){try{L(y.throw(z))}catch(U){C(U)}}function L(z){z.done?_(z.value):w(z.value).then(E,T)}L((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(L){return function(z){return T([L,z])}}function T(L){if(y)throw TypeError("Generator is already executing.");for(;p;)try{if(y=1,w&&(_=L[0]&2?w.return:L[0]?w.throw||((_=w.return)&&_.call(w),0):w.next)&&!(_=_.call(w,L[1])).done)return _;switch(w=0,_&&(L=[L[0]&2,_.value]),L[0]){case 0:case 1:_=L;break;case 4:return p.label++,{value:L[1],done:!1};case 5:p.label++,w=L[1],L=[0];continue;case 7:L=p.ops.pop(),p.trys.pop();continue;default:if(_=p.trys,!(_=_.length>0&&_[_.length-1])&&(L[0]===6||L[0]===2)){p=0;continue}if(L[0]===3&&(!_||L[1]>_[0]&&L[1]<_[3])){p.label=L[1];break}if(L[0]===6&&p.label<_[1]){p.label=_[1],_=L;break}if(_&&p.label<_[2]){p.label=_[2],p.ops.push(L);break}_[2]&&p.ops.pop(),p.trys.pop();continue}L=f.call(d,p)}catch(z){L=[6,z],w=0}finally{y=_=0}if(L[0]&5)throw L[1];return{value:L[0]?L[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=Ra(),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)})),L0=Se((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})()})),Ql=Se((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(p0()).default,e.EventEmitterTransport=n(m0()).default,e.HTTPTransport=n(E0()).default,e.WebSocketTransport=n(O0()).default,e.PostMessageWindowTransport=n(P0()).default,e.PostMessageIframeTransport=n(M0()).default;var i=Ro();Object.defineProperty(e,"JSONRPCError",{enumerable:!0,get:function(){return i.JSONRPCError}});var o=n(L0());e.Client=o.default,e.default=o.default})),Po=Se((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})),Md=Se((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 cx extends Error{constructor(f,p,y){super(p),this.code=n.number(f)?f:i.UnknownErrorCode,this.data=y,Object.setPrototypeOf(this,cx.prototype)}toJson(){let f={code:this.code,message:this.message};return this.data!==void 0&&(f.data=this.data),f}};var o=class hd{constructor(f){this.kind=f}static is(f){return f===hd.auto||f===hd.byName||f===hd.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={}))})),Ld=Se((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))}}})),N0=Se((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={}))})),Qi=Se((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=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var n=Qi(),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 ux{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=ux._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(){}})),ec=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var n=Qi(),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}}})),I0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var n=ec(),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)}}})),Nd=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var n=Qi();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()}}}})),A0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var n=Qi(),i=Po(),o=Mo(),s=Nd(),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,L=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 z of w.contentDecoders)E.set(z.name,z);if(w.contentTypeDecoder!==void 0&&(T=w.contentTypeDecoder,L.set(T.name,T)),w.contentTypeDecoders!==void 0)for(let z of w.contentTypeDecoders)L.set(z.name,z)}return T===void 0&&(T=(0,n.default)().applicationJson.decoder,L.set(T.name,T)),{charset:_,contentDecoder:C,contentDecoders:E,contentTypeDecoder:T,contentTypeDecoders:L}}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))}}})),q0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var n=Qi(),i=Po(),o=Nd(),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()}}})),j0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0;var n=13,i=10,o=`\r
12
+ `)}`},F_=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=>kx(i[o])).join(" | ")} |`)].join(`
13
+ `)};function kx(e){if(e==null)return"";if(Array.isArray(e)||typeof e=="object")return zm(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 zm(n)}function zm(e){return e.replaceAll("\\","\\\\").replaceAll("|","\\|").replaceAll(`
14
+ `," ").replaceAll("\r","")}function gd(e){return typeof e=="object"&&e&&"$bigint"in e&&typeof e.$bigint=="string"?BigInt(e.$bigint):e}var Fm="abcdefghijklmnopqrstuvwxyz",Bm=Fm+Fm.toUpperCase(),Hm=new Set;Rs="__scratch__",gr="setup",Pa={create(){let e=0,n;do{let i="";for(let o=0;o<4;o++)i+=Bm[Math.floor(Math.random()*Bm.length)];n=i,e++}while(Hm.has(n)&&e<100);if(e>=100)throw Error("Failed to generate unique CellId after 100 attempts");return Hm.add(n),n}},Zn={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=Zn.findElement(n);if(i)return i;let o=n.getRootNode();if(n=o instanceof ShadowRoot?o.host:n.parentElement,n===o)break}return null}},D_=function(e){let n=null,i=Zn.findElementThroughShadowDOMs(e);return i&&(n=Zn.parse(i.id)),n},sd={parse(e){return e.getAttribute("object-id")},parseOrThrow(e){let n=sd.parse(e);return In(n,"<marimo-ui-element/> missing object-id attribute"),n}},Rw={create(e){return`output-${e}`}},cm=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)}},Bu=function(e){return dm(e??"")},s_=function(e){return ci.mapValues(e.dataset,n=>typeof n=="string"?Bu(n):n)},a_=function(e,n){let i=e.parentElement?sd.parse(e.parentElement):void 0;return i&&n.has(i)?n.lookupValue(i):Bu(e.dataset.initialValue)},Jl=function(){if(h4())return document.title||null;if(bh()){let i=cm.getFilename();if(i)return i}let e=document.querySelector("marimo-filename");fm(e,"marimo-filename tag not found");let n=e.innerHTML;return n.length===0?null:n};var Sx=Symbol("");jw=function(e,n){return Be(e,function(i,o,s){o(this,n(i(this),s))})};function yd(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 vd=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),Cx=new WeakMap,Ex=(e,n,i,o)=>vd(e,vd(()=>new WeakMap,vd(()=>new WeakMap,Cx,n),i),o);function Tx(e,n,i=Object.is){return Ex(()=>{let o=Symbol(),s=([d,f])=>{if(f===o)return n(d);let p=n(d,f);return i(f,p)?f:p},c=Be(d=>{let f=d(c);return s([d(e),f])});return c.init=o,c},e,n,i)}var Vm=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),Rx=new WeakMap,Dx=(e,n,i)=>Vm(e,Vm(()=>new WeakMap,Rx,n),i),Ox={},$m=e=>!!e.write,Px=e=>typeof e=="function";function Mx(e,n){return Dx(()=>{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 L=y&&y.atomList[y.keyList.indexOf(T)];if(L){w[E]=L;return}let z=U=>{let $=U(s),I=U(e),G=o(I,$==null?void 0:$.arr).keyList.indexOf(T);if(G<0||G>=I.length){let pe=d[o(d).keyList.indexOf(T)];if(pe)return pe;throw Error("splitAtom: index out of bounds for read")}return I[G]};w[E]=$m(e)?Be(z,(U,$,I)=>{let G=U(s),pe=U(e),P=o(pe,G==null?void 0:G.arr).keyList.indexOf(T);if(P<0||P>=pe.length)throw Error("splitAtom: index out of bounds for write");let A=Px(I)?I(pe[P]):I;Object.is(pe[P],A)||$(e,[...pe.slice(0,P),A,...pe.slice(P+1)])}):Be(z)}),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=Be(d=>{let f=d(s);return o(d(e),f==null?void 0:f.arr)});s.init=void 0;let c=$m(e)?Be(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}}}):Be(d=>d(s).atomList);return c},e,n||Ox)}var Wm=e=>typeof(e==null?void 0:e.then)=="function";function Um(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 Wm(_)?_.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 Lx=Um();Fl=function(e,n,i=Lx,o){let s=Be(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},Be(c=>c(s),(c,d,f)=>{let p=typeof f=="function"?f(c(s)):f;return p===Sx?(d(s,n),i.removeItem(e)):Wm(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=Km(d.value,n,i,o);else if(d.get!=null)d.get=Km(d.get,n,i,o);else throw"Only put a Memoize() decorator on a method or get accessor."}};var bd=new Map;function Km(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)bd.has(p)?bd.get(p).push(f):bd.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=Be(Jl()),Bw=Be(void 0);var Nx=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 Ix(){let{hasLocalStorage:e,hasSessionStorage:n}=Z4();return e?window.localStorage:n?window.sessionStorage:new Nx}Ts=Ix();let Ui;lx=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)}},ju=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:(Re.warn("Error parsing zod local storage",i.error),this.getDefaultValue())}catch(n){return Re.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)}},Zh=class extends ju{constructor(e,n,i){let o=st.get(Es);super(n,i),this.filename=o;try{this.unsubscribeFromFilename=st.sub(Es,()=>{let s=st.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))}},Ui="marimo:notebook-col-sizes";function Ax(){return{widths:[]}}var Eo=new Zh(Ui,J2({widths:e4(XR([YR(),ZR("contentWidth")]).default("contentWidth"))}),Ax);$w={getColumnWidth:e=>Eo.get(Ui).widths[e]??"contentWidth",saveColumnWidth:(e,n)=>{let i=Eo.get(Ui).widths;if(i[e])i[e]=n;else{for(;i.length<=e;)i.push("contentWidth");i[e]=n}Eo.set(Ui,{widths:i})},clearStorage:()=>{Eo.remove(Ui)}};function qx(e,n){let i=Eo.get(Ui).widths,o=Ll(i,e,n);Eo.set(Ui,{widths:o})}var Qm,Gm,Jm,Nr,Xm,Ym,Zm,e0,Wn,t0,n0,r0,i0,a0,o0,Zt;function er(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=(Qm=$n(),Gm=$n(),Jm=$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}},er(Nr.prototype,"geDescendantCount",[Qm],Object.getOwnPropertyDescriptor(Nr.prototype,"geDescendantCount"),Nr.prototype),er(Nr.prototype,"getDescendants",[Gm],Object.getOwnPropertyDescriptor(Nr.prototype,"getDescendants"),Nr.prototype),er(Nr.prototype,"inOrderIds",[Jm],Object.getOwnPropertyDescriptor(Nr.prototype,"inOrderIds"),Nr.prototype),Nr);var jx=0;let To;To=(Xm=$n(),Ym=$n(),Zm=$n(),e0=$n(),Wn=class Co{constructor(n,i){this.nodes=n,this.id=i}static from(n){let i=`tree_${jx++}`;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():(Re.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),[])}isCollapsed(n){let i=this._nodeMap.get(n);return i?i.isCollapsed:(Re.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(Ll(this.nodes,i,0))}moveToBack(n){let i=this.indexOfOrThrow(n);return this.withNodes(Ll(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=yw(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=yw(n,i+1,o.children)),i++}return this.withNodes(n)}move(n,i){return this.withNodes(Ll(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(gw(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(Y4(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}},er(Wn.prototype,"topLevelIds",[Xm],Object.getOwnPropertyDescriptor(Wn.prototype,"topLevelIds"),Wn.prototype),er(Wn.prototype,"inOrderIds",[Ym],Object.getOwnPropertyDescriptor(Wn.prototype,"inOrderIds"),Wn.prototype),er(Wn.prototype,"idSet",[Zm],Object.getOwnPropertyDescriptor(Wn.prototype,"idSet"),Wn.prototype),er(Wn.prototype,"_nodeMap",[e0],Object.getOwnPropertyDescriptor(Wn.prototype,"_nodeMap"),Wn.prototype),Wn),zl=(t0=$n(),n0=$n(),r0=$n(),i0=$n(),a0=$n(),o0=$n(),Zt=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(gw(_.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 qx(o,s),new An(Ll([...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 Re.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(gr))}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 Re.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}},er(Zt.prototype,"isEmpty",[t0],Object.getOwnPropertyDescriptor(Zt.prototype,"isEmpty"),Zt.prototype),er(Zt.prototype,"topLevelIds",[n0],Object.getOwnPropertyDescriptor(Zt.prototype,"topLevelIds"),Zt.prototype),er(Zt.prototype,"inOrderIds",[r0],Object.getOwnPropertyDescriptor(Zt.prototype,"inOrderIds"),Zt.prototype),er(Zt.prototype,"idLength",[i0],Object.getOwnPropertyDescriptor(Zt.prototype,"idLength"),Zt.prototype),er(Zt.prototype,"_columnMap",[a0],Object.getOwnPropertyDescriptor(Zt.prototype,"_columnMap"),Zt.prototype),er(Zt.prototype,"getColumnIds",[o0],Object.getOwnPropertyDescriptor(Zt.prototype,"getColumnIds"),Zt.prototype),Zt);let wd,_d,xd,s0,kd,l0,c0,u0,d0,Sd,Cd,f0,Ed,Td;wd=Se((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})),_d=Se((e=>{var n=e&&e.__extends||(function(){var P=function(A,V){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(de,fe){de.__proto__=fe}||function(de,fe){for(var be in fe)Object.prototype.hasOwnProperty.call(fe,be)&&(de[be]=fe[be])},P(A,V)};return function(A,V){if(typeof V!="function"&&V!==null)throw TypeError("Class extends value "+String(V)+" is not a constructor or null");P(A,V);function de(){this.constructor=A}A.prototype=V===null?Object.create(V):(de.prototype=V.prototype,new de)}})(),i=e&&e.__assign||function(){return i=Object.assign||function(P){for(var A,V=1,de=arguments.length;V<de;V++)for(var fe in A=arguments[V],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=wd(),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),G(this,A)},P})();e.Node=s;var c=(function(P){n(A,P);function A(V){var de=P.call(this)||this;return de.data=V,de}return Object.defineProperty(A.prototype,"nodeValue",{get:function(){return this.data},set:function(V){this.data=V},enumerable:!1,configurable:!0}),A})(s);e.DataNode=c;var d=(function(P){n(A,P);function A(){var V=P!==null&&P.apply(this,arguments)||this;return V.type=o.ElementType.Text,V}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 V=P!==null&&P.apply(this,arguments)||this;return V.type=o.ElementType.Comment,V}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(V,de){var fe=P.call(this,de)||this;return fe.name=V,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(V){var de=P.call(this)||this;return de.children=V,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(V){this.children=V},enumerable:!1,configurable:!0}),A})(s);e.NodeWithChildren=y;var w=(function(P){n(A,P);function A(){var V=P!==null&&P.apply(this,arguments)||this;return V.type=o.ElementType.CDATA,V}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 V=P!==null&&P.apply(this,arguments)||this;return V.type=o.ElementType.Root,V}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(V,de,fe,be){fe===void 0&&(fe=[]),be===void 0&&(be=V==="script"?o.ElementType.Script:V==="style"?o.ElementType.Style:o.ElementType.Tag);var J=P.call(this,fe)||this;return J.name=V,J.attribs=de,J.type=be,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(V){this.name=V},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"attributes",{get:function(){var V=this;return Object.keys(this.attribs).map(function(de){var fe,be;return{name:de,value:V.attribs[de],namespace:(fe=V["x-attribsNamespace"])==null?void 0:fe[de],prefix:(be=V["x-attribsPrefix"])==null?void 0:be[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 L(P){return P.type===o.ElementType.Text}e.isText=L;function z(P){return P.type===o.ElementType.Comment}e.isComment=z;function U(P){return P.type===o.ElementType.Directive}e.isDirective=U;function $(P){return P.type===o.ElementType.Root}e.isDocument=$;function I(P){return Object.prototype.hasOwnProperty.call(P,"children")}e.hasChildren=I;function G(P,A){A===void 0&&(A=!1);var V;if(L(P))V=new d(P.data);else if(z(P))V=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(Ee){return Ee.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"])),V=fe}else if(T(P)){var de=A?pe(P.children):[],be=new w(de);de.forEach(function(ne){return ne.parent=be}),V=be}else if($(P)){var de=A?pe(P.children):[],J=new _(de);de.forEach(function(ne){return ne.parent=J}),P["x-mode"]&&(J["x-mode"]=P["x-mode"]),V=J}else if(U(P)){var we=new p(P.name,P.data);P["x-name"]!=null&&(we["x-name"]=P["x-name"],we["x-publicId"]=P["x-publicId"],we["x-systemId"]=P["x-systemId"]),V=we}else throw Error(`Not implemented yet: ${P.type}`);return V.startIndex=P.startIndex,V.endIndex=P.endIndex,P.sourceCodeLocation!=null&&(V.sourceCodeLocation=P.sourceCodeLocation),V}e.cloneNode=G;function pe(P){for(var A=P.map(function(de){return G(de,!0)}),V=1;V<A.length;V++)A[V].prev=A[V-1],A[V-1].next=A[V];return A}})),xd=Se((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=wd(),s=_d();i(_d(),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})),s0=Se((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")})),kd=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=s,e.escapeSpecialCharacters=d,e.revertEscapedCharacters=f,e.formatDOM=p;var n=xd(),i=s0();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,L=y.length;T<L;T++){var z=y[T];switch(z.nodeType){case 1:var U=c(z.nodeName);E=new n.Element(U,s(z.attributes)),E.children=p(U==="template"?z.content.childNodes:z.childNodes,E);break;case 3:E=new n.Text(f(z.nodeValue));break;case 8:E=new n.Comment(z.nodeValue);break;default:continue}var $=C[T-1]||null;$&&($.next=E),E.parent=w,E.prev=$,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}})),l0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=z;var n=kd(),i="html",o="head",s="body",c=/<([a-zA-Z]+[0-9]?)/,d=/<head[^]*>/i,f=/<body[^]*>/i,p=function(U,$){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},y=function(U,$){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(U,$){return $&&(U=`<${$}>${U}</${$}>`),_.parseFromString(U,C)},p=y}if(typeof document=="object"&&document.implementation){var E=document.implementation.createHTMLDocument();p=function(U,$){if($){var I=E.documentElement.querySelector($);return I&&(I.innerHTML=U),E}return E.documentElement.innerHTML=U,E}}var T=typeof document=="object"&&document.createElement("template"),L;T&&T.content&&(L=function(U){return T.innerHTML=U,T.content.childNodes});function z(U){var $,I;U=(0,n.escapeSpecialCharacters)(U);var G=U.match(c),pe=G&&G[1]?G[1].toLowerCase():"";switch(pe){case i:var P=y(U);if(!d.test(U)){var V=P.querySelector(o);($=V==null?void 0:V.parentNode)==null||$.removeChild(V)}if(!f.test(U)){var V=P.querySelector(s);(I=V==null?void 0:V.parentNode)==null||I.removeChild(V)}return P.querySelectorAll(i);case o:case s:var A=p(U).querySelectorAll(pe);return f.test(U)&&d.test(U)?A[0].parentNode.childNodes:A;default:if(L)return L(U);var V=p(U,s).querySelector(s);return V.childNodes}}})),c0=Se((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(l0()),o=kd(),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)}})),u0=Se((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}})),d0=Se((e=>{var n=0,i=1,o=2,s=3,c=4,d=5,f=6;function p(I){return w.hasOwnProperty(I)?w[I]:null}function y(I,G,pe,P,A,V,de){this.acceptsBooleans=G===o||G===s||G===c,this.attributeName=P,this.attributeNamespace=A,this.mustUseProperty=pe,this.propertyName=I,this.type=G,this.sanitizeURL=V,this.removeEmptyString=de}var w={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(I=>{w[I]=new y(I,n,!1,I,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([I,G])=>{w[I]=new y(I,i,!1,G,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(I=>{w[I]=new y(I,o,!1,I.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(I=>{w[I]=new y(I,o,!1,I,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(I=>{w[I]=new y(I,s,!1,I.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(I=>{w[I]=new y(I,s,!0,I,null,!1,!1)}),["capture","download"].forEach(I=>{w[I]=new y(I,c,!1,I,null,!1,!1)}),["cols","rows","size","span"].forEach(I=>{w[I]=new y(I,f,!1,I,null,!1,!1)}),["rowSpan","start"].forEach(I=>{w[I]=new y(I,d,!1,I.toLowerCase(),null,!1,!1)});var _=/[\-\:]([a-z])/g,C=I=>I[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(I=>{let G=I.replace(_,C);w[G]=new y(G,i,!1,I,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(I=>{let G=I.replace(_,C);w[G]=new y(G,i,!1,I,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(I=>{let G=I.replace(_,C);w[G]=new y(G,i,!1,I,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(I=>{w[I]=new y(I,i,!1,I.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(I=>{w[I]=new y(I,i,!1,I.toLowerCase(),null,!0,!0)});var{CAMELCASE:T,SAME:L,possibleStandardNames:z}=u0(),U=RegExp.prototype.test.bind(RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),$=Object.keys(z).reduce((I,G)=>{let pe=z[G];return pe===L?I[G]=G:pe===T?I[G.toLowerCase()]=G:I[G]=pe,I},{});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=U,e.possibleStandardNames=$})),Sd=Se((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=Du(),o=n(eD()),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}})),Cd=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var n=d0(),i=Sd(),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(),L=f(T);if(L){var z=(0,n.getPropertyInfo)(L);switch(o.includes(L)&&s.includes(y)&&!_&&(L=f("default"+T)),w[L]=E,z&&z.type){case n.BOOLEAN:w[L]=!0;break;case n.OVERLOADED_BOOLEAN:E===""&&(w[L]=!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]}})),f0=Se((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=Du(),o=n(Cd()),s=Sd(),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,L=E.createElement,z=E.isValidElement,U=p.length,$=0;$<U;$++){var I=p[$];if(_){var G=y.replace(I,$);if(z(G)){U>1&&(G=T(G,{key:G.key||$})),w.push(C(G,I,$));continue}}if(I.type==="text"){var pe=!I.data.trim().length;if(pe&&I.parent&&!(0,s.canTextBeChildOfNode)(I.parent)||y.trim&&pe)continue;w.push(C(I.data,I,$));continue}var P=I,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 V=void 0;switch(I.type){case"script":case"style":I.children[0]&&(A.dangerouslySetInnerHTML={__html:I.children[0].data});break;case"tag":I.name==="textarea"&&I.children[0]?A.defaultValue=I.children[0].data:I.children&&I.children.length&&(V=d(I.children,y));break;default:continue}U>1&&(A.key=$),w.push(C(L(I.name,A,V),I,$))}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)}})),Ed=Se((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(c0());e.htmlToDOM=i.default,e.attributesToProps=n(Cd()).default;var o=n(f0());e.domToReact=o.default;var s=xd();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):[]}})),Td=yh(Ed(),1),Oa=Ed(),Jh=Td.default.default||Td.default;let Zl;Zl=(e,n)=>{let[i,...o]=n.split("."),s=(e.attribs.class||"").split(" ");return e.tagName===i&&o.every(c=>s.includes(c))},L_=e=>{var n;return e&&Zl(e,"span.nb")&&e.firstChild instanceof Oa.Text&&((n=e.firstChild.nodeValue)==null?void 0:n.includes("__marimo__"))},Kh=function(e){var n,i,o;if(e instanceof Oa.Element&&e.firstChild instanceof Oa.Text&&Zl(e,"span.nb")){let s=e.next;if(s&&s instanceof Oa.Text){let c=s.next;if(c&&c instanceof Oa.Element&&c.firstChild instanceof Oa.Text&&Zl(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},$h=function(e){let n=[];return Jh(e,{replace:i=>{let o=Kh(i);if(o)return n.push(o),"dummy"}}),n};function p0(e){return n=>{let i=!1;for(let o of n)o&&(i=e(o)||i);return i}}const zx=p0(S4),Fx=p0(C4);let Rd,h0,Ro,m0,Do,g0;Rd=Se(((e,n)=>{var i=typeof Reflect=="object"?Reflect:null,o=i&&typeof i.apply=="function"?i.apply:function(P,A,V){return Function.prototype.apply.call(P,A,V)},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=I,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=[],V=1;V<arguments.length;V++)A.push(arguments[V]);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 be;if(A.length>0&&(be=A[0]),be instanceof Error)throw be;var J=Error("Unhandled error."+(be?" ("+be.message+")":""));throw J.context=be,J}var we=fe[P];if(we===void 0)return!1;if(typeof we=="function")o(we,this,A);else for(var Ee=we.length,ne=z(we,Ee),V=0;V<Ee;++V)o(ne[V],this,A);return!0};function _(P,A,V,de){var fe,be,J;if(y(V),be=P._events,be===void 0?(be=P._events=Object.create(null),P._eventsCount=0):(be.newListener!==void 0&&(P.emit("newListener",A,V.listener?V.listener:V),be=P._events),J=be[A]),J===void 0)J=be[A]=V,++P._eventsCount;else if(typeof J=="function"?J=be[A]=de?[V,J]:[J,V]:de?J.unshift(V):J.push(V),fe=w(P),fe>0&&J.length>fe&&!J.warned){J.warned=!0;var we=Error("Possible EventEmitter memory leak detected. "+J.length+" "+String(A)+" listeners added. Use emitter.setMaxListeners() to increase limit");we.name="MaxListenersExceededWarning",we.emitter=P,we.type=A,we.count=J.length,c(we)}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,V){var de={fired:!1,wrapFn:void 0,target:P,type:A,listener:V},fe=C.bind(de);return fe.listener=V,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 V,de,fe,be,J;if(y(A),de=this._events,de===void 0||(V=de[P],V===void 0))return this;if(V===A||V.listener===A)--this._eventsCount===0?this._events=Object.create(null):(delete de[P],de.removeListener&&this.emit("removeListener",P,V.listener||A));else if(typeof V!="function"){for(fe=-1,be=V.length-1;be>=0;be--)if(V[be]===A||V[be].listener===A){J=V[be].listener,fe=be;break}if(fe<0)return this;fe===0?V.shift():U(V,fe),V.length===1&&(de[P]=V[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,V=this._events,de;if(V===void 0)return this;if(V.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):V[P]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete V[P]),this;if(arguments.length===0){var fe=Object.keys(V),be;for(de=0;de<fe.length;++de)be=fe[de],be!=="removeListener"&&this.removeAllListeners(be);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(A=V[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,V){var de=P._events;if(de===void 0)return[];var fe=de[A];return fe===void 0?[]:typeof fe=="function"?V?[fe.listener||fe]:[fe]:V?$(fe):z(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):L.call(P,A)},f.prototype.listenerCount=L;function L(P){var A=this._events;if(A!==void 0){var V=A[P];if(typeof V=="function")return 1;if(V!==void 0)return V.length}return 0}f.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function z(P,A){for(var V=Array(A),de=0;de<A;++de)V[de]=P[de];return V}function U(P,A){for(;A+1<P.length;A++)P[A]=P[A+1];P.pop()}function $(P){for(var A=Array(P.length),V=0;V<A.length;++V)A[V]=P[V].listener||P[V];return A}function I(P,A){return new Promise(function(V,de){function fe(J){P.removeListener(A,be),de(J)}function be(){typeof P.removeListener=="function"&&P.removeListener("error",fe),V([].slice.call(arguments))}pe(P,A,be,{once:!0}),A!=="error"&&G(P,fe,{once:!0})})}function G(P,A,V){typeof P.on=="function"&&pe(P,"error",A,V)}function pe(P,A,V,de){if(typeof P.on=="function")de.once?P.once(A,V):P.on(A,V);else if(typeof P.addEventListener=="function")P.addEventListener(A,function fe(be){de.once&&P.removeEventListener(A,fe),V(be)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof P)}})),h0=Se((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(L){w(L)}}function C(T){try{E(f.throw(T))}catch(L){w(L)}}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=Rd();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,L){C.batch.push({resolve:T,reject:L,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=Se((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)}})),m0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TransportRequestManager=void 0;var n=Rd(),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})()})),Ra=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Transport=void 0;var n=m0();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=Se((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]:[]}})),g0=Se((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=Ra(),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 Bx(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 Dd(e){return typeof e!="string"&&(e=String(e)),e}function Od(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 ln(e){this.map={},e instanceof ln?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 Pd(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function y0(e){return new Promise(function(n,i){e.onload=function(){n(e.result)},e.onerror=function(){i(e.error)}})}function Hx(e){var n=new FileReader,i=y0(n);return n.readAsArrayBuffer(e),i}function Vx(e){var n=new FileReader,i=y0(n),o=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=o?o[1]:"utf-8";return n.readAsText(e,s),i}function $x(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 v0(e){if(e.slice)return e.slice(0);var n=new Uint8Array(e.byteLength);return n.set(new Uint8Array(e)),n.buffer}function b0(){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&&Bx(e)?(this._bodyArrayBuffer=v0(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Rn.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||x0(e))?this._bodyArrayBuffer=v0(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=Pd(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 Pd(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(Hx);throw Error("could not read as ArrayBuffer")},this.text=function(){var e=Pd(this);if(e)return e;if(this._bodyBlob)return Vx(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve($x(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(Ux)}),this.json=function(){return this.text().then(JSON.parse)},this}function Wx(e){var n=e.toUpperCase();return k0.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 ln(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 ln(n.headers)),this.method=Wx(n.method||this.method||"GET"),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal||(function(){if("AbortController"in mn)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 Ux(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 Kx(e){var n=new ln;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 Yr(e,n){if(!(this instanceof Yr))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 ln(n.headers),this.url=n.url||"",this._initBody(e)}function w0(e,n){return new Promise(function(i,o){var s=new Aa(e,n);if(s.signal&&s.signal.aborted)return o(new Ki("Aborted","AbortError"));var c=new XMLHttpRequest;function d(){c.abort()}c.onload=function(){var y={statusText:c.statusText,headers:Kx(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 Yr(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 Ki("Aborted","AbortError"))},0)};function f(y){try{return y===""&&mn.location.href?mn.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 ln||mn.Headers&&n.headers instanceof mn.Headers)){var p=[];Object.getOwnPropertyNames(n.headers).forEach(function(y){p.push(Oo(y)),c.setRequestHeader(y,Dd(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 mn,Rn,_0,x0,k0,S0,Ki,C0,E0,T0,R0,qa,D0,O0,P0,M0,L0,N0,Po,Md,Ld,I0,Qi,Mo,ec,A0,Nd,q0,j0,z0,F0,tc,B0,ja,Id,Ht,nc,H0,V0,$0,W0,U0,K0,Q0,G0,J0,X0,Y0,Z0,eg,tg,ng,rg,ig,ag,og,sg,lg,cg,ug,dg;C0=K2((()=>{mn=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},Rn={searchParams:"URLSearchParams"in mn,iterable:"Symbol"in mn&&"iterator"in Symbol,blob:"FileReader"in mn&&"Blob"in mn&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in mn,arrayBuffer:"ArrayBuffer"in mn},Rn.arrayBuffer&&(_0=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],x0=ArrayBuffer.isView||function(e){return e&&_0.indexOf(Object.prototype.toString.call(e))>-1}),ln.prototype.append=function(e,n){e=Oo(e),n=Dd(n);var i=this.map[e];this.map[e]=i?i+", "+n:n},ln.prototype.delete=function(e){delete this.map[Oo(e)]},ln.prototype.get=function(e){return e=Oo(e),this.has(e)?this.map[e]:null},ln.prototype.has=function(e){return this.map.hasOwnProperty(Oo(e))},ln.prototype.set=function(e,n){this.map[Oo(e)]=Dd(n)},ln.prototype.forEach=function(e,n){for(var i in this.map)this.map.hasOwnProperty(i)&&e.call(n,this.map[i],i,this)},ln.prototype.keys=function(){var e=[];return this.forEach(function(n,i){e.push(i)}),Od(e)},ln.prototype.values=function(){var e=[];return this.forEach(function(n){e.push(n)}),Od(e)},ln.prototype.entries=function(){var e=[];return this.forEach(function(n,i){e.push([i,n])}),Od(e)},Rn.iterable&&(ln.prototype[Symbol.iterator]=ln.prototype.entries),k0=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],Aa.prototype.clone=function(){return new Aa(this,{body:this._bodyInit})},b0.call(Aa.prototype),b0.call(Yr.prototype),Yr.prototype.clone=function(){return new Yr(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new ln(this.headers),url:this.url})},Yr.error=function(){var e=new Yr(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e},S0=[301,302,303,307,308],Yr.redirect=function(e,n){if(S0.indexOf(n)===-1)throw RangeError("Invalid status code");return new Yr(null,{status:n,headers:{location:e}})},Ki=mn.DOMException;try{new Ki}catch{Ki=function(e,n){this.message=e,this.name=n,this.stack=Error(e).stack},Ki.prototype=Object.create(Error.prototype),Ki.prototype.constructor=Ki}w0.polyfill=!0,mn.fetch||(mn.fetch=w0,mn.Headers=ln,mn.Request=Aa,mn.Response=Yr)})),E0=Se(((e,n)=>{C0(),n.exports=self.fetch.bind(self)})),T0=Se((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 L in T)T.hasOwnProperty(L)&&(E[L]=T[L])},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(L){return L instanceof C?L:new C(function(z){z(L)})}return new(C||(C=Promise))(function(L,z){function U(G){try{I(E.next(G))}catch(pe){z(pe)}}function $(G){try{I(E.throw(G))}catch(pe){z(pe)}}function I(G){G.done?L(G.value):T(G.value).then(U,$)}I((E=E.apply(w,_||[])).next())})},o=e&&e.__generator||function(w,_){var C={label:0,sent:function(){if(L[0]&1)throw L[1];return L[1]},trys:[],ops:[]},E,T,L,z;return z={next:U(0),throw:U(1),return:U(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function U(I){return function(G){return $([I,G])}}function $(I){if(E)throw TypeError("Generator is already executing.");for(;C;)try{if(E=1,T&&(L=I[0]&2?T.return:I[0]?T.throw||((L=T.return)&&L.call(T),0):T.next)&&!(L=L.call(T,I[1])).done)return L;switch(T=0,L&&(I=[I[0]&2,L.value]),I[0]){case 0:case 1:L=I;break;case 4:return C.label++,{value:I[1],done:!1};case 5:C.label++,T=I[1],I=[0];continue;case 7:I=C.ops.pop(),C.trys.pop();continue;default:if(L=C.trys,!(L=L.length>0&&L[L.length-1])&&(I[0]===6||I[0]===2)){C=0;continue}if(I[0]===3&&(!L||I[1]>L[0]&&I[1]<L[3])){C.label=I[1];break}if(I[0]===6&&C.label<L[1]){C.label=L[1],L=I;break}if(L&&C.label<L[2]){C.label=L[2],C.ops.push(I);break}L[2]&&C.ops.pop(),C.trys.pop();continue}I=_.call(w,C)}catch(G){I=[6,G],T=0}finally{E=L=0}if(I[0]&5)throw I[1];return{value:I[0]?I[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(E0()),d=Ra(),f=Do(),p=Ro(),y=(function(w){n(_,w);function _(C,E){var T=w.call(this)||this;return T.onlyNotifications=function(L){return L instanceof Array?L.every(function(z){return z.request.request.id===null||z.request.request.id===void 0}):L.request.id===null||L.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,L,z,U,$,I,pe,G,pe;return o(this,function(P){switch(P.label){case 0:T=this.transportRequestManager.addRequest(C,E),L=f.getNotifications(C),z=f.getBatchRequests(C),U=this.injectedFetcher||c.default,P.label=1;case 1:return P.trys.push([1,4,,5]),[4,U(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(C)),credentials:this.credentials})];case 2:return $=P.sent(),this.transportRequestManager.settlePendingRequest(L),this.onlyNotifications(C)?[2,Promise.resolve()]:[4,$.text()];case 3:return I=P.sent(),pe=this.transportRequestManager.resolveResponse(I),pe?(this.transportRequestManager.settlePendingRequest(z,pe),[2,Promise.reject(pe)]):[3,5];case 4:return G=P.sent(),pe=new p.JSONRPCError(G.message,p.ERR_UNKNOWN,G),this.transportRequestManager.settlePendingRequest(L,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})),R0=KR({default:()=>D0},1),O0=K2((()=>{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),D0=qa})),P0=Se((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(L){L(T)})}return new(_||(_=Promise))(function(T,L){function z(I){try{$(C.next(I))}catch(G){L(G)}}function U(I){try{$(C.throw(I))}catch(G){L(G)}}function $(I){I.done?T(I.value):E(I.value).then(z,U)}$((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,L;return L={next:z(0),throw:z(1),return:z(2)},typeof Symbol=="function"&&(L[Symbol.iterator]=function(){return this}),L;function z($){return function(I){return U([$,I])}}function U($){if(C)throw TypeError("Generator is already executing.");for(;_;)try{if(C=1,E&&(T=$[0]&2?E.return:$[0]?E.throw||((T=E.return)&&T.call(E),0):E.next)&&!(T=T.call(E,$[1])).done)return T;switch(E=0,T&&($=[$[0]&2,T.value]),$[0]){case 0:case 1:T=$;break;case 4:return _.label++,{value:$[1],done:!1};case 5:_.label++,E=$[1],$=[0];continue;case 7:$=_.ops.pop(),_.trys.pop();continue;default:if(T=_.trys,!(T=T.length>0&&T[T.length-1])&&($[0]===6||$[0]===2)){_=0;continue}if($[0]===3&&(!T||$[1]>T[0]&&$[1]<T[3])){_.label=$[1];break}if($[0]===6&&_.label<T[1]){_.label=T[1],T=$;break}if(T&&_.label<T[2]){_.label=T[2],_.ops.push($);break}T[2]&&_.ops.pop(),_.trys.pop();continue}$=w.call(y,_)}catch(I){$=[6,I],E=0}finally{C=T=0}if($[0]&5)throw $[1];return{value:$[0]?$[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((O0(),Ru(R0))),d=Ra(),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(L){var z=L.data;_.transportRequestManager.resolveResponse(z)})})},w.prototype.sendData=function(_,C){return C===void 0&&(C=5e3),i(this,void 0,void 0,function(){var E,T,L;return o(this,function(z){E=this.transportRequestManager.addRequest(_,C),T=f.getNotifications(_);try{this.connection.send(JSON.stringify(this.parseData(_))),this.transportRequestManager.settlePendingRequest(T)}catch(U){L=new p.JSONRPCError(U.message,p.ERR_UNKNOWN,U),this.transportRequestManager.settlePendingRequest(T,L),this.transportRequestManager.settlePendingRequest(f.getBatchRequests(_),L),E=Promise.reject(L)}return[2,E]})})},w.prototype.close=function(){this.connection.close()},w})(d.Transport)})),M0=Se((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(U){try{z(w.next(U))}catch($){E($)}}function L(U){try{z(w.throw(U))}catch($){E($)}}function z(U){U.done?C(U.value):_(U.value).then(T,L)}z((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(z){return function(U){return L([z,U])}}function L(z){if(w)throw TypeError("Generator is already executing.");for(;y;)try{if(w=1,_&&(C=z[0]&2?_.return:z[0]?_.throw||((C=_.return)&&C.call(_),0):_.next)&&!(C=C.call(_,z[1])).done)return C;switch(_=0,C&&(z=[z[0]&2,C.value]),z[0]){case 0:case 1:C=z;break;case 4:return y.label++,{value:z[1],done:!1};case 5:y.label++,_=z[1],z=[0];continue;case 7:z=y.ops.pop(),y.trys.pop();continue;default:if(C=y.trys,!(C=C.length>0&&C[C.length-1])&&(z[0]===6||z[0]===2)){y=0;continue}if(z[0]===3&&(!C||z[1]>C[0]&&z[1]<C[3])){y.label=z[1];break}if(z[0]===6&&y.label<C[1]){y.label=C[1],C=z;break}if(C&&y.label<C[2]){y.label=C[2],y.ops.push(z);break}C[2]&&y.ops.pop(),y.trys.pop();continue}z=p.call(f,y)}catch(U){z=[6,U],_=0}finally{w=C=0}if(z[0]&5)throw z[1];return{value:z[0]?z[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=Ra(),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)})),L0=Se((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(z){try{L(y.next(z))}catch(U){C(U)}}function T(z){try{L(y.throw(z))}catch(U){C(U)}}function L(z){z.done?_(z.value):w(z.value).then(E,T)}L((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(L){return function(z){return T([L,z])}}function T(L){if(y)throw TypeError("Generator is already executing.");for(;p;)try{if(y=1,w&&(_=L[0]&2?w.return:L[0]?w.throw||((_=w.return)&&_.call(w),0):w.next)&&!(_=_.call(w,L[1])).done)return _;switch(w=0,_&&(L=[L[0]&2,_.value]),L[0]){case 0:case 1:_=L;break;case 4:return p.label++,{value:L[1],done:!1};case 5:p.label++,w=L[1],L=[0];continue;case 7:L=p.ops.pop(),p.trys.pop();continue;default:if(_=p.trys,!(_=_.length>0&&_[_.length-1])&&(L[0]===6||L[0]===2)){p=0;continue}if(L[0]===3&&(!_||L[1]>_[0]&&L[1]<_[3])){p.label=L[1];break}if(L[0]===6&&p.label<_[1]){p.label=_[1],_=L;break}if(_&&p.label<_[2]){p.label=_[2],p.ops.push(L);break}_[2]&&p.ops.pop(),p.trys.pop();continue}L=f.call(d,p)}catch(z){L=[6,z],w=0}finally{y=_=0}if(L[0]&5)throw L[1];return{value:L[0]?L[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=Ra(),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)})),N0=Se((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})()})),Ql=Se((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(h0()).default,e.EventEmitterTransport=n(g0()).default,e.HTTPTransport=n(T0()).default,e.WebSocketTransport=n(P0()).default,e.PostMessageWindowTransport=n(M0()).default,e.PostMessageIframeTransport=n(L0()).default;var i=Ro();Object.defineProperty(e,"JSONRPCError",{enumerable:!0,get:function(){return i.JSONRPCError}});var o=n(N0());e.Client=o.default,e.default=o.default})),Po=Se((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})),Md=Se((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 ux extends Error{constructor(f,p,y){super(p),this.code=n.number(f)?f:i.UnknownErrorCode,this.data=y,Object.setPrototypeOf(this,ux.prototype)}toJson(){let f={code:this.code,message:this.message};return this.data!==void 0&&(f.data=this.data),f}};var o=class hd{constructor(f){this.kind=f}static is(f){return f===hd.auto||f===hd.byName||f===hd.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={}))})),Ld=Se((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))}}})),I0=Se((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={}))})),Qi=Se((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=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var n=Qi(),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 dx{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=dx._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(){}})),ec=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var n=Qi(),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}}})),A0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var n=ec(),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)}}})),Nd=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var n=Qi();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()}}}})),q0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var n=Qi(),i=Po(),o=Mo(),s=Nd(),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,L=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 z of w.contentDecoders)E.set(z.name,z);if(w.contentTypeDecoder!==void 0&&(T=w.contentTypeDecoder,L.set(T.name,T)),w.contentTypeDecoders!==void 0)for(let z of w.contentTypeDecoders)L.set(z.name,z)}return T===void 0&&(T=(0,n.default)().applicationJson.decoder,L.set(T.name,T)),{charset:_,contentDecoder:C,contentDecoders:E,contentTypeDecoder:T,contentTypeDecoders:L}}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))}}})),j0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var n=Qi(),i=Po(),o=Nd(),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()}}})),z0=Se((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 L=E.substr(0,T),z=E.substr(T+1).trim();w.set(s?L.toLowerCase():L,z)}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}}})),z0=Se((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=Qi(),i=Po(),o=Md(),s=Ld(),c=Mo(),d=ec(),f;(function(J){J.type=new o.NotificationType("$/cancelRequest")})(f||(f={}));var p;(function(J){function we(Ee){return typeof Ee=="string"||typeof Ee=="number"}J.is=we})(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 we(Ee){return i.func(Ee)}J.is=we})(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 we(ne){if(!i.string(ne))return J.Off;switch(ne=ne.toLowerCase(),ne){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=we;function Ee(ne){switch(ne){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=Ee})(_||(e.Trace=_={}));var E;(function(J){J.Text="text",J.JSON="json"})(E||(e.TraceFormat=E={})),(function(J){function we(Ee){return i.string(Ee)?(Ee=Ee.toLowerCase(),Ee==="json"?J.JSON:J.Text):J.Text}J.fromString=we})(E||(e.TraceFormat=E={}));var T;(function(J){J.type=new o.NotificationType("$/setTrace")})(T||(e.SetTraceNotification=T={}));var L;(function(J){J.type=new o.NotificationType("$/logTrace")})(L||(e.LogTraceNotification=L={}));var z;(function(J){J[J.Closed=1]="Closed",J[J.Disposed=2]="Disposed",J[J.AlreadyListening=3]="AlreadyListening"})(z||(e.ConnectionErrors=z={}));var U=class dx extends Error{constructor(we,Ee){super(Ee),this.code=we,Object.setPrototypeOf(this,dx.prototype)}};e.ConnectionError=U;var $;(function(J){function we(Ee){let ne=Ee;return ne&&i.func(ne.cancelUndispatched)}J.is=we})($||(e.ConnectionStrategy=$={}));var I;(function(J){function we(Ee){let ne=Ee;return ne&&(ne.kind===void 0||ne.kind==="id")&&i.func(ne.createCancellationTokenSource)&&(ne.dispose===void 0||i.func(ne.dispose))}J.is=we})(I||(e.IdCancellationReceiverStrategy=I={}));var G;(function(J){function we(Ee){let ne=Ee;return ne&&ne.kind==="request"&&i.func(ne.createCancellationTokenSource)&&(ne.dispose===void 0||i.func(ne.dispose))}J.is=we})(G||(e.RequestCancellationReceiverStrategy=G={}));var pe;(function(J){J.Message=Object.freeze({createCancellationTokenSource(Ee){return new d.CancellationTokenSource}});function we(Ee){return I.is(Ee)||G.is(Ee)}J.is=we})(pe||(e.CancellationReceiverStrategy=pe={}));var P;(function(J){J.Message=Object.freeze({sendCancellation(Ee,ne){return Ee.sendNotification(f.type,{id:ne})},cleanup(Ee){}});function we(Ee){let ne=Ee;return ne&&i.func(ne.sendCancellation)&&i.func(ne.cleanup)}J.is=we})(P||(e.CancellationSenderStrategy=P={}));var A;(function(J){J.Message=Object.freeze({receiver:pe.Message,sender:P.Message});function we(Ee){let ne=Ee;return ne&&pe.is(ne.receiver)&&P.is(ne.sender)}J.is=we})(A||(e.CancellationStrategy=A={}));var V;(function(J){function we(Ee){let ne=Ee;return ne&&i.func(ne.handleMessage)}J.is=we})(V||(e.MessageStrategy=V={}));var de;(function(J){function we(Ee){let ne=Ee;return ne&&(A.is(ne.cancellationStrategy)||$.is(ne.connectionStrategy)||V.is(ne.messageStrategy))}J.is=we})(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 be(J,we,Ee,ne){let ie=Ee===void 0?e.NullLogger:Ee,se=0,K=0,Le=0,$e,st=new Map,je,He=new Map,Oe=new Map,Ne,yn=new s.LinkedMap,qt=new Map,Dn=new Set,cn=new Map,We=_.Off,en=E.Text,vt,vn=fe.New,vr=new c.Emitter,ft=new c.Emitter,zr=new c.Emitter,tn=new c.Emitter,hi=new c.Emitter,On=ne&&ne.cancellationStrategy?ne.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 un(){return"not-"+(++K).toString()}function ea(j,ee){o.Message.isRequest(ee)?j.set(br(ee.id),ee):o.Message.isResponse(ee)?j.set(Pn(ee.id),ee):j.set(un(),ee)}function mi(j){}function Wt(){return vn===fe.Listening}function gi(){return vn===fe.Closed}function dn(){return vn===fe.Disposed}function ti(){(vn===fe.New||vn===fe.Listening)&&(vn=fe.Closed,ft.fire(void 0))}function jt(j){vr.fire([j,void 0,void 0])}function Fr(j){vr.fire(j)}J.onClose(ti),J.onError(jt),we.onClose(ti),we.onError(Fr);function bt(){Ne||yn.size===0||(Ne=(0,n.default)().timer.setImmediate(()=>{Ne=void 0,ta()}))}function yi(j){o.Message.isRequest(j)?Gt(j):o.Message.isNotification(j)?ht(j):o.Message.isResponse(j)?Ge(j):wt(j)}function ta(){if(yn.size===0)return;let j=yn.shift();try{let ee=ne==null?void 0:ne.messageStrategy;V.is(ee)?ee.handleMessage(j,yi):yi(j)}finally{bt()}}let wr=j=>{try{if(o.Message.isNotification(j)&&j.method===f.type.method){let ee=j.params.id,ve=br(ee),Ce=yn.get(ve);if(o.Message.isRequest(Ce)){let Fe=ne==null?void 0:ne.connectionStrategy,at=Fe&&Fe.cancelUndispatched?Fe.cancelUndispatched(Ce,mi):void 0;if(at&&(at.error!==void 0||at.result!==void 0)){yn.delete(ve),cn.delete(ee),at.id=Ce.id,xt(at,j.method,Date.now()),we.write(at).catch(()=>ie.error("Sending response for canceled message failed."));return}}let ze=cn.get(ee);if(ze!==void 0){ze.cancel(),Mn(j);return}else Dn.add(ee)}ea(yn,j)}finally{bt()}};function Gt(j){if(dn())return;function ee(Ze,Pt,nt){let ut={jsonrpc:"2.0",id:j.id};Ze instanceof o.ResponseError?ut.error=Ze.toJson():ut.result=Ze===void 0?null:Ze,xt(ut,Pt,nt),we.write(ut).catch(()=>ie.error("Sending response failed."))}function ve(Ze,Pt,nt){let ut={jsonrpc:"2.0",id:j.id,error:Ze.toJson()};xt(ut,Pt,nt),we.write(ut).catch(()=>ie.error("Sending response failed."))}function Ce(Ze,Pt,nt){Ze===void 0&&(Ze=null);let ut={jsonrpc:"2.0",id:j.id,result:Ze};xt(ut,Pt,nt),we.write(ut).catch(()=>ie.error("Sending response failed."))}ir(j);let ze=st.get(j.method),Fe,at;ze&&(Fe=ze.type,at=ze.handler);let Ot=Date.now();if(at||$e){let Ze=j.id??String(Date.now()),Pt=I.is(On.receiver)?On.receiver.createCancellationTokenSource(Ze):On.receiver.createCancellationTokenSource(j);j.id!==null&&Dn.has(j.id)&&Pt.cancel(),j.id!==null&&cn.set(Ze,Pt);try{let nt;if(at)if(j.params===void 0){if(Fe!==void 0&&Fe.numberOfParams!==0){ve(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${j.method} defines ${Fe.numberOfParams} params but received none.`),j.method,Ot);return}nt=at(Pt.token)}else if(Array.isArray(j.params)){if(Fe!==void 0&&Fe.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,Ot);return}nt=at(...j.params,Pt.token)}else{if(Fe!==void 0&&Fe.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,Ot);return}nt=at(j.params,Pt.token)}else $e&&(nt=$e(j.method,j.params,Pt.token));let ut=nt;nt?ut.then?ut.then(wn=>{cn.delete(Ze),ee(wn,j.method,Ot)},wn=>{cn.delete(Ze),wn instanceof o.ResponseError?ve(wn,j.method,Ot):wn&&i.string(wn.message)?ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed with message: ${wn.message}`),j.method,Ot):ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed unexpectedly without providing any details.`),j.method,Ot)}):(cn.delete(Ze),ee(nt,j.method,Ot)):(cn.delete(Ze),Ce(nt,j.method,Ot))}catch(nt){cn.delete(Ze),nt instanceof o.ResponseError?ee(nt,j.method,Ot):nt&&i.string(nt.message)?ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed with message: ${nt.message}`),j.method,Ot):ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed unexpectedly without providing any details.`),j.method,Ot)}}else ve(new o.ResponseError(o.ErrorCodes.MethodNotFound,`Unhandled method ${j.method}`),j.method,Ot)}function Ge(j){if(!dn())if(j.id===null)j.error?ie.error(`Received response message without id: Error is:
20
+ ${E}`);let L=E.substr(0,T),z=E.substr(T+1).trim();w.set(s?L.toLowerCase():L,z)}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}}})),F0=Se((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=Qi(),i=Po(),o=Md(),s=Ld(),c=Mo(),d=ec(),f;(function(J){J.type=new o.NotificationType("$/cancelRequest")})(f||(f={}));var p;(function(J){function we(Ee){return typeof Ee=="string"||typeof Ee=="number"}J.is=we})(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 we(Ee){return i.func(Ee)}J.is=we})(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 we(ne){if(!i.string(ne))return J.Off;switch(ne=ne.toLowerCase(),ne){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=we;function Ee(ne){switch(ne){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=Ee})(_||(e.Trace=_={}));var E;(function(J){J.Text="text",J.JSON="json"})(E||(e.TraceFormat=E={})),(function(J){function we(Ee){return i.string(Ee)?(Ee=Ee.toLowerCase(),Ee==="json"?J.JSON:J.Text):J.Text}J.fromString=we})(E||(e.TraceFormat=E={}));var T;(function(J){J.type=new o.NotificationType("$/setTrace")})(T||(e.SetTraceNotification=T={}));var L;(function(J){J.type=new o.NotificationType("$/logTrace")})(L||(e.LogTraceNotification=L={}));var z;(function(J){J[J.Closed=1]="Closed",J[J.Disposed=2]="Disposed",J[J.AlreadyListening=3]="AlreadyListening"})(z||(e.ConnectionErrors=z={}));var U=class fx extends Error{constructor(we,Ee){super(Ee),this.code=we,Object.setPrototypeOf(this,fx.prototype)}};e.ConnectionError=U;var $;(function(J){function we(Ee){let ne=Ee;return ne&&i.func(ne.cancelUndispatched)}J.is=we})($||(e.ConnectionStrategy=$={}));var I;(function(J){function we(Ee){let ne=Ee;return ne&&(ne.kind===void 0||ne.kind==="id")&&i.func(ne.createCancellationTokenSource)&&(ne.dispose===void 0||i.func(ne.dispose))}J.is=we})(I||(e.IdCancellationReceiverStrategy=I={}));var G;(function(J){function we(Ee){let ne=Ee;return ne&&ne.kind==="request"&&i.func(ne.createCancellationTokenSource)&&(ne.dispose===void 0||i.func(ne.dispose))}J.is=we})(G||(e.RequestCancellationReceiverStrategy=G={}));var pe;(function(J){J.Message=Object.freeze({createCancellationTokenSource(Ee){return new d.CancellationTokenSource}});function we(Ee){return I.is(Ee)||G.is(Ee)}J.is=we})(pe||(e.CancellationReceiverStrategy=pe={}));var P;(function(J){J.Message=Object.freeze({sendCancellation(Ee,ne){return Ee.sendNotification(f.type,{id:ne})},cleanup(Ee){}});function we(Ee){let ne=Ee;return ne&&i.func(ne.sendCancellation)&&i.func(ne.cleanup)}J.is=we})(P||(e.CancellationSenderStrategy=P={}));var A;(function(J){J.Message=Object.freeze({receiver:pe.Message,sender:P.Message});function we(Ee){let ne=Ee;return ne&&pe.is(ne.receiver)&&P.is(ne.sender)}J.is=we})(A||(e.CancellationStrategy=A={}));var V;(function(J){function we(Ee){let ne=Ee;return ne&&i.func(ne.handleMessage)}J.is=we})(V||(e.MessageStrategy=V={}));var de;(function(J){function we(Ee){let ne=Ee;return ne&&(A.is(ne.cancellationStrategy)||$.is(ne.connectionStrategy)||V.is(ne.messageStrategy))}J.is=we})(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 be(J,we,Ee,ne){let ie=Ee===void 0?e.NullLogger:Ee,se=0,K=0,Le=0,$e,lt=new Map,je,He=new Map,Oe=new Map,Ne,yn=new s.LinkedMap,qt=new Map,Dn=new Set,cn=new Map,We=_.Off,en=E.Text,vt,vn=fe.New,vr=new c.Emitter,ft=new c.Emitter,zr=new c.Emitter,tn=new c.Emitter,hi=new c.Emitter,On=ne&&ne.cancellationStrategy?ne.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 un(){return"not-"+(++K).toString()}function ea(j,ee){o.Message.isRequest(ee)?j.set(br(ee.id),ee):o.Message.isResponse(ee)?j.set(Pn(ee.id),ee):j.set(un(),ee)}function mi(j){}function Wt(){return vn===fe.Listening}function gi(){return vn===fe.Closed}function dn(){return vn===fe.Disposed}function ti(){(vn===fe.New||vn===fe.Listening)&&(vn=fe.Closed,ft.fire(void 0))}function jt(j){vr.fire([j,void 0,void 0])}function Fr(j){vr.fire(j)}J.onClose(ti),J.onError(jt),we.onClose(ti),we.onError(Fr);function bt(){Ne||yn.size===0||(Ne=(0,n.default)().timer.setImmediate(()=>{Ne=void 0,ta()}))}function yi(j){o.Message.isRequest(j)?Gt(j):o.Message.isNotification(j)?ht(j):o.Message.isResponse(j)?Ge(j):wt(j)}function ta(){if(yn.size===0)return;let j=yn.shift();try{let ee=ne==null?void 0:ne.messageStrategy;V.is(ee)?ee.handleMessage(j,yi):yi(j)}finally{bt()}}let wr=j=>{try{if(o.Message.isNotification(j)&&j.method===f.type.method){let ee=j.params.id,ve=br(ee),Ce=yn.get(ve);if(o.Message.isRequest(Ce)){let Fe=ne==null?void 0:ne.connectionStrategy,at=Fe&&Fe.cancelUndispatched?Fe.cancelUndispatched(Ce,mi):void 0;if(at&&(at.error!==void 0||at.result!==void 0)){yn.delete(ve),cn.delete(ee),at.id=Ce.id,xt(at,j.method,Date.now()),we.write(at).catch(()=>ie.error("Sending response for canceled message failed."));return}}let ze=cn.get(ee);if(ze!==void 0){ze.cancel(),Mn(j);return}else Dn.add(ee)}ea(yn,j)}finally{bt()}};function Gt(j){if(dn())return;function ee(Ze,Pt,nt){let ut={jsonrpc:"2.0",id:j.id};Ze instanceof o.ResponseError?ut.error=Ze.toJson():ut.result=Ze===void 0?null:Ze,xt(ut,Pt,nt),we.write(ut).catch(()=>ie.error("Sending response failed."))}function ve(Ze,Pt,nt){let ut={jsonrpc:"2.0",id:j.id,error:Ze.toJson()};xt(ut,Pt,nt),we.write(ut).catch(()=>ie.error("Sending response failed."))}function Ce(Ze,Pt,nt){Ze===void 0&&(Ze=null);let ut={jsonrpc:"2.0",id:j.id,result:Ze};xt(ut,Pt,nt),we.write(ut).catch(()=>ie.error("Sending response failed."))}ir(j);let ze=lt.get(j.method),Fe,at;ze&&(Fe=ze.type,at=ze.handler);let Ot=Date.now();if(at||$e){let Ze=j.id??String(Date.now()),Pt=I.is(On.receiver)?On.receiver.createCancellationTokenSource(Ze):On.receiver.createCancellationTokenSource(j);j.id!==null&&Dn.has(j.id)&&Pt.cancel(),j.id!==null&&cn.set(Ze,Pt);try{let nt;if(at)if(j.params===void 0){if(Fe!==void 0&&Fe.numberOfParams!==0){ve(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${j.method} defines ${Fe.numberOfParams} params but received none.`),j.method,Ot);return}nt=at(Pt.token)}else if(Array.isArray(j.params)){if(Fe!==void 0&&Fe.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,Ot);return}nt=at(...j.params,Pt.token)}else{if(Fe!==void 0&&Fe.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,Ot);return}nt=at(j.params,Pt.token)}else $e&&(nt=$e(j.method,j.params,Pt.token));let ut=nt;nt?ut.then?ut.then(wn=>{cn.delete(Ze),ee(wn,j.method,Ot)},wn=>{cn.delete(Ze),wn instanceof o.ResponseError?ve(wn,j.method,Ot):wn&&i.string(wn.message)?ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed with message: ${wn.message}`),j.method,Ot):ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed unexpectedly without providing any details.`),j.method,Ot)}):(cn.delete(Ze),ee(nt,j.method,Ot)):(cn.delete(Ze),Ce(nt,j.method,Ot))}catch(nt){cn.delete(Ze),nt instanceof o.ResponseError?ee(nt,j.method,Ot):nt&&i.string(nt.message)?ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed with message: ${nt.message}`),j.method,Ot):ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed unexpectedly without providing any details.`),j.method,Ot)}}else ve(new o.ResponseError(o.ErrorCodes.MethodNotFound,`Unhandled method ${j.method}`),j.method,Ot)}function Ge(j){if(!dn())if(j.id===null)j.error?ie.error(`Received response message without id: Error is:
21
21
  ${JSON.stringify(j.error,void 0,4)}`):ie.error("Received response message without id. No further error information provided.");else{let ee=j.id,ve=qt.get(ee);if(Br(j,ve),ve!==void 0){qt.delete(ee);try{if(j.error){let Ce=j.error;ve.reject(new o.ResponseError(Ce.code,Ce.message,Ce.data))}else if(j.result!==void 0)ve.resolve(j.result);else throw Error("Should never happen.")}catch(Ce){Ce.message?ie.error(`Response handler '${ve.method}' failed with message: ${Ce.message}`):ie.error(`Response handler '${ve.method}' failed unexpectedly.`)}}}}function ht(j){if(dn())return;let ee,ve;if(j.method===f.type.method){let Ce=j.params.id;Dn.delete(Ce),Mn(j);return}else{let Ce=He.get(j.method);Ce&&(ve=Ce.handler,ee=Ce.type)}if(ve||je)try{if(Mn(j),ve)if(j.params===void 0)ee!==void 0&&ee.numberOfParams!==0&&ee.parameterStructures!==o.ParameterStructures.byName&&ie.error(`Notification ${j.method} defines ${ee.numberOfParams} params but received none.`),ve();else if(Array.isArray(j.params)){let Ce=j.params;j.method===y.type.method&&Ce.length===2&&p.is(Ce[0])?ve({token:Ce[0],value:Ce[1]}):(ee!==void 0&&(ee.parameterStructures===o.ParameterStructures.byName&&ie.error(`Notification ${j.method} defines parameters by name but received parameters by position`),ee.numberOfParams!==j.params.length&&ie.error(`Notification ${j.method} defines ${ee.numberOfParams} params but received ${Ce.length} arguments`)),ve(...Ce))}else ee!==void 0&&ee.parameterStructures===o.ParameterStructures.byPosition&&ie.error(`Notification ${j.method} defines parameters by position but received parameters by name`),ve(j.params);else je&&je(j.method,j.params)}catch(Ce){Ce.message?ie.error(`Notification handler '${j.method}' failed with message: ${Ce.message}`):ie.error(`Notification handler '${j.method}' failed unexpectedly.`)}else zr.fire(j)}function wt(j){if(!j){ie.error("Received empty message.");return}ie.error(`Received message which is neither a response nor a notification message:
22
22
  ${JSON.stringify(j,null,4)}`);let ee=j;if(i.string(ee.id)||i.number(ee.id)){let ve=ee.id,Ce=qt.get(ve);Ce&&Ce.reject(Error("The received response has neither a result nor an error property."))}}function _t(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||!vt))if(en===E.Text){let ee;(We===_.Verbose||We===_.Compact)&&j.params&&(ee=`Params: ${_t(j.params)}
23
23
 
@@ -43,9 +43,9 @@ ${JSON.stringify(j,null,4)}`);let ee=j;if(i.string(ee.id)||i.number(ee.id)){let
43
43
 
44
44
  `:j.error===void 0&&(ve=`No result returned.
45
45
 
46
- `)),ee){let Ce=j.error?` Request failed: ${j.error.message} (${j.error.code}).`:"";vt.log(`Received response '${ee.method} - (${j.id})' in ${Date.now()-ee.timerStart}ms.${Ce}`,ve)}else vt.log(`Received response ${j.id} without active response promise.`,ve)}else bn("receive-response",j)}function bn(j,ee){if(!vt||We===_.Off)return;let ve={isLSPMessage:!0,type:j,message:ee,timestamp:Date.now()};vt.log(ve)}function ar(){if(gi())throw new U(z.Closed,"Connection is closed.");if(dn())throw new U(z.Disposed,"Connection is disposed.")}function vi(){if(Wt())throw new U(z.AlreadyListening,"Connection is already listening")}function ni(){if(!Wt())throw Error("Call listen() first.")}function Ln(j){return j===void 0?null:j}function bi(j){if(j!==null)return j}function zn(j){return j!=null&&!Array.isArray(j)&&typeof j=="object"}function or(j,ee){switch(j){case o.ParameterStructures.auto:return zn(ee)?bi(ee):[Ln(ee)];case o.ParameterStructures.byName:if(!zn(ee))throw Error("Received parameters by name but param is not an object literal.");return bi(ee);case o.ParameterStructures.byPosition:return[Ln(ee)];default:throw Error(`Unknown parameter structure ${j.toString()}`)}}function M(j,ee){let ve,Ce=j.numberOfParams;switch(Ce){case 0:ve=void 0;break;case 1:ve=or(j.parameterStructures,ee[0]);break;default:ve=[];for(let ze=0;ze<ee.length&&ze<Ce;ze++)ve.push(Ln(ee[ze]));if(ee.length<Ce)for(let ze=ee.length;ze<Ce;ze++)ve.push(null);break}return ve}let Ye={sendNotification:(j,...ee)=>{ar();let ve,Ce;if(i.string(j)){ve=j;let Fe=ee[0],at=0,Ot=o.ParameterStructures.auto;o.ParameterStructures.is(Fe)&&(at=1,Ot=Fe);let Ze=ee.length,Pt=Ze-at;switch(Pt){case 0:Ce=void 0;break;case 1:Ce=or(Ot,ee[at]);break;default:if(Ot===o.ParameterStructures.byName)throw Error(`Received ${Pt} parameters for 'by Name' notification parameter structure.`);Ce=ee.slice(at,Ze).map(nt=>Ln(nt));break}}else{let Fe=ee;ve=j.method,Ce=M(j,Fe)}let ze={jsonrpc:"2.0",method:ve,params:Ce};return _r(ze),we.write(ze).catch(Fe=>{throw ie.error("Sending notification failed."),Fe})},onNotification:(j,ee)=>{ar();let ve;return i.func(j)?je=j:ee&&(i.string(j)?(ve=j,He.set(j,{type:void 0,handler:ee})):(ve=j.method,He.set(j.method,{type:j,handler:ee}))),{dispose:()=>{ve===void 0?je=void 0:He.delete(ve)}}},onProgress:(j,ee,ve)=>{if(Oe.has(ee))throw Error(`Progress handler for token ${ee} already registered`);return Oe.set(ee,ve),{dispose:()=>{Oe.delete(ee)}}},sendProgress:(j,ee,ve)=>Ye.sendNotification(y.type,{token:ee,value:ve}),onUnhandledProgress:tn.event,sendRequest:(j,...ee)=>{ar(),ni();let ve,Ce,ze;if(i.string(j)){ve=j;let Ze=ee[0],Pt=ee[ee.length-1],nt=0,ut=o.ParameterStructures.auto;o.ParameterStructures.is(Ze)&&(nt=1,ut=Ze);let wn=ee.length;d.CancellationToken.is(Pt)&&(--wn,ze=Pt);let sr=wn-nt;switch(sr){case 0:Ce=void 0;break;case 1:Ce=or(ut,ee[nt]);break;default:if(ut===o.ParameterStructures.byName)throw Error(`Received ${sr} parameters for 'by Name' request parameter structure.`);Ce=ee.slice(nt,wn).map(ri=>Ln(ri));break}}else{let Ze=ee;ve=j.method,Ce=M(j,Ze);let Pt=j.numberOfParams;ze=d.CancellationToken.is(Ze[Pt])?Ze[Pt]:void 0}let Fe=se++,at;ze&&(at=ze.onCancellationRequested(()=>{let Ze=On.sender.sendCancellation(Ye,Fe);return Ze===void 0?(ie.log(`Received no promise from cancellation strategy when cancelling id ${Fe}`),Promise.resolve()):Ze.catch(()=>{ie.log(`Sending cancellation messages for id ${Fe} failed`)})}));let Ot={jsonrpc:"2.0",id:Fe,method:ve,params:Ce};return jn(Ot),typeof On.sender.enableCancellation=="function"&&On.sender.enableCancellation(Ot),new Promise(async(Ze,Pt)=>{let nt={method:ve,timerStart:Date.now(),resolve:ut=>{Ze(ut),On.sender.cleanup(Fe),at==null||at.dispose()},reject:ut=>{Pt(ut),On.sender.cleanup(Fe),at==null||at.dispose()}};try{await we.write(Ot),qt.set(Fe,nt)}catch(ut){throw ie.error("Sending request failed."),nt.reject(new o.ResponseError(o.ErrorCodes.MessageWriteError,ut.message?ut.message:"Unknown reason")),ut}})},onRequest:(j,ee)=>{ar();let ve=null;return w.is(j)?(ve=void 0,$e=j):i.string(j)?(ve=null,ee!==void 0&&(ve=j,st.set(j,{handler:ee,type:void 0}))):ee!==void 0&&(ve=j.method,st.set(j.method,{type:j,handler:ee})),{dispose:()=>{ve!==null&&(ve===void 0?$e=void 0:st.delete(ve))}}},hasPendingResponse:()=>qt.size>0,trace:async(j,ee,ve)=>{let Ce=!1,ze=E.Text;ve!==void 0&&(i.boolean(ve)?Ce=ve:(Ce=ve.sendNotification||!1,ze=ve.traceFormat||E.Text)),We=j,en=ze,vt=We===_.Off?void 0:ee,Ce&&!gi()&&!dn()&&await Ye.sendNotification(T.type,{value:_.toString(j)})},onError:vr.event,onClose:ft.event,onUnhandledNotification:zr.event,onDispose:hi.event,end:()=>{we.end()},dispose:()=>{if(dn())return;vn=fe.Disposed,hi.fire(void 0);let j=new o.ResponseError(o.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let ee of qt.values())ee.reject(j);qt=new Map,cn=new Map,Dn=new Set,yn=new s.LinkedMap,i.func(we.dispose)&&we.dispose(),i.func(J.dispose)&&J.dispose()},listen:()=>{ar(),vi(),vn=fe.Listening,J.listen(wr)},inspect:()=>{(0,n.default)().console.log("inspect")}};return Ye.onNotification(L.type,j=>{if(We===_.Off||!vt)return;let ee=We===_.Verbose||We===_.Compact;vt.log(j.message,ee?j.verbose:void 0)}),Ye.onNotification(y.type,j=>{let ee=Oe.get(j.token);ee?ee(j.value):tn.fire(j)}),Ye}e.createMessageConnection=be})),tc=Se((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=Md();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=Ld();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=N0();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=ec();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return c.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return c.CancellationToken}});var d=I0();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return d.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return d.SharedArrayReceiverStrategy}});var f=A0();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=q0();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=j0();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return y.AbstractMessageBuffer}});var w=z0();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=Qi().default})),F0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=tc(),i=class fx extends n.AbstractMessageBuffer{constructor(y="utf-8"){super(y),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return fx.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=Se((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,F0().default.install();var o=tc();i(tc(),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})),Id=Se(((e,n)=>{n.exports=ja()})),Ht=Se((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)}}})),nc=Se((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})),B0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var n=Ht(),i;(function(o){o.method="textDocument/implementation",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ImplementationRequest=i={}))})),H0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var n=Ht(),i;(function(o){o.method="textDocument/typeDefinition",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.TypeDefinitionRequest=i={}))})),V0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var n=Ht(),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={}))})),$0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var n=Ht(),i;(function(o){o.method="workspace/configuration",o.messageDirection=n.MessageDirection.serverToClient,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ConfigurationRequest=i={}))})),W0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var n=Ht(),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={}))})),U0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var n=Ht(),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={}))})),K0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var n=Ht(),i;(function(o){o.method="textDocument/declaration",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.DeclarationRequest=i={}))})),Q0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var n=Ht(),i;(function(o){o.method="textDocument/selectionRange",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.SelectionRangeRequest=i={}))})),G0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var n=ja(),i=Ht(),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={}))})),J0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var n=Ht(),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={}))})),X0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var n=Ht(),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={}))})),Y0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var n=Ht(),i;(function(o){o.method="window/showDocument",o.messageDirection=n.MessageDirection.serverToClient,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ShowDocumentRequest=i={}))})),Z0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var n=Ht(),i;(function(o){o.method="textDocument/linkedEditingRange",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.LinkedEditingRangeRequest=i={}))})),eg=Se((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=Ht(),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={}))})),tg=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var n=Ht(),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={}))})),ng=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var n=Ht(),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={}))})),rg=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var n=Ht(),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={}))})),ig=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var n=Ht(),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={}))})),ag=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var n=ja(),i=nc(),o=Ht(),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={}))})),og=Se((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=(Ch(),Ru(Sh)),i=nc(),o=Ht(),s;(function(T){T.Markup=1,T.Code=2;function L(z){return z===1||z===2}T.is=L})(s||(e.NotebookCellKind=s={}));var c;(function(T){function L($,I){let G={executionOrder:$};return(I===!0||I===!1)&&(G.success=I),G}T.create=L;function z($){let I=$;return i.objectLiteral(I)&&n.uinteger.is(I.executionOrder)&&(I.success===void 0||i.boolean(I.success))}T.is=z;function U($,I){return $===I?!0:$==null||I==null?!1:$.executionOrder===I.executionOrder&&$.success===I.success}T.equals=U})(c||(e.ExecutionSummary=c={}));var d;(function(T){function L(I,G){return{kind:I,document:G}}T.create=L;function z(I){let G=I;return i.objectLiteral(G)&&s.is(G.kind)&&n.DocumentUri.is(G.document)&&(G.metadata===void 0||i.objectLiteral(G.metadata))}T.is=z;function U(I,G){let pe=new Set;return I.document!==G.document&&pe.add("document"),I.kind!==G.kind&&pe.add("kind"),I.executionSummary!==G.executionSummary&&pe.add("executionSummary"),(I.metadata!==void 0||G.metadata!==void 0)&&!$(I.metadata,G.metadata)&&pe.add("metadata"),(I.executionSummary!==void 0||G.executionSummary!==void 0)&&!c.equals(I.executionSummary,G.executionSummary)&&pe.add("executionSummary"),pe}T.diff=U;function $(I,G){if(I===G)return!0;if(I==null||G==null||typeof I!=typeof G||typeof I!="object")return!1;let pe=Array.isArray(I),P=Array.isArray(G);if(pe!==P)return!1;if(pe&&P){if(I.length!==G.length)return!1;for(let A=0;A<I.length;A++)if(!$(I[A],G[A]))return!1}if(i.objectLiteral(I)&&i.objectLiteral(G)){let A=Object.keys(I),V=Object.keys(G);if(A.length!==V.length||(A.sort(),V.sort(),!$(A,V)))return!1;for(let de=0;de<A.length;de++){let fe=A[de];if(!$(I[fe],G[fe]))return!1}}return!0}})(d||(e.NotebookCell=d={}));var f;(function(T){function L(U,$,I,G){return{uri:U,notebookType:$,version:I,cells:G}}T.create=L;function z(U){let $=U;return i.objectLiteral($)&&i.string($.uri)&&n.integer.is($.version)&&i.typedArray($.cells,d.is)}T.is=z})(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 L(U){let $=U;return i.objectLiteral($)&&n.uinteger.is($.start)&&n.uinteger.is($.deleteCount)&&($.cells===void 0||i.typedArray($.cells,d.is))}T.is=L;function z(U,$,I){let G={start:U,deleteCount:$};return I!==void 0&&(G.cells=I),G}T.create=z})(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={}))})),sg=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineCompletionRequest=void 0;var n=Ht(),i;(function(o){o.method="textDocument/inlineCompletion",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.InlineCompletionRequest=i={}))})),lg=Se((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=Ht(),i=(Ch(),Ru(Sh)),o=nc(),s=B0();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return s.ImplementationRequest}});var c=H0();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return c.TypeDefinitionRequest}});var d=V0();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return d.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return d.DidChangeWorkspaceFoldersNotification}});var f=$0();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return f.ConfigurationRequest}});var p=W0();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return p.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return p.ColorPresentationRequest}});var y=U0();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return y.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return y.FoldingRangeRefreshRequest}});var w=K0();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return w.DeclarationRequest}});var _=Q0();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return _.SelectionRangeRequest}});var C=G0();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=J0();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=X0();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 L=Y0();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return L.ShowDocumentRequest}});var z=Z0();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return z.LinkedEditingRangeRequest}});var U=eg();Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return U.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return U.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return U.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return U.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return U.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return U.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return U.WillDeleteFilesRequest}});var $=tg();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return $.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return $.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return $.MonikerRequest}});var I=ng();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return I.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return I.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return I.TypeHierarchySupertypesRequest}});var G=rg();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return G.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return G.InlineValueRefreshRequest}});var pe=ig();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=ag();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=og();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 V=sg();Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return V.InlineCompletionRequest}});var de;(function(M){function Ye(j){let ee=j;return o.string(ee)||o.string(ee.language)||o.string(ee.scheme)||o.string(ee.pattern)}M.is=Ye})(de||(e.TextDocumentFilter=de={}));var fe;(function(M){function Ye(j){let ee=j;return o.objectLiteral(ee)&&(o.string(ee.notebookType)||o.string(ee.scheme)||o.string(ee.pattern))}M.is=Ye})(fe||(e.NotebookDocumentFilter=fe={}));var be;(function(M){function Ye(j){let ee=j;return o.objectLiteral(ee)&&(o.string(ee.notebook)||fe.is(ee.notebook))&&(ee.language===void 0||o.string(ee.language))}M.is=Ye})(be||(e.NotebookCellTextDocumentFilter=be={}));var J;(function(M){function Ye(j){if(!Array.isArray(j))return!1;for(let ee of j)if(!o.string(ee)&&!de.is(ee)&&!be.is(ee))return!1;return!0}M.is=Ye})(J||(e.DocumentSelector=J={}));var we;(function(M){M.method="client/registerCapability",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(we||(e.RegistrationRequest=we={}));var Ee;(function(M){M.method="client/unregisterCapability",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(Ee||(e.UnregistrationRequest=Ee={}));var ne;(function(M){M.Create="create",M.Rename="rename",M.Delete="delete"})(ne||(e.ResourceOperationKind=ne={}));var ie;(function(M){M.Abort="abort",M.Transactional="transactional",M.TextOnlyTransactional="textOnlyTransactional",M.Undo="undo"})(ie||(e.FailureHandlingKind=ie={}));var se;(function(M){M.UTF8="utf-8",M.UTF16="utf-16",M.UTF32="utf-32"})(se||(e.PositionEncodingKind=se={}));var K;(function(M){function Ye(j){let ee=j;return ee&&o.string(ee.id)&&ee.id.length>0}M.hasId=Ye})(K||(e.StaticRegistrationOptions=K={}));var Le;(function(M){function Ye(j){let ee=j;return ee&&(ee.documentSelector===null||J.is(ee.documentSelector))}M.is=Ye})(Le||(e.TextDocumentRegistrationOptions=Le={}));var $e;(function(M){function Ye(ee){let ve=ee;return o.objectLiteral(ve)&&(ve.workDoneProgress===void 0||o.boolean(ve.workDoneProgress))}M.is=Ye;function j(ee){let ve=ee;return ve&&o.boolean(ve.workDoneProgress)}M.hasWorkDoneProgress=j})($e||(e.WorkDoneProgressOptions=$e={}));var st;(function(M){M.method="initialize",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(st||(e.InitializeRequest=st={}));var je;(function(M){M.unknownProtocolVersion=1})(je||(e.InitializeErrorCodes=je={}));var He;(function(M){M.method="initialized",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(He||(e.InitializedNotification=He={}));var Oe;(function(M){M.method="shutdown",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType0(M.method)})(Oe||(e.ShutdownRequest=Oe={}));var Ne;(function(M){M.method="exit",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType0(M.method)})(Ne||(e.ExitNotification=Ne={}));var yn;(function(M){M.method="workspace/didChangeConfiguration",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(yn||(e.DidChangeConfigurationNotification=yn={}));var qt;(function(M){M.Error=1,M.Warning=2,M.Info=3,M.Log=4,M.Debug=5})(qt||(e.MessageType=qt={}));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 cn;(function(M){M.method="window/showMessageRequest",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(cn||(e.ShowMessageRequest=cn={}));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 en;(function(M){M.method="telemetry/event",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(en||(e.TelemetryEventNotification=en={}));var vt;(function(M){M.None=0,M.Full=1,M.Incremental=2})(vt||(e.TextDocumentSyncKind=vt={}));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(ee){let ve=ee;return ve!=null&&typeof ve.text=="string"&&ve.range!==void 0&&(ve.rangeLength===void 0||typeof ve.rangeLength=="number")}M.isIncremental=Ye;function j(ee){let ve=ee;return ve!=null&&typeof ve.text=="string"&&ve.range===void 0&&ve.rangeLength===void 0}M.isFull=j})(vr||(e.TextDocumentContentChangeEvent=vr={}));var ft;(function(M){M.method="textDocument/didChange",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(ft||(e.DidChangeTextDocumentNotification=ft={}));var zr;(function(M){M.method="textDocument/didClose",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(zr||(e.DidCloseTextDocumentNotification=zr={}));var tn;(function(M){M.method="textDocument/didSave",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(tn||(e.DidSaveTextDocumentNotification=tn={}));var hi;(function(M){M.Manual=1,M.AfterDelay=2,M.FocusOut=3})(hi||(e.TextDocumentSaveReason=hi={}));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 un;(function(M){M.Created=1,M.Changed=2,M.Deleted=3})(un||(e.FileChangeType=un={}));var ea;(function(M){function Ye(j){let ee=j;return o.objectLiteral(ee)&&(i.URI.is(ee.baseUri)||i.WorkspaceFolder.is(ee.baseUri))&&o.string(ee.pattern)}M.is=Ye})(ea||(e.RelativePattern=ea={}));var mi;(function(M){M.Create=1,M.Change=2,M.Delete=4})(mi||(e.WatchKind=mi={}));var Wt;(function(M){M.method="textDocument/publishDiagnostics",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(Wt||(e.PublishDiagnosticsNotification=Wt={}));var gi;(function(M){M.Invoked=1,M.TriggerCharacter=2,M.TriggerForIncompleteCompletions=3})(gi||(e.CompletionTriggerKind=gi={}));var dn;(function(M){M.method="textDocument/completion",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(dn||(e.CompletionRequest=dn={}));var ti;(function(M){M.method="completionItem/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ti||(e.CompletionResolveRequest=ti={}));var jt;(function(M){M.method="textDocument/hover",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(jt||(e.HoverRequest=jt={}));var Fr;(function(M){M.Invoked=1,M.TriggerCharacter=2,M.ContentChange=3})(Fr||(e.SignatureHelpTriggerKind=Fr={}));var bt;(function(M){M.method="textDocument/signatureHelp",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(bt||(e.SignatureHelpRequest=bt={}));var yi;(function(M){M.method="textDocument/definition",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(yi||(e.DefinitionRequest=yi={}));var ta;(function(M){M.method="textDocument/references",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ta||(e.ReferencesRequest=ta={}));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 Gt;(function(M){M.method="textDocument/documentSymbol",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Gt||(e.DocumentSymbolRequest=Gt={}));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 ht;(function(M){M.method="codeAction/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ht||(e.CodeActionResolveRequest=ht={}));var wt;(function(M){M.method="workspace/symbol",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(wt||(e.WorkspaceSymbolRequest=wt={}));var _t;(function(M){M.method="workspaceSymbol/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(_t||(e.WorkspaceSymbolResolveRequest=_t={}));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 xt;(function(M){M.method="workspace/codeLens/refresh",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType0(M.method)})(xt||(e.CodeLensRefreshRequest=xt={}));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 Br;(function(M){M.method="textDocument/formatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Br||(e.DocumentFormattingRequest=Br={}));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 vi;(function(M){M.method="textDocument/onTypeFormatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(vi||(e.DocumentOnTypeFormattingRequest=vi={}));var ni;(function(M){M.Identifier=1})(ni||(e.PrepareSupportDefaultBehavior=ni={}));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 bi;(function(M){M.method="textDocument/prepareRename",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(bi||(e.PrepareRenameRequest=bi={}));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={}))})),cg=Se((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})),ug=Se((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((Ch(),Ru(Sh)),e),i(Ht(),e),i(lg(),e);var o=cg();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={}))})),Wu=Se((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=Id();i(Id(),e),i(ug(),e);function s(c,d,f,p){return(0,o.createMessageConnection)(c,d,f,p)}e.createProtocolConnection=s}));function gn(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 gn(e,n)||0}function Gi(e,n){let i=e.lineAt(n);return{character:n-i.from,line:i.number-1}}var rc=new bw.Renderer,Kx=rc.code;rc.code=e=>e.text.trim()?Kx.call(rc,e):"";function dg(e){return bw(e,{async:!1,gfm:!0,breaks:!0,renderer:rc})}function Ar(e,n=dg){if(!e)return"";if(Xx(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
+ `)),ee){let Ce=j.error?` Request failed: ${j.error.message} (${j.error.code}).`:"";vt.log(`Received response '${ee.method} - (${j.id})' in ${Date.now()-ee.timerStart}ms.${Ce}`,ve)}else vt.log(`Received response ${j.id} without active response promise.`,ve)}else bn("receive-response",j)}function bn(j,ee){if(!vt||We===_.Off)return;let ve={isLSPMessage:!0,type:j,message:ee,timestamp:Date.now()};vt.log(ve)}function ar(){if(gi())throw new U(z.Closed,"Connection is closed.");if(dn())throw new U(z.Disposed,"Connection is disposed.")}function vi(){if(Wt())throw new U(z.AlreadyListening,"Connection is already listening")}function ni(){if(!Wt())throw Error("Call listen() first.")}function Ln(j){return j===void 0?null:j}function bi(j){if(j!==null)return j}function zn(j){return j!=null&&!Array.isArray(j)&&typeof j=="object"}function or(j,ee){switch(j){case o.ParameterStructures.auto:return zn(ee)?bi(ee):[Ln(ee)];case o.ParameterStructures.byName:if(!zn(ee))throw Error("Received parameters by name but param is not an object literal.");return bi(ee);case o.ParameterStructures.byPosition:return[Ln(ee)];default:throw Error(`Unknown parameter structure ${j.toString()}`)}}function M(j,ee){let ve,Ce=j.numberOfParams;switch(Ce){case 0:ve=void 0;break;case 1:ve=or(j.parameterStructures,ee[0]);break;default:ve=[];for(let ze=0;ze<ee.length&&ze<Ce;ze++)ve.push(Ln(ee[ze]));if(ee.length<Ce)for(let ze=ee.length;ze<Ce;ze++)ve.push(null);break}return ve}let Ye={sendNotification:(j,...ee)=>{ar();let ve,Ce;if(i.string(j)){ve=j;let Fe=ee[0],at=0,Ot=o.ParameterStructures.auto;o.ParameterStructures.is(Fe)&&(at=1,Ot=Fe);let Ze=ee.length,Pt=Ze-at;switch(Pt){case 0:Ce=void 0;break;case 1:Ce=or(Ot,ee[at]);break;default:if(Ot===o.ParameterStructures.byName)throw Error(`Received ${Pt} parameters for 'by Name' notification parameter structure.`);Ce=ee.slice(at,Ze).map(nt=>Ln(nt));break}}else{let Fe=ee;ve=j.method,Ce=M(j,Fe)}let ze={jsonrpc:"2.0",method:ve,params:Ce};return _r(ze),we.write(ze).catch(Fe=>{throw ie.error("Sending notification failed."),Fe})},onNotification:(j,ee)=>{ar();let ve;return i.func(j)?je=j:ee&&(i.string(j)?(ve=j,He.set(j,{type:void 0,handler:ee})):(ve=j.method,He.set(j.method,{type:j,handler:ee}))),{dispose:()=>{ve===void 0?je=void 0:He.delete(ve)}}},onProgress:(j,ee,ve)=>{if(Oe.has(ee))throw Error(`Progress handler for token ${ee} already registered`);return Oe.set(ee,ve),{dispose:()=>{Oe.delete(ee)}}},sendProgress:(j,ee,ve)=>Ye.sendNotification(y.type,{token:ee,value:ve}),onUnhandledProgress:tn.event,sendRequest:(j,...ee)=>{ar(),ni();let ve,Ce,ze;if(i.string(j)){ve=j;let Ze=ee[0],Pt=ee[ee.length-1],nt=0,ut=o.ParameterStructures.auto;o.ParameterStructures.is(Ze)&&(nt=1,ut=Ze);let wn=ee.length;d.CancellationToken.is(Pt)&&(--wn,ze=Pt);let sr=wn-nt;switch(sr){case 0:Ce=void 0;break;case 1:Ce=or(ut,ee[nt]);break;default:if(ut===o.ParameterStructures.byName)throw Error(`Received ${sr} parameters for 'by Name' request parameter structure.`);Ce=ee.slice(nt,wn).map(ri=>Ln(ri));break}}else{let Ze=ee;ve=j.method,Ce=M(j,Ze);let Pt=j.numberOfParams;ze=d.CancellationToken.is(Ze[Pt])?Ze[Pt]:void 0}let Fe=se++,at;ze&&(at=ze.onCancellationRequested(()=>{let Ze=On.sender.sendCancellation(Ye,Fe);return Ze===void 0?(ie.log(`Received no promise from cancellation strategy when cancelling id ${Fe}`),Promise.resolve()):Ze.catch(()=>{ie.log(`Sending cancellation messages for id ${Fe} failed`)})}));let Ot={jsonrpc:"2.0",id:Fe,method:ve,params:Ce};return jn(Ot),typeof On.sender.enableCancellation=="function"&&On.sender.enableCancellation(Ot),new Promise(async(Ze,Pt)=>{let nt={method:ve,timerStart:Date.now(),resolve:ut=>{Ze(ut),On.sender.cleanup(Fe),at==null||at.dispose()},reject:ut=>{Pt(ut),On.sender.cleanup(Fe),at==null||at.dispose()}};try{await we.write(Ot),qt.set(Fe,nt)}catch(ut){throw ie.error("Sending request failed."),nt.reject(new o.ResponseError(o.ErrorCodes.MessageWriteError,ut.message?ut.message:"Unknown reason")),ut}})},onRequest:(j,ee)=>{ar();let ve=null;return w.is(j)?(ve=void 0,$e=j):i.string(j)?(ve=null,ee!==void 0&&(ve=j,lt.set(j,{handler:ee,type:void 0}))):ee!==void 0&&(ve=j.method,lt.set(j.method,{type:j,handler:ee})),{dispose:()=>{ve!==null&&(ve===void 0?$e=void 0:lt.delete(ve))}}},hasPendingResponse:()=>qt.size>0,trace:async(j,ee,ve)=>{let Ce=!1,ze=E.Text;ve!==void 0&&(i.boolean(ve)?Ce=ve:(Ce=ve.sendNotification||!1,ze=ve.traceFormat||E.Text)),We=j,en=ze,vt=We===_.Off?void 0:ee,Ce&&!gi()&&!dn()&&await Ye.sendNotification(T.type,{value:_.toString(j)})},onError:vr.event,onClose:ft.event,onUnhandledNotification:zr.event,onDispose:hi.event,end:()=>{we.end()},dispose:()=>{if(dn())return;vn=fe.Disposed,hi.fire(void 0);let j=new o.ResponseError(o.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let ee of qt.values())ee.reject(j);qt=new Map,cn=new Map,Dn=new Set,yn=new s.LinkedMap,i.func(we.dispose)&&we.dispose(),i.func(J.dispose)&&J.dispose()},listen:()=>{ar(),vi(),vn=fe.Listening,J.listen(wr)},inspect:()=>{(0,n.default)().console.log("inspect")}};return Ye.onNotification(L.type,j=>{if(We===_.Off||!vt)return;let ee=We===_.Verbose||We===_.Compact;vt.log(j.message,ee?j.verbose:void 0)}),Ye.onNotification(y.type,j=>{let ee=Oe.get(j.token);ee?ee(j.value):tn.fire(j)}),Ye}e.createMessageConnection=be})),tc=Se((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=Md();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=Ld();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=I0();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=ec();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return c.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return c.CancellationToken}});var d=A0();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return d.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return d.SharedArrayReceiverStrategy}});var f=q0();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=j0();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=z0();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return y.AbstractMessageBuffer}});var w=F0();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=Qi().default})),B0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=tc(),i=class px extends n.AbstractMessageBuffer{constructor(y="utf-8"){super(y),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return px.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=Se((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,B0().default.install();var o=tc();i(tc(),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})),Id=Se(((e,n)=>{n.exports=ja()})),Ht=Se((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)}}})),nc=Se((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})),H0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var n=Ht(),i;(function(o){o.method="textDocument/implementation",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ImplementationRequest=i={}))})),V0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var n=Ht(),i;(function(o){o.method="textDocument/typeDefinition",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.TypeDefinitionRequest=i={}))})),$0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var n=Ht(),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={}))})),W0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var n=Ht(),i;(function(o){o.method="workspace/configuration",o.messageDirection=n.MessageDirection.serverToClient,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ConfigurationRequest=i={}))})),U0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var n=Ht(),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={}))})),K0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var n=Ht(),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={}))})),Q0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var n=Ht(),i;(function(o){o.method="textDocument/declaration",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.DeclarationRequest=i={}))})),G0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var n=Ht(),i;(function(o){o.method="textDocument/selectionRange",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.SelectionRangeRequest=i={}))})),J0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var n=ja(),i=Ht(),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={}))})),X0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var n=Ht(),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={}))})),Y0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var n=Ht(),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={}))})),Z0=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var n=Ht(),i;(function(o){o.method="window/showDocument",o.messageDirection=n.MessageDirection.serverToClient,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ShowDocumentRequest=i={}))})),eg=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var n=Ht(),i;(function(o){o.method="textDocument/linkedEditingRange",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.LinkedEditingRangeRequest=i={}))})),tg=Se((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=Ht(),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={}))})),ng=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var n=Ht(),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={}))})),rg=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var n=Ht(),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={}))})),ig=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var n=Ht(),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={}))})),ag=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var n=Ht(),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={}))})),og=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var n=ja(),i=nc(),o=Ht(),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={}))})),sg=Se((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=(Ch(),Ru(Sh)),i=nc(),o=Ht(),s;(function(T){T.Markup=1,T.Code=2;function L(z){return z===1||z===2}T.is=L})(s||(e.NotebookCellKind=s={}));var c;(function(T){function L($,I){let G={executionOrder:$};return(I===!0||I===!1)&&(G.success=I),G}T.create=L;function z($){let I=$;return i.objectLiteral(I)&&n.uinteger.is(I.executionOrder)&&(I.success===void 0||i.boolean(I.success))}T.is=z;function U($,I){return $===I?!0:$==null||I==null?!1:$.executionOrder===I.executionOrder&&$.success===I.success}T.equals=U})(c||(e.ExecutionSummary=c={}));var d;(function(T){function L(I,G){return{kind:I,document:G}}T.create=L;function z(I){let G=I;return i.objectLiteral(G)&&s.is(G.kind)&&n.DocumentUri.is(G.document)&&(G.metadata===void 0||i.objectLiteral(G.metadata))}T.is=z;function U(I,G){let pe=new Set;return I.document!==G.document&&pe.add("document"),I.kind!==G.kind&&pe.add("kind"),I.executionSummary!==G.executionSummary&&pe.add("executionSummary"),(I.metadata!==void 0||G.metadata!==void 0)&&!$(I.metadata,G.metadata)&&pe.add("metadata"),(I.executionSummary!==void 0||G.executionSummary!==void 0)&&!c.equals(I.executionSummary,G.executionSummary)&&pe.add("executionSummary"),pe}T.diff=U;function $(I,G){if(I===G)return!0;if(I==null||G==null||typeof I!=typeof G||typeof I!="object")return!1;let pe=Array.isArray(I),P=Array.isArray(G);if(pe!==P)return!1;if(pe&&P){if(I.length!==G.length)return!1;for(let A=0;A<I.length;A++)if(!$(I[A],G[A]))return!1}if(i.objectLiteral(I)&&i.objectLiteral(G)){let A=Object.keys(I),V=Object.keys(G);if(A.length!==V.length||(A.sort(),V.sort(),!$(A,V)))return!1;for(let de=0;de<A.length;de++){let fe=A[de];if(!$(I[fe],G[fe]))return!1}}return!0}})(d||(e.NotebookCell=d={}));var f;(function(T){function L(U,$,I,G){return{uri:U,notebookType:$,version:I,cells:G}}T.create=L;function z(U){let $=U;return i.objectLiteral($)&&i.string($.uri)&&n.integer.is($.version)&&i.typedArray($.cells,d.is)}T.is=z})(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 L(U){let $=U;return i.objectLiteral($)&&n.uinteger.is($.start)&&n.uinteger.is($.deleteCount)&&($.cells===void 0||i.typedArray($.cells,d.is))}T.is=L;function z(U,$,I){let G={start:U,deleteCount:$};return I!==void 0&&(G.cells=I),G}T.create=z})(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={}))})),lg=Se((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineCompletionRequest=void 0;var n=Ht(),i;(function(o){o.method="textDocument/inlineCompletion",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.InlineCompletionRequest=i={}))})),cg=Se((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=Ht(),i=(Ch(),Ru(Sh)),o=nc(),s=H0();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return s.ImplementationRequest}});var c=V0();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return c.TypeDefinitionRequest}});var d=$0();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return d.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return d.DidChangeWorkspaceFoldersNotification}});var f=W0();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return f.ConfigurationRequest}});var p=U0();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return p.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return p.ColorPresentationRequest}});var y=K0();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return y.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return y.FoldingRangeRefreshRequest}});var w=Q0();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return w.DeclarationRequest}});var _=G0();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return _.SelectionRangeRequest}});var C=J0();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=X0();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=Y0();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 L=Z0();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return L.ShowDocumentRequest}});var z=eg();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return z.LinkedEditingRangeRequest}});var U=tg();Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return U.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return U.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return U.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return U.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return U.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return U.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return U.WillDeleteFilesRequest}});var $=ng();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return $.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return $.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return $.MonikerRequest}});var I=rg();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return I.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return I.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return I.TypeHierarchySupertypesRequest}});var G=ig();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return G.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return G.InlineValueRefreshRequest}});var pe=ag();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=og();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=sg();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 V=lg();Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return V.InlineCompletionRequest}});var de;(function(M){function Ye(j){let ee=j;return o.string(ee)||o.string(ee.language)||o.string(ee.scheme)||o.string(ee.pattern)}M.is=Ye})(de||(e.TextDocumentFilter=de={}));var fe;(function(M){function Ye(j){let ee=j;return o.objectLiteral(ee)&&(o.string(ee.notebookType)||o.string(ee.scheme)||o.string(ee.pattern))}M.is=Ye})(fe||(e.NotebookDocumentFilter=fe={}));var be;(function(M){function Ye(j){let ee=j;return o.objectLiteral(ee)&&(o.string(ee.notebook)||fe.is(ee.notebook))&&(ee.language===void 0||o.string(ee.language))}M.is=Ye})(be||(e.NotebookCellTextDocumentFilter=be={}));var J;(function(M){function Ye(j){if(!Array.isArray(j))return!1;for(let ee of j)if(!o.string(ee)&&!de.is(ee)&&!be.is(ee))return!1;return!0}M.is=Ye})(J||(e.DocumentSelector=J={}));var we;(function(M){M.method="client/registerCapability",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(we||(e.RegistrationRequest=we={}));var Ee;(function(M){M.method="client/unregisterCapability",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(Ee||(e.UnregistrationRequest=Ee={}));var ne;(function(M){M.Create="create",M.Rename="rename",M.Delete="delete"})(ne||(e.ResourceOperationKind=ne={}));var ie;(function(M){M.Abort="abort",M.Transactional="transactional",M.TextOnlyTransactional="textOnlyTransactional",M.Undo="undo"})(ie||(e.FailureHandlingKind=ie={}));var se;(function(M){M.UTF8="utf-8",M.UTF16="utf-16",M.UTF32="utf-32"})(se||(e.PositionEncodingKind=se={}));var K;(function(M){function Ye(j){let ee=j;return ee&&o.string(ee.id)&&ee.id.length>0}M.hasId=Ye})(K||(e.StaticRegistrationOptions=K={}));var Le;(function(M){function Ye(j){let ee=j;return ee&&(ee.documentSelector===null||J.is(ee.documentSelector))}M.is=Ye})(Le||(e.TextDocumentRegistrationOptions=Le={}));var $e;(function(M){function Ye(ee){let ve=ee;return o.objectLiteral(ve)&&(ve.workDoneProgress===void 0||o.boolean(ve.workDoneProgress))}M.is=Ye;function j(ee){let ve=ee;return ve&&o.boolean(ve.workDoneProgress)}M.hasWorkDoneProgress=j})($e||(e.WorkDoneProgressOptions=$e={}));var lt;(function(M){M.method="initialize",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(lt||(e.InitializeRequest=lt={}));var je;(function(M){M.unknownProtocolVersion=1})(je||(e.InitializeErrorCodes=je={}));var He;(function(M){M.method="initialized",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(He||(e.InitializedNotification=He={}));var Oe;(function(M){M.method="shutdown",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType0(M.method)})(Oe||(e.ShutdownRequest=Oe={}));var Ne;(function(M){M.method="exit",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType0(M.method)})(Ne||(e.ExitNotification=Ne={}));var yn;(function(M){M.method="workspace/didChangeConfiguration",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(yn||(e.DidChangeConfigurationNotification=yn={}));var qt;(function(M){M.Error=1,M.Warning=2,M.Info=3,M.Log=4,M.Debug=5})(qt||(e.MessageType=qt={}));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 cn;(function(M){M.method="window/showMessageRequest",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(cn||(e.ShowMessageRequest=cn={}));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 en;(function(M){M.method="telemetry/event",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(en||(e.TelemetryEventNotification=en={}));var vt;(function(M){M.None=0,M.Full=1,M.Incremental=2})(vt||(e.TextDocumentSyncKind=vt={}));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(ee){let ve=ee;return ve!=null&&typeof ve.text=="string"&&ve.range!==void 0&&(ve.rangeLength===void 0||typeof ve.rangeLength=="number")}M.isIncremental=Ye;function j(ee){let ve=ee;return ve!=null&&typeof ve.text=="string"&&ve.range===void 0&&ve.rangeLength===void 0}M.isFull=j})(vr||(e.TextDocumentContentChangeEvent=vr={}));var ft;(function(M){M.method="textDocument/didChange",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(ft||(e.DidChangeTextDocumentNotification=ft={}));var zr;(function(M){M.method="textDocument/didClose",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(zr||(e.DidCloseTextDocumentNotification=zr={}));var tn;(function(M){M.method="textDocument/didSave",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(tn||(e.DidSaveTextDocumentNotification=tn={}));var hi;(function(M){M.Manual=1,M.AfterDelay=2,M.FocusOut=3})(hi||(e.TextDocumentSaveReason=hi={}));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 un;(function(M){M.Created=1,M.Changed=2,M.Deleted=3})(un||(e.FileChangeType=un={}));var ea;(function(M){function Ye(j){let ee=j;return o.objectLiteral(ee)&&(i.URI.is(ee.baseUri)||i.WorkspaceFolder.is(ee.baseUri))&&o.string(ee.pattern)}M.is=Ye})(ea||(e.RelativePattern=ea={}));var mi;(function(M){M.Create=1,M.Change=2,M.Delete=4})(mi||(e.WatchKind=mi={}));var Wt;(function(M){M.method="textDocument/publishDiagnostics",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(Wt||(e.PublishDiagnosticsNotification=Wt={}));var gi;(function(M){M.Invoked=1,M.TriggerCharacter=2,M.TriggerForIncompleteCompletions=3})(gi||(e.CompletionTriggerKind=gi={}));var dn;(function(M){M.method="textDocument/completion",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(dn||(e.CompletionRequest=dn={}));var ti;(function(M){M.method="completionItem/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ti||(e.CompletionResolveRequest=ti={}));var jt;(function(M){M.method="textDocument/hover",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(jt||(e.HoverRequest=jt={}));var Fr;(function(M){M.Invoked=1,M.TriggerCharacter=2,M.ContentChange=3})(Fr||(e.SignatureHelpTriggerKind=Fr={}));var bt;(function(M){M.method="textDocument/signatureHelp",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(bt||(e.SignatureHelpRequest=bt={}));var yi;(function(M){M.method="textDocument/definition",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(yi||(e.DefinitionRequest=yi={}));var ta;(function(M){M.method="textDocument/references",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ta||(e.ReferencesRequest=ta={}));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 Gt;(function(M){M.method="textDocument/documentSymbol",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Gt||(e.DocumentSymbolRequest=Gt={}));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 ht;(function(M){M.method="codeAction/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ht||(e.CodeActionResolveRequest=ht={}));var wt;(function(M){M.method="workspace/symbol",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(wt||(e.WorkspaceSymbolRequest=wt={}));var _t;(function(M){M.method="workspaceSymbol/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(_t||(e.WorkspaceSymbolResolveRequest=_t={}));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 xt;(function(M){M.method="workspace/codeLens/refresh",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType0(M.method)})(xt||(e.CodeLensRefreshRequest=xt={}));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 Br;(function(M){M.method="textDocument/formatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Br||(e.DocumentFormattingRequest=Br={}));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 vi;(function(M){M.method="textDocument/onTypeFormatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(vi||(e.DocumentOnTypeFormattingRequest=vi={}));var ni;(function(M){M.Identifier=1})(ni||(e.PrepareSupportDefaultBehavior=ni={}));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 bi;(function(M){M.method="textDocument/prepareRename",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(bi||(e.PrepareRenameRequest=bi={}));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={}))})),ug=Se((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})),dg=Se((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((Ch(),Ru(Sh)),e),i(Ht(),e),i(cg(),e);var o=ug();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={}))})),Wu=Se((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=Id();i(Id(),e),i(dg(),e);function s(c,d,f,p){return(0,o.createMessageConnection)(c,d,f,p)}e.createProtocolConnection=s}));function gn(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 gn(e,n)||0}function Gi(e,n){let i=e.lineAt(n);return{character:n-i.from,line:i.number-1}}var rc=new _w.Renderer,Qx=rc.code;rc.code=e=>e.text.trim()?Qx.call(rc,e):"";function fg(e){return _w(e,{async:!1,gfm:!0,breaks:!0,renderer:rc})}function Ar(e,n=fg){if(!e)return"";if(Yx(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
- `):typeof e=="string"?e:""}function Qx(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 Gx(e){if(e.length===0)return;let n=Qx(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 Jx(e){return(e==null?void 0:e.range)!==void 0}function Xx(e){return e.kind!==void 0}function tr(e,n){let i=document.createElement("div");i.className="cm-error-message",i.style.cssText=`
48
+ `):typeof e=="string"?e:""}function Gx(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 Jx(e){if(e.length===0)return;let n=Gx(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 Xx(e){return(e==null?void 0:e.range)!==void 0}function Yx(e){return e.kind!==void 0}function tr(e,n){let i=document.createElement("div");i.className="cm-error-message",i.style.cssText=`
49
49
  position: absolute;
50
50
  padding: 8px;
51
51
  background: #fee;
@@ -56,24 +56,24 @@ ${JSON.stringify(j,null,4)}`);let ee=j;if(i.string(ee.id)||i.number(ee.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 ic(e){if(e==null)return!0;if(Array.isArray(e))return e.length===0||e.every(ic);if(typeof e=="string")return fg(e);let n=e.value;return typeof n=="string"?fg(n):!1}function fg(e){return e==null?!0:typeof e=="string"?e.trim()===""||/^[\s\n`]*$/.test(e):!1}function Yx(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=Gi(e,o),w=Gi(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 Zx=Wu(),ek=Object.fromEntries(Object.entries(Zx.CompletionItemKind).map(([e,n])=>[n,e])),pg;(function(e){e.PlainText=1,e.Snippet=2})(pg||(pg={}));function tk(e){return e.replaceAll(/\\\\/g,"").replaceAll(/(\$(\d+))/g,(n,i,o)=>"${"+o+"}")}function nk(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,L){if(d&&Jx(d)?C.dispatch(gw(C.state,d.newText,Ir(C.state.doc,d.range.start),Ir(C.state.doc,d.range.end))):f&&w===pg.Snippet&&n.useSnippetOnCompletion?tD(tk(f))(C,null,T,L):C.dispatch(gw(C.state,s,T,L)),!y)return;let z=y.sort(({range:{end:U}},{range:{end:$}})=>Ir(C.state.doc,U)<Ir(C.state.doc,$)?1:Ir(C.state.doc,U)>Ir(C.state.doc,$)?-1:0);for(let U of z)C.dispatch(C.state.update({changes:{from:Ir(C.state.doc,U.range.start),to:gn(C.state.doc,U.range.end),insert:U.newText}}))},type:c&&ek[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 L=(E==null?void 0:E.documentation)||p;return!L||ic(L)?null:(n.allowHTMLContent?T.innerHTML=Ar(L,n.markdownRenderer):T.textContent=Ar(L,n.markdownRenderer),T)}catch(E){if(console.error("Failed to resolve completion item:",E),ic(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 rk(e,n,i){let o=[n?ik(n):ak,i==="python"?ok: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 ik(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 ak(e,n){let i=e.sortText??e.label,o=n.sortText??n.label;return i.localeCompare(o)}function ok(e,n){let i=e.label.endsWith("="),o=n.label.endsWith("=");return i&&!o?-1:!i&&o?1:0}function hg(e){let n=new Proxy({},{get(){throw Error(e)}});return function(i){return i.at(-1)??n}}const mg=Pl.define({combine:hg("No document URI provided. Either pass a one into the extension or use documentUri.of().")}),sk=Pl.define({combine:hg("No language ID provided. Either pass a one into the extension or use languageId.of().")});let Ad,gg;Ad=Ql(),gg=1e4,ql=class{constructor({rootUri:e,workspaceFolders:n,transport:i,initializationOptions:o,capabilities:s,timeout:c=gg,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 Ad.RequestManager([this.transport]),this.client=new Ad.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))}},Ql();var Ji=Wu(),yg=console.log;function lk(){return String(Date.now()+Math.random())}let qd;Vl=Fi.define(),jl=xs.define({create:()=>null,update(e,n){for(let i of n.effects)if(i.is(Vl))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=>v4.from(e)}),qd=x4.define();var ck=20,uk=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=dg}=e;this.documentVersion=0,this.pluginId=lk(),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(Yx(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=gn(e.state.doc,{line:n,character:i}),f;if(c&&(d=gn(e.state.doc,c.start),f=gn(e.state.doc,c.end)),d==null||ic(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=Gx(d),p=f?e.matchBefore(f):e.matchBefore(/[a-zA-Z0-9]+/),{pos:y}=e,w=rk(d,p==null?void 0:p.text,this.languageId);p&&(y=p.from);let _=w.map(E=>{var T,L;return nk(E,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:((L=(T=this.client.capabilities)==null?void 0:T.completionProvider)==null?void 0:L.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:gn(e.state.doc,f.end)}})),this.onGoToDefinition&&this.onGoToDefinition(y),y}processNotification(e){try{e.method==="textDocument/publishDiagnostics"&&this.processDiagnostics(e.params)}catch(n){yg(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={[Ji.DiagnosticSeverity.Error]:"error",[Ji.DiagnosticSeverity.Warning]:"warning",[Ji.DiagnosticSeverity.Information]:"info",[Ji.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 L of T)this.view.dispatch(this.view.state.update({changes:{from:Ir(this.view.state.doc,L.range.start),to:gn(this.view.state.doc,L.range.end),insert:L.newText}}))}"command"in _&&_.command&&yg("Executing command:",_.command)}}});return{from:Ir(this.view.state.doc,s.start),to:Ir(this.view.state.doc,s.end),severity:n[d??Ji.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=[];W4(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(pw(n,[...s,...e]))}clearDiagnostics(){this.view.dispatch(pw(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){tr(e,"Language server not ready");return}if(!((o=this.client.capabilities)!=null&&o.renameProvider)){tr(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){tr(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=gn(e.state.doc,f.start);if(p==null)return;let y=gn(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){tr(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){tr(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){tr(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=gn(e.state.doc,{line:n,character:i});return T==null?null:{pos:T,end:T,create:L=>({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,Gi(e.state.doc,n),i);e.dispatch({effects:Vl.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 tr(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 tr(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){tr(e,"Multi-file rename not supported yet");continue}let c=s.edits.sort((d,f)=>{let p=gn(e.state.doc,d.range.start);return(gn(e.state.doc,f.range.start)??0)-(p??0)}).map(d=>({from:gn(e.state.doc,d.range.start)??0,to:gn(e.state.doc,d.range.end)??0,insert:d.newText}));return e.dispatch(e.state.update({changes:c})),!0}return tr(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){tr(e,"Multi-file rename not supported yet");continue}let d=c.sort((f,p)=>{let y=gn(e.state.doc,f.range.start);return(gn(e.state.doc,p.range.start)??0)-(y??0)}).map(f=>({from:gn(e.state.doc,f.range.start)??0,to:gn(e.state.doc,f.range.end)??0,insert:f.newText}));e.dispatch(e.state.update({changes:d}))}return!1}};Pm=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=[Ml.define(f=>(n=new uk({client:o,documentUri:e.documentUri??f.state.facet(mg),languageId:e.languageId??f.state.facet(sk),view:f,featureOptions:s,sendIncrementalChanges:e.sendIncrementalChanges,allowHTMLContent:e.allowHTMLContent,useSnippetOnCompletion:e.useSnippetOnCompletion,onGoToDefinition:e.onGoToDefinition,markdownRenderer:e.markdownRenderer}),n))];if(c.push(Ta.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,Gi(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,Gi(f.state.doc,p)).catch(y=>tr(f,`Go to definition failed: ${y instanceof Error?y.message:"Unknown error"}`)),!0}}])),s.hoverEnabled&&c.push(_h((f,p)=>n==null?null:n.requestHoverTooltip(f,Gi(f.state.doc,p)),e.hoverConfig)),s.signatureHelpEnabled){c.push(jl);let f=p=>{p.state.field(jl)&&p.dispatch({effects:Vl.of(null)})};c.push(Ut.domEventHandlers({mousedown:(p,y)=>(f(y),!1)})),c.push(Ta.of([{key:")",run:p=>(f(p),!1)},{key:"Escape",run:p=>(f(p),!0)}])),c.push(Ut.updateListener.of(p=>{if(!(n&&s.signatureActivateOnTyping)||!p.state.field(jl)||!(p.selectionSet||p.docChanged))return;let y=p.state.selection.main.head;hk(p.state.doc,y)||f(p.view)})),c.push(Ut.updateListener.of(async p=>{var E;if(!(n&&p.docChanged)||p.transactions.some(T=>T.annotation(qd))||!((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,L,z,U,$)=>{if(_>=0)return;let I=fk($.toString(),z,y);I&&(_=I.triggerPos,C=I.triggerCharacter)}),_>=0&&n.showSignatureHelpTooltip(p.view,_,C)}))}return s.completionEnabled&&c.push(Nu({...e.completionConfig,override:[async f=>{var _,C;if(n==null)return null;let{state:p,pos:y}=f,w=dk(f,((C=(_=n.client.capabilities)==null?void 0:_.completionProvider)==null?void 0:C.triggerCharacters)??[],e.completionMatchBefore);return w==null?null:await n.requestCompletion(f,Gi(p.doc,y),w)},...((d=e.completionConfig)==null?void 0:d.override)||[]]})),c.push(Ut.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,Gi(p.state.doc,y)).catch(w=>tr(p,`Go to definition failed: ${w instanceof Error?w.message:"Unknown error"}`)),f.preventDefault())}}})),c};function dk(e,n,i){let{state:o,pos:s,explicit:c}=e,d=o.doc.lineAt(s),f=Ji.CompletionTriggerKind.Invoked,p,y=d.text[s-d.from-1]||"",w=n==null?void 0:n.includes(y);return!c&&w&&(f=Ji.CompletionTriggerKind.TriggerCharacter,p=y),f===Ji.CompletionTriggerKind.Invoked&&!e.matchBefore(i||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:f,triggerCharacter:p}}function fk(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 pk(e){let n=0;for(let i of e)i==="("?n++:i===")"&&n--;return n}function hk(e,n,i=ck){let o=e.lineAt(n),s=Math.max(1,o.number-i),c=e.line(s).from;return pk(e.sliceString(c,n))>0}zu=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:qd.of(!0),selection:{anchor:C},effects:s,userEvent:c})}else e.dispatch({changes:{from:0,to:d.length,insert:n},effects:s,userEvent:c})},xo=function(){return Pl.define({combine:e=>e[0]})};const vg=xo(),bg=xo(),jd=xo(),zd=xo(),wg=xo();rx=function({completionConfig:e,hotkeys:n,placeholderType:i,lspConfig:o,diagnosticsConfig:s}){return[vg.of(e),bg.of(n),jd.of(i),wg.of({...o,diagnostics:s})]},Yu=new Mu;function mk(e){return Object.values(e.cellRuntime).some(n=>n.status==="running")}function gk(e){return Object.values(e.cellRuntime).filter(n=>n.status==="running"||n.status==="queued").length}function yk(e){return Lm(e).length>0}Z_=function(e){return e.cellIds.inOrderIds.map(n=>e.cellData[n])};function vk({cellHandles:e}){let n={};for(let[i,o]of ci.entries(e))o.current&&(n[i]=o.current.editorView);return n}xm=function(e){let{cellIds:n,cellData:i}=e,o=[];for(let s of n.inOrderIds)i[s].config.disabled&&o.push(s);return o},mm=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 bk(e){return e.history.length>0}C_=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"})}},Lm=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.inOrderIds.filter(s=>um({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))},um=function({executionTime:e,status:n,errored:i,interrupted:o,stopped:s}){return e===null&&n!=="queued"&&n!=="running"&&!(i||o||s)},Dt=Pl.define({combine:e=>e[0]}),La=Pl.define({combine:e=>e[0]});var wk={...Eh,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"};const _g=Th.define(wk),xg=Th.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 _k=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 _k.has(e)}function kg(e){let n=e.dialect;if(!ac(n))return Re.debug("Unknown dialect",{dialect:n}),Ds;switch(n){case"postgresql":case"postgres":return Eh;case"mysql":return oD;case"sqlite":return iD;case"mssql":case"sqlserver":case"microsoft sql server":return lD;case"duckdb":return xg;case"mariadb":return cD;case"cassandra":return uD;case"oracledb":case"oracle":return rD;case"bigquery":return _g;case"timescaledb":return Eh;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 Re.debug("Unsupported dialect",{dialect:n}),Ds;default:return _s(n),Ds}}var xk={...sD,caseInsensitiveIdentifiers:!0,identifierQuotes:"'"};let Ds;Ds=Th.define(xk),$i="__marimo_duckdb",ko=new Set([$i]),L_="memory",Xl=function(e){return e===""};var Os={formatTableName:e=>e,formatSelectClause:(e,n)=>`SELECT ${e} FROM ${n} LIMIT 100`};function kk(e){if(e=e.toLowerCase(),!ac(e))return Os;switch(e){case"bigquery":{let n=_g.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;Xl(s)?y=f===d?y:`${f}.${y}`:(s!==c&&(y=`${s}.${y}`),f!==d&&(y=`${f}.${y}`));let w=kk(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 ic(e){if(e==null)return!0;if(Array.isArray(e))return e.length===0||e.every(ic);if(typeof e=="string")return pg(e);let n=e.value;return typeof n=="string"?pg(n):!1}function pg(e){return e==null?!0:typeof e=="string"?e.trim()===""||/^[\s\n`]*$/.test(e):!1}function Zx(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=Gi(e,o),w=Gi(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 ek=Wu(),tk=Object.fromEntries(Object.entries(ek.CompletionItemKind).map(([e,n])=>[n,e])),hg;(function(e){e.PlainText=1,e.Snippet=2})(hg||(hg={}));function nk(e){return e.replaceAll(/\\\\/g,"").replaceAll(/(\$(\d+))/g,(n,i,o)=>"${"+o+"}")}function rk(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,L){if(d&&Xx(d)?C.dispatch(vw(C.state,d.newText,Ir(C.state.doc,d.range.start),Ir(C.state.doc,d.range.end))):f&&w===hg.Snippet&&n.useSnippetOnCompletion?nD(nk(f))(C,null,T,L):C.dispatch(vw(C.state,s,T,L)),!y)return;let z=y.sort(({range:{end:U}},{range:{end:$}})=>Ir(C.state.doc,U)<Ir(C.state.doc,$)?1:Ir(C.state.doc,U)>Ir(C.state.doc,$)?-1:0);for(let U of z)C.dispatch(C.state.update({changes:{from:Ir(C.state.doc,U.range.start),to:gn(C.state.doc,U.range.end),insert:U.newText}}))},type:c&&tk[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 L=(E==null?void 0:E.documentation)||p;return!L||ic(L)?null:(n.allowHTMLContent?T.innerHTML=Ar(L,n.markdownRenderer):T.textContent=Ar(L,n.markdownRenderer),T)}catch(E){if(console.error("Failed to resolve completion item:",E),ic(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 ik(e,n,i){let o=[n?ak(n):ok,i==="python"?sk: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 ak(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 ok(e,n){let i=e.sortText??e.label,o=n.sortText??n.label;return i.localeCompare(o)}function sk(e,n){let i=e.label.endsWith("="),o=n.label.endsWith("=");return i&&!o?-1:!i&&o?1:0}function mg(e){let n=new Proxy({},{get(){throw Error(e)}});return function(i){return i.at(-1)??n}}const gg=Pl.define({combine:mg("No document URI provided. Either pass a one into the extension or use documentUri.of().")}),lk=Pl.define({combine:mg("No language ID provided. Either pass a one into the extension or use languageId.of().")});let Ad,yg;Ad=Ql(),yg=1e4,ql=class{constructor({rootUri:e,workspaceFolders:n,transport:i,initializationOptions:o,capabilities:s,timeout:c=yg,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 Ad.RequestManager([this.transport]),this.client=new Ad.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))}},Ql();var Ji=Wu(),vg=console.log;function ck(){return String(Date.now()+Math.random())}let qd;Vl=Fi.define(),jl=xs.define({create:()=>null,update(e,n){for(let i of n.effects)if(i.is(Vl))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=>b4.from(e)}),qd=k4.define();var uk=20,dk=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=fg}=e;this.documentVersion=0,this.pluginId=ck(),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(Zx(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=gn(e.state.doc,{line:n,character:i}),f;if(c&&(d=gn(e.state.doc,c.start),f=gn(e.state.doc,c.end)),d==null||ic(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=Jx(d),p=f?e.matchBefore(f):e.matchBefore(/[a-zA-Z0-9]+/),{pos:y}=e,w=ik(d,p==null?void 0:p.text,this.languageId);p&&(y=p.from);let _=w.map(E=>{var T,L;return rk(E,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:((L=(T=this.client.capabilities)==null?void 0:T.completionProvider)==null?void 0:L.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:gn(e.state.doc,f.end)}})),this.onGoToDefinition&&this.onGoToDefinition(y),y}processNotification(e){try{e.method==="textDocument/publishDiagnostics"&&this.processDiagnostics(e.params)}catch(n){vg(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={[Ji.DiagnosticSeverity.Error]:"error",[Ji.DiagnosticSeverity.Warning]:"warning",[Ji.DiagnosticSeverity.Information]:"info",[Ji.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 L of T)this.view.dispatch(this.view.state.update({changes:{from:Ir(this.view.state.doc,L.range.start),to:gn(this.view.state.doc,L.range.end),insert:L.newText}}))}"command"in _&&_.command&&vg("Executing command:",_.command)}}});return{from:Ir(this.view.state.doc,s.start),to:Ir(this.view.state.doc,s.end),severity:n[d??Ji.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=[];U4(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(mw(n,[...s,...e]))}clearDiagnostics(){this.view.dispatch(mw(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){tr(e,"Language server not ready");return}if(!((o=this.client.capabilities)!=null&&o.renameProvider)){tr(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){tr(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=gn(e.state.doc,f.start);if(p==null)return;let y=gn(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){tr(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){tr(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){tr(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=gn(e.state.doc,{line:n,character:i});return T==null?null:{pos:T,end:T,create:L=>({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,Gi(e.state.doc,n),i);e.dispatch({effects:Vl.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 tr(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 tr(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){tr(e,"Multi-file rename not supported yet");continue}let c=s.edits.sort((d,f)=>{let p=gn(e.state.doc,d.range.start);return(gn(e.state.doc,f.range.start)??0)-(p??0)}).map(d=>({from:gn(e.state.doc,d.range.start)??0,to:gn(e.state.doc,d.range.end)??0,insert:d.newText}));return e.dispatch(e.state.update({changes:c})),!0}return tr(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){tr(e,"Multi-file rename not supported yet");continue}let d=c.sort((f,p)=>{let y=gn(e.state.doc,f.range.start);return(gn(e.state.doc,p.range.start)??0)-(y??0)}).map(f=>({from:gn(e.state.doc,f.range.start)??0,to:gn(e.state.doc,f.range.end)??0,insert:f.newText}));e.dispatch(e.state.update({changes:d}))}return!1}};Mm=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=[Ml.define(f=>(n=new dk({client:o,documentUri:e.documentUri??f.state.facet(gg),languageId:e.languageId??f.state.facet(lk),view:f,featureOptions:s,sendIncrementalChanges:e.sendIncrementalChanges,allowHTMLContent:e.allowHTMLContent,useSnippetOnCompletion:e.useSnippetOnCompletion,onGoToDefinition:e.onGoToDefinition,markdownRenderer:e.markdownRenderer}),n))];if(c.push(Ta.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,Gi(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,Gi(f.state.doc,p)).catch(y=>tr(f,`Go to definition failed: ${y instanceof Error?y.message:"Unknown error"}`)),!0}}])),s.hoverEnabled&&c.push(_h((f,p)=>n==null?null:n.requestHoverTooltip(f,Gi(f.state.doc,p)),e.hoverConfig)),s.signatureHelpEnabled){c.push(jl);let f=p=>{p.state.field(jl)&&p.dispatch({effects:Vl.of(null)})};c.push(Ut.domEventHandlers({mousedown:(p,y)=>(f(y),!1)})),c.push(Ta.of([{key:")",run:p=>(f(p),!1)},{key:"Escape",run:p=>(f(p),!0)}])),c.push(Ut.updateListener.of(p=>{if(!(n&&s.signatureActivateOnTyping)||!p.state.field(jl)||!(p.selectionSet||p.docChanged))return;let y=p.state.selection.main.head;mk(p.state.doc,y)||f(p.view)})),c.push(Ut.updateListener.of(async p=>{var E;if(!(n&&p.docChanged)||p.transactions.some(T=>T.annotation(qd))||!((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,L,z,U,$)=>{if(_>=0)return;let I=pk($.toString(),z,y);I&&(_=I.triggerPos,C=I.triggerCharacter)}),_>=0&&n.showSignatureHelpTooltip(p.view,_,C)}))}return s.completionEnabled&&c.push(Nu({...e.completionConfig,override:[async f=>{var _,C;if(n==null)return null;let{state:p,pos:y}=f,w=fk(f,((C=(_=n.client.capabilities)==null?void 0:_.completionProvider)==null?void 0:C.triggerCharacters)??[],e.completionMatchBefore);return w==null?null:await n.requestCompletion(f,Gi(p.doc,y),w)},...((d=e.completionConfig)==null?void 0:d.override)||[]]})),c.push(Ut.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,Gi(p.state.doc,y)).catch(w=>tr(p,`Go to definition failed: ${w instanceof Error?w.message:"Unknown error"}`)),f.preventDefault())}}})),c};function fk(e,n,i){let{state:o,pos:s,explicit:c}=e,d=o.doc.lineAt(s),f=Ji.CompletionTriggerKind.Invoked,p,y=d.text[s-d.from-1]||"",w=n==null?void 0:n.includes(y);return!c&&w&&(f=Ji.CompletionTriggerKind.TriggerCharacter,p=y),f===Ji.CompletionTriggerKind.Invoked&&!e.matchBefore(i||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:f,triggerCharacter:p}}function pk(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 hk(e){let n=0;for(let i of e)i==="("?n++:i===")"&&n--;return n}function mk(e,n,i=uk){let o=e.lineAt(n),s=Math.max(1,o.number-i),c=e.line(s).from;return hk(e.sliceString(c,n))>0}zu=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:qd.of(!0),selection:{anchor:C},effects:s,userEvent:c})}else e.dispatch({changes:{from:0,to:d.length,insert:n},effects:s,userEvent:c})},xo=function(){return Pl.define({combine:e=>e[0]})};const bg=xo(),wg=xo(),jd=xo(),zd=xo(),_g=xo();ix=function({completionConfig:e,hotkeys:n,placeholderType:i,lspConfig:o,diagnosticsConfig:s}){return[bg.of(e),wg.of(n),jd.of(i),_g.of({...o,diagnostics:s})]},Yu=new Mu;function gk(e){return Object.values(e.cellRuntime).some(n=>n.status==="running")}function yk(e){return Object.values(e.cellRuntime).filter(n=>n.status==="running"||n.status==="queued").length}function vk(e){return Nm(e).length>0}ex=function(e){return e.cellIds.inOrderIds.map(n=>e.cellData[n])};function bk({cellHandles:e}){let n={};for(let[i,o]of ci.entries(e))o.current&&(n[i]=o.current.editorView);return n}xm=function(e){let{cellIds:n,cellData:i}=e,o=[];for(let s of n.inOrderIds)i[s].config.disabled&&o.push(s);return o},mm=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 wk(e){return e.history.length>0}T_=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"})}},Nm=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.inOrderIds.filter(s=>um({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))},um=function({executionTime:e,status:n,errored:i,interrupted:o,stopped:s}){return e===null&&n!=="queued"&&n!=="running"&&!(i||o||s)},Dt=Pl.define({combine:e=>e[0]}),La=Pl.define({combine:e=>e[0]});var _k={...Eh,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"};const xg=Th.define(_k),kg=Th.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 xk=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 xk.has(e)}function Sg(e){let n=e.dialect;if(!ac(n))return Re.debug("Unknown dialect",{dialect:n}),Ds;switch(n){case"postgresql":case"postgres":return Eh;case"mysql":return sD;case"sqlite":return aD;case"mssql":case"sqlserver":case"microsoft sql server":return cD;case"duckdb":return kg;case"mariadb":return uD;case"cassandra":return dD;case"oracledb":case"oracle":return iD;case"bigquery":return xg;case"timescaledb":return Eh;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 Re.debug("Unsupported dialect",{dialect:n}),Ds;default:return _s(n),Ds}}var kk={...lD,caseInsensitiveIdentifiers:!0,identifierQuotes:"'"};let Ds;Ds=Th.define(kk),$i="__marimo_duckdb",ko=new Set([$i]),I_="memory",Xl=function(e){return e===""};var Os={formatTableName:e=>e,formatSelectClause:(e,n)=>`SELECT ${e} FROM ${n} LIMIT 100`};function Sk(e){if(e=e.toLowerCase(),!ac(e))return Os;switch(e){case"bigquery":{let n=xg.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}}v_=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;Xl(s)?y=f===d?y:`${f}.${y}`:(s!==c&&(y=`${s}.${y}`),f!==d&&(y=`${f}.${y}`));let w=Sk(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')`},B_=function(e,n){if(n==="date"||n==="datetime"||n==="time"){if(e==="min")return"Earliest";if(e==="max")return"Latest"}return e};function Sk(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:AD,createActions:qD,valueAtom:Sg,useActions:Ck}=Nl(Sk,{addDatasets:(e,n)=>{let{previewDatasetColumn:i}=Hi();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}}});D_=()=>Yn(Sg),ad=Be(e=>e(Sg).tables),K_=Be(new Set),X_=Be(!1),c_=function(){return Ck()};var Ek=new Map([[$i,{name:$i,dialect:"duckdb",source:"duckdb",display_name:"DuckDB (In-Memory)",databases:[]}]]);function Tk(){return{latestEngineSelected:$i,connectionsMap:Ek}}let Rk,Dk;({reducer:Rk,createActions:Dk,valueAtom:_o,useActions:b_}=Nl(Tk,{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}}})),Gu=Be(e=>e(_o).connectionsMap);function Cg(e){let n=ct.get(_o);n.connectionsMap.has(e)&&ct.set(_o,{...n,latestEngineSelected:e})}n_=Be(e=>{let n=ct.get(ad),i=e(_o).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=Xl(f.name);for(let w of f.tables){let _;if(_=w.name,y){_=d?w.name:`${c.name}.${w.name}`,o.has(_)?Re.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(_)?Re.warn(`Table name collision for ${_}. Skipping.`):o.set(_,w)}}}return o}),Cw=function(e){return e.variable_name?"dataframe":"table"};let Ps,Fd,Eg,Bd,Tg,Rg,Hd,Dg;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)}},sm=Ct("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"}]]),zh=Ct("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"}]]),Cm=Ct("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"}]]),Fh=Ct("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"}]]),Ih=Ct("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=Ct("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"}]]),am=Ct("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"}]]),tm=Ct("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"}]]),Ah=Ct("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Eg=Ct("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"}]]),rm=Ct("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),Bd=Ct("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=Ct("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"}]]),pd=Ct("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"}]]),Yh=Ct("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"}]]),Tg=Ct("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"}]]),$u=Ct("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Rg=Ct("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"}]]),wo=Ct("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=Ct("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"}]]),Gh=Ct("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"}]]),Uh=Ct("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"}]]),Vh=Ct("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=Ct("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"}]]),Dg=Ct("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"}]]),ym=Ct("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"}]]),bo=Ct("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"}]]),bm=Ct("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=Ct("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 Og(e){let[n,i]=e.split(" ");return i?`${Al(n)} ${i}`:Al(e)}Ku={boolean:c4,date:l4,time:Ah,datetime:Fd,temporal:Fd,number:vh,string:u4,integer:vh,unknown:Ih},Lw=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,Pg,Vd,Mg,Lo,Lg,Ng,Ig,Ag,qg,No,Zr,za,fi,$d;Da=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`}},tx=class px{constructor(n){this.words=n}static of(...n){return new px(n.map(i=>typeof i=="string"?new Da(i):i))}join(n,i){return this.words.map(o=>o.pluralize(i)).join(n)}},Ms=Gr(),B=yh(g4(),1),Pg=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)]"},Mg={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",Lg=new Da("column","columns"),Ng=new Da("row","rows"),Ig=new Da("schema","schemas"),Ag=new Da("table","tables"),qg=new Da("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},Zr=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},fi=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?Pg: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 Ok=e=>{var d,f;let n=e.type==="view"?(0,B.jsx)(pd,{className:"w-4 h-4 text-[var(--blue-9)]"}):(0,B.jsx)(bo,{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=Ku[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)(Zr,{label:"Source",value:(0,B.jsx)(mr,{variant:"outline",className:`text-xs ${Mg[e.source_type]}`,children:e.source})}),e.variable_name&&(0,B.jsx)(Zr,{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)(Zr,{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)(rm,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_columns} ${Lg.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,B.jsx)(za,{icon:(0,B.jsx)(vh,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_rows} ${Ng.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)(kD,{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)(zh,{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)(fi,{items:o,totalCount:e.columns.length})]})},Pk=e=>{var s;let n=Ku[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)(Zr,{label:"Type",value:(0,B.jsx)("span",{className:"font-medium",children:e.type})}),(0,B.jsx)(Zr,{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)(fi,{title:"Sample Values",items:o,totalCount:e.sample_values.length})]})},Mk=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)(wo,{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," ",Ag.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)(Zr,{label:"Dialect",value:(0,B.jsx)("span",{className:"font-medium",children:e.dialect})}),e.engine&&(0,B.jsx)(Zr,{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)(wo,{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)(fi,{title:"Schemas",items:i,totalCount:e.schemas.length})]})},Lk=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)(pd,{className:"w-3 h-3 text-[var(--blue-9)]"}):(0,B.jsx)(bo,{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)(wo,{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)(bo,{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)(fi,{title:"Tables",items:i,totalCount:e.tables.length})]})};var jg=(0,B.jsx)(mr,{variant:"outline",children:"default"}),Nk=8,zg=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<Nk&&(_=p.tables.slice(0,zg+1).map(C=>(0,B.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,B.jsx)(bo,{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)(wo,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{children:p.name}),w&&jg,(0,B.jsxs)(mr,{variant:"outline",className:"text-xs ml-auto",children:[p.tables.length," tables"]})]}),(0,B.jsx)(fi,{items:_,totalCount:p.tables.length,limit:zg})]},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&&jg]}),w&&(0,B.jsx)(fi,{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)(bo,{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)(Eg,{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)(Zr,{label:"Dialect",value:(0,B.jsx)("span",{className:"font-medium",children:Al(e.dialect)})}),(0,B.jsx)(Zr,{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} ${qg.pluralize(i)}`}),(0,B.jsx)(za,{icon:(0,B.jsx)(wo,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${o} ${Ig.pluralize(o)}`})]}),i>0&&(0,B.jsx)(fi,{items:c,totalCount:i}),f&&f.length>0&&(0,B.jsx)(fi,{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)($u,{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=ud(),Fg=class{constructor(){ke(this,"schema",{})}addTable(e,n){let i={self:Ak({table:n}),children:n.columns.map(o=>Ik({column:o}))};return this.setAt([...e,n.name],i),this}addSchema(e,n){let i={self:qk({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}addDatabase(e,n){let i={self:jk({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 Ik(e){return{label:e.column.name,type:"column",info:()=>{let n=document.createElement("div");return(0,sc.createRoot)(n).render(Pk(e.column)),{dom:n}}}}function Ak(e){return{label:e.table.name,type:"table",info:()=>{let n=document.createElement("div");return(0,sc.createRoot)(n).render(Ok(e.table)),{dom:n}}}}function qk(e){return{label:e.namespace.name,detail:e.path.join("."),type:"schema",info:()=>{let n=document.createElement("div");return(0,sc.createRoot)(n).render(Lk(e.namespace)),{dom:n}}}}function jk(e){return{label:e.namespace.name,detail:e.path.join("."),type:"database",info:()=>{let n=document.createElement("div");return(0,sc.createRoot)(n).render(Mk(e.namespace)),{dom:n}}}}var zk=Be(e=>{let n=e(ad),i=new Fg;for(let o of n)i.addTable([],o);return i.build()}),Fk=class{constructor(){this.cache=new Ps(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return ct.get(Gu).get(e)}getConnectionSchema(e){var d;let{default_database:n,databases:i,default_schema:o}=e,s=new Fg,c=i.find(f=>f.name===n||i.length===1);if(((d=c??i[0])==null?void 0:d.schemas.some(f=>Xl(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?kg(n):Ds}getCompletionSource(e){let n=this.getConnection(e);if(!n)return null;let i=()=>ct.get(zk),o=this.cache.getOrCreate(n);return{dialect:kg(n),schema:o.shouldAddLocalTables?{...o.schema,...i()}:o.schema,defaultSchema:o.defaultSchema,defaultTable:Bk(n)}}};function Bk(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 Fk,Ls=Fi.define();dd=async function(e){let{sendFormat:n}=Hi(),i=ci.mapValues(e,s=>Jr(s)),o=await n({codes:i,lineLength:Z2().formatting.line_length});for(let[s,c]of ci.entries(o.codes)){let d=s,f=i[d],p=e[d];p&&c!==f&&(p.state.facet(Dt).updateCellCode({cellId:d,code:c,formattingChange:!0}),So(p,c))}},f_=function(){return dd(vk(od()))};async function Hk(e,n){let{formatDialect:i}=await ce(async()=>{let{formatDialect:_}=await import("./esm-D2sDl0Fj.js").then(async C=>(await C.__tla,C));return{formatDialect:_}},__vite__mapDeps([0,1]),import.meta.url),o=await Vk(Fa.getInternalDialect(n)),s=e.state.field(Lr),c=y4(e.state);if(s.type!=="sql"){Re.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(_){Re.error("Error formatting SQL",{error:_});return}let p=s.transformIn(f)[0],y=e.state.facet(Dt),w=e.state.facet(zd);y.updateCellCode({cellId:w,code:p,formattingChange:!0}),zu(e,f,{effects:[Ls.of(!0)]})}async function Vk(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:L,trino:z,transactsql:U,singlestoredb:$,snowflake:I}=await ce(async()=>{let{bigquery:pe,db2:P,db2i:A,duckdb:V,hive:de,mariadb:fe,mysql:be,tidb:J,n1ql:we,plsql:Ee,postgresql:ne,redshift:ie,spark:se,sqlite:K,sql:Le,trino:$e,transactsql:st,singlestoredb:je,snowflake:He}=await import("./esm-D2sDl0Fj.js").then(async Oe=>(await Oe.__tla,Oe));return{bigquery:pe,db2:P,db2i:A,duckdb:V,hive:de,mariadb:fe,mysql:be,tidb:J,n1ql:we,plsql:Ee,postgresql:ne,redshift:ie,spark:se,sqlite:K,sql:Le,trino:$e,transactsql:st,singlestoredb:je,snowflake:He}},__vite__mapDeps([0,1]),import.meta.url),G=L;if(!e||!ac(e))return G;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 I;case"trino":return z;case"tidb":return p;case"oracle":case"oracledb":return w;case"spark":return E;case"singlestoredb":return $;case"couchbase":return y;case"bigquery":return n;case"duckdb":return s;case"mssql":case"sqlserver":case"microsoft sql server":return U;case"athena":case"awsathena":case"cassandra":case"noql":case"flink":case"mongodb":case"timescaledb":case"datafusion":return L;case"databricks":return E;default:return _s(e),G}}var $k=ud();function Wk(e,n){let i=document.createElement("div"),o;return{dom:i,mount(){o=(0,$k.createRoot)(i),o.render((0,B.jsx)(U2,{store:ct,children:(0,B.jsx)(n,{view:e})}))},update(){o==null||o.render((0,B.jsx)(U2,{store:ct,children:(0,B.jsx)(n,{view:e})}))},destroy(){o==null||o.unmount()}}}function ye(e){return new dw(cw.define(e))}function Xi(e){return ce(()=>import("./dist-Cs61SvFK.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 Uk=[le.of({name:"C",extensions:["c","h","ino"],load(){return ce(()=>import("./dist-DZH5tKVw.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-DZH5tKVw.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 Xi("Cassandra")}}),le.of({name:"CSS",extensions:["css"],load(){return ce(()=>import("./dist-D9Fiuh_3.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-JWnLTASV.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-BRKKmf0q.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-ByhoBCLE.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-BmJp4tX0.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-BNNp07CX.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-C4et3kHY.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-BmJp4tX0.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-DBfLs40b.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-B3_wJGK3.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 Xi("MariaSQL")}}),le.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return ce(()=>import("./dist-BDE62V06.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 Xi("MSSQL")}}),le.of({name:"MySQL",load(){return Xi("MySQL")}}),le.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return ce(()=>import("./dist-CZt2oGGQ.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 Xi("PLSQL")}}),le.of({name:"PostgreSQL",load(){return Xi("PostgreSQL")}}),le.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return ce(()=>import("./dist-CoibEXVK.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-CXOfu6B_.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-PikrGYIK.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-PikrGYIK.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 Xi("StandardSQL")}}),le.of({name:"SQLite",load(){return Xi("SQLite")}}),le.of({name:"TSX",extensions:["tsx"],load(){return ce(()=>import("./dist-BmJp4tX0.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-BmJp4tX0.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-DUTVmHc-.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-DN9Eyqh1.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-CPwcyFg3.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-Bl4yyYus.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-BlzLkEza.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-Khb778U5.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-CC3QRUnf.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-BzHxpB_u.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-Cs8YSzaw.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-TW9KXOmZ.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-C_sT-_CQ.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-C_sT-_CQ.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-BJpII9DZ.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-BjrhHx8m.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-juXyFkA0.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-Cmn_5nuv.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-D549BT6Q.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-DGMqnM8m.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-DJrWmXfk.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-CQplIm4C.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-TW9KXOmZ.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-Dz2enOOE.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-BfBmz-1M.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-DxzWHAng.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-Bj1NVjKa.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-D73UE5Hl.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-Ch-B_r8E.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-C_sT-_CQ.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-CICk6vIb.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-C1O6zP9K.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-BwL41NIP.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-Cj5Wcvsd.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-DjzhghfA.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-1tMcz7c0.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-D9Pm6H-4.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-Bkmw-ITl.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-sRDGjaMs.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-hS11Npqh.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-HvvvGZ2_.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-BymCZpo_.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-D1PB_nO2.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-BbvC3Y-d.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-BbvC3Y-d.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-DTsrgwMt.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-Do8pA7p2.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-C0HGxgJT.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-B-Inh9cI.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-TW9KXOmZ.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-C6P4ddCY.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-DTvhQBWH.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-D0yC5rBL.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-wRwDN36m.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-CTTCwBwt.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-eJkJqAKw.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-BeQS3Xo8.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-CREUN6EW.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-B3ap5r7i.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-B2LCbtl9.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-TW9KXOmZ.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-TW9KXOmZ.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-sRDGjaMs.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-DhLlnMzQ.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-CLovtD0B.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-BJwozZXL.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-B3rIP59U.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-BQrpamWX.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-Crqgmja1.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-BMPI0iSd.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-BMPWl2Em.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-BvTKD58f.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-B1rTmaHH.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-BNL1PH4D.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-DOvfvYEk.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-B7R9RTHE.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-B7R9RTHE.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-BGJp-XLA.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-CZmYq1Si.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-TW9KXOmZ.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-CdW_eMia.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-oPdLMo8m.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-DEd8Bmn8.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-CnqQIV2W.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-DD6Hdy4w.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-sRDGjaMs.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-DKyVXlni.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-DQc2JQ5m.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-TW9KXOmZ.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-Dk_-yu_w.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-CjrgUbUd.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-BBWVYm-R.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-BBWVYm-R.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-CqmLdpPq.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-DCmY87p6.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-C_0nHQXl.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-Co__osNU.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-CfCZczlo.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-DRTXXEvh.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-Cc6RCKwc.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-B_hjyyZd.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-C9kHEAnH.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-BpKw2L0C.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-I7JvNTQ0.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-DrexAmUA.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-BxgSn4mU.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-FfkCaLcE.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-CqmLdpPq.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-Brd1jg5j.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-DryU6qzU.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-CxNmk6Uw.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-CIIYHJij.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-D9NVglDL.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-D9NVglDL.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-D9NVglDL.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-C-lY0RYt.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-B_4eJv27.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([212,9,5,13,14,4]),import.meta.url).then(e=>e.angular())}})],Bg=new WeakMap,Kk=/(\n|\r\n?|\u2028|\u2029)/g,Qk=/^\s*/,Gk=/\S/,Jk=Array.prototype.slice,Wd=48,Hg=57,Vg=97,Xk=102,$g=65,Yk=70;Yl=function(e){if(typeof e=="string")return Kg([e])[0];if(typeof e=="function")return function(){let o=Jk.call(arguments);return o[0]=Ug(o[0]),e.apply(this,o)};let n=Ug(e),i=Wg(n,0);for(let o=1;o<n.length;o++)i+=arguments[o]+Wg(n,o);return i};function Wg(e,n){let i=e[n];if(i===void 0)throw TypeError(`invalid cooked string at index ${n}`);return i}function Ug(e){let n=Bg.get(e);if(n)return n;let i=Kg(e.raw),o=i.map(eS);return Object.defineProperty(o,"raw",{value:Object.freeze(i)}),Object.freeze(o),Bg.set(e,o),o}function Kg(e){let n=e.map(s=>s.split(Kk)),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||Gk.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,_=Qk.exec(y)[0];if(!w&&_.length===y.length){c[p]="";continue}i=Zk(_,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 Zk(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 eS(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')`},H_=function(e,n){if(n==="date"||n==="datetime"||n==="time"){if(e==="min")return"Earliest";if(e==="max")return"Latest"}return e};function Ck(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:qD,createActions:jD,valueAtom:Cg,useActions:Ek}=Nl(Ck,{addDatasets:(e,n)=>{let{previewDatasetColumn:i}=Hi();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}}});P_=()=>Yn(Cg),ad=Be(e=>e(Cg).tables),Q_=Be(new Set),Y_=Be(!1),d_=function(){return Ek()};var Tk=new Map([[$i,{name:$i,dialect:"duckdb",source:"duckdb",display_name:"DuckDB (In-Memory)",databases:[]}]]);function Rk(){return{latestEngineSelected:$i,connectionsMap:Tk}}let Dk,Ok;({reducer:Dk,createActions:Ok,valueAtom:_o,useActions:__}=Nl(Rk,{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}}})),Gu=Be(e=>e(_o).connectionsMap);function Eg(e){let n=st.get(_o);n.connectionsMap.has(e)&&st.set(_o,{...n,latestEngineSelected:e})}i_=Be(e=>{let n=st.get(ad),i=e(_o).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=Xl(f.name);for(let w of f.tables){let _;if(_=w.name,y){_=d?w.name:`${c.name}.${w.name}`,o.has(_)?Re.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(_)?Re.warn(`Table name collision for ${_}. Skipping.`):o.set(_,w)}}}return o}),Tw=function(e){return e.variable_name?"dataframe":"table"};let Ps,Fd,Tg,Bd,Rg,Dg,Hd,Og;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)}},sm=Ct("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"}]]),zh=Ct("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"}]]),Em=Ct("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"}]]),Fh=Ct("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"}]]),Ih=Ct("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=Ct("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"}]]),am=Ct("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"}]]),tm=Ct("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"}]]),Ah=Ct("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Tg=Ct("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"}]]),rm=Ct("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),Bd=Ct("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=Ct("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"}]]),pd=Ct("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"}]]),Yh=Ct("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"}]]),Rg=Ct("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"}]]),$u=Ct("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Dg=Ct("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"}]]),wo=Ct("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=Ct("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"}]]),Gh=Ct("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"}]]),Uh=Ct("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"}]]),Vh=Ct("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=Ct("search-check",[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),Og=Ct("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"}]]),ym=Ct("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"}]]),bo=Ct("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"}]]),bm=Ct("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=Ct("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 Pg(e){let[n,i]=e.split(" ");return i?`${Al(n)} ${i}`:Al(e)}Ku={boolean:u4,date:c4,time:Ah,datetime:Fd,temporal:Fd,number:vh,string:d4,integer:vh,unknown:Ih},Iw=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,Mg,Vd,Lg,Lo,Ng,Ig,Ag,qg,jg,No,Zr,za,fi,$d;Da=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`}},nx=class hx{constructor(n){this.words=n}static of(...n){return new hx(n.map(i=>typeof i=="string"?new Da(i):i))}join(n,i){return this.words.map(o=>o.pluralize(i)).join(n)}},Ms=Gr(),B=yh(y4(),1),Mg=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)]"},Lg={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",Ng=new Da("column","columns"),Ig=new Da("row","rows"),Ag=new Da("schema","schemas"),qg=new Da("table","tables"),jg=new Da("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},Zr=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},fi=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?Mg: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 Pk=e=>{var d,f;let n=e.type==="view"?(0,B.jsx)(pd,{className:"w-4 h-4 text-[var(--blue-9)]"}):(0,B.jsx)(bo,{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=Ku[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)(Zr,{label:"Source",value:(0,B.jsx)(mr,{variant:"outline",className:`text-xs ${Lg[e.source_type]}`,children:e.source})}),e.variable_name&&(0,B.jsx)(Zr,{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)(Zr,{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)(rm,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_columns} ${Ng.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,B.jsx)(za,{icon:(0,B.jsx)(vh,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_rows} ${Ig.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)(SD,{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)(zh,{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)(fi,{items:o,totalCount:e.columns.length})]})},Mk=e=>{var s;let n=Ku[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)(Zr,{label:"Type",value:(0,B.jsx)("span",{className:"font-medium",children:e.type})}),(0,B.jsx)(Zr,{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)(fi,{title:"Sample Values",items:o,totalCount:e.sample_values.length})]})},Lk=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)(wo,{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," ",qg.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)(Zr,{label:"Dialect",value:(0,B.jsx)("span",{className:"font-medium",children:e.dialect})}),e.engine&&(0,B.jsx)(Zr,{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)(wo,{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)(fi,{title:"Schemas",items:i,totalCount:e.schemas.length})]})},Nk=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)(pd,{className:"w-3 h-3 text-[var(--blue-9)]"}):(0,B.jsx)(bo,{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)(wo,{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)(bo,{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)(fi,{title:"Tables",items:i,totalCount:e.tables.length})]})};var zg=(0,B.jsx)(mr,{variant:"outline",children:"default"}),Ik=8,Fg=3;let oc;Yw=(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<Ik&&(_=p.tables.slice(0,Fg+1).map(C=>(0,B.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,B.jsx)(bo,{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)(wo,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{children:p.name}),w&&zg,(0,B.jsxs)(mr,{variant:"outline",className:"text-xs ml-auto",children:[p.tables.length," tables"]})]}),(0,B.jsx)(fi,{items:_,totalCount:p.tables.length,limit:Fg})]},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&&zg]}),w&&(0,B.jsx)(fi,{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)(bo,{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)(Tg,{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)(Zr,{label:"Dialect",value:(0,B.jsx)("span",{className:"font-medium",children:Al(e.dialect)})}),(0,B.jsx)(Zr,{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} ${jg.pluralize(i)}`}),(0,B.jsx)(za,{icon:(0,B.jsx)(wo,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${o} ${Ag.pluralize(o)}`})]}),i>0&&(0,B.jsx)(fi,{items:c,totalCount:i}),f&&f.length>0&&(0,B.jsx)(fi,{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)($u,{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=ud(),Bg=class{constructor(){ke(this,"schema",{})}addTable(e,n){let i={self:qk({table:n}),children:n.columns.map(o=>Ak({column:o}))};return this.setAt([...e,n.name],i),this}addSchema(e,n){let i={self:jk({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}addDatabase(e,n){let i={self:zk({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 Ak(e){return{label:e.column.name,type:"column",info:()=>{let n=document.createElement("div");return(0,sc.createRoot)(n).render(Mk(e.column)),{dom:n}}}}function qk(e){return{label:e.table.name,type:"table",info:()=>{let n=document.createElement("div");return(0,sc.createRoot)(n).render(Pk(e.table)),{dom:n}}}}function jk(e){return{label:e.namespace.name,detail:e.path.join("."),type:"schema",info:()=>{let n=document.createElement("div");return(0,sc.createRoot)(n).render(Nk(e.namespace)),{dom:n}}}}function zk(e){return{label:e.namespace.name,detail:e.path.join("."),type:"database",info:()=>{let n=document.createElement("div");return(0,sc.createRoot)(n).render(Lk(e.namespace)),{dom:n}}}}var Fk=Be(e=>{let n=e(ad),i=new Bg;for(let o of n)i.addTable([],o);return i.build()}),Bk=class{constructor(){this.cache=new Ps(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return st.get(Gu).get(e)}getConnectionSchema(e){var d;let{default_database:n,databases:i,default_schema:o}=e,s=new Bg,c=i.find(f=>f.name===n||i.length===1);if(((d=c??i[0])==null?void 0:d.schemas.some(f=>Xl(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?Sg(n):Ds}getCompletionSource(e){let n=this.getConnection(e);if(!n)return null;let i=()=>st.get(Fk),o=this.cache.getOrCreate(n);return{dialect:Sg(n),schema:o.shouldAddLocalTables?{...o.schema,...i()}:o.schema,defaultSchema:o.defaultSchema,defaultTable:Hk(n)}}};function Hk(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 Bk,Ls=Fi.define();dd=async function(e){let{sendFormat:n}=Hi(),i=ci.mapValues(e,s=>Jr(s)),o=await n({codes:i,lineLength:tw().formatting.line_length});for(let[s,c]of ci.entries(o.codes)){let d=s,f=i[d],p=e[d];p&&c!==f&&(p.state.facet(Dt).updateCellCode({cellId:d,code:c,formattingChange:!0}),So(p,c))}},h_=function(){return dd(bk(od()))};async function Vk(e,n){let{formatDialect:i}=await ce(async()=>{let{formatDialect:_}=await import("./esm-D2sDl0Fj.js").then(async C=>(await C.__tla,C));return{formatDialect:_}},__vite__mapDeps([0,1]),import.meta.url),o=await $k(Fa.getInternalDialect(n)),s=e.state.field(Lr),c=v4(e.state);if(s.type!=="sql"){Re.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(_){Re.error("Error formatting SQL",{error:_});return}let p=s.transformIn(f)[0],y=e.state.facet(Dt),w=e.state.facet(zd);y.updateCellCode({cellId:w,code:p,formattingChange:!0}),zu(e,f,{effects:[Ls.of(!0)]})}async function $k(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:L,trino:z,transactsql:U,singlestoredb:$,snowflake:I}=await ce(async()=>{let{bigquery:pe,db2:P,db2i:A,duckdb:V,hive:de,mariadb:fe,mysql:be,tidb:J,n1ql:we,plsql:Ee,postgresql:ne,redshift:ie,spark:se,sqlite:K,sql:Le,trino:$e,transactsql:lt,singlestoredb:je,snowflake:He}=await import("./esm-D2sDl0Fj.js").then(async Oe=>(await Oe.__tla,Oe));return{bigquery:pe,db2:P,db2i:A,duckdb:V,hive:de,mariadb:fe,mysql:be,tidb:J,n1ql:we,plsql:Ee,postgresql:ne,redshift:ie,spark:se,sqlite:K,sql:Le,trino:$e,transactsql:lt,singlestoredb:je,snowflake:He}},__vite__mapDeps([0,1]),import.meta.url),G=L;if(!e||!ac(e))return G;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 I;case"trino":return z;case"tidb":return p;case"oracle":case"oracledb":return w;case"spark":return E;case"singlestoredb":return $;case"couchbase":return y;case"bigquery":return n;case"duckdb":return s;case"mssql":case"sqlserver":case"microsoft sql server":return U;case"athena":case"awsathena":case"cassandra":case"noql":case"flink":case"mongodb":case"timescaledb":case"datafusion":return L;case"databricks":return E;default:return _s(e),G}}var Wk=ud();function Uk(e,n){let i=document.createElement("div"),o;return{dom:i,mount(){o=(0,Wk.createRoot)(i),o.render((0,B.jsx)(Q2,{store:st,children:(0,B.jsx)(n,{view:e})}))},update(){o==null||o.render((0,B.jsx)(Q2,{store:st,children:(0,B.jsx)(n,{view:e})}))},destroy(){o==null||o.unmount()}}}function ye(e){return new pw(dw.define(e))}function Xi(e){return ce(()=>import("./dist-Cs61SvFK.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 Kk=[le.of({name:"C",extensions:["c","h","ino"],load(){return ce(()=>import("./dist-DZH5tKVw.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-DZH5tKVw.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 Xi("Cassandra")}}),le.of({name:"CSS",extensions:["css"],load(){return ce(()=>import("./dist-D9Fiuh_3.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-JWnLTASV.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-BRKKmf0q.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-ByhoBCLE.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-BmJp4tX0.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-BNNp07CX.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-C4et3kHY.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-BmJp4tX0.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-DBfLs40b.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-B3_wJGK3.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 Xi("MariaSQL")}}),le.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return ce(()=>import("./dist-BDE62V06.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 Xi("MSSQL")}}),le.of({name:"MySQL",load(){return Xi("MySQL")}}),le.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return ce(()=>import("./dist-CZt2oGGQ.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 Xi("PLSQL")}}),le.of({name:"PostgreSQL",load(){return Xi("PostgreSQL")}}),le.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return ce(()=>import("./dist-CoibEXVK.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-CXOfu6B_.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-PikrGYIK.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-PikrGYIK.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 Xi("StandardSQL")}}),le.of({name:"SQLite",load(){return Xi("SQLite")}}),le.of({name:"TSX",extensions:["tsx"],load(){return ce(()=>import("./dist-BmJp4tX0.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-BmJp4tX0.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-DUTVmHc-.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-DN9Eyqh1.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-CPwcyFg3.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-Bl4yyYus.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-BlzLkEza.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-Khb778U5.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-CC3QRUnf.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-BzHxpB_u.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-Cs8YSzaw.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-TW9KXOmZ.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-C_sT-_CQ.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-C_sT-_CQ.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-BJpII9DZ.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-BjrhHx8m.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-juXyFkA0.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-Cmn_5nuv.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-D549BT6Q.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-DGMqnM8m.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-DJrWmXfk.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-CQplIm4C.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-TW9KXOmZ.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-Dz2enOOE.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-BfBmz-1M.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-DxzWHAng.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-Bj1NVjKa.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-D73UE5Hl.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-Ch-B_r8E.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-C_sT-_CQ.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-CICk6vIb.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-C1O6zP9K.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-BwL41NIP.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-Cj5Wcvsd.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-DjzhghfA.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-1tMcz7c0.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-D9Pm6H-4.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-Bkmw-ITl.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-sRDGjaMs.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-hS11Npqh.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-HvvvGZ2_.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-BymCZpo_.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-D1PB_nO2.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-BbvC3Y-d.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-BbvC3Y-d.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-DTsrgwMt.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-Do8pA7p2.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-C0HGxgJT.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-B-Inh9cI.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-TW9KXOmZ.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-C6P4ddCY.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-DTvhQBWH.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-D0yC5rBL.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-wRwDN36m.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-CTTCwBwt.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-eJkJqAKw.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-BeQS3Xo8.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-CREUN6EW.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-B3ap5r7i.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-B2LCbtl9.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-TW9KXOmZ.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-TW9KXOmZ.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-sRDGjaMs.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-DhLlnMzQ.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-CLovtD0B.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-BJwozZXL.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-B3rIP59U.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-BQrpamWX.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-Crqgmja1.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-BMPI0iSd.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-BMPWl2Em.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-BvTKD58f.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-B1rTmaHH.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-BNL1PH4D.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-DOvfvYEk.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-B7R9RTHE.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-B7R9RTHE.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-BGJp-XLA.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-CZmYq1Si.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-TW9KXOmZ.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-CdW_eMia.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-oPdLMo8m.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-DEd8Bmn8.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-CnqQIV2W.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-DD6Hdy4w.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-sRDGjaMs.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-DKyVXlni.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-DQc2JQ5m.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-TW9KXOmZ.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-Dk_-yu_w.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-CjrgUbUd.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-BBWVYm-R.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-BBWVYm-R.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-CqmLdpPq.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-DCmY87p6.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-C_0nHQXl.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-Co__osNU.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-CfCZczlo.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-DRTXXEvh.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-Cc6RCKwc.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-B_hjyyZd.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-C9kHEAnH.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-BpKw2L0C.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-I7JvNTQ0.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-DrexAmUA.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-BxgSn4mU.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-FfkCaLcE.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-CqmLdpPq.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-Brd1jg5j.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-DryU6qzU.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-CxNmk6Uw.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-CIIYHJij.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-D9NVglDL.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-D9NVglDL.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-D9NVglDL.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-C-lY0RYt.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-B_4eJv27.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([212,9,5,13,14,4]),import.meta.url).then(e=>e.angular())}})],Hg=new WeakMap,Qk=/(\n|\r\n?|\u2028|\u2029)/g,Gk=/^\s*/,Jk=/\S/,Xk=Array.prototype.slice,Wd=48,Vg=57,$g=97,Yk=102,Wg=65,Zk=70;Yl=function(e){if(typeof e=="string")return Qg([e])[0];if(typeof e=="function")return function(){let o=Xk.call(arguments);return o[0]=Kg(o[0]),e.apply(this,o)};let n=Kg(e),i=Ug(n,0);for(let o=1;o<n.length;o++)i+=arguments[o]+Ug(n,o);return i};function Ug(e,n){let i=e[n];if(i===void 0)throw TypeError(`invalid cooked string at index ${n}`);return i}function Kg(e){let n=Hg.get(e);if(n)return n;let i=Qg(e.raw),o=i.map(tS);return Object.defineProperty(o,"raw",{value:Object.freeze(i)}),Object.freeze(o),Hg.set(e,o),o}function Qg(e){let n=e.map(s=>s.split(Qk)),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||Jk.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,_=Gk.exec(y)[0];if(!w&&_.length===y.length){c[p]="";continue}i=eS(_,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 eS(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 tS(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(Qg(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(Qg(s,0))return;n+=s}i=o}return n+e.slice(i)}function Qg(e,n){let i=e.charCodeAt(n);return i>=Wd&&i<=Hg}function Ud(e,n,i){if(i>=e.length)return-1;let o=0;for(;n<i;n++){let s=tS(e.charCodeAt(n));if(s===-1)return-1;o=o*16+s}return o}function tS(e){return e>=Wd&&e<=Hg?e-Wd:e>=Vg&&e<=Xk?e-Vg+10:e>=$g&&e<=Yk?e-$g+10:-1}const Gg=["","f","r","fr","rf"];function nS(e){try{return Yl(`
67
+ `:case"\u2028":case"\u2029":break;case"0":if(Gg(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(Gg(s,0))return;n+=s}i=o}return n+e.slice(i)}function Gg(e,n){let i=e.charCodeAt(n);return i>=Wd&&i<=Vg}function Ud(e,n,i){if(i>=e.length)return-1;let o=0;for(;n<i;n++){let s=nS(e.charCodeAt(n));if(s===-1)return-1;o=o*16+s}return o}function nS(e){return e>=Wd&&e<=Vg?e-Wd:e>=$g&&e<=Yk?e-$g+10:e>=Wg&&e<=Zk?e-Wg+10:-1}const Jg=["","f","r","fr","rf"];function rS(e){try{return Yl(`
68
68
  ${e}
69
- `).trim()}catch{return e}}function rS(e){return CD.parse(e)}var iS=new Set(["(","[","{",",",")","]","}"]);function aS(e,n){return e.name==="ArgList"?{args:oS(e),kwargs:sS(e,n)}:(console.warn(`Not an ArgList, name: ${e.name}`),{args:[],kwargs:[]})}function oS(e){var o;e.firstChild();let n=[],i=e.name;do if(i=e.name,!iS.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 sS(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 lS(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 cS(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 uS(e){let n=[...Gg].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 dS(e,n){return e.replaceAll(`\\${n}`,n)}var fS=[['"""','"""'],["'''","'''"],['"','"'],["'","'"]],pS=Gg.flatMap(e=>fS.map(([n,i])=>[e+n,i])).map(([e,n])=>[e,RegExp(`^mo\\.md\\(\\s*${Jg(e)}(.*)${Jg(n)}\\s*\\)$`,"s")]);function Jg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Xg=class{constructor(){ke(this,"type","markdown");ke(this,"defaultCode",`mo.md(r"""
69
+ `).trim()}catch{return e}}function iS(e){return ED.parse(e)}var aS=new Set(["(","[","{",",",")","]","}"]);function oS(e,n){return e.name==="ArgList"?{args:sS(e),kwargs:lS(e,n)}:(console.warn(`Not an ArgList, name: ${e.name}`),{args:[],kwargs:[]})}function sS(e){var o;e.firstChild();let n=[],i=e.name;do if(i=e.name,!aS.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 lS(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 cS(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 uS(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 dS(e){let n=[...Jg].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 fS(e,n){return e.replaceAll(`\\${n}`,n)}var pS=[['"""','"""'],["'''","'''"],['"','"'],["'","'"]],hS=Jg.flatMap(e=>pS.map(([n,i])=>[e+n,i])).map(([e,n])=>[e,RegExp(`^mo\\.md\\(\\s*${Xg(e)}(.*)${Xg(n)}\\s*\\)$`,"s")]);function Xg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Yg=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 pS){let s=e.match(o);if(s){let c=s[1],[d,f]=uS(i);n.quotePrefix=d;let p=dS(c,f),y=e.indexOf(c);return{code:Yl(`
72
+ """)`}transformIn(e){e=e.trim();let n={...this.defaultMetadata};if(e==="")return{code:"",offset:0,metadata:n};for(let[i,o]of hS){let s=e.match(o);if(s){let c=s[1],[d,f]=dS(i);n.quotePrefix=d;let p=fS(c,f),y=e.indexOf(c);return{code:Yl(`
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=Dh.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}},hS=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",Yg=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=Zg(e);return i?(n.dataframeName=i.dfName,n.showOutput=i.output??!0,n.engine=i.engine??Kd,{code:Yl(`
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=Dh.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}},mS=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",Zg=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=ey(e);return i?(n.dataframeName=i.dfName,n.showOutput=i.output??!0,n.engine=i.engine??Kd,{code:Yl(`
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}"""
@@ -82,17 +82,17 @@ ${i.sqlString}
82
82
  output=False`}${c===Kd?"":`,
83
83
  engine=${c}`}
84
84
  )`;return{code:[...o,f].join(`
85
- `)+gS(p)+y,offset:f.length+1}}isSupported(e){return e.trim()===""?!0:!e.includes("mo.sql")||e.split("mo.sql").length>2?!1:Zg(e)!==null}extractCommentLines(e){let n=e.split(`
86
- `),i=[];for(let o of n)if(o!=null&&o.startsWith("#"))i.push(o);else break;return i}};function mS(e){do{if(e.name==="AssignStatement")return e.node;if(e.name!=="Comment")return null}while(e.next());return null}function Zg(e){try{let n=rS(e).cursor();n.name==="Script"&&n.next();let i=mS(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:L,kwargs:z}=aS(E.node.cursor(),e);L.length===1&&(s=lS(L[0],e),f=L[0].from+cS(e.slice(L[0].from,L[0].to)));for(let{key:U,value:$}of z)switch(U){case"engine":c=$;break;case"output":d=$==="True";break}if(s==="")return{dfName:o,sqlString:"",engine:c,output:d,startPosition:f};break}}}return!o||!s?null:{dfName:o,sqlString:nS(s),engine:c,output:d,startPosition:f}}catch(n){return console.warn("Failed to parse SQL statement",n),null}}function gS(e){return e.split(`
85
+ `)+yS(p)+y,offset:f.length+1}}isSupported(e){return e.trim()===""?!0:!e.includes("mo.sql")||e.split("mo.sql").length>2?!1:ey(e)!==null}extractCommentLines(e){let n=e.split(`
86
+ `),i=[];for(let o of n)if(o!=null&&o.startsWith("#"))i.push(o);else break;return i}};function gS(e){do{if(e.name==="AssignStatement")return e.node;if(e.name!=="Comment")return null}while(e.next());return null}function ey(e){try{let n=iS(e).cursor();n.name==="Script"&&n.next();let i=gS(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:L,kwargs:z}=oS(E.node.cursor(),e);L.length===1&&(s=cS(L[0],e),f=L[0].from+uS(e.slice(L[0].from,L[0].to)));for(let{key:U,value:$}of z)switch(U){case"engine":c=$;break;case"output":d=$==="True";break}if(s==="")return{dfName:o,sqlString:"",engine:c,output:d,startPosition:f};break}}}return!o||!s?null:{dfName:o,sqlString:rS(s),engine:c,output:d,startPosition:f}}catch(n){return console.warn("Failed to parse SQL statement",n),null}}function yS(e){return e.split(`
87
87
  `).map(n=>n!=null&&n.trim()?` ${n}`:n).join(`
88
- `)}function yS(e,n){return{get:()=>n.get(e),sub:i=>n.sub(e,()=>i(n.get(e)))}}function vS(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}}Ju=function(e){return e?e.state.field(Lr).type:"python"};function bS(e,n){return!e||Ju(e)===n?!1:e.state.doc.toString().trim()===""?!0:yr[n].isSupported(Jr(e))}Om=function(e,n,i={}){return!i.force&&!bS(e,n)?!1:(Dm(e,{language:n}),n)};function wS(e){return Ta.of([{key:e.getHotkey("cell.format").key,preventDefault:!0,run:n=>(dd({[n.state.facet(La)]:n}),!0)},{key:e.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:n=>{let i=Ju(n);if(i!=="markdown"&&i!=="python")return!1;let o=Om(n,i==="python"?"markdown":"python",{force:!0});return o==="markdown"&&n.state.facet(Dt).afterToggleMarkdown(),o!==!1}}])}S_=function(){return Ut.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(n=>n.effects.some(i=>i.is(Ls))))return;ey(e.view,{behavior:"smooth"})}})};function ey(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"),vS(o,{offset:{top:30,bottom:150},body:s,behavior:n.behavior})}}function _S(){return{}}let xS,kS,ty;({reducer:xS,createActions:kS,valueAtom:Ma,useActions:ty}=Nl(_S,{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}})),V_=()=>Yn(Ma),I_=function(){return ty()},v_=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 Re.warn(`Error getting ${i} from storage`,s),o}},setItem:(i,o)=>{n.setItem(i,JSON.stringify(e.toSerializable(o)))},removeItem:i=>{n.removeItem(i)}}},Kl=Wm(()=>Ts),Rm=Be({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1});function Ns(e){var n;return((n=ct.get(Rm))==null?void 0:n[e])??!1}function SS(e,n){if(typeof window>"u")return;let i=`__marimo__${n}`;window[i]&&Re.warn(`Overwriting existing debug object ${i}`),window[i]=e}var CS={markdown:!0,wasm_layouts:!1,rtc_v2:!1,performant_table_charts:!1,chat_modes:!1,cache_panel:!1,external_agents:!1};Gl=function(e){var n,i;return((i=(n=Z2())==null?void 0:n.experimental)==null?void 0:i[e])??CS[e]};function ES(e,n){Hi().saveUserConfig({config:{experimental:{[e]:n}}})}m_=({feature:e,children:n})=>Gl(e)?n:null,SS(ES,"setFeatureFlag"),Ul=[{type:"files",Icon:Tg,label:"Files",tooltip:"View files",defaultSection:"sidebar"},{type:"variables",Icon:Qh,label:"Variables",tooltip:"Explore variables and data sources",defaultSection:"sidebar"},{type:"packages",Icon:Fh,label:"Packages",tooltip:"Manage packages",defaultSection:"sidebar"},{type:"ai",Icon:Cm,label:"AI",tooltip:"Chat & Agents",defaultSection:"sidebar"},{type:"snippets",Icon:Dg,label:"Snippets",tooltip:"Snippets",defaultSection:"developer-panel"},{type:"outline",Icon:Vh,label:"Outline",tooltip:"View outline",defaultSection:"sidebar"},{type:"documentation",Icon:bm,label:"Docs",tooltip:"View live docs",defaultSection:"sidebar"},{type:"dependencies",Icon:Nh,label:"Dependencies",tooltip:"Explore dependencies",defaultSection:"sidebar"},{type:"errors",Icon:tm,label:"Errors",tooltip:"View errors",defaultSection:"developer-panel"},{type:"scratchpad",Icon:Gh,label:"Scratchpad",tooltip:"Scratchpad",defaultSection:"developer-panel"},{type:"tracing",Icon:sm,label:"Tracing",tooltip:"View tracing",defaultSection:"developer-panel"},{type:"secrets",Icon:Rg,label:"Secrets",tooltip:"Manage secrets",defaultSection:"developer-panel",hidden:bh()},{type:"logs",Icon:Yh,label:"Logs",tooltip:"View logs",defaultSection:"developer-panel"},{type:"terminal",Icon:ym,label:"Terminal",tooltip:"Terminal",hidden:bh(),defaultSection:"developer-panel",requiredCapability:"terminal"},{type:"cache",Icon:xD,label:"Cache",tooltip:"View cache",defaultSection:"developer-panel",hidden:!Gl("cache_panel")}],F_=new Map(Ul.map(e=>[e.type,e])),ld=function(e){return!!(e.hidden||e.requiredCapability&&!Ns(e.requiredCapability))};var TS=Gr();q_=Fl("marimo:panel-layout",{sidebar:Ul.filter(e=>!ld(e)&&e.defaultSection==="sidebar").map(e=>e.type),developerPanel:Ul.filter(e=>!ld(e)&&e.defaultSection==="developer-panel").map(e=>e.type)},Kl,{getOnInit:!0});var ny="marimo:sidebar",ry=new ju(Q2({selectedPanel:G2().optional().transform(e=>e),isSidebarOpen:J2(),isDeveloperPanelOpen:J2().optional().default(!1),selectedDeveloperPanelTab:G2().optional().default("terminal").transform(e=>e)}),RS);function RS(){return{selectedPanel:"variables",isSidebarOpen:!1,isDeveloperPanelOpen:!1,selectedDeveloperPanelTab:"terminal"}}let DS,OS,iy;({reducer:DS,createActions:OS,valueAtom:cd,useActions:iy}=Nl(()=>ry.get(ny),{openApplication:(e,n)=>({...e,selectedPanel:n,isSidebarOpen:!0}),toggleApplication:(e,n)=>({...e,selectedPanel:n,isSidebarOpen:e.isSidebarOpen?e.selectedPanel!==n:!0}),toggleSidebarPanel:e=>({...e,isSidebarOpen:!e.isSidebarOpen}),setIsSidebarOpen:(e,n)=>({...e,isSidebarOpen:n}),toggleDeveloperPanel:e=>({...e,isDeveloperPanelOpen:!e.isDeveloperPanelOpen}),setIsDeveloperPanelOpen:(e,n)=>({...e,isDeveloperPanelOpen:n}),setSelectedDeveloperPanelTab:(e,n)=>({...e,selectedDeveloperPanelTab:n}),openDeveloperPanelTab:(e,n)=>({...e,isDeveloperPanelOpen:!0,selectedDeveloperPanelTab:n})},[(e,n)=>ry.set(ny,n)])),R_=()=>{let e=(0,TS.c)(2),n=Yn(cd);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},U_=function(){return iy()},ed=Be({documentation:null});var ay=new Set(["FunctionDefinition","LambdaExpression","ArrayComprehensionExpression","SetComprehension","DictionaryComprehensionExpression","ComprehensionExpression","ClassDefinition"]);function PS(e){let n=iw(e.state);if(!n||NS(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 G,pe,P,A,V,de,fe,be,J,we,Ee;let L=E.cursor(),z=L.name,U=L.from,$=ay.has(z),I=T;switch($&&(I=[...T,U],s.set(U,new Set),c.set(U,z)),z){case"FunctionDefinition":{let ne=E.cursor();ne.firstChild();do if(ne.name==="VariableName"){let se=e.state.doc.sliceString(ne.from,ne.to),K=T[T.length-1]??-1;s.has(K)||s.set(K,new Set),(G=s.get(K))==null||G.add(se);break}while(ne.nextSibling());let ie=E.cursor();ie.firstChild();do if(ie.name==="ParamList"){let se=ie.node.cursor();se.firstChild();do if(se.name==="VariableName"){let K=e.state.doc.sliceString(se.from,se.to);(pe=s.get(U))==null||pe.add(K)}while(se.nextSibling())}while(ie.nextSibling());break}case"LambdaExpression":{let ne=E.cursor();ne.firstChild();do if(ne.name==="ParamList"){let ie=ne.node.cursor();ie.firstChild();do if(ie.name==="VariableName"){let se=e.state.doc.sliceString(ie.from,ie.to);(P=s.get(U))==null||P.add(se)}while(ie.nextSibling())}while(ne.nextSibling());break}case"ArrayComprehensionExpression":case"DictionaryComprehensionExpression":case"SetComprehension":case"ComprehensionExpression":{let ne=E.cursor();ne.firstChild();let ie=!1;do if(ne.name==="for")ie=!0;else if(ie&&ne.name==="VariableName"){let se=e.state.doc.sliceString(ne.from,ne.to);(A=s.get(U))==null||A.add(se)}else if(ie&&ne.name==="TupleExpression"){let se=ne.node.cursor();se.firstChild();do if(se.name==="VariableName"){let K=e.state.doc.sliceString(se.from,se.to);(V=s.get(U))==null||V.add(K)}while(se.nextSibling())}else ie&&ne.name==="in"&&(ie=!1);while(ne.nextSibling());break}case"ClassDefinition":{let ne=E.cursor();ne.firstChild();do if(ne.name==="VariableName"){let ie=e.state.doc.sliceString(ne.from,ne.to),se=T[T.length-1]??-1;s.has(se)||s.set(se,new Set),(de=s.get(se))==null||de.add(ie);break}while(ne.nextSibling());d.set(U,[]);break}case"AssignStatement":{let ne=E.cursor(),ie=[];ne.firstChild();do ne.name==="AssignOp"&&ie.push(ne.from);while(ne.nextSibling());let se=ie[ie.length-1],K=E.cursor();K.firstChild();let Le=I[I.length-1]??-1;do K.from<se&&Qd(K,{currentScope:Le,state:e.state,allDeclarations:s,scopeTypes:c,classLevelDeclarations:d,assignmentPosition:L.to});while(K.nextSibling());break}case"ForStatement":{let ne=E.cursor();ne.firstChild();let ie=!1;do if(ne.name==="for")ie=!0;else if(ie&&ne.name==="VariableName"){let se=e.state.doc.sliceString(ne.from,ne.to),K=I[I.length-1]??-1;s.has(K)||s.set(K,new Set),(fe=s.get(K))==null||fe.add(se)}else ie&&ne.name==="in"&&(ie=!1);while(ne.nextSibling());break}case"ImportStatement":{let ne=E.cursor();ne.firstChild();do if(ne.name==="VariableName"){let ie=e.state.doc.sliceString(ne.from,ne.to),se=I[I.length-1]??-1;s.has(se)||s.set(se,new Set),(be=s.get(se))==null||be.add(ie)}while(ne.nextSibling());break}case"ImportFromStatement":{let ne=E.cursor();ne.firstChild();let ie=!1;do if(ne.name==="import")ie=!0;else if(ie&&ne.name==="VariableName"){let se=e.state.doc.sliceString(ne.from,ne.to),K=I[I.length-1]??-1;s.has(K)||s.set(K,new Set),(J=s.get(K))==null||J.add(se)}while(ne.nextSibling());break}case"TryStatement":{let ne=E.cursor();ne.firstChild();let ie=!1;do if(ne.name==="as")ie=!0;else if(ie&&ne.name==="VariableName"){let se=e.state.doc.sliceString(ne.from,ne.to),K=I[I.length-1]??-1;s.has(K)||s.set(K,new Set),(we=s.get(K))==null||we.add(se),ie=!1}while(ne.nextSibling());break}case"WithStatement":{let ne=E.cursor();ne.firstChild();let ie=!1;do if(ne.name==="as")ie=!0;else if(ie&&ne.name==="VariableName"){let se=e.state.doc.sliceString(ne.from,ne.to),K=I[I.length-1]??-1;s.has(K)||s.set(K,new Set),(Ee=s.get(K))==null||Ee.add(se),ie=!1}while(ne.nextSibling());break}}C(L,ne=>{f(ne,I)})}function p(E,T,L){let z=d.get(T);return z?z.some(([U,$])=>U===E&&$<L):!1}function y(E,T,L){var z,U;for(let $ of T)if(c.get($)==="ClassDefinition"){if(p(E,$,L))return!0}else if((z=s.get($))!=null&&z.has(E))return!0;return((U=s.get(-1))==null?void 0:U.has(E))??!1}function w(E,T){let L=E.cursor(),z=L.name,U=L.from,$=ay.has(z),I=T;if($&&(I=[...T,U]),z==="VariableName"){let G=e.state.doc.sliceString(L.from,L.to);_(G,L)&&(y(G,I,L.from)||o.push({from:L.from,to:L.to,variableName:G}))}C(L,G=>{w(G,I)})}function _(E,T){return i.has(E)&&!MS(T)&&!LS(T)}function C(E,T){if(E.firstChild())do T(E.node);while(E.nextSibling())}return f(n,[]),w(n,[]),o}function MS(e){let n=e.node.cursor();if(n.moveTo(e.from),n.parent()&&n.name==="CallExpression"&&n.firstChild())do if(n.name==="ArgList"&&n.firstChild()){do if(n.from===e.from&&n.to===e.to)return n.nextSibling()&&n.name==="AssignOp";while(n.nextSibling());break}while(n.nextSibling());return!1}function LS(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 NS(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 IS=Bi.mark({class:"mo-cm-reactive-reference"});s_=Bi.mark({class:"mo-cm-reactive-reference-hover"});var oy=Fi.define(),AS=class{constructor(e,n){ke(this,"highlightDebounceMs",300);this.view=e,this.cellId=n,this.scheduleHighlighting=X2(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=ct.sub(Ma,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=PS({state:this.view.state,cellId:this.cellId,variables:ct.get(Ma)});e.length>0&&Re.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:oy.of(e)})})}};qu=xs.define({create(){return{decorations:Bi.none,ranges:[]}},update(e,n){let i={decorations:e.decorations.map(n.changes),ranges:e.ranges};for(let o of n.effects)o.is(oy)&&(i={decorations:Bi.set(o.value.map(s=>IS.range(s.from,s.to))),ranges:o.value});return i},provide:e=>Ut.decorations.from(e,n=>n.decorations)});function qS(e){return[qu,Ml.define(n=>new AS(n,e))]}Kw=function(e,n){return n?qS(e):[]};function sy(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=f4()?"\u2318":"Ctrl",o.append(document.createTextNode("Jump to defining cell ")),o.append(s),o.append(document.createTextNode(" + Click")),i.append(o)}return i}Qu=new Iu("autocomplete-result",async(e,n)=>{let{sendCodeCompletionRequest:i}=Hi();await i({id:e,...n})});var jS={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:jS[i.type]??1,info:()=>sy(i.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:n,limitToType:i,excludeTypes:o,exactName:s,showGoToDefinitionHint:c=!1}){let d=zS(n.options,s);if(!d)return;let f=e-n.prefix_length,p=sy(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 zS(e,n){if(e.length!==0){if(e.length===1)return e[0];if(n)return e.find(i=>i.name===n)}}o_=function(e){var n;return[(n=e==null?void 0:e.pylsp)!=null&&n.enabled&&Ns("pylsp")?[]:_h(async(i,o)=>{let s=await ly({view:i,pos:o,excludeTypes:["tooltip"]});return s===null||s==="cancelled"?null:s},{hideOnChange:!0}),HS]};async function ly({view:e,pos:n,excludeTypes:i}){var w;let o=Zn.findElement(e.dom);if(!o)return Re.error("Failed to find active cell."),null;let s=Zn.parse(o.id),{startToken:c,endToken:d}=cy(e.state.doc,n),f=((w=e.state.field(qu,!1))==null?void 0:w.ranges.some(_=>n>=_.from&&n<=_.to))??!1,p=await Qu.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 cy(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 FS(e){let{head:n}=e.selection.main,i=e.doc.sliceString(n-1,n);return/\w/.test(i)}var BS=X2(async(e,n)=>{if(ct.get(cd).selectedPanel!=="documentation")return;let i=await ly({view:e,pos:n});i!=="cancelled"&&ct.set(ed,{documentation:(i==null?void 0:i.html)??null})},300),HS=Ut.updateListener.of(e=>{if(e.selectionSet&&FS(e.state)){let n=e.state.selection.main.head;BS(e.view,n)}});function uy(e,n){e.focus(),requestAnimationFrame(()=>{e.dispatch({selection:{anchor:n,head:n},effects:Ut.scrollIntoView(n,{y:"center"})})})}Hu=function(e,n){let{state:i}=e,o=iw(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?(uy(e,c),!0):!1};function VS(e,n){return uy(e,e.state.doc.line(n).from),!0}function $S(e){let{from:n,to:i}=e.selection.main;if(n===i){let{startToken:o,endToken:s}=cy(e.doc,n);return e.doc.sliceString(o,s)}return e.doc.sliceString(n,i)}function WS(e,n){if(!n)return null;let i=e[n];return!i||i.declaredBy.length===0?null:i.declaredBy[0]}function US(e){return e.startsWith("_")}Em=function(e){let{state:n}=e,i=$S(n);return i?(vw(e),e.dispatch({effects:L4}),Bh(e,i)):!1},Bh=function(e,n){let i=KS(e,n);return i?Hu(i,n):!1},qw=function(e,n){let i=dy(e);return i?VS(i,n):!1};function KS(e,n){if(US(n))return e;let i=WS(ct.get(Ma),n);return i?dy(i):null}function dy(e){var n;return((n=ct.get(yt).cellHandles[e].current)==null?void 0:n.editorView)??null}function QS(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,oa&&clearTimeout(oa)}function w(u){var m=u.state.vim;return m.onPasteFn||(m.onPasteFn=function(){m.insertMode||(u.setCursor(bt(u.getCursor(),0,1)),dn.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=["<",">"],L=["-",'"',".",":","_","/","+"],z=/^\w$/,U=/^[A-Z]$/;try{U=RegExp("^[\\p{Lu}]$","u")}catch{}function $(u,m){return m>=u.firstLine()&&m<=u.lastLine()}function I(u){return/^[a-z]$/.test(u)}function G(u){return"()[]{}".indexOf(u)!=-1}function pe(u){return _.test(u)}function P(u){return U.test(u)}function A(u){return/^\s*$/.test(u)}function V(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 be(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 we(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}be("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)}}),be("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 Ee=function(){var u=100,m=-1,v=0,b=0,x=Array(u);function k(N,F,q){var oe=x[m%u];function re(Y){var xe=++m%u,_e=x[xe];_e&&_e.clear(),x[xe]=N.setBookmark(Y)}if(oe){var X=oe.find();X&&!ht(X,F)&&re(F)}else re(F);re(q),v=m,b=m-u+1,b<0&&(b=0)}function R(N,F){m+=F,m>v?m=v:m<b&&(m=b);var q=x[(u+m)%u];if(q&&!q.find()){var oe=F>0?1:-1,re,X=N.getCursor();do if(m+=oe,q=x[(u+m)%u],q&&(re=q.find())&&!ht(X,re))break;while(m<v&&m>b)}return q}function O(N,F){var q=m,oe=R(N,F);return m=q,oe&&oe.find()}return{cachedCursor:void 0,add:k,find:O,move:R}},ne=function(u){return u?{changes:u.changes,expectCursorActivityForChange:u.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class ie{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=ne()}exitMacroRecordMode(){var m=K.macroModeState;m.onRecordingDone&&m.onRecordingDone(),m.onRecordingDone=void 0,m.isRecording=!1}enterMacroRecordMode(m,v){var b=K.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 K;function Le(){for(var u in K={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:Ee(),macroModeState:new ie,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 $e{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 st,je={enterVimMode:p,leaveVimMode:y,buildKeyMap:function(){},getRegisterController:function(){return K.registerController},resetVimGlobalState_:Le,getVimGlobalState_:function(){return K},maybeInitVimState_:se,suppressErrorLogging:!1,InsertModeKey:$e,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 N=Object.assign({},k);N.context=R[O],this._mapCommand(N)}}}},langmap:vt,vimKeyFromEvent:en,setOption:J,getOption:we,defineOption:be,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:ki,findKey:function(u,m,v){var b=se(u),x=u;function k(){var q=K.macroModeState;if(q.isRecording){if(m=="q")return q.exitMacroRecordMode(),ft(x),!0;v!="mapping"&&Vr(q,m)}}function R(){if(m=="<Esc>"){if(b.visualMode)Ye(x);else if(b.insertMode)Hn(x);else return;return ft(x),!0}}function O(){if(R())return!0;b.inputState.keyBuffer.push(m);var q=b.inputState.keyBuffer.join(""),oe=m.length==1,re=Pn.matchCommand(q,o,b.inputState,"insert"),X=b.inputState.changeQueue;if(re.type=="none")return ft(x),!1;if(re.type=="partial"){if(re.expectLiteralNext&&(b.expectLiteralNext=!0),st&&window.clearTimeout(st),st=oe&&window.setTimeout(function(){b.insertMode&&b.inputState.keyBuffer.length&&ft(x)},we("insertModeEscKeysTimeout")),oe){var Y=x.listSelections();(!X||X.removed.length!=Y.length)&&(X=b.inputState.changeQueue=new zr),X.inserted+=m;for(var xe=0;xe<Y.length;xe++){var _e=_t(Y[xe].anchor,Y[xe].head),qe=jn(Y[xe].anchor,Y[xe].head),Te=x.getRange(_e,x.state.overwrite?bt(qe,0,1):qe);X.removed[xe]=(X.removed[xe]||"")+Te}}return!oe}else re.type=="full"&&(b.inputState.keyBuffer.length=0);if(b.expectLiteralNext=!1,st&&window.clearTimeout(st),re.command&&X){for(var Y=x.listSelections(),xe=0;xe<Y.length;xe++){var Ie=Y[xe].head;x.replaceRange(X.removed[xe]||"",bt(Ie,0,-X.inserted.length),Ie,"+input")}K.macroModeState.lastInsertModeChanges.changes.pop()}return re.command||ft(x),re.command}function N(){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 ft(x),!1;var re=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,re);return Y.type=="none"?(ft(x),!1):Y.type=="partial"?(Y.expectLiteralNext&&(b.expectLiteralNext=!0),!0):Y.type=="clear"?(ft(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 F=b.insertMode?O():N();if(F===!1)return!b.insertMode&&(m.length===1||e.isMac&&/<A-.>/.test(m))?function(){return!0}:void 0;if(F===!0)return function(){return!0};if(F)return function(){return x.operation(function(){x.curOp.isVimOp=!0;try{if(typeof F!="object")return;F.type=="keyToKey"?qt(x,F.toKeys,F):Pn.processCommand(x,b,F)}catch(q){throw x.state.vim=void 0,se(x),je.suppressErrorLogging||console.log(q),q}return!0})}},handleEx:function(u,m){_n.processCommand(u,m)},defineMotion:ea,defineAction:ti,defineOperator:gi,mapCommand:kc,_mapCommand:ai,defineRegister:hi,exitVisualMode:Ye,exitInsertMode:Hn},He=[],Oe=!1,Ne;function yn(u){if(!Ne)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 vS(e,n){return{get:()=>n.get(e),sub:i=>n.sub(e,()=>i(n.get(e)))}}function bS(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}}Ju=function(e){return e?e.state.field(Lr).type:"python"};function wS(e,n){return!e||Ju(e)===n?!1:e.state.doc.toString().trim()===""?!0:yr[n].isSupported(Jr(e))}Pm=function(e,n,i={}){return!i.force&&!wS(e,n)?!1:(Om(e,{language:n}),n)};function _S(e){return Ta.of([{key:e.getHotkey("cell.format").key,preventDefault:!0,run:n=>(dd({[n.state.facet(La)]:n}),!0)},{key:e.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:n=>{let i=Ju(n);if(i!=="markdown"&&i!=="python")return!1;let o=Pm(n,i==="python"?"markdown":"python",{force:!0});return o==="markdown"&&n.state.facet(Dt).afterToggleMarkdown(),o!==!1}}])}E_=function(){return Ut.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(n=>n.effects.some(i=>i.is(Ls))))return;ty(e.view,{behavior:"smooth"})}})};function ty(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"),bS(o,{offset:{top:30,bottom:150},body:s,behavior:n.behavior})}}function xS(){return{}}let kS,SS,ny;({reducer:kS,createActions:SS,valueAtom:Ma,useActions:ny}=Nl(xS,{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}})),$_=()=>Yn(Ma),q_=function(){return ny()},w_=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 Re.warn(`Error getting ${i} from storage`,s),o}},setItem:(i,o)=>{n.setItem(i,JSON.stringify(e.toSerializable(o)))},removeItem:i=>{n.removeItem(i)}}},Kl=Um(()=>Ts),Dm=Be({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1});function Ns(e){var n;return((n=st.get(Dm))==null?void 0:n[e])??!1}function CS(e,n){if(typeof window>"u")return;let i=`__marimo__${n}`;window[i]&&Re.warn(`Overwriting existing debug object ${i}`),window[i]=e}var ES={markdown:!0,wasm_layouts:!1,rtc_v2:!1,performant_table_charts:!1,chat_modes:!1,cache_panel:!1,external_agents:!1};Gl=function(e){var n,i;return((i=(n=tw())==null?void 0:n.experimental)==null?void 0:i[e])??ES[e]};function TS(e,n){Hi().saveUserConfig({config:{experimental:{[e]:n}}})}y_=({feature:e,children:n})=>Gl(e)?n:null,CS(TS,"setFeatureFlag"),Ul=[{type:"files",Icon:Rg,label:"Files",tooltip:"View files",defaultSection:"sidebar"},{type:"variables",Icon:Qh,label:"Variables",tooltip:"Explore variables and data sources",defaultSection:"sidebar"},{type:"packages",Icon:Fh,label:"Packages",tooltip:"Manage packages",defaultSection:"sidebar"},{type:"ai",Icon:Em,label:"AI",tooltip:"Chat & Agents",defaultSection:"sidebar"},{type:"snippets",Icon:Og,label:"Snippets",tooltip:"Snippets",defaultSection:"developer-panel"},{type:"outline",Icon:Vh,label:"Outline",tooltip:"View outline",defaultSection:"sidebar"},{type:"documentation",Icon:bm,label:"Docs",tooltip:"View live docs",defaultSection:"sidebar"},{type:"dependencies",Icon:Nh,label:"Dependencies",tooltip:"Explore dependencies",defaultSection:"sidebar"},{type:"errors",Icon:tm,label:"Errors",tooltip:"View errors",defaultSection:"developer-panel"},{type:"scratchpad",Icon:Gh,label:"Scratchpad",tooltip:"Scratchpad",defaultSection:"developer-panel"},{type:"tracing",Icon:sm,label:"Tracing",tooltip:"View tracing",defaultSection:"developer-panel"},{type:"secrets",Icon:Dg,label:"Secrets",tooltip:"Manage secrets",defaultSection:"developer-panel",hidden:bh()},{type:"logs",Icon:Yh,label:"Logs",tooltip:"View logs",defaultSection:"developer-panel"},{type:"terminal",Icon:ym,label:"Terminal",tooltip:"Terminal",hidden:bh(),defaultSection:"developer-panel",requiredCapability:"terminal"},{type:"cache",Icon:kD,label:"Cache",tooltip:"View cache",defaultSection:"developer-panel",hidden:!Gl("cache_panel")}],B_=new Map(Ul.map(e=>[e.type,e])),ld=function(e){return!!(e.hidden||e.requiredCapability&&!Ns(e.requiredCapability))};var RS=Gr();km=Fl("marimo:panel-layout",{sidebar:Ul.filter(e=>!ld(e)&&e.defaultSection==="sidebar").map(e=>e.type),developerPanel:Ul.filter(e=>!ld(e)&&e.defaultSection==="developer-panel").map(e=>e.type)},Kl,{getOnInit:!0});function ry(e){let n=st.get(km);return n.sidebar.includes(e)?"sidebar":n.developerPanel.includes(e)?"developer-panel":null}var iy="marimo:sidebar",ay=new ju(J2({selectedPanel:X2().optional().transform(e=>e),isSidebarOpen:Y2(),isDeveloperPanelOpen:Y2().optional().default(!1),selectedDeveloperPanelTab:X2().optional().default("terminal").transform(e=>e)}),DS);function DS(){return{selectedPanel:"variables",isSidebarOpen:!1,isDeveloperPanelOpen:!1,selectedDeveloperPanelTab:"terminal"}}let OS,PS,oy;({reducer:OS,createActions:PS,valueAtom:cd,useActions:oy}=Nl(()=>ay.get(iy),{openApplication:(e,n)=>{let i=ry(n);return i==="sidebar"?{...e,selectedPanel:n,isSidebarOpen:!0}:i==="developer-panel"?{...e,selectedDeveloperPanelTab:n,isDeveloperPanelOpen:!0}:e},toggleApplication:(e,n)=>{let i=ry(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)=>ay.set(iy,n)])),O_=()=>{let e=(0,RS.c)(2),n=Yn(cd);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},K_=function(){return oy()},ed=Be({documentation:null});var sy=new Set(["FunctionDefinition","LambdaExpression","ArrayComprehensionExpression","SetComprehension","DictionaryComprehensionExpression","ComprehensionExpression","ClassDefinition"]);function MS(e){let n=ow(e.state);if(!n||IS(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 G,pe,P,A,V,de,fe,be,J,we,Ee;let L=E.cursor(),z=L.name,U=L.from,$=sy.has(z),I=T;switch($&&(I=[...T,U],s.set(U,new Set),c.set(U,z)),z){case"FunctionDefinition":{let ne=E.cursor();ne.firstChild();do if(ne.name==="VariableName"){let se=e.state.doc.sliceString(ne.from,ne.to),K=T[T.length-1]??-1;s.has(K)||s.set(K,new Set),(G=s.get(K))==null||G.add(se);break}while(ne.nextSibling());let ie=E.cursor();ie.firstChild();do if(ie.name==="ParamList"){let se=ie.node.cursor();se.firstChild();do if(se.name==="VariableName"){let K=e.state.doc.sliceString(se.from,se.to);(pe=s.get(U))==null||pe.add(K)}while(se.nextSibling())}while(ie.nextSibling());break}case"LambdaExpression":{let ne=E.cursor();ne.firstChild();do if(ne.name==="ParamList"){let ie=ne.node.cursor();ie.firstChild();do if(ie.name==="VariableName"){let se=e.state.doc.sliceString(ie.from,ie.to);(P=s.get(U))==null||P.add(se)}while(ie.nextSibling())}while(ne.nextSibling());break}case"ArrayComprehensionExpression":case"DictionaryComprehensionExpression":case"SetComprehension":case"ComprehensionExpression":{let ne=E.cursor();ne.firstChild();let ie=!1;do if(ne.name==="for")ie=!0;else if(ie&&ne.name==="VariableName"){let se=e.state.doc.sliceString(ne.from,ne.to);(A=s.get(U))==null||A.add(se)}else if(ie&&ne.name==="TupleExpression"){let se=ne.node.cursor();se.firstChild();do if(se.name==="VariableName"){let K=e.state.doc.sliceString(se.from,se.to);(V=s.get(U))==null||V.add(K)}while(se.nextSibling())}else ie&&ne.name==="in"&&(ie=!1);while(ne.nextSibling());break}case"ClassDefinition":{let ne=E.cursor();ne.firstChild();do if(ne.name==="VariableName"){let ie=e.state.doc.sliceString(ne.from,ne.to),se=T[T.length-1]??-1;s.has(se)||s.set(se,new Set),(de=s.get(se))==null||de.add(ie);break}while(ne.nextSibling());d.set(U,[]);break}case"AssignStatement":{let ne=E.cursor(),ie=[];ne.firstChild();do ne.name==="AssignOp"&&ie.push(ne.from);while(ne.nextSibling());let se=ie[ie.length-1],K=E.cursor();K.firstChild();let Le=I[I.length-1]??-1;do K.from<se&&Qd(K,{currentScope:Le,state:e.state,allDeclarations:s,scopeTypes:c,classLevelDeclarations:d,assignmentPosition:L.to});while(K.nextSibling());break}case"ForStatement":{let ne=E.cursor();ne.firstChild();let ie=!1;do if(ne.name==="for")ie=!0;else if(ie&&ne.name==="VariableName"){let se=e.state.doc.sliceString(ne.from,ne.to),K=I[I.length-1]??-1;s.has(K)||s.set(K,new Set),(fe=s.get(K))==null||fe.add(se)}else ie&&ne.name==="in"&&(ie=!1);while(ne.nextSibling());break}case"ImportStatement":{let ne=E.cursor();ne.firstChild();do if(ne.name==="VariableName"){let ie=e.state.doc.sliceString(ne.from,ne.to),se=I[I.length-1]??-1;s.has(se)||s.set(se,new Set),(be=s.get(se))==null||be.add(ie)}while(ne.nextSibling());break}case"ImportFromStatement":{let ne=E.cursor();ne.firstChild();let ie=!1;do if(ne.name==="import")ie=!0;else if(ie&&ne.name==="VariableName"){let se=e.state.doc.sliceString(ne.from,ne.to),K=I[I.length-1]??-1;s.has(K)||s.set(K,new Set),(J=s.get(K))==null||J.add(se)}while(ne.nextSibling());break}case"TryStatement":{let ne=E.cursor();ne.firstChild();let ie=!1;do if(ne.name==="as")ie=!0;else if(ie&&ne.name==="VariableName"){let se=e.state.doc.sliceString(ne.from,ne.to),K=I[I.length-1]??-1;s.has(K)||s.set(K,new Set),(we=s.get(K))==null||we.add(se),ie=!1}while(ne.nextSibling());break}case"WithStatement":{let ne=E.cursor();ne.firstChild();let ie=!1;do if(ne.name==="as")ie=!0;else if(ie&&ne.name==="VariableName"){let se=e.state.doc.sliceString(ne.from,ne.to),K=I[I.length-1]??-1;s.has(K)||s.set(K,new Set),(Ee=s.get(K))==null||Ee.add(se),ie=!1}while(ne.nextSibling());break}}C(L,ne=>{f(ne,I)})}function p(E,T,L){let z=d.get(T);return z?z.some(([U,$])=>U===E&&$<L):!1}function y(E,T,L){var z,U;for(let $ of T)if(c.get($)==="ClassDefinition"){if(p(E,$,L))return!0}else if((z=s.get($))!=null&&z.has(E))return!0;return((U=s.get(-1))==null?void 0:U.has(E))??!1}function w(E,T){let L=E.cursor(),z=L.name,U=L.from,$=sy.has(z),I=T;if($&&(I=[...T,U]),z==="VariableName"){let G=e.state.doc.sliceString(L.from,L.to);_(G,L)&&(y(G,I,L.from)||o.push({from:L.from,to:L.to,variableName:G}))}C(L,G=>{w(G,I)})}function _(E,T){return i.has(E)&&!LS(T)&&!NS(T)}function C(E,T){if(E.firstChild())do T(E.node);while(E.nextSibling())}return f(n,[]),w(n,[]),o}function LS(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 NS(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 IS(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 AS=Bi.mark({class:"mo-cm-reactive-reference"});c_=Bi.mark({class:"mo-cm-reactive-reference-hover"});var ly=Fi.define(),qS=class{constructor(e,n){ke(this,"highlightDebounceMs",300);this.view=e,this.cellId=n,this.scheduleHighlighting=Z2(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=st.sub(Ma,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=MS({state:this.view.state,cellId:this.cellId,variables:st.get(Ma)});e.length>0&&Re.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:ly.of(e)})})}};qu=xs.define({create(){return{decorations:Bi.none,ranges:[]}},update(e,n){let i={decorations:e.decorations.map(n.changes),ranges:e.ranges};for(let o of n.effects)o.is(ly)&&(i={decorations:Bi.set(o.value.map(s=>AS.range(s.from,s.to))),ranges:o.value});return i},provide:e=>Ut.decorations.from(e,n=>n.decorations)});function jS(e){return[qu,Ml.define(n=>new qS(n,e))]}Gw=function(e,n){return n?jS(e):[]};function cy(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=p4()?"\u2318":"Ctrl",o.append(document.createTextNode("Jump to defining cell ")),o.append(s),o.append(document.createTextNode(" + Click")),i.append(o)}return i}Qu=new Iu("autocomplete-result",async(e,n)=>{let{sendCodeCompletionRequest:i}=Hi();await i({id:e,...n})});var zS={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:zS[i.type]??1,info:()=>cy(i.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:n,limitToType:i,excludeTypes:o,exactName:s,showGoToDefinitionHint:c=!1}){let d=FS(n.options,s);if(!d)return;let f=e-n.prefix_length,p=cy(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 FS(e,n){if(e.length!==0){if(e.length===1)return e[0];if(n)return e.find(i=>i.name===n)}}l_=function(e){var n;return[(n=e==null?void 0:e.pylsp)!=null&&n.enabled&&Ns("pylsp")?[]:_h(async(i,o)=>{let s=await uy({view:i,pos:o,excludeTypes:["tooltip"]});return s===null||s==="cancelled"?null:s},{hideOnChange:!0}),VS]};async function uy({view:e,pos:n,excludeTypes:i}){var w;let o=Zn.findElement(e.dom);if(!o)return Re.error("Failed to find active cell."),null;let s=Zn.parse(o.id),{startToken:c,endToken:d}=dy(e.state.doc,n),f=((w=e.state.field(qu,!1))==null?void 0:w.ranges.some(_=>n>=_.from&&n<=_.to))??!1,p=await Qu.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 dy(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 BS(e){let{head:n}=e.selection.main,i=e.doc.sliceString(n-1,n);return/\w/.test(i)}var HS=Z2(async(e,n)=>{if(st.get(cd).selectedPanel!=="documentation")return;let i=await uy({view:e,pos:n});i!=="cancelled"&&st.set(ed,{documentation:(i==null?void 0:i.html)??null})},300),VS=Ut.updateListener.of(e=>{if(e.selectionSet&&BS(e.state)){let n=e.state.selection.main.head;HS(e.view,n)}});function fy(e,n){e.focus(),requestAnimationFrame(()=>{e.dispatch({selection:{anchor:n,head:n},effects:Ut.scrollIntoView(n,{y:"center"})})})}Hu=function(e,n){let{state:i}=e,o=ow(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?(fy(e,c),!0):!1};function $S(e,n){return fy(e,e.state.doc.line(n).from),!0}function WS(e){let{from:n,to:i}=e.selection.main;if(n===i){let{startToken:o,endToken:s}=dy(e.doc,n);return e.doc.sliceString(o,s)}return e.doc.sliceString(n,i)}function US(e,n){if(!n)return null;let i=e[n];return!i||i.declaredBy.length===0?null:i.declaredBy[0]}function KS(e){return e.startsWith("_")}Tm=function(e){let{state:n}=e,i=WS(n);return i?(ww(e),e.dispatch({effects:N4}),Bh(e,i)):!1},Bh=function(e,n){let i=QS(e,n);return i?Hu(i,n):!1},zw=function(e,n){let i=py(e);return i?$S(i,n):!1};function QS(e,n){if(KS(n))return e;let i=US(st.get(Ma),n);return i?py(i):null}function py(e){var n;return((n=st.get(yt).cellHandles[e].current)==null?void 0:n.editorView)??null}function GS(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,oa&&clearTimeout(oa)}function w(u){var m=u.state.vim;return m.onPasteFn||(m.onPasteFn=function(){m.insertMode||(u.setCursor(bt(u.getCursor(),0,1)),dn.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=["<",">"],L=["-",'"',".",":","_","/","+"],z=/^\w$/,U=/^[A-Z]$/;try{U=RegExp("^[\\p{Lu}]$","u")}catch{}function $(u,m){return m>=u.firstLine()&&m<=u.lastLine()}function I(u){return/^[a-z]$/.test(u)}function G(u){return"()[]{}".indexOf(u)!=-1}function pe(u){return _.test(u)}function P(u){return U.test(u)}function A(u){return/^\s*$/.test(u)}function V(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 be(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 we(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}be("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)}}),be("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 Ee=function(){var u=100,m=-1,v=0,b=0,x=Array(u);function k(N,F,q){var oe=x[m%u];function re(Y){var xe=++m%u,_e=x[xe];_e&&_e.clear(),x[xe]=N.setBookmark(Y)}if(oe){var X=oe.find();X&&!ht(X,F)&&re(F)}else re(F);re(q),v=m,b=m-u+1,b<0&&(b=0)}function R(N,F){m+=F,m>v?m=v:m<b&&(m=b);var q=x[(u+m)%u];if(q&&!q.find()){var oe=F>0?1:-1,re,X=N.getCursor();do if(m+=oe,q=x[(u+m)%u],q&&(re=q.find())&&!ht(X,re))break;while(m<v&&m>b)}return q}function O(N,F){var q=m,oe=R(N,F);return m=q,oe&&oe.find()}return{cachedCursor:void 0,add:k,find:O,move:R}},ne=function(u){return u?{changes:u.changes,expectCursorActivityForChange:u.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class ie{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=ne()}exitMacroRecordMode(){var m=K.macroModeState;m.onRecordingDone&&m.onRecordingDone(),m.onRecordingDone=void 0,m.isRecording=!1}enterMacroRecordMode(m,v){var b=K.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 K;function Le(){for(var u in K={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:Ee(),macroModeState:new ie,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 $e{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 lt,je={enterVimMode:p,leaveVimMode:y,buildKeyMap:function(){},getRegisterController:function(){return K.registerController},resetVimGlobalState_:Le,getVimGlobalState_:function(){return K},maybeInitVimState_:se,suppressErrorLogging:!1,InsertModeKey:$e,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 N=Object.assign({},k);N.context=R[O],this._mapCommand(N)}}}},langmap:vt,vimKeyFromEvent:en,setOption:J,getOption:we,defineOption:be,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:ki,findKey:function(u,m,v){var b=se(u),x=u;function k(){var q=K.macroModeState;if(q.isRecording){if(m=="q")return q.exitMacroRecordMode(),ft(x),!0;v!="mapping"&&Vr(q,m)}}function R(){if(m=="<Esc>"){if(b.visualMode)Ye(x);else if(b.insertMode)Hn(x);else return;return ft(x),!0}}function O(){if(R())return!0;b.inputState.keyBuffer.push(m);var q=b.inputState.keyBuffer.join(""),oe=m.length==1,re=Pn.matchCommand(q,o,b.inputState,"insert"),X=b.inputState.changeQueue;if(re.type=="none")return ft(x),!1;if(re.type=="partial"){if(re.expectLiteralNext&&(b.expectLiteralNext=!0),lt&&window.clearTimeout(lt),lt=oe&&window.setTimeout(function(){b.insertMode&&b.inputState.keyBuffer.length&&ft(x)},we("insertModeEscKeysTimeout")),oe){var Y=x.listSelections();(!X||X.removed.length!=Y.length)&&(X=b.inputState.changeQueue=new zr),X.inserted+=m;for(var xe=0;xe<Y.length;xe++){var _e=_t(Y[xe].anchor,Y[xe].head),qe=jn(Y[xe].anchor,Y[xe].head),Te=x.getRange(_e,x.state.overwrite?bt(qe,0,1):qe);X.removed[xe]=(X.removed[xe]||"")+Te}}return!oe}else re.type=="full"&&(b.inputState.keyBuffer.length=0);if(b.expectLiteralNext=!1,lt&&window.clearTimeout(lt),re.command&&X){for(var Y=x.listSelections(),xe=0;xe<Y.length;xe++){var Ie=Y[xe].head;x.replaceRange(X.removed[xe]||"",bt(Ie,0,-X.inserted.length),Ie,"+input")}K.macroModeState.lastInsertModeChanges.changes.pop()}return re.command||ft(x),re.command}function N(){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 ft(x),!1;var re=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,re);return Y.type=="none"?(ft(x),!1):Y.type=="partial"?(Y.expectLiteralNext&&(b.expectLiteralNext=!0),!0):Y.type=="clear"?(ft(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 F=b.insertMode?O():N();if(F===!1)return!b.insertMode&&(m.length===1||e.isMac&&/<A-.>/.test(m))?function(){return!0}:void 0;if(F===!0)return function(){return!0};if(F)return function(){return x.operation(function(){x.curOp.isVimOp=!0;try{if(typeof F!="object")return;F.type=="keyToKey"?qt(x,F.toKeys,F):Pn.processCommand(x,b,F)}catch(q){throw x.state.vim=void 0,se(x),je.suppressErrorLogging||console.log(q),q}return!0})}},handleEx:function(u,m){_n.processCommand(u,m)},defineMotion:ea,defineAction:ti,defineOperator:gi,mapCommand:kc,_mapCommand:ai,defineRegister:hi,exitVisualMode:Ye,exitInsertMode:Hn},He=[],Oe=!1,Ne;function yn(u){if(!Ne)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=Ne.value||"",b={key:We[m],target:{value:v,selectionEnd:v.length,selectionStart:v.length}};Ne.onKeyDown&&Ne.onKeyDown(b,Ne.value,k),Ne&&Ne.onKeyUp&&Ne.onKeyUp(b,Ne.value,k);return}}if(u==`
90
90
  `){var x=Ne;Ne=null,x.onClose&&x.onClose(x.value)}else Ne.value=(Ne.value||"")+u;function k(R){Ne&&(typeof R=="string"?Ne.value=R:Ne=null)}}function qt(u,m,v){var b=Oe;if(v){if(He.indexOf(v)!=-1)return;He.push(v),Oe=v.noremap!=0}try{for(var x=se(u),k=/<(?:[CSMA]-)*\w+>|./gi,R;R=k.exec(m);){var O=R[0],N=x.insertMode;if(Ne){yn(O);continue}if(!je.handleKey(u,O,"mapping")&&N&&x.insertMode){if(O[0]=="<"){var F=O.toLowerCase().slice(1,-1);if(F=F.split("-").pop()||"",F=="lt")O="<";else if(F=="space")O=" ";else if(F=="cr")O=`
91
91
  `;else if(We.hasOwnProperty(F)){O=We[F],Ya(u,O);continue}else O=O[0],k.lastIndex=R.index+1}u.replaceSelection(O)}}}finally{if(He.pop(),Oe=He.length?b:!1,!He.length&&Ne){var q=Ne;Ne=null,ia(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"},cn={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 en(u,m){var k;var v=u.key;if(!cn[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 vt(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}}be("langmap",void 0,"string",["lmap"],function(u,m){if(u===void 0)return f.string;vt(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 ft(u,m){u.state.vim.inputState=new vr,u.state.vim.expectLiteralNext=!1,e.signal(u,"vim-command-done",m)}function zr(){this.removed=[],this.inserted=""}class tn{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(ne(m))}pushSearchQuery(m){this.searchQueries.push(m)}clear(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1}toString(){return this.keyBuffer.join("")}}function hi(u,m){var v=K.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,L.push(u)}class On{constructor(m){this.registers=m,this.unnamedRegister=m['"']=new tn,m["."]=new tn,m[":"]=new tn,m["/"]=new tn,m["+"]=new tn}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 tn(b,x,k);break;case"delete":case"change":b.indexOf(`
95
- `)==-1?this.registers["-"]=new tn(b,x):(this.shiftNumericRegisters_(),this.registers[1]=new tn(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 tn),this.registers[m]):this.unnamedRegister}isValidRegister(m){return m&&(de(m,L)||z.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=yi(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=Fr(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 ft(u);b.operator=v.operator,b.operatorArgs=Fr(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=Fr(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=Fr(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,ft(u),m.lastMotion=null,v.isEdit&&this.recordLastEdit(m,b,v),dn[v.action](u,R,m)},processSearch:function(u,m,v){if(!u.getSearchCursor)return;var b=v.searchArgs.forward,x=v.searchArgs.wholeWordOnly;Un(u).setReversed(!b);var k=b?"/":"?",R=Un(u).getQuery(),O=u.getScrollInfo(),N="";function F(Te,Ie,dt){K.searchHistoryController.pushInput(Te),K.searchHistoryController.reset();try{wi(u,Te,Ie,dt)}catch{lt(u,"Invalid regex: "+Te),ft(u);return}Pn.processMotion(u,m,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:v.searchArgs.toJumplist}})}function q(Te){u.scrollTo(O.left,O.top),F(Te,!0,!0);var Ie=K.macroModeState;Ie.isRecording&&Ga(Ie,Te)}function oe(){return we("pcre")?"(JavaScript regexp: set pcre)":"(Vim regexp: set nopcre)"}function re(Te,Ie,dt){var Je=en(Te),Mt,zt;Je=="<Up>"||Je=="<Down>"?(Mt=Je=="<Up>",zt=Te.target?Te.target.selectionEnd:0,Ie=K.searchHistoryController.nextMatch(Ie,Mt)||"",dt(Ie),zt&&Te.target&&(Te.target.selectionEnd=Te.target.selectionStart=Math.min(zt,Te.target.value.length))):Je&&Je!="<Left>"&&Je!="<Right>"&&K.searchHistoryController.reset(),N=Ie,X()}function X(){var Te;try{Te=wi(u,N,!0,!0)}catch{}Te?u.scrollIntoView(_i(u,!b,Te),30):(xi(u),u.scrollTo(O.left,O.top))}function Y(Te,Ie,dt){var Je=en(Te);Je=="<Esc>"||Je=="<C-c>"||Je=="<C-[>"||Je=="<BS>"&&Ie==""?(K.searchHistoryController.pushInput(Ie),K.searchHistoryController.reset(),wi(u,(R==null?void 0:R.source)||""),xi(u),u.scrollTo(O.left,O.top),e.e_stop(Te),ft(u),dt(),u.focus()):Je=="<Up>"||Je=="<Down>"?e.e_stop(Te):Je=="<C-u>"&&(e.e_stop(Te),dt(""))}switch(v.searchArgs.querySrc){case"prompt":var xe=K.macroModeState;xe.isPlaying?F(xe.replaySearchQueries.shift()||"",!0,!1):ia(u,{onClose:q,prefix:k,desc:Nn("span",{$cursor:"pointer",onmousedown:function(Ie){Ie.preventDefault(),J("pcre",!we("pcre")),this.textContent=oe(),X()}},oe()),onKeyUp:re,onKeyDown:Y});break;case"wordUnderCursor":var _e=Ce(u,{noSymbol:!0}),qe=!0;if(_e||(_e=Ce(u,{noSymbol:!1}),qe=!1),!_e){lt(u,"No word under cursor"),ft(u);return}let Te=u.getLine(_e.start.line).substring(_e.start.ch,_e.end.ch);Te=qe&&x?"\\b"+Te+"\\b":Mn(Te),K.jumpList.cachedCursor=u.getCursor(),u.setCursor(_e.start),F(Te,!0,!1);break}},processEx:function(u,m,v){function b(O){K.exCommandHistoryController.pushInput(O),K.exCommandHistoryController.reset(),_n.processCommand(u,O),u.state.vim&&ft(u),xi(u)}function x(O,N,F){var q=en(O),oe,re;(q=="<Esc>"||q=="<C-c>"||q=="<C-[>"||q=="<BS>"&&N=="")&&(K.exCommandHistoryController.pushInput(N),K.exCommandHistoryController.reset(),e.e_stop(O),ft(u),xi(u),F(),u.focus()),q=="<Up>"||q=="<Down>"?(e.e_stop(O),oe=q=="<Up>",re=O.target?O.target.selectionEnd:0,N=K.exCommandHistoryController.nextMatch(N,oe)||"",F(N),re&&O.target&&(O.target.selectionEnd=O.target.selectionStart=Math.min(re,O.target.value.length))):q=="<C-u>"?(e.e_stop(O),F("")):q&&q!="<Left>"&&q!="<Right>"&&K.exCommandHistoryController.reset()}function k(O,N){var F=new e.StringStream(N),q={};try{if(_n.parseInput_(u,F,q),q.commandName!="s"){xi(u);return}var oe=_n.matchCommand_(q.commandName);if(!oe||(_n.parseCommandArgs_(F,q,oe),!q.argString))return;var re=Vs(q.argString.slice(1),!0,!0);re&&Bo(u,re)}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),ia(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,N=m.sel,F=Ge(m.visualMode?jt(u,N.head):u.getCursor("head")),q=Ge(m.visualMode?jt(u,N.anchor):u.getCursor("anchor")),oe=Ge(F),re=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,ft(u),b){var _e=un[b](u,F,x,m,v);if(m.lastMotion=un[b],!_e)return;if(x.toJumplist){var qe=K.jumpList,Te=qe.cachedCursor;Te?(Fe(u,Te,_e),delete qe.cachedCursor):Fe(u,F,_e)}_e instanceof Array?(Y=_e[0],X=_e[1]):X=_e,X||(X=Ge(F)),m.visualMode?(m.visualBlock&&X.ch===1/0||(X=jt(u,X,oe)),Y&&(Y=jt(u,Y)),Y||(Y=re),N.anchor=Y,N.head=X,zn(u),Fn(u,m,"<",wt(Y,X)?Y:X),Fn(u,m,">",wt(Y,X)?X:Y)):k||(X=jt(u,X,oe),u.setCursor(X.line,X.ch))}if(k){if(R.lastSel){Y=re;var Ie=R.lastSel,dt=Math.abs(Ie.head.line-Ie.anchor.line),Je=Math.abs(Ie.head.ch-Ie.anchor.ch);X=Ie.visualLine?new n(re.line+dt,re.ch):Ie.visualBlock?new n(re.line+dt,re.ch+Je):Ie.head.line==Ie.anchor.line?new n(re.line,re.ch+Je):new n(re.line+dt,re.ch),m.visualMode=!0,m.visualLine=Ie.visualLine,m.visualBlock=Ie.visualBlock,N=m.sel={anchor:Y,head:X},zn(u)}else m.visualMode&&(R.lastSel={anchor:Ge(N.anchor),head:Ge(N.head),visualBlock:m.visualBlock,visualLine:m.visualLine});var Mt,zt,Ue,Ve,Vt;if(m.visualMode){Mt=_t(N.head,N.anchor),zt=jn(N.head,N.anchor),Ue=m.visualLine||R.linewise,Ve=m.visualBlock?"block":Ue?"line":"char";var nn=i(u,Mt,zt);if(Vt=or(u,{anchor:nn.start,head:nn.end},Ve),Ue){var fn=Vt.ranges;if(Ve=="block")for(var Za=0;Za<fn.length;Za++)fn[Za].head.ch=xt(u,fn[Za].head.line);else Ve=="line"&&(fn[0].head=new n(fn[0].head.line+1,0))}}else{if(Mt=Ge(Y||re),zt=Ge(X||oe),wt(zt,Mt)){var Sc=Mt;Mt=zt,zt=Sc}Ue=x.linewise||R.linewise,Ue?ee(u,Mt,zt):x.forward&&j(u,Mt,zt),Ve="char";var Cc=!x.inclusive||Ue,nn=i(u,Mt,zt);Vt=or(u,{anchor:nn.start,head:nn.end},Ve,Cc)}u.setSelections(Vt.ranges,Vt.primary),m.lastMotion=null,R.repeat=xe,R.registerName=O,R.linewise=Ue;var Wo=Wt[k](u,R,Vt.ranges,re,X);m.visualMode&&Ye(u,Wo!=null),Wo&&u.setCursor(Wo)}},recordLastEdit:function(u,m,v){var b=K.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)}},un={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=Un(u),x=b.getQuery();if(x){var k=!v.forward;k=b.isReversed()?!k:k,Bo(u,x);var R=_i(u,k,x,v.repeat);return R||lt(u,"No match found "+x+(we("pcre")?" (set nopcre to use Vim regexps)":"")),R}},findAndSelectNextInclusive:function(u,m,v,b,x){var k=Un(u),R=k.getQuery();if(R){var O=!v.forward;O=k.isReversed()?!O:O;var N=kf(u,O,R,v.repeat,b);if(N){if(x.operator)return N;var F=N[0],q=new n(N[1].line,N[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,F]:[oe,q]:v.forward?[oe,q]:[oe,F]}else b.visualMode=!0,b.visualLine=!1,b.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""});return O?[q,F]:[F,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?[jt(u,new n(x.anchor.line,x.head.ch)),jt(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(I(O)){var N=b.marks[O].find();if(!(v.forward?wt(N,R):wt(R,N))&&!(v.linewise&&N.line==R.line)){var F=ht(R,x),q=v.forward?_r(R,N,x):_r(x,N,R);(F||q)&&(x=N)}}}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,N=u.firstLine(),F=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<N&&x.line==N?this.moveToStartOfLine(u,m,v,b):O>F&&x.line==F?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 N=u.charCoords(new n(u.firstLine(),0),"div");N.left=b.lastHSPos,R=u.coordsChar(N,"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 Jt(u,m,v.repeat,b).start},moveBySentence:function(u,m,v){var b=v.forward?1:-1;return mc(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=un.moveByDisplayLines(u,m,v,b),!k)return null;var N=u.charCoords(k,"local");return u.scrollTo(null,x.top+N.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 at(k,v),x?(x.ch+=k,x):null},moveToCharacter:function(u,m,v){var b=v.repeat;return at(0,v),sr(u,b,v.forward,v.selectedCharacter,m)||m},moveToSymbol:function(u,m,v){var b=v.repeat;return v.selectedCharacter&&Pt(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,ri(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&&G(R)){var O=u.getTokenTypeAt(new n(b,x+1));if(O!=="string"&&O!=="comment")break}if(x<k.length){var N=R==="<"||R===">"?/[(){}[\]<>]/:/[(){}[\]]/;return u.findMatchingBracket(new n(b,x),{bracketRegex:N}).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,N,F;if(x[R]){if(F=!0,N=ii(u,m,R,O),!N){var q=u.getSearchCursor(RegExp("\\"+R,"g"),m);q.find()&&(N=ii(u,q.from(),R,O))}}else if(k[R])F=!0,N=ra(u,m,R,O);else if(R==="W"||R==="w")for(var oe=v.repeat||1;oe-- >0;){var re=Ce(u,{inclusive:O,innerWord:!O,bigWord:R==="W",noSymbol:R==="W",multiline:!0},N&&N.end);re&&(N||(N=re),N.end=re.end)}else if(R==="p")if(N=Jt(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),N.end.line--}else if(R==="t")N=ze(u,m,O);else if(R==="s"){var Y=u.getLine(m.line);m.ch>0&&V(Y[m.ch])&&--m.ch;var xe=Bs(u,m,v.repeat,1,O),_e=Bs(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}),N={start:_e,end:xe}}return N?u.state.vim.visualMode?bi(u,N.start,N.end,F):[N.start,N.end]:null},repeatLastCharacterSearch:function(u,m,v){var b=K.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 ea(u,m){un[u]=m}function mi(u,m){for(var v=[],b=0;b<m;b++)v.push(u);return v}var Wt={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 N=mi("",v.length);u.replaceSelections(N),b=_t(v[0].head,v[0].anchor)}else{x=u.getRange(R,O);var F=k.lastEditInputState;if((F==null?void 0:F.motion)=="moveByWords"&&!A(x)){var q=/\s+$/.exec(x);q&&F.motionArgs&&F.motionArgs.forward&&(O=bt(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}K.registerController.pushText(m.registerName,"change",x,m.linewise,v.length>1),dn.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=mi("",v.length);u.replaceSelections(R),b=_t(v[0].head,v[0].anchor)}else{var O=v[0].anchor,N=v[0].head;m.linewise&&N.line!=u.firstLine()&&O.line==u.lastLine()&&O.line==N.line-1&&(O.line==u.firstLine()?O.ch=0:O=new n(O.line-1,xt(u,O.line-1))),x=u.getRange(O,N),u.replaceRange("",O,N),b=O,m.linewise&&(b=un.moveToFirstNonWhiteSpaceCharacter(u,O))}return K.registerController.pushText(m.registerName,"delete",x,m.linewise,k.visualBlock),jt(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,N=v.length-1;N>=0;N--)if(O=_t(v[N].anchor,v[N].head),m.indentRight)u.replaceRange(R.repeat(x),O,O);else{for(var F=u.getLine(O.line),q=0,oe=0;oe<x;oe++){var re=F[O.ch+q];if(re==" ")q++;else if(re==" "){q++;for(var X=1;X<R.length&&(re=F[O.ch+q],re===" ");X++)q++}else break}u.replaceRange("",O,bt(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 N=Y;N<=xe;N++)for(var oe=0;oe<x;oe++)u.indentLine(N,m.indentRight)}return un.moveToFirstNonWhiteSpaceCharacter(u,v[0].anchor)},indentAuto:function(u,m,v){return u.execCommand("indentAuto"),un.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,N=0;N<k.length;N++){var F=k[N],q="";if(O===!0)q=F.toLowerCase();else if(O===!1)q=F.toUpperCase();else for(var oe=0;oe<F.length;oe++){var re=F.charAt(oe);q+=P(re)?re.toLowerCase():re.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?un.moveToFirstNonWhiteSpaceCharacter(u,b):m.linewise?b:_t(v[0].anchor,v[0].head)},yank:function(u,m,v,b){var x=u.state.vim,k=u.getSelection(),R=x.visualMode?_t(x.sel.anchor,x.sel.head,v[0].head,v[0].anchor):b;return K.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 N=k[O].split("").map(F=>{let q=F.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):F}).join("");R.push(N)}return u.replaceSelections(R),m.shouldMoveCursor?x:!u.state.vim.visualMode&&m.linewise&&v[0].anchor.line+1==v[0].head.line?un.moveToFirstNonWhiteSpaceCharacter(u,b):m.linewise?b:_t(v[0].anchor,v[0].head)}};function gi(u,m){Wt[u]=m}var dn={jumpListWalk:function(u,m,v){if(!v.visualMode){var b=m.repeat||1,x=m.forward,k=K.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,N=Ge(u.getCursor()),F=u.charCoords(N,"local");if(m.forward)O>F.top?(N.line+=(O-F.top)/x,N.line=Math.ceil(N.line),u.setCursor(N),F=u.charCoords(N,"local"),u.scrollTo(null,F.top)):u.scrollTo(null,O);else{var q=O+u.getScrollInfo().clientHeight;q<F.bottom?(N.line-=(F.bottom-q)/x,N.line=Math.floor(N.line),u.setCursor(N),F=u.charCoords(N,"local"),u.scrollTo(null,F.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=K.macroModeState;for(b=="@"?b=k.latestRegister||"":k.latestRegister=b;x--;)Qa(u,v,k,b)},enterMacroRecordMode:function(u,m){var v=K.macroModeState,b=m.selectedCharacter;K.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,xt(u,k.line));else if(b=="bol")k=new n(k.line,0);else if(b=="charAfter"){var O=i(u,k,bt(k,0,1));k=O.end}else if(b=="firstNonBlank"){var O=i(u,k,un.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?bt(x.head,0,1):new n(x.anchor.line,0)}else if(b=="inplace"){if(v.visualMode)return}else b=="lastEdit"&&(k=_c(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"})),K.macroModeState.isPlaying||(u.on("change",$r),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=u.setBookmark(k,{insertLeft:!0}),e.on(u.getInputField(),"keydown",Ks)),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=jt(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,"<",_t(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,"<",_t(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"),wt(x,b)){var k=x;x=b,b=k}x.ch=xt(u,x.line)-1}else{var R=Math.max(m.repeat,2);b=u.getCursor(),x=jt(u,new n(b.line+R-1,1/0))}for(var O=0,N=b.line;N<x.line;N++){O=xt(u,b.line);var F="",q=0;if(!m.keepSpaces){var oe=u.getLine(b.line+1);q=oe.search(/\S/),q==-1?q=oe.length:F=" "}u.replaceRange(F,new n(b.line,O),new n(b.line+1,q))}var re=jt(u,new n(b.line,O));v.visualMode&&Ye(u,!1),u.setCursor(re)},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 tn(b,x):(this.shiftNumericRegisters_(),this.registers[1]=new tn(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 tn),this.registers[m]):this.unnamedRegister}isValidRegister(m){return m&&(de(m,L)||z.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=yi(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=Fr(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 ft(u);b.operator=v.operator,b.operatorArgs=Fr(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=Fr(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=Fr(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,ft(u),m.lastMotion=null,v.isEdit&&this.recordLastEdit(m,b,v),dn[v.action](u,R,m)},processSearch:function(u,m,v){if(!u.getSearchCursor)return;var b=v.searchArgs.forward,x=v.searchArgs.wholeWordOnly;Un(u).setReversed(!b);var k=b?"/":"?",R=Un(u).getQuery(),O=u.getScrollInfo(),N="";function F(Te,Ie,dt){K.searchHistoryController.pushInput(Te),K.searchHistoryController.reset();try{wi(u,Te,Ie,dt)}catch{ct(u,"Invalid regex: "+Te),ft(u);return}Pn.processMotion(u,m,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:v.searchArgs.toJumplist}})}function q(Te){u.scrollTo(O.left,O.top),F(Te,!0,!0);var Ie=K.macroModeState;Ie.isRecording&&Ga(Ie,Te)}function oe(){return we("pcre")?"(JavaScript regexp: set pcre)":"(Vim regexp: set nopcre)"}function re(Te,Ie,dt){var Je=en(Te),Mt,zt;Je=="<Up>"||Je=="<Down>"?(Mt=Je=="<Up>",zt=Te.target?Te.target.selectionEnd:0,Ie=K.searchHistoryController.nextMatch(Ie,Mt)||"",dt(Ie),zt&&Te.target&&(Te.target.selectionEnd=Te.target.selectionStart=Math.min(zt,Te.target.value.length))):Je&&Je!="<Left>"&&Je!="<Right>"&&K.searchHistoryController.reset(),N=Ie,X()}function X(){var Te;try{Te=wi(u,N,!0,!0)}catch{}Te?u.scrollIntoView(_i(u,!b,Te),30):(xi(u),u.scrollTo(O.left,O.top))}function Y(Te,Ie,dt){var Je=en(Te);Je=="<Esc>"||Je=="<C-c>"||Je=="<C-[>"||Je=="<BS>"&&Ie==""?(K.searchHistoryController.pushInput(Ie),K.searchHistoryController.reset(),wi(u,(R==null?void 0:R.source)||""),xi(u),u.scrollTo(O.left,O.top),e.e_stop(Te),ft(u),dt(),u.focus()):Je=="<Up>"||Je=="<Down>"?e.e_stop(Te):Je=="<C-u>"&&(e.e_stop(Te),dt(""))}switch(v.searchArgs.querySrc){case"prompt":var xe=K.macroModeState;xe.isPlaying?F(xe.replaySearchQueries.shift()||"",!0,!1):ia(u,{onClose:q,prefix:k,desc:Nn("span",{$cursor:"pointer",onmousedown:function(Ie){Ie.preventDefault(),J("pcre",!we("pcre")),this.textContent=oe(),X()}},oe()),onKeyUp:re,onKeyDown:Y});break;case"wordUnderCursor":var _e=Ce(u,{noSymbol:!0}),qe=!0;if(_e||(_e=Ce(u,{noSymbol:!1}),qe=!1),!_e){ct(u,"No word under cursor"),ft(u);return}let Te=u.getLine(_e.start.line).substring(_e.start.ch,_e.end.ch);Te=qe&&x?"\\b"+Te+"\\b":Mn(Te),K.jumpList.cachedCursor=u.getCursor(),u.setCursor(_e.start),F(Te,!0,!1);break}},processEx:function(u,m,v){function b(O){K.exCommandHistoryController.pushInput(O),K.exCommandHistoryController.reset(),_n.processCommand(u,O),u.state.vim&&ft(u),xi(u)}function x(O,N,F){var q=en(O),oe,re;(q=="<Esc>"||q=="<C-c>"||q=="<C-[>"||q=="<BS>"&&N=="")&&(K.exCommandHistoryController.pushInput(N),K.exCommandHistoryController.reset(),e.e_stop(O),ft(u),xi(u),F(),u.focus()),q=="<Up>"||q=="<Down>"?(e.e_stop(O),oe=q=="<Up>",re=O.target?O.target.selectionEnd:0,N=K.exCommandHistoryController.nextMatch(N,oe)||"",F(N),re&&O.target&&(O.target.selectionEnd=O.target.selectionStart=Math.min(re,O.target.value.length))):q=="<C-u>"?(e.e_stop(O),F("")):q&&q!="<Left>"&&q!="<Right>"&&K.exCommandHistoryController.reset()}function k(O,N){var F=new e.StringStream(N),q={};try{if(_n.parseInput_(u,F,q),q.commandName!="s"){xi(u);return}var oe=_n.matchCommand_(q.commandName);if(!oe||(_n.parseCommandArgs_(F,q,oe),!q.argString))return;var re=Vs(q.argString.slice(1),!0,!0);re&&Bo(u,re)}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),ia(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,N=m.sel,F=Ge(m.visualMode?jt(u,N.head):u.getCursor("head")),q=Ge(m.visualMode?jt(u,N.anchor):u.getCursor("anchor")),oe=Ge(F),re=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,ft(u),b){var _e=un[b](u,F,x,m,v);if(m.lastMotion=un[b],!_e)return;if(x.toJumplist){var qe=K.jumpList,Te=qe.cachedCursor;Te?(Fe(u,Te,_e),delete qe.cachedCursor):Fe(u,F,_e)}_e instanceof Array?(Y=_e[0],X=_e[1]):X=_e,X||(X=Ge(F)),m.visualMode?(m.visualBlock&&X.ch===1/0||(X=jt(u,X,oe)),Y&&(Y=jt(u,Y)),Y||(Y=re),N.anchor=Y,N.head=X,zn(u),Fn(u,m,"<",wt(Y,X)?Y:X),Fn(u,m,">",wt(Y,X)?X:Y)):k||(X=jt(u,X,oe),u.setCursor(X.line,X.ch))}if(k){if(R.lastSel){Y=re;var Ie=R.lastSel,dt=Math.abs(Ie.head.line-Ie.anchor.line),Je=Math.abs(Ie.head.ch-Ie.anchor.ch);X=Ie.visualLine?new n(re.line+dt,re.ch):Ie.visualBlock?new n(re.line+dt,re.ch+Je):Ie.head.line==Ie.anchor.line?new n(re.line,re.ch+Je):new n(re.line+dt,re.ch),m.visualMode=!0,m.visualLine=Ie.visualLine,m.visualBlock=Ie.visualBlock,N=m.sel={anchor:Y,head:X},zn(u)}else m.visualMode&&(R.lastSel={anchor:Ge(N.anchor),head:Ge(N.head),visualBlock:m.visualBlock,visualLine:m.visualLine});var Mt,zt,Ue,Ve,Vt;if(m.visualMode){Mt=_t(N.head,N.anchor),zt=jn(N.head,N.anchor),Ue=m.visualLine||R.linewise,Ve=m.visualBlock?"block":Ue?"line":"char";var nn=i(u,Mt,zt);if(Vt=or(u,{anchor:nn.start,head:nn.end},Ve),Ue){var fn=Vt.ranges;if(Ve=="block")for(var Za=0;Za<fn.length;Za++)fn[Za].head.ch=xt(u,fn[Za].head.line);else Ve=="line"&&(fn[0].head=new n(fn[0].head.line+1,0))}}else{if(Mt=Ge(Y||re),zt=Ge(X||oe),wt(zt,Mt)){var Sc=Mt;Mt=zt,zt=Sc}Ue=x.linewise||R.linewise,Ue?ee(u,Mt,zt):x.forward&&j(u,Mt,zt),Ve="char";var Cc=!x.inclusive||Ue,nn=i(u,Mt,zt);Vt=or(u,{anchor:nn.start,head:nn.end},Ve,Cc)}u.setSelections(Vt.ranges,Vt.primary),m.lastMotion=null,R.repeat=xe,R.registerName=O,R.linewise=Ue;var Wo=Wt[k](u,R,Vt.ranges,re,X);m.visualMode&&Ye(u,Wo!=null),Wo&&u.setCursor(Wo)}},recordLastEdit:function(u,m,v){var b=K.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)}},un={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=Un(u),x=b.getQuery();if(x){var k=!v.forward;k=b.isReversed()?!k:k,Bo(u,x);var R=_i(u,k,x,v.repeat);return R||ct(u,"No match found "+x+(we("pcre")?" (set nopcre to use Vim regexps)":"")),R}},findAndSelectNextInclusive:function(u,m,v,b,x){var k=Un(u),R=k.getQuery();if(R){var O=!v.forward;O=k.isReversed()?!O:O;var N=kf(u,O,R,v.repeat,b);if(N){if(x.operator)return N;var F=N[0],q=new n(N[1].line,N[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,F]:[oe,q]:v.forward?[oe,q]:[oe,F]}else b.visualMode=!0,b.visualLine=!1,b.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""});return O?[q,F]:[F,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?[jt(u,new n(x.anchor.line,x.head.ch)),jt(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(I(O)){var N=b.marks[O].find();if(!(v.forward?wt(N,R):wt(R,N))&&!(v.linewise&&N.line==R.line)){var F=ht(R,x),q=v.forward?_r(R,N,x):_r(x,N,R);(F||q)&&(x=N)}}}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,N=u.firstLine(),F=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<N&&x.line==N?this.moveToStartOfLine(u,m,v,b):O>F&&x.line==F?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 N=u.charCoords(new n(u.firstLine(),0),"div");N.left=b.lastHSPos,R=u.coordsChar(N,"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 Jt(u,m,v.repeat,b).start},moveBySentence:function(u,m,v){var b=v.forward?1:-1;return mc(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=un.moveByDisplayLines(u,m,v,b),!k)return null;var N=u.charCoords(k,"local");return u.scrollTo(null,x.top+N.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 at(k,v),x?(x.ch+=k,x):null},moveToCharacter:function(u,m,v){var b=v.repeat;return at(0,v),sr(u,b,v.forward,v.selectedCharacter,m)||m},moveToSymbol:function(u,m,v){var b=v.repeat;return v.selectedCharacter&&Pt(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,ri(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&&G(R)){var O=u.getTokenTypeAt(new n(b,x+1));if(O!=="string"&&O!=="comment")break}if(x<k.length){var N=R==="<"||R===">"?/[(){}[\]<>]/:/[(){}[\]]/;return u.findMatchingBracket(new n(b,x),{bracketRegex:N}).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,N,F;if(x[R]){if(F=!0,N=ii(u,m,R,O),!N){var q=u.getSearchCursor(RegExp("\\"+R,"g"),m);q.find()&&(N=ii(u,q.from(),R,O))}}else if(k[R])F=!0,N=ra(u,m,R,O);else if(R==="W"||R==="w")for(var oe=v.repeat||1;oe-- >0;){var re=Ce(u,{inclusive:O,innerWord:!O,bigWord:R==="W",noSymbol:R==="W",multiline:!0},N&&N.end);re&&(N||(N=re),N.end=re.end)}else if(R==="p")if(N=Jt(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),N.end.line--}else if(R==="t")N=ze(u,m,O);else if(R==="s"){var Y=u.getLine(m.line);m.ch>0&&V(Y[m.ch])&&--m.ch;var xe=Bs(u,m,v.repeat,1,O),_e=Bs(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}),N={start:_e,end:xe}}return N?u.state.vim.visualMode?bi(u,N.start,N.end,F):[N.start,N.end]:null},repeatLastCharacterSearch:function(u,m,v){var b=K.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 ea(u,m){un[u]=m}function mi(u,m){for(var v=[],b=0;b<m;b++)v.push(u);return v}var Wt={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 N=mi("",v.length);u.replaceSelections(N),b=_t(v[0].head,v[0].anchor)}else{x=u.getRange(R,O);var F=k.lastEditInputState;if((F==null?void 0:F.motion)=="moveByWords"&&!A(x)){var q=/\s+$/.exec(x);q&&F.motionArgs&&F.motionArgs.forward&&(O=bt(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}K.registerController.pushText(m.registerName,"change",x,m.linewise,v.length>1),dn.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=mi("",v.length);u.replaceSelections(R),b=_t(v[0].head,v[0].anchor)}else{var O=v[0].anchor,N=v[0].head;m.linewise&&N.line!=u.firstLine()&&O.line==u.lastLine()&&O.line==N.line-1&&(O.line==u.firstLine()?O.ch=0:O=new n(O.line-1,xt(u,O.line-1))),x=u.getRange(O,N),u.replaceRange("",O,N),b=O,m.linewise&&(b=un.moveToFirstNonWhiteSpaceCharacter(u,O))}return K.registerController.pushText(m.registerName,"delete",x,m.linewise,k.visualBlock),jt(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,N=v.length-1;N>=0;N--)if(O=_t(v[N].anchor,v[N].head),m.indentRight)u.replaceRange(R.repeat(x),O,O);else{for(var F=u.getLine(O.line),q=0,oe=0;oe<x;oe++){var re=F[O.ch+q];if(re==" ")q++;else if(re==" "){q++;for(var X=1;X<R.length&&(re=F[O.ch+q],re===" ");X++)q++}else break}u.replaceRange("",O,bt(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 N=Y;N<=xe;N++)for(var oe=0;oe<x;oe++)u.indentLine(N,m.indentRight)}return un.moveToFirstNonWhiteSpaceCharacter(u,v[0].anchor)},indentAuto:function(u,m,v){return u.execCommand("indentAuto"),un.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,N=0;N<k.length;N++){var F=k[N],q="";if(O===!0)q=F.toLowerCase();else if(O===!1)q=F.toUpperCase();else for(var oe=0;oe<F.length;oe++){var re=F.charAt(oe);q+=P(re)?re.toLowerCase():re.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?un.moveToFirstNonWhiteSpaceCharacter(u,b):m.linewise?b:_t(v[0].anchor,v[0].head)},yank:function(u,m,v,b){var x=u.state.vim,k=u.getSelection(),R=x.visualMode?_t(x.sel.anchor,x.sel.head,v[0].head,v[0].anchor):b;return K.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 N=k[O].split("").map(F=>{let q=F.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):F}).join("");R.push(N)}return u.replaceSelections(R),m.shouldMoveCursor?x:!u.state.vim.visualMode&&m.linewise&&v[0].anchor.line+1==v[0].head.line?un.moveToFirstNonWhiteSpaceCharacter(u,b):m.linewise?b:_t(v[0].anchor,v[0].head)}};function gi(u,m){Wt[u]=m}var dn={jumpListWalk:function(u,m,v){if(!v.visualMode){var b=m.repeat||1,x=m.forward,k=K.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,N=Ge(u.getCursor()),F=u.charCoords(N,"local");if(m.forward)O>F.top?(N.line+=(O-F.top)/x,N.line=Math.ceil(N.line),u.setCursor(N),F=u.charCoords(N,"local"),u.scrollTo(null,F.top)):u.scrollTo(null,O);else{var q=O+u.getScrollInfo().clientHeight;q<F.bottom?(N.line-=(F.bottom-q)/x,N.line=Math.floor(N.line),u.setCursor(N),F=u.charCoords(N,"local"),u.scrollTo(null,F.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=K.macroModeState;for(b=="@"?b=k.latestRegister||"":k.latestRegister=b;x--;)Qa(u,v,k,b)},enterMacroRecordMode:function(u,m){var v=K.macroModeState,b=m.selectedCharacter;K.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,xt(u,k.line));else if(b=="bol")k=new n(k.line,0);else if(b=="charAfter"){var O=i(u,k,bt(k,0,1));k=O.end}else if(b=="firstNonBlank"){var O=i(u,k,un.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?bt(x.head,0,1):new n(x.anchor.line,0)}else if(b=="inplace"){if(v.visualMode)return}else b=="lastEdit"&&(k=_c(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"})),K.macroModeState.isPlaying||(u.on("change",$r),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=u.setBookmark(k,{insertLeft:!0}),e.on(u.getInputField(),"keydown",Ks)),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=jt(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,"<",_t(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,"<",_t(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"),wt(x,b)){var k=x;x=b,b=k}x.ch=xt(u,x.line)-1}else{var R=Math.max(m.repeat,2);b=u.getCursor(),x=jt(u,new n(b.line+R-1,1/0))}for(var O=0,N=b.line;N<x.line;N++){O=xt(u,b.line);var F="",q=0;if(!m.keepSpaces){var oe=u.getLine(b.line+1);q=oe.search(/\S/),q==-1?q=oe.length:F=" "}u.replaceRange(F,new n(b.line,O),new n(b.line+1,q))}var re=jt(u,new n(b.line,O));v.visualMode&&Ye(u,!1),u.setCursor(re)},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=xt(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=K.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(Vt){var nn=Vt.split(" ").length-1,fn=Vt.split(" ").length-1;return nn*R+fn*1},N=O(u.getLine(u.getCursor().line).match(/^\s*/)[0]),F=b.replace(/\n$/,""),q=b!==F,oe=O(b.match(/^\s*/)[0]),b=F.replace(/^\s*/gm,function(Vt){var nn=N+(O(Vt)-oe);if(nn<0)return"";if(u.getOption("indentWithTabs")){var fn=Math.floor(nn/R);return Array(fn+1).join(" ")}else return Array(nn+1).join(" ")});b+=q?`
97
97
  `:""}m.repeat>1&&(b=Array(m.repeat+1).join(b));var re=x.linewise,X=x.blockwise,Y=X?b.split(`
98
98
  `):void 0;if(Y){re&&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(xt(u,k.line),k.ch)}else re?v.visualMode?b=v.visualLine?b.slice(0,-1):`
@@ -105,53 +105,53 @@ ${i.sqlString}
105
105
  `;break;case"<Space>":case"<S-Space>":v=" ";break;default:v="";break}return v}function Gt(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 ht(u,m){return u.ch==m.ch&&u.line==m.line}function wt(u,m){return u.line<m.line||u.line==m.line&&u.ch<m.ch}function _t(u,m){return arguments.length>2&&(m=_t.apply(void 0,Array.prototype.slice.call(arguments,1))),wt(u,m)?u:m}function jn(u,m){return arguments.length>2&&(m=jn.apply(void 0,Array.prototype.slice.call(arguments,1))),wt(u,m)?m:u}function _r(u,m,v){var b=wt(u,m),x=wt(m,v);return b&&x}function xt(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 Br(u,m,v){var b=xt(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=!ht(m,x),R=vi(b,u.getCursor("head")),O=ht(b[R].head,b[R].anchor),N=b.length-1,F=N-R>R?N:0,q=b[F].anchor,oe=Math.min(q.line,x.line),re=Math.max(q.line,x.line),X=q.ch,Y=x.ch,xe=b[F].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<=re;qe++){var Te={anchor:new n(qe,X),head:new n(qe,Y)};v.push(Te)}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=bt(m,x,0);b.push({anchor:k,head:k})}u.setSelections(b,0)}function vi(u,m,v){for(var b=0;b<u.length;b++){var x=ht(u[b].anchor,m),k=ht(u[b].head,m);if(x||k)return b}return-1}function ni(u,m){var v=u.listSelections(),b=v[0],x=v[v.length-1];return[wt(b.anchor,b.head)?b.anchor:b.head,wt(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 bi(u,m,v,b){var x=u.state.vim.sel,k=b?m:x.head,R=b?m:x.anchor,O;return wt(v,m)&&(O=v,v=m,m=O),wt(k,R)?(k=_t(m,k),R=jn(R,v)):(R=_t(m,R),k=jn(k,v),k=bt(k,0,-1),k.ch==-1&&k.line!=u.firstLine()&&(k=new n(k.line-1,xt(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&&!wt(m.head,m.anchor)?1:0,O=wt(m.head,m.anchor)?1:0;return x=bt(m.head,0,R),k=bt(m.anchor,0,O),{ranges:[{anchor:k,head:x}],primary:0}}else if(v=="line"){if(wt(m.head,m.anchor))x.ch=0,k.ch=xt(u,k.line);else{k.ch=0;var N=u.lastLine();x.line>N&&(x.line=N),x.ch=xt(u,x.line)}return{ranges:[{anchor:k,head:x}],primary:0}}else if(v=="block"){var F=Math.min(k.line,x.line),q=k.ch,oe=Math.max(k.line,x.line),re=x.ch;q<re?re+=1:q+=1;for(var X=oe-F+1,Y=x.line==F?0:X-1,xe=[],_e=0;_e<X;_e++)xe.push({anchor:new n(F+_e,q),head:new n(F+_e,re)});return{ranges:xe,primary:Y}}throw"never happens"}function M(u){var m=u.getCursor("head");return u.getSelection().length==1&&(m=_t(m,u.getCursor("anchor"))),m}function Ye(u,m){var v=u.state.vim;m!==!1&&u.setCursor(jt(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
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=xt(u,v.line)):v.ch=0}}function ee(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 Ce(u,{inclusive:m,innerWord:v,bigWord:b,noSymbol:x,multiline:k},R){var O=R||M(u),N=u.getLine(O.line),F=N,q=O.line,oe=q,re=O.ch,X,Y=x?C[0]:E[0];if(v&&/\s/.test(N.charAt(re)))Y=function(dt){return/\s/.test(dt)};else{for(;!Y(N.charAt(re));)if(re++,re>=N.length){if(!k)return null;re--,X=nt(u,O,!0,b,!0);break}b?Y=E[0]:(Y=C[0],Y(N.charAt(re))||(Y=C[1]))}for(var xe=re,_e=re;Y(N.charAt(_e))&&_e>=0;)_e--;if(_e++,X)xe=X.to,oe=X.line,F=u.getLine(oe),!F&&xe==0&&xe++;else for(;Y(N.charAt(xe))&&xe<N.length;)xe++;if(m){var qe=xe,Te=O.ch<=_e&&/\s/.test(N.charAt(O.ch));if(!Te)for(;/\s/.test(F.charAt(xe))&&xe<F.length;)xe++;if(qe==xe||Te){for(var Ie=_e;/\s/.test(N.charAt(_e-1))&&_e>0;)_e--;!_e&&!Te&&(_e=Ie)}}return{start:new n(q,_e),end:new n(oe,xe)}}function ze(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 Fe(u,m,v){ht(m,v)||K.jumpList.add(u,m,v)}function at(u,m){K.lastCharacterSearch.increment=u,K.lastCharacterSearch.forward=m.forward,K.lastCharacterSearch.selectedCharacter=m.selectedCharacter}var Ot={"(":"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 Pt(u,m,v,b){var x=Ge(u.getCursor()),k=v?1:-1,R=v?u.lineCount():-1,O=x.ch,N=x.line,F=u.getLine(N),q={lineText:F,nextCh:F.charAt(O),lastCh:null,index:O,symb:b,reverseSymb:(v?{")":"(","}":"{"}:{"(":")","{":"}"})[b],forward:v,depth:0,curMoveThrough:!1},oe=Ot[b];if(!oe)return x;var re=Ze[oe].init,X=Ze[oe].isComplete;for(re&&re(q);N!==R&&m;){if(q.index+=k,q.nextCh=q.lineText.charAt(q.index),!q.nextCh){if(N+=k,q.lineText=u.getLine(N)||"",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=N,x.ch=q.index,m--)}return q.nextCh||q.curMoveThrough?new n(N,q.index):x}function nt(u,m,v,b,x){var k=m.line,R=m.ch,O=u.getLine(k),N=v?1:-1,F=b?E:C;if(x&&O==""){if(k+=N,O=u.getLine(k),!$(u,k))return null;R=v?0:O.length}for(;;){if(x&&O=="")return{from:0,to:0,line:k};for(var q=N>0?O.length:-1,oe=q,re=q;R!=q;){for(var X=!1,Y=0;Y<F.length&&!X;++Y)if(F[Y](O.charAt(R))){for(oe=R;R!=q&&F[Y](O.charAt(R));)R+=N;if(re=R,X=oe!=re,oe==m.ch&&k==m.line&&re==oe+N)continue;return{from:Math.min(oe,re+1),to:Math.max(oe,re),line:k}}X||(R+=N)}if(k+=N,!$(u,k))return null;O=u.getLine(k),R=N>0?0:O.length}}function ut(u,m,v,b,x,k){var R=Ge(m),O=[];(b&&!x||!b&&x)&&v++;for(var N=!(b&&x),F=0;F<v;F++){var q=nt(u,m,b,k,N);if(!q){var oe=xt(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 re=O.length!=v,X=O[0],Y=O.pop();return b&&!x?(!re&&(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?(!re&&(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,N=0;N<m;N++){var F=u.getLine(k.line);if(O=na(R,F,b,v),O==-1)return;R=O}if(O!=null)return new n(u.getCursor().line,O)}}function ri(u,m){var v=u.getCursor().line;return jt(u,new n(v,m-1))}function Fn(u,m,v,b){!de(v,T)&&!z.test(v)||(m.marks[v]&&m.marks[v].clear(),m.marks[v]=u.setBookmark(b))}function na(u,m,v,b,x){return b?m.indexOf(v,u+1):m.lastIndexOf(v,u-1)}function Jt(u,m,v,b,x){var k=m.line,R=u.firstLine(),O=u.lastLine(),N,F,q=k;function oe(_e){return!u.getLine(_e)}function re(_e,qe,Te){return Te?oe(_e)!=oe(_e+qe):!oe(_e)&&oe(_e+qe)}if(b){for(;R<=q&&q<=O&&v>0;)re(q,b)&&v--,q+=b;return{start:new n(q,0),end:m}}var X=u.state.vim;if(X.visualLine&&re(k,1,!0)){var Y=X.sel.anchor;re(Y.line,-1,!0)&&(!x||Y.line!=k)&&(k+=1)}var xe=oe(k);for(q=k;q<=O&&v;q++)re(q,1,!0)&&(!x||oe(q)!=xe)&&v--;for(F=new n(q,0),q>O&&!xe?xe=!0:x=!1,q=k;q>R&&!((!x||oe(q)==xe||q==k)&&re(q,-1,!0));q--);return N=new n(q,0),{start:N,end:F}}function Bs(u,m,v,b,x){function k(F){F.line!==null&&(F.pos+F.dir<0||F.pos+F.dir>=F.line.length?F.line=null:F.pos+=F.dir)}function R(F,q,oe,re){var X={line:F.getLine(q),ln:q,pos:oe,dir:re};if(X.line==="")return{ln:X.ln,pos:X.pos};var Y=X.pos;for(k(X);X.line!==null;){if(Y=X.pos,V(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(F,q,oe,re){var X=F.getLine(q),Y={line:X,ln:q,pos:oe,dir:re};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])&&!V(Y.line[Y.pos]))xe=Y.pos;else if(V(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 N={ln:m.line,pos:m.ch};v>0;)N=b<0?O(u,N.ln,N.pos,b):R(u,N.ln,N.pos,b),v--;return new n(N.ln,N.pos)}function mc(u,m,v,b){function x(N,F){if(F.line!==null)if(F.pos+F.dir<0||F.pos+F.dir>=F.line.length){if(F.ln+=F.dir,!$(N,F.ln)){F.line=null;return}F.line=N.getLine(F.ln),F.pos=F.dir>0?0:F.line.length-1}else F.pos+=F.dir}function k(N,F,q,oe){var _e=N.getLine(F),re=_e==="",X={line:_e,ln:F,pos:q,dir:oe},Y={ln:X.ln,pos:X.pos},xe=X.line==="";for(x(N,X);X.line!==null;){if(Y.ln=X.ln,Y.pos=X.pos,X.line===""&&!xe||re&&X.line!==""&&!A(X.line[X.pos]))return{ln:X.ln,pos:X.pos};V(X.line[X.pos])&&!re&&(X.pos===X.line.length-1||A(X.line[X.pos+1]))&&(re=!0),x(N,X)}var _e=N.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(N,F,q,oe){var _e=N.getLine(F),re={line:_e,ln:F,pos:q,dir:oe},X=re.ln,Y=null,xe=re.line==="";for(x(N,re);re.line!==null;){if(re.line===""&&!xe)return Y===null?{ln:re.ln,pos:re.pos}:{ln:X,pos:Y};if(V(re.line[re.pos])&&Y!==null&&!(re.ln===X&&re.pos+1===Y))return{ln:X,pos:Y};re.line!==""&&!A(re.line[re.pos])&&(xe=!1,X=re.ln,Y=re.pos),x(N,re)}var _e=N.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 ii(u,m,v,b){var x=m,k={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[v],R={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[v],O=u.getLine(x.line).charAt(x.ch)===R?1:0,N=u.scanForBracket(new n(x.line,x.ch+O),-1,void 0,{bracketRegex:k}),F=u.scanForBracket(new n(x.line,x.ch+O),1,void 0,{bracketRegex:k});if(!N||!F)return null;var q=N.pos,oe=F.pos;if(q.line==oe.line&&q.ch>oe.ch||q.line>oe.line){var re=q;q=oe,oe=re}return b?oe.ch+=1:q.ch+=1,{start:q,end:oe}}function ra(u,m,v,b){var x=Ge(m),k=u.getLine(x.line).split(""),R,O,N,F,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(bt(m,0,1))),re=/string/.test(u.getTokenTypeAt(m));oe&&!re||(O=x.ch,--x.ch)}if(k[x.ch]==v&&!O)R=x.ch+1;else for(N=x.ch;N>-1&&!R;N--)k[N]==v&&(R=N+1);if(R&&!O)for(N=R,F=k.length;N<F&&!O;N++)k[N]==v&&(O=N);return!R||!O?{start:x,end:x}:(b&&(--R,++O),{start:new n(x.line,R),end:new n(x.line,O)})}be("pcre",!0,"boolean");class _f{constructor(){this.highlightTimeout}getQuery(){return K.query}setQuery(m){K.query=m}getOverlay(){return this.searchOverlay}setOverlay(m){this.searchOverlay=m}isReversed(){return K.isReversed}setReversed(m){K.isReversed=m}getScrollbarAnnotate(){return this.annotate}setScrollbarAnnotate(m){this.annotate=m}}function Un(u){var m=u.state.vim;return m.searchState_||(m.searchState_=new _f)}function gc(u){return Wa(u,"/")}function xf(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 Hr(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
107
  `,"\\r":"\r","\\t":" "};function yc(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 vc={"\\/":"/","\\\\":"\\","\\n":`
108
- `,"\\r":"\r","\\t":" ","\\&":"&"};function Hs(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 vc)if(m.match(x,!0)){b=!0,v.push(vc[x]);break}b||v.push(m.next())}return v.join("")}function Vs(u,m,v){K.registerController.getRegister("/").setText(u);var b=xf(u),x,k;return b.length?(x=u.substring(0,b[0]),k=u.substring(b[0]).indexOf("i")!=-1):x=u,x?(we("pcre")||(x=Hr(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 lt(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 ia(u,m){var x;if(He.length){m.value||(m.value=""),Ne=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 bc(u,m){return u instanceof RegExp&&m instanceof RegExp?u.flags==m.flags&&u.source==m.source:!1}function wi(u,m,v,b){if(m){var x=Un(u),k=Vs(m,!!v,!!b);if(k)return Bo(u,k),bc(k,x.getQuery())||x.setQuery(k),k}}function aa(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 oa=0;function Bo(u,m){clearTimeout(oa);var v=Un(u);v.highlightTimeout=oa,oa=setTimeout(function(){if(u.state.vim){var b=Un(u);b.highlightTimeout=void 0;var x=b.getOverlay();(!x||m!=x.query)&&(x&&u.removeOverlay(x),x=aa(m),u.addOverlay(x),u.showMatchesOnScrollbar&&(b.getScrollbarAnnotate()&&b.getScrollbarAnnotate().clear(),b.setScrollbarAnnotate(u.showMatchesOnScrollbar(m))),b.setOverlay(x))}},50)}function _i(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&&ht(k.from(),x)){var N=m?k.from():k.to();O=k.find(m),O&&!O[0]&&ht(k.from(),N)&&u.getLine(N.line).length==N.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 kf(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&&ht(R.from(),k)&&R.find(!m);for(var N=0;N<b;N++)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 F=R.from(),q=R.to();return F&&q&&[F,q]})}function xi(u){var m=Un(u);m.highlightTimeout&&(m.highlightTimeout=(clearTimeout(m.highlightTimeout),void 0)),u.removeOverlay(Un(u).getOverlay()),m.setOverlay(null),m.getScrollbarAnnotate()&&(m.getScrollbarAnnotate().clear(),m.setScrollbarAnnotate(null))}function wc(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 K.jumpList.find(u,-1)||new n(0,0);if(v==".")return _c(u);var b=m.marks[v];return b&&b.find()}function _c(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=K.registerController.getRegister(":"),R=k.toString(),O=new e.StringStream(v);k.setText(v);var N=b||{};N.input=v;try{this.parseInput_(m,O,N)}catch(oe){throw lt(m,oe+""),oe}x.visualMode&&Ye(m);var F,q;if(!N.commandName)N.line!==void 0&&(q="move");else if(F=this.matchCommand_(N.commandName),F){if(q=F.name,F.excludeFromCommandHistory&&k.setText(R),this.parseCommandArgs_(O,N,F),F.type=="exToKey"){qt(m,F.toKeys||"",F);return}else if(F.type=="exToEx"){this.processCommand(m,F.toInput||"");return}}if(!q){lt(m,'Not an editor command ":'+v+'"');return}try{xr[q](m,N),(!F||!F.possiblyAsync)&&N.callback&&N.callback()}catch(oe){throw lt(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),ai(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),Ws(x),!0}}var xr={colorscheme:function(u,m){if(!m.args||m.args.length<1){lt(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&&lt(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&&lt(u,"No such mapping: "+m.input)},mapclear:function(u,m){je.mapclear()},imapclear:function(u,m){je.mapclear("insert")},nmapclear:function(u,m){je.mapclear("normal")},vmapclear:function(u,m){je.mapclear("visual")},omapclear:function(u,m){je.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&&lt(u,"Invalid mapping: "+m.input);return}var x=v[0].split("="),k=x.shift()||"",R=x.length>0?x.join("="):void 0,O=!1,N=!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),N=!0);R===void 0&&k.substring(0,2)=="no"&&(k=k.substring(2),R=!1);var F=fe[k]&&fe[k].type=="boolean";if(F&&(N?R=!we(k,u,b):R??(R=!0)),!F&&R===void 0||O){var q=we(k,u,b);q instanceof Error?lt(u,q.message):q===!0||q===!1?lt(u," "+(q?"":"no")+k):lt(u," "+k+"="+q)}else{var oe=J(k,R,u,b);oe instanceof Error&&lt(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=K.registerController.registers,x=`----------Registers----------
108
+ `,"\\r":"\r","\\t":" ","\\&":"&"};function Hs(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 vc)if(m.match(x,!0)){b=!0,v.push(vc[x]);break}b||v.push(m.next())}return v.join("")}function Vs(u,m,v){K.registerController.getRegister("/").setText(u);var b=xf(u),x,k;return b.length?(x=u.substring(0,b[0]),k=u.substring(b[0]).indexOf("i")!=-1):x=u,x?(we("pcre")||(x=Hr(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 ia(u,m){var x;if(He.length){m.value||(m.value=""),Ne=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 bc(u,m){return u instanceof RegExp&&m instanceof RegExp?u.flags==m.flags&&u.source==m.source:!1}function wi(u,m,v,b){if(m){var x=Un(u),k=Vs(m,!!v,!!b);if(k)return Bo(u,k),bc(k,x.getQuery())||x.setQuery(k),k}}function aa(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 oa=0;function Bo(u,m){clearTimeout(oa);var v=Un(u);v.highlightTimeout=oa,oa=setTimeout(function(){if(u.state.vim){var b=Un(u);b.highlightTimeout=void 0;var x=b.getOverlay();(!x||m!=x.query)&&(x&&u.removeOverlay(x),x=aa(m),u.addOverlay(x),u.showMatchesOnScrollbar&&(b.getScrollbarAnnotate()&&b.getScrollbarAnnotate().clear(),b.setScrollbarAnnotate(u.showMatchesOnScrollbar(m))),b.setOverlay(x))}},50)}function _i(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&&ht(k.from(),x)){var N=m?k.from():k.to();O=k.find(m),O&&!O[0]&&ht(k.from(),N)&&u.getLine(N.line).length==N.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 kf(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&&ht(R.from(),k)&&R.find(!m);for(var N=0;N<b;N++)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 F=R.from(),q=R.to();return F&&q&&[F,q]})}function xi(u){var m=Un(u);m.highlightTimeout&&(m.highlightTimeout=(clearTimeout(m.highlightTimeout),void 0)),u.removeOverlay(Un(u).getOverlay()),m.setOverlay(null),m.getScrollbarAnnotate()&&(m.getScrollbarAnnotate().clear(),m.setScrollbarAnnotate(null))}function wc(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 K.jumpList.find(u,-1)||new n(0,0);if(v==".")return _c(u);var b=m.marks[v];return b&&b.find()}function _c(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=K.registerController.getRegister(":"),R=k.toString(),O=new e.StringStream(v);k.setText(v);var N=b||{};N.input=v;try{this.parseInput_(m,O,N)}catch(oe){throw ct(m,oe+""),oe}x.visualMode&&Ye(m);var F,q;if(!N.commandName)N.line!==void 0&&(q="move");else if(F=this.matchCommand_(N.commandName),F){if(q=F.name,F.excludeFromCommandHistory&&k.setText(R),this.parseCommandArgs_(O,N,F),F.type=="exToKey"){qt(m,F.toKeys||"",F);return}else if(F.type=="exToEx"){this.processCommand(m,F.toInput||"");return}}if(!q){ct(m,'Not an editor command ":'+v+'"');return}try{xr[q](m,N),(!F||!F.possiblyAsync)&&N.callback&&N.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),ai(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),Ws(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){je.mapclear()},imapclear:function(u,m){je.mapclear("insert")},nmapclear:function(u,m){je.mapclear("normal")},vmapclear:function(u,m){je.mapclear("visual")},omapclear:function(u,m){je.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,N=!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),N=!0);R===void 0&&k.substring(0,2)=="no"&&(k=k.substring(2),R=!1);var F=fe[k]&&fe[k].type=="boolean";if(F&&(N?R=!we(k,u,b):R??(R=!0)),!F&&R===void 0||O){var q=we(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=K.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(K.registerController.isValidRegister(O)){var N=b[O]||new tn;x+='"'+O+" "+N.toString()+`
111
111
  `}}else for(var O in b){var F=b[O].toString();F.length&&(x+='"'+O+" "+F+`
112
- `)}lt(u,x,!0)},marks:function(u,m){var v=m.args,b=u.state.vim.marks,x=`-----------Marks-----------
112
+ `)}ct(u,x,!0)},marks:function(u,m){var v=m.args,b=u.state.vim.marks,x=`-----------Marks-----------
113
113
  mark line col
114
114
 
115
115
  `;if(v)for(var k=v.join(""),R=0;R<k.length;R++){var O=k.charAt(R),N=b[O]&&b[O].find();N&&(x+=O+" "+N.line+" "+N.ch+`
116
116
  `)}else for(var O in b){var N=b[O]&&b[O].find();N&&(x+=O+" "+N.line+" "+N.ch+`
117
- `)}lt(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 Ve=Ue.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!Ve||!Ue.eol())return"Invalid arguments";if(Ve[1]){b=Ve[1].indexOf("i")!=-1,x=Ve[1].indexOf("u")!=-1;var Vt=Ve[1].indexOf("d")!=-1||Ve[1].indexOf("n")!=-1,nn=Ve[1].indexOf("x")!=-1,fn=Ve[1].indexOf("o")!=-1;if(Number(Vt)+Number(nn)+Number(fn)>1)return"Invalid arguments";k=Vt&&"decimal"||nn&&"hex"||fn&&"octal"}Ve[2]&&(R=new RegExp(Ve[2].substr(1,Ve[2].length-2),b?"i":""))}}var N=O();if(N){lt(u,N+": "+m.argString);return}var F=m.line||u.firstLine(),q=m.lineEnd||m.line||u.lastLine();if(F==q)return;var oe=new n(F,0),re=new n(q,xt(u,q)),X=u.getRange(oe,re).split(`
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 Ve=Ue.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!Ve||!Ue.eol())return"Invalid arguments";if(Ve[1]){b=Ve[1].indexOf("i")!=-1,x=Ve[1].indexOf("u")!=-1;var Vt=Ve[1].indexOf("d")!=-1||Ve[1].indexOf("n")!=-1,nn=Ve[1].indexOf("x")!=-1,fn=Ve[1].indexOf("o")!=-1;if(Number(Vt)+Number(nn)+Number(fn)>1)return"Invalid arguments";k=Vt&&"decimal"||nn&&"hex"||fn&&"octal"}Ve[2]&&(R=new RegExp(Ve[2].substr(1,Ve[2].length-2),b?"i":""))}}var N=O();if(N){ct(u,N+": "+m.argString);return}var F=m.line||u.firstLine(),q=m.lineEnd||m.line||u.lastLine();if(F==q)return;var oe=new n(F,0),re=new n(q,xt(u,q)),X=u.getRange(oe,re).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 Te=0;Te<X.length;Te++){var Ie=R?X[Te].match(R):null;Ie&&Ie[0]!=""?_e.push(Ie):Y&&Y.exec(X[Te])?_e.push(X[Te]):qe.push(X[Te])}else qe=X;function dt(Ue,Ve){if(v){var Vt=Ue;Ue=Ve,Ve=Vt}b&&(Ue=Ue.toLowerCase(),Ve=Ve.toLowerCase());var nn=Y&&Y.exec(Ue),fn=Y&&Y.exec(Ve);return!nn||!fn?Ue<Ve?-1:1:parseInt((nn[1]+nn[2]).toLowerCase(),xe)-parseInt((fn[1]+fn[2]).toLowerCase(),xe)}function Je(Ue,Ve){if(v){var Vt=Ue;Ue=Ve,Ve=Vt}return b&&(Ue[0]=Ue[0].toLowerCase(),Ve[0]=Ve[0].toLowerCase()),Ue[0]<Ve[0]?-1:1}if(_e.sort(R?Je:dt),R)for(var Te=0;Te<_e.length;Te++)_e[Te]=_e[Te].input;else k||qe.sort(dt);if(X=v?_e.concat(qe):qe.concat(_e),x){var Mt=X,zt;X=[];for(var Te=0;Te<Mt.length;Te++)Mt[Te]!=zt&&X.push(Mt[Te]),zt=Mt[Te]}u.replaceRange(X.join(`
119
- `),oe,re)},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){lt(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),qt(u,m.argString.trimStart(),{noremap:v}),u.state.vim.insertMode&&Hn(u,!0);else qt(u,m.argString.trimStart(),{noremap:v}),u.state.vim.insertMode&&Hn(u,!0)},global:function(u,m){var v=m.argString;if(!v){lt(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=gc(v),O=v,N="";if(R&&R.length&&(O=R[0],N=R.slice(1,R.length).join("/")),O)try{wi(u,O,!0,!0)}catch{lt(u,"Invalid regex: "+O);return}for(var F=Un(u).getQuery(),q=[],oe=x;oe<=k;oe++){var re=u.getLine(oe);F.test(re)!==b&&q.push(N?u.getLineHandle(oe):re)}if(!N){lt(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+N;_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,N,F=!1,q=!1;if(b&&b.length)x=b[0],we("pcre")&&x!==""&&(x=new RegExp(x).source),k=b[1],k!==void 0&&(k=we("pcre")?Hs(k.replace(/([^\\])&/g,"$1$$&")):yc(k),K.lastSubstituteReplacePart=k),R=b[2]?b[2].split(" "):[];else if(v&&v.length){lt(u,"Substitutions should be of the form :s/pattern/replace/");return}if(R&&(O=R[0],N=parseInt(R[1]),O&&(O.indexOf("c")!=-1&&(F=!0),O.indexOf("g")!=-1&&(q=!0),x=we("pcre")?x+"/"+O:x.replace(/\//g,"\\/")+"/"+O)),x)try{wi(u,x,!0,!0)}catch{lt(u,"Invalid regex: "+x);return}if(k||(k=K.lastSubstituteReplacePart),k===void 0){lt(u,"No previous substitute regular expression");return}var oe=Un(u).getQuery(),re=m.line===void 0?u.getCursor().line:m.line,X=m.lineEnd||re;re==u.firstLine()&&X==u.lastLine()&&(X=1/0),N&&(re=X,X=re+N-1);var Y=jt(u,new n(re,0)),xe=u.getSearchCursor(oe,Y);$s(u,F,q,re,X,xe,oe,k,m.callback)},startinsert:function(u,m){qt(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){xi(u)},yank:function(u){var m=Ge(u.getCursor()).line,v=u.getLine(m);K.registerController.pushText("0","yank",v,!0,!0)},delete:function(u,m){var v=m.selectionLine,b=isNaN(m.selectionLineEnd)?v:m.selectionLineEnd;Wt.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)),dn.joinLines(u,{repeat:b-v},u.state.vim)},delmarks:function(u,m){if(!m.argString||!ir(m.argString)){lt(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)){lt(u,"Invalid argument: "+m.argString.substring(x));return}var k=b.next();if(b.match("-",!0)){if(!b.match(/[a-zA-Z]/,!1)){lt(u,"Invalid argument: "+m.argString.substring(x));return}var R=k,O=b.next();if(R&&O&&I(R)==I(O)){var N=R.charCodeAt(0),F=O.charCodeAt(0);if(N>=F){lt(u,"Invalid argument: "+m.argString.substring(x));return}for(var q=0;q<=F-N;q++){var oe=String.fromCharCode(N+q);delete v.marks[oe]}}else{lt(u,"Invalid argument: "+R+"-");return}}else k&&delete v.marks[k]}}},_n=new Vo;je.defineEx("version","ve",u=>{lt(u,"Codemirror-vim version: 6.3.0")});function $s(u,m,v,b,x,k,R,O,N){u.state.vim.exMode=!0;var F=!1,q=0,oe,re,X;function Y(){u.operation(function(){for(;!F;)xe(),qe();Te()})}function xe(){var dt="",Je=k.match||k.pos&&k.pos.match;dt=Je?O.replace(/\$(\d{1,3}|[$&])/g,function(zt,Ue){if(Ue=="$")return"$";if(Ue=="&")return Je[0];for(var Ve=Ue;parseInt(Ve)>=Je.length&&Ve.length>0;)Ve=Ve.slice(0,Ve.length-1);return Ve?Je[Ve]+Ue.slice(Ve.length,Ue.length):zt}):u.getRange(k.from(),k.to()).replace(R,O);var Mt=k.to().line;k.replace(dt),re=k.to().line,x+=re-Mt,X=re<Mt}function _e(){var dt=oe&&Ge(k.to()),Je=k.findNext();return Je&&!Je[0]&&dt&&ht(k.from(),dt)&&(Je=k.findNext()),Je&&q++,Je}function qe(){for(;_e()&&wc(k.from(),b,x);)if(!(!v&&k.from().line==re&&!X)){u.scrollIntoView(k.from(),30),u.setSelection(k.from(),k.to()),oe=k.from(),F=!1;return}F=!0}function Te(dt){if(dt&&dt(),u.focus(),oe){u.setCursor(oe);var Je=u.state.vim;Je.exMode=!1,Je.lastHPos=Je.lastHSPos=oe.ch}N?N():F&&lt(u,(q?"Found "+q+" matches":"No matches found")+" for pattern: "+R+(we("pcre")?" (set nopcre to use Vim regexps)":""))}function Ie(dt,Je,Mt){switch(e.e_stop(dt),en(dt)){case"y":xe(),qe();break;case"n":qe();break;case"a":var zt=N;N=void 0,u.operation(Y),N=zt;break;case"l":xe();case"q":case"<Esc>":case"<C-c>":case"<C-[>":Te(Mt);break}return F&&Te(Mt),!0}if(qe(),F){lt(u,"No matches for "+R+(we("pcre")?" (set nopcre to use vim regexps)":""));return}if(!m){Y(),N&&N();return}ia(u,{prefix:Nn("span","replace with ",Nn("strong",O)," (y/n/a/q/l)"),onKeyDown:Ie})}function Hn(u,m){var v=u.state.vim,b=K.macroModeState,x=K.registerController.getRegister("."),k=b.isPlaying,R=b.lastInsertModeChanges;k||(u.off("change",$r),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=void 0,e.off(u.getInputField(),"keydown",Ks)),!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&&Us(b)}function ai(u){o.unshift(u),u.keys&&xc(u.keys)}function xc(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){m&&(s[m]||(s[m]=0),s[m]++)})}function Ws(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){s[m]&&s[m]--})}function kc(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];ai(k)}be("insertModeEscKeysTimeout",200,"number");function Qa(u,m,v,b){var x=K.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 N=k[O],F,q,oe=/<(?:[CSMA]-)*\w+>|./gi;F=oe.exec(N);)if(q=F[0],je.handleKey(u,q,"macro"),m.insertMode){var re=x.insertModeChanges[R++].changes;K.macroModeState.lastInsertModeChanges.changes=re,Qs(u,re,1),Hn(u)}v.isPlaying=!1}function Vr(u,m){if(!u.isPlaying){var v=u.latestRegister,b=K.registerController.getRegister(v);b&&b.pushText(m)}}function Us(u){if(!u.isPlaying){var m=u.latestRegister,v=K.registerController.getRegister(m);v&&v.pushInsertModeChanges&&v.pushInsertModeChanges(u.lastInsertModeChanges)}}function Ga(u,m){if(!u.isPlaying){var v=u.latestRegister,b=K.registerController.getRegister(v);b&&b.pushSearchQuery&&b.pushSearchQuery(m)}}function $r(u,m){var v=K.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(),N=u.getCursor();if(O&&O.line==N.line){var F=O.ch-N.ch;F>0&&F<R.length&&(b.changes.push([R,F]),R="")}}R&&b.changes.push(R)}}m=m.next}}function $o(u){var x;var m=u.state.vim;if(m.insertMode){var v=K.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=wt(b,v)?0:-1,k=wt(b,v)?-1:0;b=bt(b,0,x),v=bt(v,0,k),m.sel={anchor:v,head:b},Fn(u,m,"<",_t(b,v)),Fn(u,m,">",jn(b,v))}else m.insertMode||(m.lastHPos=u.getCursor().ch)}function Ks(u){var m=K.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 $e(v,u)))}function Xa(u,m,v,b){var x=K.macroModeState;x.isPlaying=!0;var k=m.lastEditActionCommand,R=m.inputState;function O(){k?Pn.processAction(u,m,k):Pn.evalInput(u,m)}function N(q){if(x.lastInsertModeChanges.changes.length>0){q=m.lastEditActionCommand?q:1;var oe=x.lastInsertModeChanges;Qs(u,oe.changes,q)}}if(m.inputState=m.lastEditInputState,k&&k.interlaceInsertRepeat)for(var F=0;F<v;F++)O(),N(1);else b||O(),N(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 Qs(u,m,v){var b=u.getCursor("head"),x=K.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(bt(b,k,0));for(var R=0;R<m.length;R++){var O=m[R];if(O instanceof $e)Ya(u,O.keyName);else if(typeof O=="string")u.replaceSelection(O);else{var N=u.getCursor(),F=bt(N,0,O[0].length-(O[1]||0));u.replaceRange(O[0],N,O[1]?N:F),u.setCursor(F)}}}x&&u.setCursor(bt(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 ki(u,m,v){var k=se(u),b=u,x=!1,k=je.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 ft(b),!0}var N=b.isInMultiSelectMode();if(k.wasInVisualBlock&&!N?k.wasInVisualBlock=!1:N&&k.visualBlock&&(k.wasInVisualBlock=!0),m=="<Esc>"&&!k.insertMode&&!k.visualMode&&N&&k.status=="<Esc>")ft(b);else if(R||!N||b.inVirtualSelectionMode)x=je.handleKey(b,m,v);else{var F=xn(k),q=k.inputState.changeQueueList||[];b.operation(function(){var re;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=wt(X,Y)?0:-1,_e=wt(X,Y)?-1:0;X=bt(X,0,xe),Y=bt(Y,0,_e),b.state.vim.sel.head=X,b.state.vim.sel.anchor=Y,x=je.handleKey(b,m,v),b.virtualSelection&&(q[oe]=b.state.vim.inputState.changeQueue,b.state.vim=xn(F)),oe++}),(re=b.curOp)!=null&&re.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(),je}function nr(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 ei=class{constructor(e,n){this.line=e,this.ch=n}};function fy(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 py(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 hy(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 my(e,...n){if(e)for(var i=0;i<e.length;++i)e[i](...n)}var Jd;try{Jd=RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch{Jd=/[\w]/}function Is(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 gy(e,n){var o;e.curOp&&(e.curOp.$changeStart=void 0),(n?N4:I4)(e.cm6);let i=(o=e.curOp)==null?void 0:o.$changeStart;i!=null&&e.cm6.dispatch({selection:{anchor:i}})}var GS={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 hx{openDialog(n,i,o){return XS(this,n,i,o)}openNotification(n,i){return JS(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){fy(this,n,i)}off(n,i){py(this,n,i)}signal(n,i,o){hy(this,n,i,o)}indexFromPos(n){return nr(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=nr(s,n),d=hn.create([hn.range(c,c)],0).ranges;i.state.selection.ranges=d,w4(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=nr(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=nr(o,c.head),f=nr(o,c.anchor);return d==f?hn.cursor(d,1):hn.range(f,d)});this.cm6.dispatch({selection:hn.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 ei(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,aw.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(nr(o,n),nr(o,i))}replaceRange(n,i,o,s){o||(o=i);var c=this.cm6.state.doc,d=nr(c,i),f=nr(c,o);Is(this,{changes:{from:d,to:f,insert:n}})}replaceSelection(n){Is(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]||""}));Is(this,{changes:i})}getSelection(){return this.getSelections().join(`
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 ei(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:hn.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=nr(o.doc,n),c=fw(o,s+1,-1);return c&&c.end||(c=fw(o,s,1),c&&c.end)?{to:qr(o.doc,c.end.from)}:{to:void 0}}scanForBracket(n,i,o,s){return eC(this,n,i,o,s)}indentLine(n,i){i?this.indentMore():this.indentLess()}indentMore(){J4(this.cm6)}indentLess(){z4(this.cm6)}execCommand(n){if(n=="indentAuto")hx.commands.indentAuto(this);else if(n=="goLineLeft")H4(this.cm6);else if(n=="goLineRight"){B4(this.cm6);let i=this.cm6.state,o=i.selection.main.head;o<i.doc.length&&i.sliceDoc(o,o+1)!==`
123
- `&&F4(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 rC(this,s,o)}addOverlay({query:n}){let i=new V4({regexp:!0,search:n.source,caseSensitive:!/i/.test(n.flags)});if(i.valid){i.forVim=!0,this.cm6Query=i;let o=xh.of(i);return this.cm6.dispatch({effects:o}),i}}removeOverlay(n){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let i=xh.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=nr(o.cm6.state.doc,i),p=n.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(E,T){return T||"\\"+E});function y(E,T=0,L=E.length){return new U4(E,p,{ignoreCase:n.ignoreCase},T,L)}function w(E){var T=o.cm6.state.doc;if(E>T.length)return null;let L=y(T,E).next();return L.done?null:L.value}var _=1e4;function C(E,T){var L=o.cm6.state.doc;for(let z=1;;z++){let U=Math.max(E,T-z*_),$=y(L,U,T),I=null;for(;!$.next().done;)I=$.value;if(I&&(U==E||I.from>U+10))return I;if(U==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&&(Is(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=nr(d,n),y=hn.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=nr(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:Ut.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&&my(n.changeHandlers,this,n.change),n&&n.cursorActivity&&(my(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(ow)==" ";case"indentUnit":return this.cm6.state.facet(ow).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=lw(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 hn.range(c.from,c.to+1)}return c});this.cm6.dispatch({selection:hn.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=hn.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:hn.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 iC(this,n)}};Xe.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform),Xe.Pos=ei,Xe.StringStream=M4,Xe.commands={cursorCharLeft:function(e){$4(e.cm6)},redo:function(e){gy(e,!1)},undo:function(e){gy(e,!0)},newlineAndIndent:function(e){G4({state:e.cm6.state,dispatch:n=>Is(e,n)})},indentAuto:function(e){A4(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},Xe.isWordChar=function(e){return Jd.test(e)},Xe.keys=GS,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=fy,Xe.off=py,Xe.signal=hy,Xe.findMatchingTag=tC,Xe.findEnclosingTag=nC,Xe.keyName=void 0;function yy(e,n,i){var o=document.createElement("div");return o.appendChild(n),o}function vy(e,n){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=n}function JS(e,n,i){vy(e,f);var o=yy(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(),wy(e,o))}return o.onclick=function(p){p.preventDefault(),f()},by(e,o),d&&(c=setTimeout(f,d)),f}function by(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 wy(e,n){e.state.dialog==n&&(e.state.dialog=null,Xe.signal(e,"dialog"))}function XS(e,n,i,o){o||(o={}),vy(e,void 0);var s=yy(e,n,o.bottom),c=!1;by(e,s);function d(p){if(typeof p=="string")f.value=p;else{if(c)return;c=!0,wy(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 YS={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function ZS(e){return e&&e.bracketRegex||/[(){}[\]]/}function eC(e,n,i,o,s){for(var c=s&&s.maxScanLineLength||1e4,d=s&&s.maxScanLines||1e3,f=[],p=ZS(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 L=YS[T];if(L&&L.charAt(1)==">"==i>0)f.push(T);else if(f.length)f.pop();else return{pos:new ei(w,C),ch:T}}}}}return w-i==(i>0?e.lastLine():e.firstLine())?!1:null}function tC(e,n){return null}function nC(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=lw(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:_y(i.doc,s.firstChild),close:_y(i.doc,s.lastChild)};s=s.parent}}function _y(e,n){return{from:qr(e,n.from),to:qr(e,n.to)}}var rC=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,aw.TrackDel))}};function iC(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
- `+p,new ei(s,f.start),new ei(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 ei(s,w.length),new ei(s+1,y.length-_.length)),s--,c--):w.length<d.length&&e.replaceRange("",new ei(s,w.length),new ei(s,d.length))}}s++}return s;function E(L,z,U){if(!(L.length<z)){var $=L.slice(0,z),I=L.slice(z),G=/^(?:(\s+)|(\S+)(\s+))/.exec(I),pe=/(?:(\s+)|(\s+)(\S+))$/.exec($),P=0,A=0;if(pe&&!pe[2]&&(P=z-pe[1].length,A=z),G&&!G[2]&&(P||(P=z),A=z+G[1].length),P)return{start:P,end:A};if(pe&&pe[2]&&pe.index>U)return{start:pe.index,end:pe.index+pe[2].length};if(G&&G[2])return P=z+G[2].length,{start:P,end:P+G[3].length}}}}var Xd=O4||(function(){let e={cursorBlinkRate:1200};return function(){return e}})(),aC=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}},oC=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=Xd(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"),sC(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=uC(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 sC(e){return Xd(e.startState)!=Xd(e.state)}var lC=Lu.highest(Ut.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 cC(e){let n=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==R4.LTR?n.left:n.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:n.top-e.scrollDOM.scrollTop*e.scaleY}}function uC(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
- `&&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 L=cC(n),z=n.domAtPos(c),U=z?z.node:n.contentDOM;for(U instanceof Text&&z.offset>=U.data.length&&((w=U.parentElement)==null?void 0:w.nextSibling)&&(U=(_=U.parentElement)==null?void 0:_.nextSibling,z={node:U,offset:0});z&&z.node instanceof HTMLElement;)U=z.node,z={node:z.node.childNodes[z.offset],offset:0};if(!(U instanceof HTMLElement)){if(!U.parentNode)return null;U=U.parentNode}let $=getComputedStyle(U),I=T.left,G=(C=(s=n).coordsForChar)==null?void 0:C.call(s,c);if(G&&(I=G.left),!E||E==`
126
- `||E=="\r")E="\xA0";else if(E==" "){E="\xA0";var y=n.coordsAtPos(c+1,-1);y&&(I=y.left-(y.left-T.left)/parseInt($.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 aC((I-L.left)/n.scaleX,(T.top-L.top+pe*(1-f))/n.scaleY,pe*f/n.scaleY,$.fontFamily,$.fontSize,$.fontWeight,$.color,o?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",E,f!=1)}else return null}let xy,ky,Sy,Cy;xy=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),Vi=QS(Xe),ky=250,Sy=Ut.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"}}),Cy=Ml.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=Bi.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;let n=this.cm=new Xe(e);Vi.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new oC(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:Ey.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=>{Vi.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(xh))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(){Vi.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=Bi.none;let{view:n}=this,i=new rw;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*ky;)f=s[++o].to;e.highlight(n.state,d,f,(p,y)=>{i.add(p,y,fC)})}return this.decorations=i.finish()}handleKey(e,n){let i=this.cm,o=i.state.vim;if(!o)return;let s=Vi.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=Vi.multiSelectHandleKey(i,s,"user");return o=Vi.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),Vi.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:()=>[Ut.inputHandler.of((e,n,i,o)=>{var w,_;var s=$l(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:()=>{}}),dC(e),!0}}return!1})],decorations:e=>e.decorations});function dC(e){var n=e.scrollDOM.parentElement;if(n){if(xy){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 fC=Bi.mark({class:"cm-searchMatch"}),Ey=Fi.define(),pC=xs.define({create:()=>!1,update(e,n){for(let i of n.effects)i.is(Ey)&&(e=i.value);return e},provide:e=>wh.from(e,n=>n?hC:null)});function hC(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 mC(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}}t_=function(e={}){return[Sy,Cy,lC,e.status?wh.of(mC):pC]},$l=function(e){return e.cm||null},Hh=function(e){let n=e.state.selection.main;return n.from===0&&n.to===0},qh=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},Dw=function(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})},Qw=function(e){var n;return((n=$l(e))==null?void 0:n.state.vim)!=null},lx=function(e){var i;let n=(i=$l(e))==null?void 0:i.state.vim;return n?!n.mode&&!n.insertMode&&!n.visualMode?!0:n.mode==="normal":!1},e_=function(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})};function Ty(e,n){if(!(n!=null&&n.length))return Bi.none;let i=new rw,o=e.facet(La),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=Bi.line({class:"cm-error-line"});i.add(d.from,d.from,f)}catch(d){Re.debug("Invalid line number in error decoration",{error:d})}return i.finish()}function Ry(e,n){if(!(n!=null&&n.length))return;let i=e.state.facet(La),o=n.filter(d=>d.kind==="cell"&&d.cellId===i);if(o.length===0)return;let s=D4(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(C4.of({from:p,to:y}))})}catch(f){Re.debug("Invalid line numbers",{error:f})}c.length>0&&e.dispatch({effects:c})}var gC=class{constructor(e,n){let i=n.get();this.decorations=Ty(e.state,i),Ry(e,i),this.unsubscribe=n.sub(o=>{let s=this.decorations.size;this.decorations=Ty(e.state,o),Ry(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 yC(e){return Ml.define(n=>new gC(n,e),{decorations:n=>n.decorations})}function vC(e){return[yC(e),Ut.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 bC({cellId:e,hotkeys:n}){let i=[];return i.push(...Y2({key:n.getHotkey("cell.run").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).onRun(),!0)}),{key:n.getHotkey("cell.runAndNewBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Dt);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})),!0}},...Y2({key:n.getHotkey("cell.runAndNewAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Dt);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(Dt).aiCellCompletion()&&o.contentDOM.focus(),!0)}),e!=="__scratch__"&&i.push({key:n.getHotkey("cell.goToDefinition").key,preventDefault:!0,stopPropagation:!0,run:o=>(Em(o),!0)},{key:n.getHotkey("cell.delete").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.doc.length===0&&o.state.facet(Dt).deleteCell(),!0)},{key:n.getHotkey("cell.moveUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).moveCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.moveDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).moveCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.moveLeft").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).moveCell({cellId:e,before:!0,direction:"left"}),!0)},{key:n.getHotkey("cell.moveRight").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).moveCell({cellId:e,before:!1,direction:"right"}),!0)},{key:"ArrowUp",preventDefault:!0,stopPropagation:!0,run:o=>yw(o.state)?!1:Hh(o)?(o.state.facet(Dt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:"ArrowDown",preventDefault:!0,stopPropagation:!0,run:o=>yw(o.state)?!1:qh(o)?(o.state.facet(Dt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0):!1},{key:n.getHotkey("cell.focusDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0)},{key:n.getHotkey("cell.focusUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},{key:n.getHotkey("cell.sendToBottom").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).sendToBottom({cellId:e}),!0)},{key:n.getHotkey("cell.sendToTop").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).sendToTop({cellId:e}),!0)},{key:n.getHotkey("cell.createAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(Dt).createNewCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.createBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(Dt).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(Dt).toggleHideCode();return vw(o),s?(o.contentDOM.blur(),(c=document.getElementById(Zn.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(Dt);return s.splitCell({cellId:e}),s.moveToNextCell&&requestAnimationFrame(()=>{o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})}),!0}}),[Lu.high(Ta.of(i))]}function wC(e){return[Ut.updateListener.of(n=>{if(n.docChanged){let i=n.transactions.some(d=>d.effects.some(f=>f.is(Ls))),o=Jr(n.view),s=n.view.state.facet(Dt),c=n.view.state.facet(La);s.updateCellCode({cellId:c,code:o,formattingChange:i})}}),wS(e)]}function _C({predicate:e}){return Ut.updateListener.of(n=>{n.docChanged&&n.view.hasFocus&&e()&&(n.transactions.some(i=>i.effects.some(o=>o.is(Ls)))||n.view.state.facet(Dt).onRun())})}Nw=function({cellId:e,hotkeys:n,cellActions:i}){return[Dt.of(i),La.of(e),bC({cellId:e,hotkeys:n}),wC(n),vC(yS(lT(e),ct))]};const Dy=async e=>{let n=e.state.doc.sliceString(0,e.pos),i=document.activeElement,o=null;if(i!==null){let d=Zn.findElement(i);d!==null&&(o=Zn.parse(d.id))}if(o===null)return Re.error("Failed to find active cell."),null;let s=await Qu.request({document:n,cellId:o});if(!s)return null;let c=Gd.asHoverTooltip({position:e.pos,message:s,limitToType:"tooltip"});return c&&ct.set(ed,{documentation:c.html??null}),c?null:Gd.asCompletionResult(e.pos,s)};function xC(e){return n=>e.predicate(n.state)?e.completion(n):null}var kC=async e=>{let n=e.matchBefore(/:\w*$/);if(!e.explicit&&!n)return null;let i=await SC();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w:]*$/}},SC=ui(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"}))}),CC=async e=>{let n=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!n)return null;let i=await EC();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w-:]*$/}},EC=ui(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}}))}),TC=e=>{let n=e.matchBefore(/\\\w*$/);return!e.explicit&&!n?null:{from:(n==null?void 0:n.from)??e.pos,options:RC(),validFor:/^[\w\\]*$/}},RC=ui(()=>[["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 Oy;Oy=[kC,CC,TC],Hl={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 Py;Bl=class Nm{constructor(n){this.deliminator=n}static guessDeliminator(n){return n.includes("/")?new Nm("/"):new Nm("\\")}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)}},Py=100;function Io(e){return!e.state.selection.main.empty}function Yd({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 Zd({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(`
119
+ `),oe,re)},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),qt(u,m.argString.trimStart(),{noremap:v}),u.state.vim.insertMode&&Hn(u,!0);else qt(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=gc(v),O=v,N="";if(R&&R.length&&(O=R[0],N=R.slice(1,R.length).join("/")),O)try{wi(u,O,!0,!0)}catch{ct(u,"Invalid regex: "+O);return}for(var F=Un(u).getQuery(),q=[],oe=x;oe<=k;oe++){var re=u.getLine(oe);F.test(re)!==b&&q.push(N?u.getLineHandle(oe):re)}if(!N){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+N;_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,N,F=!1,q=!1;if(b&&b.length)x=b[0],we("pcre")&&x!==""&&(x=new RegExp(x).source),k=b[1],k!==void 0&&(k=we("pcre")?Hs(k.replace(/([^\\])&/g,"$1$$&")):yc(k),K.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],N=parseInt(R[1]),O&&(O.indexOf("c")!=-1&&(F=!0),O.indexOf("g")!=-1&&(q=!0),x=we("pcre")?x+"/"+O:x.replace(/\//g,"\\/")+"/"+O)),x)try{wi(u,x,!0,!0)}catch{ct(u,"Invalid regex: "+x);return}if(k||(k=K.lastSubstituteReplacePart),k===void 0){ct(u,"No previous substitute regular expression");return}var oe=Un(u).getQuery(),re=m.line===void 0?u.getCursor().line:m.line,X=m.lineEnd||re;re==u.firstLine()&&X==u.lastLine()&&(X=1/0),N&&(re=X,X=re+N-1);var Y=jt(u,new n(re,0)),xe=u.getSearchCursor(oe,Y);$s(u,F,q,re,X,xe,oe,k,m.callback)},startinsert:function(u,m){qt(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){xi(u)},yank:function(u){var m=Ge(u.getCursor()).line,v=u.getLine(m);K.registerController.pushText("0","yank",v,!0,!0)},delete:function(u,m){var v=m.selectionLine,b=isNaN(m.selectionLineEnd)?v:m.selectionLineEnd;Wt.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)),dn.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&&I(R)==I(O)){var N=R.charCodeAt(0),F=O.charCodeAt(0);if(N>=F){ct(u,"Invalid argument: "+m.argString.substring(x));return}for(var q=0;q<=F-N;q++){var oe=String.fromCharCode(N+q);delete v.marks[oe]}}else{ct(u,"Invalid argument: "+R+"-");return}}else k&&delete v.marks[k]}}},_n=new Vo;je.defineEx("version","ve",u=>{ct(u,"Codemirror-vim version: 6.3.0")});function $s(u,m,v,b,x,k,R,O,N){u.state.vim.exMode=!0;var F=!1,q=0,oe,re,X;function Y(){u.operation(function(){for(;!F;)xe(),qe();Te()})}function xe(){var dt="",Je=k.match||k.pos&&k.pos.match;dt=Je?O.replace(/\$(\d{1,3}|[$&])/g,function(zt,Ue){if(Ue=="$")return"$";if(Ue=="&")return Je[0];for(var Ve=Ue;parseInt(Ve)>=Je.length&&Ve.length>0;)Ve=Ve.slice(0,Ve.length-1);return Ve?Je[Ve]+Ue.slice(Ve.length,Ue.length):zt}):u.getRange(k.from(),k.to()).replace(R,O);var Mt=k.to().line;k.replace(dt),re=k.to().line,x+=re-Mt,X=re<Mt}function _e(){var dt=oe&&Ge(k.to()),Je=k.findNext();return Je&&!Je[0]&&dt&&ht(k.from(),dt)&&(Je=k.findNext()),Je&&q++,Je}function qe(){for(;_e()&&wc(k.from(),b,x);)if(!(!v&&k.from().line==re&&!X)){u.scrollIntoView(k.from(),30),u.setSelection(k.from(),k.to()),oe=k.from(),F=!1;return}F=!0}function Te(dt){if(dt&&dt(),u.focus(),oe){u.setCursor(oe);var Je=u.state.vim;Je.exMode=!1,Je.lastHPos=Je.lastHSPos=oe.ch}N?N():F&&ct(u,(q?"Found "+q+" matches":"No matches found")+" for pattern: "+R+(we("pcre")?" (set nopcre to use Vim regexps)":""))}function Ie(dt,Je,Mt){switch(e.e_stop(dt),en(dt)){case"y":xe(),qe();break;case"n":qe();break;case"a":var zt=N;N=void 0,u.operation(Y),N=zt;break;case"l":xe();case"q":case"<Esc>":case"<C-c>":case"<C-[>":Te(Mt);break}return F&&Te(Mt),!0}if(qe(),F){ct(u,"No matches for "+R+(we("pcre")?" (set nopcre to use vim regexps)":""));return}if(!m){Y(),N&&N();return}ia(u,{prefix:Nn("span","replace with ",Nn("strong",O)," (y/n/a/q/l)"),onKeyDown:Ie})}function Hn(u,m){var v=u.state.vim,b=K.macroModeState,x=K.registerController.getRegister("."),k=b.isPlaying,R=b.lastInsertModeChanges;k||(u.off("change",$r),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=void 0,e.off(u.getInputField(),"keydown",Ks)),!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&&Us(b)}function ai(u){o.unshift(u),u.keys&&xc(u.keys)}function xc(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){m&&(s[m]||(s[m]=0),s[m]++)})}function Ws(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){s[m]&&s[m]--})}function kc(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];ai(k)}be("insertModeEscKeysTimeout",200,"number");function Qa(u,m,v,b){var x=K.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 N=k[O],F,q,oe=/<(?:[CSMA]-)*\w+>|./gi;F=oe.exec(N);)if(q=F[0],je.handleKey(u,q,"macro"),m.insertMode){var re=x.insertModeChanges[R++].changes;K.macroModeState.lastInsertModeChanges.changes=re,Qs(u,re,1),Hn(u)}v.isPlaying=!1}function Vr(u,m){if(!u.isPlaying){var v=u.latestRegister,b=K.registerController.getRegister(v);b&&b.pushText(m)}}function Us(u){if(!u.isPlaying){var m=u.latestRegister,v=K.registerController.getRegister(m);v&&v.pushInsertModeChanges&&v.pushInsertModeChanges(u.lastInsertModeChanges)}}function Ga(u,m){if(!u.isPlaying){var v=u.latestRegister,b=K.registerController.getRegister(v);b&&b.pushSearchQuery&&b.pushSearchQuery(m)}}function $r(u,m){var v=K.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(),N=u.getCursor();if(O&&O.line==N.line){var F=O.ch-N.ch;F>0&&F<R.length&&(b.changes.push([R,F]),R="")}}R&&b.changes.push(R)}}m=m.next}}function $o(u){var x;var m=u.state.vim;if(m.insertMode){var v=K.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=wt(b,v)?0:-1,k=wt(b,v)?-1:0;b=bt(b,0,x),v=bt(v,0,k),m.sel={anchor:v,head:b},Fn(u,m,"<",_t(b,v)),Fn(u,m,">",jn(b,v))}else m.insertMode||(m.lastHPos=u.getCursor().ch)}function Ks(u){var m=K.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 $e(v,u)))}function Xa(u,m,v,b){var x=K.macroModeState;x.isPlaying=!0;var k=m.lastEditActionCommand,R=m.inputState;function O(){k?Pn.processAction(u,m,k):Pn.evalInput(u,m)}function N(q){if(x.lastInsertModeChanges.changes.length>0){q=m.lastEditActionCommand?q:1;var oe=x.lastInsertModeChanges;Qs(u,oe.changes,q)}}if(m.inputState=m.lastEditInputState,k&&k.interlaceInsertRepeat)for(var F=0;F<v;F++)O(),N(1);else b||O(),N(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 Qs(u,m,v){var b=u.getCursor("head"),x=K.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(bt(b,k,0));for(var R=0;R<m.length;R++){var O=m[R];if(O instanceof $e)Ya(u,O.keyName);else if(typeof O=="string")u.replaceSelection(O);else{var N=u.getCursor(),F=bt(N,0,O[0].length-(O[1]||0));u.replaceRange(O[0],N,O[1]?N:F),u.setCursor(F)}}}x&&u.setCursor(bt(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 ki(u,m,v){var k=se(u),b=u,x=!1,k=je.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 ft(b),!0}var N=b.isInMultiSelectMode();if(k.wasInVisualBlock&&!N?k.wasInVisualBlock=!1:N&&k.visualBlock&&(k.wasInVisualBlock=!0),m=="<Esc>"&&!k.insertMode&&!k.visualMode&&N&&k.status=="<Esc>")ft(b);else if(R||!N||b.inVirtualSelectionMode)x=je.handleKey(b,m,v);else{var F=xn(k),q=k.inputState.changeQueueList||[];b.operation(function(){var re;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=wt(X,Y)?0:-1,_e=wt(X,Y)?-1:0;X=bt(X,0,xe),Y=bt(Y,0,_e),b.state.vim.sel.head=X,b.state.vim.sel.anchor=Y,x=je.handleKey(b,m,v),b.virtualSelection&&(q[oe]=b.state.vim.inputState.changeQueue,b.state.vim=xn(F)),oe++}),(re=b.curOp)!=null&&re.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(),je}function nr(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 ei=class{constructor(e,n){this.line=e,this.ch=n}};function hy(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 my(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 gy(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 yy(e,...n){if(e)for(var i=0;i<e.length;++i)e[i](...n)}var Jd;try{Jd=RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch{Jd=/[\w]/}function Is(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 vy(e,n){var o;e.curOp&&(e.curOp.$changeStart=void 0),(n?I4:A4)(e.cm6);let i=(o=e.curOp)==null?void 0:o.$changeStart;i!=null&&e.cm6.dispatch({selection:{anchor:i}})}var JS={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 mx{openDialog(n,i,o){return YS(this,n,i,o)}openNotification(n,i){return XS(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){hy(this,n,i)}off(n,i){my(this,n,i)}signal(n,i,o){gy(this,n,i,o)}indexFromPos(n){return nr(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=nr(s,n),d=hn.create([hn.range(c,c)],0).ranges;i.state.selection.ranges=d,_4(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=nr(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=nr(o,c.head),f=nr(o,c.anchor);return d==f?hn.cursor(d,1):hn.range(f,d)});this.cm6.dispatch({selection:hn.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 ei(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,sw.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(nr(o,n),nr(o,i))}replaceRange(n,i,o,s){o||(o=i);var c=this.cm6.state.doc,d=nr(c,i),f=nr(c,o);Is(this,{changes:{from:d,to:f,insert:n}})}replaceSelection(n){Is(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]||""}));Is(this,{changes:i})}getSelection(){return this.getSelections().join(`
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 ei(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:hn.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=nr(o.doc,n),c=hw(o,s+1,-1);return c&&c.end||(c=hw(o,s,1),c&&c.end)?{to:qr(o.doc,c.end.from)}:{to:void 0}}scanForBracket(n,i,o,s){return tC(this,n,i,o,s)}indentLine(n,i){i?this.indentMore():this.indentLess()}indentMore(){X4(this.cm6)}indentLess(){F4(this.cm6)}execCommand(n){if(n=="indentAuto")mx.commands.indentAuto(this);else if(n=="goLineLeft")V4(this.cm6);else if(n=="goLineRight"){H4(this.cm6);let i=this.cm6.state,o=i.selection.main.head;o<i.doc.length&&i.sliceDoc(o,o+1)!==`
123
+ `&&B4(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 iC(this,s,o)}addOverlay({query:n}){let i=new $4({regexp:!0,search:n.source,caseSensitive:!/i/.test(n.flags)});if(i.valid){i.forVim=!0,this.cm6Query=i;let o=xh.of(i);return this.cm6.dispatch({effects:o}),i}}removeOverlay(n){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let i=xh.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=nr(o.cm6.state.doc,i),p=n.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(E,T){return T||"\\"+E});function y(E,T=0,L=E.length){return new K4(E,p,{ignoreCase:n.ignoreCase},T,L)}function w(E){var T=o.cm6.state.doc;if(E>T.length)return null;let L=y(T,E).next();return L.done?null:L.value}var _=1e4;function C(E,T){var L=o.cm6.state.doc;for(let z=1;;z++){let U=Math.max(E,T-z*_),$=y(L,U,T),I=null;for(;!$.next().done;)I=$.value;if(I&&(U==E||I.from>U+10))return I;if(U==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&&(Is(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=nr(d,n),y=hn.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=nr(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:Ut.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&&yy(n.changeHandlers,this,n.change),n&&n.cursorActivity&&(yy(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(lw)==" ";case"indentUnit":return this.cm6.state.facet(lw).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=uw(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 hn.range(c.from,c.to+1)}return c});this.cm6.dispatch({selection:hn.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=hn.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:hn.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 aC(this,n)}};Xe.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform),Xe.Pos=ei,Xe.StringStream=L4,Xe.commands={cursorCharLeft:function(e){W4(e.cm6)},redo:function(e){vy(e,!1)},undo:function(e){vy(e,!0)},newlineAndIndent:function(e){J4({state:e.cm6.state,dispatch:n=>Is(e,n)})},indentAuto:function(e){q4(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},Xe.isWordChar=function(e){return Jd.test(e)},Xe.keys=JS,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=hy,Xe.off=my,Xe.signal=gy,Xe.findMatchingTag=nC,Xe.findEnclosingTag=rC,Xe.keyName=void 0;function by(e,n,i){var o=document.createElement("div");return o.appendChild(n),o}function wy(e,n){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=n}function XS(e,n,i){wy(e,f);var o=by(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(),xy(e,o))}return o.onclick=function(p){p.preventDefault(),f()},_y(e,o),d&&(c=setTimeout(f,d)),f}function _y(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 xy(e,n){e.state.dialog==n&&(e.state.dialog=null,Xe.signal(e,"dialog"))}function YS(e,n,i,o){o||(o={}),wy(e,void 0);var s=by(e,n,o.bottom),c=!1;_y(e,s);function d(p){if(typeof p=="string")f.value=p;else{if(c)return;c=!0,xy(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 ZS={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function eC(e){return e&&e.bracketRegex||/[(){}[\]]/}function tC(e,n,i,o,s){for(var c=s&&s.maxScanLineLength||1e4,d=s&&s.maxScanLines||1e3,f=[],p=eC(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 L=ZS[T];if(L&&L.charAt(1)==">"==i>0)f.push(T);else if(f.length)f.pop();else return{pos:new ei(w,C),ch:T}}}}}return w-i==(i>0?e.lastLine():e.firstLine())?!1:null}function nC(e,n){return null}function rC(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=uw(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:ky(i.doc,s.firstChild),close:ky(i.doc,s.lastChild)};s=s.parent}}function ky(e,n){return{from:qr(e,n.from),to:qr(e,n.to)}}var iC=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,sw.TrackDel))}};function aC(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
+ `+p,new ei(s,f.start),new ei(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 ei(s,w.length),new ei(s+1,y.length-_.length)),s--,c--):w.length<d.length&&e.replaceRange("",new ei(s,w.length),new ei(s,d.length))}}s++}return s;function E(L,z,U){if(!(L.length<z)){var $=L.slice(0,z),I=L.slice(z),G=/^(?:(\s+)|(\S+)(\s+))/.exec(I),pe=/(?:(\s+)|(\s+)(\S+))$/.exec($),P=0,A=0;if(pe&&!pe[2]&&(P=z-pe[1].length,A=z),G&&!G[2]&&(P||(P=z),A=z+G[1].length),P)return{start:P,end:A};if(pe&&pe[2]&&pe.index>U)return{start:pe.index,end:pe.index+pe[2].length};if(G&&G[2])return P=z+G[2].length,{start:P,end:P+G[3].length}}}}var Xd=P4||(function(){let e={cursorBlinkRate:1200};return function(){return e}})(),oC=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}},sC=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=Xd(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"),lC(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=dC(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 lC(e){return Xd(e.startState)!=Xd(e.state)}var cC=Lu.highest(Ut.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 uC(e){let n=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==D4.LTR?n.left:n.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:n.top-e.scrollDOM.scrollTop*e.scaleY}}function dC(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
+ `&&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 L=uC(n),z=n.domAtPos(c),U=z?z.node:n.contentDOM;for(U instanceof Text&&z.offset>=U.data.length&&((w=U.parentElement)==null?void 0:w.nextSibling)&&(U=(_=U.parentElement)==null?void 0:_.nextSibling,z={node:U,offset:0});z&&z.node instanceof HTMLElement;)U=z.node,z={node:z.node.childNodes[z.offset],offset:0};if(!(U instanceof HTMLElement)){if(!U.parentNode)return null;U=U.parentNode}let $=getComputedStyle(U),I=T.left,G=(C=(s=n).coordsForChar)==null?void 0:C.call(s,c);if(G&&(I=G.left),!E||E==`
126
+ `||E=="\r")E="\xA0";else if(E==" "){E="\xA0";var y=n.coordsAtPos(c+1,-1);y&&(I=y.left-(y.left-T.left)/parseInt($.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 oC((I-L.left)/n.scaleX,(T.top-L.top+pe*(1-f))/n.scaleY,pe*f/n.scaleY,$.fontFamily,$.fontSize,$.fontWeight,$.color,o?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",E,f!=1)}else return null}let Sy,Cy,Ey,Ty;Sy=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),Vi=GS(Xe),Cy=250,Ey=Ut.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"}}),Ty=Ml.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=Bi.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;let n=this.cm=new Xe(e);Vi.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new sC(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:Ry.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=>{Vi.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(xh))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(){Vi.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=Bi.none;let{view:n}=this,i=new aw;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*Cy;)f=s[++o].to;e.highlight(n.state,d,f,(p,y)=>{i.add(p,y,pC)})}return this.decorations=i.finish()}handleKey(e,n){let i=this.cm,o=i.state.vim;if(!o)return;let s=Vi.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=Vi.multiSelectHandleKey(i,s,"user");return o=Vi.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),Vi.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:()=>[Ut.inputHandler.of((e,n,i,o)=>{var w,_;var s=$l(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:()=>{}}),fC(e),!0}}return!1})],decorations:e=>e.decorations});function fC(e){var n=e.scrollDOM.parentElement;if(n){if(Sy){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 pC=Bi.mark({class:"cm-searchMatch"}),Ry=Fi.define(),hC=xs.define({create:()=>!1,update(e,n){for(let i of n.effects)i.is(Ry)&&(e=i.value);return e},provide:e=>wh.from(e,n=>n?mC:null)});function mC(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 gC(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}}r_=function(e={}){return[Ey,Ty,cC,e.status?wh.of(gC):hC]},$l=function(e){return e.cm||null},Hh=function(e){let n=e.state.selection.main;return n.from===0&&n.to===0},qh=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},Pw=function(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})},Jw=function(e){var n;return((n=$l(e))==null?void 0:n.state.vim)!=null},cx=function(e){var i;let n=(i=$l(e))==null?void 0:i.state.vim;return n?!n.mode&&!n.insertMode&&!n.visualMode?!0:n.mode==="normal":!1},n_=function(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})};function Dy(e,n){if(!(n!=null&&n.length))return Bi.none;let i=new aw,o=e.facet(La),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=Bi.line({class:"cm-error-line"});i.add(d.from,d.from,f)}catch(d){Re.debug("Invalid line number in error decoration",{error:d})}return i.finish()}function Oy(e,n){if(!(n!=null&&n.length))return;let i=e.state.facet(La),o=n.filter(d=>d.kind==="cell"&&d.cellId===i);if(o.length===0)return;let s=O4(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(E4.of({from:p,to:y}))})}catch(f){Re.debug("Invalid line numbers",{error:f})}c.length>0&&e.dispatch({effects:c})}var yC=class{constructor(e,n){let i=n.get();this.decorations=Dy(e.state,i),Oy(e,i),this.unsubscribe=n.sub(o=>{let s=this.decorations.size;this.decorations=Dy(e.state,o),Oy(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 vC(e){return Ml.define(n=>new yC(n,e),{decorations:n=>n.decorations})}function bC(e){return[vC(e),Ut.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 wC({cellId:e,hotkeys:n}){let i=[];return i.push(...ew({key:n.getHotkey("cell.run").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).onRun(),!0)}),{key:n.getHotkey("cell.runAndNewBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Dt);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})),!0}},...ew({key:n.getHotkey("cell.runAndNewAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Dt);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(Dt).aiCellCompletion()&&o.contentDOM.focus(),!0)}),e!=="__scratch__"&&i.push({key:n.getHotkey("cell.goToDefinition").key,preventDefault:!0,stopPropagation:!0,run:o=>(Tm(o),!0)},{key:n.getHotkey("cell.delete").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.doc.length===0&&o.state.facet(Dt).deleteCell(),!0)},{key:n.getHotkey("cell.moveUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).moveCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.moveDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).moveCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.moveLeft").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).moveCell({cellId:e,before:!0,direction:"left"}),!0)},{key:n.getHotkey("cell.moveRight").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).moveCell({cellId:e,before:!1,direction:"right"}),!0)},{key:"ArrowUp",preventDefault:!0,stopPropagation:!0,run:o=>bw(o.state)?!1:Hh(o)?(o.state.facet(Dt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:"ArrowDown",preventDefault:!0,stopPropagation:!0,run:o=>bw(o.state)?!1:qh(o)?(o.state.facet(Dt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0):!1},{key:n.getHotkey("cell.focusDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0)},{key:n.getHotkey("cell.focusUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},{key:n.getHotkey("cell.sendToBottom").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).sendToBottom({cellId:e}),!0)},{key:n.getHotkey("cell.sendToTop").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Dt).sendToTop({cellId:e}),!0)},{key:n.getHotkey("cell.createAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(Dt).createNewCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.createBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(Dt).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(Dt).toggleHideCode();return ww(o),s?(o.contentDOM.blur(),(c=document.getElementById(Zn.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(Dt);return s.splitCell({cellId:e}),s.moveToNextCell&&requestAnimationFrame(()=>{o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})}),!0}}),[Lu.high(Ta.of(i))]}function _C(e){return[Ut.updateListener.of(n=>{if(n.docChanged){let i=n.transactions.some(d=>d.effects.some(f=>f.is(Ls))),o=Jr(n.view),s=n.view.state.facet(Dt),c=n.view.state.facet(La);s.updateCellCode({cellId:c,code:o,formattingChange:i})}}),_S(e)]}function xC({predicate:e}){return Ut.updateListener.of(n=>{n.docChanged&&n.view.hasFocus&&e()&&(n.transactions.some(i=>i.effects.some(o=>o.is(Ls)))||n.view.state.facet(Dt).onRun())})}Aw=function({cellId:e,hotkeys:n,cellActions:i}){return[Dt.of(i),La.of(e),wC({cellId:e,hotkeys:n}),_C(n),bC(vS(cT(e),st))]};const Py=async e=>{let n=e.state.doc.sliceString(0,e.pos),i=document.activeElement,o=null;if(i!==null){let d=Zn.findElement(i);d!==null&&(o=Zn.parse(d.id))}if(o===null)return Re.error("Failed to find active cell."),null;let s=await Qu.request({document:n,cellId:o});if(!s)return null;let c=Gd.asHoverTooltip({position:e.pos,message:s,limitToType:"tooltip"});return c&&st.set(ed,{documentation:c.html??null}),c?null:Gd.asCompletionResult(e.pos,s)};function kC(e){return n=>e.predicate(n.state)?e.completion(n):null}var SC=async e=>{let n=e.matchBefore(/:\w*$/);if(!e.explicit&&!n)return null;let i=await CC();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w:]*$/}},CC=ui(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"}))}),EC=async e=>{let n=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!n)return null;let i=await TC();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w-:]*$/}},TC=ui(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}}))}),RC=e=>{let n=e.matchBefore(/\\\w*$/);return!e.explicit&&!n?null:{from:(n==null?void 0:n.from)??e.pos,options:DC(),validFor:/^[\w\\]*$/}},DC=ui(()=>[["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 My;My=[SC,EC,RC],Hl={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 Ly;Bl=class Im{constructor(n){this.deliminator=n}static guessDeliminator(n){return n.includes("/")?new Im("/"):new Im("\\")}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)}},Ly=100;function Io(e){return!e.state.selection.main.empty}function Yd({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 Zd({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:hn.range(n.from+f,n.to+p)}}function DC(e){if(!Io(e))return!1;let n=Yd({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 OC(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 Zd({view:e,range:i,markupBefore:"**",markupAfter:"**"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0}function My(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 Zd({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 PC(e){let n=e.state.changeByRange(i=>{if(i.empty){let o=e.state.wordAt(i.head);o&&(i=o)}return Zd({view:e,range:i,markupBefore:"_",markupAfter:"_"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0}function Ly(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:hn.create([hn.range(o+3,o+3+n.length),hn.cursor(o+3+n.length)])})}catch{}return e.focus(),!0}vm=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(_>Py){Il({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 _=ct.get(Es),C=_?Hl.dirname(_):null,E=C?`${C}/public`:"public",T=await Hi().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=Hl.rest(s,C)),Il({title:"Image uploaded successfully",description:`We've uploaded your image at ${s}`})):Il({title:"Failed to upload image. Using raw base64 string."})}}}catch{Il({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:hn.create([hn.range(d+4,d+4+o.length),hn.cursor(d+4+o.length)])})}catch{}return e.focus(),!0},Wh=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 MC(e){if(!Io(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:Yd({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 LC(e){if(!Io(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:Yd({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 NC(e){return[Lu.highest(Ta.of([{key:e.getHotkey("markdown.bold").key,stopPropagation:!0,run:OC},{key:e.getHotkey("markdown.italic").key,stopPropagation:!0,run:PC},{key:e.getHotkey("markdown.link").key,stopPropagation:!0,run:n=>Ly(n)},{key:e.getHotkey("markdown.orderedList").key,run:LC},{key:e.getHotkey("markdown.unorderedList").key,run:MC},{key:e.getHotkey("markdown.blockquote").key,run:DC},{key:e.getHotkey("markdown.code").key,run:My},{key:"`",run:My}])),Ut.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(),Ly(i,o))}}),Ut.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(),vm(i,o),!0;if(o.type.startsWith("text/"))return n.preventDefault(),Wh(i,o),!0}})]}function IC(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:()=>Mh(s)})}Mh=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",ef=123,Ny=125,tf=1,AC={mark:`${Ao}Mark`,resolve:Ao};function qC(e,n){return{defineNodes:[{name:Ao,style:Pu.emphasis},{name:`${Ao}Mark`,style:Pu.processingInstruction}],parseInline:[{name:Ao,parse(i,o,s){return!n()||o!==ef&&o!==Ny||o===ef&&i.slice(s-1,s)==="{"?-1:i.addDelimiter(AC,s,s+tf,o===ef,o===Ny)}}],wrap:uw(i=>{if(!n()||i.type.name!==Ao)return null;let o=i.from+tf,s=i.to-tf;return o>=s||o<0||s<0?null:{parser:e,overlay:[{from:o,to:s}],extensions:[kw().support]}})}}const jC=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=IC(ct.get(Ma),new Set,99);return{from:o.from,options:s,validFor:/^\w*$/}};var lc="InlineMathDollar",qo="InlineMathBracket",cc="BlockMathDollar",jo="BlockMathBracket",Ba={[lc]:1,[qo]:3,[cc]:2,[jo]:3},Nt={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 zC(e){let n=[];return Object.keys(Ba).forEach(i=>{n.push({name:i,style:Pu.emphasis},{name:`${i}Mark`,style:Pu.processingInstruction})}),{defineNodes:n,parseInline:[{name:cc,parse(i,o,s){return o!==Nt.DOLLAR||i.char(s+1)!==Nt.DOLLAR?-1:i.addDelimiter(zo[cc],s,s+Ba[cc],!0,!0)}},{name:lc,parse(i,o,s){return o!==Nt.DOLLAR||i.char(s+1)===Nt.DOLLAR?-1:i.addDelimiter(zo[lc],s,s+Ba[lc],!0,!0)}},{name:qo,before:"Escape",parse(i,o,s){return o!==Nt.BACKSLASH||i.char(s+1)!==Nt.BACKSLASH||![Nt.OPEN_PAREN,Nt.CLOSE_PAREN].includes(i.char(s+2))?-1:i.addDelimiter(zo[qo],s,s+Ba[qo],i.char(s+2)===Nt.OPEN_PAREN,i.char(s+2)===Nt.CLOSE_PAREN)}},{name:jo,before:"Escape",parse(i,o,s){return o!==Nt.BACKSLASH||i.char(s+1)!==Nt.BACKSLASH||![Nt.OPEN_BRACKET,Nt.CLOSE_BRACKET].includes(i.char(s+2))?-1:i.addDelimiter(zo[jo],s,s+Ba[jo],i.char(s+2)===Nt.OPEN_BRACKET,i.char(s+2)===Nt.CLOSE_BRACKET)}},{name:qo,before:"Escape",parse(i,o,s){return o!==Nt.BACKSLASH||![Nt.OPEN_PAREN,Nt.CLOSE_PAREN].includes(i.char(s+1))?-1:i.addDelimiter(zo[qo],s,s+2,i.char(s+1)===Nt.OPEN_PAREN,i.char(s+1)===Nt.CLOSE_PAREN)}},{name:jo,before:"Escape",parse(i,o,s){return o!==Nt.BACKSLASH||![Nt.OPEN_BRACKET,Nt.CLOSE_BRACKET].includes(i.char(s+1))?-1:i.addDelimiter(zo[jo],s,s+2,i.char(s+1)===Nt.OPEN_BRACKET,i.char(s+1)===Nt.CLOSE_BRACKET)}}],wrap:uw(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})}}Uu=Fi.define(),nd=Fi.define(),di=xs.define({create:()=>({}),update:(e,n)=>{for(let i of n.effects){if(i.is(Uu))return i.value;if(i.is(nd))return{...e,...i.value}}return e}}),Fu=class{constructor(){ke(this,"parser",new Xg);ke(this,"type","markdown");ke(this,"defaultCode",this.parser.defaultCode);ke(this,"defaultMetadata",this.parser.defaultMetadata)}static fromMarkdown(e){return Xg.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=xw().language.data,c,d=()=>{var p;if(!c)return!0;let f=c==null?void 0:c.state.field(di);return f===void 0?!1:((p=f.quotePrefix)==null?void 0:p.includes("f"))??!1};return[Ml.define(f=>(c=f,{})),xw({base:SD,codeLanguages:Uk,extensions:[zC(cw.define(RD).parser),qC(Dh.parser,d)]}),NC(i),Oy.map(f=>s.of({autocomplete:f})),kw().language.data.of({autocomplete:xC({completion:Dy,predicate:d})}),Nu({defaultKeymap:!1,activateOnTyping:!0}),_C({predicate:()=>!d()})]}};function Iy(){return`file://${Jl()??"/__marimo_notebook__.py"}`}function nf(){return`file://${Hl.dirname(Jl()??"/")}`}function FC(e){return ci.filter(e,n=>n!==!1&&n!==null)}function Ay(e){let n=e.map(FC);return Object.assign({},...n)}var BC=class{constructor(e){ke(this,"clients",[]);this.clients=e,this.documentUri=Iy()}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 Ay(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 Ay(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 HC(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 HC(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}}Zw=function(e){return[...VC(e),e].join(`
129
- `)};function VC(e){return wm().map(n=>{let i=Jr(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 $C=Be(e=>{let n=e(yt);return ci.fromEntries(n.cellIds.inOrderIds.map(i=>{let o=n.cellHandles[i];return[i,o!=null&&o.current?Jr(o.current.editorView):""]}))}),WC=Be(e=>e(yt).cellIds.inOrderIds),UC=Be(e=>QC(e(WC),e(Ma)));const KC=Be(e=>({cellIds:e(UC),codes:e($C)}));function QC(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 GC(e,n){let i=new Map,o=0;e.forEach(d=>{i.set(d,o),o+=n[d].split(`
128
+ `))});let f=s?-o.length:o.length,p=c?-i.length:i.length;return{changes:d,range:hn.range(n.from+f,n.to+p)}}function OC(e){if(!Io(e))return!1;let n=Yd({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 PC(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 Zd({view:e,range:i,markupBefore:"**",markupAfter:"**"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0}function Ny(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 Zd({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 MC(e){let n=e.state.changeByRange(i=>{if(i.empty){let o=e.state.wordAt(i.head);o&&(i=o)}return Zd({view:e,range:i,markupBefore:"_",markupAfter:"_"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0}function Iy(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:hn.create([hn.range(o+3,o+3+n.length),hn.cursor(o+3+n.length)])})}catch{}return e.focus(),!0}vm=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(_>Ly){Il({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 _=st.get(Es),C=_?Hl.dirname(_):null,E=C?`${C}/public`:"public",T=await Hi().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=Hl.rest(s,C)),Il({title:"Image uploaded successfully",description:`We've uploaded your image at ${s}`})):Il({title:"Failed to upload image. Using raw base64 string."})}}}catch{Il({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:hn.create([hn.range(d+4,d+4+o.length),hn.cursor(d+4+o.length)])})}catch{}return e.focus(),!0},Wh=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 LC(e){if(!Io(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:Yd({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 NC(e){if(!Io(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:Yd({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 IC(e){return[Lu.highest(Ta.of([{key:e.getHotkey("markdown.bold").key,stopPropagation:!0,run:PC},{key:e.getHotkey("markdown.italic").key,stopPropagation:!0,run:MC},{key:e.getHotkey("markdown.link").key,stopPropagation:!0,run:n=>Iy(n)},{key:e.getHotkey("markdown.orderedList").key,run:NC},{key:e.getHotkey("markdown.unorderedList").key,run:LC},{key:e.getHotkey("markdown.blockquote").key,run:OC},{key:e.getHotkey("markdown.code").key,run:Ny},{key:"`",run:Ny}])),Ut.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(),Iy(i,o))}}),Ut.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(),vm(i,o),!0;if(o.type.startsWith("text/"))return n.preventDefault(),Wh(i,o),!0}})]}function AC(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:()=>Mh(s)})}Mh=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",ef=123,Ay=125,tf=1,qC={mark:`${Ao}Mark`,resolve:Ao};function jC(e,n){return{defineNodes:[{name:Ao,style:Pu.emphasis},{name:`${Ao}Mark`,style:Pu.processingInstruction}],parseInline:[{name:Ao,parse(i,o,s){return!n()||o!==ef&&o!==Ay||o===ef&&i.slice(s-1,s)==="{"?-1:i.addDelimiter(qC,s,s+tf,o===ef,o===Ay)}}],wrap:fw(i=>{if(!n()||i.type.name!==Ao)return null;let o=i.from+tf,s=i.to-tf;return o>=s||o<0||s<0?null:{parser:e,overlay:[{from:o,to:s}],extensions:[Cw().support]}})}}const zC=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=AC(st.get(Ma),new Set,99);return{from:o.from,options:s,validFor:/^\w*$/}};var lc="InlineMathDollar",qo="InlineMathBracket",cc="BlockMathDollar",jo="BlockMathBracket",Ba={[lc]:1,[qo]:3,[cc]:2,[jo]:3},Nt={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 FC(e){let n=[];return Object.keys(Ba).forEach(i=>{n.push({name:i,style:Pu.emphasis},{name:`${i}Mark`,style:Pu.processingInstruction})}),{defineNodes:n,parseInline:[{name:cc,parse(i,o,s){return o!==Nt.DOLLAR||i.char(s+1)!==Nt.DOLLAR?-1:i.addDelimiter(zo[cc],s,s+Ba[cc],!0,!0)}},{name:lc,parse(i,o,s){return o!==Nt.DOLLAR||i.char(s+1)===Nt.DOLLAR?-1:i.addDelimiter(zo[lc],s,s+Ba[lc],!0,!0)}},{name:qo,before:"Escape",parse(i,o,s){return o!==Nt.BACKSLASH||i.char(s+1)!==Nt.BACKSLASH||![Nt.OPEN_PAREN,Nt.CLOSE_PAREN].includes(i.char(s+2))?-1:i.addDelimiter(zo[qo],s,s+Ba[qo],i.char(s+2)===Nt.OPEN_PAREN,i.char(s+2)===Nt.CLOSE_PAREN)}},{name:jo,before:"Escape",parse(i,o,s){return o!==Nt.BACKSLASH||i.char(s+1)!==Nt.BACKSLASH||![Nt.OPEN_BRACKET,Nt.CLOSE_BRACKET].includes(i.char(s+2))?-1:i.addDelimiter(zo[jo],s,s+Ba[jo],i.char(s+2)===Nt.OPEN_BRACKET,i.char(s+2)===Nt.CLOSE_BRACKET)}},{name:qo,before:"Escape",parse(i,o,s){return o!==Nt.BACKSLASH||![Nt.OPEN_PAREN,Nt.CLOSE_PAREN].includes(i.char(s+1))?-1:i.addDelimiter(zo[qo],s,s+2,i.char(s+1)===Nt.OPEN_PAREN,i.char(s+1)===Nt.CLOSE_PAREN)}},{name:jo,before:"Escape",parse(i,o,s){return o!==Nt.BACKSLASH||![Nt.OPEN_BRACKET,Nt.CLOSE_BRACKET].includes(i.char(s+1))?-1:i.addDelimiter(zo[jo],s,s+2,i.char(s+1)===Nt.OPEN_BRACKET,i.char(s+1)===Nt.CLOSE_BRACKET)}}],wrap:fw(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})}}Uu=Fi.define(),nd=Fi.define(),di=xs.define({create:()=>({}),update:(e,n)=>{for(let i of n.effects){if(i.is(Uu))return i.value;if(i.is(nd))return{...e,...i.value}}return e}}),Fu=class{constructor(){ke(this,"parser",new Yg);ke(this,"type","markdown");ke(this,"defaultCode",this.parser.defaultCode);ke(this,"defaultMetadata",this.parser.defaultMetadata)}static fromMarkdown(e){return Yg.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=Sw().language.data,c,d=()=>{var p;if(!c)return!0;let f=c==null?void 0:c.state.field(di);return f===void 0?!1:((p=f.quotePrefix)==null?void 0:p.includes("f"))??!1};return[Ml.define(f=>(c=f,{})),Sw({base:CD,codeLanguages:Kk,extensions:[FC(dw.define(DD).parser),jC(Dh.parser,d)]}),IC(i),My.map(f=>s.of({autocomplete:f})),Cw().language.data.of({autocomplete:kC({completion:Py,predicate:d})}),Nu({defaultKeymap:!1,activateOnTyping:!0}),xC({predicate:()=>!d()})]}};function qy(){return`file://${Jl()??"/__marimo_notebook__.py"}`}function nf(){return`file://${Hl.dirname(Jl()??"/")}`}function BC(e){return ci.filter(e,n=>n!==!1&&n!==null)}function jy(e){let n=e.map(BC);return Object.assign({},...n)}var HC=class{constructor(e){ke(this,"clients",[]);this.clients=e,this.documentUri=qy()}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 jy(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 jy(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 VC(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 VC(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}}t_=function(e){return[...$C(e),e].join(`
129
+ `)};function $C(e){return wm().map(n=>{let i=Jr(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 WC=Be(e=>{let n=e(yt);return ci.fromEntries(n.cellIds.inOrderIds.map(i=>{let o=n.cellHandles[i];return[i,o!=null&&o.current?Jr(o.current.editorView):""]}))}),UC=Be(e=>e(yt).cellIds.inOrderIds),KC=Be(e=>GC(e(UC),e(Ma)));const QC=Be(e=>({cellIds:e(KC),codes:e(WC)}));function GC(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 JC(e,n){let i=new Map,o=0;e.forEach(d=>{i.set(d,o),o+=n[d].split(`
130
130
  `).length});function s(d){return i.has(d)||Re.warn("[lsp] no cell line offsets for",d),i.get(d)??0}let c=e.map(d=>n[d]).join(`
131
- `);return{cellIds:e,mergedText:c,transformRange:(d,f)=>qy(d,s(f)),reverseRange:(d,f)=>qy(d,-s(f)),isInRange:(d,f)=>{let p=n[f].split(`
131
+ `);return{cellIds:e,mergedText:c,transformRange:(d,f)=>zy(d,s(f)),reverseRange:(d,f)=>zy(d,-s(f)),isInRange:(d,f)=>{let p=n[f].split(`
132
132
  `).length,y=i.get(f)||0,w=d.start.line-y,_=d.end.line-y;return w>=0&&_<p},getEditsForNewText:d=>{let f=d.split(`
133
133
  `),p=c.split(`
134
134
  `);if(f.length!==p.length)throw Re.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 ci.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)=>uc(d,s(f)),reversePosition:(d,f)=>uc(d,-s(f))}}function qy(e,n){return{start:uc(e.start,n),end:uc(e.end,n)}}function uc(e,n){return{line:e.line+n,character:e.character}}const rr={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 jy(e){return"notify"in e}var JC=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 GC(e,n)}},XC=()=>{let e=od().cellHandles;return ci.mapValues(e,n=>{var i;return(i=n.current)==null?void 0:i.editorViewOrNull})},rf=(Zi=class{constructor(n,i,o=XC){ke(this,"completionItemCache",new Ps(10));this.documentUri=Iy(),this.getNotebookEditors=o,this.initialSettings=i,this.client=n,this.patchProcessNotification(),this.initializePromise.then(()=>{In(jy(this.client),"notify is not a method on the client"),this.client.notify("workspace/didChangeConfiguration",{settings:i})}),this.snapshotter=new JC(this.getNotebookCode.bind(this))}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(jy(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}}),Re.log("[lsp] Document re-synchronization complete")}getNotebookCode(){return ct.get(KC)}assertCellDocumentUri(n){In(rr.is(n),"Execpted URI to be CellDocumentUri")}async textDocumentDidOpen(n){Re.debug("[lsp] textDocumentDidOpen",n);let i=n.textDocument.uri;this.assertCellDocumentUri(i);let{lens:o,version:s}=this.snapshotter.snapshot();Zi.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();return o?this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:i},contentChanges:[{text:n.mergedText}]}):{textDocument:{uri:this.documentUri,version:i},contentChanges:[{text:n.mergedText}]}}async textDocumentDidChange(n){return Re.debug("[lsp] textDocumentDidChange",n),n.contentChanges.length===1?this.sync():(Re.warn("[lsp] Unhandled textDocumentDidChange",n),this.client.textDocumentDidChange(n))}async textDocumentDefinition(n){let i=n.textDocument.uri;if(!rr.is(i))return Re.warn("Invalid cell document URI",i),null;await this.sync();let{lens:o}=this.snapshotter.getLatestSnapshot(),s=rr.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(!rr.is(i))return Re.warn("Invalid cell document URI",i),null;await this.sync();let{lens:o}=this.snapshotter.getLatestSnapshot(),s=rr.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 C;let i=n.textDocument.uri;if(!rr.is(i))return Re.warn("Invalid cell document URI",i),null;let o=rr.parse(i);await this.sync();let{lens:s}=this.snapshotter.getLatestSnapshot(),c=s.transformPosition(n.position,o),d=await this.client.textDocumentRename({...n,textDocument:{uri:this.documentUri},position:c});if(!d)return null;let f=(C=d.documentChanges)==null?void 0:C.flatMap(E=>"edits"in E?E.edits:[]);if(!f||f.length!==1)return Re.warn("Expected exactly one edit",f),d;let p=f[0];if(!("newText"in p))return Re.warn("Expected newText in edit",p),d;let y=s.getEditsForNewText(p.newText),w=new Map(y.map(E=>[E.cellId,E.text])),_=this.getNotebookEditors();for(let[E,T]of ci.entries(_)){let L=w.get(E);if(L==null){Re.warn("No new code for cell",E);continue}if(!T){Re.warn("No view for plugin",E);continue}Jr(T)!==L&&So(T,L)}return{...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(!rr.is(i))return Re.warn("Invalid cell document URI",i),null;await this.sync();let{lens:o}=this.snapshotter.getLatestSnapshot(),s=rr.parse(i);return this.client.textDocumentPrepareRename({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentHover(n){Re.debug("[lsp] textDocumentHover",n),await this.sync();let{lens:i}=this.snapshotter.getLatestSnapshot(),o=rr.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)):(Re.debug("[lsp] no hover result"),s)}async textDocumentCompletion(n){let{lens:i}=this.snapshotter.getLatestSnapshot(),o=rr.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"){Re.debug("[lsp] handling diagnostics",o);let s=this.snapshotter.getLatestSnapshot(),c=o.params.diagnostics,{lens:d,version:f}=s,p=new Map;for(let w of c)for(let _ of d.cellIds)if(d.isInRange(w.range,_)){p.has(_)||p.set(_,[]);let C={...w,range:d.reverseRange(w.range,_)};p.get(_).push(C);break}let y=new Set(Zi.SEEN_CELL_DOCUMENT_URIS);for(let[w,_]of p.entries()){Re.debug("[lsp] diagnostics for cell",w,_);let C=rr.of(w);y.delete(C),n({...o,params:{...o.params,uri:C,version:f,diagnostics:_}})}if(y.size>0){Re.debug("[lsp] clearing diagnostics",y);for(let w of y)n({method:"textDocument/publishDiagnostics",params:{uri:w,diagnostics:[]}})}return}return n(o)};this.client.processNotification=i}},ke(Zi,"SEEN_CELL_DOCUMENT_URIS",new Set),Zi),YC=Ql(),ZC=Ra(),eE=class extends ZC.Transport{constructor(n){super();ke(this,"isClosed",!1);ke(this,"hasConnectedBefore",!1);this.options=n,this.delegate=void 0}createDelegate(){if(this.delegate)try{this.delegate.close()}catch(n){Re.warn("Error closing old WebSocket delegate",n)}return this.delegate=new YC.WebSocketTransport(this.options.getWsUrl()),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(),Re.log("WebSocket transport connected successfully");let i=this.hasConnectedBefore;this.hasConnectedBefore=!0,i&&this.options.onReconnect&&(Re.log("Calling onReconnect callback to re-synchronize state"),await this.options.onReconnect())}catch(n){throw Re.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}async sendData(n,i){var o;if(this.isDelegateClosedOrClosing()){Re.warn("WebSocket is closed or closing, attempting to reconnect");try{await this.connect()}catch(s){throw Re.error("Failed to reconnect WebSocket",s),s}}return(o=this.delegate)==null?void 0:o.sendData(n,i)}};function af(e,n){let i=m4();return new eE({getWsUrl:()=>i.getLSPURL(e).toString(),waitForConnection:async()=>{await h4()},onReconnect:n})}Fi.define(),new Mu;function tE(e){return e.facet(b4.readOnly)}function nE(e){return[nw(e),Ta.of([{key:"ArrowRight",preventDefault:!0,run:n=>zy(n,e)},{key:"Tab",preventDefault:!0,run:n=>zy(n,e)}])]}function zy(e,n){if(tE(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 rE(e){let{beforeText:n,linkText:i,afterText:o,onClick:s}=e;return[nw(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}),Ut.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 iE=ui(e=>{let n,i={transport:af("pylsp",async()=>{await(n==null?void 0:n())}),rootUri:nf(),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 rf(new ql({...i}),f);return n=()=>p.resyncAllDocuments(),p}),aE=ui(e=>{let n,i=new rf(new ql({transport:af("ty",async()=>{await(n==null?void 0:n())}),rootUri:nf(),workspaceFolders:[],getWorkspaceConfiguration:o=>[{disableLanguageServices:!0}]}),{});return n=()=>i.resyncAllDocuments(),i}),oE=ui(e=>{let n,i=new rf(new ql({transport:af("basedpyright",async()=>{await(n==null?void 0:n())}),rootUri:nf(),workspaceFolders:[]}),{});return n=()=>i.resyncAllDocuments(),i}),sE=class{constructor(){ke(this,"parser",new hS);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&&Ns("pylsp")&&f.push(iE(s)),(_=s==null?void 0:s.ty)!=null&&_.enabled&&Ns("ty")&&f.push(aE(s)),(C=s==null?void 0:s.basedpyright)!=null&&C.enabled&&Ns("basedpyright")&&f.push(oE(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 BC(f);return[Pm({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:L=>{Re.debug("onGoToDefinition",L),T.documentUri!==L.uri&&Hi().openFile({path:L.uri.replace("file://","")})}}),mg.of(rr.of(e))]}return Nu({...c,override:[Dy]})})(),Mm(),lE(o)]}};function lE(e){return e==="marimo-import"?Lu.highest(nE("import marimo as mo")):e==="ai"?rE({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:n=>{n.state.facet(Dt).aiCellCompletion()}}):[]}var of=Dh.configure({props:[_4.add({ParenthesizedExpression:sw,ArgList:sw})]});Mm=function(){return new dw(of,[of.data.of({autocomplete:ED}),of.data.of({autocomplete:TD})])};const cE=e=>{let n;return async()=>(n||(n=e()),await n)};var dc=class{constructor(e={}){ke(this,"opts");ke(this,"parser",null);ke(this,"offsetRecord",{});ke(this,"getParser",cE(async()=>{if(this.parser)return this.parser;let e=await ce(()=>import("./node-sql-parser-DFzvtOsy.js").then(async i=>(await i.__tla,i)).then(WR(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}=fE(e);return this.offsetRecord=o,i}return e}async parseWithDuckDBSupport(e,n){let i=await this.getParser(),o=uE(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 uE(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 dE=2;function fE(e){let n={};return{sql:e.replace(/("(?:[^"\\]|\\.)*")|('(?:[^'\\]|\\.)*')|(\{[^}]*\})/g,(i,o,s,c,d)=>o||s?i:c?(n[d]=dE,`'${c}'`):i),offsetRecord:n}}var pE=750;function hE(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 mE(e={}){let n=e.parser||new dc;return K4(async i=>{let o=i.state.doc,s=o.toString();return s.trim()?(await n.validateSql(s,{state:i.state})).map(c=>hE(c,o)):[]},{delay:e.delay||pE})}function Ha(e){return typeof e=="object"&&!Array.isArray(e)&&!("self"in e)}function pi(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)||pi(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)||pi(c)&&jr(c.children)),s<=1?"database":"schema");switch(s){case 0:return"database";case 1:return"schema";default:return"namespace"}}function Fy(e,n,i={}){let{maxDepth:o=10}=i;if(n===""&&pi(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:sf(e,s,[],i)}function sf(e,n,i,o,s){if(n.length===0){if(pi(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 sf(y,d,[...i,p],o,e)}}else{if(pi(e))return sf(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 gE(e,n,i={}){let o=[];if(n.includes(".")){let s=n.lastIndexOf("."),c=n.substring(0,s),d=n.substring(s+1),f=Fy(e,c,i);if(f!=null&&f.namespace)return lf(f.namespace,d,f.path,i)}else return lf(e,n,[],i);return o}function lf(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(pi(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(pi(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(...lf(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 yE(e,n,i={}){let o=[],{maxDepth:s=10}=i;fc(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 fc(e,n,i,o){if(!(n.length>=o)){if(Ha(e))for(let[s,c]of Object.entries(e)){let d=[...n,s];if(pi(c)){let f=qn(d,"completion",c.children,e);i.push({completion:c.self,path:d,type:"completion",semanticType:f,namespace:c.children}),fc(c.children,d,i,o)}else{let f=qn(d,"namespace",c,e);i.push({path:d,type:"namespace",semanticType:f,namespace:c}),fc(c,d,i,o)}}else if(pi(e)){let s=qn(n,"completion",e.children);i.push({completion:e.self,path:n,type:"completion",semanticType:s,namespace:e.children}),fc(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 By(e,n,i={}){let{enableFuzzySearch:o=!1}=i,s=Fy(e,n,i);if(s)return s;let c=gE(e,n,i);if(c.length>0)return c[0]||null;if(o){let d=yE(e,n,i);if(d.length>0)return d[0]||null}return null}function Hy(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=Hy(s,n);Object.keys(c).length>0&&(i[o]=c)}return i}return e}function vE(e={}){let{schema:n={},keywords:i={},hoverTime:o=300,enableKeywords:s=!0,enableTables:c=!0,enableColumns:d=!0,enableFuzzySearch:f=!0,parser:p=new dc,tooltipRender:y,tooltipRenderers:w={}}=e,_=null;return _h(async(C,E,T)=>{let{from:L,to:z,text:U}=C.state.doc.lineAt(E),$=E,I=E;_===null&&(_=typeof i=="function"?i(C):Promise.resolve(i));let G=await _;for(;$>L&&/[\w.]/.test(U[$-L-1]??"");)$--;for(;I<z&&/[\w.]/.test(U[I-L]??"");)I++;if($===E&&T<0||I===E&&T>0)return null;let pe=U.slice($-L,I-L).toLowerCase();if(!pe||pe.length===0)return null;let P=typeof n=="function"?n(C):n,A=null;if(`${pe}`,!A&&s&&G[pe]&&(G[pe],A={word:pe,view:C,pos:E,tooltipType:"keyword",keywordData:{keyword:pe,info:G[pe]}}),!A&&(c||d)&&P){let V=C.state.doc.toString(),de=await p.extractTableReferences(V),fe=new Set(de.map(we=>we.toLowerCase())),be=Hy(P,fe),J=By(be,pe,{enableFuzzySearch:f});!J&&fe.size===0&&(J=By(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?be:P}})}return A?{pos:$,end:I,above:!0,create(V){if(y){let be=y(pe,V,E);if(be)return{dom:be}}let de=null;if(A.tooltipType==="keyword"&&A.keywordData)de=w.keyword?w.keyword(A.keywordData):$y(A.keywordData);else if(A.tooltipType==="namespace"&&A.namespaceData){let be=A.namespaceData,{semanticType:J}=be.item;de=J==="table"&&w.table?w.table(be):J==="column"&&w.column?w.column(be):(J==="database"||J==="schema"||J==="namespace")&&w.namespace?w.namespace(be):Vy(be.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 Vy(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 _=pc(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 _=pc(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 _=pc(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 pc(e){return Array.isArray(e)?e.length:typeof e=="object"&&e?"self"in e&&"children"in e?1+pc(e.children):Object.keys(e).length:0}function $y(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 bE(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 wE(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 _E={keyword:$y,table:bE,column:wE,namespace:Vy},Wy=(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 Ut.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 xE=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)=>uc(d,s(f)),reversePosition:(d,f)=>uc(d,-s(f))}}function zy(e,n){return{start:uc(e.start,n),end:uc(e.end,n)}}function uc(e,n){return{line:e.line+n,character:e.character}}const rr={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 Fy(e){return"notify"in e}var XC=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 JC(e,n)}},YC=()=>{let e=od().cellHandles;return ci.mapValues(e,n=>{var i;return(i=n.current)==null?void 0:i.editorViewOrNull})},rf=(Zi=class{constructor(n,i,o=YC){ke(this,"completionItemCache",new Ps(10));this.documentUri=qy(),this.getNotebookEditors=o,this.initialSettings=i,this.client=n,this.patchProcessNotification(),this.initializePromise.then(()=>{In(Fy(this.client),"notify is not a method on the client"),this.client.notify("workspace/didChangeConfiguration",{settings:i})}),this.snapshotter=new XC(this.getNotebookCode.bind(this))}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(Fy(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}}),Re.log("[lsp] Document re-synchronization complete")}getNotebookCode(){return st.get(QC)}assertCellDocumentUri(n){In(rr.is(n),"Execpted URI to be CellDocumentUri")}async textDocumentDidOpen(n){Re.debug("[lsp] textDocumentDidOpen",n);let i=n.textDocument.uri;this.assertCellDocumentUri(i);let{lens:o,version:s}=this.snapshotter.snapshot();Zi.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();return o?this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:i},contentChanges:[{text:n.mergedText}]}):{textDocument:{uri:this.documentUri,version:i},contentChanges:[{text:n.mergedText}]}}async textDocumentDidChange(n){return Re.debug("[lsp] textDocumentDidChange",n),n.contentChanges.length===1?this.sync():(Re.warn("[lsp] Unhandled textDocumentDidChange",n),this.client.textDocumentDidChange(n))}async textDocumentDefinition(n){let i=n.textDocument.uri;if(!rr.is(i))return Re.warn("Invalid cell document URI",i),null;await this.sync();let{lens:o}=this.snapshotter.getLatestSnapshot(),s=rr.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(!rr.is(i))return Re.warn("Invalid cell document URI",i),null;await this.sync();let{lens:o}=this.snapshotter.getLatestSnapshot(),s=rr.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 C;let i=n.textDocument.uri;if(!rr.is(i))return Re.warn("Invalid cell document URI",i),null;let o=rr.parse(i);await this.sync();let{lens:s}=this.snapshotter.getLatestSnapshot(),c=s.transformPosition(n.position,o),d=await this.client.textDocumentRename({...n,textDocument:{uri:this.documentUri},position:c});if(!d)return null;let f=(C=d.documentChanges)==null?void 0:C.flatMap(E=>"edits"in E?E.edits:[]);if(!f||f.length!==1)return Re.warn("Expected exactly one edit",f),d;let p=f[0];if(!("newText"in p))return Re.warn("Expected newText in edit",p),d;let y=s.getEditsForNewText(p.newText),w=new Map(y.map(E=>[E.cellId,E.text])),_=this.getNotebookEditors();for(let[E,T]of ci.entries(_)){let L=w.get(E);if(L==null){Re.warn("No new code for cell",E);continue}if(!T){Re.warn("No view for plugin",E);continue}Jr(T)!==L&&So(T,L)}return{...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(!rr.is(i))return Re.warn("Invalid cell document URI",i),null;await this.sync();let{lens:o}=this.snapshotter.getLatestSnapshot(),s=rr.parse(i);return this.client.textDocumentPrepareRename({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentHover(n){Re.debug("[lsp] textDocumentHover",n),await this.sync();let{lens:i}=this.snapshotter.getLatestSnapshot(),o=rr.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)):(Re.debug("[lsp] no hover result"),s)}async textDocumentCompletion(n){let{lens:i}=this.snapshotter.getLatestSnapshot(),o=rr.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"){Re.debug("[lsp] handling diagnostics",o);let s=this.snapshotter.getLatestSnapshot(),c=o.params.diagnostics,{lens:d,version:f}=s,p=new Map;for(let w of c)for(let _ of d.cellIds)if(d.isInRange(w.range,_)){p.has(_)||p.set(_,[]);let C={...w,range:d.reverseRange(w.range,_)};p.get(_).push(C);break}let y=new Set(Zi.SEEN_CELL_DOCUMENT_URIS);for(let[w,_]of p.entries()){Re.debug("[lsp] diagnostics for cell",w,_);let C=rr.of(w);y.delete(C),n({...o,params:{...o.params,uri:C,version:f,diagnostics:_}})}if(y.size>0){Re.debug("[lsp] clearing diagnostics",y);for(let w of y)n({method:"textDocument/publishDiagnostics",params:{uri:w,diagnostics:[]}})}return}return n(o)};this.client.processNotification=i}},ke(Zi,"SEEN_CELL_DOCUMENT_URIS",new Set),Zi),ZC=Ql(),eE=Ra(),tE=class extends eE.Transport{constructor(n){super();ke(this,"isClosed",!1);ke(this,"hasConnectedBefore",!1);this.options=n,this.delegate=void 0}createDelegate(){if(this.delegate)try{this.delegate.close()}catch(n){Re.warn("Error closing old WebSocket delegate",n)}return this.delegate=new ZC.WebSocketTransport(this.options.getWsUrl()),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(),Re.log("WebSocket transport connected successfully");let i=this.hasConnectedBefore;this.hasConnectedBefore=!0,i&&this.options.onReconnect&&(Re.log("Calling onReconnect callback to re-synchronize state"),await this.options.onReconnect())}catch(n){throw Re.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}async sendData(n,i){var o;if(this.isDelegateClosedOrClosing()){Re.warn("WebSocket is closed or closing, attempting to reconnect");try{await this.connect()}catch(s){throw Re.error("Failed to reconnect WebSocket",s),s}}return(o=this.delegate)==null?void 0:o.sendData(n,i)}};function af(e,n){let i=g4();return new tE({getWsUrl:()=>i.getLSPURL(e).toString(),waitForConnection:async()=>{await m4()},onReconnect:n})}Fi.define(),new Mu;function nE(e){return e.facet(w4.readOnly)}function rE(e){return[iw(e),Ta.of([{key:"ArrowRight",preventDefault:!0,run:n=>By(n,e)},{key:"Tab",preventDefault:!0,run:n=>By(n,e)}])]}function By(e,n){if(nE(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 iE(e){let{beforeText:n,linkText:i,afterText:o,onClick:s}=e;return[iw(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}),Ut.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 aE=ui(e=>{let n,i={transport:af("pylsp",async()=>{await(n==null?void 0:n())}),rootUri:nf(),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 rf(new ql({...i}),f);return n=()=>p.resyncAllDocuments(),p}),oE=ui(e=>{let n,i=new rf(new ql({transport:af("ty",async()=>{await(n==null?void 0:n())}),rootUri:nf(),workspaceFolders:[],getWorkspaceConfiguration:o=>[{disableLanguageServices:!0}]}),{});return n=()=>i.resyncAllDocuments(),i}),sE=ui(e=>{let n,i=new rf(new ql({transport:af("basedpyright",async()=>{await(n==null?void 0:n())}),rootUri:nf(),workspaceFolders:[]}),{});return n=()=>i.resyncAllDocuments(),i}),lE=class{constructor(){ke(this,"parser",new mS);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&&Ns("pylsp")&&f.push(aE(s)),(_=s==null?void 0:s.ty)!=null&&_.enabled&&Ns("ty")&&f.push(oE(s)),(C=s==null?void 0:s.basedpyright)!=null&&C.enabled&&Ns("basedpyright")&&f.push(sE(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 HC(f);return[Mm({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:L=>{Re.debug("onGoToDefinition",L),T.documentUri!==L.uri&&Hi().openFile({path:L.uri.replace("file://","")})}}),gg.of(rr.of(e))]}return Nu({...c,override:[Py]})})(),Lm(),cE(o)]}};function cE(e){return e==="marimo-import"?Lu.highest(rE("import marimo as mo")):e==="ai"?iE({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:n=>{n.state.facet(Dt).aiCellCompletion()}}):[]}var of=Dh.configure({props:[x4.add({ParenthesizedExpression:cw,ArgList:cw})]});Lm=function(){return new pw(of,[of.data.of({autocomplete:TD}),of.data.of({autocomplete:RD})])};const uE=e=>{let n;return async()=>(n||(n=e()),await n)};var dc=class{constructor(e={}){ke(this,"opts");ke(this,"parser",null);ke(this,"offsetRecord",{});ke(this,"getParser",uE(async()=>{if(this.parser)return this.parser;let e=await ce(()=>import("./node-sql-parser-DFzvtOsy.js").then(async i=>(await i.__tla,i)).then(UR(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}=pE(e);return this.offsetRecord=o,i}return e}async parseWithDuckDBSupport(e,n){let i=await this.getParser(),o=dE(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 dE(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 fE=2;function pE(e){let n={};return{sql:e.replace(/("(?:[^"\\]|\\.)*")|('(?:[^'\\]|\\.)*')|(\{[^}]*\})/g,(i,o,s,c,d)=>o||s?i:c?(n[d]=fE,`'${c}'`):i),offsetRecord:n}}var hE=750;function mE(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 gE(e={}){let n=e.parser||new dc;return Q4(async i=>{let o=i.state.doc,s=o.toString();return s.trim()?(await n.validateSql(s,{state:i.state})).map(c=>mE(c,o)):[]},{delay:e.delay||hE})}function Ha(e){return typeof e=="object"&&!Array.isArray(e)&&!("self"in e)}function pi(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)||pi(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)||pi(c)&&jr(c.children)),s<=1?"database":"schema");switch(s){case 0:return"database";case 1:return"schema";default:return"namespace"}}function Hy(e,n,i={}){let{maxDepth:o=10}=i;if(n===""&&pi(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:sf(e,s,[],i)}function sf(e,n,i,o,s){if(n.length===0){if(pi(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 sf(y,d,[...i,p],o,e)}}else{if(pi(e))return sf(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 yE(e,n,i={}){let o=[];if(n.includes(".")){let s=n.lastIndexOf("."),c=n.substring(0,s),d=n.substring(s+1),f=Hy(e,c,i);if(f!=null&&f.namespace)return lf(f.namespace,d,f.path,i)}else return lf(e,n,[],i);return o}function lf(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(pi(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(pi(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(...lf(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 vE(e,n,i={}){let o=[],{maxDepth:s=10}=i;fc(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 fc(e,n,i,o){if(!(n.length>=o)){if(Ha(e))for(let[s,c]of Object.entries(e)){let d=[...n,s];if(pi(c)){let f=qn(d,"completion",c.children,e);i.push({completion:c.self,path:d,type:"completion",semanticType:f,namespace:c.children}),fc(c.children,d,i,o)}else{let f=qn(d,"namespace",c,e);i.push({path:d,type:"namespace",semanticType:f,namespace:c}),fc(c,d,i,o)}}else if(pi(e)){let s=qn(n,"completion",e.children);i.push({completion:e.self,path:n,type:"completion",semanticType:s,namespace:e.children}),fc(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 Vy(e,n,i={}){let{enableFuzzySearch:o=!1}=i,s=Hy(e,n,i);if(s)return s;let c=yE(e,n,i);if(c.length>0)return c[0]||null;if(o){let d=vE(e,n,i);if(d.length>0)return d[0]||null}return null}function $y(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=$y(s,n);Object.keys(c).length>0&&(i[o]=c)}return i}return e}function bE(e={}){let{schema:n={},keywords:i={},hoverTime:o=300,enableKeywords:s=!0,enableTables:c=!0,enableColumns:d=!0,enableFuzzySearch:f=!0,parser:p=new dc,tooltipRender:y,tooltipRenderers:w={}}=e,_=null;return _h(async(C,E,T)=>{let{from:L,to:z,text:U}=C.state.doc.lineAt(E),$=E,I=E;_===null&&(_=typeof i=="function"?i(C):Promise.resolve(i));let G=await _;for(;$>L&&/[\w.]/.test(U[$-L-1]??"");)$--;for(;I<z&&/[\w.]/.test(U[I-L]??"");)I++;if($===E&&T<0||I===E&&T>0)return null;let pe=U.slice($-L,I-L).toLowerCase();if(!pe||pe.length===0)return null;let P=typeof n=="function"?n(C):n,A=null;if(`${pe}`,!A&&s&&G[pe]&&(G[pe],A={word:pe,view:C,pos:E,tooltipType:"keyword",keywordData:{keyword:pe,info:G[pe]}}),!A&&(c||d)&&P){let V=C.state.doc.toString(),de=await p.extractTableReferences(V),fe=new Set(de.map(we=>we.toLowerCase())),be=$y(P,fe),J=Vy(be,pe,{enableFuzzySearch:f});!J&&fe.size===0&&(J=Vy(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?be:P}})}return A?{pos:$,end:I,above:!0,create(V){if(y){let be=y(pe,V,E);if(be)return{dom:be}}let de=null;if(A.tooltipType==="keyword"&&A.keywordData)de=w.keyword?w.keyword(A.keywordData):Uy(A.keywordData);else if(A.tooltipType==="namespace"&&A.namespaceData){let be=A.namespaceData,{semanticType:J}=be.item;de=J==="table"&&w.table?w.table(be):J==="column"&&w.column?w.column(be):(J==="database"||J==="schema"||J==="namespace")&&w.namespace?w.namespace(be):Wy(be.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 Wy(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 _=pc(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 _=pc(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 _=pc(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 pc(e){return Array.isArray(e)?e.length:typeof e=="object"&&e?"self"in e&&"children"in e?1+pc(e.children):Object.keys(e).length:0}function Uy(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 wE(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 _E(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 xE={keyword:Uy,table:wE,column:_E,namespace:Wy},Ky=(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 Ut.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 kE=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
- `||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()}},Uy=Fi.define(),Ky=xs.define({create(){return{currentStatement:null,allStatements:[],cursorPosition:0,isFocused:!0}},update(e,n){for(let i of n.effects)if(i.is(Uy))return i.value;return e}}),kE=class extends P4{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=`
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()}},Qy=Fi.define(),Gy=xs.define({create(){return{currentStatement:null,allStatements:[],cursorPosition:0,isFocused:!0}},update(e,n){for(let i of n.effects)if(i.is(Qy))return i.value;return e}}),SE=class extends M4{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};
140
140
  height: 100%;
141
141
  width: 100%;
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 SE(e,n){var f;let i=E4.empty;if((f=n.whenHide)!=null&&f.call(n,e))return i;let o=e.state.field(Ky,!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 kE(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 CE(e){return Ut.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:Uy.of(d)})})}function EE(e){let n=e.width||3;return Ut.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 TE(e){return T4({class:`cm-sql-gutter ${e.className||""}`,markers:n=>SE(n,e)})}function RE(e={}){return[Ky,CE(new xE(e.parser||new dc)),EE(e),TE(e)]}function DE(e={}){let n=[],{enableLinting:i=!0,enableGutterMarkers:o=!0,enableHover:s=!0,linterConfig:c,gutterConfig:d,hoverConfig:f}=e;return i&&n.push(mE(c)),o&&n.push(RE(d)),s&&(n.push(vE(f)),f!=null&&f.theme?n.push(f.theme):n.push(Wy())),n}var OE=class mx{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??mx.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)}};ix=new Iu("sql-table-preview",async(e,n)=>{await Hi().previewSQLTable({requestId:e,...n})}),Xw=new Iu("sql-table-list-preview",async(e,n)=>{await Hi().previewSQLTableList({requestId:e,...n})}),Lh=new OE(new Iu("validate-sql",async(e,n)=>{await Hi().validateSQL({requestId:e,...n})}),{maxSize:3});var PE=Gr();let Va;Va=Be(new Map),p_=e=>{let n=(0,PE.c)(3),i=Yn(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 Qy(e){let n=ct.get(Va),i=new Map(n);i.delete(e),ct.set(Va,i)}function ME(){ct.set(Va,new Map)}function LE({cellId:e,errorMessage:n,dialect:i}){let o=ct.get(Va),s=new Map(o),c=i==="DuckDB"?NE(n):Gy(n);s.set(e,c),ct.set(Va,s)}function NE(e){let{errorType:n,errorMessage:i}=Gy(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 Gy(e){return{errorType:e.split(":")[0].trim(),errorMessage:e.split(":").slice(1).join(":").trim()}}function Jy(e){return e.field(di)}function IE(){return e=>{let n=Jy(e.state).engine,i=Fa.getCompletionSource(n);return i&&aD(i)(e)||null}}function AE(){return e=>{let n=Jy(e.state).engine,i=Fa.getDialect(n);return e.matchBefore(/\.\w*/)?null:dD(i,!0,(o,s)=>({label:o,type:s,info:async()=>{let c=(await qE())[o.toLocaleLowerCase()];if(!c)return null;let d=document.createElement("div");return d.innerHTML=_E.keyword({keyword:o,info:c}),d}}))(e)}}var qE=ui(async()=>{let e=await ce(()=>import("./common-keywords-0dB1lgek.js").then(async i=>(await i.__tla,i)),[],import.meta.url),n=await ce(()=>import("./duckdb-keywords-DH8yhwVC.js").then(async i=>(await i.__tla,i)),[],import.meta.url);return{...e.default.keywords,...n.default.keywords}}),jE=Gr(),Xy=Fl("marimo:notebook-sql-mode","default",Kl);function zE(){let e=(0,jE.c)(3),[n,i]=K2(Xy),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 Yy(){return ct.get(Xy)}var FE=xg,BE="DuckDB",Zy=new Mu;function cf(){return ct.get(_o).latestEngineSelected}let ev;fd=(wf=class{constructor(){ke(this,"parser",new Yg);ke(this,"type","sql");this.sqlModeEnabled=!0}get defaultMetadata(){return{...this.parser.defaultMetadata,engine:cf()||"__marimo_duckdb"}}get defaultCode(){let e=cf();return e&&e!=="__marimo_duckdb"?`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`:this.parser.defaultCode}transformIn(e){this.parser.defaultMetadata.engine=cf()||"__marimo_duckdb";let n=this.parser.transformIn(e),i=n.metadata;return i.engine&&i.engine!=="__marimo_duckdb"&&Cg(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=[Zy.of(ww({dialect:FE})),Ta.of([{key:"Tab",run:f=>eD(f)||q4(f),preventDefault:!0}]),Nu({defaultKeymap:!1,activateOnTyping:!0,override:[IE(),jC,AE()]})];if(((d=s==null?void 0:s.diagnostics)==null?void 0:d.sql_linter)??!1){let f=ct.get(DD),p=new ev({getParserOptions:y=>({database:nv(y)??BE})});c.push(DE({enableLinting:!0,linterConfig:{delay:250,parser:p},enableGutterMarkers:!0,gutterConfig:{backgroundColor:"#3b82f6",errorBackgroundColor:"#ef4444",hideWhenNotFocused:!0,parser:p},hoverConfig:{schema:$E,hoverTime:300,enableKeywords:!0,enableTables:!0,enableColumns:!0,parser:p,theme:Wy(f)}}),Ut.updateListener.of(y=>{y.focusChanged&&p.setFocusState(y.view.hasFocus)}))}return this.sqlModeEnabled&&c.push(UE()),c}},ke(wf,"fromQuery",e=>Yg.fromQuery(e)),wf),ev=class extends dc{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 iv(n,i,o,Yy());if(d.error){Re.error("Failed to validate SQL",{error:d.error}),s([]);return}s(((c=d.parse_result)==null?void 0:c.errors)??[])}catch(d){Re.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=nv(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 tv(e,n){e.dispatch({effects:Zy.reconfigure(ww({dialect:n}))})}function HE(e,n){tv(e,Fa.getDialect(n))}function VE(e){let n=Fo(e.state).engine;tv(e,Fa.getDialect(n))}function Fo(e){return e.field(di)}function $E(e){let n=Fo(e.state).engine,i=Fa.getCompletionSource(n);return i!=null&&i.schema?i.schema:{}}function nv(e){let n=Fo(e).engine;return rv(n)}function rv(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 Re.debug("Unsupported dialect",{dialect:n}),null;default:return _s(n),null}}var WE=300;function UE(){let e,n=null;return Ut.updateListener.of(i=>{if(!i.docChanged)return;let o=Yy();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(La);if(c===""){Qy(d);return}try{let f=rv(s),p=(await iv(c,s,f,o)).validate_result;p!=null&&p.error_message?LE({cellId:d,errorMessage:p.error_message,dialect:f}):Qy(d)}catch(f){Re.error("Failed to validate SQL",{error:f})}},WE)})}async function iv(e,n,i,o){let s=await Lh.request({onlyParse:o==="default",engine:n,dialect:i,query:e});if(s.error)throw Error(s.error);return s}var KE=ui(()=>new sE),QE=ui(()=>new Fu),GE=ui(()=>new fd);yr={get python(){return KE()},get markdown(){return QE()},get sql(){return GE()}};function JE(){return Object.values(yr)}var At=yh(Du(),1),hc="Checkbox",[XE,jD]=OD(hc),[YE,uf]=XE(hc);function ZE(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]=PD({prop:i,defaultProp:s??!1,onChange:p,caller:hc}),[T,L]=At.useState(null),[z,U]=At.useState(null),$=At.useRef(!1),I=T?!!d||!!T.closest("form"):!0,G={checked:C,disabled:c,setChecked:E,control:T,setControl:L,name:f,form:d,value:w,hasConsumerStoppedPropagationRef:$,required:y,defaultChecked:Yi(s)?!1:s,isFormControl:I,bubbleInput:z,setBubbleInput:U};return(0,B.jsx)(YE,{scope:n,...G,children:e3(_)?_(G):o})}var av="CheckboxTrigger",ov=At.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}=uf(av,e),L=ew(s,w),z=At.useRef(p);return At.useEffect(()=>{let U=c==null?void 0:c.form;if(U){let $=()=>_(z.current);return U.addEventListener("reset",$),()=>U.removeEventListener("reset",$)}},[c,_]),(0,B.jsx)(Oh.button,{type:"button",role:"checkbox","aria-checked":Yi(p)?"mixed":p,"aria-required":y,"data-state":dv(p),"data-disabled":f?"":void 0,disabled:f,value:d,...o,ref:L,onKeyDown:Sw(n,U=>{U.key==="Enter"&&U.preventDefault()}),onClick:Sw(i,U=>{_($=>Yi($)?!0:!$),T&&E&&(C.current=U.isPropagationStopped(),C.current||U.stopPropagation())})})});ov.displayName=av;var df=At.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)(ZE,{__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)(ov,{..._,ref:n,__scopeCheckbox:i}),C&&(0,B.jsx)(uv,{__scopeCheckbox:i})]})})});df.displayName=hc;var sv="CheckboxIndicator",lv=At.forwardRef((e,n)=>{let{__scopeCheckbox:i,forceMount:o,...s}=e,c=uf(sv,i);return(0,B.jsx)(MD,{present:o||Yi(c.checked)||c.checked===!0,children:(0,B.jsx)(Oh.span,{"data-state":dv(c.checked),"data-disabled":c.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})});lv.displayName=sv;var cv="CheckboxBubbleInput",uv=At.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}=uf(cv,e),T=ew(i,E),L=mD(c),z=LD(o);At.useEffect(()=>{let $=C;if(!$)return;let I=window.HTMLInputElement.prototype,G=Object.getOwnPropertyDescriptor(I,"checked").set,pe=!s.current;if(L!==c&&G){let P=new Event("click",{bubbles:pe});$.indeterminate=Yi(c),G.call($,Yi(c)?!1:c),$.dispatchEvent(P)}},[C,L,c,s]);let U=At.useRef(Yi(c)?!1:c);return(0,B.jsx)(Oh.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??U.current,required:f,disabled:p,name:y,value:w,form:_,...n,tabIndex:-1,ref:T,style:{...n.style,...z,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});uv.displayName=cv;function e3(e){return typeof e=="function"}function Yi(e){return e==="indeterminate"}function dv(e){return Yi(e)?"indeterminate":e?"checked":"unchecked"}let fv;fv=Gr(),Wl=At.forwardRef((e,n)=>{let i=(0,fv.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=Ou("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)(lv,{className:Ou("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),children:(0,B.jsx)(fD,{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)(df,{ref:n,className:c,...s,children:d}),i[6]=s,i[7]=n,i[8]=c,i[9]=f):f=i[9],f}),Wl.displayName=df.displayName,x_="_";var t3=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("."));hm=function(e,n=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,"_"),n?e.toLowerCase():e):"_"},A_=function(e,n){let i=new Set(n),o=e,s=d=>!i.has(d)&&!t3.has(d);if(s(e))return e;let c=1;for(;!s(o);)o=`${e}_${c}`,c++;return o},$_=function(e,n){return gm(e)?`cell-${n}`:e},gm=function(e){return e?e==="_"||e==="__":!0};var n3=Gr();function r3(e){let n=(0,n3.c)(15),{minWidth:i,padding:o}=e,s=i===void 0?70:i,c=o===void 0?15:o,[d,f]=(0,At.useState)(50),p=(0,At.useRef)(null),y=(0,At.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 V=A.offsetWidth;f(V+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),o4(C);let E;n[4]===_?E=n[5]:(E=P=>{_(P.target.value)},n[4]=_,n[5]=E);let T=`${d}px`,L=`${s}px`,z;n[6]!==T||n[7]!==L?(z={width:T,minWidth:L},n[6]=T,n[7]=L,n[8]=z):z=n[8];let U;n[9]!==E||n[10]!==z?(U={ref:p,type:"text",onChange:E,style:z},n[9]=E,n[10]=z,n[11]=U):U=n[11];let $=U,I;n[12]===Symbol.for("react.memo_cache_sentinel")?(I={ref:y,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},n[12]=I):I=n[12];let G=I,pe;return n[13]===$?pe=n[14]:(pe={inputProps:$,spanProps:G},n[13]=$,n[14]=pe),pe}var i3=Gr();function a3({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}const o3=()=>{let e=(0,i3.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};var s3="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",l3="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",c3="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==",u3="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",d3="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",f3=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,p3="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",h3="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",pv=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,m3="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",g3="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",y3="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",v3="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",b3="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",w3="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",_3=""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,x3=Gr(),k3={sqlite:v3,duckdb:u3,motherduck:p3,postgres:pv,postgresql:pv,mysql:h3,snowflake:g3,databricks:l3,clickhouse:s3,timeplus:w3,bigquery:d3,trino:_3,iceberg:f3,datafusion:c3,pyspark:y3,redshift:m3,supabase:b3};pm=e=>{let n=(0,x3.c)(11),{name:i,className:o}=e,s=k3[i.toLowerCase()];if(!s){let f;n[0]===o?f=n[1]:(f=Ou("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=Ou("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 ff=Gr();const S3=e=>{let n=(0,ff.c)(27),{selectedEngine:i,onChange:o}=e,s=Yn(Gu),c=[],d=[];for(let[fe,be]of s.entries())ko.has(fe)?c.push(be):d.push(be);let f=nD(),p=i&&!s.has(i),y;n[0]!==s||n[1]!==o||n[2]!==f?(y=fe=>{if(fe===hv){window.open(mv,"_blank");return}let be=s.get(fe);be&&(f(),o(be.name),Cg(be.name))},n[0]=s,n[1]=o,n[2]=f,n[3]=y):y=n[3];let w=y,_=D3,C=bD,E;n[4]===Symbol.for("react.memo_cache_sentinel")?(E=(0,B.jsx)(E3,{children:(0,B.jsx)(hD,{placeholder:"Select an engine"})}),n[4]=E):E=n[4];let T=gD,L=yD,z;n[5]===Symbol.for("react.memo_cache_sentinel")?(z=(0,B.jsx)(pD,{children:"Database connections"}),n[5]=z):z=n[5];let U;n[6]!==p||n[7]!==i?(U=p&&(0,B.jsx)(Rh,{value:i,children:(0,B.jsxs)("div",{className:"flex items-center gap-1 opacity-50",children:[(0,B.jsx)(am,{className:"h-3 w-3"}),(0,B.jsx)("span",{className:"truncate",children:Og(i)})]})},i),n[6]=p,n[7]=i,n[8]=U):U=n[8];let $=_(d),I=d.length>0&&(0,B.jsx)(_w,{}),G=_(c),pe;n[9]===Symbol.for("react.memo_cache_sentinel")?(pe=(0,B.jsx)(_w,{}),n[9]=pe):pe=n[9];let P;n[10]===Symbol.for("react.memo_cache_sentinel")?(P=(0,B.jsx)(Rh,{className:"text-muted-foreground",value:hv,children:(0,B.jsxs)("a",{className:"flex items-center gap-1",href:mv,target:"_blank",rel:"noreferrer",children:[(0,B.jsx)(_D,{className:"h-3 w-3"}),(0,B.jsx)("span",{children:"How to add a database connection"})]})}),n[10]=P):P=n[10];let A;n[11]!==L||n[12]!==z||n[13]!==U||n[14]!==$||n[15]!==I||n[16]!==G?(A=(0,B.jsxs)(L,{children:[z,U,$,I,G,pe,P]}),n[11]=L,n[12]=z,n[13]=U,n[14]=$,n[15]=I,n[16]=G,n[17]=A):A=n[17];let V;n[18]!==T||n[19]!==A?(V=(0,B.jsx)(T,{children:A}),n[18]=T,n[19]=A,n[20]=V):V=n[20];let de;return n[21]!==C||n[22]!==w||n[23]!==i||n[24]!==V||n[25]!==E?(de=(0,B.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,B.jsxs)(C,{value:i,onValueChange:w,children:[E,V]})}),n[21]=C,n[22]=w,n[23]=i,n[24]=V,n[25]=E,n[26]=de):de=n[26],de};var hv="__help__",mv="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";const C3=()=>{let e=(0,ff.c)(16),{sqlMode:n,setSQLMode:i}=zE(),o;e[0]!==i||e[1]!==n?(o=()=>{let E=n==="validate"?"default":"validate";E==="default"&&ME(),i(E)},e[0]=i,e[1]=n,e[2]=o):o=e[2];let s=o,c=O3,d=P3,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)(tw,{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)(Ph,{delayDuration:300,content:f,children:_})}),e[13]=f,e[14]=_,e[15]=C):C=e[15],C};var E3=e=>{let n=(0,ff.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)(vD,{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 T3(e){return e.source!=="iceberg"}function R3(e){return(0,B.jsx)(Rh,{value:e.name,children:(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[(0,B.jsx)(pm,{className:"h-3 w-3",name:e.dialect}),(0,B.jsx)("span",{className:"truncate ml-0.5",children:Og(e.display_name)})]})},e.name)}function D3(e){return e=e.filter(T3),e.map(R3)}function O3(e){return e==="validate"?(0,B.jsx)(Hd,{className:"h-3 w-3"}):(0,B.jsx)(Bd,{className:"h-3 w-3"})}function P3(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 gv=Gr(),yv=()=>{let e=(0,gv.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 M3=e=>{let n=(0,gv.c)(99),{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}=r3(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]===Symbol.for("react.memo_cache_sentinel")?(p=(0,B.jsx)("div",{}),n[3]=p):p=n[3];let y=p,w=!1,_;n[4]===i?_=n[5]:(_=L=>{i.dispatch({effects:nd.of(L),changes:{from:0,to:i.state.doc.length,insert:i.state.doc.toString()}})},n[4]=i,n[5]=_);let C=_;if(f instanceof fd){let L;n[6]===i.state?L=n[7]:(L=i.state.field(di),n[6]=i.state,n[7]=L);let z=L;w=!0;let U;n[8]===C?U=n[9]:(U=Oe=>{let Ne=hm(Oe.currentTarget.value,!1);Oe.currentTarget.value=Ne,C({dataframeName:Ne})},n[8]=C,n[9]=U);let $=U,I;n[10]!==C||n[11]!==i?(I=Oe=>{C({engine:Oe}),HE(i,Oe)},n[10]=C,n[11]=i,n[12]=I):I=n[12];let G=I,pe;n[13]===Symbol.for("react.memo_cache_sentinel")?(pe=(0,B.jsx)("span",{className:"select-none",children:"Output variable: "}),n[13]=pe):pe=n[13];let P;n[14]===c?P=n[15]:(P=Oe=>{var Ne;(Ne=c.onChange)==null||Ne.call(c,Oe)},n[14]=c,n[15]=P);let A;n[16]===$?A=n[17]:(A=Oe=>{Oe.key==="Enter"&&Oe.shiftKey&&$(Oe)},n[16]=$,n[17]=A);let V;n[18]!==c||n[19]!==z.dataframeName||n[20]!==$||n[21]!==A||n[22]!==P?(V=(0,B.jsx)("input",{...c,defaultValue:z.dataframeName,onChange:P,onBlur:$,onKeyDown:A,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[18]=c,n[19]=z.dataframeName,n[20]=$,n[21]=A,n[22]=P,n[23]=V):V=n[23];let de;n[24]===s?de=n[25]:(de=(0,B.jsx)("span",{...s}),n[24]=s,n[25]=de);let fe;n[26]!==V||n[27]!==de?(fe=(0,B.jsxs)("label",{className:"flex gap-2 items-center",children:[pe,V,de]}),n[26]=V,n[27]=de,n[28]=fe):fe=n[28];let be;n[29]!==z.engine||n[30]!==G?(be=(0,B.jsx)(S3,{selectedEngine:z.engine,onChange:G}),n[29]=z.engine,n[30]=G,n[31]=be):be=n[31];let J;n[32]===z.engine?J=n[33]:(J=z.engine==="__marimo_duckdb"&&(0,B.jsx)(C3,{}),n[32]=z.engine,n[33]=J);let we;n[34]!==z.engine||n[35]!==i?(we=async()=>{await Hk(i,z.engine)},n[34]=z.engine,n[35]=i,n[36]=we):we=n[36];let Ee;n[37]===Symbol.for("react.memo_cache_sentinel")?(Ee=(0,B.jsx)(Uh,{className:"h-3 w-3"}),n[37]=Ee):Ee=n[37];let ne;n[38]===we?ne=n[39]:(ne=(0,B.jsx)(Ph,{content:"Format SQL",children:(0,B.jsx)(tw,{variant:"text",size:"icon",onClick:we,children:Ee})}),n[38]=we,n[39]=ne);let ie;n[40]===Symbol.for("react.memo_cache_sentinel")?(ie=(0,B.jsx)(yv,{}),n[40]=ie):ie=n[40];let se;n[41]===C?se=n[42]:(se=Oe=>{C({showOutput:!Oe.target.checked})},n[41]=C,n[42]=se);let K=!z.showOutput,Le;n[43]!==se||n[44]!==K?(Le=(0,B.jsx)("input",{type:"checkbox",onChange:se,checked:K}),n[43]=se,n[44]=K,n[45]=Le):Le=n[45];let $e;n[46]===Symbol.for("react.memo_cache_sentinel")?($e=(0,B.jsx)("span",{className:"select-none",children:"Hide output"}),n[46]=$e):$e=n[46];let st;n[47]===Le?st=n[48]:(st=(0,B.jsxs)("label",{className:"flex items-center gap-2",children:[Le,$e]}),n[47]=Le,n[48]=st);let je;n[49]!==J||n[50]!==ne||n[51]!==st?(je=(0,B.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[J,ne,ie,st]}),n[49]=J,n[50]=ne,n[51]=st,n[52]=je):je=n[52];let He;n[53]!==fe||n[54]!==be||n[55]!==je?(He=(0,B.jsxs)("div",{className:"flex flex-1 gap-2 items-center",children:[fe,be,je]}),n[53]=fe,n[54]=be,n[55]=je,n[56]=He):He=n[56],y=He}if(f instanceof Fu){w=!0;let L,z,U,$,I,G,pe,P,A,V;if(n[57]!==C||n[58]!==i.state){let{quotePrefix:se}=i.state.field(di);z=se,z===void 0&&(z="r",C({quotePrefix:z})),V=(K,Le)=>{typeof Le=="boolean"&&C({quotePrefix:a3({currentQuotePrefix:z,checked:Le,prefix:K})})},U="flex flex-row w-full justify-end gap-1.5 items-center",P="flex items-center gap-1.5",n[69]===Symbol.for("react.memo_cache_sentinel")?(A=(0,B.jsx)("span",{children:"r"}),n[69]=A):A=n[69],L=Wl,I="Toggle raw string",G="w-3 h-3",pe=z.includes("r"),$=K=>{V("r",K)},n[57]=C,n[58]=i.state,n[59]=L,n[60]=z,n[61]=U,n[62]=$,n[63]=I,n[64]=G,n[65]=pe,n[66]=P,n[67]=A,n[68]=V}else L=n[59],z=n[60],U=n[61],$=n[62],I=n[63],G=n[64],pe=n[65],P=n[66],A=n[67],V=n[68];let de;n[70]!==L||n[71]!==$||n[72]!==I||n[73]!==G||n[74]!==pe?(de=(0,B.jsx)(L,{"aria-label":I,className:G,checked:pe,onCheckedChange:$}),n[70]=L,n[71]=$,n[72]=I,n[73]=G,n[74]=pe,n[75]=de):de=n[75];let fe;n[76]!==de||n[77]!==P||n[78]!==A?(fe=(0,B.jsxs)("div",{className:P,children:[A,de]}),n[76]=de,n[77]=P,n[78]=A,n[79]=fe):fe=n[79];let be;n[80]===Symbol.for("react.memo_cache_sentinel")?(be=(0,B.jsx)("span",{children:"f"}),n[80]=be):be=n[80];let J;n[81]===z?J=n[82]:(J=z.includes("f"),n[81]=z,n[82]=J);let we;n[83]===V?we=n[84]:(we=se=>{V("f",se)},n[83]=V,n[84]=we);let Ee;n[85]!==J||n[86]!==we?(Ee=(0,B.jsxs)("div",{className:"flex items-center gap-1.5",children:[be,(0,B.jsx)(Wl,{"aria-label":"Toggle f-string",className:"w-3 h-3",checked:J,onCheckedChange:we})]}),n[85]=J,n[86]=we,n[87]=Ee):Ee=n[87];let ne;n[88]===Symbol.for("react.memo_cache_sentinel")?(ne=(0,B.jsx)(Ph,{content:(0,B.jsx)(o3,{}),children:(0,B.jsx)($u,{className:"w-3 h-3"})}),n[88]=ne):ne=n[88];let ie;n[89]!==U||n[90]!==fe||n[91]!==Ee?(ie=(0,B.jsxs)("div",{className:U,children:[fe,Ee,ne]}),n[89]=U,n[90]=fe,n[91]=Ee,n[92]=ie):ie=n[92],y=ie}let E;n[93]===w?E=n[94]:(E=w&&(0,B.jsx)(yv,{}),n[93]=w,n[94]=E);let T;return n[95]!==y||n[96]!==f.type||n[97]!==E?(T=(0,B.jsx)(ND,{children:(0,B.jsxs)("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[y,E,f.type]})}),n[95]=y,n[96]=f.type,n[97]=E,n[98]=T):T=n[98],T};var pf=new Mu;rd=Fi.define(),Lr=xs.define({create(){return yr.python},update(e,n){for(let i of n.effects)if(i.is(rd))return i.value;return e},provide:e=>wh.from(e,n=>n.type==="python"?null:i=>Wk(i,M3))});function L3(){let e=JE(),n=(i,o)=>{let s=e[o%e.length];return s.isSupported(i)?s:n(i,o+1)};return[Ta.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:(vv({view:i,nextLanguage:c,opts:{keepCodeAsIs:!1}}),!0)}}])]}function vv({view:e,nextLanguage:n,opts:i}){let o=e.state.field(Lr),s=e.state.doc.toString(),c=e.state.facet(vg),d=e.state.facet(bg),f=e.state.facet(jd),p=e.state.facet(zd),y=e.state.facet(wg),w=e.state.field(di),_=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),[L,z,U]=n.transformIn(E);_+=T,_-=z,_=kh(_,0,L.length),C=L,w=U}e.dispatch({effects:[rd.of(n),Uu.of(w),pf.reconfigure(n.getExtension(p,c,d,f,y)),Yu.reconfigure([]),Ls.of(!0)],changes:i.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:C},selection:i.keepCodeAsIs?void 0:hn.cursor(_)}),e.dispatch({effects:[Yu.reconfigure([j4()])]}),n.type==="sql"&&VE(e)}u_=function(e){let{placeholderType:n,completionConfig:i,hotkeys:o,cellId:s,lspConfig:c}=e;return[L3(),pf.of(yr.python.getExtension(s,i,o,n,c)),Lr,di]},H_=function(e){return N3(Jr({state:e}).trim())};function N3(e){return e?yr.markdown.isSupported(e)?yr.markdown:yr.sql.isSupported(e)?yr.sql:yr.python:yr.python}Dm=function(e,n){e.state.field(Lr).type!==n.language&&vv({view:e,nextLanguage:yr[n.language],opts:{keepCodeAsIs:n.keepCodeAsIs??!1}})},y_=function(e,{completionConfig:n,hotkeysProvider:i,lspConfig:o}){let s=e.state.field(Lr),c=e.state.facet(jd),d=e.state.facet(zd);return pf.reconfigure(s.getExtension(d,n,i,c,o))},Jr=function(e,n,i){let o=e.state.field(Lr),s=e.state.field(di),c=e.state.doc.toString();return n===void 0?o.transformOut(c,s)[0]:o.transformOut(c.slice(n,i),s)[0]},So=function(e,n){let[i]=e.state.field(Lr).transformIn(n);return zu(e,i),i};function I3(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 CE(e,n){var f;let i=T4.empty;if((f=n.whenHide)!=null&&f.call(n,e))return i;let o=e.state.field(Gy,!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 SE(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 EE(e){return Ut.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:Qy.of(d)})})}function TE(e){let n=e.width||3;return Ut.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 RE(e){return R4({class:`cm-sql-gutter ${e.className||""}`,markers:n=>CE(n,e)})}function DE(e={}){return[Gy,EE(new kE(e.parser||new dc)),TE(e),RE(e)]}function OE(e={}){let n=[],{enableLinting:i=!0,enableGutterMarkers:o=!0,enableHover:s=!0,linterConfig:c,gutterConfig:d,hoverConfig:f}=e;return i&&n.push(gE(c)),o&&n.push(DE(d)),s&&(n.push(bE(f)),f!=null&&f.theme?n.push(f.theme):n.push(Ky())),n}var PE=class gx{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??gx.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)}};ax=new Iu("sql-table-preview",async(e,n)=>{await Hi().previewSQLTable({requestId:e,...n})}),Zw=new Iu("sql-table-list-preview",async(e,n)=>{await Hi().previewSQLTableList({requestId:e,...n})}),Lh=new PE(new Iu("validate-sql",async(e,n)=>{await Hi().validateSQL({requestId:e,...n})}),{maxSize:3});var ME=Gr();let Va;Va=Be(new Map),m_=e=>{let n=(0,ME.c)(3),i=Yn(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 Jy(e){let n=st.get(Va),i=new Map(n);i.delete(e),st.set(Va,i)}function LE(){st.set(Va,new Map)}function NE({cellId:e,errorMessage:n,dialect:i}){let o=st.get(Va),s=new Map(o),c=i==="DuckDB"?IE(n):Xy(n);s.set(e,c),st.set(Va,s)}function IE(e){let{errorType:n,errorMessage:i}=Xy(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 Xy(e){return{errorType:e.split(":")[0].trim(),errorMessage:e.split(":").slice(1).join(":").trim()}}function Yy(e){return e.field(di)}function AE(){return e=>{let n=Yy(e.state).engine,i=Fa.getCompletionSource(n);return i&&oD(i)(e)||null}}function qE(){return e=>{let n=Yy(e.state).engine,i=Fa.getDialect(n);return e.matchBefore(/\.\w*/)?null:fD(i,!0,(o,s)=>({label:o,type:s,info:async()=>{let c=(await jE())[o.toLocaleLowerCase()];if(!c)return null;let d=document.createElement("div");return d.innerHTML=xE.keyword({keyword:o,info:c}),d}}))(e)}}var jE=ui(async()=>{let e=await ce(()=>import("./common-keywords-0dB1lgek.js").then(async i=>(await i.__tla,i)),[],import.meta.url),n=await ce(()=>import("./duckdb-keywords-DH8yhwVC.js").then(async i=>(await i.__tla,i)),[],import.meta.url);return{...e.default.keywords,...n.default.keywords}}),zE=Gr(),Zy=Fl("marimo:notebook-sql-mode","default",Kl);function FE(){let e=(0,zE.c)(3),[n,i]=G2(Zy),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 ev(){return st.get(Zy)}var BE=kg,HE="DuckDB",tv=new Mu;function cf(){return st.get(_o).latestEngineSelected}let nv;fd=(wf=class{constructor(){ke(this,"parser",new Zg);ke(this,"type","sql");this.sqlModeEnabled=!0}get defaultMetadata(){return{...this.parser.defaultMetadata,engine:cf()||"__marimo_duckdb"}}get defaultCode(){let e=cf();return e&&e!=="__marimo_duckdb"?`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`:this.parser.defaultCode}transformIn(e){this.parser.defaultMetadata.engine=cf()||"__marimo_duckdb";let n=this.parser.transformIn(e),i=n.metadata;return i.engine&&i.engine!=="__marimo_duckdb"&&Eg(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=[tv.of(xw({dialect:BE})),Ta.of([{key:"Tab",run:f=>tD(f)||j4(f),preventDefault:!0}]),Nu({defaultKeymap:!1,activateOnTyping:!0,override:[AE(),zC,qE()]})];if(((d=s==null?void 0:s.diagnostics)==null?void 0:d.sql_linter)??!1){let f=st.get(OD),p=new nv({getParserOptions:y=>({database:iv(y)??HE})});c.push(OE({enableLinting:!0,linterConfig:{delay:250,parser:p},enableGutterMarkers:!0,gutterConfig:{backgroundColor:"#3b82f6",errorBackgroundColor:"#ef4444",hideWhenNotFocused:!0,parser:p},hoverConfig:{schema:WE,hoverTime:300,enableKeywords:!0,enableTables:!0,enableColumns:!0,parser:p,theme:Ky(f)}}),Ut.updateListener.of(y=>{y.focusChanged&&p.setFocusState(y.view.hasFocus)}))}return this.sqlModeEnabled&&c.push(KE()),c}},ke(wf,"fromQuery",e=>Zg.fromQuery(e)),wf),nv=class extends dc{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 ov(n,i,o,ev());if(d.error){Re.error("Failed to validate SQL",{error:d.error}),s([]);return}s(((c=d.parse_result)==null?void 0:c.errors)??[])}catch(d){Re.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=iv(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 rv(e,n){e.dispatch({effects:tv.reconfigure(xw({dialect:n}))})}function VE(e,n){rv(e,Fa.getDialect(n))}function $E(e){let n=Fo(e.state).engine;rv(e,Fa.getDialect(n))}function Fo(e){return e.field(di)}function WE(e){let n=Fo(e.state).engine,i=Fa.getCompletionSource(n);return i!=null&&i.schema?i.schema:{}}function iv(e){let n=Fo(e).engine;return av(n)}function av(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 Re.debug("Unsupported dialect",{dialect:n}),null;default:return _s(n),null}}var UE=300;function KE(){let e,n=null;return Ut.updateListener.of(i=>{if(!i.docChanged)return;let o=ev();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(La);if(c===""){Jy(d);return}try{let f=av(s),p=(await ov(c,s,f,o)).validate_result;p!=null&&p.error_message?NE({cellId:d,errorMessage:p.error_message,dialect:f}):Jy(d)}catch(f){Re.error("Failed to validate SQL",{error:f})}},UE)})}async function ov(e,n,i,o){let s=await Lh.request({onlyParse:o==="default",engine:n,dialect:i,query:e});if(s.error)throw Error(s.error);return s}var QE=ui(()=>new lE),GE=ui(()=>new Fu),JE=ui(()=>new fd);yr={get python(){return QE()},get markdown(){return GE()},get sql(){return JE()}};function XE(){return Object.values(yr)}var At=yh(Du(),1),hc="Checkbox",[YE,zD]=PD(hc),[ZE,uf]=YE(hc);function e3(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]=MD({prop:i,defaultProp:s??!1,onChange:p,caller:hc}),[T,L]=At.useState(null),[z,U]=At.useState(null),$=At.useRef(!1),I=T?!!d||!!T.closest("form"):!0,G={checked:C,disabled:c,setChecked:E,control:T,setControl:L,name:f,form:d,value:w,hasConsumerStoppedPropagationRef:$,required:y,defaultChecked:Yi(s)?!1:s,isFormControl:I,bubbleInput:z,setBubbleInput:U};return(0,B.jsx)(ZE,{scope:n,...G,children:t3(_)?_(G):o})}var sv="CheckboxTrigger",lv=At.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}=uf(sv,e),L=nw(s,w),z=At.useRef(p);return At.useEffect(()=>{let U=c==null?void 0:c.form;if(U){let $=()=>_(z.current);return U.addEventListener("reset",$),()=>U.removeEventListener("reset",$)}},[c,_]),(0,B.jsx)(Oh.button,{type:"button",role:"checkbox","aria-checked":Yi(p)?"mixed":p,"aria-required":y,"data-state":pv(p),"data-disabled":f?"":void 0,disabled:f,value:d,...o,ref:L,onKeyDown:Ew(n,U=>{U.key==="Enter"&&U.preventDefault()}),onClick:Ew(i,U=>{_($=>Yi($)?!0:!$),T&&E&&(C.current=U.isPropagationStopped(),C.current||U.stopPropagation())})})});lv.displayName=sv;var df=At.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)(e3,{__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)(lv,{..._,ref:n,__scopeCheckbox:i}),C&&(0,B.jsx)(fv,{__scopeCheckbox:i})]})})});df.displayName=hc;var cv="CheckboxIndicator",uv=At.forwardRef((e,n)=>{let{__scopeCheckbox:i,forceMount:o,...s}=e,c=uf(cv,i);return(0,B.jsx)(LD,{present:o||Yi(c.checked)||c.checked===!0,children:(0,B.jsx)(Oh.span,{"data-state":pv(c.checked),"data-disabled":c.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})});uv.displayName=cv;var dv="CheckboxBubbleInput",fv=At.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}=uf(dv,e),T=nw(i,E),L=gD(c),z=ND(o);At.useEffect(()=>{let $=C;if(!$)return;let I=window.HTMLInputElement.prototype,G=Object.getOwnPropertyDescriptor(I,"checked").set,pe=!s.current;if(L!==c&&G){let P=new Event("click",{bubbles:pe});$.indeterminate=Yi(c),G.call($,Yi(c)?!1:c),$.dispatchEvent(P)}},[C,L,c,s]);let U=At.useRef(Yi(c)?!1:c);return(0,B.jsx)(Oh.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??U.current,required:f,disabled:p,name:y,value:w,form:_,...n,tabIndex:-1,ref:T,style:{...n.style,...z,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});fv.displayName=dv;function t3(e){return typeof e=="function"}function Yi(e){return e==="indeterminate"}function pv(e){return Yi(e)?"indeterminate":e?"checked":"unchecked"}let hv;hv=Gr(),Wl=At.forwardRef((e,n)=>{let i=(0,hv.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=Ou("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)(uv,{className:Ou("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),children:(0,B.jsx)(pD,{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)(df,{ref:n,className:c,...s,children:d}),i[6]=s,i[7]=n,i[8]=c,i[9]=f):f=i[9],f}),Wl.displayName=df.displayName,S_="_";var n3=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("."));hm=function(e,n=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,"_"),n?e.toLowerCase():e):"_"},j_=function(e,n){let i=new Set(n),o=e,s=d=>!i.has(d)&&!n3.has(d);if(s(e))return e;let c=1;for(;!s(o);)o=`${e}_${c}`,c++;return o},W_=function(e,n){return gm(e)?`cell-${n}`:e},gm=function(e){return e?e==="_"||e==="__":!0};var r3=Gr();function i3(e){let n=(0,r3.c)(15),{minWidth:i,padding:o}=e,s=i===void 0?70:i,c=o===void 0?15:o,[d,f]=(0,At.useState)(50),p=(0,At.useRef)(null),y=(0,At.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 V=A.offsetWidth;f(V+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),s4(C);let E;n[4]===_?E=n[5]:(E=P=>{_(P.target.value)},n[4]=_,n[5]=E);let T=`${d}px`,L=`${s}px`,z;n[6]!==T||n[7]!==L?(z={width:T,minWidth:L},n[6]=T,n[7]=L,n[8]=z):z=n[8];let U;n[9]!==E||n[10]!==z?(U={ref:p,type:"text",onChange:E,style:z},n[9]=E,n[10]=z,n[11]=U):U=n[11];let $=U,I;n[12]===Symbol.for("react.memo_cache_sentinel")?(I={ref:y,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},n[12]=I):I=n[12];let G=I,pe;return n[13]===$?pe=n[14]:(pe={inputProps:$,spanProps:G},n[13]=$,n[14]=pe),pe}var a3=Gr();function o3({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}const s3=()=>{let e=(0,a3.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};var l3="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",c3="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",u3="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==",d3="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",f3="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",p3=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,h3="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",m3="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",mv=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,g3="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",y3="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",v3="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",b3="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",w3="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",_3="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",x3=""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,k3=Gr(),S3={sqlite:b3,duckdb:d3,motherduck:h3,postgres:mv,postgresql:mv,mysql:m3,snowflake:y3,databricks:c3,clickhouse:l3,timeplus:_3,bigquery:f3,trino:x3,iceberg:p3,datafusion:u3,pyspark:v3,redshift:g3,supabase:w3};pm=e=>{let n=(0,k3.c)(11),{name:i,className:o}=e,s=S3[i.toLowerCase()];if(!s){let f;n[0]===o?f=n[1]:(f=Ou("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=Ou("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 ff=Gr();const C3=e=>{let n=(0,ff.c)(27),{selectedEngine:i,onChange:o}=e,s=Yn(Gu),c=[],d=[];for(let[fe,be]of s.entries())ko.has(fe)?c.push(be):d.push(be);let f=rD(),p=i&&!s.has(i),y;n[0]!==s||n[1]!==o||n[2]!==f?(y=fe=>{if(fe===gv){window.open(yv,"_blank");return}let be=s.get(fe);be&&(f(),o(be.name),Eg(be.name))},n[0]=s,n[1]=o,n[2]=f,n[3]=y):y=n[3];let w=y,_=O3,C=wD,E;n[4]===Symbol.for("react.memo_cache_sentinel")?(E=(0,B.jsx)(T3,{children:(0,B.jsx)(mD,{placeholder:"Select an engine"})}),n[4]=E):E=n[4];let T=yD,L=vD,z;n[5]===Symbol.for("react.memo_cache_sentinel")?(z=(0,B.jsx)(hD,{children:"Database connections"}),n[5]=z):z=n[5];let U;n[6]!==p||n[7]!==i?(U=p&&(0,B.jsx)(Rh,{value:i,children:(0,B.jsxs)("div",{className:"flex items-center gap-1 opacity-50",children:[(0,B.jsx)(am,{className:"h-3 w-3"}),(0,B.jsx)("span",{className:"truncate",children:Pg(i)})]})},i),n[6]=p,n[7]=i,n[8]=U):U=n[8];let $=_(d),I=d.length>0&&(0,B.jsx)(kw,{}),G=_(c),pe;n[9]===Symbol.for("react.memo_cache_sentinel")?(pe=(0,B.jsx)(kw,{}),n[9]=pe):pe=n[9];let P;n[10]===Symbol.for("react.memo_cache_sentinel")?(P=(0,B.jsx)(Rh,{className:"text-muted-foreground",value:gv,children:(0,B.jsxs)("a",{className:"flex items-center gap-1",href:yv,target:"_blank",rel:"noreferrer",children:[(0,B.jsx)(xD,{className:"h-3 w-3"}),(0,B.jsx)("span",{children:"How to add a database connection"})]})}),n[10]=P):P=n[10];let A;n[11]!==L||n[12]!==z||n[13]!==U||n[14]!==$||n[15]!==I||n[16]!==G?(A=(0,B.jsxs)(L,{children:[z,U,$,I,G,pe,P]}),n[11]=L,n[12]=z,n[13]=U,n[14]=$,n[15]=I,n[16]=G,n[17]=A):A=n[17];let V;n[18]!==T||n[19]!==A?(V=(0,B.jsx)(T,{children:A}),n[18]=T,n[19]=A,n[20]=V):V=n[20];let de;return n[21]!==C||n[22]!==w||n[23]!==i||n[24]!==V||n[25]!==E?(de=(0,B.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,B.jsxs)(C,{value:i,onValueChange:w,children:[E,V]})}),n[21]=C,n[22]=w,n[23]=i,n[24]=V,n[25]=E,n[26]=de):de=n[26],de};var gv="__help__",yv="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";const E3=()=>{let e=(0,ff.c)(16),{sqlMode:n,setSQLMode:i}=FE(),o;e[0]!==i||e[1]!==n?(o=()=>{let E=n==="validate"?"default":"validate";E==="default"&&LE(),i(E)},e[0]=i,e[1]=n,e[2]=o):o=e[2];let s=o,c=P3,d=M3,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)(rw,{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)(Ph,{delayDuration:300,content:f,children:_})}),e[13]=f,e[14]=_,e[15]=C):C=e[15],C};var T3=e=>{let n=(0,ff.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)(bD,{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 R3(e){return e.source!=="iceberg"}function D3(e){return(0,B.jsx)(Rh,{value:e.name,children:(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[(0,B.jsx)(pm,{className:"h-3 w-3",name:e.dialect}),(0,B.jsx)("span",{className:"truncate ml-0.5",children:Pg(e.display_name)})]})},e.name)}function O3(e){return e=e.filter(R3),e.map(D3)}function P3(e){return e==="validate"?(0,B.jsx)(Hd,{className:"h-3 w-3"}):(0,B.jsx)(Bd,{className:"h-3 w-3"})}function M3(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 vv=Gr(),bv=()=>{let e=(0,vv.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 L3=e=>{let n=(0,vv.c)(99),{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}=i3(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]===Symbol.for("react.memo_cache_sentinel")?(p=(0,B.jsx)("div",{}),n[3]=p):p=n[3];let y=p,w=!1,_;n[4]===i?_=n[5]:(_=L=>{i.dispatch({effects:nd.of(L),changes:{from:0,to:i.state.doc.length,insert:i.state.doc.toString()}})},n[4]=i,n[5]=_);let C=_;if(f instanceof fd){let L;n[6]===i.state?L=n[7]:(L=i.state.field(di),n[6]=i.state,n[7]=L);let z=L;w=!0;let U;n[8]===C?U=n[9]:(U=Oe=>{let Ne=hm(Oe.currentTarget.value,!1);Oe.currentTarget.value=Ne,C({dataframeName:Ne})},n[8]=C,n[9]=U);let $=U,I;n[10]!==C||n[11]!==i?(I=Oe=>{C({engine:Oe}),VE(i,Oe)},n[10]=C,n[11]=i,n[12]=I):I=n[12];let G=I,pe;n[13]===Symbol.for("react.memo_cache_sentinel")?(pe=(0,B.jsx)("span",{className:"select-none",children:"Output variable: "}),n[13]=pe):pe=n[13];let P;n[14]===c?P=n[15]:(P=Oe=>{var Ne;(Ne=c.onChange)==null||Ne.call(c,Oe)},n[14]=c,n[15]=P);let A;n[16]===$?A=n[17]:(A=Oe=>{Oe.key==="Enter"&&Oe.shiftKey&&$(Oe)},n[16]=$,n[17]=A);let V;n[18]!==c||n[19]!==z.dataframeName||n[20]!==$||n[21]!==A||n[22]!==P?(V=(0,B.jsx)("input",{...c,defaultValue:z.dataframeName,onChange:P,onBlur:$,onKeyDown:A,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[18]=c,n[19]=z.dataframeName,n[20]=$,n[21]=A,n[22]=P,n[23]=V):V=n[23];let de;n[24]===s?de=n[25]:(de=(0,B.jsx)("span",{...s}),n[24]=s,n[25]=de);let fe;n[26]!==V||n[27]!==de?(fe=(0,B.jsxs)("label",{className:"flex gap-2 items-center",children:[pe,V,de]}),n[26]=V,n[27]=de,n[28]=fe):fe=n[28];let be;n[29]!==z.engine||n[30]!==G?(be=(0,B.jsx)(C3,{selectedEngine:z.engine,onChange:G}),n[29]=z.engine,n[30]=G,n[31]=be):be=n[31];let J;n[32]===z.engine?J=n[33]:(J=z.engine==="__marimo_duckdb"&&(0,B.jsx)(E3,{}),n[32]=z.engine,n[33]=J);let we;n[34]!==z.engine||n[35]!==i?(we=async()=>{await Vk(i,z.engine)},n[34]=z.engine,n[35]=i,n[36]=we):we=n[36];let Ee;n[37]===Symbol.for("react.memo_cache_sentinel")?(Ee=(0,B.jsx)(Uh,{className:"h-3 w-3"}),n[37]=Ee):Ee=n[37];let ne;n[38]===we?ne=n[39]:(ne=(0,B.jsx)(Ph,{content:"Format SQL",children:(0,B.jsx)(rw,{variant:"text",size:"icon",onClick:we,children:Ee})}),n[38]=we,n[39]=ne);let ie;n[40]===Symbol.for("react.memo_cache_sentinel")?(ie=(0,B.jsx)(bv,{}),n[40]=ie):ie=n[40];let se;n[41]===C?se=n[42]:(se=Oe=>{C({showOutput:!Oe.target.checked})},n[41]=C,n[42]=se);let K=!z.showOutput,Le;n[43]!==se||n[44]!==K?(Le=(0,B.jsx)("input",{type:"checkbox",onChange:se,checked:K}),n[43]=se,n[44]=K,n[45]=Le):Le=n[45];let $e;n[46]===Symbol.for("react.memo_cache_sentinel")?($e=(0,B.jsx)("span",{className:"select-none",children:"Hide output"}),n[46]=$e):$e=n[46];let lt;n[47]===Le?lt=n[48]:(lt=(0,B.jsxs)("label",{className:"flex items-center gap-2",children:[Le,$e]}),n[47]=Le,n[48]=lt);let je;n[49]!==J||n[50]!==ne||n[51]!==lt?(je=(0,B.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[J,ne,ie,lt]}),n[49]=J,n[50]=ne,n[51]=lt,n[52]=je):je=n[52];let He;n[53]!==fe||n[54]!==be||n[55]!==je?(He=(0,B.jsxs)("div",{className:"flex flex-1 gap-2 items-center",children:[fe,be,je]}),n[53]=fe,n[54]=be,n[55]=je,n[56]=He):He=n[56],y=He}if(f instanceof Fu){w=!0;let L,z,U,$,I,G,pe,P,A,V;if(n[57]!==C||n[58]!==i.state){let{quotePrefix:se}=i.state.field(di);z=se,z===void 0&&(z="r",C({quotePrefix:z})),V=(K,Le)=>{typeof Le=="boolean"&&C({quotePrefix:o3({currentQuotePrefix:z,checked:Le,prefix:K})})},U="flex flex-row w-full justify-end gap-1.5 items-center",P="flex items-center gap-1.5",n[69]===Symbol.for("react.memo_cache_sentinel")?(A=(0,B.jsx)("span",{children:"r"}),n[69]=A):A=n[69],L=Wl,I="Toggle raw string",G="w-3 h-3",pe=z.includes("r"),$=K=>{V("r",K)},n[57]=C,n[58]=i.state,n[59]=L,n[60]=z,n[61]=U,n[62]=$,n[63]=I,n[64]=G,n[65]=pe,n[66]=P,n[67]=A,n[68]=V}else L=n[59],z=n[60],U=n[61],$=n[62],I=n[63],G=n[64],pe=n[65],P=n[66],A=n[67],V=n[68];let de;n[70]!==L||n[71]!==$||n[72]!==I||n[73]!==G||n[74]!==pe?(de=(0,B.jsx)(L,{"aria-label":I,className:G,checked:pe,onCheckedChange:$}),n[70]=L,n[71]=$,n[72]=I,n[73]=G,n[74]=pe,n[75]=de):de=n[75];let fe;n[76]!==de||n[77]!==P||n[78]!==A?(fe=(0,B.jsxs)("div",{className:P,children:[A,de]}),n[76]=de,n[77]=P,n[78]=A,n[79]=fe):fe=n[79];let be;n[80]===Symbol.for("react.memo_cache_sentinel")?(be=(0,B.jsx)("span",{children:"f"}),n[80]=be):be=n[80];let J;n[81]===z?J=n[82]:(J=z.includes("f"),n[81]=z,n[82]=J);let we;n[83]===V?we=n[84]:(we=se=>{V("f",se)},n[83]=V,n[84]=we);let Ee;n[85]!==J||n[86]!==we?(Ee=(0,B.jsxs)("div",{className:"flex items-center gap-1.5",children:[be,(0,B.jsx)(Wl,{"aria-label":"Toggle f-string",className:"w-3 h-3",checked:J,onCheckedChange:we})]}),n[85]=J,n[86]=we,n[87]=Ee):Ee=n[87];let ne;n[88]===Symbol.for("react.memo_cache_sentinel")?(ne=(0,B.jsx)(Ph,{content:(0,B.jsx)(s3,{}),children:(0,B.jsx)($u,{className:"w-3 h-3"})}),n[88]=ne):ne=n[88];let ie;n[89]!==U||n[90]!==fe||n[91]!==Ee?(ie=(0,B.jsxs)("div",{className:U,children:[fe,Ee,ne]}),n[89]=U,n[90]=fe,n[91]=Ee,n[92]=ie):ie=n[92],y=ie}let E;n[93]===w?E=n[94]:(E=w&&(0,B.jsx)(bv,{}),n[93]=w,n[94]=E);let T;return n[95]!==y||n[96]!==f.type||n[97]!==E?(T=(0,B.jsx)(ID,{children:(0,B.jsxs)("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[y,E,f.type]})}),n[95]=y,n[96]=f.type,n[97]=E,n[98]=T):T=n[98],T};var pf=new Mu;rd=Fi.define(),Lr=xs.define({create(){return yr.python},update(e,n){for(let i of n.effects)if(i.is(rd))return i.value;return e},provide:e=>wh.from(e,n=>n.type==="python"?null:i=>Uk(i,L3))});function N3(){let e=XE(),n=(i,o)=>{let s=e[o%e.length];return s.isSupported(i)?s:n(i,o+1)};return[Ta.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:(wv({view:i,nextLanguage:c,opts:{keepCodeAsIs:!1}}),!0)}}])]}function wv({view:e,nextLanguage:n,opts:i}){let o=e.state.field(Lr),s=e.state.doc.toString(),c=e.state.facet(bg),d=e.state.facet(wg),f=e.state.facet(jd),p=e.state.facet(zd),y=e.state.facet(_g),w=e.state.field(di),_=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),[L,z,U]=n.transformIn(E);_+=T,_-=z,_=kh(_,0,L.length),C=L,w=U}e.dispatch({effects:[rd.of(n),Uu.of(w),pf.reconfigure(n.getExtension(p,c,d,f,y)),Yu.reconfigure([]),Ls.of(!0)],changes:i.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:C},selection:i.keepCodeAsIs?void 0:hn.cursor(_)}),e.dispatch({effects:[Yu.reconfigure([z4()])]}),n.type==="sql"&&$E(e)}f_=function(e){let{placeholderType:n,completionConfig:i,hotkeys:o,cellId:s,lspConfig:c}=e;return[N3(),pf.of(yr.python.getExtension(s,i,o,n,c)),Lr,di]},V_=function(e){return I3(Jr({state:e}).trim())};function I3(e){return e?yr.markdown.isSupported(e)?yr.markdown:yr.sql.isSupported(e)?yr.sql:yr.python:yr.python}Om=function(e,n){e.state.field(Lr).type!==n.language&&wv({view:e,nextLanguage:yr[n.language],opts:{keepCodeAsIs:n.keepCodeAsIs??!1}})},b_=function(e,{completionConfig:n,hotkeysProvider:i,lspConfig:o}){let s=e.state.field(Lr),c=e.state.facet(jd),d=e.state.facet(zd);return pf.reconfigure(s.getExtension(d,n,i,c,o))},Jr=function(e,n,i){let o=e.state.field(Lr),s=e.state.field(di),c=e.state.doc.toString();return n===void 0?o.transformOut(c,s)[0]:o.transformOut(c.slice(n,i),s)[0]},So=function(e,n){let[i]=e.state.field(Lr).transformIn(n);return zu(e,i),i};function A3(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:Jr(e,0,c),afterCursorCode:Jr(e,d)}}var A3=["marimo-carousel","marimo-tabs","marimo-accordion"],q3="h1, h2, h3, h4, h5, h6";function j3(e){if(typeof DOMParser>"u")return null;let n=[],i=new DOMParser().parseFromString(e,"text/html").querySelectorAll(q3);for(let o of Array.from(i)){let s=o.textContent;if(A3.some(d=>o.closest(d))||!s)continue;let c=Number.parseInt(o.tagName[1],10);n.push({name:s,level:c,by:Tm(o)})}return{items:n}}Tm=function(e){let n=e.id;if(n)return{id:n};let i=e.textContent;return{path:`//${e.tagName}[contains(., "${i}")]`}};function z3(e){return{items:e.filter(Boolean).flatMap(n=>n.items)}}km=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"),j3(e.data)}catch{return Re.error("Failed to parse outline"),null}},w_=function(e){return e==null?!1:e.items.some(n=>n.level<=3)};function bv(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 Re.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]}Au=function(e){return e==="application/vnd.marimo+error"||e==="application/vnd.marimo+traceback"},Uw=Fl("marimo:rtc:username","",Kl),lm=_m(()=>Gl("rtc_v2"));let hf,wv,mf,As;om=class md{static fromMilliseconds(n){return n==null?null:new md(n)}static fromSeconds(n){return n==null?null:new md(n*1e3)}static now(){return new md(Date.now())}constructor(n){this.ms=n}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}},hf=($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:Jr(e,0,c),afterCursorCode:Jr(e,d)}}var q3=["marimo-carousel","marimo-tabs","marimo-accordion"],j3="h1, h2, h3, h4, h5, h6";function z3(e){if(typeof DOMParser>"u")return null;let n=[],i=new DOMParser().parseFromString(e,"text/html").querySelectorAll(j3);for(let o of Array.from(i)){let s=o.textContent;if(q3.some(d=>o.closest(d))||!s)continue;let c=Number.parseInt(o.tagName[1],10);n.push({name:s,level:c,by:Rm(o)})}return{items:n}}Rm=function(e){let n=e.id;if(n)return{id:n};let i=e.textContent;return{path:`//${e.tagName}[contains(., "${i}")]`}};function F3(e){return{items:e.filter(Boolean).flatMap(n=>n.items)}}Sm=function(e){if(e==null||e.mimetype!=="text/html"&&e.mimetype!=="text/markdown"||e.data==null)return null;try{return In(typeof e.data=="string","expected string"),z3(e.data)}catch{return Re.error("Failed to parse outline"),null}},x_=function(e){return e==null?!1:e.items.some(n=>n.level<=3)};function _v(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 Re.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]}Au=function(e){return e==="application/vnd.marimo+error"||e==="application/vnd.marimo+traceback"},Qw=Fl("marimo:rtc:username","",Kl),lm=_m(()=>Gl("rtc_v2"));let hf,xv,mf,As;om=class md{static fromMilliseconds(n){return n==null?null:new md(n)}static fromSeconds(n){return n==null?null:new md(n*1e3)}static now(){return new md(Date.now())}constructor(n){this.ms=n}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}},hf=($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
- `)}},ke($a,"ESCAPE_REGEX",/\u001B\[([0-9;]*)([A-DJKH])/u),$a),wv=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}},mf=class{constructor(){ke(this,"parser",new wv);ke(this,"buffer",new hf)}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 hf}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}},As=class Im{constructor(n,i,o,s){ke(this,"ansiReducer",new mf);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 mf;return i.append(n.data),new Im(n.mimetype,n.channel,n.timestamp,i)}appendData(n){return this.ansiReducer.append(n),new Im(this.mimetype,this.channel,this.timestamp,this.ansiReducer)}toJSON(){return{mimetype:this.mimetype,channel:this.channel,timestamp:this.timestamp,data:this.data}}};function F3(e,n=5e3){let i=[...e];if(i.length<2)return xv(i.map(H3),n);let o=i[i.length-1],s=i[i.length-2];return B3(o,s)&&(_v(o),_v(s),i[i.length-2]=V3(s,o),i.pop()),xv(i,n)}function B3(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 H3(e){return e instanceof As?e:typeof e.data=="string"?As.create(e):e}function V3(e,n){return e instanceof As?e.appendData(n.data):As.create(e).appendData(n.data)}function _v(e){In(typeof e.data=="string","expected string output")}function xv(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(`
149
+ `)}},ke($a,"ESCAPE_REGEX",/\u001B\[([0-9;]*)([A-DJKH])/u),$a),xv=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}},mf=class{constructor(){ke(this,"parser",new xv);ke(this,"buffer",new hf)}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 hf}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}},As=class Am{constructor(n,i,o,s){ke(this,"ansiReducer",new mf);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 mf;return i.append(n.data),new Am(n.mimetype,n.channel,n.timestamp,i)}appendData(n){return this.ansiReducer.append(n),new Am(this.mimetype,this.channel,this.timestamp,this.ansiReducer)}toJSON(){return{mimetype:this.mimetype,channel:this.channel,timestamp:this.timestamp,data:this.data}}};function B3(e,n=5e3){let i=[...e];if(i.length<2)return Sv(i.map(V3),n);let o=i[i.length-1],s=i[i.length-2];return H3(o,s)&&(kv(o),kv(s),i[i.length-2]=$3(s,o),i.pop()),Sv(i,n)}function H3(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 V3(e){return e instanceof As?e:typeof e.data=="string"?As.create(e):e}function $3(e,n){return e instanceof As?e.appendData(n.data):As.create(e).appendData(n.data)}function kv(e){In(typeof e.data=="string","expected string output")}function Sv(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(`
154
- `)},...e.slice(s+1)]}return[c,...e.slice(s+1)]}function $3(e,n){let i={...e};switch(n.status){case"queued":i.interrupted=!1,i.errored=!1,i.runElapsedTimeMs=null,i.debuggerActive=!1;break;case"running":i.interrupted=!1,e.stopped&&(i.output=null),i.status==="queued"&&(i.consoleOutputs=[]),i.stopped=!1,i.runStartTimestamp=n.timestamp,i.lastRunStartTimestamp=n.timestamp;break;case"idle":e.runStartTimestamp&&(i.runElapsedTimeMs=om.fromSeconds((n.timestamp??0)-e.runStartTimestamp).toMilliseconds(),i.runStartTimestamp=null,i.staleInputs=!1),!e.lastRunStartTimestamp&&n.timestamp&&(i.lastRunStartTimestamp=n.timestamp),i.debuggerActive=!1;break;case null:break;case"disabled-transitively":break;case void 0:break;default:_s(n.status)}i.output=n.output??i.output,i.staleInputs=n.stale_inputs??i.staleInputs,i.status=n.status??i.status,i.serialization=n.serialization;let o=!1;n.output!=null&&n.output.mimetype==="application/vnd.marimo+error"&&((i.status==="queued"||i.status==="running")&&(i.status="idle"),In(Array.isArray(n.output.data),"Expected error output data to be an array"),n.output.data.some(f=>f.type==="interruption")?(i.interrupted=!0,o=!0):n.output.data.some(f=>f.type.includes("ancestor"))?i.stopped=!0:i.errored=!0);let s=e.consoleOutputs;o&&(i.debuggerActive=!1,s=s.map(f=>f.channel==="stdin"?{...f,response:f.response??""}:f));let c=n.console;c!=null&&(s=F3(Array.isArray(c)?c:[...s,c])),i.consoleOutputs=s,i.outline=km(i.output);let d=[n.console].flat().filter(Boolean).filter(f=>f.channel==="pdb");return d.length>0&&d.some(f=>f.data==="start")&&(i.debuggerActive=!0),i}function W3(e){let n={...e};return e.status!=="disabled-transitively"&&(n.status="queued"),n.interrupted=!1,n.errored=!1,n.runElapsedTimeMs=null,n.debuggerActive=!1,n}jh=function(e){return e==="running"||e==="queued"},i_=function(e,n){let{status:i,output:o,runStartTimestamp:s,interrupted:c,staleInputs:d}=e;if(c)return!1;if(n)return!0;let f=jh(i),p=i==="running"&&o!==null&&s!==null&&(o.timestamp??0)>s;return f&&!p?!0:d};function U3(e,n){return wD(e*1e3,n==null?void 0:n.in)}var gf=function(e,n){return Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,e},It;(function(e){e[e.EOS=0]="EOS",e[e.Text=1]="Text",e[e.Incomplete=2]="Incomplete",e[e.ESC=3]="ESC",e[e.Unknown=4]="Unknown",e[e.SGR=5]="SGR",e[e.OSCURL=6]="OSCURL"})(It||(It={})),Sm=class{constructor(){this.VERSION="6.0.6",this.setup_palettes(),this._use_classes=!1,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1,this.fg=this.bg=null,this._buffer="",this._url_allowlist={http:1,https:1},this._escape_html=!0,this.boldStyle="font-weight:bold",this.faintStyle="opacity:0.7",this.italicStyle="font-style:italic",this.underlineStyle="text-decoration:underline"}set use_classes(e){this._use_classes=e}get use_classes(){return this._use_classes}set url_allowlist(e){this._url_allowlist=e}get url_allowlist(){return this._url_allowlist}set escape_html(e){this._escape_html=e}get escape_html(){return this._escape_html}set boldStyle(e){this._boldStyle=e}get boldStyle(){return this._boldStyle}set faintStyle(e){this._faintStyle=e}get faintStyle(){return this._faintStyle}set italicStyle(e){this._italicStyle=e}get italicStyle(){return this._italicStyle}set underlineStyle(e){this._underlineStyle=e}get underlineStyle(){return this._underlineStyle}setup_palettes(){this.ansi_colors=[[{rgb:[0,0,0],class_name:"ansi-black"},{rgb:[187,0,0],class_name:"ansi-red"},{rgb:[0,187,0],class_name:"ansi-green"},{rgb:[187,187,0],class_name:"ansi-yellow"},{rgb:[0,0,187],class_name:"ansi-blue"},{rgb:[187,0,187],class_name:"ansi-magenta"},{rgb:[0,187,187],class_name:"ansi-cyan"},{rgb:[255,255,255],class_name:"ansi-white"}],[{rgb:[85,85,85],class_name:"ansi-bright-black"},{rgb:[255,85,85],class_name:"ansi-bright-red"},{rgb:[0,255,0],class_name:"ansi-bright-green"},{rgb:[255,255,85],class_name:"ansi-bright-yellow"},{rgb:[85,85,255],class_name:"ansi-bright-blue"},{rgb:[255,85,255],class_name:"ansi-bright-magenta"},{rgb:[85,255,255],class_name:"ansi-bright-cyan"},{rgb:[255,255,255],class_name:"ansi-bright-white"}]],this.palette_256=[],this.ansi_colors.forEach(i=>{i.forEach(o=>{this.palette_256.push(o)})});let e=[0,95,135,175,215,255];for(let i=0;i<6;++i)for(let o=0;o<6;++o)for(let s=0;s<6;++s){let c={rgb:[e[i],e[o],e[s]],class_name:"truecolor"};this.palette_256.push(c)}let n=8;for(let i=0;i<24;++i,n+=10){let o={rgb:[n,n,n],class_name:"truecolor"};this.palette_256.push(o)}}escape_txt_for_html(e){return this._escape_html?e.replace(/[&<>"']/gm,n=>{if(n==="&")return"&amp;";if(n==="<")return"&lt;";if(n===">")return"&gt;";if(n==='"')return"&quot;";if(n==="'")return"&#x27;"}):e}append_buffer(e){this._buffer+=e}get_next_packet(){var e={kind:It.EOS,text:"",url:""},n=this._buffer.length;if(n==0)return e;var i=this._buffer.indexOf("\x1B");if(i==-1)return e.kind=It.Text,e.text=this._buffer,this._buffer="",e;if(i>0)return e.kind=It.Text,e.text=this._buffer.slice(0,i),this._buffer=this._buffer.slice(i),e;if(i==0){if(n<3)return e.kind=It.Incomplete,e;var o=this._buffer.charAt(1);if(o!="["&&o!="]"&&o!="(")return e.kind=It.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;if(o=="["){this._csi_regex||(this._csi_regex=kv(Q3||(Q3=gf([`
154
+ `)},...e.slice(s+1)]}return[c,...e.slice(s+1)]}function W3(e,n){let i={...e};switch(n.status){case"queued":i.interrupted=!1,i.errored=!1,i.runElapsedTimeMs=null,i.debuggerActive=!1;break;case"running":i.interrupted=!1,e.stopped&&(i.output=null),i.status==="queued"&&(i.consoleOutputs=[]),i.stopped=!1,i.runStartTimestamp=n.timestamp,i.lastRunStartTimestamp=n.timestamp;break;case"idle":e.runStartTimestamp&&(i.runElapsedTimeMs=om.fromSeconds((n.timestamp??0)-e.runStartTimestamp).toMilliseconds(),i.runStartTimestamp=null,i.staleInputs=!1),!e.lastRunStartTimestamp&&n.timestamp&&(i.lastRunStartTimestamp=n.timestamp),i.debuggerActive=!1;break;case null:break;case"disabled-transitively":break;case void 0:break;default:_s(n.status)}i.output=n.output??i.output,i.staleInputs=n.stale_inputs??i.staleInputs,i.status=n.status??i.status,i.serialization=n.serialization;let o=!1;n.output!=null&&n.output.mimetype==="application/vnd.marimo+error"&&((i.status==="queued"||i.status==="running")&&(i.status="idle"),In(Array.isArray(n.output.data),"Expected error output data to be an array"),n.output.data.some(f=>f.type==="interruption")?(i.interrupted=!0,o=!0):n.output.data.some(f=>f.type.includes("ancestor"))?i.stopped=!0:i.errored=!0);let s=e.consoleOutputs;o&&(i.debuggerActive=!1,s=s.map(f=>f.channel==="stdin"?{...f,response:f.response??""}:f));let c=n.console;c!=null&&(s=B3(Array.isArray(c)?c:[...s,c])),i.consoleOutputs=s,i.outline=Sm(i.output);let d=[n.console].flat().filter(Boolean).filter(f=>f.channel==="pdb");return d.length>0&&d.some(f=>f.data==="start")&&(i.debuggerActive=!0),i}function U3(e){let n={...e};return e.status!=="disabled-transitively"&&(n.status="queued"),n.interrupted=!1,n.errored=!1,n.runElapsedTimeMs=null,n.debuggerActive=!1,n}jh=function(e){return e==="running"||e==="queued"},o_=function(e,n){let{status:i,output:o,runStartTimestamp:s,interrupted:c,staleInputs:d}=e;if(c)return!1;if(n)return!0;let f=jh(i),p=i==="running"&&o!==null&&s!==null&&(o.timestamp??0)>s;return f&&!p?!0:d};function K3(e,n){return _D(e*1e3,n==null?void 0:n.in)}var gf=function(e,n){return Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,e},It;(function(e){e[e.EOS=0]="EOS",e[e.Text=1]="Text",e[e.Incomplete=2]="Incomplete",e[e.ESC=3]="ESC",e[e.Unknown=4]="Unknown",e[e.SGR=5]="SGR",e[e.OSCURL=6]="OSCURL"})(It||(It={})),Cm=class{constructor(){this.VERSION="6.0.6",this.setup_palettes(),this._use_classes=!1,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1,this.fg=this.bg=null,this._buffer="",this._url_allowlist={http:1,https:1},this._escape_html=!0,this.boldStyle="font-weight:bold",this.faintStyle="opacity:0.7",this.italicStyle="font-style:italic",this.underlineStyle="text-decoration:underline"}set use_classes(e){this._use_classes=e}get use_classes(){return this._use_classes}set url_allowlist(e){this._url_allowlist=e}get url_allowlist(){return this._url_allowlist}set escape_html(e){this._escape_html=e}get escape_html(){return this._escape_html}set boldStyle(e){this._boldStyle=e}get boldStyle(){return this._boldStyle}set faintStyle(e){this._faintStyle=e}get faintStyle(){return this._faintStyle}set italicStyle(e){this._italicStyle=e}get italicStyle(){return this._italicStyle}set underlineStyle(e){this._underlineStyle=e}get underlineStyle(){return this._underlineStyle}setup_palettes(){this.ansi_colors=[[{rgb:[0,0,0],class_name:"ansi-black"},{rgb:[187,0,0],class_name:"ansi-red"},{rgb:[0,187,0],class_name:"ansi-green"},{rgb:[187,187,0],class_name:"ansi-yellow"},{rgb:[0,0,187],class_name:"ansi-blue"},{rgb:[187,0,187],class_name:"ansi-magenta"},{rgb:[0,187,187],class_name:"ansi-cyan"},{rgb:[255,255,255],class_name:"ansi-white"}],[{rgb:[85,85,85],class_name:"ansi-bright-black"},{rgb:[255,85,85],class_name:"ansi-bright-red"},{rgb:[0,255,0],class_name:"ansi-bright-green"},{rgb:[255,255,85],class_name:"ansi-bright-yellow"},{rgb:[85,85,255],class_name:"ansi-bright-blue"},{rgb:[255,85,255],class_name:"ansi-bright-magenta"},{rgb:[85,255,255],class_name:"ansi-bright-cyan"},{rgb:[255,255,255],class_name:"ansi-bright-white"}]],this.palette_256=[],this.ansi_colors.forEach(i=>{i.forEach(o=>{this.palette_256.push(o)})});let e=[0,95,135,175,215,255];for(let i=0;i<6;++i)for(let o=0;o<6;++o)for(let s=0;s<6;++s){let c={rgb:[e[i],e[o],e[s]],class_name:"truecolor"};this.palette_256.push(c)}let n=8;for(let i=0;i<24;++i,n+=10){let o={rgb:[n,n,n],class_name:"truecolor"};this.palette_256.push(o)}}escape_txt_for_html(e){return this._escape_html?e.replace(/[&<>"']/gm,n=>{if(n==="&")return"&amp;";if(n==="<")return"&lt;";if(n===">")return"&gt;";if(n==='"')return"&quot;";if(n==="'")return"&#x27;"}):e}append_buffer(e){this._buffer+=e}get_next_packet(){var e={kind:It.EOS,text:"",url:""},n=this._buffer.length;if(n==0)return e;var i=this._buffer.indexOf("\x1B");if(i==-1)return e.kind=It.Text,e.text=this._buffer,this._buffer="",e;if(i>0)return e.kind=It.Text,e.text=this._buffer.slice(0,i),this._buffer=this._buffer.slice(i),e;if(i==0){if(n<3)return e.kind=It.Incomplete,e;var o=this._buffer.charAt(1);if(o!="["&&o!="]"&&o!="(")return e.kind=It.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;if(o=="["){this._csi_regex||(this._csi_regex=Cv(G3||(G3=gf([`
155
155
  ^ # beginning of line
156
156
  #
157
157
  # First attempt
@@ -185,7 +185,7 @@ mark line col
185
185
  [\\x20-\\x7e]* # anything legal
186
186
  ([\\x00-\\x1f:]) # anything illegal
187
187
  )
188
- `]))));let c=this._buffer.match(this._csi_regex);if(c===null)return e.kind=It.Incomplete,e;if(c[4])return e.kind=It.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;c[1]!=""||c[3]!="m"?e.kind=It.Unknown:e.kind=It.SGR,e.text=c[2];var s=c[0].length;return this._buffer=this._buffer.slice(s),e}else if(o=="]"){if(n<4)return e.kind=It.Incomplete,e;if(this._buffer.charAt(2)!="8"||this._buffer.charAt(3)!=";")return e.kind=It.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;this._osc_st||(this._osc_st=K3(G3||(G3=gf([`
188
+ `]))));let c=this._buffer.match(this._csi_regex);if(c===null)return e.kind=It.Incomplete,e;if(c[4])return e.kind=It.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;c[1]!=""||c[3]!="m"?e.kind=It.Unknown:e.kind=It.SGR,e.text=c[2];var s=c[0].length;return this._buffer=this._buffer.slice(s),e}else if(o=="]"){if(n<4)return e.kind=It.Incomplete,e;if(this._buffer.charAt(2)!="8"||this._buffer.charAt(3)!=";")return e.kind=It.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;this._osc_st||(this._osc_st=Q3(J3||(J3=gf([`
189
189
  (?: # legal sequence
190
190
  (\x1B) # ESC | # alternate
191
191
  (\x07) # BEL (what xterm did)
@@ -212,7 +212,7 @@ mark line col
212
212
  | # alternate
213
213
  [\\x1c-\\x1f] # anything illegal
214
214
  )
215
- `])))),this._osc_st.lastIndex=0;{let f=this._osc_st.exec(this._buffer);if(f===null)return e.kind=It.Incomplete,e;if(f[3])return e.kind=It.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e}{let f=this._osc_st.exec(this._buffer);if(f===null)return e.kind=It.Incomplete,e;if(f[3])return e.kind=It.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e}this._osc_regex||(this._osc_regex=kv(J3||(J3=gf([`
215
+ `])))),this._osc_st.lastIndex=0;{let f=this._osc_st.exec(this._buffer);if(f===null)return e.kind=It.Incomplete,e;if(f[3])return e.kind=It.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e}{let f=this._osc_st.exec(this._buffer);if(f===null)return e.kind=It.Incomplete,e;if(f[3])return e.kind=It.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e}this._osc_regex||(this._osc_regex=Cv(X3||(X3=gf([`
216
216
  ^ # beginning of line
217
217
  #
218
218
  \x1B]8; # OSC Hyperlink
@@ -248,7 +248,7 @@ mark line col
248
248
  | # alternate
249
249
  (?:\\x07) # BEL (what xterm did)
250
250
  )
251
- `]))));let c=this._buffer.match(this._osc_regex);if(c===null)return e.kind=It.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;e.kind=It.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=It.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==It.EOS||i.kind==It.Incomplete)break;i.kind==It.ESC||i.kind==It.Unknown||(i.kind==It.Text?n.push(this.transform_to_html(this.with_state(i))):i.kind==It.SGR?this.process_ansi(i):i.kind==It.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 kv(e,...n){let i=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(i)}function K3(e,...n){let i=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(i,"g")}var Q3,G3,J3,X3=new Sm;Vu=function(e){try{let n=document.createElement("div");return n.innerHTML=e,(n.textContent||n.innerText||"").split(`
251
+ `]))));let c=this._buffer.match(this._osc_regex);if(c===null)return e.kind=It.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;e.kind=It.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=It.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==It.EOS||i.kind==It.Incomplete)break;i.kind==It.ESC||i.kind==It.Unknown||(i.kind==It.Text?n.push(this.transform_to_html(this.with_state(i))):i.kind==It.SGR?this.process_ansi(i):i.kind==It.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 Cv(e,...n){let i=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(i)}function Q3(e,...n){let i=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(i,"g")}var G3,J3,X3,Y3=new Cm;Vu=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 Re.error("Error parsing HTML content:",n),e}},Iw=function(e){if(!e)return"";try{return Vu(X3.ansi_to_html(e))}catch(n){return Re.error("Error converting ANSI to plain text:",n),e}},im={startCase:e=>{if(!e)return"";if(typeof e!="string")throw Re.error(e),TypeError(`Expected string, got ${typeof e}`);return/[A-Za-z]/.test(e)?s4(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 Sv=!1;function Y3(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=im.asString(s.data),y=d?Vu(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(Cv.log),i.length===0&&Au((o=e.output)==null?void 0:o.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(c=>{Cv.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");!Sv&&s&&(Sv=!0,Il({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 Cv={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`,`[${em(e.timestamp)}]`,`(${e.cellId}) ${e.message}`)}};em=function(e){try{return U3(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},Rw=function(e,n){let i=Zu(n);i?i.focus():Re.warn(`[CellFocusManager] focusCellEditor: element not found: ${n}`)},ox=function(e){let n=document.getElementById(Zn.create(e));n?yf(n):Re.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},jw=function(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})},nm=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function yf(e){try{e.focus()}catch{Re.warn("[CellFocusManager] element may not be focusable",e)}}Xh=function(e,n){let{retries:i,delay:o,initialDelay:s=0}=n,c=0,d=()=>{if(c<i){try{if(e())return}catch(f){Re.error(`Error executing function on attempt ${c+1}, retrying`,{error:f})}c++,setTimeout(d,o)}};s>0?setTimeout(d,s):d()};function qs({cellId:e,cell:n,isCodeHidden:i,codeFocus:o,variableName:s}){var d;if(!n)return;let c=document.getElementById(Zn.create(e));if(!c){Re.warn("scrollCellIntoView: element not found");return}if(nm()){yf(c);return}if(i)yf(c);else{let f=(d=n.current)==null?void 0:d.editorView;if(!f){Re.warn("scrollCellIntoView: editor not found",e);return}if(f.hasFocus)return;if(Xh(()=>(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&&Hu(f,s)}c.scrollIntoView({behavior:"smooth",block:"nearest"})}Fw=function(e){let n=document.getElementById(Zn.create(e));if(!n){Re.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 Z3(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function eT(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}Bw=function(e){let n=Zu(e);if(n!=null&&n.hasFocus){ey(n,{behavior:"instant"});return}let i=document.getElementById(Zn.create(e));i?i.scrollIntoView({behavior:"instant",block:"nearest"}):Re.warn(`[CellFocusManager] scrollCellIntoView: element not found: ${e}`)},Mr=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 tT(e){return{hide_code:!1,disabled:!1,column:null,...e}}Pr=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 vf=Gr();function Ev(e){let n={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[Rs]:Mr({id:Rs,config:n}),...e.cellData},cellRuntime:{[Rs]:Pr(),...e.cellRuntime},cellHandles:{[Rs]:(0,At.createRef)(),...e.cellHandles}}}function nT(){return Ev({cellIds:zl.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let rT,iT,Tv;({reducer:rT,createActions:iT,useActions:Tv,valueAtom:yt}=Nl(nT,{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 L of e.cellIds.inOrderIds)if(((T=e.cellData[L])==null?void 0:T.code)===s)return e}if(i==="__end__"){let L=e.cellIds.atOrThrow(0);w=L.id,_=L.length}else if(typeof i=="string"){let L=e.cellIds.findWithId(i);w=L.id,_=L.topLevelIds.indexOf(i)}else if(i.type==="__end__"){let L=e.cellIds.get(i.columnId)||e.cellIds.atOrThrow(0);w=L.id,_=L.length}else throw Error("Invalid cellId");let C=n.newCellId||Pa.create(),E=o?_:_+1;return{...e,cellIds:e.cellIds.insertId(C,w,E),cellData:{...e.cellData,[C]:Mr({id:C,code:s,lastCodeRun:c,config:tT({hide_code:y}),lastExecutionTime:d,edited:!!s&&s!==c})},cellRuntime:{...e.cellRuntime,[C]:Pr()},cellHandles:{...e.cellHandles,[C]:(0,At.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&&Re.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"?kh(c-1,0,i.length-1):s==="after"?kh(c+1,0,i.length-1):c;let f=i.atOrThrow(d);return qs({cellId:f,cell:e.cellHandles[f],isCodeHidden:js(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 qs({cellId:i,cell:e.cellHandles[i],isCodeHidden:js(e,i),codeFocus:void 0,variableName:void 0}),eT(),e},focusBottomCell:e=>{let n=e.cellIds.getColumns().at(-1);if(n===void 0||n.length===0)return e;let i=n.last();return qs({cellId:i,cell:e.cellHandles[i],isCodeHidden:js(e,i),codeFocus:void 0,variableName:void 0}),Z3(),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=Pa.create();return{...e,cellIds:e.cellIds.addColumn(n.columnId,[i]),cellData:{...e.cellData,[i]:Mr({id:i})},cellRuntime:{...e.cellRuntime,[i]:Pr()},cellHandles:{...e.cellHandles,[i]:(0,At.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:Q4});return f.doc=e.cellData[i].code,sT(i),{...e,cellIds:e.cellIds.deleteById(i),history:[...e.history,{name:e.cellData[i].name,serializedEditorState:f,column:o.id,index:s,isSetupCell:i===gr}],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?gr:Pa.create(),f=Mr({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]:Pr()},cellHandles:{...e.cellHandles,[d]:(0,At.createRef)()},history:e.history.slice(0,-1),scrollKey:d}},clearSerializedEditorState:(e,n)=>{let{cellId:i}=n;return Fs({state:e,cellId:i,cellReducer:o=>({...o,serializedEditorState:null})})},updateCellCode:(e,n)=>{let{cellId:i,code:o,formattingChange:s}=n;return e.cellData[i]?Fs({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 Fs({state:e,cellId:i,cellReducer:s=>({...s,name:o})})},updateCellConfig:(e,n)=>{let{cellId:i,config:o}=n;return Fs({state:e,cellId:i,cellReducer:s=>({...s,config:{...s.config,...o}})})},prepareForRun:(e,n)=>Fs({state:zs({state:e,cellId:n.cellId,cellReducer:i=>W3(i)}),cellId:n.cellId,cellReducer:i=>({...i,edited:!1,lastCodeRun:i.code.trim()})}),handleCellMessage:(e,n)=>{let i=n.cell_id,o=zs({state:e,cellId:i,cellReducer:s=>$3(s,n)});return{...o,cellLogs:[...o.cellLogs,...Y3(n)]}},setCellIds:(e,n)=>{if(QR(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]=Mr({id:c})),c in e.cellRuntime||(o[c]=Pr()),c in e.cellHandles||(s[c]=(0,At.createRef)());return{...e,cellIds:zl.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 Mr({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(!lm()){let y=i.cellHandles[d].current;y!=null&&y.editorViewOrNull&&So(y.editorViewOrNull,c)}return{...s,code:c,edited:p,lastCodeRun:f}};for(let[s,c]of wx(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 zs({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}):(Re.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,Pr()]));return Ev({...e,cellIds:zl.fromIdsAndColumns(n.map(s=>[s.id,s.config.column])),cellData:i,cellRuntime:o,cellHandles:Object.fromEntries(n.map(s=>[s.id,(0,At.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=Pa.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,f),cellData:{...e.cellData,[w]:Mr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Pr()},cellHandles:{...e.cellHandles,[w]:(0,At.createRef)()},scrollKey:w}}if(y&&!s){let w=Pa.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,0),cellData:{...e.cellData,[w]:Mr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Pr()},cellHandles:{...e.cellHandles,[w]:(0,At.createRef)()},scrollKey:w}}if((p||y)&&s)return e;if(f>=0&&f<c.length){let w=c.atOrThrow(f);qs({cellId:w,cell:e.cellHandles[w],isCodeHidden:js(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 qs({cellId:s,cell:e.cellHandles[s],isCodeHidden:js(e,s),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(jx(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),unfoldAll:e=>(zx(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=bv(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=bv(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}=I3(d.editorView);So(d.editorView,f);let y=Pa.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]:Mr({id:y,code:p,edited:!!p})},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]},[y]:Pr()},cellHandles:{...e.cellHandles,[y]:(0,At.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:(So(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 zs({state:e,cellId:i,cellReducer:o=>({...o,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,n)=>{let{cellId:i}=n;return zs({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 i??(i="# Initialization code that runs before all other cells"),e.cellIds.setupCellExists()?{...e,scrollKey:gr}:{...e,cellIds:e.cellIds.insertId(gr,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[gr]:Mr({id:gr,name:gr,code:i,edited:!!i})},cellRuntime:{...e.cellRuntime,[gr]:Pr()},cellHandles:{...e.cellHandles,[gr]:(0,At.createRef)()},scrollKey:gr}}}));function js(e,n){return!!e.cellData[n].config.hide_code&&!e.untouchedNewCells.has(n)}function zs({state:e,cellId:n,cellReducer:i}){return n in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[n]:i(e.cellRuntime[n])}}:(Re.warn(`Cell ${n} not found in state`),e)}function Fs({state:e,cellId:n,cellReducer:i}){return n in e.cellData?{...e,cellData:{...e.cellData,[n]:i(e.cellData[n])}}:(Re.warn(`Cell ${n} not found in state`),e)}Y_=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})))},Xu=Be(e=>e(yt).cellIds),k_=Be(e=>e(Xu).hasOnlyOneId()),E_=Be(e=>xm(e(yt)).length>0),Be(e=>mm(e(yt)).length>0);let Rv;J_=Be(e=>bk(e(yt))),l_=Be(e=>yk(e(yt))),td=Be(e=>{let{cellIds:n,cellRuntime:i,cellData:o}=e(yt);return n.inOrderIds.map(s=>{var f;let c=i[s],{name:d}=o[s];if(Au((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)}),d_=Be(e=>{let{cellIds:n,cellRuntime:i}=e(yt);return z3(n.inOrderIds.map(o=>i[o].outline))}),W_=Be(e=>e(td).length),Rv=KR(Be(e=>{let{cellIds:n,cellData:i}=e(yt);return ci.fromEntries(n.inOrderIds.map(o=>{var s;return[o,(s=i[o])==null?void 0:s.name]}))}));var aT=Be(e=>e(yt).scrollKey);Vw=()=>Yn(yt),Ww=()=>Yn(Xu),Tw=()=>Yn(Rv),Mw=()=>Yn(td),M_=()=>Yn(yt).cellLogs,$w=()=>Yn(aT),od=()=>ct.get(yt),__=()=>{let{cellIds:e,cellData:n}=ct.get(yt);return e.inOrderIds.map(i=>{var o;return(o=n[i])==null?void 0:o.name}).filter(Boolean)};var oT=Px(Ex(yt,e=>e.cellIds.inOrderIds.map(n=>e.cellData[n])));Yw=()=>K2(oT),ax=Be(e=>mk(e(yt))),nx=Be(e=>gk(e(yt))),Gw=Be(e=>e(yt).cellIds.colLength),N_=Be(e=>e(yt).cellIds.idLength>0),j_=Be(e=>e(yt).cellIds.getColumnIds()),id=yd(e=>Be(n=>n(yt).cellData[e]));var bf=yd(e=>Be(n=>n(yt).cellRuntime[e]));const Dv=yd(e=>Be(n=>n(yt).cellHandles[e]));function sT(e){id.remove(e),bf.remove(e),Dv.remove(e)}ex=e=>{let n=(0,vf.c)(2),i;return n[0]===e?i=n[1]:(i=id(e),n[0]=e,n[1]=i),Yn(i)},O_=e=>{let n=(0,vf.c)(2),i;return n[0]===e?i=n[1]:(i=bf(e),n[0]=e,n[1]=i),Yn(i)},Pw=e=>{let n=(0,vf.c)(2),i;return n[0]===e?i=n[1]:(i=Dv(e),n[0]=e,n[1]=i),Yn(i)},wm=()=>{let{cellIds:e,cellHandles:n}=ct.get(yt);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)},Zu=e=>{var i;let{cellHandles:n}=ct.get(yt);return(i=n[e].current)==null?void 0:i.editorView},h_=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.getColumns().flatMap(s=>s.topLevelIds.map(c=>({...i[c],...o[c]})))},Q_=function(e){return Be(n=>n(yt).untouchedNewCells.has(e))};function lT(e){let n=bf(e);return Be(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(...$h(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})}Ow=function(){return Tv()}})();export{Au as $,Cw as $n,Ew as $r,qu as $t,Tw as A,bo as An,Ra as Ar,Mh as At,Rw as B,Cs as Bn,ju as Br,Dw as Bt,Ow as C,Da as Cn,zu as Cr,Lh as Ct,Pw as D,Al as Dn,ql as Dr,di as Dt,Mw as E,Lw as En,jl as Er,Fu as Et,Pr as F,Nh as Fn,Oa as Fr,Nw as Ft,Iw as G,Ih as Gn,Aw as Gr,qw as Gt,jw as H,Ah as Hn,zw as Hr,Vi as Ht,Fw as I,wo as In,zl as Ir,qh as It,jh as J,zh as Jn,Bu as Jr,Hu as Jt,Vu as K,Fh as Kn,Fl as Kr,Bh as Kt,Bw as L,$u as Ln,Hw as Lr,Hh as Lt,Vw as M,Vh as Mn,$h as Mr,Wh as Mt,$w as N,Uh as Nn,Kh as Nr,Bl as Nt,Ww as O,Qh as On,Wu as Or,Uu as Ot,Mr as P,Gh as Pn,Jh as Pr,Hl as Pt,Uw as Q,_o as Qn,Pa as Qr,Kw as Qt,Xh as R,Yh as Rn,Zh as Rr,Qw as Rt,Gw as S,Jw as Sn,xo as Sr,Xw as St,Yw as T,Ku as Tn,Vl as Tr,Zw as Tt,em as U,tm as Un,Es as Ur,$l as Ut,nm as V,rm as Vn,Ts as Vr,e_ as Vt,im as W,am as Wn,$n as Wr,t_ as Wt,om as X,n_ as Xn,r_ as Xr,Qu as Xt,i_ as Y,sm as Yn,a_ as Yr,o_ as Yt,lm as Z,Gu as Zn,cm as Zr,s_ as Zt,l_ as _,ID as __tla,Ju as _n,um as _r,Wl as _t,Xu as a,dm as ai,Ul as an,c_ as ar,u_ as at,d_ as b,f_ as bn,Yu as br,p_ as bt,h_ as c,fm as ci,m_ as cn,g_ as cr,y_ as ct,Zu as d,v_ as dn,ko as dr,pm as dt,Zn as ei,ed as en,b_ as er,w_ as et,__ as f,Kl as fn,Dt as fr,x_ as ft,k_ as g,S_ as gn,C_ as gr,hm as gt,E_ as h,Ma as hn,mm as hr,gm as ht,td as i,T_ as ii,R_ as in,D_ as ir,So as it,O_ as j,ym as jn,P_ as jr,vm as jt,M_ as k,bm as kn,Ql as kr,nd as kt,wm as l,_m as li,Gl as ln,L_ as lr,rd as lt,N_ as m,I_ as mn,xm as mr,A_ as mt,id as n,gr as ni,q_ as nn,ad as nr,km as nt,j_ as o,z_ as oi,F_ as on,B_ as or,H_ as ot,od as p,V_ as pn,La as pr,$_ as pt,Sm as q,Cm as qn,Jl as qr,Em as qt,W_ as r,sd as ri,U_ as rn,K_ as rr,Jr as rt,Q_ as s,G_ as si,ld as sn,Xl as sr,Lr as st,J_ as t,Rs as ti,cd as tn,X_ as tr,Tm as tt,Y_ as u,ud as ui,Rm as un,$i as ur,Dm as ut,yt as v,Om as vn,Z_ as vr,yr as vt,ex as w,tx as wn,Pm as wr,Mm as wt,nx as x,dd as xn,rx as xr,ix as xt,ax as y,Yl as yn,Lm as yr,fd as yt,ox as z,pd as zn,sx as zr,lx as zt};
253
+ `)}catch(n){return Re.error("Error parsing HTML content:",n),e}},qw=function(e){if(!e)return"";try{return Vu(Y3.ansi_to_html(e))}catch(n){return Re.error("Error converting ANSI to plain text:",n),e}},im={startCase:e=>{if(!e)return"";if(typeof e!="string")throw Re.error(e),TypeError(`Expected string, got ${typeof e}`);return/[A-Za-z]/.test(e)?l4(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 Ev=!1;function Z3(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=im.asString(s.data),y=d?Vu(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(Tv.log),i.length===0&&Au((o=e.output)==null?void 0:o.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(c=>{Tv.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");!Ev&&s&&(Ev=!0,Il({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 Tv={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`,`[${em(e.timestamp)}]`,`(${e.cellId}) ${e.message}`)}};em=function(e){try{return K3(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},Ow=function(e,n){let i=Zu(n);i?i.focus():Re.warn(`[CellFocusManager] focusCellEditor: element not found: ${n}`)},sx=function(e){let n=document.getElementById(Zn.create(e));n?yf(n):Re.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},Fw=function(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})},nm=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function yf(e){try{e.focus()}catch{Re.warn("[CellFocusManager] element may not be focusable",e)}}Xh=function(e,n){let{retries:i,delay:o,initialDelay:s=0}=n,c=0,d=()=>{if(c<i){try{if(e())return}catch(f){Re.error(`Error executing function on attempt ${c+1}, retrying`,{error:f})}c++,setTimeout(d,o)}};s>0?setTimeout(d,s):d()};function qs({cellId:e,cell:n,isCodeHidden:i,codeFocus:o,variableName:s}){var d;if(!n)return;let c=document.getElementById(Zn.create(e));if(!c){Re.warn("scrollCellIntoView: element not found");return}if(nm()){yf(c);return}if(i)yf(c);else{let f=(d=n.current)==null?void 0:d.editorView;if(!f){Re.warn("scrollCellIntoView: editor not found",e);return}if(f.hasFocus)return;if(Xh(()=>(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&&Hu(f,s)}c.scrollIntoView({behavior:"smooth",block:"nearest"})}Hw=function(e){let n=document.getElementById(Zn.create(e));if(!n){Re.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 eT(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function tT(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}Vw=function(e){let n=Zu(e);if(n!=null&&n.hasFocus){ty(n,{behavior:"instant"});return}let i=document.getElementById(Zn.create(e));i?i.scrollIntoView({behavior:"instant",block:"nearest"}):Re.warn(`[CellFocusManager] scrollCellIntoView: element not found: ${e}`)},Mr=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 nT(e){return{hide_code:!1,disabled:!1,column:null,...e}}Pr=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 vf=Gr();function Rv(e){let n={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[Rs]:Mr({id:Rs,config:n}),...e.cellData},cellRuntime:{[Rs]:Pr(),...e.cellRuntime},cellHandles:{[Rs]:(0,At.createRef)(),...e.cellHandles}}}function rT(){return Rv({cellIds:zl.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let iT,aT,Dv;({reducer:iT,createActions:aT,useActions:Dv,valueAtom:yt}=Nl(rT,{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 L of e.cellIds.inOrderIds)if(((T=e.cellData[L])==null?void 0:T.code)===s)return e}if(i==="__end__"){let L=e.cellIds.atOrThrow(0);w=L.id,_=L.length}else if(typeof i=="string"){let L=e.cellIds.findWithId(i);w=L.id,_=L.topLevelIds.indexOf(i)}else if(i.type==="__end__"){let L=e.cellIds.get(i.columnId)||e.cellIds.atOrThrow(0);w=L.id,_=L.length}else throw Error("Invalid cellId");let C=n.newCellId||Pa.create(),E=o?_:_+1;return{...e,cellIds:e.cellIds.insertId(C,w,E),cellData:{...e.cellData,[C]:Mr({id:C,code:s,lastCodeRun:c,config:nT({hide_code:y}),lastExecutionTime:d,edited:!!s&&s!==c})},cellRuntime:{...e.cellRuntime,[C]:Pr()},cellHandles:{...e.cellHandles,[C]:(0,At.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&&Re.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"?kh(c-1,0,i.length-1):s==="after"?kh(c+1,0,i.length-1):c;let f=i.atOrThrow(d);return qs({cellId:f,cell:e.cellHandles[f],isCodeHidden:js(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 qs({cellId:i,cell:e.cellHandles[i],isCodeHidden:js(e,i),codeFocus:void 0,variableName:void 0}),tT(),e},focusBottomCell:e=>{let n=e.cellIds.getColumns().at(-1);if(n===void 0||n.length===0)return e;let i=n.last();return qs({cellId:i,cell:e.cellHandles[i],isCodeHidden:js(e,i),codeFocus:void 0,variableName:void 0}),eT(),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=Pa.create();return{...e,cellIds:e.cellIds.addColumn(n.columnId,[i]),cellData:{...e.cellData,[i]:Mr({id:i})},cellRuntime:{...e.cellRuntime,[i]:Pr()},cellHandles:{...e.cellHandles,[i]:(0,At.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:G4});return f.doc=e.cellData[i].code,lT(i),{...e,cellIds:e.cellIds.deleteById(i),history:[...e.history,{name:e.cellData[i].name,serializedEditorState:f,column:o.id,index:s,isSetupCell:i===gr}],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?gr:Pa.create(),f=Mr({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]:Pr()},cellHandles:{...e.cellHandles,[d]:(0,At.createRef)()},history:e.history.slice(0,-1),scrollKey:d}},clearSerializedEditorState:(e,n)=>{let{cellId:i}=n;return Fs({state:e,cellId:i,cellReducer:o=>({...o,serializedEditorState:null})})},updateCellCode:(e,n)=>{let{cellId:i,code:o,formattingChange:s}=n;return e.cellData[i]?Fs({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 Fs({state:e,cellId:i,cellReducer:s=>({...s,name:o})})},updateCellConfig:(e,n)=>{let{cellId:i,config:o}=n;return Fs({state:e,cellId:i,cellReducer:s=>({...s,config:{...s.config,...o}})})},prepareForRun:(e,n)=>Fs({state:zs({state:e,cellId:n.cellId,cellReducer:i=>U3(i)}),cellId:n.cellId,cellReducer:i=>({...i,edited:!1,lastCodeRun:i.code.trim()})}),handleCellMessage:(e,n)=>{let i=n.cell_id,o=zs({state:e,cellId:i,cellReducer:s=>W3(s,n)});return{...o,cellLogs:[...o.cellLogs,...Z3(n)]}},setCellIds:(e,n)=>{if(GR(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]=Mr({id:c})),c in e.cellRuntime||(o[c]=Pr()),c in e.cellHandles||(s[c]=(0,At.createRef)());return{...e,cellIds:zl.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 Mr({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(!lm()){let y=i.cellHandles[d].current;y!=null&&y.editorViewOrNull&&So(y.editorViewOrNull,c)}return{...s,code:c,edited:p,lastCodeRun:f}};for(let[s,c]of _x(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 zs({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}):(Re.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,Pr()]));return Rv({...e,cellIds:zl.fromIdsAndColumns(n.map(s=>[s.id,s.config.column])),cellData:i,cellRuntime:o,cellHandles:Object.fromEntries(n.map(s=>[s.id,(0,At.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=Pa.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,f),cellData:{...e.cellData,[w]:Mr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Pr()},cellHandles:{...e.cellHandles,[w]:(0,At.createRef)()},scrollKey:w}}if(y&&!s){let w=Pa.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,0),cellData:{...e.cellData,[w]:Mr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Pr()},cellHandles:{...e.cellHandles,[w]:(0,At.createRef)()},scrollKey:w}}if((p||y)&&s)return e;if(f>=0&&f<c.length){let w=c.atOrThrow(f);qs({cellId:w,cell:e.cellHandles[w],isCodeHidden:js(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 qs({cellId:s,cell:e.cellHandles[s],isCodeHidden:js(e,s),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(zx(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),unfoldAll:e=>(Fx(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=_v(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=_v(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}=A3(d.editorView);So(d.editorView,f);let y=Pa.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]:Mr({id:y,code:p,edited:!!p})},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]},[y]:Pr()},cellHandles:{...e.cellHandles,[y]:(0,At.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:(So(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 zs({state:e,cellId:i,cellReducer:o=>({...o,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,n)=>{let{cellId:i}=n;return zs({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 i??(i="# Initialization code that runs before all other cells"),e.cellIds.setupCellExists()?{...e,scrollKey:gr}:{...e,cellIds:e.cellIds.insertId(gr,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[gr]:Mr({id:gr,name:gr,code:i,edited:!!i})},cellRuntime:{...e.cellRuntime,[gr]:Pr()},cellHandles:{...e.cellHandles,[gr]:(0,At.createRef)()},scrollKey:gr}}}));function js(e,n){return!!e.cellData[n].config.hide_code&&!e.untouchedNewCells.has(n)}function zs({state:e,cellId:n,cellReducer:i}){return n in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[n]:i(e.cellRuntime[n])}}:(Re.warn(`Cell ${n} not found in state`),e)}function Fs({state:e,cellId:n,cellReducer:i}){return n in e.cellData?{...e,cellData:{...e.cellData,[n]:i(e.cellData[n])}}:(Re.warn(`Cell ${n} not found in state`),e)}Z_=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})))},Xu=Be(e=>e(yt).cellIds),C_=Be(e=>e(Xu).hasOnlyOneId()),R_=Be(e=>xm(e(yt)).length>0),Be(e=>mm(e(yt)).length>0);let Ov;X_=Be(e=>wk(e(yt))),u_=Be(e=>vk(e(yt))),td=Be(e=>{let{cellIds:n,cellRuntime:i,cellData:o}=e(yt);return n.inOrderIds.map(s=>{var f;let c=i[s],{name:d}=o[s];if(Au((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)}),p_=Be(e=>{let{cellIds:n,cellRuntime:i}=e(yt);return F3(n.inOrderIds.map(o=>i[o].outline))}),U_=Be(e=>e(td).length),Ov=QR(Be(e=>{let{cellIds:n,cellData:i}=e(yt);return ci.fromEntries(n.inOrderIds.map(o=>{var s;return[o,(s=i[o])==null?void 0:s.name]}))}));var oT=Be(e=>e(yt).scrollKey);Ww=()=>Yn(yt),Kw=()=>Yn(Xu),Dw=()=>Yn(Ov),Nw=()=>Yn(td),N_=()=>Yn(yt).cellLogs,Uw=()=>Yn(oT),od=()=>st.get(yt),k_=()=>{let{cellIds:e,cellData:n}=st.get(yt);return e.inOrderIds.map(i=>{var o;return(o=n[i])==null?void 0:o.name}).filter(Boolean)};var sT=Mx(Tx(yt,e=>e.cellIds.inOrderIds.map(n=>e.cellData[n])));e_=()=>G2(sT),ox=Be(e=>gk(e(yt))),rx=Be(e=>yk(e(yt))),Xw=Be(e=>e(yt).cellIds.colLength),A_=Be(e=>e(yt).cellIds.idLength>0),z_=Be(e=>e(yt).cellIds.getColumnIds()),id=yd(e=>Be(n=>n(yt).cellData[e]));var bf=yd(e=>Be(n=>n(yt).cellRuntime[e]));const Pv=yd(e=>Be(n=>n(yt).cellHandles[e]));function lT(e){id.remove(e),bf.remove(e),Pv.remove(e)}tx=e=>{let n=(0,vf.c)(2),i;return n[0]===e?i=n[1]:(i=id(e),n[0]=e,n[1]=i),Yn(i)},M_=e=>{let n=(0,vf.c)(2),i;return n[0]===e?i=n[1]:(i=bf(e),n[0]=e,n[1]=i),Yn(i)},Lw=e=>{let n=(0,vf.c)(2),i;return n[0]===e?i=n[1]:(i=Pv(e),n[0]=e,n[1]=i),Yn(i)},wm=()=>{let{cellIds:e,cellHandles:n}=st.get(yt);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)},Zu=e=>{var i;let{cellHandles:n}=st.get(yt);return(i=n[e].current)==null?void 0:i.editorView},g_=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.getColumns().flatMap(s=>s.topLevelIds.map(c=>({...i[c],...o[c]})))},G_=function(e){return Be(n=>n(yt).untouchedNewCells.has(e))};function cT(e){let n=bf(e);return Be(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(...$h(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})}Mw=function(){return Dv()}})();export{Au as $,Tw as $n,Rw as $r,qu as $t,Dw as A,bo as An,Ra as Ar,Mh as At,Ow as B,Cs as Bn,ju as Br,Pw as Bt,Mw as C,Da as Cn,zu as Cr,Lh as Ct,Lw as D,Al as Dn,ql as Dr,di as Dt,Nw as E,Iw as En,jl as Er,Fu as Et,Pr as F,Nh as Fn,Oa as Fr,Aw as Ft,qw as G,Ih as Gn,jw as Gr,zw as Gt,Fw as H,Ah as Hn,Bw as Hr,Vi as Ht,Hw as I,wo as In,zl as Ir,qh as It,jh as J,zh as Jn,Bu as Jr,Hu as Jt,Vu as K,Fh as Kn,Fl as Kr,Bh as Kt,Vw as L,$u as Ln,$w as Lr,Hh as Lt,Ww as M,Vh as Mn,$h as Mr,Wh as Mt,Uw as N,Uh as Nn,Kh as Nr,Bl as Nt,Kw as O,Qh as On,Wu as Or,Uu as Ot,Mr as P,Gh as Pn,Jh as Pr,Hl as Pt,Qw as Q,_o as Qn,Pa as Qr,Gw as Qt,Xh as R,Yh as Rn,Zh as Rr,Jw as Rt,Xw as S,Yw as Sn,xo as Sr,Zw as St,e_ as T,Ku as Tn,Vl as Tr,t_ as Tt,em as U,tm as Un,Es as Ur,$l as Ut,nm as V,rm as Vn,Ts as Vr,n_ as Vt,im as W,am as Wn,$n as Wr,r_ as Wt,om as X,i_ as Xn,a_ as Xr,Qu as Xt,o_ as Y,sm as Yn,s_ as Yr,l_ as Yt,lm as Z,Gu as Zn,cm as Zr,c_ as Zt,u_ as _,AD as __tla,Ju as _n,um as _r,Wl as _t,Xu as a,dm as ai,Ul as an,d_ as ar,f_ as at,p_ as b,h_ as bn,Yu as br,m_ as bt,g_ as c,fm as ci,y_ as cn,v_ as cr,b_ as ct,Zu as d,w_ as dn,ko as dr,pm as dt,Zn as ei,ed as en,__ as er,x_ as et,k_ as f,Kl as fn,Dt as fr,S_ as ft,C_ as g,E_ as gn,T_ as gr,hm as gt,R_ as h,Ma as hn,mm as hr,gm as ht,td as i,D_ as ii,O_ as in,P_ as ir,So as it,M_ as j,ym as jn,L_ as jr,vm as jt,N_ as k,bm as kn,Ql as kr,nd as kt,wm as l,_m as li,Gl as ln,I_ as lr,rd as lt,A_ as m,q_ as mn,xm as mr,j_ as mt,id as n,gr as ni,km as nn,ad as nr,Sm as nt,z_ as o,F_ as oi,B_ as on,H_ as or,V_ as ot,od as p,$_ as pn,La as pr,W_ as pt,Cm as q,Em as qn,Jl as qr,Tm as qt,U_ as r,sd as ri,K_ as rn,Q_ as rr,Jr as rt,G_ as s,J_ as si,ld as sn,Xl as sr,Lr as st,X_ as t,Rs as ti,cd as tn,Y_ as tr,Rm as tt,Z_ as u,ud as ui,Dm as un,$i as ur,Om as ut,yt as v,Pm as vn,ex as vr,yr as vt,tx as w,nx as wn,Mm as wr,Lm as wt,rx as x,dd as xn,ix as xr,ax as xt,ox as y,Yl as yn,Nm as yr,fd as yt,sx as z,pd as zn,lx as zr,cx as zt};