polydiff 0.1.1 → 0.1.2

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 (80) hide show
  1. package/README.md +30 -78
  2. package/dist/assets/{angular-html-ezhpupwN.js → angular-html-C76KiGzD.js} +1 -1
  3. package/dist/assets/{angular-ts-DGkBU2Ac.js → angular-ts-BD3Mnzbu.js} +1 -1
  4. package/dist/assets/{apl-CUGT4nIi.js → apl-DnigSV4a.js} +1 -1
  5. package/dist/assets/{astro-C6f9OliD.js → astro-qsSokj8B.js} +1 -1
  6. package/dist/assets/{blade-71nbYGOJ.js → blade-U2J3SHwq.js} +1 -1
  7. package/dist/assets/{c-Bpp83vUT.js → c-Cy48DBYM.js} +1 -1
  8. package/dist/assets/{chapel-ASdwSMh4.js → chapel-DU0nbvcT.js} +1 -1
  9. package/dist/assets/{cobol-DNxuGELk.js → cobol-APxYRU6S.js} +1 -1
  10. package/dist/assets/{coffee-CTyXBUCJ.js → coffee-CMVtIQ8B.js} +1 -1
  11. package/dist/assets/{cpp-CzJZfqV4.js → cpp-DiEjTdBd.js} +1 -1
  12. package/dist/assets/{crystal-BfqQdHxV.js → crystal-_rYX393W.js} +1 -1
  13. package/dist/assets/{css-DlfMUpGK.js → css-BtU1DKpW.js} +1 -1
  14. package/dist/assets/{edge-ZaCA-9tU.js → edge-Br4ksFXa.js} +1 -1
  15. package/dist/assets/{elixir-GeIrO3JP.js → elixir-Bv_4y_zG.js} +1 -1
  16. package/dist/assets/{elm-BetcOCtl.js → elm-Cx-dMND_.js} +1 -1
  17. package/dist/assets/{erb-Dru309ol.js → erb-COPrSViz.js} +1 -1
  18. package/dist/assets/{git-rebase-DJIWyVXc.js → git-rebase-D4D90lTW.js} +1 -1
  19. package/dist/assets/{glimmer-js-DIqXjYAY.js → glimmer-js-C4gWrPQL.js} +1 -1
  20. package/dist/assets/{glimmer-ts-pnunO5g0.js → glimmer-ts-C99h3W7n.js} +1 -1
  21. package/dist/assets/{glsl-DWspuWDC.js → glsl-RHBJe3ld.js} +1 -1
  22. package/dist/assets/{graphql-DjZ79Z4P.js → graphql-BPqUaGZt.js} +1 -1
  23. package/dist/assets/{hack-iafWRwwB.js → hack-99V0ltvY.js} +1 -1
  24. package/dist/assets/{haml-o-Lgpxml.js → haml-xERa5XyT.js} +1 -1
  25. package/dist/assets/{handlebars-C8OUH7g6.js → handlebars-MxX_GTuw.js} +1 -1
  26. package/dist/assets/{html-CJzu28V2.js → html-DQ9PwQ1m.js} +1 -1
  27. package/dist/assets/{html-derivative-Cb8okpVc.js → html-derivative-Da9qILg2.js} +1 -1
  28. package/dist/assets/{http-ttaoWHS4.js → http-BuqmB53K.js} +1 -1
  29. package/dist/assets/{hurl-DzAr45rI.js → hurl-XOQLnEit.js} +1 -1
  30. package/dist/assets/{index-CGIYnoUG.js → index-CB-nNij5.js} +3 -3
  31. package/dist/assets/{java-B9M8FiDh.js → java-UC978eZQ.js} +1 -1
  32. package/dist/assets/{javascript-DsgDiit9.js → javascript-Cd1RGTih.js} +1 -1
  33. package/dist/assets/{jinja-BpB_f_L5.js → jinja-BHqpe9-0.js} +1 -1
  34. package/dist/assets/{jison-BBboHJLm.js → jison-CyfJfEgg.js} +1 -1
  35. package/dist/assets/{json-CjLBqelG.js → json-DaP6JbRl.js} +1 -1
  36. package/dist/assets/{jsx-B86puyK5.js → jsx-Cssoyj6k.js} +1 -1
  37. package/dist/assets/{julia-Dx4irgay.js → julia-BjB65CXm.js} +1 -1
  38. package/dist/assets/{just-BaU8BkWf.js → just-D2b48Zu1.js} +1 -1
  39. package/dist/assets/{latex-OCFtPaVb.js → latex-8j1UKNrn.js} +1 -1
  40. package/dist/assets/{liquid-B-HSosSR.js → liquid-D5v7uHS3.js} +1 -1
  41. package/dist/assets/{lua-DmtpgLJe.js → lua-BkDLRwYN.js} +1 -1
  42. package/dist/assets/{marko-DLvj6HlY.js → marko-CDSu0yiU.js} +1 -1
  43. package/dist/assets/{mdc-CLlpDeEH.js → mdc-DlSfqxlb.js} +1 -1
  44. package/dist/assets/{nginx-B6eJiJtn.js → nginx-DO1j2OMH.js} +1 -1
  45. package/dist/assets/{nim-BjTTIyjo.js → nim-DW4cM62z.js} +1 -1
  46. package/dist/assets/{org-BbxkHpL7.js → org-BAp2JzOV.js} +1 -1
  47. package/dist/assets/{perl-7YBielDt.js → perl-DB9IU3wX.js} +1 -1
  48. package/dist/assets/{php--KPClthN.js → php-DXrf_D3v.js} +1 -1
  49. package/dist/assets/{pug-C7XMl1L8.js → pug-Bs1r0pSU.js} +1 -1
  50. package/dist/assets/{qml-CN9HGHWl.js → qml-Doo9Cky4.js} +1 -1
  51. package/dist/assets/{r-BR7Z2WHy.js → r-VQJF91wR.js} +1 -1
  52. package/dist/assets/{razor-C6ePkXhR.js → razor-Dk2kv2By.js} +1 -1
  53. package/dist/assets/{regexp-4j9D_ZJm.js → regexp-GqRnLewn.js} +1 -1
  54. package/dist/assets/{rst-DnVZxVCG.js → rst-C6ecNsTn.js} +1 -1
  55. package/dist/assets/{ruby-CcELT3hw.js → ruby-BabyW0G3.js} +1 -1
  56. package/dist/assets/{sas-C0OZEEpB.js → sas-Cp-D0gCy.js} +1 -1
  57. package/dist/assets/{scss-CsORv0BP.js → scss-CLMXRvFR.js} +1 -1
  58. package/dist/assets/{shellscript-BTztjGqL.js → shellscript-GvcLJj0i.js} +1 -1
  59. package/dist/assets/{shellsession-Cl0t6nbx.js → shellsession-KR2Dmt63.js} +1 -1
  60. package/dist/assets/{soy-Dlpwi8rU.js → soy-U6NbpSMz.js} +1 -1
  61. package/dist/assets/{sql-Dea5cDqJ.js → sql-DktaOtqw.js} +1 -1
  62. package/dist/assets/{stata-CI6WIEjb.js → stata-yvKR4kbi.js} +1 -1
  63. package/dist/assets/{surrealql-CMQ8lmEG.js → surrealql-B171yI6F.js} +1 -1
  64. package/dist/assets/{svelte-CL7YYnWK.js → svelte-B_bXEc_n.js} +1 -1
  65. package/dist/assets/{templ-BeZbGaJP.js → templ-tqWE5SlP.js} +1 -1
  66. package/dist/assets/{tex-BSS8Q45r.js → tex-B6G2B11r.js} +1 -1
  67. package/dist/assets/{ts-tags-BBdnNf-a.js → ts-tags-D5u9DmEU.js} +1 -1
  68. package/dist/assets/{tsx-c1m_nKLG.js → tsx-CTl-K_ZZ.js} +1 -1
  69. package/dist/assets/{twig-psqnv4mB.js → twig-BUTDHjkY.js} +1 -1
  70. package/dist/assets/{typescript-ByR3P8c1.js → typescript-CYAHNX2C.js} +1 -1
  71. package/dist/assets/{typst-Dg-RDIXz.js → typst-Bio4TaT2.js} +1 -1
  72. package/dist/assets/{vue-DbsvoIfv.js → vue-B-YWRyzE.js} +1 -1
  73. package/dist/assets/{vue-html-n7sDnKkW.js → vue-html-Cb0eicOD.js} +1 -1
  74. package/dist/assets/{vue-vine-CUhVSAxO.js → vue-vine-DxrdWx_w.js} +1 -1
  75. package/dist/assets/{xml-mUdjR8gR.js → xml-B2i4V3Dl.js} +1 -1
  76. package/dist/assets/{xsl-vKBVy2ER.js → xsl-Cys3IUoN.js} +1 -1
  77. package/dist/assets/{yaml-BGDRkaBQ.js → yaml-CedrTYT2.js} +1 -1
  78. package/dist/index.html +1 -1
  79. package/package.json +5 -4
  80. package/server/git.mjs +1 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-ezhpupwN.js","assets/html-CJzu28V2.js","assets/javascript-DsgDiit9.js","assets/css-DlfMUpGK.js","assets/angular-ts-DGkBU2Ac.js","assets/scss-CsORv0BP.js","assets/apl-CUGT4nIi.js","assets/xml-mUdjR8gR.js","assets/java-B9M8FiDh.js","assets/json-CjLBqelG.js","assets/astro-C6f9OliD.js","assets/typescript-ByR3P8c1.js","assets/postcss-BXeXVLqQ.js","assets/tsx-c1m_nKLG.js","assets/blade-71nbYGOJ.js","assets/html-derivative-Cb8okpVc.js","assets/sql-Dea5cDqJ.js","assets/bsl-_VjlB9mv.js","assets/sdbl-bTVj8UrX.js","assets/cairo-DLTphjLi.js","assets/python-gzcpVVnB.js","assets/chapel-ASdwSMh4.js","assets/c-Bpp83vUT.js","assets/cobol-DNxuGELk.js","assets/coffee-CTyXBUCJ.js","assets/cpp-CzJZfqV4.js","assets/regexp-4j9D_ZJm.js","assets/glsl-DWspuWDC.js","assets/crystal-BfqQdHxV.js","assets/shellscript-BTztjGqL.js","assets/edge-ZaCA-9tU.js","assets/elixir-GeIrO3JP.js","assets/elm-BetcOCtl.js","assets/erb-Dru309ol.js","assets/ruby-CcELT3hw.js","assets/haml-o-Lgpxml.js","assets/graphql-DjZ79Z4P.js","assets/jsx-B86puyK5.js","assets/lua-DmtpgLJe.js","assets/yaml-BGDRkaBQ.js","assets/erlang-Cphh6RMH.js","assets/markdown-BYOwaDjH.js","assets/fortran-fixed-form-DEKoE2YW.js","assets/fortran-free-form-CYNrtFtB.js","assets/fsharp-D13ZGOAj.js","assets/gdresource-xMC7jr7x.js","assets/gdshader-CBce3t8t.js","assets/gdscript-DYvRD3hg.js","assets/git-commit-BSykSTBG.js","assets/diff-woXpYk--.js","assets/git-rebase-DJIWyVXc.js","assets/glimmer-js-DIqXjYAY.js","assets/glimmer-ts-pnunO5g0.js","assets/hack-iafWRwwB.js","assets/handlebars-C8OUH7g6.js","assets/http-ttaoWHS4.js","assets/hurl-DzAr45rI.js","assets/csv-Dx-8-gkx.js","assets/hxml-Dcm88srW.js","assets/haxe-C8oCnwJJ.js","assets/jinja-BpB_f_L5.js","assets/jison-BBboHJLm.js","assets/julia-Dx4irgay.js","assets/r-BR7Z2WHy.js","assets/just-BaU8BkWf.js","assets/perl-7YBielDt.js","assets/latex-OCFtPaVb.js","assets/tex-BSS8Q45r.js","assets/liquid-B-HSosSR.js","assets/marko-DLvj6HlY.js","assets/less-DVTAwKKz.js","assets/mdc-CLlpDeEH.js","assets/nextflow-BJtWHP5T.js","assets/nextflow-groovy-DJMQeKeT.js","assets/nginx-B6eJiJtn.js","assets/nim-BjTTIyjo.js","assets/org-BbxkHpL7.js","assets/clojure-DqKBuwfJ.js","assets/csharp-oqKa8noW.js","assets/dart-CnvKMtbv.js","assets/docker-IyjqRm3v.js","assets/go-rLFTqkRN.js","assets/groovy-CacY0gHj.js","assets/ini-B5eOa1yu.js","assets/make-Dixweg8N.js","assets/objective-c-D1A_Heim.js","assets/ocaml-O90oeIOV.js","assets/php--KPClthN.js","assets/vb-DOwzaHZ0.js","assets/raku-B3gFvitq.js","assets/rust-Cfkwpbl8.js","assets/scala-BiFt_7mu.js","assets/zig-CMLA9XwU.js","assets/xsl-vKBVy2ER.js","assets/pug-C7XMl1L8.js","assets/qml-CN9HGHWl.js","assets/razor-C6ePkXhR.js","assets/rst-DnVZxVCG.js","assets/cmake-Bj61d0ZC.js","assets/sas-C0OZEEpB.js","assets/shaderlab-TOUzSsQk.js","assets/hlsl-Cvrh5tZx.js","assets/shellsession-Cl0t6nbx.js","assets/soy-Dlpwi8rU.js","assets/sparql-D_iOobhT.js","assets/turtle-ByJddavk.js","assets/stata-CI6WIEjb.js","assets/surrealql-CMQ8lmEG.js","assets/svelte-CL7YYnWK.js","assets/templ-BeZbGaJP.js","assets/ts-tags-BBdnNf-a.js","assets/twig-psqnv4mB.js","assets/typst-Dg-RDIXz.js","assets/bat-qdxAdBWQ.js","assets/bibtex-Ci_nEsc7.js","assets/jsonc-CYpm1nAK.js","assets/log-BNLmms1o.js","assets/powershell-CCSX75yM.js","assets/swift-CyEgAFGc.js","assets/system-verilog-Dh5ihWbf.js","assets/verilog-B2gwz-sJ.js","assets/vue-DbsvoIfv.js","assets/vue-html-n7sDnKkW.js","assets/vue-vine-CUhVSAxO.js","assets/stylus-B6D30XZt.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-C76KiGzD.js","assets/html-DQ9PwQ1m.js","assets/javascript-Cd1RGTih.js","assets/css-BtU1DKpW.js","assets/angular-ts-BD3Mnzbu.js","assets/scss-CLMXRvFR.js","assets/apl-DnigSV4a.js","assets/xml-B2i4V3Dl.js","assets/java-UC978eZQ.js","assets/json-DaP6JbRl.js","assets/astro-qsSokj8B.js","assets/typescript-CYAHNX2C.js","assets/postcss-BXeXVLqQ.js","assets/tsx-CTl-K_ZZ.js","assets/blade-U2J3SHwq.js","assets/html-derivative-Da9qILg2.js","assets/sql-DktaOtqw.js","assets/bsl-_VjlB9mv.js","assets/sdbl-bTVj8UrX.js","assets/cairo-DLTphjLi.js","assets/python-gzcpVVnB.js","assets/chapel-DU0nbvcT.js","assets/c-Cy48DBYM.js","assets/cobol-APxYRU6S.js","assets/coffee-CMVtIQ8B.js","assets/cpp-DiEjTdBd.js","assets/regexp-GqRnLewn.js","assets/glsl-RHBJe3ld.js","assets/crystal-_rYX393W.js","assets/shellscript-GvcLJj0i.js","assets/edge-Br4ksFXa.js","assets/elixir-Bv_4y_zG.js","assets/elm-Cx-dMND_.js","assets/erb-COPrSViz.js","assets/ruby-BabyW0G3.js","assets/haml-xERa5XyT.js","assets/graphql-BPqUaGZt.js","assets/jsx-Cssoyj6k.js","assets/lua-BkDLRwYN.js","assets/yaml-CedrTYT2.js","assets/erlang-Cphh6RMH.js","assets/markdown-BYOwaDjH.js","assets/fortran-fixed-form-DEKoE2YW.js","assets/fortran-free-form-CYNrtFtB.js","assets/fsharp-D13ZGOAj.js","assets/gdresource-xMC7jr7x.js","assets/gdshader-CBce3t8t.js","assets/gdscript-DYvRD3hg.js","assets/git-commit-BSykSTBG.js","assets/diff-woXpYk--.js","assets/git-rebase-D4D90lTW.js","assets/glimmer-js-C4gWrPQL.js","assets/glimmer-ts-C99h3W7n.js","assets/hack-99V0ltvY.js","assets/handlebars-MxX_GTuw.js","assets/http-BuqmB53K.js","assets/hurl-XOQLnEit.js","assets/csv-Dx-8-gkx.js","assets/hxml-Dcm88srW.js","assets/haxe-C8oCnwJJ.js","assets/jinja-BHqpe9-0.js","assets/jison-CyfJfEgg.js","assets/julia-BjB65CXm.js","assets/r-VQJF91wR.js","assets/just-D2b48Zu1.js","assets/perl-DB9IU3wX.js","assets/latex-8j1UKNrn.js","assets/tex-B6G2B11r.js","assets/liquid-D5v7uHS3.js","assets/marko-CDSu0yiU.js","assets/less-DVTAwKKz.js","assets/mdc-DlSfqxlb.js","assets/nextflow-BJtWHP5T.js","assets/nextflow-groovy-DJMQeKeT.js","assets/nginx-DO1j2OMH.js","assets/nim-DW4cM62z.js","assets/org-BAp2JzOV.js","assets/clojure-DqKBuwfJ.js","assets/csharp-oqKa8noW.js","assets/dart-CnvKMtbv.js","assets/docker-IyjqRm3v.js","assets/go-rLFTqkRN.js","assets/groovy-CacY0gHj.js","assets/ini-B5eOa1yu.js","assets/make-Dixweg8N.js","assets/objective-c-D1A_Heim.js","assets/ocaml-O90oeIOV.js","assets/php-DXrf_D3v.js","assets/vb-DOwzaHZ0.js","assets/raku-B3gFvitq.js","assets/rust-Cfkwpbl8.js","assets/scala-BiFt_7mu.js","assets/zig-CMLA9XwU.js","assets/xsl-Cys3IUoN.js","assets/pug-Bs1r0pSU.js","assets/qml-Doo9Cky4.js","assets/razor-Dk2kv2By.js","assets/rst-C6ecNsTn.js","assets/cmake-Bj61d0ZC.js","assets/sas-Cp-D0gCy.js","assets/shaderlab-TOUzSsQk.js","assets/hlsl-Cvrh5tZx.js","assets/shellsession-KR2Dmt63.js","assets/soy-U6NbpSMz.js","assets/sparql-D_iOobhT.js","assets/turtle-ByJddavk.js","assets/stata-yvKR4kbi.js","assets/surrealql-B171yI6F.js","assets/svelte-B_bXEc_n.js","assets/templ-tqWE5SlP.js","assets/ts-tags-D5u9DmEU.js","assets/twig-BUTDHjkY.js","assets/typst-Bio4TaT2.js","assets/bat-qdxAdBWQ.js","assets/bibtex-Ci_nEsc7.js","assets/jsonc-CYpm1nAK.js","assets/log-BNLmms1o.js","assets/powershell-CCSX75yM.js","assets/swift-CyEgAFGc.js","assets/system-verilog-Dh5ihWbf.js","assets/verilog-B2gwz-sJ.js","assets/vue-B-YWRyzE.js","assets/vue-html-Cb0eicOD.js","assets/vue-vine-DxrdWx_w.js","assets/stylus-B6D30XZt.js"])))=>i.map(i=>d[i]);
2
2
  var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var L=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function R(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function z(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else R(z.bind(null,e))}var B={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=B,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=z,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=R,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),L=Symbol.for(`react.suspense`),R=Symbol.for(`react.suspense_list`),z=Symbol.for(`react.memo`),B=Symbol.for(`react.lazy`),V=Symbol.for(`react.activity`),H=Symbol.for(`react.legacy_hidden`),U=Symbol.for(`react.memo_cache_sentinel`),ee=Symbol.for(`react.view_transition`),te=Symbol.for(`react.recoverable`),ne=Symbol.iterator;function W(e){return typeof e!=`object`||!e?null:(e=ne&&e[ne]||e[`@@iterator`],typeof e==`function`?e:null)}var re=Symbol.for(`react.client.reference`);function ie(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case L:return`Suspense`;case R:return`SuspenseList`;case V:return`Activity`;case ee:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case z:return t=e.displayName||null,t===null?ie(e.type)||`Memo`:t;case B:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}var ae=Array.isArray,G=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},ce=[],le=-1;function ue(e){return{current:e}}function de(e){0>le||(e.current=ce[le],ce[le]=null,le--)}function fe(e,t){le++,ce[le]=e.current,e.current=t}var pe=ue(null),me=ue(null),he=ue(null),ge=ue(null);function _e(e,t){switch(fe(he,t),fe(me,e),fe(pe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?fp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=fp(t),e=pp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}de(pe),fe(pe,e)}function ve(){de(pe),de(me),de(he)}function ye(e){var t=e.memoizedState;t!==null&&(lh._currentValue=t.memoizedState,fe(ge,e)),t=pe.current;var n=pp(t,e.type);t!==n&&(fe(me,e),fe(pe,n))}function be(e){me.current===e&&(de(pe),de(me)),ge.current===e&&(de(ge),lh._currentValue=se)}var xe,Se;function Ce(e){if(xe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||``,Se=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+xe+e+Se}var we=!1;function Te(e,t){if(!e||we)return``;we=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
@@ -7,7 +7,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
7
7
  `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{we=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ce(n):``}function Ee(e,t){switch(e.tag){case 26:case 27:case 5:return Ce(e.type);case 16:return Ce(`Lazy`);case 13:return e.child!==t&&t!==null?Ce(`Suspense Fallback`):Ce(`Suspense`);case 19:return Ce(`SuspenseList`);case 0:case 15:return Te(e.type,!1);case 11:return Te(e.type.render,!1);case 1:return Te(e.type,!0);case 31:return Ce(`Activity`);case 30:return Ce(`ViewTransition`);default:return``}}function De(e){try{var t=``,n=null;do t+=Ee(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
8
  Error generating stack: `+e.message+`
9
9
  `+e.stack}}var Oe=Object.prototype.hasOwnProperty,ke=t.unstable_scheduleCallback,Ae=t.unstable_cancelCallback,je=t.unstable_shouldYield,Me=t.unstable_requestPaint,Ne=t.unstable_now,Pe=t.unstable_getCurrentPriorityLevel,Fe=t.unstable_ImmediatePriority,Ie=t.unstable_UserBlockingPriority,Le=t.unstable_NormalPriority,Re=t.unstable_LowPriority,ze=t.unstable_IdlePriority,Be=t.log,Ve=t.unstable_setDisableYieldValue,He=null,K=null;function Ue(e){if(typeof Be==`function`&&Ve(e),K&&typeof K.setStrictMode==`function`)try{K.setStrictMode(He,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-We(n),i=1<<r;t|=e[r],n&=~i}return t}function tt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 nt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function rt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function it(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function at(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-We(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ot(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ot(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-We(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function st(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-We(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ct(e,t){var n=t&-t;return n=n&42?1:lt(n),(n&(e.suspendedLanes|t))===0?n:0}function lt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ut(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function dt(){var e=oe.p;return e===0?(e=window.event,e===void 0?32:Th(e.type)):e}function ft(e,t){var n=oe.p;try{return oe.p=e,t()}finally{oe.p=n}}var pt=Math.random().toString(36).slice(2),mt=`__reactFiber$`+pt,ht=`__reactProps$`+pt,gt=`__reactContainer$`+pt,q=`__reactEvents$`+pt,_t=`__reactListeners$`+pt,vt=`__reactHandles$`+pt,yt=`__reactResources$`+pt,bt=`__reactMarker$`+pt,xt=`__reactLoad$`+pt;function St(e){delete e[mt],delete e[ht],delete e[_t],delete e[vt]}function Ct(e){var t;if(t=e[mt])return t;for(var n=e.parentNode;n;){if(t=n[gt]||n[mt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mm(e);e!==null;){if(n=e[mt])return n;e=mm(e)}return t}e=n,n=e.parentNode}return null}function wt(e){if(e=e[mt]||e[gt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Tt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Et(e){var t=e[yt];return t||=e[yt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Dt(e){e[bt]=!0}function Ot(e){e[xt]=void 0}var kt=new Set,At={};function jt(e,t){Mt(e,t),Mt(e+`Capture`,t)}function Mt(e,t){for(At[e]=t,e=0;e<t.length;e++)kt.add(t[e])}var Nt=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]*$`),Pt={},Ft={};function It(e){return Oe.call(Ft,e)?!0:Oe.call(Pt,e)?!1:Nt.test(e)?Ft[e]=!0:(Pt[e]=!0,!1)}var Lt=!1;function Rt(){var e=Lt;return Lt=!1,e}function zt(e,t,n){if(It(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Bt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Vt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Ht(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ut(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Wt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gt(e){if(!e._valueTracker){var t=Ut(e)?`checked`:`value`;e._valueTracker=Wt(e,t,``+e[t])}}function Kt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ut(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var qt=/[\n"\\]/g;function Jt(e){return e.replace(qt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Yt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Ht(t)):e.value!==``+Ht(t)&&(e.value=``+Ht(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Zt(e,Ht(n)):o===`number`&&e.value==t?Zt(e,Ht(e.value)):Zt(e,Ht(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Ht(s):e.removeAttribute(`name`)}function Xt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Gt(e);return}n=n==null?``:``+Ht(n),t=t==null?n:``+Ht(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Gt(e)}function Zt(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function Qt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Ht(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function $t(e,t,n){if(t!=null&&(t=``+Ht(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ht(n)}function J(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ae(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ht(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Gt(e)}function en(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var tn=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 Y(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||tn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function nn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Lt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(Y(e,a,r),Lt=!0)}else for(var o in t)t.hasOwnProperty(o)&&Y(e,o,t[o])}function rn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 an=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`],[`maskType`,`mask-type`],[`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`]]),on=/^[\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 sn(e){return on.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function cn(){}var ln=null;function un(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var dn=null,fn=null;function pn(e){var t=wt(e);if(t&&(e=t.stateNode)){var n=e[ht]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Yt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Jt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ht]||null;if(!a)throw Error(i(90));Yt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Kt(r)}break a;case`textarea`:$t(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Qt(e,!!n.multiple,t,!1)}}}var mn=!1;function hn(e,t,n){if(mn)return e(t,n);mn=!0;try{return e(t)}finally{if(mn=!1,(dn!==null||fn!==null)&&(zd(),dn&&(t=dn,e=fn,fn=dn=null,pn(t),e)))for(t=0;t<e.length;t++)pn(e[t])}}function gn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ht]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var _n=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),vn=!1;if(_n)try{var yn={};Object.defineProperty(yn,"passive",{get:function(){vn=!0}}),window.addEventListener(`test`,yn,yn),window.removeEventListener(`test`,yn,yn)}catch{vn=!1}var X=null,bn=null,xn=null;function Sn(){if(xn)return xn;var e,t=bn,n=t.length,r,i=`value`in X?X.value:X.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return xn=i.slice(e,1<r?1-r:void 0)}function Cn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function wn(){return!0}function Tn(){return!1}function En(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?wn:Tn,this.isPropagationStopped=Tn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=wn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=wn)},persist:function(){},isPersistent:wn}),t}var Dn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},On=En(Dn),kn=D({},Dn,{view:0,detail:0}),An=En(kn),jn,Mn,Nn,Pn=D({},kn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Nn&&(Nn&&e.type===`mousemove`?(jn=e.screenX-Nn.screenX,Mn=e.screenY-Nn.screenY):Mn=jn=0,Nn=e),jn)},movementY:function(e){return`movementY`in e?e.movementY:Mn}}),Fn=En(Pn),In=En(D({},Pn,{dataTransfer:0})),Ln=En(D({},kn,{relatedTarget:0})),Rn=En(D({},Dn,{animationName:0,elapsedTime:0,pseudoElement:0})),zn=En(D({},Dn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Bn=En(D({},Dn,{data:0})),Vn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Hn={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`},Un={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Wn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Un[e])?!!t[e]:!1}function Gn(){return Wn}var Kn=En(D({},kn,{key:function(e){if(e.key){var t=Vn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Cn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Hn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gn,charCode:function(e){return e.type===`keypress`?Cn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Cn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),qn=En(D({},Pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Jn=En(D({},Dn,{submitter:0})),Yn=En(D({},kn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gn})),Xn=En(D({},Dn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Zn=En(D({},Pn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Qn=En(D({},Dn,{newState:0,oldState:0,source:0})),$n=[9,13,27,32],er=_n&&`CompositionEvent`in window,tr=null;_n&&`documentMode`in document&&(tr=document.documentMode);var nr=_n&&`TextEvent`in window&&!tr,rr=_n&&(!er||tr&&8<tr&&11>=tr),ir=` `,ar=!1;function or(e,t){switch(e){case`keyup`:return $n.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function sr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var cr=!1;function lr(e,t){switch(e){case`compositionend`:return sr(t);case`keypress`:return t.which===32?(ar=!0,ir):null;case`textInput`:return e=t.data,e===ir&&ar?null:e;default:return null}}function ur(e,t){if(cr)return e===`compositionend`||!er&&or(e,t)?(e=Sn(),xn=bn=X=null,cr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return rr&&t.locale!==`ko`?null:t.data;default:return null}}var dr={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 fr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!dr[e.type]:t===`textarea`}function pr(e,t,n,r){dn?fn?fn.push(r):fn=[r]:dn=r,t=Yf(t,`onChange`),0<t.length&&(n=new On(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var mr=null,hr=null;function gr(e){Vf(e,0)}function _r(e){if(Kt(Tt(e)))return e}function vr(e,t){if(e===`change`)return t}var yr=!1;if(_n){var br;if(_n){var xr=`oninput`in document;if(!xr){var Sr=document.createElement(`div`);Sr.setAttribute(`oninput`,`return;`),xr=typeof Sr.oninput==`function`}br=xr}else br=!1;yr=br&&(!document.documentMode||9<document.documentMode)}function Cr(){mr&&(mr.detachEvent(`onpropertychange`,wr),hr=mr=null)}function wr(e){if(e.propertyName===`value`&&_r(hr)){var t=[];pr(t,hr,e,un(e)),hn(gr,t)}}function Tr(e,t,n){e===`focusin`?(Cr(),mr=t,hr=n,mr.attachEvent(`onpropertychange`,wr)):e===`focusout`&&Cr()}function Er(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return _r(hr)}function Dr(e,t){if(e===`click`)return _r(t)}function Or(e,t){if(e===`input`||e===`change`)return _r(t)}function kr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ar=typeof Object.is==`function`?Object.is:kr;function jr(e,t){if(Ar(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Oe.call(t,i)||!Ar(e[i],t[i]))return!1}return!0}function Mr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Nr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pr(e,t){var n=Nr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Nr(n)}}function Fr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Fr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ir(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Mr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Mr(e.document)}return t}function Lr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Rr=_n&&`documentMode`in document&&11>=document.documentMode,zr=null,Br=null,Vr=null,Hr=!1;function Ur(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hr||zr==null||zr!==Mr(r)||(r=zr,`selectionStart`in r&&Lr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Vr&&jr(Vr,r)||(Vr=r,r=Yf(Br,`onSelect`),0<r.length&&(t=new On(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=zr)))}function Wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Gr={animationend:Wr(`Animation`,`AnimationEnd`),animationiteration:Wr(`Animation`,`AnimationIteration`),animationstart:Wr(`Animation`,`AnimationStart`),transitionrun:Wr(`Transition`,`TransitionRun`),transitionstart:Wr(`Transition`,`TransitionStart`),transitioncancel:Wr(`Transition`,`TransitionCancel`),transitionend:Wr(`Transition`,`TransitionEnd`)},Kr={},qr={};_n&&(qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Gr.animationend.animation,delete Gr.animationiteration.animation,delete Gr.animationstart.animation),`TransitionEvent`in window||delete Gr.transitionend.transition);function Jr(e){if(Kr[e])return Kr[e];if(!Gr[e])return e;var t=Gr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in qr)return Kr[e]=t[n];return e}var Yr=Jr(`animationend`),Xr=Jr(`animationiteration`),Zr=Jr(`animationstart`),Qr=Jr(`transitionrun`),$r=Jr(`transitionstart`),ei=Jr(`transitioncancel`),ti=Jr(`transitionend`),ni=new Map,ri=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);ri.push(`scrollEnd`);function ii(e,t){ni.set(e,t),jt(t,[e])}var ai=0;function oi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=bd.identifierPrefix;var n=ai++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function si(e){if(e==null||typeof e==`string`)return e;var t=null,n=Od;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function ci(e,t){return e=si(e),t=si(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var li=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ui=[],di=0,fi=0;function pi(){for(var e=di,t=fi=di=0;t<e;){var n=ui[t];ui[t++]=null;var r=ui[t];ui[t++]=null;var i=ui[t];ui[t++]=null;var a=ui[t];if(ui[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&_i(n,i,a)}}function mi(e,t,n,r){ui[di++]=e,ui[di++]=t,ui[di++]=n,ui[di++]=r,fi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function hi(e,t,n,r){return mi(e,t,n,r),vi(e)}function gi(e,t){return mi(e,null,null,t),vi(e)}function _i(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-We(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function vi(e){if(50<kd)throw kd=0,Ad=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var yi={};function bi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xi(e,t,n,r){return new bi(e,t,n,r)}function Si(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ci(e,t){var n=e.alternate;return n===null?(n=xi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function wi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ti(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Si(r)&&(s=1);else if(typeof r==`string`)s=Ym(e,n,pe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case V:return e=xi(31,n,t,a),e.elementType=V,e.lanes=o,e;case j:return Ei(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=xi(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case L:return e=xi(13,n,t,a),e.elementType=L,e.lanes=o,e;case R:return e=xi(19,n,t,a),e.elementType=R,e.lanes=o,e;case H:case ee:return e=a|32,e=xi(30,n,t,e),e.elementType=ee,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case z:s=14;break a;case B:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=xi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ei(e,t,n,r){return e=xi(7,e,r,t),e.lanes=n,e}function Di(e,t,n){return e=xi(6,e,null,t),e.lanes=n,e}function Oi(e){var t=xi(18,null,null,0);return t.stateNode=e,t}function ki(e,t,n){return t=xi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ai=new WeakMap;function ji(e,t){if(typeof e==`object`&&e){var n=Ai.get(e);return n===void 0?(t={value:e,source:t,stack:De(t)},Ai.set(e,t),t):n}return{value:e,source:t,stack:De(t)}}var Mi=[],Ni=0,Pi=null,Fi=0,Ii=[],Li=0,Ri=null,zi=1,Bi=``;function Vi(e,t){Mi[Ni++]=Fi,Mi[Ni++]=Pi,Pi=e,Fi=t}function Hi(e,t,n){Ii[Li++]=zi,Ii[Li++]=Bi,Ii[Li++]=Ri,Ri=e;var r=zi;e=Bi;var i=32-We(r)-1;r&=~(1<<i),n+=1;var a=32-We(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,zi=1<<32-We(t)+i|n<<i|r,Bi=a+e}else zi=1<<a|n<<i|r,Bi=e}function Ui(e){e.return!==null&&(Vi(e,1),Hi(e,1,0))}function Wi(e){for(;e===Pi;)Pi=Mi[--Ni],Mi[Ni]=null,Fi=Mi[--Ni],Mi[Ni]=null;for(;e===Ri;)Ri=Ii[--Li],Ii[Li]=null,Bi=Ii[--Li],Ii[Li]=null,zi=Ii[--Li],Ii[Li]=null}function Gi(e,t){Ii[Li++]=zi,Ii[Li++]=Bi,Ii[Li++]=Ri,zi=t.id,Bi=t.overflow,Ri=e}var Ki=null,qi=null,Ji=!1,Yi=null,Xi=!1,Zi=Error(i(519));function Qi(e){throw ia(ji(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Zi}function $i(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[mt]=e,t[ht]=r,n){case`dialog`:Hf(`cancel`,t),Hf(`close`,t);break;case`iframe`:case`object`:case`embed`:Hf(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Hf(zf[n],t);break;case`source`:Hf(`error`,t);break;case`img`:case`image`:case`link`:Hf(`error`,t),Hf(`load`,t);break;case`details`:Hf(`toggle`,t);break;case`input`:Hf(`invalid`,t),Xt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Hf(`invalid`,t);break;case`textarea`:Hf(`invalid`,t),J(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||tp(t.textContent,n)?(r.popover!=null&&(Hf(`beforetoggle`,t),Hf(`toggle`,t)),r.onScroll!=null&&Hf(`scroll`,t),r.onScrollEnd!=null&&Hf(`scrollend`,t),r.onClick!=null&&(t.onclick=cn),t=!0):t=!1,t||Qi(e,!0)}function ea(e){for(Ki=e.return;Ki;)switch(Ki.tag){case 5:case 31:case 13:Xi=!1;return;case 27:case 3:Xi=!0;return;default:Ki=Ki.return}}function ta(e){if(e!==Ki)return!1;if(!Ji)return ea(e),Ji=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||hp(e.type,e.memoizedProps)),n=!n),n&&qi&&Qi(e),ea(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));qi=pm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));qi=pm(e)}else t===27?(t=qi,wp(e.type)?(e=fm,fm=null,qi=e):qi=t):qi=Ki?dm(e.stateNode.nextSibling):null;return!0}function na(){qi=Ki=null,Ji=!1}function ra(){var e=Yi;return e!==null&&(fd===null?fd=e:fd.push.apply(fd,e),Yi=null),e}function ia(e){Yi===null?Yi=[e]:Yi.push(e)}var aa=ue(null),oa=null,sa=null;function ca(e,t,n){fe(aa,t._currentValue),t._currentValue=n}function la(e){e._currentValue=aa.current,de(aa)}function ua(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function da(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ua(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ua(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ua(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function fa(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Ar(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ge.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[lh]:e.push(lh))}a=a.return}return e!==null&&da(t,e,n,r),t.flags|=262144,e!==null}function pa(e){for(e=e.firstContext;e!==null;){if(!Ar(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ma(e){oa=e,sa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ha(e){return _a(oa,e)}function ga(e,t){return oa===null&&ma(e),_a(e,t)}function _a(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},sa===null){if(e===null)throw Error(i(308));sa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else sa=sa.next=t;return n}var va=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ya=t.unstable_scheduleCallback,ba=t.unstable_NormalPriority,xa={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sa(){return{controller:new va,data:new Map,refCount:0}}function Ca(e){e.refCount--,e.refCount===0&&ya(ba,function(){e.controller.abort()})}function wa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ta=null;function Ea(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Da=null,Oa=0,ka=0,Aa=null;function ja(e,t){if(Da===null){var n=Da=[];Oa=0,ka=Pf(),Aa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Oa++,t.then(Ma,Ma),t}function Ma(){if(--Oa===0&&(Ta=null,Da!==null)){Aa!==null&&(Aa.status=`fulfilled`);var e=Da;Da=null,ka=0,Aa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Na(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Pa=G.S;G.S=function(e,t){if(hd=Ne(),typeof t==`object`&&t&&typeof t.then==`function`&&ja(e,t),Ta!==null)for(var n=bf;n!==null;)wa(n,Ta),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)wa(r,n),r=r.next;if(ka!==0){r=Ta,r===null&&(r=Ta=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Pa!==null&&Pa(e,t)};var Fa=ue(null);function Ia(){var e=Fa.current;return e===null?Xu.pooledCache:e}function La(e,t){t===null?fe(Fa,Fa.current):fe(Fa,t.pool)}function Ra(){var e=Ia();return e===null?null:{parent:xa._currentValue,pool:e}}var za=Error(i(460)),Ba=Error(i(474)),Va=Error(i(542)),Ha={then:function(){}};function Ua(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Wa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(cn,cn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ja(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(cn,cn);else{if(e=Xu,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ja(e),e}throw Ka=t,za}}function Ga(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ka=e,za):e}}var Ka=null;function qa(){if(Ka===null)throw Error(i(459));var e=Ka;return Ka=null,e}function Ja(e){if(e===za||e===Va)throw Error(i(483))}var Ya=null,Xa=0;function Za(e){var t=Xa;return Xa+=1,Ya===null&&(Ya=[]),Wa(Ya,e,t)}function Qa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function $a(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function eo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Ci(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Di(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===j?(e=d(e,t,n.props.children,r,n.key),Qa(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===B&&Ga(i)===t.type)?(t=a(t,n.props),Qa(t,n),t.return=e,t):(t=Ti(n.type,n.key,n.props,null,e.mode,r),Qa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ki(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Ei(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Di(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ti(t.type,t.key,t.props,null,e.mode,n),Qa(n,t),n.return=e,n;case A:return t=ki(t,e.mode,n),t.return=e,t;case B:return t=Ga(t),f(e,t,n)}if(ae(t)||W(t))return t=Ei(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Za(t),n);if(t.$$typeof===F)return f(e,ga(e,t),n);$a(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case B:return n=Ga(n),p(e,t,n,r)}if(ae(n)||W(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Za(n),r);if(n.$$typeof===F)return p(e,t,ga(e,n),r);$a(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case B:return r=Ga(r),m(e,t,n,r,i)}if(ae(r)||W(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Za(r),i);if(r.$$typeof===F)return m(e,t,n,ga(t,r),i);$a(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Ji&&Vi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Ji&&Vi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Ji&&Vi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Ji&&Vi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Ji&&Vi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Ji&&Vi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),Qa(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===B&&Ga(l)===r.type){n(e,r.sibling),c=a(r,o.props),Qa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Ei(o.props.children,e.mode,c,o.key),Qa(c,o),c.return=e,e=c):(c=Ti(o.type,o.key,o.props,null,e.mode,c),Qa(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=ki(o,e.mode,c),c.return=e,e=c}return s(e);case B:return o=Ga(o),_(e,r,o,c)}if(ae(o))return h(e,r,o,c);if(W(o)){if(l=W(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,Za(o),c);if(o.$$typeof===F)return _(e,r,ga(e,o),c);$a(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Di(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Xa=0;var i=_(e,t,n,r);return Ya=null,i}catch(t){if(t===za||t===Va)throw t;var a=xi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var to=eo(!0),no=eo(!1),ro=!1;function io(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ao(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function oo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function so(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Yu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=vi(e),_i(e,null,n),t}return mi(e,r,t,n),vi(e)}function co(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,st(e,n)}}function lo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var uo=!1;function fo(){if(uo){var e=Aa;if(e!==null)throw e}}function po(e,t,n,r){uo=!1;var i=e.updateQueue;ro=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Qu&f)===f:(r&f)===f){f!==0&&f===ka&&(uo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:ro=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),od|=o,e.lanes=o,e.memoizedState=d}}function mo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function ho(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)mo(n[e],t)}var go=ue(null),_o=ue(0);function vo(e,t){e=id,fe(_o,e),fe(go,t),id=e|t.baseLanes}function yo(){fe(_o,id),fe(go,go.current)}function bo(){id=_o.current,de(go),de(_o)}var xo=ue(null),So=null;function Co(e){var t=e.alternate;fe(Oo,Oo.current&1),fe(xo,e),So===null&&(t===null||go.current!==null||t.memoizedState!==null)&&(So=e)}function wo(e){fe(Oo,Oo.current),fe(xo,e),So===null&&(So=e)}function To(e){e.tag===22?(fe(Oo,Oo.current),fe(xo,e),So===null&&(So=e)):Eo()}function Eo(){fe(Oo,Oo.current),fe(xo,xo.current)}function Do(e){de(xo),So===e&&(So=null),de(Oo)}var Oo=ue(0);function ko(e,t){fe(xo,xo.current),fe(Oo,t)}function Ao(e){de(Oo),de(xo),So===e&&(So=null)}function jo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||cm(n)||lm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Mo=0,No=null,Po=null,Fo=null,Io=!1,Lo=!1,Ro=!1,zo=0,Bo=0,Vo=null,Ho=0;function Uo(){throw Error(i(321))}function Wo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ar(e[n],t[n]))return!1;return!0}function Go(e,t,n,r,i,a){return Mo=a,No=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?cc:lc,Ro=!1,a=n(r,i),Ro=!1,Lo&&(a=qo(t,n,r,i)),Ko(e),a}function Ko(e){G.H=sc;var t=Po!==null&&Po.next!==null;if(Mo=0,Fo=Po=No=null,Io=!1,Bo=0,Vo=null,t)throw Error(i(300));e===null||Ec||(e=e.dependencies,e!==null&&pa(e)&&(Ec=!0))}function qo(e,t,n,r){No=e;var a=0;do{if(Lo&&(Vo=null),Bo=0,Lo=!1,25<=a)throw Error(i(301));if(a+=1,Fo=Po=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}G.H=uc,o=t(n,r)}while(Lo);return o}function Jo(){var e=G.H,t=e.useState()[0];return t=typeof t.then==`function`?ts(t):t,e=e.useState()[0],(Po===null?null:Po.memoizedState)!==e&&(No.flags|=1024),t}function Yo(){var e=zo!==0;return zo=0,e}function Xo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Zo(e){if(Io){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Io=!1}Mo=0,Fo=Po=No=null,Lo=!1,Bo=zo=0,Vo=null}function Qo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fo===null?No.memoizedState=Fo=e:Fo=Fo.next=e,Fo}function $o(){if(Po===null){var e=No.alternate;e=e===null?null:e.memoizedState}else e=Po.next;var t=Fo===null?No.memoizedState:Fo.next;if(t!==null)Fo=t,Po=e;else{if(e===null)throw No.alternate===null?Error(i(467)):Error(i(310));Po=e,e={memoizedState:Po.memoizedState,baseState:Po.baseState,baseQueue:Po.baseQueue,queue:Po.queue,next:null},Fo===null?No.memoizedState=Fo=e:Fo=Fo.next=e}return Fo}function es(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ts(e){var t=Bo;return Bo+=1,Vo===null&&(Vo=[]),e=Wa(Vo,e,t),t=No,(Fo===null?t.memoizedState:Fo.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?cc:lc),e}function ns(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ts(e);if(e.$$typeof===te)return;if(e.$$typeof===F)return ha(e)}throw Error(i(438,String(e)))}function rs(e){var t=null,n=No.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=No.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=es(),No.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=U;return t.index++,n}function is(e,t){return typeof t==`function`?t(e):t}function as(e){return os($o(),Po,e)}function os(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Mo&f)===f:(Qu&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ka&&(d=!0);else if((Mo&p)===p){u=u.next,p===ka&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,No.lanes|=p,od|=p;f=u.action,Ro&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,No.lanes|=f,od|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ar(o,e.memoizedState)&&(Ec=!0,d&&(n=Aa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ss(e){var t=$o(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Ar(o,t.memoizedState)||(Ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function cs(e,t,n){var r=No,a=$o(),o=Ji;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Ar((Po||a).memoizedState,n);if(s&&(a.memoizedState=n,Ec=!0),a=a.queue,Ns(ds.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Fo!==null&&!!(Fo.memoizedState.tag&1),Os(e?9:8,{destroy:void 0},us.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Xu===null)throw Error(i(349));o||Mo&127||ls(r,t,n)}return n}function ls(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=No.updateQueue,t===null?(t=es(),No.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function us(e,t,n,r){t.value=n,t.getSnapshot=r,fs(t)&&ps(e)}function ds(e,t,n){return n(function(){fs(t)&&ps(e)})}function fs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ar(e,n)}catch{return!0}}function ps(e){var t=gi(e,2);t!==null&&Pd(t,e,2)}function ms(e){var t=Qo();if(typeof e==`function`){var n=e;if(e=n(),Ro){Ue(!0);try{n()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:e},t}function hs(e,t,n,r){return e.baseState=n,os(e,Po,typeof r==`function`?r:is)}function gs(e,t,n,r,a){if(ic(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};G.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,_s(t,o)):(o.next=n.next,t.pending=n.next=o)}}function _s(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=G.T,o={};o.types=a===null?null:a.types,G.T=o;try{var s=n(i,r),c=G.S;c!==null&&c(o,s),vs(e,t,s)}catch(n){bs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),G.T=a}}else try{a=n(i,r),vs(e,t,a)}catch(n){bs(e,t,n)}}function vs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ys(e,t,n)},function(n){return bs(e,t,n)}):ys(e,t,n)}function ys(e,t,n){t.status=`fulfilled`,t.value=n,xs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,_s(e,n)))}function bs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,xs(t),t=t.next;while(t!==r)}e.action=null}function xs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ss(e,t){return t}function Cs(e,t){if(Ji){var n=Xu.formState;if(n!==null){a:{var r=No;if(Ji){if(qi){b:{for(var i=qi,a=Xi;i.nodeType!==8;){if(!a){i=null;break b}if(i=dm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){qi=dm(i.nextSibling),r=i.data===`F!`;break a}}Qi(r)}r=!1}r&&(t=n[0])}}return n=Qo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ss,lastRenderedState:t},n.queue=r,n=tc.bind(null,No,r),r.dispatch=n,r=ms(!1),a=rc.bind(null,No,!1,r.queue),r=Qo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=gs.bind(null,No,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ws(e){return Ts($o(),Po,e)}function Ts(e,t,n){if(t=os(e,t,Ss)[0],e=as(is)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ts(t)}catch(e){throw e===za?Va:e}else r=t;t=$o();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(No.flags|=2048,Os(9,{destroy:void 0},Es.bind(null,i,n),null)),[r,a,e]}function Es(e,t){e.action=t}function Ds(e){var t=$o(),n=Po;if(n!==null)return Ts(t,n,e);$o(),t=t.memoizedState,n=$o();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Os(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=No.updateQueue,t===null&&(t=es(),No.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ks(){return $o().memoizedState}function As(e,t,n,r){var i=Qo();No.flags|=e,i.memoizedState=Os(1|t,{destroy:void 0},n,r===void 0?null:r)}function js(e,t,n,r){var i=$o();r=r===void 0?null:r;var a=i.memoizedState.inst;Po!==null&&r!==null&&Wo(r,Po.memoizedState.deps)?i.memoizedState=Os(t,a,n,r):(No.flags|=e,i.memoizedState=Os(1|t,a,n,r))}function Ms(e,t){As(8390656,8,e,t)}function Ns(e,t){js(2048,8,e,t)}function Ps(e){No.flags|=4;var t=No.updateQueue;if(t===null)t=es(),No.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Fs(e){var t=$o().memoizedState;return Ps({ref:t,nextImpl:e}),function(){if(Yu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Is(e,t){return js(4,2,e,t)}function Ls(e,t){return js(4,4,e,t)}function Rs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function zs(e,t,n){n=n==null?null:n.concat([e]),js(4,4,Rs.bind(null,t,e),n)}function Bs(){}function Vs(e,t){var n=$o();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Wo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Hs(e,t){var n=$o();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Wo(t,r[1]))return r[0];if(r=e(),Ro){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r}function Us(e,t,n){return n===void 0||Mo&1073741824&&!(Qu&261930)?e.memoizedState=t:(e.memoizedState=n,e=Md(),No.lanes|=e,od|=e,n)}function Ws(e,t,n,r){return Ar(n,t)?n:go.current===null?!(Mo&106)||Mo&1073741824&&!(Qu&261930)?(Ec=!0,e.memoizedState=n):(e=Md(),No.lanes|=e,od|=e,t):(e=Us(e,n,r),Ar(e,t)||(Ec=!0),e)}function Gs(e,t,n,r,i){var a=oe.p;oe.p=a!==0&&8>a?a:8;var o=G.T,s={};s.types=o===null?null:o.types,G.T=s,rc(e,!1,t,n);try{var c=i(),l=G.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?nc(e,t,Na(c,r),jd(e)):nc(e,t,r,jd(e))}catch(n){nc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{oe.p=a,o!==null&&s.types!==null&&(o.types=s.types),G.T=o}}function Ks(){}function qs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Js(e).queue;Gs(e,a,t,se,n===null?Ks:function(){return Ys(e),n(r)})}function Js(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ys(e){var t=Js(e);t.next===null&&(t=e.alternate.memoizedState),nc(e,t.next.queue,{},jd())}function Xs(){return ha(lh)}function Zs(){return $o().memoizedState}function Qs(){return $o().memoizedState}function $s(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=oo(n);var r=so(t,e,n);r!==null&&(Pd(r,t,n),co(r,t,n)),t={cache:Sa()},e.payload=t;return}t=t.return}}function ec(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ic(e)?ac(t,n):(n=hi(e,t,n,r),n!==null&&(Pd(n,e,r),oc(n,t,r)))}function tc(e,t,n){nc(e,t,n,jd())}function nc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ic(e))ac(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Ar(s,o))return mi(e,t,i,0),Xu===null&&pi(),!1}catch{}if(n=hi(e,t,i,r),n!==null)return Pd(n,e,r),oc(n,t,r),!0}return!1}function rc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ic(e)){if(t)throw Error(i(479))}else t=hi(e,n,r,2),t!==null&&Pd(t,e,2)}function ic(e){var t=e.alternate;return e===No||t!==null&&t===No}function ac(e,t){Lo=Io=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function oc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,st(e,n)}}var sc={readContext:ha,use:ns,useCallback:Uo,useContext:Uo,useEffect:Uo,useImperativeHandle:Uo,useLayoutEffect:Uo,useInsertionEffect:Uo,useMemo:Uo,useReducer:Uo,useRef:Uo,useState:Uo,useDebugValue:Uo,useDeferredValue:Uo,useTransition:Uo,useSyncExternalStore:Uo,useId:Uo,useHostTransitionStatus:Uo,useFormState:Uo,useActionState:Uo,useOptimistic:Uo,useMemoCache:Uo,useCacheRefresh:Uo,useEffectEvent:Uo},cc={readContext:ha,use:ns,useCallback:function(e,t){return Qo().memoizedState=[e,t===void 0?null:t],e},useContext:ha,useEffect:Ms,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),As(4194308,4,Rs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return As(4194308,4,e,t)},useInsertionEffect:function(e,t){As(4,2,e,t)},useMemo:function(e,t){var n=Qo();t=t===void 0?null:t;var r=e();if(Ro){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Qo();if(n!==void 0){var i=n(t);if(Ro){Ue(!0);try{n(t)}finally{Ue(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ec.bind(null,No,e),[r.memoizedState,e]},useRef:function(e){var t=Qo();return e={current:e},t.memoizedState=e},useState:function(e){e=ms(e);var t=e.queue,n=tc.bind(null,No,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Bs,useDeferredValue:function(e,t){return Us(Qo(),e,t)},useTransition:function(){var e=ms(!1);return e=Gs.bind(null,No,e.queue,!0,!1),Qo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=No,a=Qo();if(Ji){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xu===null)throw Error(i(349));Qu&127||ls(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ms(ds.bind(null,r,o,e),[e]),r.flags|=2048,Os(9,{destroy:void 0},us.bind(null,r,o,n,t),null),n},useId:function(){var e=Qo(),t=Xu.identifierPrefix;if(Ji){var n=Bi,r=zi;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=zo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Ho++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Xs,useFormState:Cs,useActionState:Cs,useOptimistic:function(e){var t=Qo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=rc.bind(null,No,!0,n),n.dispatch=t,[e,t]},useMemoCache:rs,useCacheRefresh:function(){return Qo().memoizedState=$s.bind(null,No)},useEffectEvent:function(e){var t=Qo(),n={impl:e};return t.memoizedState=n,function(){if(Yu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},lc={readContext:ha,use:ns,useCallback:Vs,useContext:ha,useEffect:Ns,useImperativeHandle:zs,useInsertionEffect:Is,useLayoutEffect:Ls,useMemo:Hs,useReducer:as,useRef:ks,useState:function(){return as(is)},useDebugValue:Bs,useDeferredValue:function(e,t){return Ws($o(),Po.memoizedState,e,t)},useTransition:function(){var e=as(is)[0],t=$o().memoizedState;return[typeof e==`boolean`?e:ts(e),t]},useSyncExternalStore:cs,useId:Zs,useHostTransitionStatus:Xs,useFormState:ws,useActionState:ws,useOptimistic:function(e,t){return hs($o(),Po,e,t)},useMemoCache:rs,useCacheRefresh:Qs,useEffectEvent:Fs},uc={readContext:ha,use:ns,useCallback:Vs,useContext:ha,useEffect:Ns,useImperativeHandle:zs,useInsertionEffect:Is,useLayoutEffect:Ls,useMemo:Hs,useReducer:ss,useRef:ks,useState:function(){return ss(is)},useDebugValue:Bs,useDeferredValue:function(e,t){var n=$o();return Po===null?Us(n,e,t):Ws(n,Po.memoizedState,e,t)},useTransition:function(){var e=ss(is)[0],t=$o().memoizedState;return[typeof e==`boolean`?e:ts(e),t]},useSyncExternalStore:cs,useId:Zs,useHostTransitionStatus:Xs,useFormState:Ds,useActionState:Ds,useOptimistic:function(e,t){var n=$o();return Po===null?(n.baseState=e,[e,n.queue.dispatch]):hs(n,Po,e,t)},useMemoCache:rs,useCacheRefresh:Qs,useEffectEvent:Fs};function dc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var fc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=jd(),i=oo(r);i.payload=t,n!=null&&(i.callback=n),t=so(e,i,r),t!==null&&(Pd(t,e,r),co(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=jd(),i=oo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=so(e,i,r),t!==null&&(Pd(t,e,r),co(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jd(),r=oo(n);r.tag=2,t!=null&&(r.callback=t),t=so(e,r,n),t!==null&&(Pd(t,e,n),co(t,e,n))}};function pc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!jr(n,r)||!jr(i,a):!0}function mc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&fc.enqueueReplaceState(t,t.state,null)}function hc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function gc(e){li(e)}function _c(e){console.error(e)}function vc(e){li(e)}function yc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function bc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function xc(e,t,n){return n=oo(n),n.tag=3,n.payload={element:null},n.callback=function(){yc(e,t)},n}function Sc(e){return e=oo(e),e.tag=3,e}function Cc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){bc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){bc(t,n,r),typeof i!=`function`&&(vd===null?vd=new Set([this]):vd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function wc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&fa(t,n,a,!0),n=xo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return So===null?Kd():n.alternate===null&&ad===0&&(ad=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ha?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),hf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ha?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),hf(e,r,a)),!1}throw Error(i(435,n.tag))}return hf(e,r,a),Kd(),!1}if(Ji)return t=xo.current,t===null?(r!==Zi&&(t=Error(i(423),{cause:r}),ia(ji(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=ji(r,n),a=xc(e.stateNode,r,a),lo(e,a),ad!==4&&(ad=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Zi&&(e=Error(i(422),{cause:r}),ia(ji(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=ji(o,n),dd===null?dd=[o]:dd.push(o),ad!==4&&(ad=2),t===null)return!0;r=ji(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=xc(n.stateNode,r,e),lo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(vd===null||!vd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Sc(a),Cc(a,e,n,r),lo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Tc=Error(i(461)),Ec=!1;function Dc(e,t,n,r){t.child=e===null?no(t,null,n,r):to(t,e.child,n,r)}function Oc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ma(t),r=Go(e,t,n,o,a,i),s=Yo(),e!==null&&!Ec?(Xo(e,t,i),nl(e,t,i)):(Ji&&s&&Ui(t),t.flags|=1,Dc(e,t,r,i),t.child)}function kc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Si(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Ac(e,t,a,r,i)):(e=Ti(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!rl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?jr:n,n(o,r)&&e.ref===t.ref)return nl(e,t,i)}return t.flags|=1,e=Ci(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(jr(a,r)&&e.ref===t.ref){if(Ec=!1,t.pendingProps=r=a,rl(e,i))e.flags&131072&&(Ec=!0);else return t.lanes=e.lanes,nl(e,t,i)}}return Rc(e,t,n,r,i)}function jc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Nc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&La(t,a===null?null:a.cachePool),a===null?yo():vo(t,a),To(t);else return r=t.lanes=536870912,Nc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&La(t,null),yo(),Eo()):(La(t,a.cachePool),vo(t,a),Eo(),t.memoizedState=null);return Dc(e,t,i,n),t.child}function Mc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Nc(e,t,n,r,i){var a=Ia();return a=a===null?null:{parent:xa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&La(t,null),yo(),To(t),e!==null&&fa(e,t,r,!0),t.childLanes=i,null}function Pc(e,t){return t=qc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Fc(e,t,n){return to(t,e.child,null,n),e=Pc(t,t.pendingProps),e.flags|=2,Do(t),t.memoizedState=null,e}function Ic(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Ji){if(r.mode===`hidden`)return e=Pc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Mc(null,e);if(wo(t),(e=qi)?(e=sm(e,Xi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ri===null?null:{id:zi,overflow:Bi},retryLane:536870912,hydrationErrors:null},n=Oi(e),n.return=t,t.child=n,Ki=t,qi=null)):e=null,e===null)throw Qi(t);return t.lanes=536870912,null}return Pc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(wo(t),a){if(t.flags&256)t.flags&=-257,t=Fc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Ec||fa(e,t,n,!1),a=(n&e.childLanes)!==0,Ec||a){if(go.current===null){if(r=Xu,r!==null&&(s=ct(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,gi(e,s),Pd(r,e,s),Tc;Kd()}t=Fc(e,t,n)}else e=o.treeContext,qi=dm(s.nextSibling),Ki=t,Ji=!0,Yi=null,Xi=!1,e!==null&&Gi(t,e),t=Pc(t,r),t.flags|=134221824;return t}return e=Ci(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Lc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Rc(e,t,n,r,i){return ma(t),n=Go(e,t,n,r,void 0,i),r=Yo(),e!==null&&!Ec?(Xo(e,t,i),nl(e,t,i)):(Ji&&r&&Ui(t),t.flags|=1,Dc(e,t,n,i),t.child)}function zc(e,t,n,r,i,a){return ma(t),t.updateQueue=null,n=qo(t,r,n,i),Ko(e),r=Yo(),e!==null&&!Ec?(Xo(e,t,a),nl(e,t,a)):(Ji&&r&&Ui(t),t.flags|=1,Dc(e,t,n,a),t.child)}function Bc(e,t,n,r,i){if(ma(t),t.stateNode===null){var a=yi,o=n.contextType;typeof o==`object`&&o&&(a=ha(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=fc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},io(t),o=n.contextType,a.context=typeof o==`object`&&o?ha(o):yi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(dc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&fc.enqueueReplaceState(a,a.state,null),po(t,r,a,i),fo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=hc(n,s);a.props=c;var l=a.context,u=n.contextType;o=yi,typeof u==`object`&&u&&(o=ha(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&mc(t,a,r,o),ro=!1;var f=t.memoizedState;a.state=f,po(t,r,a,i),fo(),l=t.memoizedState,s||f!==l||ro?(typeof d==`function`&&(dc(t,n,d,r),l=t.memoizedState),(c=ro||pc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,ao(e,t),o=t.memoizedProps,u=hc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=yi,typeof l==`object`&&l&&(c=ha(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&mc(t,a,r,c),ro=!1,f=t.memoizedState,a.state=f,po(t,r,a,i),fo();var p=t.memoizedState;o!==d||f!==p||ro||e!==null&&e.dependencies!==null&&pa(e.dependencies)?(typeof s==`function`&&(dc(t,n,s,r),p=t.memoizedState),(u=ro||pc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&pa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Lc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=to(t,e.child,null,i),t.child=to(t,null,n,i)):Dc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=nl(e,t,i),e}function Vc(e,t,n,r){return na(),t.flags|=256,Dc(e,t,n,r),t.child}var Hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Uc(e){return{baseLanes:e,cachePool:Ra()}}function Wc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ld),e}function Gc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Oo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(Ji){if(i?Co(t):Eo(),(e=qi)?(e=sm(e,Xi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ri===null?null:{id:zi,overflow:Bi},retryLane:536870912,hydrationErrors:null},n=Oi(e),n.return=t,t.child=n,Ki=t,qi=null)):e=null,e===null)throw Qi(t);return t.lanes=lm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Eo(),i=t.mode,a=qc({mode:`hidden`,children:a},i),r=Ei(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Uc(n),r.childLanes=Wc(e,o,n),t.memoizedState=Hc,Mc(null,r)):(Co(t),Kc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Yc(e,t,a,o,r,c,s,n)}return i?(Eo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ci(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ei(i,a,n,null),i.flags|=2):i=Ci(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Mc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Uc(n):(a=i.cachePool,a===null?a=Ra():(s=xa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Wc(e,o,n),t.memoizedState=Hc,Mc(e.child,r)):(Co(t),n=e.child,e=n.sibling,n=Ci(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Kc(e,t){return t=qc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function qc(e,t){return e=xi(22,e,null,t),e.lanes=0,e}function Jc(e,t,n){return to(t,e.child,null,n),e=Kc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Yc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Co(t),t.flags&=-257,Jc(e,t,c)):t.memoizedState===null?(Eo(),o=a.fallback,s=t.mode,a=qc({mode:`visible`,children:a.children},s),o=Ei(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,to(t,e.child,null,c),a=t.child,a.memoizedState=Uc(c),a.childLanes=Wc(e,r,c),t.memoizedState=Hc,Mc(null,a)):(Eo(),t.child=e.child,t.flags|=128,null);if(Co(t),lm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ia({value:a,source:null,stack:null})),Jc(e,t,c)}if(Ec||fa(e,t,c,!1),r=(c&e.childLanes)!==0,Ec||r){if(go.current!==null)return Jc(e,t,c);if(r=Xu,r!==null&&(a=ct(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,gi(e,a),Pd(r,e,a),Tc;return cm(o)||Kd(),Jc(e,t,c)}return cm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,qi=dm(o.nextSibling),Ki=t,Ji=!0,Yi=null,Xi=!1,e!==null&&Gi(t,e),t=Kc(t,a.children),t.flags|=134221824,t)}function Xc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ua(e.return,t,n)}function Zc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&jo(n)===null&&(t=e),e=e.sibling}return t}function Qc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function $c(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function el(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Oo.current;if(t.flags&128)return ko(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,ko(t,o),i===`backwards`&&e!==null?($c(e),Dc(e,t,r,n),$c(e)):Dc(e,t,r,n),r=Ji?Fi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xc(e,n,t);else if(e.tag===19)Xc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=Zc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,$c(t)),Qc(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&jo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Qc(t,!0,n,null,a,r);break;case`together`:Qc(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Zc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Qc(t,!1,i,n,a,r)}return t.child}function tl(e,t,n){var r=t.pendingProps;return ca(t,t.type,r.value),Dc(e,t,r.children,n),t.child}function nl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),od|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(fa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ci(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ci(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function rl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&pa(e)))}function il(e,t,n){switch(t.tag){case 3:_e(t,t.stateNode.containerInfo),ca(t,xa,e.memoizedState.cache),na();break;case 27:case 5:ye(t);break;case 4:_e(t,t.stateNode.containerInfo);break;case 10:ca(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,wo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Co(t),t.flags|=128,null;r=fa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Gc(e,t,n):(Co(t),e=nl(e,t,n),e===null?null:e.sibling)}Co(t);break;case 19:if(t.flags&128)return el(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(fa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return el(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ko(t,Oo.current),r)break;return null;case 22:return t.lanes=0,jc(e,t,n,t.pendingProps);case 24:ca(t,xa,e.memoizedState.cache)}return nl(e,t,n)}function al(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ec=!0;else{if(!rl(e,n)&&!(t.flags&128))return Ec=!1,il(e,t,n);Ec=!!(e.flags&131072)}}else Ec=!1,Ji&&t.flags&1048576&&Hi(t,Fi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ga(t.elementType),t.type=e,typeof e==`function`)Si(e)?(r=hc(e,r),t.tag=1,t=Bc(null,t,e,r,n)):(t.tag=0,t=Rc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=Oc(null,t,e,r,n);break a}if(a===z){t.tag=14,t=kc(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=tl(null,t,n);break a}}throw t=ie(e)||e,Error(i(306,t,``))}}return t;case 0:return Rc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=hc(r,t.pendingProps),Bc(e,t,r,a,n);case 3:a:{if(_e(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,ao(e,t),po(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ca(t,xa,r),r!==o.cache&&da(t,[xa],n,!0),fo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Vc(e,t,r,n);break a}if(r!==a){a=ji(Error(i(424)),t),ia(a),t=Vc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(qi=dm(e.firstChild),Ki=t,Ji=!0,Yi=null,Xi=!0,n=no(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(na(),r===a){t=nl(e,t,n);break a}Dc(e,t,r,n)}t=t.child}return t;case 26:return Lc(e,t),e===null?(n=Fm(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ji||(t.stateNode=mp(t.type,t.pendingProps,he.current,t)):t.memoizedState=Fm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ye(t),e===null&&Ji&&(r=t.stateNode=_m(t.type,t.pendingProps,he.current),Ki=t,Xi=!0,a=qi,wp(t.type)?(fm=a,qi=dm(r.firstChild)):qi=a),Dc(e,t,t.pendingProps.children,n),Lc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ji&&((a=r=qi)&&(r=am(r,t.type,t.pendingProps,Xi),r===null?a=!1:(t.stateNode=r,Ki=t,qi=dm(r.firstChild),Xi=!1,a=!0)),a||Qi(t)),ye(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,hp(a,o)?r=null:s!==null&&hp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Go(e,t,Jo,null,null,n),lh._currentValue=a),Lc(e,t),Dc(e,t,r,n),t.child;case 6:return e===null&&Ji&&((e=n=qi)&&(n=om(n,t.pendingProps,Xi),n===null?e=!1:(t.stateNode=n,Ki=t,qi=null,e=!0)),e||Qi(t)),null;case 13:return Gc(e,t,n);case 4:return _e(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=to(t,null,r,n):Dc(e,t,r,n),t.child;case 11:return Oc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Lc(e,t),Dc(e,t,r,n),t.child;case 8:return Dc(e,t,t.pendingProps.children,n),t.child;case 12:return Dc(e,t,t.pendingProps.children,n),t.child;case 10:return tl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ma(t),a=ha(a),r=r(a),t.flags|=1,Dc(e,t,r,n),t.child;case 14:return kc(e,t,t.type,t.pendingProps,n);case 15:return Ac(e,t,t.type,t.pendingProps,n);case 19:return el(e,t,n);case 31:return Ic(e,t,n);case 22:return jc(e,t,n,t.pendingProps);case 24:return ma(t),r=ha(xa),e===null?(a=Ia(),a===null&&(a=Xu,o=Sa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},io(t),ca(t,xa,a)):((e.lanes&n)!==0&&(ao(e,t),po(t,null,null,n),fo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ca(t,xa,r),r!==a.cache&&da(t,[xa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ca(t,xa,r))),Dc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:Ji&&Ui(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Lc(e,t),Dc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ol(e){e.flags|=4}function sl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Xm(t,r):Xm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Ud())e.flags|=8192;else throw Ka=Ha,Ba}}else e.flags&=-16777217}function cl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Zm(t)){if(Ud())e.flags|=8192;else throw Ka=Ha,Ba}}function ll(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:nt(),e.lanes|=t,ud|=t)}function ul(e,t){if(!Ji)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function dl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function fl(e,t,n){var r=t.pendingProps;switch(Wi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dl(t),null;case 1:return dl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),la(xa),ve(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ta(t)?ol(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ra())),dl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ol(t),o===null?(dl(t),sl(t,a,null,r,n)):(dl(t),cl(t,o))):o?o===e.memoizedState?(dl(t),t.flags&=-16777217):(ol(t),dl(t),cl(t,o)):(e=e.memoizedProps,e!==r&&ol(t),dl(t),sl(t,a,e,r,n)),null;case 27:if(be(t),n=he.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return dl(t),t.subtreeFlags&=-33554433,null}e=pe.current,ta(t)?$i(t,e):(e=_m(a,r,n),t.stateNode=e,ol(t))}return dl(t),t.subtreeFlags&=-33554433,null;case 5:if(be(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return dl(t),t.subtreeFlags&=-33554433,null}if(o=pe.current,ta(t))$i(t,o);else{var s=dp(he.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[mt]=t,o[ht]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(ip(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ol(t)}}return dl(t),t.subtreeFlags&=-33554433,sl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=he.current,ta(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ki,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[mt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||tp(e.nodeValue,n)),e||Qi(t,!0)}else e=dp(e).createTextNode(r),e[mt]=t,t.stateNode=e}return dl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ta(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[mt]=t}else na(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dl(t),e=!1}else n=ra(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Do(t),t):(Do(t),null);if(t.flags&128)throw Error(i(558))}return dl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ta(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[mt]=t}else na(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dl(t),a=!1}else a=ra(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Do(t),t):(Do(t),null)}return Do(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ll(t,t.updateQueue),dl(t),null);case 4:return ve(),e===null&&Gf(t.stateNode.containerInfo),t.flags|=67108864,dl(t),null;case 10:return la(t.type),dl(t),null;case 19:if(Ao(t),r=t.memoizedState,r===null)return dl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)ul(r,!1);else{if(ad!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=jo(e),o!==null){for(t.flags|=128,ul(r,!1),e=o.updateQueue,t.updateQueue=e,ll(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)wi(n,e),n=n.sibling;return ko(t,Oo.current&1|2),Ji&&Vi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ne()>gd&&(t.flags|=128,a=!0,ul(r,!1),t.lanes=4194304)}}else{if(!a){if(e=jo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ll(t,e),ul(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!Ji)return dl(t),null}else 2*Ne()-r.renderingStartTime>gd&&n!==536870912&&(t.flags|=128,a=!0,ul(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ne(),e.sibling=null,o=Oo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||Ji?ko(t,o):(n=o,fe(xo,t),fe(Oo,n),So===null&&(So=t)),Ji&&Vi(t,r.treeForkCount),e}return dl(t),null;case 22:case 23:return Do(t),bo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(dl(t),t.subtreeFlags&6&&(t.flags|=8192)):dl(t),n=t.updateQueue,n!==null&&ll(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&de(Fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),la(xa),dl(t),null;case 25:return null;case 30:return t.flags|=33554432,dl(t),null}throw Error(i(156,t.tag))}function pl(e,t){switch(Wi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return la(xa),ve(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return be(t),null;case 31:if(t.memoizedState!==null){if(Do(t),t.alternate===null)throw Error(i(340));na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Do(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ao(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ve(),null;case 10:return la(t.type),null;case 22:case 23:return Do(t),bo(),e!==null&&de(Fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return la(xa),null;case 25:return null;default:return null}}function ml(e,t){switch(Wi(t),t.tag){case 3:la(xa),ve();break;case 26:case 27:case 5:be(t);break;case 4:ve();break;case 31:t.memoizedState!==null&&Do(t);break;case 13:Do(t);break;case 19:Ao(t);break;case 10:la(t.type);break;case 22:case 23:Do(t),bo(),e!==null&&de(Fa);break;case 24:la(xa)}}function hl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){mf(t,t.return,e)}}function gl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){mf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){mf(t,t.return,e)}}function _l(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ho(t,n)}catch(t){mf(e,e.return,t)}}}function vl(e,t,n){n.props=hc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){mf(e,t,n)}}function yl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=oi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Ip(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Lp(e);m(e.child,!1,em,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){mf(e,t,n)}}function bl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){mf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){mf(e,t,n)}else n.current=null}}function xl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)nm(e.stateNode,t[n])}function Sl(e){for(var t=e.return;t!==null&&(Tl(t)&&nm(e.stateNode,t.stateNode),!wl(t));)t=t.return}function Cl(e){for(var t=e.return;t!==null&&(Tl(t)&&rm(e.stateNode,t.stateNode),!wl(t));)t=t.return}function wl(e){return e.tag===5||e.tag===3||e.tag===27}function Tl(e){return e&&e.tag===7&&e.stateNode!==null}function El(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){mf(e,e.return,t)}}function Dl(e,t,n){try{var r=e.stateNode;op(r,e.type,n,t),r[ht]=t}catch(t){mf(e,e.return,t)}}function Ol(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wp(e.type)||e.tag===4}function kl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ol(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&wp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Al(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=cn)),xl(e,r),Lt=!0;else if(i!==4&&(i===27&&(xl(e,r),r=null,wp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Al(e,t,n,r),e=e.sibling;e!==null;)Al(e,t,n,r),e=e.sibling}function jl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),xl(e,r),Lt=!0;else if(i!==4&&(i===27&&(xl(e,r),r=null,wp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(jl(e,t,n,r),e=e.sibling;e!==null;)jl(e,t,n,r),e=e.sibling}function Ml(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ip(t,r,n),t[mt]=e,t[ht]=n}catch(t){mf(e,e.return,t)}}var Nl=!1,Pl=null;function Fl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Nl=!0)}var Il=null;function Ll(){var e=Il;return Il=null,e}var Rl=0;function zl(e,t,n,r,i){return Rl=0,Bl(e.child,t,n,r,i)}function Bl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Ap(o);r.push(s),s.view&&(a=!0)}else a||Ap(o).view&&(a=!0);Nl=!0,Dp(o,Rl===0?t:t+`_`+Rl,n),Rl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Bl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Vl(e,t){for(;e!==null;)e.tag===5?Op(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Vl(e.child,t)),e=e.sibling}function Hl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Hl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=ci(t.default,t.share),t!==`none`&&(zl(e,n,t,null,!1)||Vl(e.child,!1))}e=e.sibling}}function Ul(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=oi(r,n),a=ci(r.default,n.paired?r.share:r.enter);a===`none`?Hl(e):zl(e,i,a,null,!1)?(Hl(e),n.paired||t||Nd(e,r.onEnter)):Vl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ul(e,t),e=e.sibling;else Hl(e)}function Wl(e){if(Pl!==null&&Pl.size!==0){var t=Pl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=ci(n.default,n.share);if(a!==`none`&&(zl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Nd(e,n.onShare)):Vl(e.child,!1)),t.delete(r),t.size===0)break}}}Wl(e)}e=e.sibling}}}function Gl(e){if(e.tag===30){var t=e.memoizedProps,n=oi(t,e.stateNode),r=Pl===null?void 0:Pl.get(n),i=ci(t.default,r===void 0?t.exit:t.share);i!==`none`&&(zl(e,n,i,null,!1)?r===void 0?Nd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Pl.delete(n),Nd(e,t.onShare)):Vl(e.child,!1)),Pl!==null&&Wl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e),e=e.sibling;else Pl!==null&&Wl(e)}function Kl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=oi(t,e.stateNode);t=ci(t.default,t.update),e.flags&=-5,t!==`none`&&zl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Kl(e);e=e.sibling}}function ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Vl(e.child,!1))}ql(e)}e=e.sibling}}function Jl(e){if(e.tag===30)e.stateNode.paired=null,Vl(e.child,!1),ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e),e=e.sibling;else ql(e)}function Yl(e){for(e=e.child;e!==null;)e.tag===30?Vl(e.child,!1):e.subtreeFlags&33554432&&Yl(e),e=e.sibling}function Xl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Rl<a.length){var l=a[Rl],u=Ap(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Dp(c,Rl===0?n:n+`_`+Rl,i),s&&e.flags&4||(Il===null&&(Il=[]),Il.push(c,Rl===0?r:r+`_`+Rl,t.memoizedProps)),Rl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Xl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Zl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=oi(n,r),a=ci(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(jp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Rl=0,i=Xl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Nd(e,n.onUpdate))}else e.subtreeFlags&33554432&&Zl(e,t);e=e.sibling}}var Ql=!1,$l=!1,eu=!1,tu=!1,nu=typeof WeakSet==`function`?WeakSet:Set,ru=null,iu=!1,au=!1,ou=!1,su=!1;function cu(e,t,n){if(e=e.containerInfo,lp=vh,e=Ir(e),Lr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(up={focusedElem:e,selectionRange:r},vh=!1,n=(n&335544064)===n,ru=t,t=n?9270:1024;ru!==null;){if(e=ru,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Gl(r[a]);if(e.alternate===null&&e.flags&2)n&&Fl(e),lu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Gl(r),lu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Fl(e),lu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,ru=r):(n&&Kl(e),lu(n))}}Pl=null}function lu(e){for(;ru!==null;){var t=ru,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=hc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){mf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)im(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:im(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=oi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=ci(a.default,a.update),a!==`none`&&zl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,ru=r;break}ru=t.return}}function uu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Au(e,n),r&4&&hl(5,n);break;case 1:if(Au(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){mf(n,n.return,e)}else{var i=hc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){mf(n,n.return,e)}}}r&64&&_l(n),r&512&&yl(n,n.return);break;case 3:if(Au(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{ho(e,t)}catch(e){mf(n,n.return,e)}}break;case 27:t===null&&r&4&&Ml(n);case 26:case 5:Au(e,n),t===null&&r&4&&El(n),r&512&&yl(n,n.return);break;case 12:Au(e,n);break;case 31:Au(e,n),r&4&&yu(e,n);break;case 13:Au(e,n),r&4&&bu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),um(e,n))));break;case 22:if(r=n.memoizedState!==null||Ql,!r){var a=t!==null&&t.memoizedState!==null||$l;t=Ql,i=$l,Ql=r,($l=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Mu(e,n,r)):Au(e,n),Ql=t,$l=i}break;case 30:Au(e,n),r&512&&yl(n,n.return);break;case 7:r&512&&yl(n,n.return);default:Au(e,n)}}function du(e,t){for(e=e.child;e!==null;)fu(e,t),e=e.sibling}function fu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){mf(e,e.return,t)}pu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Lt=!0}catch(t){mf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ep(s,!0):Ep(e.stateNode,!1)}catch(t){mf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&du(e,t);break;default:du(e,t)}}function pu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:fu(n,r);break a;case 22:n.memoizedState===null&&pu(n,r);break a;default:pu(n,r)}}e=e.sibling}}function mu(e){var t=e.alternate;t!==null&&(e.alternate=null,mu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&St(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var hu=null,gu=!1;function _u(e,t,n){for(n=n.child;n!==null;)vu(e,t,n),n=n.sibling}function vu(e,t,n){if(K&&typeof K.onCommitFiberUnmount==`function`)try{K.onCommitFiberUnmount(He,n)}catch{}switch(n.tag){case 26:$l||bl(n,t),_u(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!$l&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$l||bl(n,t),Cl(n);var r=hu,i=gu;wp(n.type)&&(hu=n.stateNode,gu=!1),_u(e,t,n),vm(n.stateNode,n.type,n.memoizedProps),hu=r,gu=i;break;case 5:$l||bl(n,t),Cl(n);case 6:if(n.tag===6&&Cl(n),r=hu,i=gu,hu=null,_u(e,t,n),hu=r,gu=i,hu!==null){if(gu)try{(hu.nodeType===9?hu.body:hu.nodeName===`HTML`?hu.ownerDocument.body:hu).removeChild(n.stateNode),Lt=!0}catch(e){mf(n,t,e)}else try{hu.removeChild(n.stateNode),Lt=!0}catch(e){mf(n,t,e)}}break;case 18:hu!==null&&(gu?(e=hu,Tp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Uh(e)):Tp(hu,n.stateNode));break;case 4:r=hu,i=gu,hu=n.stateNode.containerInfo,gu=!0,_u(e,t,n),hu=r,gu=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),$l||gl(4,n,t),_u(e,t,n);break;case 1:$l||(bl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&vl(n,t,r)),_u(e,t,n);break;case 21:_u(e,t,n);break;case 22:$l=(r=$l)||n.memoizedState!==null,_u(e,t,n),$l=r;break;case 30:bl(n,t),_u(e,t,n);break;case 7:$l||bl(n,t),_u(e,t,n);break;default:_u(e,t,n)}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Uh(e)}catch(e){mf(t,t.return,e)}}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Uh(e)}catch(e){mf(t,t.return,e)}}function xu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nu),t;default:throw Error(i(435,e.tag))}}function Su(e,t){var n=xu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function Cu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(wp(l.type)){hu=l.stateNode,gu=!1;break a}break;case 5:hu=l.stateNode,gu=!1;break a;case 3:case 4:hu=l.stateNode.containerInfo,gu=!0;break a}l=l.return}if(hu===null)throw Error(i(160));vu(s,c,o),hu=null,gu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tu(t,e,n),t=t.sibling}var wu=null;function Tu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Cu(t,e,n),Eu(e),a&4&&(gl(3,e,e.return),hl(3,e),gl(5,e,e.return));break;case 1:Cu(t,e,n),Eu(e),a&512&&($l||r===null||bl(r,r.return)),a&64&&Ql&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=wu,Cu(t,e,n),Eu(e),a&512&&($l||r===null||bl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(Ql)e.stateNode=mp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[bt]||r[mt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),ip(r,t,n),r[mt]=e,Dt(r),t=r;break a;case`link`:if(o=qm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),ip(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=qm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),ip(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[mt]=e,Dt(r),t=r}e.stateNode=t}}else Ql||Jm(o,e.type,e.stateNode)}else e.stateNode=Hm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Dl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||$l||t.parentNode.removeChild(t)):a.count--,n===null?Ql||Jm(o,e.type,e.stateNode):Hm(o,n,e.memoizedProps))}break;case 27:Cu(t,e,n),Eu(e),a&512&&($l||r===null||bl(r,r.return)),r!==null&&a&4&&Dl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=eu,eu=!1,Cu(t,e,n),eu=o,Eu(e),a&512&&($l||r===null||bl(r,r.return)),e.flags&32){t=e.stateNode;try{en(t,``),Lt=!0}catch(t){mf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Dl(e,t,r===null?t:r.memoizedProps)),a&1024&&(tu=!0);break;case 6:if(Cu(t,e,n),Eu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Lt=!0}catch(t){mf(e,e.return,t)}}break;case 3:if(Lt=!1,Km=null,o=wu,wu=Sm(t.containerInfo),Cu(t,e,n),wu=o,Eu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Uh(t.containerInfo)}catch(t){mf(e,e.return,t)}tu&&(tu=!1,Du(e)),Lt=!1;break;case 4:a=eu,eu=Ql,r=Rt(),o=wu,wu=Sm(e.stateNode.containerInfo),Cu(t,e,n),Eu(e),wu=o,Lt&&au&&(ou=!0),Lt=r,eu=a;break;case 12:Cu(t,e,n),Eu(e);break;case 31:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 13:Cu(t,e,n),Eu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(md=Ne()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=Ql,l=$l,u=eu;Ql=c||o,eu=u||o,$l=l||s,Cu(t,e,n),$l=l,eu=u,Ql=c,Eu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||Ql||$l||(t=s||$l,n=Ql,r=$l,Ql=o||Ql,$l=t,ju(e,2),Ql=n,$l=r),!o&&eu||du(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Su(e,n))));break;case 19:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 30:a&512&&($l||r===null||bl(r,r.return)),a=Rt(),o=au,s=(n&335544064)===n,c=e.memoizedProps,au=s&&ci(c.default,c.update)!==`none`,Cu(t,e,n),Eu(e),s&&r!==null&&Lt&&(e.flags|=4),au=o,Lt=a;break;case 21:break;case 7:a&512&&($l||r===null||bl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Cu(t,e,n),Eu(e)}}function Eu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ol(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Tl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(wl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;jl(e,kl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(en(l,``),n.flags&=-33),jl(e,kl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Al(e,kl(e),u,s);break;default:throw Error(i(161))}}catch(t){mf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Du(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Du(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,vh=!0,t.reset(),vh=!1),e=e.sibling}}function Ou(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ku(t,e),t=t.sibling;else Zl(t,!1)}function ku(e,t){var n=e.alternate;if(n===null)Ul(e,!1);else switch(e.tag){case 3:if(su=iu=!1,Ll(),Ou(t,e),!iu&&!ou){if(e=Il,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Op(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),su=!0}Il=null;break;case 5:Ou(t,e);break;case 4:r=iu,iu=!1,Ou(t,e),iu&&(ou=!0),iu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Ou(t,e):Ul(e,!1));break;case 30:r=iu,i=Ll(),iu=!1,Ou(t,e),iu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=oi(a,o),o=oi(n.memoizedProps,o);var s=ci(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Rl=0,t=Xl(e,n,t,o,s,a,!0),Rl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Nd(e,e.memoizedProps.onUpdate),Il=i):i!==null&&(i.push.apply(i,Il),Il=i),iu=e.flags&32?!0:r;break;default:Ou(t,e)}}function Au(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)uu(e,t.alternate,t),t=t.sibling}function ju(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:gl(4,n,n.return),ju(n,r);break;case 1:bl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&vl(n,n.return,i),ju(n,r);break;case 27:r&2&&vm(n.stateNode,n.type,n.memoizedProps);case 5:bl(n,n.return),n.tag!==5&&n.tag!==27||Cl(n),ju(n,r);break;case 6:Cl(n);break;case 26:bl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||$l||i.parentNode.removeChild(i),ju(n,r);break;case 22:n.memoizedState===null&&ju(n,r);break;case 30:bl(n,n.return),ju(n,r);break;case 7:bl(n,n.return);default:ju(n,r)}e=e.sibling}}function Mu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Mu(i,a,n),hl(4,a);break;case 1:if(Mu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){mf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)mo(l[i],c)}catch(e){mf(r,r.return,e)}}s&&o&64&&_l(a),yl(a,a.return);break;case 27:n&2&&Ml(a);case 5:a.tag!==5&&a.tag!==27||Sl(a),Mu(i,a,n),s&&r===null&&o&4&&El(a),yl(a,a.return);break;case 6:Sl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Ql||Jm(Sm(c.ownerDocument),a.type,c),Mu(i,a,n),s&&r===null&&o&4&&El(a),yl(a,a.return);break;case 12:Mu(i,a,n);break;case 31:Mu(i,a,n),s&&o&4&&yu(i,a);break;case 13:Mu(i,a,n),s&&o&4&&bu(i,a);break;case 22:a.memoizedState===null&&Mu(i,a,n),yl(a,a.return);break;case 30:Mu(i,a,n),yl(a,a.return);break;case 7:yl(a,a.return);default:Mu(i,a,n)}t=t.sibling}}function Nu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ca(n))}function Pu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ca(e))}function Fu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Iu(e,t,n,r),t=t.sibling;else i&&Yl(t)}function Iu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Jl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Fu(e,t,n,r),a&2048&&hl(9,t);break;case 1:Fu(e,t,n,r);break;case 3:Fu(e,t,n,r),i&&su&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ca(a)));break;case 12:if(a&2048){Fu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){mf(t,t.return,e)}}else Fu(e,t,n,r);break;case 31:Fu(e,t,n,r);break;case 13:Fu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Jl(t),o._visibility&2?Fu(e,t,n,r):(o._visibility|=2,Lu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Jl(s),o._visibility&2?Fu(e,t,n,r):Ru(e,t)),a&2048&&Nu(s,t);break;case 24:Fu(e,t,n,r),a&2048&&Pu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Vl(a.child,!0),Vl(t.child,!0))),Fu(e,t,n,r);break;default:Fu(e,t,n,r)}}function Lu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Lu(a,o,s,c,i),hl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Lu(a,o,s,c,i)):u._visibility&2?Lu(a,o,s,c,i):Ru(a,o),i&&l&2048&&Nu(o.alternate,o);break;case 24:Lu(a,o,s,c,i),i&&l&2048&&Pu(o.alternate,o);break;default:Lu(a,o,s,c,i)}t=t.sibling}}function Ru(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ru(n,r),i&2048&&Nu(r.alternate,r);break;case 24:Ru(n,r),i&2048&&Pu(r.alternate,r);break;default:Ru(n,r)}t=t.sibling}}var zu=8192;function Bu(e,t,n){if(e.subtreeFlags&zu)for(e=e.child;e!==null;)Vu(e,t,n),e=e.sibling}function Vu(e,t,n){switch(e.tag){case 26:Bu(e,t,n),e.flags&zu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&$m(n,e)):eh(n,wu,e.memoizedState,e.memoizedProps));break;case 5:Bu(e,t,n),e.flags&zu&&(e=e.stateNode,(t&335544128)===t&&$m(n,e));break;case 3:case 4:var r=wu;wu=Sm(e.stateNode.containerInfo),Bu(e,t,n),wu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=zu,zu=16777216,Bu(e,t,n),zu=r):Bu(e,t,n));break;case 30:if((e.flags&zu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Pl===null&&(Pl=new Map),Pl.set(r,i)}Bu(e,t,n);break;default:Bu(e,t,n)}}function Hu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Uu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Wu(e),e=e.sibling}function Wu(e){switch(e.tag){case 0:case 11:case 15:Uu(e),e.flags&2048&&gl(9,e,e.return);break;case 3:Uu(e);break;case 12:Uu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Gu(e)):Uu(e);break;default:Uu(e)}}function Gu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gl(8,t,t.return),Gu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Gu(t));break;default:Gu(t)}e=e.sibling}}function Ku(e,t){for(;ru!==null;){var n=ru;switch(n.tag){case 0:case 11:case 15:gl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ca(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ru=r;else a:for(n=e;ru!==null;){r=ru;var i=r.sibling,a=r.return;if(mu(r),r===n){ru=null;break a}if(i!==null){i.return=a,ru=i;break a}ru=a}}}var qu={getCacheForType:function(e){var t=ha(xa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ha(xa).controller.signal}},Ju=typeof WeakMap==`function`?WeakMap:Map,Yu=0,Xu=null,Zu=null,Qu=0,$u=0,ed=null,td=!1,nd=!1,rd=!1,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=null,fd=null,pd=!1,md=0,hd=0,gd=1/0,_d=null,vd=null,yd=0,bd=null,xd=null,Sd=0,Cd=0,wd=null,Td=null,Ed=null,Dd=null,Od=null,kd=0,Ad=null;function jd(){return Yu&2&&Qu!==0?Qu&-Qu:G.T===null?dt():Pf()}function Md(){if(ld===0){if(!(Qu&536870912)||Ji){var e=Ye;Ye<<=1,!(Ye&3932160)&&(Ye=262144),ld=e}else ld=536870912}return e=xo.current,e!==null&&(e.flags|=32),ld}function Nd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Ip(oi(e.memoizedProps,n))),Dd===null&&(Dd=[]),Dd.push(t.bind(null,r))}}function Pd(e,t,n){(e===Xu&&($u===2||$u===9)||e.cancelPendingCommit!==null)&&(Vd(e,0),Rd(e,Qu,ld,!1)),it(e,n),(!(Yu&2)||e!==Xu)&&(e===Xu&&(!(Yu&2)&&(sd|=n),ad===4&&Rd(e,Qu,ld,!1)),Ef(e))}function Fd(e,t,n){if(Yu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||$e(e,t),a=r?Yd(e,t):qd(e,t,!0),o=r;do{if(a===0){nd&&!r&&Rd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ld(n)){a=qd(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=dd;var l=c.current.memoizedState.isDehydrated;if(l&&(Vd(c,s).flags|=256),s=qd(c,s,!1),s!==2&&s!==6){if(rd&&!l){c.errorRecoveryDisabledLanes|=o,sd|=o,a=4;break a}o=fd,fd=a,o!==null&&(fd===null?fd=o:fd.push.apply(fd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Vd(e,0),Rd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Rd(r,t,ld,!td);break a;case 2:fd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=md+300-Ne(),10<a)){if(Rd(r,t,ld,!td),Qe(r,0,!0)!==0)break a;Sd=t,r.timeoutHandle=vp(Id.bind(null,r,n,fd,_d,pd,t,ld,sd,ud,td,o,`Throttled`,-0,0),a);break a}Id(r,n,fd,_d,pd,t,ld,sd,ud,td,o,null,-0,0)}break}while(1);Ef(e)}function Id(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:cn},Pl=null,Vu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=ih.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?md-Ne():(a&4194048)===a?hd-Ne():0,m=nh(d,m),m!==null)){Sd=a,e.cancelPendingCommit=m(nf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Rd(e,a,o,!l);return}nf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ld(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Ar(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Rd(e,t,n,r){t=et(e,t),t&=~cd,t&=~sd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-We(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ot(e,n,t)}function zd(){return Yu&6?!0:(Df(0,!1),!1)}function Bd(){if(Zu!==null){if($u===0)var e=Zu.return;else e=Zu,sa=oa=null,Zo(e),Ya=null,Xa=0,e=Zu;for(;e!==null;)ml(e.alternate,e),e=e.return;Zu=null}}function Vd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,yp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sd=0,Bd(),Xu=e,Zu=n=Ci(e.current,null),Qu=t,$u=0,ed=null,td=!1,nd=$e(e,t),rd=!1,ud=ld=cd=sd=od=ad=0,fd=dd=null,pd=!1,id=et(e,t),pi(),n}function Hd(e,t){No=null,G.H=sc,t===za||t===Va?(t=qa(),$u=3):t===Ba?(t=qa(),$u=4):$u=t===Tc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ed=t,Zu===null&&(ad=1,yc(e,ji(t,e.current)))}function Ud(){var e=xo.current;return e===null?!0:(Qu&4194048)===Qu?So===null:(Qu&62914560)===Qu||Qu&536870912?e===So:!1}function Wd(){var e=G.H;return G.H=sc,e===null?sc:e}function Gd(){var e=G.A;return G.A=qu,e}function Kd(){ad=4,td||(Qu&4194048)!==Qu&&xo.current!==null||(nd=!0),!(od&134217727)&&!(sd&134217727)||Xu===null||Rd(Xu,Qu,ld,!1)}function qd(e,t,n){var r=Yu;Yu|=2;var i=Wd(),a=Gd();(Xu!==e||Qu!==t)&&(_d=null,Vd(e,t)),t=!1;var o=ad;a:do try{if($u!==0&&Zu!==null){var s=Zu,c=ed;switch($u){case 8:Bd(),o=6;break a;case 3:case 2:case 9:case 6:xo.current===null&&(t=!0);var l=$u;if($u=0,ed=null,$d(e,s,c,l),n&&nd){o=0;break a}break;default:l=$u,$u=0,ed=null,$d(e,s,c,l)}}Jd(),o=ad;break}catch(t){Hd(e,t)}while(1);return t&&e.shellSuspendCounter++,sa=oa=null,Yu=r,G.H=i,G.A=a,Zu===null&&(Xu=null,Qu=0,pi()),o}function Jd(){for(;Zu!==null;)Zd(Zu)}function Yd(e,t){var n=Yu;Yu|=2;var r=Wd(),a=Gd();Xu!==e||Qu!==t?(_d=null,gd=Ne()+500,Vd(e,t)):nd=$e(e,t);a:do try{if($u!==0&&Zu!==null){t=Zu;var o=ed;b:switch($u){case 1:$u=0,ed=null,$d(e,t,o,1);break;case 2:case 9:if(Ua(o)){$u=0,ed=null,Qd(t);break}t=function(){$u!==2&&$u!==9||Xu!==e||($u=7),Ef(e)},o.then(t,t);break a;case 3:$u=7;break a;case 4:$u=5;break a;case 7:Ua(o)?($u=0,ed=null,Qd(t)):($u=0,ed=null,$d(e,t,o,7));break;case 5:var s=null;switch(Zu.tag){case 26:s=Zu.memoizedState;case 5:case 27:var c=Zu;if(s?Zm(s):c.stateNode.complete){$u=0,ed=null;var l=c.sibling;if(l!==null)Zu=l;else{var u=c.return;u===null?Zu=null:(Zu=u,ef(u))}break b}}$u=0,ed=null,$d(e,t,o,5);break;case 6:$u=0,ed=null,$d(e,t,o,6);break;case 8:Bd(),ad=6;break a;default:throw Error(i(462))}}Xd();break}catch(t){Hd(e,t)}while(1);return sa=oa=null,G.H=r,G.A=a,Yu=n,Zu===null?(Xu=null,Qu=0,pi(),ad):0}function Xd(){for(;Zu!==null&&!je();)Zd(Zu)}function Zd(e){var t=al(e.alternate,e,id);e.memoizedProps=e.pendingProps,t===null?ef(e):Zu=t}function Qd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=zc(n,t,t.pendingProps,t.type,void 0,Qu);break;case 11:t=zc(n,t,t.pendingProps,t.type.render,t.ref,Qu);break;case 5:Zo(t);var r=t;r===Ki&&(Ji?(ea(r),r.tag===5&&r.stateNode!=null&&(qi=r.stateNode)):(ea(r),Ji=!0));default:ml(n,t),t=Zu=wi(t,id),t=al(n,t,id)}e.memoizedProps=e.pendingProps,t===null?ef(e):Zu=t}function $d(e,t,n,r){sa=oa=null,Zo(t),Ya=null,Xa=0;var i=t.return;try{if(wc(e,i,t,n,Qu)){ad=1,yc(e,ji(n,e.current)),Zu=null;return}}catch(t){if(i!==null)throw Zu=i,t;ad=1,yc(e,ji(n,e.current)),Zu=null;return}t.flags&32768?(Ji||r===1?e=!0:nd||Qu&536870912?e=!1:(td=e=!0,(r===2||r===9||r===3||r===6)&&(r=xo.current,r!==null&&r.tag===13&&(r.flags|=16384))),tf(t,e)):ef(t)}function ef(e){var t=e;do{if(t.flags&32768){tf(t,td);return}e=t.return;var n=fl(t.alternate,t,id);if(n!==null){Zu=n;return}if(t=t.sibling,t!==null){Zu=t;return}Zu=t=e}while(t!==null);ad===0&&(ad=5)}function tf(e,t){do{var n=pl(e.alternate,e);if(n!==null){n.flags&=32767,Zu=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Zu=e;return}Zu=e=n}while(e!==null);ad=6,Zu=null}function nf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do df();while(yd!==0);if(Yu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Xu&&(Zu=Xu=null,Qu=0),xd=t,bd=e,Sd=n,wd=a,Td=r,rf(e,t,n,s,c,l,f)}}function rf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Cd=s,s|=fi,at(e,n,s,r,i,a),Dd=null,(n&335544064)===n?(Od=Ea(e),r=10262):(Od=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(Le,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),Nl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=G.T,G.T=null,i=oe.p,oe.p=2,a=Yu,Yu|=4;try{cu(e,t,n)}finally{Yu=a,oe.p=i,G.T=r}}yd=1,Nl?Ed=Pp(o,e.containerInfo,Od,sf,cf,of,lf,ff,af,null,null):(sf(),cf(),lf())}function af(e){if(yd!==0){var t=bd.onRecoverableError;t(e,{componentStack:null})}}function of(){yd===3&&(yd=0,ku(xd,bd),yd=4)}function sf(){if(yd===1){yd=0;var e=bd,t=xd,n=Sd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=G.T,G.T=null;var i=oe.p;oe.p=2;var a=Yu;Yu|=4;try{au=ou=!1,Tu(t,e,n),n=up;var o=Ir(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Fr(s.ownerDocument.documentElement,s)){if(c!==null&&Lr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Pr(s,h),v=Pr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}vh=!!lp,up=lp=null}finally{Yu=a,oe.p=i,G.T=r}}e.current=t,yd=2}}function cf(){if(yd===2){yd=0;var e=bd,t=xd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=G.T,G.T=null;var r=oe.p;oe.p=2;var i=Yu;Yu|=4;try{uu(e,t.alternate,t)}finally{Yu=i,oe.p=r,G.T=n}}yd=3}}function lf(){if(yd===4||yd===3){yd=0;var e=Ed;Ed=null,Me();var t=bd,n=xd,r=Sd,i=Td,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?yd=5:(yd=0,xd=bd=null,uf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(vd=null),ut(r),n=n.stateNode,K&&typeof K.onCommitFiberRoot==`function`)try{K.onCommitFiberRoot(He,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=G.T,a=oe.p,oe.p=2,G.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{G.T=n,oe.p=a}}if(i=Dd,o=Od,Od=null,i!==null&&(Dd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Sd&3&&df(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===Ad?kd++:(kd=0,Ad=t):(kd=0,Ad=null),Df(0,!1)}}function uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ca(t)))}function df(){return Ed!==null&&(Ed.skipTransition(),Ed=null),sf(),cf(),lf(),ff()}function ff(){if(yd!==5)return!1;var e=bd,t=Cd;Cd=0;var n=ut(Sd),r=G.T,a=oe.p;try{oe.p=32>n?32:n,G.T=null,n=wd,wd=null;var o=bd,s=Sd;if(yd=0,xd=bd=null,Sd=0,Yu&6)throw Error(i(331));var c=Yu;if(Yu|=4,Wu(o.current),Iu(o,o.current,s,n),Yu=c,Df(0,!1),K&&typeof K.onPostCommitFiberRoot==`function`)try{K.onPostCommitFiberRoot(He,o)}catch{}return!0}finally{oe.p=a,G.T=r,uf(e,t)}}function pf(e,t,n){t=ji(n,t),t=xc(e.stateNode,t,2),e=so(e,t,2),e!==null&&(it(e,2),Ef(e))}function mf(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vd===null||!vd.has(r))){e=ji(n,e),n=Sc(2),r=so(t,n,2),r!==null&&(Cc(n,r,t,e),it(r,2),Ef(r));break}}t=t.return}}function hf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ju;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(rd=!0,i.add(n),e=gf.bind(null,e,t,n),t.then(e,e))}function gf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xu===e&&(Qu&n)===n&&(ad===4||ad===3&&(Qu&62914560)===Qu&&300>Ne()-md?Yu&2?cd|=n:Vd(e,0):cd|=n,ud===Qu&&(ud=0)),Ef(e)}function Z(e,t){t===0&&(t=nt()),e=gi(e,t),e!==null&&(it(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Z(e,n)}function vf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Z(e,n)}function yf(e,t){return ke(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-We(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=Qu,a=Qe(r,r===Xu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&_p()&&(e=Tf);for(var t=Ne(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}yd!==0&&yd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-We(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=tt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Xu,n=Qu,n=Qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&($u===2||$u===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ae(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||$e(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ae(r),ut(n)){case 2:case 8:n=Ie;break;case 32:n=Le;break;case 268435456:n=ze;break;default:n=Le}return r=jf.bind(null,e),n=ke(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ae(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(yd!==0&&yd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(df()&&e.callbackNode!==n)return null;var r=Qu;return r=Qe(e,e===Xu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Fd(e,r,t),Af(e,Ne()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(df())return null;Fd(e,t,!0)}function Nf(){Sp(function(){Yu&6?ke(Fe,Of):kf()})}function Pf(){if(Tf===0){var e=ka;e===0&&(e=Je,Je<<=1,!(Je&261888)&&(Je=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:sn(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[ht]||null).action),o=r.submitter;o&&(t=(t=o[ht]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new On(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);qs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),qs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<ri.length;Lf++){var Rf=ri[Lf];ii(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}ii(Yr,`onAnimationEnd`),ii(Xr,`onAnimationIteration`),ii(Zr,`onAnimationStart`),ii(`dblclick`,`onDoubleClick`),ii(`focusin`,`onFocus`),ii(`focusout`,`onBlur`),ii(Qr,`onTransitionRun`),ii($r,`onTransitionStart`),ii(ei,`onTransitionCancel`),ii(ti,`onTransitionEnd`),Mt(`onMouseEnter`,[`mouseout`,`mouseover`]),Mt(`onMouseLeave`,[`mouseout`,`mouseover`]),Mt(`onPointerEnter`,[`pointerout`,`pointerover`]),Mt(`onPointerLeave`,[`pointerout`,`pointerover`]),jt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),jt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),jt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),jt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),jt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),jt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`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(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){li(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){li(e)}i.currentTarget=null,a=c}}}}function Hf(e,t){var n=t[q];n===void 0&&(n=t[q]=new Set);var r=e+`__bubble`;n.has(r)||(Kf(t,e,2,!1),n.add(r))}function Uf(e,t,n){var r=0;t&&(r|=4),Kf(n,e,r,t)}var Wf=`_reactListening`+Math.random().toString(36).slice(2);function Gf(e){if(!e[Wf]){e[Wf]=!0,kt.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Uf(t,!1,e),Uf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wf]||(t[Wf]=!0,Uf(`selectionchange`,!1,t))}}function Kf(e,t,n,r){switch(Th(t)){case 2:var i=yh;break;case 8:i=bh;break;default:i=xh}n=i.bind(null,t,n,e),i=void 0,!vn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function qf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Ct(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}hn(function(){var r=a,i=un(n),s=[];a:{var c=ni.get(e);if(c!==void 0){var l=On,u=e;switch(e){case`keypress`:if(Cn(n)===0)break a;case`keydown`:case`keyup`:l=Kn;break;case`focusin`:u=`focus`,l=Ln;break;case`focusout`:u=`blur`,l=Ln;break;case`beforeblur`:case`afterblur`:l=Ln;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Fn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=In;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Yn;break;case Yr:case Xr:case Zr:l=Rn;break;case ti:l=Xn;break;case`scroll`:case`scrollend`:l=An;break;case`wheel`:l=Zn;break;case`copy`:case`cut`:case`paste`:l=zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=qn;break;case`submit`:l=Jn;break;case`toggle`:case`beforetoggle`:l=Qn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=gn(m,p),g!=null&&d.push(Jf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==ln&&(u=n.relatedTarget||n.fromElement)&&(Ct(u)||u[gt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Ct(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Fn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=qn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Tt(c),h=l==null?u:Tt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Ct(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,Xf):null,c!==null&&Zf(s,u,c,d,!1),l!==null&&f!==null&&Zf(s,f,l,d,!0)))}a:{if(c=r?Tt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=vr;else if(fr(c)){if(yr)_=Or;else{_=Er;var v=Tr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&rn(r.elementType)&&(_=vr):_=Dr;if(_&&=_(e,r)){pr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Tt(r):window,e){case`focusin`:(fr(v)||v.contentEditable===`true`)&&(zr=v,Br=r,Vr=null);break;case`focusout`:Vr=Br=zr=null;break;case`mousedown`:Hr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Hr=!1,Ur(s,n,i);break;case`selectionchange`:if(Rr)break;case`keydown`:case`keyup`:Ur(s,n,i)}var y;if(er)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else cr?or(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(rr&&n.locale!==`ko`&&(cr||b!==`onCompositionStart`?b===`onCompositionEnd`&&cr&&(y=Sn()):(X=i,bn=`value`in X?X.value:X.textContent,cr=!0)),v=Yf(r,b),0<v.length&&(b=new Bn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=sr(n),y!==null&&(b.data=y)))),(y=nr?lr(e,n):ur(e,n))&&(b=Yf(r,`onBeforeInput`),0<b.length&&(v=new Bn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),If(s,e,r,n,i)}Vf(s,t)})}function Jf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Yf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=gn(e,n),i!=null&&r.unshift(Jf(e,i,a)),i=gn(e,t),i!=null&&r.push(Jf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Xf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=gn(n,a),l!=null&&o.unshift(Jf(n,l,c))):i||(l=gn(n,a),l!=null&&o.push(Jf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Qf=/\r\n?/g,$f=/\u0000|\uFFFD/g;function ep(e){return(typeof e==`string`?e:``+e).replace(Qf,`
10
- `).replace($f,``)}function tp(e,t){return t=ep(t),ep(e)===t}function np(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||en(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&en(e,``+r);else return;break;case`className`:Bt(e,`class`,r);break;case`tabIndex`:Bt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Bt(e,n,r);break;case`style`:nn(e,r,o);return;case`data`:if(t!==`object`){Bt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=sn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&np(e,t,`name`,a.name,a,null),np(e,t,`formEncType`,a.formEncType,a,null),np(e,t,`formMethod`,a.formMethod,a,null),np(e,t,`formTarget`,a.formTarget,a,null)):(np(e,t,`encType`,a.encType,a,null),np(e,t,`method`,a.method,a,null),np(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=sn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=cn);return;case`onScroll`:r!=null&&Hf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Hf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=sn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`: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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Hf(`beforetoggle`,e),Hf(`toggle`,e),zt(e,`popover`,r);break;case`xlinkActuate`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:zt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=an.get(n)||n,zt(e,n,r);else return}Lt=!0}function rp(e,t,n,r,a,o){switch(n){case`style`:nn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)en(e,r);else if(typeof r==`number`||typeof r==`bigint`)en(e,``+r);else return;break;case`onScroll`:r!=null&&Hf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Hf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=cn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!At.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[ht]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Lt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):zt(e,n,r)}return}Lt=!0}function ip(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Hf(`error`,e),Hf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:np(e,t,o,s,n,null)}}a&&np(e,t,`srcSet`,n.srcSet,n,null),r&&np(e,t,`src`,n.src,n,null);return;case`input`:Hf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:np(e,t,r,d,n,null)}}Xt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Hf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:np(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Qt(e,!!r,n,!0):Qt(e,!!r,t,!1);return;case`textarea`:for(s in Hf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:np(e,t,s,c,n,null)}J(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:np(e,t,l,r,n,null)}return;case`dialog`:Hf(`beforetoggle`,e),Hf(`toggle`,e),Hf(`cancel`,e),Hf(`close`,e);break;case`iframe`:case`object`:Hf(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Hf(zf[r],e);break;case`image`:Hf(`error`,e),Hf(`load`,e);break;case`details`:Hf(`toggle`,e);break;case`embed`:case`source`:case`link`:Hf(`error`,e),Hf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:np(e,t,u,r,n,null)}return;default:if(rn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&rp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&np(e,t,c,r,n,null))}var ap={};function op(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||np(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Lt=!0),o=m;break;case`name`:m!==f&&(Lt=!0),a=m;break;case`checked`:m!==f&&(Lt=!0),u=m;break;case`defaultChecked`:m!==f&&(Lt=!0),d=m;break;case`value`:m!==f&&(Lt=!0),s=m;break;case`defaultValue`:m!==f&&(Lt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&np(e,t,p,m,r,f)}}Yt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||np(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Lt=!0),p=o;break;case`defaultValue`:o!==l&&(Lt=!0),c=o;break;case`multiple`:o!==l&&(Lt=!0),s=o;default:o!==l&&np(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Qt(e,!!n,n?[]:``,!1):Qt(e,!!n,t,!0)):Qt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:np(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Lt=!0),p=a;break;case`defaultValue`:a!==o&&(Lt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&np(e,t,s,a,r,o)}$t(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:np(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Lt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:np(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&np(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:np(e,t,u,p,r,m)}return;default:if(rn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&rp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||rp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&np(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||np(e,t,f,p,r,m)}function sp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function cp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&sp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&sp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var lp=null,up=null;function dp(e){return e.nodeType===9?e:e.ownerDocument}function fp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function pp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function mp(e,t,n,r){return n=dp(n).createElement(e),n[mt]=r,n[ht]=t,ip(n,e,t),Dt(n),n}function hp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var gp=null;function _p(){var e=window.event;return e&&e.type===`popstate`?e!==gp&&(gp=e,!0):(gp=null,!1)}var vp=typeof setTimeout==`function`?setTimeout:void 0,yp=typeof clearTimeout==`function`?clearTimeout:void 0,bp=typeof Promise==`function`?Promise:void 0,xp=typeof requestAnimationFrame==`function`?requestAnimationFrame:vp,Sp=typeof queueMicrotask==`function`?queueMicrotask:bp===void 0?vp:function(e){return bp.resolve(null).then(e).catch(Cp)};function Cp(e){setTimeout(function(){throw e})}function wp(e){return e===`head`}function Tp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Uh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)ym(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,ym(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[bt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&ym(e.ownerDocument.body)}n=i}while(n);Uh(t)}function Ep(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Dp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Op(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function kp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Ap(e){return kp(e.getBoundingClientRect(),getComputedStyle(e),e)}function jp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return kp(t,n,e)}function Mp(e){return e.documentElement.clientHeight}function Np(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Pp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Mp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Qm(f),u>th){s.length=o;break}f=new Promise(Np.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Fp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Fp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Fp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Fp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Ip(e){return{name:e,group:new Fp(`group`,e),imagePair:new Fp(`image-pair`,e),old:new Fp(`old`,e),new:new Fp(`new`,e)}}function Lp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Lp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Hp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Bp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Rp,e,s,r)}this._eventListeners=a}};function Rp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Lp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Hp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Bp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,zp,e,n,i),r.splice(t,1),a!==null&&a()}};function zp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Bp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Vp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Hp(e,t,n,r){if(e.length===0)return-1;r=Vp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Vp(a.optionsOrUseCapture)===r)return i}return-1}Lp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Bp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Bp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Lp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Up,e,void 0,void 0)};function Up(e,t){return e.tag!==6&&(e=b(e),hm(e,t))}Lp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Wp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Up(t[n],e);n--);};function Wp(e,t){return t.push(e),!1}Lp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=dp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Gp,e,void 0,void 0))};function Gp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Lp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Kp,e,void 0,void 0)};function Kp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Lp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,qp,e,void 0,void 0);for(var n=t=0;n<Jp.length;n++){var r=Jp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Jp[t++]=r}Jp.length=t}};function qp(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var Jp=[],Yp=!1;function Xp(e,t,n){Jp.push({fragmentInstance:e,observer:t,instance:n}),Yp||(Yp=!0,gm(function(){Yp=!1;var e=Jp;Jp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Lp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,Zp,e,void 0,void 0),e};function Zp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Lp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Lp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Wp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Qp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Qp(e,t,n,r,i){var a=Ct(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function $p(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Lp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Wp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),$p(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),$p(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function em(e,t){return e=b(e),tm(e,t),!1}function tm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function nm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Bp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Jp.length;i++){var a=Jp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Jp[r++]=a)}Jp.length=r,n.observe(e)}),tm(e,t))}function rm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Bp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Xp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function im(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:im(n),St(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function am(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[bt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=dm(e.nextSibling),e===null)break}return null}function om(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=dm(e.nextSibling),e===null))return null;return e}function sm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=dm(e.nextSibling),e===null))return null;return e}function cm(e){return e.data===`$?`||e.data===`$~`}function lm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function um(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function dm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var fm=null;function pm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return dm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function mm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function hm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function gm(e){xp(function(){xp(function(t){return e(t)})})}function _m(e,t,n){switch(t=dp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function vm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&np(e,t,r,null,ap,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===cn&&(e.onclick=null),St(e)}function ym(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);St(e)}var bm=new Map,xm=new Set;function Sm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Cm=oe.d;oe.d={f:wm,r:Tm,D:Om,C:km,L:Am,m:jm,X:Nm,S:Mm,M:Pm};function wm(){var e=Cm.f(),t=zd();return e||t}function Tm(e){var t=wt(e);t!==null&&t.tag===5&&t.type===`form`?Ys(t):Cm.r(e)}var Em=typeof document>`u`?null:document;function Dm(e,t,n){var r=Em;if(r&&typeof t==`string`&&t){var i=Jt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),xm.has(i)||(xm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),ip(t,`link`,e),Dt(t),r.head.appendChild(t)))}}function Om(e){Cm.D(e),Dm(`dns-prefetch`,e,null)}function km(e,t){Cm.C(e,t),Dm(`preconnect`,e,t)}function Am(e,t,n){Cm.L(e,t,n);var r=Em;if(r&&e&&t){var i=`link[rel="preload"][as="`+Jt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Jt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Jt(n.imageSizes)+`"]`)):i+=`[href="`+Jt(e)+`"]`;var a=i;switch(t){case`style`:a=Im(e);break;case`script`:a=Bm(e)}if(!(bm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),bm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lm(a))||t===`script`&&r.querySelector(Vm(a))))){var o=r.createElement(`link`);ip(o,`link`,e),t===`style`&&(o[xt]=!0,o.onload=o.onerror=function(){Ot(o)}),Dt(o),r.head.appendChild(o)}}}function jm(e,t){Cm.m(e,t);var n=Em;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Jt(r)+`"][href="`+Jt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bm(e)}if(!bm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),bm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vm(a)))return}r=n.createElement(`link`),ip(r,`link`,e),Dt(r),n.head.appendChild(r)}}}function Mm(e,t,n){Cm.S(e,t,n);var r=Em;if(r&&e){var i=Et(r).hoistableStyles,a=Im(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=bm.get(a))&&Wm(e,n);var c=o=r.createElement(`link`);Dt(c),ip(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Um(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nm(e,t){Cm.X(e,t);var n=Em;if(n&&e){var r=Et(n).hoistableScripts,i=Bm(e),a=r.get(i);a||(a=n.querySelector(Vm(i)),a||(e=D({src:e,async:!0},t),(t=bm.get(i))&&Gm(e,t),a=n.createElement(`script`),Dt(a),ip(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t){Cm.M(e,t);var n=Em;if(n&&e){var r=Et(n).hoistableScripts,i=Bm(e),a=r.get(i);a||(a=n.querySelector(Vm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=bm.get(i))&&Gm(e,t),a=n.createElement(`script`),Dt(a),ip(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Fm(e,t,n,r){var a=(a=he.current)?Sm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Im(n.href),t=Et(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Im(n.href);var o=Et(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Lm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=bm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},bm.set(e,o)),zm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Bm(n),t=Et(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Im(e){return`href="`+Jt(e)+`"`}function Lm(e){return`link[rel="stylesheet"][`+e+`]`}function Rm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function zm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[xt]){r.loading=1;return}}else t=e.createElement(`link`),t[xt]=!0,t.onload=t.onerror=Ot.bind(null,t),ip(t,`link`,n),Dt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Bm(e){return`[src="`+Jt(e)+`"]`}function Vm(e){return`script[async]`+e}function Hm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Jt(n.href)+`"]`);if(r)return t.instance=r,Dt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Dt(r),ip(r,`style`,a),Um(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Im(n.href);var o=e.querySelector(Lm(a));if(o)return t.state.loading|=4,t.instance=o,Dt(o),o;r=Rm(n),(a=bm.get(a))&&Wm(r,a),o=(e.ownerDocument||e).createElement(`link`),Dt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),ip(o,`link`,r),t.state.loading|=4,Um(o,n.precedence,e),t.instance=o;case`script`:return o=Bm(n.src),(a=e.querySelector(Vm(o)))?(t.instance=a,Dt(a),a):(r=n,(a=bm.get(o))&&(r=D({},n),Gm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Dt(a),ip(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Um(r,n.precedence,e));return t.instance}function Um(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Gm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Km=null;function qm(e,t,n){if(Km===null){var r=new Map,i=Km=new Map;i.set(n,r)}else i=Km,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[bt]||a[mt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Jm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Ym(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Xm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Zm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Qm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function $m(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Qm(t),e.suspenseyImages.push(t)),e=ah.bind(e),t.decode().then(e,e))}function eh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Im(r.href),a=t.querySelector(Lm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ih.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Dt(a);return}a=t.ownerDocument||t,r=Rm(r),(i=bm.get(i))&&Wm(r,i),a=a.createElement(`link`),Dt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),ip(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ih.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var th=0;function nh(e,t){return e.stylesheets&&e.count===0&&sh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&sh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&th===0&&(th=62500*cp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>th?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function rh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)sh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ih(){this.count--,rh(this)}function ah(){this.imgCount--,rh(this)}var oh=null;function sh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,oh=new Map,t.forEach(ch,e),oh=null,ih.call(e))}function ch(e,t){if(!(t.state.loading&4)){var n=oh.get(e);if(n)var r=n.get(null);else{n=new Map,oh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ih.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var lh={$$typeof:F,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function uh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=rt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rt(0),this.hiddenUpdates=rt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function dh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new uh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=xi(3,null,null,t),e.current=a,a.stateNode=e,t=Sa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},io(a),e}function fh(e){return e?(e=yi,e):yi}function ph(e,t,n,r,i,a){i=fh(i),r.context===null?r.context=i:r.pendingContext=i,r=oo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=so(e,r,t),n!==null&&(Pd(n,e,t),co(n,e,t))}function mh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hh(e,t){mh(e,t),(e=e.alternate)&&mh(e,t)}function gh(e){if(e.tag===13||e.tag===31){var t=gi(e,67108864);t!==null&&Pd(t,e,67108864),hh(e,67108864)}}function _h(e){if(e.tag===13||e.tag===31){var t=jd();t=lt(t);var n=gi(e,t);n!==null&&Pd(n,e,t),hh(e,t)}}var vh=!0;function yh(e,t,n,r){var i=G.T;G.T=null;var a=oe.p;try{oe.p=2,xh(e,t,n,r)}finally{oe.p=a,G.T=i}}function bh(e,t,n,r){var i=G.T;G.T=null;var a=oe.p;try{oe.p=8,xh(e,t,n,r)}finally{oe.p=a,G.T=i}}function xh(e,t,n,r){if(vh){var i=Sh(r);if(i===null)qf(e,t,r,Ch,n),Nh(e,r);else if(Fh(i,e,t,n,r))r.stopPropagation();else if(Nh(e,r),t&4&&-1<Mh.indexOf(e)){for(;i!==null;){var a=wt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-We(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(Yu&6)&&(gd=Ne()+500,Df(0,!1))}}break;case 31:case 13:s=gi(a,2),s!==null&&Pd(s,a,2),zd(),hh(a,2)}if(a=Sh(r),a===null&&qf(e,t,r,Ch,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else qf(e,t,r,null,n)}}function Sh(e){return e=un(e),wh(e)}var Ch=null;function wh(e){if(Ch=null,e=Ct(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ch=e,null}function Th(e){switch(e){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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Pe()){case Fe:return 2;case Ie:return 8;case Le:case Re:return 32;case ze:return 268435456;default:return 32}default:return 32}}var Eh=!1,Dh=null,Oh=null,kh=null,Ah=new Map,Q=new Map,jh=[],Mh=`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 Nh(e,t){switch(e){case`focusin`:case`focusout`:Dh=null;break;case`dragenter`:case`dragleave`:Oh=null;break;case`mouseover`:case`mouseout`:kh=null;break;case`pointerover`:case`pointerout`:Ah.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Q.delete(t.pointerId)}}function Ph(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=wt(t),t!==null&&gh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Fh(e,t,n,r,i){switch(t){case`focusin`:return Dh=Ph(Dh,e,t,n,r,i),!0;case`dragenter`:return Oh=Ph(Oh,e,t,n,r,i),!0;case`mouseover`:return kh=Ph(kh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ah.set(a,Ph(Ah.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Q.set(a,Ph(Q.get(a)||null,e,t,n,r,i)),!0}return!1}function Ih(e){var t=Ct(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ft(e.priority,function(){_h(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ft(e.priority,function(){_h(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Lh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ln=r,n.target.dispatchEvent(r),ln=null}else return t=wt(n),t!==null&&gh(t),e.blockedOn=n,!1;t.shift()}return!0}function Rh(e,t,n){Lh(e)&&n.delete(t)}function zh(){Eh=!1,Dh!==null&&Lh(Dh)&&(Dh=null),Oh!==null&&Lh(Oh)&&(Oh=null),kh!==null&&Lh(kh)&&(kh=null),Ah.forEach(Rh),Q.forEach(Rh)}function Bh(e,n){e.blockedOn===n&&(e.blockedOn=null,Eh||(Eh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,zh)))}var Vh=null;function Hh(e){Vh!==e&&(Vh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vh===e&&(Vh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(wh(r||n)===null)continue;break}var a=wt(n);a!==null&&(e.splice(t,3),t-=3,qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Uh(e){function t(t){return Bh(t,e)}Dh!==null&&Bh(Dh,e),Oh!==null&&Bh(Oh,e),kh!==null&&Bh(kh,e),Ah.forEach(t),Q.forEach(t);for(var n=0;n<jh.length;n++){var r=jh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<jh.length&&(n=jh[0],n.blockedOn===null);)Ih(n),n.blockedOn===null&&jh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ht]||null;if(typeof a==`function`)o||Hh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ht]||null)s=o.formAction;else if(wh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Hh(n)}}}function Wh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Gh(e){this._internalRoot=e}Kh.prototype.render=Gh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ph(n,jd(),e,t,null,null)},Kh.prototype.unmount=Gh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ph(e.current,2,null,e,null,null),zd(),t[gt]=null}};function Kh(e){this._internalRoot=e}Kh.prototype.unstable_scheduleHydration=function(e){if(e){var t=dt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jh.length&&t!==0&&t<jh[n].priority;n++);jh.splice(n,0,e),n===0&&Ih(e)}};var qh=n.version;if(qh!==`19.3.0`)throw Error(i(527,qh,`19.3.0`));oe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Jh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:G,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Yh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yh.isDisabled&&Yh.supportsFiber)try{He=Yh.inject(Jh),K=Yh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=gc,s=_c,c=vc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=dh(e,1,!1,null,null,n,r,null,o,s,c,Wh),e[gt]=t.current,Gf(e),new Gh(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=o((e=>{var t=d().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return t.H.useMemoCache(e)}})),y=o(((e,t)=>{t.exports=v()})),b=l(d(),1),x={};function S(e,t){let n=b.useRef(x);return n.current===x&&(n.current=e(t)),n}var C=[],w=void 0;function T(){return w}function E(e){C.push(e)}function D(e){let t=(t,n)=>{let r=S(k).current,i;try{w=r;for(let e of C)e.before(r);i=e(t,n);for(let e of C)e.after(r);r.didInitialize=!0}finally{w=void 0}return i};return t.displayName=e.displayName||e.name,t}function O(e){return b.forwardRef(D(e))}function k(){return{didInitialize:!1}}function A(){}var j=Object.freeze([]),M=Object.freeze({}),N=typeof document<`u`?b.useLayoutEffect:()=>{};function P(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var F=P(`https://base-ui.com/production-error`,`Base UI`),I=b.createContext(void 0);function L(e){let t=b.useContext(I);if(t===void 0&&!e)throw Error(F(72));return t}function R(e){b.useEffect(e,j)}var z=0,B=class e{static create(){return new e}currentId=z;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=z,t()},e)}isStarted(){return this.currentId!==z}clear=()=>{this.currentId!==z&&(clearTimeout(this.currentId),this.currentId=z)};disposeEffect=()=>this.clear};function V(){let e=S(B.create).current;return R(e.disposeEffect),e}function H(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:U,platform:ee,maxTouchPoints:te}=H(),ne=U.toLowerCase(),W=ee.toLowerCase(),re=/^i(os$|p)/.test(W)||W===`macintel`&&te>1,ie=`android`,ae=W===ie||ne.includes(ie),G=!re&&W.startsWith(`mac`);W.startsWith(`win`),!ae&&/^(linux|chrome os)/.test(W);var oe=G||re,se=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),ce=!se&&ne.includes(`firefox`);!se&&ne.includes(`chrom`);var le=oe,ue=/jsdom|happydom/.test(ne);function de(e){e.preventDefault(),e.stopPropagation()}function fe(e){return`nativeEvent`in e}function pe(e){return e.pointerType===``&&e.isTrusted?!0:ae&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function me(e){return ue?!1:!ae&&e.width===0&&e.height===0||ae&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function he(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function ge(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function _e(){return typeof window<`u`}function ve(e){return xe(e)?(e.nodeName||``).toLowerCase():`#document`}function ye(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function be(e){return((xe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function xe(e){return _e()?e instanceof Node||e instanceof ye(e).Node:!1}function Se(e){return _e()?e instanceof Element||e instanceof ye(e).Element:!1}function Ce(e){return _e()?e instanceof HTMLElement||e instanceof ye(e).HTMLElement:!1}function we(e){return!_e()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ye(e).ShadowRoot}function Te(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ie(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ee(e){return/^(table|td|th)$/.test(ve(e))}function De(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Oe=/transform|translate|scale|rotate|perspective|filter/,ke=/paint|layout|strict|content/,Ae=e=>!!e&&e!==`none`,je;function Me(e){let t=Se(e)?Ie(e):e;return Ae(t.transform)||Ae(t.translate)||Ae(t.scale)||Ae(t.rotate)||Ae(t.perspective)||!Pe()&&(Ae(t.backdropFilter)||Ae(t.filter))||Oe.test(t.willChange||``)||ke.test(t.contain||``)}function Ne(e){let t=Re(e);for(;Ce(t)&&!Fe(t);){if(Me(t))return t;if(De(t))return null;t=Re(t)}return null}function Pe(){return je??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),je}function Fe(e){return/^(html|body|#document)$/.test(ve(e))}function Ie(e){return ye(e).getComputedStyle(e)}function Le(e){return Se(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Re(e){if(ve(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||we(e)&&e.host||be(e);return we(t)?t.host:t}function ze(e){let t=Re(e);return Fe(t)?(e.ownerDocument||e).body:Ce(t)&&Te(t)?t:ze(t)}function Be(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ze(e),i=r===e.ownerDocument?.body,a=ye(r);if(i){let e=Ve(a);return t.concat(a,a.visualViewport||[],Te(r)?r:[],e&&n?Be(e):[])}return t.concat(r,Be(r,[],n))}function Ve(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function He(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function K(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&we(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ue(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var We=`data-base-ui-focusable`,Ge=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Ke=`ArrowLeft`,qe=`ArrowRight`,Je=`ArrowUp`,Ye=`ArrowDown`,Xe=`data-starting-style`,Ze=`data-ending-style`,Qe={[Xe]:``},$e={[Ze]:``},et={transitionStatus(e){return e===`starting`?Qe:e===`ending`?$e:null}},tt=`data-open`,nt=`data-closed`,rt=`data-anchor-hidden`,it=`data-popup-open`,at=`data-pressed`,ot={[it]:``},st={[it]:``,[at]:``},ct={[tt]:``},lt={[nt]:``},ut={[rt]:``},dt={open(e){return e?ot:null}},ft={open(e){return e?st:null}},pt={open(e){return e?ct:lt},anchorHidden(e){return e?ut:null}},mt={...pt,...et},ht=`data-trigger-disabled`;function gt(e,t){if(!Se(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(ht);for(let[,e]of t.entries())if(K(e,n))return!e.hasAttribute(ht);return!1}function q(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function _t(e){return e.matches(`html,body`)}function vt(e){return Ce(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function yt(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ge}`)!=null}function bt(e){return e?e.getAttribute(`role`)===`combobox`&&vt(e):!1}function xt(e){if(!e||ue)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function St(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Ct(e,t){return t!=null&&!he(t)?0:typeof e==`function`?e():e}function wt(e,t,n){let r=Ct(e,n);return typeof r==`number`?r:r?.[t]}function Tt(e){return typeof e==`function`?e():e}function Et(e,t){return t||e===`click`||e===`mousedown`}function Dt(e){return e?.includes(`mouse`)&&e!==`mousedown`}var Ot=`none`,kt=`trigger-press`,At=`trigger-hover`,jt=`trigger-focus`,Mt=`outside-press`,Nt=`item-press`,Pt=`close-press`,Ft=`increment-press`,It=`decrement-press`,Lt=`input-change`,Rt=`input-clear`,zt=`input-blur`,Bt=`input-paste`,Vt=`input-press`,Ht=`focus-out`,Ut=`escape-key`,Wt=`list-navigation`,Gt=`keyboard`,Kt=`pointer`,qt=`wheel`,Jt=`cancel-open`,Yt=`sibling-open`,Xt=`disabled`,Zt=`missing`,Qt=`initial`,$t=`imperative-action`;function J(e,t,n,r){let i=!1,a=!1,o=r??M;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function en(e,t,n){let r=n??M;return{reason:e,event:t??new Event(`base-ui`),...r}}var tn=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Y=o(((e,t)=>{t.exports=tn()}))(),nn=b.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new B,currentIdRef:{current:null},currentContextRef:{current:null}});function rn(e,t){e.current=t.current}function an(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=b.useRef(n),a=b.useRef(n),o=b.useRef(null),s=b.useRef(null),c=V();return N(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:wt(i.current,`open`),close:wt(n,`close`)}},[n,o,i,a]),(0,Y.jsx)(nn.Provider,{value:b.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function on(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=b.useContext(nn),[f,p]=b.useState(!1),m=b.useRef(n);return N(()=>{m.current=n},[n]),N(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),N(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:wt(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,J(Ot))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),N(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,rn(o,c),d.clear()}},[l,a,o,i,c,d]),b.useMemo(()=>({activeIdRef:a,hasProvider:u,delayRef:o,isInstantPhase:f}),[a,u,o,f])}function sn(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function cn(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function ln(e,t,n,r){let i=S(dn).current;return fn(i,e,t,n,r)&&mn(i,[e,t,n,r]),i.callback}function un(e){let t=S(dn).current;return pn(t,e)&&mn(t,e),t.callback}function dn(){return{callback:null,cleanup:null,refs:[]}}function fn(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function pn(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function mn(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function hn(e){let t=S(gn,e).current;return t.next=e,N(t.effect),t}function gn(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var _n={...b},vn=_n.useInsertionEffect,yn=vn&&vn!==_n.useLayoutEffect?vn:e=>e();function X(e){let t=S(bn).current;return t.next=e,yn(t.effect),t.trampoline}function bn(){let e={next:void 0,callback:xn,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function xn(){}var Sn=null;globalThis.requestAnimationFrame;var Cn=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},wn=class e{static create(){return new e}static request(e){return Cn.request(e)}static cancel(e){return Cn.cancel(e)}currentId=Sn;request(e){this.cancel(),this.currentId=Cn.request(()=>{this.currentId=Sn,e()})}cancel=()=>{this.currentId!==Sn&&(Cn.cancel(this.currentId),this.currentId=Sn)};disposeEffect=()=>this.cancel};function Tn(){let e=S(wn.create).current;return R(e.disposeEffect),e}function En(e){return e?.ownerDocument||document}var Dn={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},On={...Dn,position:`fixed`,top:0,left:0},kn={...Dn,position:`absolute`},An=b.forwardRef(function(e,t){let[n,r]=b.useState();N(()=>{le&&se&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Y.jsx)(`span`,{...e,ref:t,style:On,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),jn=Math.min,Mn=Math.max,Nn=Math.round,Pn=Math.floor,Fn=e=>({x:e,y:e}),In={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ln(e,t,n){return Mn(e,jn(t,n))}function Rn(e,t){return typeof e==`function`?e(t):e}function zn(e){return e.split(`-`)[0]}function Bn(e){return e.split(`-`)[1]}function Vn(e){return e===`x`?`y`:`x`}function Hn(e){return e===`y`?`height`:`width`}function Un(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Wn(e){return Vn(Un(e))}function Gn(e,t,n){n===void 0&&(n=!1);let r=Bn(e),i=Wn(e),a=Hn(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=er(o)),[o,er(o)]}function Kn(e){let t=er(e);return[qn(e),t,qn(t)]}function qn(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Jn=[`left`,`right`],Yn=[`right`,`left`],Xn=[`top`,`bottom`],Zn=[`bottom`,`top`];function Qn(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Yn:Jn:t?Jn:Yn;case`left`:case`right`:return t?Xn:Zn;default:return[]}}function $n(e,t,n,r){let i=Bn(e),a=Qn(zn(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(qn)))),a}function er(e){let t=zn(e);return In[t]+e.slice(t.length)}function tr(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function nr(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:tr(e)}function rr(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ir(e,t,n){return Math.floor(e/t)!==n}function ar(e,t){return t<0||t>=e.length}function or(e,t){return cr(e.current,{disabledIndices:t})}function sr(e,t){return cr(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function cr(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&ur(e,a,r));return a}function lr(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!ur(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Pn(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!ur(e,r,s))return r}};d&&de(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=cr(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=cr(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}ar(e,f)&&(f=u)}if(n===`both`){let n=Pn(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&de(t),u%o===o-1?r&&(f=cr(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=cr(e,{startingIndex:u,disabledIndices:s}),r&&ir(f,o,n)&&(f=cr(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),ir(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&de(t),u%o===0?r&&(f=cr(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=cr(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&ir(f,o,n)&&(f=cr(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),ir(f,o,n)&&(f=u));let c=Pn(l/o)===n;ar(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:cr(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function ur(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!fr(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function dr(e){return e.visibility===`hidden`||e.visibility===`collapse`}function fr(e,t=e?Ie(e):null){return!e||!e.isConnected||!t||dr(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var pr=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function mr(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return we(n)?n.host:null}function hr(e){for(let t of Array.from(e.children))if(ve(t)===`summary`)return t;return null}function gr(e,t){let n=hr(t);return!!n&&(e===n||K(n,e))}function _r(e){let t=e?ve(e):``;return e!=null&&e.matches(pr)&&(t!==`summary`||e.parentElement!=null&&ve(e.parentElement)===`details`&&hr(e.parentElement)===e)&&(t!==`details`||hr(e)==null)&&(t!==`input`||e.type!==`hidden`)}function vr(e){if(!_r(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=mr(t)){let n=t!==e,r=ve(t)===`slot`;if(t.hasAttribute(`inert`)||n&&ve(t)===`details`&&!t.open&&!gr(e,t)||t.hasAttribute(`hidden`)||!r&&!yr(t,n))return!1}return!0}function yr(e,t){let n=Ie(e);return t?n.display!==`none`:fr(e,n)}function br(e){let t=e.tabIndex;if(t<0){let t=ve(e);if(t===`details`||t===`audio`||t===`video`||Ce(e)&&e.isContentEditable)return 0}return t}function xr(e){if(ve(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Sr(e,t){let n=xr(e);if(!n)return!0;let r=t.find(e=>{let t=xr(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=xr(e);return t?.name===n.name&&t.form===n.form})===n}function Cr(e){if(Ce(e)&&ve(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Ce(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function wr(e,t){Cr(e).forEach(e=>{_r(e)&&t.push(e),wr(e,t)})}function Tr(e,t,n){Cr(e).forEach(e=>{Ce(e)&&e.matches(t)&&n.push(e),Tr(e,t,n)})}function Er(e){return vr(e)&&br(e)>=0}function Dr(e){let t=[];return wr(e,t),t.filter(vr)}function Or(e){let t=Dr(e);return t.filter(e=>br(e)>=0&&Sr(e,t))}function kr(e,t){let n=Or(e),r=n.length;if(r===0)return;let i=He(En(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Ar(e){return kr(En(e).body,1)||e}function jr(e){return kr(En(e).body,-1)||e}function Mr(e,t){if(!e)return null;let n=Or(En(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Nr(e){return Mr(e,1)}function Pr(e){return Mr(e,-1)}function Fr(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!K(n,r)}function Ir(e){Or(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Lr(e){let t=[];Tr(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Rr(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Rr(e,t.id,n)])}function zr(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Br(e){return`data-base-ui-${e}`}var Vr=0;function Hr(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Vr);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),A;let o=requestAnimationFrame(a);return Vr=o,()=>{Vr===o&&(cancelAnimationFrame(o),Vr=0)}}var Ur={inert:new WeakMap,"aria-hidden":new WeakMap},Wr=`data-base-ui-inert`,Gr={inert:new WeakSet,"aria-hidden":new WeakSet},Kr=new WeakMap,qr=0;function Jr(e){return Gr[e]}function Yr(e){return e?we(e)?e.host:Yr(e.parentNode):null}var Xr=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Yr(t);return e.contains(n)?n:null}).filter(e=>e!=null),Zr=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Qr=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{ve(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function $r(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Xr(t,e),l=i?Qr(t,Zr(c),new Set(c)):[],u=[],d=[];if(a){let e=Ur[a],n=Jr(a);s=n,o=e;let r=Xr(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);Qr(t,Zr(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(Kr.get(e)||0)+1;Kr.set(e,t),d.push(e),t===1&&e.setAttribute(Wr,``)}),qr+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(Kr.get(e)||0)-1;Kr.set(e,t),t||e.removeAttribute(Wr)}),--qr,qr||(Ur.inert=new WeakMap,Ur[`aria-hidden`]=new WeakMap,Gr.inert=new WeakSet,Gr[`aria-hidden`]=new WeakSet,Kr=new WeakMap)}}function ei(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=En(e[0]).body;return $r(e,a,n,r,{mark:i})}var ti=0;function ni(e,t=`mui`){let[n,r]=b.useState(e),i=e||n;return b.useEffect(()=>{n??(ti+=1,r(`${t}-${ti}`))},[n,t]),i}var ri=_n.useId;function ii(e,t){if(ri!==void 0){let n=ri();return e??(t?`${t}-${n}`:n)}return ni(e,t)}var ai=19;function oi(e){return ai>=e}function si(e){if(!b.isValidElement(e))return null;let t=e,n=t.props;return(oi(19)?n?.ref:t.ref)??null}function ci(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function li(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function ui(e,t){return typeof e==`function`?e(t):e}function di(e,t){return typeof e==`function`?e(t):e}var fi={};function pi(e,t,n,r,i){if(!n&&!r&&!i&&!e)return hi(t);let a=hi(e);return t&&(a=gi(a,t)),n&&(a=gi(a,n)),r&&(a=gi(a,r)),i&&(a=gi(a,i)),a}function mi(e){if(e.length===0)return fi;if(e.length===1)return hi(e[0]);let t=hi(e[0]);for(let n=1;n<e.length;n+=1)t=gi(t,e[n]);return t}function hi(e){return bi(e)?{...xi(e,fi)}:_i(e)}function gi(e,t){return bi(t)?xi(t,e):vi(e,t)}function _i(e){let t={...e};for(let e in t){let n=t[e];yi(e,n)&&(t[e]=Ci(n))}return t}function vi(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=ci(e.style,r);break;case`className`:e[n]=Ti(e.className,r);break;default:e[n]=yi(n,r)?Si(e[n],r):r}}return e}function yi(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function bi(e){return typeof e==`function`}function xi(e,t){return bi(e)?e(t):e??fi}function Si(e,t){return t?e?(...n)=>{let r=n[0];if(Ei(r)){let i=r;wi(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Ci(t):e}function Ci(e){return e&&((...t)=>{let n=t[0];return Ei(n)&&wi(n),e(...t)})}function wi(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ti(e,t){return t?e?t+` `+e:t:e}function Ei(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Di(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=ji(r));let i=Oi(t,n,r);if(n.enabled===!1)return null;let a=n.state??M;return Mi(e,r,i,a)}function Oi(e,t,n){let{className:r,style:i}=e,{state:a=M,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?ui(r,a):void 0,d=l?di(i,a):void 0,f=l?li(a,c):M,p=l&&s?ki(s):void 0,m=l?ci(f,p)??{}:M;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?un([m.ref,si(n),...o]):ln(m.ref,si(n),o):ln(null,null)),l?(u!==void 0&&(m.className=Ti(m.className,u)),d!==void 0&&(m.style=ci(m.style,d)),m):M}function ki(e){return Array.isArray(e)?mi(e):pi(void 0,e)}var Ai=Symbol.for(`react.lazy`);function ji(e){if(e?.$$typeof!==Ai)return e;let t=b.Children.toArray(e)[0];return b.isValidElement(t)?t:e}function Mi(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=pi(n,t.props);return e.ref=n.ref,b.cloneElement(t,e)}if(e&&typeof e==`string`)return Ni(e,n);throw Error(F(8))}function Ni(e,t){return e===`button`?(0,b.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,b.createElement)(`img`,{alt:``,...t,key:t.key}):b.createElement(e,t)}var Pi={style:{transition:`none`}},Fi=`data-base-ui-click-trigger`,Ii={fallbackAxisSide:`none`},Li={fallbackAxisSide:`end`},Ri={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},zi=l(h(),1),Bi=b.createContext(null),Vi=()=>b.useContext(Bi),Hi=Br(`portal`);function Ui(e={}){let{ref:t,container:n,componentProps:r=M,elementProps:i}=e,a=ii(),o=Vi()?.portalNode,[s,c]=b.useState(null),[l,u]=b.useState(null),d=X(e=>{e!==null&&u(e)}),f=b.useRef(null);N(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(xe(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Di(`div`,r,{ref:[t,d],props:[{id:a,[Hi]:``},i]}),m=s&&p?zi.createPortal(p,s):null;return{node:l,nodeId:b.isValidElement(p)?p.props.id:void 0,subtree:m}}var Wi=b.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=Ui({container:o,ref:t,componentProps:e,elementProps:c}),f=b.useRef(null),p=b.useRef(null),m=b.useRef(null),h=b.useRef(null),[g,_]=b.useState(null),v=b.useRef(!1),y=g?.modal,x=g?.open,S=!!g&&!g.modal&&g.open&&!!l;b.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&Fr(e)&&(e.type===`focusin`?v.current&&=(Lr(l),!1):(Ir(l),v.current=!0))}return cn(sn(l,`focusin`,e,!0),sn(l,`focusout`,e,!0))},[l,y]),N(()=>{l&&x===!0&&v.current&&(Lr(l),v.current=!1)},[x,l]);let C=b.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,Y.jsxs)(b.Fragment,{children:[d,(0,Y.jsxs)(Bi.Provider,{value:C,children:[S&&l&&(0,Y.jsx)(An,{"data-type":`outside`,ref:f,onFocus:e=>{Fr(e,l)?m.current?.focus():jr(g?g.domReference:null)?.focus()}}),S&&l&&(0,Y.jsx)(`span`,{role:s,"aria-owns":u,style:Ri}),l&&zi.createPortal(a,l),S&&l&&(0,Y.jsx)(An,{"data-type":`outside`,ref:p,onFocus:e=>{Fr(e,l)?h.current?.focus():(Ar(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,J(`focus-out`,e.nativeEvent)))}})]})]})});function Gi(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Ki=class{nodesRef={current:[]};events=Gi();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},qi=b.createContext(null),Ji=b.createContext(null),Yi=()=>b.useContext(qi)?.id||null,Xi=e=>{let t=b.useContext(Ji);return e??t};function Zi(e){let t=ii(),n=Xi(e),r=Yi();return N(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Qi(e){let{children:t,id:n}=e,r=Yi();return(0,Y.jsx)(qi.Provider,{value:b.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function $i(e){let{children:t,externalTree:n}=e,r=S(()=>n??new Ki).current;return(0,Y.jsx)(Ji.Provider,{value:r,children:t})}function ea(e){return e==null?e:`current`in e?e.current:e}function ta(e,t){let n=ye(Ue(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var na=20,ra=[];function ia(){ra=ra.filter(e=>e.deref()?.isConnected)}function aa(e){ia(),e&&ve(e)!==`body`&&(ra.push(new WeakRef(e)),ra.length>na&&(ra=ra.slice(-20)))}function oa(){return ia(),ra[ra.length-1]?.deref()}function sa(e){return e?Er(e)?e:Or(e)[0]||e:null}function ca(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Dr(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Er(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function la(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:x}=h.context,S=X(()=>x.current.floatingContext?.nodeId),C=i===!1,w=bt(_)&&C,T=hn(i),E=hn(a),D=hn(l),O=hn(g),k=Xi(p),A=Vi(),j=b.useRef(!1),M=b.useRef(!1),P=b.useRef(!1),F=b.useRef(null),I=b.useRef(``),L=b.useRef(``),R=b.useRef(null),z=b.useRef(null),B=ln(R,f,A?.beforeInsideRef),H=ln(z,A?.afterInsideRef),U=V(),ee=V(),te=Tn(),ne=A!=null,W=St(v),re=X((e=W)=>e?Or(e):[]),ie=X(()=>m?.().filter(e=>e!=null)??[]);b.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&K(W,He(En(W)))&&re().length===0&&!w&&de(e)}return sn(En(W),`keydown`,e)},[r,W,s,w,re]),b.useEffect(()=>{if(r||!g)return;let e=En(W);function t(){P.current=!1}function n(e){let t=Ue(e),n=ie(),r=K(v,t)||K(_,t)||K(A?.portalNode,t)||n.some(e=>e===t||K(e,t));P.current=!r,L.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,ee.start(0,()=>{M.current=!1}))}function i(){L.current=`keyboard`}return cn(sn(e,`pointerdown`,n,!0),sn(e,`pointerup`,t,!0),sn(e,`pointercancel`,t,!0),sn(e,`keydown`,i,!0),t)},[r,v,_,W,g,A,ee,ie]),b.useEffect(()=>{if(r||!c)return;let e=En(W);function t(){M.current=!0,ee.start(0,()=>{M.current=!1})}function n(e){let t=Ue(e);Er(t)&&(F.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=Ue(t);s&&n==null&&i!=null&&K(v,i)&&aa(i),queueMicrotask(()=>{let a=S(),c=h.context.triggerElements,l=ie(),f=n?.hasAttribute(Br(`focus-guard`))&&[R.current,z.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,ea(d),ea(u)].includes(n),p=!(K(_,n)||K(v,n)||K(n,v)||K(A?.portalNode,n)||l.some(e=>e===n||K(e,n))||c.hasMatchingElement(e=>K(e,n))||f||k&&(Rr(k.nodesRef.current,a).find(e=>K(e.context?.elements.floating,n)||K(e.context?.elements.domReference,n))||zr(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,St(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&W&&ca(W),o&&r!==_&&!fr(i)&&He(e)===e.body){if(Ce(W)&&(W.focus(),o===`popup`)){te.request(()=>{W.focus()});return}let e=re(),t=F.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;Ce(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!s)&&n&&p&&!M.current&&(w||n!==oa())&&(j.current=!0,h.setOpen(!1,J(Ht,t)))})}function a(){P.current||(x.current.insideReactTree=!0,U.start(0,()=>{x.current.insideReactTree=!1}))}let l=Ce(_)?_:null;if(v||l)return cn(l&&sn(l,`focusout`,i),l&&sn(l,`pointerdown`,t),v&&sn(v,`focusin`,n),v&&sn(v,`focusout`,i),v&&A&&sn(v,`focusout`,a,!0))},[r,_,v,W,s,k,A,h,c,o,re,w,S,x,U,ee,te,u,d,ie]),b.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${Br(`portal`)}]`)||[]),t=(k?zr(k.nodesRef.current,S()):[]).find(e=>bt(e.context?.elements.domReference||null))?.context?.elements.domReference,n=ei([v,...e,R.current,z.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...ie(),t,ea(d),ea(u),w?_:null].filter(e=>e!=null),{ariaHidden:s||w,mark:!1}),i=ei([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,A,w,k,S,u,d,ie]),N(()=>{if(!g||r||!Ce(W))return;I.current=``,L.current=``;let e=En(W),t=He(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||K(W,t))return;let i=null,a=()=>(i??=re(W),i[0]||W),o;o=r===!0||r===null?a():ea(r),o||=a();let s=K(W,He(e));Hr(o,{preventScroll:o===W,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=He(e);return!(t!==o&&K(W,t))}})})},[r,g,W,re,T,D,O]),N(()=>{if(r||!W)return;let e=En(W),t=He(e),n=D.current==null;aa(t);function i(e){if(e.open||(I.current=ta(e.nativeEvent,L.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(pe(e.nativeEvent)||me(e.nativeEvent))j.current=!1;else{let e=!1;En(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&ve(t)!==`body`?t:null,s=n?o||a:a||o;return s||=oa()||null,typeof i==`boolean`?s:ea(i)||s||null}return()=>{y.off(`openchange`,i);let t=He(e),n=ie(),r=K(v,t)||n.some(e=>e===t||K(e,t))||k&&Rr(k.nodesRef.current,S(),!1).some(e=>K(e.context?.elements.floating,t)),o=E.current,s=I.current,c=a(s);queueMicrotask(()=>{let n=sa(c),i=typeof o!=`boolean`;if(o&&!j.current&&Ce(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,W,E,D,y,k,_,S,ie]),N(()=>{if(!se||g||!v)return;let e=He(En(v));Ce(e)&&vt(e)&&K(v,e)&&e.blur()},[g,v]),N(()=>{if(!r&&A)return A.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,s,g,h,c,_]),N(()=>{if(!r&&W)return ca(W),()=>{queueMicrotask(ia)}},[r,W]);let ae=!r&&(!s||!w)&&(ne||s);return(0,Y.jsxs)(b.Fragment,{children:[ae&&(0,Y.jsx)(An,{"data-type":`inside`,ref:B,onFocus:e=>{if(s){let e=re();Hr(e[e.length-1])}else A?.portalNode&&(j.current=!1,Fr(e,A.portalNode)?Ar(_)?.focus():ea(d??A.beforeOutsideRef)?.focus())}}),n,ae&&(0,Y.jsx)(An,{"data-type":`inside`,ref:H,onFocus:e=>{s?Hr(re()[0]):A?.portalNode&&(c&&(j.current=!0),Fr(e,A.portalNode)?jr(_)?.focus():ea(u??A.afterOutsideRef)?.focus())}})]})}function ua(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=kt}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=b.useRef(void 0),f=Tn(),p=V(),m=b.useMemo(()=>{function e(e,t,n,r){let i=J(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=he(e.pointerType,!0)&&me(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||he(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=Ue(o);if(vt(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}he(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return b.useMemo(()=>n?{reference:m}:M,[n,m])}function da(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function fa(e){return e!=null&&e.clientX!=null}function pa(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=b.useRef(!1),u=b.useRef(null),[d,f]=b.useState(),[p,m]=b.useState([]),h=X(e=>{i.set(`positionReference`,e)}),g=X((e,t,n)=>{l.current||(!c.current.openEvent||fa(c.current.openEvent))&&i.set(`positionReference`,da(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=X(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=he(d)?o:a;b.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=ye(o);function r(t){let n=Ue(t);K(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||fa(c.current.openEvent)?u.current=sn(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),b.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),b.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),b.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=b.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return b.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function ma(){return!1}function ha(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function ga(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=ma,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f,events:p}=l.context,m=Xi(c),h=X(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=X(()=>a),{escapeKey:y,outsidePress:x}=ha(s),S=b.useRef(!1),C=b.useRef(!1),w=b.useRef(!1),T=b.useRef(!1),E=b.useRef(!1),D=b.useRef(``),O=b.useRef(null),k=V(),A=V(),j=X(()=>{A.clear(),f.current.insideReactTree=!1}),M=X(e=>{let t=f.current.floatingContext?.nodeId;return(m?Rr(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=X(e=>q(e,l.select(`floatingElement`))||q(e,l.select(`domReferenceElement`))),P=X(e=>{o()&&l.setOpen(!1,J(kt,e.nativeEvent))}),F=X(e=>{if(!u||!n||!r||e.key!==`Escape`||E.current||!y&&M(`__escapeKeyBubbles`))return;let t=J(Ut,fe(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),I=X(()=>{f.current.insideReactTree=!0,A.start(0,j)}),L=X(e=>{if(!u||!n||e.button!==0)return;let t=Ue(e.nativeEvent);K(l.select(`floatingElement`),t)&&(S.current||(S.current=!0,C.current=!1))}),R=X(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&S.current&&(C.current=!0)});b.useEffect(()=>{function e(e){e.open||(T.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),b.useEffect(()=>{if(!u||!n)return u||(T.current=!1),j;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=x;let e=new B,t=new B,i=En(d);function a(){e.clear(),E.current=!0}function o(){e.start(se?5:0,()=>{E.current=!1})}function s(){w.current=!0,t.start(0,()=>{w.current=!1})}function c(){S.current=!1,C.current=!1}function p(){let e=D.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function h(e){let t=p();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function b(e){let t=f.current.floatingContext?.nodeId,n=m&&Rr(m.nodesRef.current,t).some(t=>q(e,t.context?.elements.floating));return N(e)||n}function A(e){if(h(e)){e.type!==`click`&&!N(e)&&(t.clear(),w.current=!1),j();return}if(f.current.insideReactTree){j();return}let n=Ue(e),r=`[${Br(`inert`)}]`,i=Se(n)?n.getRootNode():null,a=Array.from((we(i)?i:En(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>K(e,n))))return;let s=Se(n)?n:null;for(;s&&!Fe(s);){let e=Re(s);if(Fe(e)||!Se(e))break;s=e}if(!(a.length&&Se(n)&&!_t(n)&&!K(n,l.select(`floatingElement`))&&a.every(e=>!K(s,e)))){if(Ce(n)&&!(`touches`in e)){let t=Fe(n),r=Ie(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!b(e)){if(p()===`intentional`){if(e.detail!==0&&!pe(e)&&!T.current)return;if(w.current){t.clear(),w.current=!1;return}}(typeof g!=`function`||g(e))&&(M(`__outsidePressBubbles`)||(l.setOpen(!1,J(Mt,e)),j()))}}}function P(e){p()===`sloppy`&&e.pointerType!==`touch`&&l.select(`open`)&&n&&!N(e)&&A(e)}function I(e){if(p()!==`sloppy`||!l.select(`open`)||!n||N(e))return;let t=e.touches[0];t&&(O.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{O.current&&(O.current.dismissOnTouchEnd=!1,O.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=Ue(e);if(!n)return;let r=sn(n,e.type,()=>{t(e),r()})}function R(e){D.current=`touch`,L(e,I)}function z(e){k.clear(),e.type===`pointerdown`&&(e.button===0&&(T.current=!0),D.current=e.pointerType),(e.type!==`mousedown`||!O.current||O.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):A(e)})}function V(e){if(e.type===`pointercancel`&&(T.current=!1),!S.current)return;let n=C.current;if(c(),p()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!b(e)){if(n){s();return}(typeof g!=`function`||g(e))&&(t.clear(),w.current=!0,j())}}}function H(e){if(p()!==`sloppy`||!O.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-O.current.startX),r=Math.abs(t.clientY-O.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(O.current.dismissOnTouchEnd=!0),i>10&&(A(e),k.clear(),O.current=null)}function U(e){L(e,H)}function ee(e){p()===`sloppy`&&O.current&&!N(e)&&(O.current.dismissOnTouchEnd&&A(e),k.clear(),O.current=null)}function te(e){L(e,ee)}let ne=cn(r&&cn(sn(i,`keydown`,F),sn(i,`compositionstart`,a),sn(i,`compositionend`,o)),_&&cn(sn(i,`click`,z,!0),sn(i,`pointerdown`,z,!0),sn(i,`pointerup`,V,!0),sn(i,`pointercancel`,V,!0),sn(i,`mousedown`,z,!0),sn(i,`mouseup`,V,!0),sn(i,`touchstart`,R,{capture:!0,passive:!0}),sn(i,`touchmove`,U,{capture:!0,passive:!0}),sn(i,`touchend`,te,{capture:!0,passive:!0})));return()=>{ne(),e.clear(),t.clear(),c(),w.current=!1,j()}},[f,d,r,_,g,u,n,y,x,F,j,v,M,N,m,l,k]);let z=b.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),H=b.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return b.useMemo(()=>n?{reference:z,floating:H,trigger:z}:{},[n,z,H])}function _a(e,t,n){let{reference:r,floating:i}=e,a=Un(t),o=Wn(t),s=Hn(o),c=zn(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Bn(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function va(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Rn(t,e),p=nr(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=rr(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=rr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ya=50,ba=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:va},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_a(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ya&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=_a(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xa=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Rn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=zn(r),_=Un(o),v=zn(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[er(o)]:Kn(o)),x=p!==`none`;!d&&x&&b.push(...$n(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Gn(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Un(t)||T.every(e=>Un(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Un(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Sa=new Set([`left`,`top`]);async function Ca(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=zn(n),s=Bn(n),c=Un(n)===`y`,l=Sa.has(o)?-1:1,u=a&&c?-1:1,d=Rn(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var wa=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ca(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ta=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Rn(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Un(i),p=Vn(f),m=u[p],h=u[f],g=(e,t)=>Ln(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ea=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Rn(e,t),u={x:n,y:r},d=Un(i),f=Vn(d),p=u[f],m=u[d],h=Rn(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Sa.has(zn(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Da=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Rn(e,t),c=await i.detectOverflow(t,s),l=zn(n),u=Bn(n),d=Un(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=jn(p-c[m],g),y=jn(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Mn(c.left,c.right):S=p-2*Mn(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Oa(e){let t=Ie(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ce(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Nn(n)!==a||Nn(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ka(e){return Se(e)?e:e.contextElement}function Aa(e){let t=ka(e);if(!Ce(t))return Fn(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Oa(t),o=(a?Nn(n.width):n.width)/r,s=(a?Nn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ja=Fn(0);function Ma(e){let t=ye(e);return!Pe()||!t.visualViewport?ja:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Na(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ye(e)}function Pa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ka(e),o=Fn(1);t&&(r?Se(r)&&(o=Aa(r)):o=Aa(e));let s=Na(a,n,r)?Ma(a):Fn(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=ye(a),t=Se(r)?ye(r):r,n=e,i=Ve(n);for(;i&&t!==n;){let e=Aa(i),t=i.getBoundingClientRect(),r=Ie(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ye(i),i=Ve(n)}}return rr({width:u,height:d,x:c,y:l})}function Fa(e,t){let n=Le(e).scrollLeft;return t?t.left+n:Pa(be(e)).left+n}function Ia(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Fa(e,n),y:n.top+t.scrollTop}}function La(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=be(r),s=t?De(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Fn(1),u=Fn(0),d=Ce(r);if((d||!a)&&((ve(r)!==`body`||Te(o))&&(c=Le(r)),d)){let e=Pa(r);l=Aa(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Ia(o,c):Fn(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ra(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function za(e){let t=Le(e),n=e.ownerDocument.body,r=Mn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Mn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Fa(e),o=-t.scrollTop;return Ie(n).direction===`rtl`&&(a+=Mn(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Ba=25;function Va(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ye(e),a=be(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Pe()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Fa(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Ba&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ha(e,t){let n=Pa(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Aa(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ua(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Va(e,n,t);else if(t===`document`)r=za(be(e));else if(Se(t))r=Ha(t,n);else{let n=Ma(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return rr(r)}function Wa(e,t){let n=t.get(e);if(n)return n;let r=Be(e,[],!1).filter(e=>Se(e)&&ve(e)!==`body`),i=null,a=Ie(e).position===`fixed`,o=a?Re(e):e;for(;Se(o)&&!Fe(o);){let e=Ie(o),t=Me(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Re(o)}return t.set(e,r),r}function Ga(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?De(t)?[]:Wa(t,this._c):[].concat(n),r],o=Ua(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ua(t,a[e],i);s=Mn(n.top,s),c=jn(n.right,c),l=jn(n.bottom,l),u=Mn(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ka(e){let{width:t,height:n}=Oa(e);return{width:t,height:n}}function qa(e,t,n){let r=Ce(t),i=be(t),a=n===`fixed`,o=Pa(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Fn(0);if((r||!a)&&((ve(t)!==`body`||Te(i))&&(s=Le(t)),r)){let e=Pa(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Fa(i));let l=i&&!r&&!a?Ia(i,s):Fn(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Ja(e){return Ie(e).position===`static`}function Ya(e,t){if(!Ce(e)||Ie(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return be(e)===n&&(n=n.ownerDocument.body),n}function Xa(e,t){let n=ye(e);if(De(e))return n;if(!Ce(e)){let t=Re(e);for(;t&&!Fe(t);){if(Se(t)&&!Ja(t))return t;t=Re(t)}return n}let r=Ya(e,t);for(;r&&Ee(r)&&Ja(r);)r=Ya(r,t);return r&&Fe(r)&&Ja(r)&&!Me(r)?n:r||Ne(e)||n}var Za=async function(e){let t=this.getOffsetParent||Xa,n=this.getDimensions,r=await n(e.floating);return{reference:qa(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Qa(e){return Ie(e).direction===`rtl`}var $a={convertOffsetParentRelativeRectToViewportRelativeRect:La,getDocumentElement:be,getClippingRect:Ga,getOffsetParent:Xa,getElementRects:Za,getClientRects:Ra,getDimensions:Ka,getScale:Aa,isElement:Se,isRTL:Qa};function eo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function to(e,t,n){let r=null,i,a=be(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Pn(d),h=Pn(a.clientWidth-(u+f)),g=Pn(a.clientHeight-(d+p)),_=Pn(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Mn(0,jn(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!eo(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=ye(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function no(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ka(e),u=i||a?[...l?Be(l):[],...t?Be(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?to(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Pa(e):null;c&&g();function g(){let t=Pa(e);h&&!eo(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ro=wa,io=Ta,ao=xa,oo=Da,so=Ea,co=(e,t,n)=>{let r=new Map,i=n??{},a={...$a,...i.platform,_c:r};return ba(e,t,{...i,platform:a})},lo=typeof document<`u`?b.useLayoutEffect:function(){};function uo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!uo(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!uo(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function fo(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function po(e,t){let n=fo(e);return Math.round(t*n)/n}function mo(e){let t=b.useRef(e);return lo(()=>{t.current=e}),t}function ho(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=b.useState(r);uo(f,r)||p(r);let[m,h]=b.useState(null),[g,_]=b.useState(null),v=b.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=b.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=b.useRef(null),w=b.useRef(null),T=b.useRef(u),E=c!=null,D=mo(c),O=mo(i),k=mo(l),A=b.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),co(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!uo(T.current,t)&&(T.current=t,zi.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);lo(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=b.useRef(!1);lo(()=>(j.current=!0,()=>{j.current=!1}),[]),lo(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=b.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:y}),[v,y]),N=b.useMemo(()=>({reference:x,floating:S}),[x,S]),P=b.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=po(N.floating,u.x),r=po(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...fo(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var go=(e,t)=>{let n=ro(e);return{name:n.name,fn:n.fn,options:[e,t]}},_o=(e,t)=>{let n=io(e);return{name:n.name,fn:n.fn,options:[e,t]}},vo=(e,t)=>({fn:so(e).fn,options:[e,t]}),yo=(e,t)=>{let n=ao(e);return{name:n.name,fn:n.fn,options:[e,t]}},bo=(e,t)=>{let n=oo(e);return{name:n.name,fn:n.fn,options:[e,t]}},xo=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),So=o(((e,t)=>{t.exports=xo()})),Co=o((e=>{var t=d(),n=So();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),wo=o(((e,t)=>{t.exports=Co()})),To=So(),Eo=wo(),Do=oi(19)?Ao:jo;function Oo(e,t,n,r,i){return Do(e,t,n,r,i)}function ko(e,t,n,r,i){let a=b.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,To.useSyncExternalStore)(e.subscribe,a,a)}E({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,To.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Ao(e,t,n,r,i){let a=T();if(!a)return ko(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function jo(e,t,n,r,i){return(0,Eo.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Mo=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Oo(this,e,t,n,r)}},No=class extends Mo{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){b.useDebugValue(e);let n=this;N(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;N(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;N(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){b.useDebugValue(e);let n=this,r=t!==void 0;N(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return b.useDebugValue(e),Oo(this,this.selectors[e],t,n,r)}useContextCallback(e,t){b.useDebugValue(e);let n=X(t??A);this.context[e]=n}useStateSetter(e){let t=b.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function Po(){let[,e]=b.useState({});return b.useCallback(()=>{e({})},[])}var Fo={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Io=class extends No{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Gi(),nested:n,triggerElements:i},Fo),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&ge(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Lo(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=b.useRef(null);r===void 0&&f.current===null&&(f.current=new Io({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),N(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};Se(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function Ro(e,t=!1,n=!1,r=!1){let[i,a]=b.useState(e&&t?`idle`:void 0),[o,s]=b.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),N(()=>{if(!e&&o&&i!==`ending`&&n){let e=wn.request(()=>{a(`ending`)});return()=>{wn.cancel(e)}}},[e,o,i,n]),N(()=>{if(!e||t)return;let n=wn.request(()=>{a(void 0)});return()=>{wn.cancel(n)}},[t,e]),N(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=wn.request(()=>{a(`idle`)});return()=>{wn.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var zo=null;function Bo(e){if(!zo){let e=[];zo=e,queueMicrotask(()=>{zo=null,zi.flushSync(()=>{for(let t of e)t()})})}zo.push(e)}function Vo(e,t=!1,n=!1){let r=Tn();return X((i,a=null)=>{r.cancel();let o=ea(e);if(o==null)return;let s=o,c=()=>{if(!n){zi.flushSync(i);return}Bo(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(s.getAnimations().some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=Xe;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function Ho(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=X(a),s=Vo(r,n,i);b.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var Uo={tabIndex:-1,[We]:``};function Wo(e){return t=>t!==`touch`||e.current}function Go(e,t=!1){let n=ii(),r=Yi()!=null,i=S(()=>e(n,r)).current;return Lo({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Ko({handle:e,store:t}){return N(()=>e.attachStore(t),[e,t]),null}function qo(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Jo(e,t){let n=b.useRef(null);return X(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),qo(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),qo(t))})}function Yo(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function Xo(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Zo(e,t,n,r={}){let i=n.reason,a=i===At,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Xo(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=Yo(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?zi.flushSync(l):l()}function Qo(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Jo(e,n),o=X(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=X(e=>{a(e),e&&o(e)});return N(()=>(s(t.current),()=>s(null)),[s,t,n,e]),N(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function $o(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=b.useRef(null),i=e.useState(`open`);N(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=J(Ot);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function es(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=Ro(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=X(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Ho({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function ts(e,t){e.useSyncedValues(t),N(()=>()=>{e.update({activeTriggerProps:M,inactiveTriggerProps:M,popupProps:M})},[e])}function ns(e,t){N(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),N(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var rs=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function is(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Io({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:M,inactiveTriggerProps:M,popupProps:M}}var as=e=>e.triggerIdProp??e.activeTriggerId,os=e=>e.openProp??e.open,ss=e=>(e.popupElement?.id??e.floatingId)||void 0;function cs(e,t){return t!==void 0&&os(e)&&as(e)===t}function ls(e,t){return cs(e,t)?!0:t!==void 0&&os(e)&&as(e)==null&&e.triggerCount===1}var us={open:os,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:as,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:ss,isTriggerActive:(e,t)=>t!==void 0&&as(e)===t,isOpenedByTrigger:(e,t)=>cs(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&as(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ls(e,t)?ss(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function ds(e){let t=b.useCallback(t=>e===void 0?A:e.subscribeStore(t),[e]),n=b.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,To.useSyncExternalStore)(t,n,()=>e?.serverStore)}function fs(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=ii(),a=Yi()!=null,o=S(()=>new Io({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new rs,floatingId:i,syncOnly:!1,nested:a})).current;return N(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Se(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function ps(e){return ms(e,e.rootContext)}function ms(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=b.useState(null),[d,f]=b.useState(void 0),[p,m]=b.useState(void 0),h=b.useRef(null),g=Xi(r),_=b.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=ho({...e,elements:{..._,...l&&{reference:l}}}),y=Se(d)?d:null,x=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,x);let S=b.useCallback(e=>{let t=Se(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),C=b.useCallback(e=>{(Se(e)||e===null)&&(h.current=e,f(e)),(Se(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!Se(e))&&v.refs.setReference(e)},[v.refs,f]),w=b.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),T=b.useMemo(()=>({...v.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:h}),[v.refs,C,w,S]),E=b.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),D=b.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:T,elements:E,nodeId:n,rootStore:t}),[v,T,E,n,t,s,c]);return N(()=>{o&&(h.current=o)},[o]),N(()=>{t.context.dataRef.current.floatingContext=D;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=D)}),b.useMemo(()=>({...v,context:D,refs:T,elements:E,rootStore:t}),[v,T,E,D,t])}var hs=G&&se;function gs(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=b.useRef(!1),c=b.useRef(null),l=b.useRef(!0),u=V();b.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=ye(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&Ce(e)&&e===He(En(e))&&(s.current=!0,c.current=e)}function a(){l.current=!0}function o(){l.current=!1}return cn(sn(t,`blur`,r),hs&&sn(t,`keydown`,a,!0),hs&&sn(t,`pointerdown`,o,!0))},[i,n]),b.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);Se(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=b.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=Ue(t.nativeEvent);if(Se(a)){if(hs&&!t.relatedTarget){if(!l.current&&!vt(a))return}else if(!xt(a))return}let o=gt(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,J(jt,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,J(jt,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=Se(n)&&n.hasAttribute(Br(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=He(En(e));(n||t!==e)&&(K(o.current.floatingContext?.refs.floating.current,t)||K(e,t)||a||gt(n??t,i.context.triggerElements)||i.setOpen(!1,J(jt,r)))})}}},[o,r,i,u]);return b.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var _s=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new B,this.restTimeout=new B,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},vs=new WeakMap;function ys(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&vs.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),vs.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function bs(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=vs.get(n);a&&a!==e&&ys(a),ys(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,vs.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function xs(e){let t=e.context.dataRef.current,n=S(()=>t.hoverInteractionState??_s.create()).current;return t.hoverInteractionState||=n,R(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Ss(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=Xi(),d=Yi(),f=xs(a),p=V(),m=X(()=>Et(l.current.openEvent?.type,f.interactedInside)),h=X(()=>Dt(l.current.openEvent?.type)),g=X(()=>{ys(f)});N(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),b.useEffect(()=>g,[g]),N(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&Se(c)&&s){let e=c,t=s,n=En(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return bs(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),b.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&Rr(u.nodesRef.current,d).length>0)}function t(e){let t=wt(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,J(At,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=Ue(e);if(!yt(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(gt(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&Se(o)&&Rr(u.nodesRef.current,r,!1).some(e=>K(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){u&&d&&!e()&&p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,J(At,t)),u.events.emit(`floating.closed`,t)})}let y=s;return cn(y&&sn(y,`mouseenter`,c),y&&sn(y,`mouseleave`,_),y&&sn(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var Cs={current:null};function ws(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Cs,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=Xi(l),y=xs(h),x=b.useRef(!1),S=hn(i),C=hn(r),w=hn(o),T=hn(n),E=hn(p),D=hn(f),O=X(()=>Et(g.current.openEvent?.type,y.interactedInside)),k=X(()=>E.current?.()!==!1),A=X((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!K(e,t);if(!Se(n))return!1;let i=n;return r.hasMatchingElement(e=>K(e,i))&&(!e||!K(e,i))}),j=X(()=>{y.handler&&=(En(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),M=X(()=>{ys(y)});return u&&(y.handleCloseOptions=i?.__options),b.useEffect(()=>j,[j]),b.useEffect(()=>{if(!n)return;function e(e){e.open?x.current=!1:(x.current=e.reason===At,j(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,j]),b.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=wt(C.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,J(At,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,J(At,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!Se(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!he(y.pointerType))return;let t=Tt(w.current),n=wt(C.current,`open`,y.pointerType),r=Ue(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(Se(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(K(e,r)){s=e;break}}Se(i)&&Se(o)&&!h.context.triggerElements.hasElement(i)&&K(i,o)&&(s=o);let c=s!=null&&A(o,s,r),l=h.select(`open`),u=D.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&x.current,f=!c&&Se(s)&&Se(o)&&K(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){k()&&h.setOpen(!0,J(At,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&k()&&h.setOpen(!0,J(At,e,s))}):g&&k()&&h.setOpen(!0,J(At,e,s)))}function i(t){if(O()){M();return}j();let n=En(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!gt(t.relatedTarget,h.context.triggerElements)){if(S.current&&r){h.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=S.current({...r,tree:v,x:t.clientX,y:t.clientY,onClose(){M(),j(),T.current&&!O()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!K(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){K(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?sn(t,`mouseout`,o):void 0;return s?cn(sn(t,`mousemove`,r,{once:!0}),sn(t,`mouseenter`,r),sn(t,`mouseleave`,i),l):cn(sn(t,`mouseenter`,r),sn(t,`mouseleave`,i),l)},[j,M,g,C,h,n,S,y,u,A,O,a,s,w,c,v,T,d,D,k,m]),b.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=A(r,n,e.target);if(a&&!he(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;bs(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Tt(w.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,O())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&k()&&h.setOpen(!0,J(At,t,n))}y.pointerType===`touch`?zi.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,O,A,a,h,w,k])}var Ts=`Escape`;function Es(e){return se&&e.movementX===0&&e.movementY===0}function Ds(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Os(e,t){return Ds(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function ks(e,t,n){return Ds(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function As(e,t,n){return Ds(t,n?e===Ke:e===qe,e===Ye)}function js(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===Ts:Ds(t,n?e===qe:e===Ke,e===Je)}function Ms(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:x,grid:S}=t,C=S!=null,w=`rootStore`in e?e.rootStore:e,T=w.useState(`open`),E=w.useState(`floatingElement`),D=w.useState(`domReferenceElement`),O=w.context.dataRef,k=St(E),A=bt(D),j=hn(k),M=Yi(),P=Xi(x),F=b.useRef(f),I=b.useRef(o??-1),L=b.useRef(null),R=b.useRef(!0),z=X(e=>{i(I.current===-1?null:I.current,e)}),B=b.useRef(!!E),V=b.useRef(T),H=b.useRef(!1),U=b.useRef(!1),ee=b.useRef(null),te=hn(h),ne=hn(T),W=hn(o),re=hn(y),ie=Tn(),ae=Tn(),G=X(()=>{function e(e){d?P?.events.emit(`virtualfocus`,e):ee.current=Hr(e,{sync:H.current,preventScroll:!0})}let t=n.current[I.current],r=U.current;t&&e(t),(H.current?e=>e():e=>ie.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),fe&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});N(()=>{O.current.orientation=g},[O,g]),N(()=>{a&&(T&&E?(I.current=o??-1,F.current&&o!=null&&(U.current=!0,z())):B.current&&(I.current=-1,z()))},[a,T,E,o,z]),N(()=>{if(a){if(!T){H.current=!1;return}if(E){if(r==null){if(H.current=!1,W.current!=null)return;if(B.current&&(I.current=-1,G()),(!V.current||!B.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ae.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||ks(L.current,g,u)||l?or(n):sr(n),L.current=null,z())};t()}}else ar(n.current,r)||(I.current=r,G(),U.current=!1)}}},[a,T,E,r,W,l,n,g,u,z,G,ae]),N(()=>{if(!a||E||!P||d||!B.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=He(En(D??t??null)),r=e.some(e=>e.context&&K(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,E,D,P,M,d]),N(()=>{V.current=T,B.current=!!E}),N(()=>{T||(L.current=null,F.current=f)},[T,f]);let oe=r!=null,se=X(e=>{if(!ne.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),ce=X(()=>_??P?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),le=X(()=>or(n,te.current)),ue=X(e=>{if(R.current=!1,H.current=!0,e.which===229||!ne.current&&e.currentTarget===j.current)return;if(l&&js(e.key,g,u,C)){Os(e.key,ce())||de(e),w.setOpen(!1,J(Wt,e.nativeEvent)),Ce(D)&&(d?P?.events.emit(`virtualfocus`,D):D.focus());return}let t=I.current,r=or(n,h),i=sr(n,h);if(A||(e.key===`Home`&&(de(e),I.current=r,z(e)),e.key===`End`&&(de(e),I.current=i,z(e))),S!=null){let t=S(e,I.current,n,g,c,u,h,r,i);if(t!=null&&(I.current=t,z(e)),g===`both`)return}if(Os(e.key,g)){if(de(e),T&&!d&&He(e.currentTarget.ownerDocument)===e.currentTarget){I.current=ks(e.key,g,u)?r:i,z(e);return}ks(e.key,g,u)?c?t>=i?s&&t!==n.current.length?I.current=-1:(H.current=!1,I.current=r):I.current=cr(n.current,{startingIndex:t,disabledIndices:h}):I.current=Math.min(i,cr(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?I.current=n.current.length:(H.current=!1,I.current=i):I.current=cr(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):I.current=Math.max(r,cr(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),ar(n.current,I.current)&&(I.current=-1),z(e)}}),fe=b.useMemo(()=>({onFocus(e){H.current=!0,se(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){Es(e)||(H.current=!0,U.current=!1,p&&se(e))},onPointerLeave(e){if(!ne.current||!R.current||e.pointerType===`touch`)return;H.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&re.current&&(ee.current?.(),ee.current=null,I.current=-1,z(e),!d)){let e=j.current,t=He(En(e));e&&K(e,t)&&e.focus({preventScroll:!0})}}}),[se,ne,j,p,n,z,re,d]),he=b.useMemo(()=>d&&T&&oe&&{"aria-activedescendant":`${v}-${r}`},[d,T,oe,v,r]),ge=b.useMemo(()=>({...A?{}:he,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&T&&!d){let t=Ue(e.nativeEvent);if(t&&!K(j.current,t))return;de(e),w.setOpen(!1,J(Ht,e.nativeEvent)),Ce(D)&&D.focus();return}ue(e)},onPointerMove(e){Es(e)||(R.current=!0)}}),[he,ue,j,A,w,T,d,D]),_e=b.useMemo(()=>{function e(e){w.setOpen(!0,J(Wt,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&pe(e.nativeEvent)&&(F.current=!d)}function n(e){F.current=f,f===`auto`&&me(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(t){let n=w.select(`open`);R.current=!1;let r=t.key.startsWith(`Arrow`),i=As(t.key,ce(),u),a=Os(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return ue(t);if(n||m||!r){if(o){let e=Os(t.key,ce());L.current=l&&e?null:t.key}if(l){i&&(de(t),n?(I.current=le(),z(t)):e(t));return}a&&(W.current!=null&&(I.current=W.current),de(t),!n&&m?e(t):ue(t),n&&z(t))}},onFocus(e){w.select(`open`)&&!d&&(I.current=-1,z(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[ue,f,le,l,z,w,m,g,ce,u,W,d]),ve=b.useMemo(()=>({...he,..._e}),[he,_e]);return b.useMemo(()=>a?{reference:ve,floating:ge,item:fe,trigger:_e}:{},[a,ve,ge,_e,fe])}function Ns(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=V(),m=b.useRef(``),h=b.useRef(u??i??-1),g=b.useRef(null),_=X(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!fr(n)||n?.matches(`:disabled`)?!1:o==null||!ur(j,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&c(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(de(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(de(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),v=X(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);K(n,t)||K(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});N(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let y=b.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return b.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var Ps=.1,Fs=Ps*Ps,Is=.5;function Ls(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Rs(e,t,n,r,i,a,o,s,c,l){let u=!1;return Ls(e,t,n,r,i,a)&&(u=!u),Ls(e,t,i,a,o,s)&&(u=!u),Ls(e,t,o,s,c,l)&&(u=!u),Ls(e,t,c,l,n,r)&&(u=!u),u}function zs(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Bs(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Vs(e={}){let{blockPointerEvents:t=!1}=e,n=new B,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Fs;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Ue(r),g=r.type===`mouseleave`,_=K(u,h),v=K(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&Se(r.relatedTarget)&&K(u,r.relatedTarget))return;function y(){return!!(s&&Rr(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Bs(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Bs(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Bs(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Bs(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!zs(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Is/2:Is*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Is+1,o=C||T?S.bottom-Is:S.top,s=C?T?S.bottom-Is:S.top:S.bottom-Is;M=Rs(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Is/2:Is*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Is,o=C||T?S.top+Is:S.bottom,s=C?T?S.top+Is:S.bottom:S.top+Is;M=Rs(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Is/2:Is*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Is+1,o=w||E?S.right-Is:S.left,s=w?E?S.right-Is:S.left:S.right-Is;M=Rs(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Is/2:Is*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Is,o=w||E?S.left+Is:S.right,s=w?E?S.left+Is:S.right:S.left+Is;M=Rs(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var Hs={...us,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Us=class extends No{constructor(e,t,n){let r=new rs;super(Ws(e,r,t,n),Gs(r),Hs)}setOpen=(e,t)=>{Zo(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,J(kt,e))}};function Ws(e,t,n,r=!1){return{...is(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function Gs(e){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var Ks=D(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Go((e,t)=>new Us({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),$o(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:x}=es(h,p),S=p.useState(`isInstantPhase`),C=p.useState(`instantType`),w=p.useState(`lastOpenChangeReason`),T=b.useRef(null);N(()=>{m&&t&&p.setOpen(!1,J(Xt))},[m,t,p]),N(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),p.set(`instantType`,`delay`)):T.current!==null&&(p.set(`instantType`,T.current),T.current=null)},[x,S,w,C,p]),N(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),b.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,J($t))}),[y,p]);let E=h||_||!t&&a!==`none`;return(0,Y.jsxs)(I.Provider,{value:p,children:[l&&(0,Y.jsx)(Ko,{handle:l,store:p}),E&&(0,Y.jsx)(qs,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function qs({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=ga(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=pa(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=b.useMemo(()=>pi(a.reference,i.reference),[a.reference,i.reference]);return ts(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??M}),null}function Js(e){return ii(e,`base-ui`)}var Ys=b.createContext(void 0);function Xs(){return b.useContext(Ys)}var Zs=`data-base-ui-tooltip-trigger`;function Qs(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(Se(n))return n}}let t=e.target;return Se(t)?t:null}function $s(e){let t=e;for(;t;){let e=t.closest(`[${Zs}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&Se(n.host)?n.host:null}return null}var ec=O(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=L(!0),m=ds(a)??p;if(!m)throw Error(F(82));let h=Js(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=b.useRef(null),x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=Qo(h,y,m,{payload:o,closeOnClick:l,closeDelay:x}),w=Xs(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=on(v,{open:_}),k=xs(v);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=hn(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),I=b.useRef(!1),R=V(),z=b.useRef(void 0);function B(){return O&&T.current!=null?0:c??w??600}function H(e){let t=y.current;if(!t||!e)return!1;let n=$s(e);return n!==null&&n!==t&&K(t,n)}function U(e){let t=H(e);return I.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,R.clear()),t}let ee=ws(v,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?Vs():null,restMs:B,delay(){return u==null&&O?{close:wt(E.current,`close`)}:{close:x}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!I.current}}),te=gs(v,{enabled:!j}).reference,ne=e=>{let t=I.current,n=Qs(e),r=U(n),i=y.current,a=i&&n&&K(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,J(At,e));return}if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&he(z.current)){let t=()=>{!I.current&&!M.current&&!m.select(`open`)&&m.setOpen(!0,J(At,e,i))},n=B();n===0?(R.clear(),t()):R.start(n,t)}},W=m.useState(`triggerProps`,C);return Di(`button`,e,{state:{open:_},ref:[t,S,y],props:[ee,te,C||N!==`none`?W:void 0,{onMouseOver(e){ne(e.nativeEvent)},onFocus(e){H(Qs(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){I.current=!1,R.clear(),z.current=void 0},onPointerEnter(e){z.current=e.pointerType},onPointerDown(e){z.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[ht]:j?``:void 0,[Zs]:j?void 0:``},f],stateAttributesMapping:dt})}),tc=b.createContext(void 0);function nc(){let e=b.useContext(tc);if(e===void 0)throw Error(F(70));return e}var rc=b.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=Ui({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,Y.jsxs)(b.Fragment,{children:[l,c&&zi.createPortal(n,c)]})}),ic=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return L().useState(`mounted`)||n?(0,Y.jsx)(tc.Provider,{value:n,children:(0,Y.jsx)(rc,{ref:t,...r})}):null}),ac=b.createContext(void 0);function oc(){let e=b.useContext(ac);if(e===void 0)throw Error(F(71));return e}var sc=b.createContext(void 0);function cc(){return b.useContext(sc)?.direction??`ltr`}var lc=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Rn(e,t)||{};if(l==null)return{};let f=nr(u),p={x:n,y:r},m=Wn(i),h=Hn(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=Ln(k,j,A),N=!c.arrow&&Bn(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),uc=(e,t)=>{let{name:n,fn:r}=lc(e);return{name:n,fn:r,options:[e,t]}},dc={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},fc={sideX:`left`,sideY:`top`},pc=`--available-width`,mc=`--available-height`,hc=`--anchor-width`,gc=`--anchor-height`,_c=`--transform-origin`,vc=pc,yc=mc;function bc(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function xc(e,t,n){let{rects:r,placement:i}=e;return{side:bc(t,zn(i),n),align:Bn(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Sc(e){return Cc(e,ps)}function Cc(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,[w,T]=b.useState(null);!g&&w!==null&&T(null);let E=_.side||`flip`,D=_.align||`flip`,O=_.fallbackAxisSide||`end`,k=v?.crossAxis??!1,A=v?.rootBoundary,j=typeof n==`function`?n:void 0,M=X(j),P=j?M:n,F=hn(n),I=hn(g),L=cc()===`rtl`,R=w||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":L?`left`:`right`,"inline-start":L?`right`:`left`}[i],z=o===`center`?R:`${R}-${o}`,B=l;typeof B==`number`?B={top:B,right:B,bottom:B,left:B}:B&&={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0};let V=+(i===`bottom`),H=+(i===`top`),U=+(i===`right`),ee=+(i===`left`),te={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:B},ne=b.useRef(null),W=hn(a),re=hn(s),ie=typeof a==`function`?0:a,ae=typeof s==`function`?0:s,G=[];p&&G.push(p),G.push(go(e=>{let t=xc(e,i,L),n=typeof W.current==`function`?W.current(t):W.current,r=typeof re.current==`function`?re.current(t):re.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ie,ae,L,i]));let oe=D===`none`&&E!==`shift`,se=!oe&&(u||k||E===`shift`),ce=E===`none`?null:yo({...te,padding:{top:B.top+1+V,right:B.right+1+ee,bottom:B.bottom+1+H,left:B.left+1+U},mainAxis:!k&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O}),le=oe?null:_o({...te,rootBoundary:A,mainAxis:D!==`none`,crossAxis:se,limiter:u||k?void 0:vo(e=>{if(!ne.current)return{};let{width:t,height:n}=ne.current.getBoundingClientRect(),r=Un(zn(e.placement)),i=r===`y`?t:n,a=r===`y`?B.left+B.right:B.top+B.bottom;return{offset:i/2+a/2}})},[te,u,k,A,B,D]);E===`shift`||D===`shift`||o===`center`?G.push(le,ce):G.push(ce,le),G.push(bo({...te,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!I.current)return;let i=e.style;i.setProperty(vc,`${t}px`),i.setProperty(yc,`${n}px`);let a=ye(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(hc,`${u}px`),i.setProperty(gc,`${d}px`)}}),uc(e=>({element:ne.current||En(e.elements.floating).createElement(`div`),padding:ne.current?d:0,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=zn(r),u=Bn(r),d=Un(l)===`y`,f=ne.current,p=typeof a==`function`?a(xc(e,i,L)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return se&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(_c,d?`${m} ${h}`:`${h} ${m}`),{}}},dc,x),N(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let ue=b.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:de,elements:fe,x:pe,y:me,middlewareData:he,update:ge,placement:_e,context:ve,isPositioned:be,floatingStyles:xe}=t({rootContext:h,open:m?g:void 0,placement:z,middleware:G,strategy:r,whileElementsMounted:m?void 0:(...e)=>no(...e,ue),nodeId:y,externalTree:C}),{sideX:Se,sideY:Ce}=he.adaptiveOrigin||fc,we=be?r:`fixed`,Te=b.useMemo(()=>{let e;return e=be?x?{position:we,[Se]:pe,[Ce]:me}:{...xe,position:we}:{position:we,top:0,left:0},e[vc]=`100vw`,e[yc]=`100vh`,be||(e.opacity=0),e},[x,we,Se,pe,Ce,me,xe,be]),Ee=b.useRef(null);N(()=>{if(!g)return;let e=F.current,t=typeof e==`function`?e():e,n=(wc(t)?t.current:t)||null;n!==Ee.current&&(de.setPositionReference(n),Ee.current=n)},[g,de,P,F]),b.useEffect(()=>{if(!g)return;let e=F.current;typeof e!=`function`&&wc(e)&&e.current!==Ee.current&&(de.setPositionReference(e.current),Ee.current=e.current)},[g,de,P,F]),b.useEffect(()=>{if(m&&g&&fe.reference&&fe.floating)return no(fe.reference,fe.floating,ge,ue)},[m,g,fe,ge,ue]);let De=zn(_e),Oe=bc(i,De,L),ke=Bn(_e)||`center`,Ae=!!he.hide?.referenceHidden;N(()=>{S&&g&&be&&De!==R&&T(De)},[S,g,be,De,R]);let je=b.useMemo(()=>({position:`absolute`,top:he.arrow?.y,left:he.arrow?.x}),[he.arrow]),Me=he.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:Te,arrowStyles:je,arrowRef:ne,arrowUncentered:Me,side:Oe,align:ke,physicalSide:De,anchorHidden:Ae,refs:de,context:ve,isPositioned:be,update:ge}),[Te,je,ne,Me,Oe,ke,De,Ae,de,ve,be,ge])}function wc(e){return e!=null&&`current`in e}function Tc(e){return e===`starting`?Pi:M}function Ec(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Di(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Tc(r),i],stateAttributesMapping:pt})}var Dc=b.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Li,style:g,..._}=e,v=L(),y=nc(),x=v.useState(`open`),S=v.useState(`mounted`),C=v.useState(`trackCursorAxis`),w=v.useState(`disableHoverablePopup`),T=v.useState(`floatingRootContext`),E=v.useState(`instantType`),D=v.useState(`transitionStatus`),O=Sc({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),k=Ec(e,b.useMemo(()=>({open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,O.side,O.align,O.anchorHidden,C,E]),{styles:O.positionerStyles,transitionStatus:D,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!S,inert:!x||C===`both`||w});return(0,Y.jsx)(ac.Provider,{value:O,children:k})}),Oc=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=L(),{side:s,align:c}=oc(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Ho({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Ss(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Di(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Uo,f,Tc(d),a],stateAttributesMapping:mt})}),kc=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=b.useMemo(()=>({open:t,close:n}),[t,n]);return(0,Y.jsx)(Ys.Provider,{value:t,children:(0,Y.jsx)(an,{delay:i,timeoutMs:r,children:e.children})})};function Ac(e){return oi(19)?e:e?`true`:void 0}function jc({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=b.useRef(e!==void 0),[a,o]=b.useState(t);return[i&&e!==void 0?e:a,b.useCallback(e=>{i||o(e)},[])]}var Mc=b.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Nc(){return b.useContext(Mc)}function Pc(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=X(i),[,o]=b.useState(!1),s=S(Ic).current,c=S(Fc).current,l=b.useRef(0),u=b.useRef(!0),d=b.useRef(null),f=b.useRef(null),p=X(()=>{u.current||(u.current=!0,o(e=>!e))}),m=X((e,t)=>{c.set(e,t),p()}),h=X(e=>{c.delete(e),p()}),g=X(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!zc(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&Bc(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Rc(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=X(()=>{let[e,t]=Lc(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});N(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),N(()=>{u.current&&v()}),N(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=X(e=>(s.add(e),()=>{s.delete(e)})),x=b.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,Y.jsx)(Mc.Provider,{value:x,children:t})}function Fc(){return new Map}function Ic(){return new Set}function Lc(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>Bc(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Rc(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function zc(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function Bc(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function Vc(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var Hc=`ArrowUp`,Uc=`ArrowDown`,Wc=`ArrowLeft`,Gc=`ArrowRight`,Kc=new Set([Hc,Uc,Wc,Gc,`Home`,`End`]),qc=[`Shift`,`Control`,`Alt`,`Meta`];function Jc(e){return Ce(e)&&e.tagName===`INPUT`}function Yc(e){return!!(Jc(e)&&e.selectionStart!=null||Ce(e)&&e.tagName===`TEXTAREA`)}function Xc(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=Zc(e,t,`left`),a=Qc(e),o=Qc(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=Zc(e,t,`top`),r=Qc(e),i=Qc(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function Zc(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Qc(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var $c=`data-composite-item-active`;function el(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=j}=e,[p,m]=b.useState(0),h=r!=null,g=b.useRef(null),_=ln(g,c),v=b.useRef([]),y=b.useRef(!1),x=b.useRef(null),S=o??p,C=X((e,t=!1)=>{if(x.current=v.current[e]??null,(s??m)(e),t){let t=v.current[e];Xc(g.current,t,a,n)}}),w=X(e=>{if(e.size===0)return;if(y.current){let e=v.current,t=e.indexOf(x.current);if(t===-1){let t=e[S];!t||ur(e,S,d)?C(tl(e,d)):x.current=t}else t!==S&&C(t);return}y.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)C(i);else if(ur(t,S,d)){let e=cr(t,{disabledIndices:d});ar(t,e)||C(e)}Xc(g.current,r,a,n)});N(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(ur(e,S,d)){let t=cr(e,{disabledIndices:d});ar(e,t)||C(t)}},[d,o,S,v,C]);let T=X((e,t,n)=>i?i(e,t,n,v):n),E=X(e=>{let o=e.key===`Home`||e.key===`End`;if(!Kc.has(e.key)||!l&&o||nl(e,f)||!g.current)return;let s=a===`rtl`,c=s?Wc:Gc,p=s?Gc:Wc,m=n===`vertical`?Uc:c,_=n===`vertical`?Hc:p,y=Ue(e.nativeEvent);if(y!=null&&Yc(y)&&!Vc(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=S,x=or(v,d),w=sr(v,d);r!=null&&(b=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:S,loopFocus:t,maxIndex:w,minIndex:x,onLoop:T,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=x:e.key===`End`&&(b=w)),b===S&&(E||D)&&(t&&b===w&&E?(b=x,i&&(b=i(e,S,b,v))):t&&b===x&&D?(b=w,i&&(b=i(e,S,b,v))):b=cr(v.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==S&&!ar(v.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),C(b,!0),queueMicrotask(()=>{v.current[b]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=Ue(e.nativeEvent);t&&n!=null&&Yc(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:E},highlightedIndex:S,onHighlightedIndexChange:C,elementsRef:v,onMapChange:w,relayKeyboardEvent:E}}function tl(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!ur(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function nl(e,t){for(let n of qc)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}var rl=b.createContext(void 0);function il(e=!1){let t=b.useContext(rl);if(t===void 0&&!e)throw Error(F(16));return t}function al(e){let{render:t,className:n,style:r,refs:i=j,props:a=j,state:o=M,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:x=!1,tag:S=`div`,...C}=e,{props:w,highlightedIndex:T,onHighlightedIndexChange:E,elementsRef:D,onMapChange:O,relayKeyboardEvent:k}=el({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:cc(),disabledIndices:v,modifierKeys:y}),A=Di(S,e,{state:o,ref:i,props:[w,...a,C],stateAttributesMapping:s}),N=b.useMemo(()=>({highlightedIndex:T,onHighlightedIndexChange:E,highlightItemOnHover:x,relayKeyboardEvent:k}),[T,E,x,k]);return(0,Y.jsx)(rl.Provider,{value:N,children:(0,Y.jsx)(Pc,{elementsRef:D,onMapChange:e=>{h?.(e),O(e)},children:A})})}var ol=b.createContext(void 0);function sl(e){let t=b.useContext(ol);if(t===void 0&&!e)throw Error(F(69));return t}var cl=b.createContext(void 0);function ll(){return b.useContext(cl)}var ul=b.createContext(void 0);function dl(){return b.useContext(ul)}var fl=b.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:a,orientation:o=`horizontal`,multiple:s=!1,value:c,className:l,render:u,style:d,...f}=e,p=sl(!0),m=ll(),h=n??j,g=c!==void 0||n!==void 0,_=(p?.disabled??!1)||(m?.disabled??!1)||r,[v,y]=jc({controlled:c,default:h,name:`ToggleGroup`,state:`value`}),x=X((e,t,n)=>{let r;s?(r=v.slice(),t?r.push(e):r.splice(v.indexOf(e),1)):r=t?[e]:[],a?.(r,n),!n.isCanceled&&y(r)}),S={disabled:_,multiple:s,orientation:o},C=b.useMemo(()=>({disabled:_,setGroupValue:x,value:v,isValueInitialized:g}),[_,x,v,g]),w={role:`group`},T=Di(`div`,e,{enabled:!!p,state:S,ref:t,props:[w,f]});return(0,Y.jsx)(ul.Provider,{value:C,children:p?T:(0,Y.jsx)(al,{render:u,className:l,style:d,state:S,refs:[t],props:[w,f],loopFocus:i,enableHomeAndEndKeys:!0,orientation:o})})});function pl(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:b.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function ml(e,t,{detail:n=0}={}){e.dispatchEvent(new(ye(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function hl(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=b.useRef(null),s=il(!0),c=a??s!==void 0,{props:l}=pl({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=b.useCallback(()=>{let e=o.current;gl(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return N(u,[u]),{getButtonProps:b.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return pi({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(wi(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=gl(r),s=!i&&_l(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),ml(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),ml(r,e)))},onKeyUp(e){if(!t){if(wi(e),a?.(e),e.target===e.currentTarget&&i&&c&&gl(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),ml(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:X(e=>{o.current=e,u()})}}function gl(e){return Ce(e)&&e.tagName===`BUTTON`}function _l(e){return Ce(e)&&e.tagName===`A`&&!!e.href}function vl(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Nc(),u=b.useRef(-1),[d,f]=b.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=b.useRef(null),h=b.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return N(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}function yl(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=il(),{ref:i,index:a}=vl(e),o=n===a,s=b.useRef(null),c=ln(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function bl(e){let{render:t,className:n,style:r,state:i=M,props:a=j,refs:o=j,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=yl({metadata:s});return Di(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}var xl=b.forwardRef(function(e,t){let{className:n,defaultPressed:r=!1,disabled:i=!1,form:a,onPressedChange:o,pressed:s,render:c,type:l,value:u,nativeButton:d=!0,style:f,...p}=e,m=Js(u||void 0),h=dl(),g=h?.value??[],_=(i||h?.disabled)??!1,[v,y]=jc({controlled:h?m!==void 0&&g.indexOf(m)>-1:s,default:r,name:`Toggle`,state:`pressed`}),{getButtonProps:x,buttonRef:S}=hl({disabled:_,native:d}),C={disabled:_,pressed:v},w=[S,t],T=[{"aria-pressed":v,onClick(e){let t=!v,n=J(Ot,e.nativeEvent);o?.(t,n),!n.isCanceled&&(m&&h?.setGroupValue?.(m,t,n),!n.isCanceled&&y(t))}},p,x],E=Di(`button`,e,{enabled:!h,state:C,ref:w,props:T}),D=b.useMemo(()=>({disabled:_,focusableWhenDisabled:!1}),[_]);return h?(0,Y.jsx)(bl,{tag:`button`,render:c,className:n,style:f,metadata:D,state:C,refs:w,props:T}):E}),Sl=b.createContext(void 0);function Cl(e){let t=b.useContext(Sl);if(!e&&t===void 0)throw Error(F(27));return t}var wl=b.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Cl(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Di(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:mt,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),Tl=b.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=Cl(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=hl({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,J(Pt,e.nativeEvent))}return Di(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),El=b.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Cl(),c=Js(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Di(`p`,e,{ref:t,props:[{id:c},o]})}),Dl=b.createContext(void 0);function Ol(){let e=b.useContext(Dl);if(e===void 0)throw Error(F(26));return e}var kl=`--nested-dialogs`,Al=`data-nested-dialog-open`,jl={...pt,...et,nestedDialogOpen(e){return e?{[Al]:``}:null}},Ml=b.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Cl(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);Ol(),Ho({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?Wo(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=Di(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...Uo,hidden:!m,onKeyDown(e){Kc.has(e.key)&&e.stopPropagation()},style:{[kl]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:jl});return(0,Y.jsx)(la,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),Nl=b.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Y.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Pl=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Cl(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Y.jsx)(Dl.Provider,{value:n,children:(0,Y.jsxs)(Wi,{ref:t,...r,children:[a&&o===!0&&(0,Y.jsx)(Nl,{ref:i.context.internalBackdropRef,inert:Ac(!s)}),e.children]})}):null}),Fl={},Il={},Ll=``;function Rl(e,t){return Te(e)?e:t}function zl(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Rl(t,n)).overflowY)}function Bl(e){if(typeof document>`u`)return!1;let t=En(e);return ye(t).innerWidth-t.documentElement.clientWidth>0}function Vl(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=En(e),n=t.documentElement,r=t.body,i=Rl(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Hl(e){let t=En(e),n=t.documentElement,r=t.body,i=Rl(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Ul(e){let t=En(e),n=t.documentElement,r=t.body,i=ye(n),a=0,o=0,s=!1,c=wn.create();if(se&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Fl={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ll=n.style.scrollBehavior,Il={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Rl(n,r);if(s=Vl(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,Fl),Object.assign(r.style,Il),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Ll)}function d(){u(),c.request(l)}l();let f=sn(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Wl=new class{lockCount=0;restore=null;timeoutLock=B.create();timeoutUnlock=B.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=En(e),n=t.documentElement,r=t.body,i=ye(n);if(zl(i,n,r)){let t=new i.MutationObserver(()=>{zl(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=re||!Bl(e);this.restore=a?Hl(e):Ul(e)}};function Gl(e=!0,t=null){N(()=>{if(e)return Wl.acquire(t)},[e,t])}function Kl({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=b.useState(0),[u,d]=b.useState(0),f=c===0,p=ga(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Ue(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||K(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return Gl(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),N(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),ts(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var ql={...us,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},Jl=class extends No{constructor(e,t,n){let r=new rs,i=Yl(e,r,t,n);super(i,Xl(r),ql)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(Yo(this.state,e,t.trigger)))}};function Yl(e,t,n,r=!1){return{...is(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Xl(e){return{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Zl(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=Cl(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},x=Go((e,t)=>new Jl({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(y),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`);ns(x,S),$o(x);let{forceUnmount:T}=es(S,x);b.useImperativeHandle(l,()=>({unmount:T,close:()=>x.setOpen(!1,J($t))}),[T,x]);let E=S||C;return(0,Y.jsxs)(Sl.Provider,{value:x,children:[u&&(0,Y.jsx)(Ko,{handle:u,store:x}),E&&(0,Y.jsx)(Kl,{store:x,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:w}):n]})}var Ql=D(function(e){return Zl(`dialog`,e)}),$l=b.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Cl(),c=Js(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Di(`h2`,e,{ref:t,props:[{id:c},o]})});function eu(e){let t=b.useRef(``),n=b.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:b.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function tu(e,t){let n=b.useRef(e),r=X(t);N(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function nu(e,t){let{onClick:n,onPointerDown:r}=eu(X((n,r)=>{(typeof e==`function`?e():e)||t(r||(re?`touch`:``))}));return b.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function ru(e){let[t,n]=b.useState(null),r=nu(e,n);return tu(e,t=>{t&&!e&&n(null)}),b.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var iu=O(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=Cl(!0),f=ds(l)??d;if(!f)throw Error(F(79));let p=Js(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),_=b.useRef(null),{registerTrigger:v,isMountedByThisTrigger:y}=Qo(p,_,f,{payload:c}),{getButtonProps:x,buttonRef:S}=hl({disabled:a,native:o}),C=ua(m),w=nu(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),T={disabled:a,open:h},E=f.useState(`triggerProps`,y);return Di(`button`,e,{state:T,ref:[S,t,v,_],props:[C.reference,E,w,{[Fi]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,x],stateAttributesMapping:dt})}),au=b.createContext(void 0);function ou(){let e=b.useContext(au);if(e===void 0)throw Error(F(64));return e}var su=`data-activation-direction`,cu={tabActivationDirection:e=>({[su]:e})},lu=b.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=b.useRef([]),[f,p]=b.useState(()=>new Map),[m,h]=jc({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[_,v]=b.useState(()=>new Map),y=b.useRef(void 0),x=b.useCallback(e=>uu(_,e),[_]),[S,C]=b.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:w,tabActivationDirection:T}=S,E=T,D=!1;w!==m&&(E=du(w,m,a,_),D=w!=null&&m!=null&&x(m)==null);let O=D?w:m,k=w!==O||T!==E;N(()=>{k&&C({previousValue:O,tabActivationDirection:E})},[O,k,E]);let A=X((e,t)=>{t.activationDirection=du(m,e,a,_),i?.(e,t),!t.isCanceled&&h(e)}),j=X((e,t)=>{i?.(e,J(t,void 0,void 0,{activationDirection:`none`}))}),M=X((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),P=b.useCallback(e=>f.get(e),[f]),F=b.useCallback(e=>{for(let t of _.values())if(e===t.value)return t.id},[_]),I=b.useMemo(()=>({getTabElementBySelectedValue:x,getTabIdByPanelValue:F,getTabPanelIdByValue:P,onValueChange:A,orientation:a,registerMountedTabPanel:M,setTabMap:v,tabActivationDirection:E,value:m}),[x,F,P,A,a,M,v,E,m]),L=b.useMemo(()=>{for(let e of _.values())if(e.value===m)return e},[_,m]),R=b.useMemo(()=>{for(let e of _.values())if(!e.disabled)return e.value},[_]),z=b.useRef(!u),B=b.useRef(r),V=b.useRef(u),H=b.useRef(!1);N(()=>{if(g)return;function e(e,t){h(e),C({previousValue:e,tabActivationDirection:`none`}),j(e,t),z.current=!1}if(_.size===0){H.current&&m!==null&&!y.current?.isConnected&&e(null,Zt);return}H.current=!0,y.current=_.keys().next().value;let t=L?.disabled,n=L==null&&m!==null;if(!t&&m===B.current&&(V.current=!1),V.current&&t&&m===B.current)return;let r=z.current;if(t||n){let n=R??null;if(m===n){z.current=!1;return}let i=Zt;r?i=Qt:t&&(i=Xt),e(n,i);return}r&&L!=null&&(j(m,Qt),z.current=!1)},[R,g,j,L,h,_,m]);let U=Di(`div`,e,{state:{orientation:a,tabActivationDirection:E},ref:t,props:l,stateAttributesMapping:cu});return(0,Y.jsx)(au.Provider,{value:I,children:(0,Y.jsx)(Pc,{elementsRef:d,children:U})})});function uu(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function du(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=uu(r,e),c=uu(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var fu=b.createContext(void 0);function pu(){let e=b.useContext(fu);if(e===void 0)throw Error(F(65));return e}var mu=b.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=ou(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:_}=pu(),{highlightedIndex:v,onHighlightedIndexChange:y}=il(),x=Js(o),{compositeProps:S,compositeRef:C,index:w}=yl({metadata:b.useMemo(()=>({disabled:r,id:x,value:a}),[r,x,a])}),T=a===u,E=b.useRef(!1),D=b.useRef(null),O=X(e=>{D.current?.(),D.current=e?g(e):null});N(()=>{if(E.current){E.current=!1;return}if(!(T&&w>-1&&v!==w))return;let e=_;if(e!=null){let t=He(En(e));if(t&&K(e,t))return}r||y(w)},[T,w,v,y,r,_]);let{getButtonProps:k,buttonRef:A}=hl({disabled:r,native:s,focusableWhenDisabled:!0}),j=d(a),M=b.useRef(!1),P=b.useRef(!1);function F(e){f(a,J(Ot,e.nativeEvent,void 0,{activationDirection:`none`}))}function I(e){T||r||F(e)}function L(e){T||r||h&&(!M.current||P.current)&&F(e)}function R(e){if(T||r)return;M.current=!0,P.current=e.button===0;let t=En(e.currentTarget);function n(){M.current=!1,P.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return Di(`button`,e,{state:{disabled:r,active:T,orientation:p,tabActivationDirection:m},ref:[t,A,C,O],props:[S,{role:`tab`,"aria-controls":j,"aria-selected":T,id:x,onClick:I,onFocus:L,onPointerDown:R,[$c]:T?``:void 0,onKeyDownCapture(){E.current=!0}},l,k],stateAttributesMapping:cu})}),hu=`data-index`,gu={...cu,...et},_u=b.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=ou(),p=Js(),{ref:m,index:h}=vl(),g=r===c,{mounted:_,transitionStatus:v,setMounted:y}=Ro(g),x=!_,S=l(r),C={hidden:x,orientation:u,tabActivationDirection:d,transitionStatus:v},w=b.useRef(null),T=Di(`div`,e,{state:C,ref:[t,m,w],props:[{"aria-labelledby":S,hidden:x,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:Ac(!g),[hu]:h},s],stateAttributesMapping:gu});return Ho({open:g,ref:w,onComplete(){g||y(!1)}}),N(()=>{if(!(p==null||x&&!a))return f(r,p)},[x,a,r,p,f]),a||_?T:null}),vu=b.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=ou(),[d,f]=b.useState(0),[p,m]=b.useState(null),h=b.useRef(new Set),g=b.useRef(new Set),_=b.useRef(null);N(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let v=X(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=X(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),x={orientation:c,tabActivationDirection:u},S={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},C=b.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:v,registerTabResizeObserverElement:y,tabsListElement:p}),[n,v,y,p]);return(0,Y.jsx)(fu.Provider,{value:C,children:(0,Y.jsx)(al,{render:a,className:r,style:o,state:x,refs:[t,m],props:[S,s],stateAttributesMapping:cu,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:j})})}),yu=b.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Di(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),bu=b.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=hl({disabled:i,focusableWhenDisabled:a,native:o});return Di(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),xu=b.createContext(void 0);function Su(e=!0){let t=b.useContext(xu);if(t===void 0&&!e)throw Error(F(25));return t}var Cu=b.createContext(void 0);function wu(e){let t=b.useContext(Cu);if(t===void 0&&!e)throw Error(F(33));return t}var Tu=b.createContext(void 0);function Eu(e){let t=b.useContext(Tu);if(t===void 0&&!e)throw Error(F(36));return t}function Du(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=Su(!0),f=d!==void 0;return b.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:Nt})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!G&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&ml(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var Ou={type:`regular-item`};function ku(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=b.useRef(null),{getButtonProps:d,buttonRef:f}=hl({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Du({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=b.useCallback(e=>pi(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=ln(u,f);return b.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var Au=b.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=vl({guess:!0,label:a}),f=wu(!0),p=Js(i),{store:m}=Eu(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=ku({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:Ou});return Di(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})}),ju=b.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=Eu(),{side:c,align:l}=wu(),u=sl(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),x=s.useState(`floatingRootContext`),S=s.useState(`floatingTreeRoot`),C=s.useState(`closeDelay`),w=s.useState(`hoverEnabled`),T=s.useState(`disabled`),E=s.useState(`openMethod`),D=_.type===`context-menu`;Ho({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),b.useEffect(()=>{function e(e){s.setOpen(!1,J(e.reason,e.domEvent))}return S.events.on(`close`,e),()=>{S.events.off(`close`,e)}},[S.events,s]),Ss(x,{enabled:w&&!T&&!D&&_.type!==`menubar`,closeDelay:C});let O=s.useStateSetter(`popupElement`),k=Di(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,O],stateAttributesMapping:mt,props:[p,{onKeyDown(e){u&&Kc.has(e.key)&&e.stopPropagation()}},Tc(f),o,{"data-rootownerid":y}]}),A=_.type===void 0||D;return(g||_.type===`menubar`&&v!==`outside-press`)&&(A=!0),(0,Y.jsx)(la,{context:x,openInteractionType:E,modal:D,disabled:!m,returnFocus:a===void 0?A:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:S,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:k})}),Mu=b.createContext(void 0);function Nu(){let e=b.useContext(Mu);if(e===void 0)throw Error(F(32));return e}var Pu=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=Eu();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,Y.jsx)(Mu.Provider,{value:n,children:(0,Y.jsx)(Wi,{ref:t,...r,portalOwnerRole:o})})}),Fu=20;function Iu(e,t,n,r){let[i,a]=b.useState(!1);N(()=>{if(!e||!t||n==null){a(!1);return}let r=En(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Fu)},[e,t,n]),Gl(e&&(!t||i),r)}var Lu=b.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Ii,style:g,..._}=e,{store:v}=Eu(),y=Nu(),x=Su(!0),S=v.useState(`parent`),C=v.useState(`floatingRootContext`),w=v.useState(`floatingTreeRoot`),T=v.useState(`mounted`),E=v.useState(`open`),D=v.useState(`modal`),O=v.useState(`openMethod`),k=v.useState(`activeTriggerElement`),A=v.useState(`transitionStatus`),j=v.useState(`positionerElement`),M=v.useState(`instantType`),P=v.useState(`adaptiveOrigin`),F=v.useState(`lastOpenChangeReason`),I=v.useState(`floatingNodeId`),L=v.useState(`floatingParentNodeId`),R=C.useState(`domReferenceElement`),z=b.useRef(null),B=Vo(j),H=n,U=c,ee=l,te=s,ne=h;S.type===`context-menu`&&(H=n??S.context?.anchor,te??=`start`,!o&&te!==`center`&&(ee=e.alignOffset??2,U=e.sideOffset??-5));let W=o,re=te;S.type===`menu`?(W??=`inline-end`,re??=`start`,ne=e.collisionAvoidance??Li):S.type===`menubar`&&(W??=S.context.orientation===`vertical`?`inline-end`:`bottom`,re??=`start`);let ie=S.type===`context-menu`,ae=Sc({anchor:H,floatingRootContext:C,positionMethod:x?`fixed`:r,mounted:T,side:W,sideOffset:U,align:re,alignOffset:ee,arrowPadding:ie?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:I,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:ne,shift:ie?{crossAxis:!(`side`in ne&&ne.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:w,adaptiveOrigin:P});b.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===I&&v.set(`hoverEnabled`,!1),e.nodeId!==I&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,J(Yt)))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[v,w.events,I]),b.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,J(t))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[w.events,v]);let G=V();b.useEffect(()=>{E||G.clear()},[E,G]),b.useEffect(()=>{function e(e){if(E&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&k&&k!==e.target){let e=v.select(`closeDelay`);e>0?G.isStarted()||G.start(e,()=>{v.setOpen(!1,J(Yt))}):v.setOpen(!1,J(Yt))}else G.clear()}}return w.events.on(`itemhover`,e),()=>{w.events.off(`itemhover`,e)}},[w.events,E,k,v,G]),b.useEffect(()=>{let e={open:E,nodeId:I,parentNodeId:L,reason:v.select(`lastOpenChangeReason`)};w.events.emit(`menuopenchange`,e)},[w.events,E,v,I,L]),N(()=>{let e=R,t=z.current;if(e&&(z.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return B(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[R,B,v]);let oe={open:E,side:ae.side,align:ae.align,anchorHidden:ae.anchorHidden,nested:S.type===`menu`,instant:M},se=S.type===`menubar`&&S.context.modal;Iu(E&&(se||D&&F!==`trigger-hover`),O===`touch`,j,k);let ce=Ec(e,oe,{styles:ae.positionerStyles,transitionStatus:A,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!T,inert:!E}),le=T&&S.type!==`menu`&&(S.type!==`menubar`&&D&&F!==`trigger-hover`||S.type===`menubar`&&S.context.modal),ue=null;return S.type===`menubar`?ue=S.context.contentElement:S.type===void 0&&(ue=k),(0,Y.jsxs)(Cu.Provider,{value:ae,children:[le&&(0,Y.jsx)(Nl,{ref:S.type===`context-menu`||S.type===`nested-context-menu`?S.context.internalBackdropRef:null,inert:Ac(!E),cutout:ue}),(0,Y.jsx)(Qi,{id:I,children:(0,Y.jsx)(Pc,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:ce})})]})}),Ru=b.createContext(null);function zu(e){let t=b.useContext(Ru);if(t===null&&!e)throw Error(F(5));return t}var Bu={...us,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Vu=class extends No{constructor(e,t,n=!1){let r=new rs,i=Uu(r,t,n,e);super(i,Hu(r),Bu),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null};function Hu(e){return{positionerRef:b.createRef(),popupRef:b.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function Uu(e,t,n=!1,r){return{...is(e,t,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Ki,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:M,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var Wu=b.createContext(void 0);function Gu(){return b.useContext(Wu)}var Ku=D(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=Su(!0),_=Eu(!0),v=zu(!0),y=Gu(),x=b.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),C=ii(),w=ii(),T=Yi(),E=x.type===`menu`?x.store:void 0,D=(n??a)&&E?.state.transitionStatus===`starting`,O=S(()=>D?E?.state.instantType:void 0).current,k=qu({open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:x,disabled:o,highlightItemOnHover:h,modal:x.type===void 0?s:void 0,rootId:C,instantType:O},w,T!=null);k.useControlledProp(`openProp`,n),k.useControlledProp(`triggerIdProp`,p),k.useContextCallback(`onOpenChangeComplete`,i);let A=k.useState(`floatingTreeRoot`),P=Zi(A),F=k.useState(`open`),I=k.useState(`activeTriggerElement`),L=k.useState(`positionerElement`),R=k.useState(`hoverEnabled`),z=k.useState(`disabled`),B=k.useState(`lastOpenChangeReason`),H=k.useState(`parent`),U=k.useState(`activeIndex`),ee=k.useState(`payload`),te=k.useState(`floatingParentNodeId`),ne=b.useRef(null),W=b.useRef(H.type!==`context-menu`),re=V(),ie=b.useRef(!0),ae=V(),G=te!=null,{openMethod:oe,triggerProps:se}=ru(F);k.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:H.type===void 0?s:void 0,openMethod:oe,rootId:C}),$o(k);let{forceUnmount:ce,transitionStatus:le}=es(F,k,()=>{k.set(`allowMouseEnter`,!1)},D),ue=Vo(k.context.popupRef);b.useEffect(()=>{if(O===void 0)return;let e=()=>{k.state.instantType===O&&k.set(`instantType`,void 0)};if(!F){e();return}if(le!==void 0)return;if(k.context.popupRef.current==null){e();return}let t=new AbortController;return ue(e,t.signal),()=>{t.abort()}},[O,F,le,ue,k]),N(()=>{g&&!_?k.update({parent:{type:`context-menu`,context:g},floatingNodeId:P,floatingParentNodeId:T}):_&&k.update({floatingNodeId:P,floatingParentNodeId:T})},[g,_,P,T,k]),b.useEffect(()=>{if(F||(ne.current=null),H.type===`context-menu`){if(!F){re.clear(),W.current=!1;return}re.start(500,()=>{W.current=!0})}},[re,F,H.type]),N(()=>{!F&&!R&&k.set(`hoverEnabled`,!0)},[F,R,k]);let de=X((e,t)=>{let n=t.reason;if(!e&&!k.select(`open`)||F===e&&t.trigger===I&&B===n)return;let i=Xo(t);if(!e&&t.trigger==null&&(t.trigger=I??void 0),r?.(e,t),t.isCanceled)return;k.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!ie.current)return;e&&n===`trigger-focus`?(ie.current=!1,ae.start(300,()=>{ie.current=!0})):(ie.current=!0,ae.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null);ne.current=t.event;let c=Yo(k.state,e,t.trigger,i());c.openChangeReason=n,c.instantType=H.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:o||s?o?`click`:`dismiss`:void 0,k.update(c)}),fe=Lo({popupStore:k,floatingRootContext:k.state.floatingRootContext,floatingId:w,nested:T!=null,onOpenChange:de}),pe=fe.context.events;N(()=>{let e=({open:e,eventDetails:t})=>de(e,t);return pe.on(`setOpen`,e),()=>{pe?.off(`setOpen`,e)}},[pe,de]);let me=b.useCallback(()=>{k.setOpen(!1,J($t))},[k]);b.useImperativeHandle(u,()=>({unmount:ce,close:me}),[ce,me]);let he;H.type===`context-menu`&&(he=H.context),b.useImperativeHandle(he?.positionerRef,()=>L,[L]),b.useImperativeHandle(he?.actionsRef,()=>({setOpen:de}),[de]);let ge=ga(fe,{enabled:!z,bubbles:{escapeKey:d&&H.type===`menu`},outsidePress(){return H.type!==`context-menu`||ne.current?.type===`contextmenu`||W.current},externalTree:G?A:void 0}),_e=cc(),ve=b.useCallback(e=>{k.select(`activeIndex`)!==e&&k.set(`activeIndex`,e)},[k]),ye=Ms(fe,{enabled:!z,listRef:k.context.itemDomElements,activeIndex:U,nested:H.type!==void 0,loopFocus:c,orientation:l,parentOrientation:H.type===`menubar`?H.context.orientation:void 0,rtl:_e===`rtl`,disabledIndices:j,onNavigate:ve,openOnArrowKeyDown:H.type!==`context-menu`,externalTree:G?A:void 0,focusItemOnHover:h}),be=b.useCallback(e=>{k.context.typingRef.current=e},[k]),xe=Ns(fe,{enabled:!z,listRef:k.context.itemLabels,elementsRef:k.context.itemDomElements,activeIndex:U,resetMs:500,onMatch:e=>{F&&e!==U&&k.set(`activeIndex`,e)},onTyping:be}),Se=b.useMemo(()=>{let e=pi(xe.reference,ye.reference,ge.reference,{onMouseMove(){k.set(`allowMouseEnter`,!0)}},se);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=F,e},[k,xe.reference,ye.reference,ge.reference,se,F]),Ce=b.useMemo(()=>{let e=pi(ye.trigger,ge.trigger,se);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[ye.trigger,ge.trigger,se]);S(()=>(k.update({inactiveTriggerProps:Ce}),null)),ts(k,{floatingRootContext:fe,activeTriggerProps:Se,inactiveTriggerProps:Ce,popupProps:b.useMemo(()=>pi(Uo,{id:w,role:`menu`,"aria-orientation":l===`horizontal`?`horizontal`:void 0,"aria-labelledby":I?.id,onMouseMove(){k.set(`allowMouseEnter`,!0),H.type===`menu`&&k.set(`hoverEnabled`,!1)},onClick(){k.select(`hoverEnabled`)&&k.set(`hoverEnabled`,!1)},onKeyDown(e){let t=k.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},xe.floating,ye.floating,ge.floating),[I,w,l,H.type,k,xe.floating,ye.floating,ge.floating]),itemProps:ye.item??M});let we=b.useMemo(()=>({store:k,parent:x}),[k,x]),Te=(0,Y.jsxs)(Tu.Provider,{value:we,children:[f&&(0,Y.jsx)(Ko,{handle:f,store:k}),typeof t==`function`?t({payload:ee}):t]});return H.type===void 0||H.type===`context-menu`?(0,Y.jsx)($i,{externalTree:A,children:Te}):Te});function qu(e,t,n){return S(()=>new Vu(e,t,n)).current}var Ju=5;function Yu(e,t){let n=Xu(t);return e.clientX>=n.left-Ju&&e.clientX<=n.right+Ju&&e.clientY>=n.top-Ju&&e.clientY<=n.bottom+Ju}function Xu(e){let t=e.getBoundingClientRect(),n=ye(e);if(ue)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Zu(e){if(Ce(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Fe(e))return Zu(Re(e))}function Qu(e,t){let n=b.useRef(null);function r(t){zi.flushSync(()=>{e.setOpen(!1,J(Ht,t.nativeEvent,t.currentTarget))}),Pr(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&Fr(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{zi.flushSync(()=>{e.setOpen(!1,J(Ht,n.nativeEvent,n.currentTarget))});let i=Nr(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&K(r,i);){let e=i;if(i=Ar(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function $u(e){let[t,n]=b.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=b.useRef(null),i=b.useRef(null),a=b.useRef(null),o=b.useRef(null),s=b.useRef(!0),c=b.useRef(null),l=ii(),u=b.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return(0,Y.jsx)(xu.Provider,{value:u,children:(0,Y.jsx)(Tu.Provider,{value:void 0,children:(0,Y.jsx)(Ku,{...e})})})}var ed=500,td=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{setAnchor:o,actionsRef:s,internalBackdropRef:c,backdropRef:l,positionerRef:u,allowMouseUpTriggerRef:d,initialCursorPointRef:f,rootId:p}=Su(!1),{store:m}=Eu(!1),h=m.useState(`open`),g=m.useState(`disabled`),_=b.useRef(null),v=b.useRef(null),y=V(),x=V(),S=b.useRef(!1),C=b.useRef(null);function w(e,t,n){let r=n.type.startsWith(`touch`);f.current={x:e,y:t},o({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),S.current=!1,s.current?.setOpen(!0,J(kt,n)),x.start(ed,()=>{S.current=!0})}function T(e){if(g)return;d.current=!0,de(e),w(e.clientX,e.clientY,e.nativeEvent);let t=En(_.current);C.current?.abort();let n=new AbortController;C.current=n,t.addEventListener(`mouseup`,e=>{if(d.current=!1,!S.current)return;x.clear(),S.current=!1;let t=Ue(e);K(u.current,t)||p&&t&&Zu(t)===p||s.current?.setOpen(!1,J(Jt,e))},{once:!0,signal:n.signal})}function E(){y.clear(),v.current=null}function D(e){if(g){E();return}if(d.current=!1,e.touches.length!==1){E();return}e.stopPropagation();let t=e.touches[0],n={x:t.clientX,y:t.clientY};v.current=n,y.start(ed,()=>{w(n.x,n.y,e.nativeEvent)})}function O(e){if(e.touches.length!==1){E();return}if(y.isStarted()&&v.current){let t=e.touches[0],n=Math.abs(t.clientX-v.current.x),r=Math.abs(t.clientY-v.current.y);(n>10||r>10)&&E()}}return b.useEffect(()=>()=>{C.current?.abort()},[]),b.useEffect(()=>{function e(e){if(g)return;let t=Ue(e);(K(_.current,t)||K(c.current,t)||K(l.current,t))&&e.preventDefault()}return sn(En(_.current),`contextmenu`,e)},[l,g,c]),Di(`div`,e,{state:{open:h},ref:[_,t],props:[{onContextMenu:T,onTouchStart:D,onTouchMove:O,onTouchEnd:E,onTouchCancel:E,style:{WebkitTouchCallout:`none`}},a],stateAttributesMapping:ft})}),nd=Lu;function rd(e){let t=(0,b.useRef)(e);return(0,b.useInsertionEffect)(()=>void(t.current=e)),(0,b.useCallback)((...e)=>t.current(...e),[])}var id=(0,b.createContext)(void 0);function ad(){return(0,b.useContext)(id)}var od={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},sd={display:`contents`};function cd(){return null}var ld=`diffs-container`,ud=/(?=^From [a-f0-9]+ .+$)/m,dd=/(?=^diff --git)/gm,fd=/(?<=\n)/,pd=/^(---|\+\+\+)\s+([^\t\r\n]+)/,md=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,hd=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,gd=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,_d=`header-prefix`,vd=`header-filename-suffix`,yd=`header-metadata`,bd=`header-custom`,xd={dark:`pierre-dark`,light:`pierre-light`},Sd=`data-theme-css`,Cd=`data-unsafe-css`,wd=`data-diffs-scrollbar-measure`,Td=`--diffs-scrollbar-gutter-measured`,Ed=1e5,Dd={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...Dd});var Od=Object.freeze({fromStart:0,fromEnd:0}),kd={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Ad={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function jd(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function Md({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function Nd(e,t){return e-(t===0?0:1)}function Pd(e,t){return Nd(e,t)+t}function Fd(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:Id(n,e.startContentIndex)}}function Id(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){let t=e.hunkContent[r];n+=t.type===`context`?t.lines:t.deletions+t.additions}return n}function Ld({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:i,renderHeaderMetadata:a,renderAnnotation:o,renderGutterUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:u,getInstance:d,getAnnotationSlotName:f=jd}){let p=n?.(e),m=r?.(e),h=i?.(e),g=a?.(e);return(0,Y.jsxs)(Y.Fragment,{children:[p==null?(0,Y.jsxs)(Y.Fragment,{children:[m!=null&&(0,Y.jsx)(`div`,{slot:`header-prefix`,children:m}),h!=null&&(0,Y.jsx)(`div`,{slot:`header-filename-suffix`,children:h}),g!=null&&(0,Y.jsx)(`div`,{slot:`header-metadata`,children:g})]}):(0,Y.jsx)(`div`,{slot:bd,children:p}),o!=null&&l?.map((e,t)=>(0,Y.jsx)(`div`,{slot:f(e),children:o(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=Rd(t,e);return(0,Y.jsx)(`div`,{slot:n,style:sd,children:c(t,d)},n)}),s!=null&&(0,Y.jsx)(`div`,{slot:`gutter-utility-slot`,style:od,children:s(u)})]})}function Rd(e,t){let n=Fd(e,t);return n==null?void 0:Md({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}var zd=new Map,Bd=new Map,Vd=new Map,Hd=new Set;function Ud(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!Hd.has(t))return!1;return!0}function Wd(e=xd){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}var Gd=new Set;function Kd(e){let t=[],n=new Set;for(let r of qd(e.themes)){let e=Xd(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return Kd({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return Kd({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function qd(e){return Jd(e)?[e]:e}function Jd(e){return Xd(e)||Yd(e)}function Yd(e){return typeof e.name==`string`&&typeof e.load==`function`}function Xd(e){return typeof e.getThemes==`function`}function Zd(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var Qd=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},$d=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},ef=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function tf(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new Qd(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new $d(i));let c=r,l=s().then(e=>{let a=Zd(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new ef(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var nf=tf();function rf(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=nf.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,nf.getResolvedTheme(n)??nf.seedResolvedTheme(n,e);Gd.has(n)||(Gd.add(n),t.loadThemeSync(e))}}function af(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(Hd.has(n.name))continue;let e=zd.get(n.name);e??(e=n,zd.set(n.name,e)),Hd.add(e.name),t.loadLanguageSync(e.data)}}function of(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var sf=Object.defineProperty,cf=Object.getOwnPropertyDescriptor,lf=Object.getOwnPropertyNames,uf=Object.prototype.hasOwnProperty,df=(e,t)=>{let n={};for(var r in e)sf(n,r,{get:e[r],enumerable:!0});return t||sf(n,Symbol.toStringTag,{value:`Module`}),n},ff=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=lf(t),a=0,o=i.length,s;a<o;a++)s=i[a],!uf.call(e,s)&&s!==n&&sf(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=cf(t,s))||r.enumerable});return e},pf=(e,t,n)=>(ff(e,t,`default`),n&&ff(n,t,`default`)),mf=`modulepreload`,hf=function(e){return`/`+e},gf={},Z=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=hf(t,n),t=s(t),t in gf)return;gf[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:mf,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},_f=[{id:`abap`,name:`ABAP`,import:(()=>Z(()=>import(`./abap-CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>Z(()=>import(`./actionscript-3-Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>Z(()=>import(`./ada-C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>Z(()=>import(`./ahk-CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>Z(()=>import(`./ahk2-_6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>Z(()=>import(`./angular-html-ezhpupwN.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>Z(()=>import(`./angular-ts-DGkBU2Ac.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>Z(()=>import(`./apache-U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>Z(()=>import(`./apex-KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>Z(()=>import(`./apl-CUGT4nIi.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>Z(()=>import(`./applescript-CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>Z(()=>import(`./ara-4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>Z(()=>import(`./asciidoc-SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>Z(()=>import(`./asm-Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>Z(()=>import(`./astro-C6f9OliD.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>Z(()=>import(`./awk-BWXHIvNe.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>Z(()=>import(`./ballerina-B7ZEbQpA.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>Z(()=>import(`./bat-qdxAdBWQ.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>Z(()=>import(`./beancount-D-usSTwE.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>Z(()=>import(`./berry-DKpUyyne.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>Z(()=>import(`./bibtex-Ci_nEsc7.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>Z(()=>import(`./bicep-CUHmPFLl.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>Z(()=>import(`./bird2-CYIUgYqB.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>Z(()=>import(`./blade-71nbYGOJ.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>Z(()=>import(`./bsl-_VjlB9mv.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>Z(()=>import(`./c-Bpp83vUT.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>Z(()=>import(`./c3-D0apG41V.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>Z(()=>import(`./cadence-CQ2zXKGN.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>Z(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([19,20])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>Z(()=>import(`./chapel-ASdwSMh4.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>Z(()=>import(`./clarity-CtfBBspg.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>Z(()=>import(`./clojure-DqKBuwfJ.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>Z(()=>import(`./cmake-Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>Z(()=>import(`./cobol-DNxuGELk.js`),__vite__mapDeps([23,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>Z(()=>import(`./codeowners-C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>Z(()=>import(`./codeql-oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>Z(()=>import(`./coffee-CTyXBUCJ.js`),__vite__mapDeps([24,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>Z(()=>import(`./common-lisp-Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>Z(()=>import(`./coq-DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>Z(()=>import(`./cpp-CzJZfqV4.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>Z(()=>import(`./crystal-BfqQdHxV.js`),__vite__mapDeps([28,2,3,1,16,22,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>Z(()=>import(`./csharp-oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>Z(()=>import(`./css-DlfMUpGK.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>Z(()=>import(`./csv-Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>Z(()=>import(`./cue-CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>Z(()=>import(`./cypher-ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>Z(()=>import(`./d-qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>Z(()=>import(`./dart-CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>Z(()=>import(`./dax-BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>Z(()=>import(`./desktop-Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>Z(()=>import(`./diff-woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>Z(()=>import(`./docker-IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>Z(()=>import(`./dotenv-_5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>Z(()=>import(`./dream-maker-DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>Z(()=>import(`./edge-ZaCA-9tU.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>Z(()=>import(`./elixir-GeIrO3JP.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>Z(()=>import(`./elm-BetcOCtl.js`),__vite__mapDeps([32,27,22])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>Z(()=>import(`./emacs-lisp-c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>Z(()=>import(`./erb-Dru309ol.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>Z(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>Z(()=>import(`./fennel-DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>Z(()=>import(`./fish-BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>Z(()=>import(`./fluent-C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>Z(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>Z(()=>import(`./fortran-free-form-CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>Z(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>Z(()=>import(`./gdresource-xMC7jr7x.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>Z(()=>import(`./gdscript-DYvRD3hg.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>Z(()=>import(`./gdshader-CBce3t8t.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>Z(()=>import(`./genie-CV2tkWYe.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>Z(()=>import(`./gherkin-DExj1W_8.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>Z(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>Z(()=>import(`./git-rebase-DJIWyVXc.js`),__vite__mapDeps([50,29])))},{id:`gleam`,name:`Gleam`,import:(()=>Z(()=>import(`./gleam-CSRkHgEL.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>Z(()=>import(`./glimmer-js-DIqXjYAY.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>Z(()=>import(`./glimmer-ts-pnunO5g0.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>Z(()=>import(`./glsl-DWspuWDC.js`).then(e=>e.n),__vite__mapDeps([27,22])))},{id:`gn`,name:`GN`,import:(()=>Z(()=>import(`./gn-ilITqXS6.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>Z(()=>import(`./gnuplot-7GGW24-e.js`),[]))},{id:`go`,name:`Go`,import:(()=>Z(()=>import(`./go-rLFTqkRN.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>Z(()=>import(`./graphql-DjZ79Z4P.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37])))},{id:`groovy`,name:`Groovy`,import:(()=>Z(()=>import(`./groovy-CacY0gHj.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>Z(()=>import(`./hack-iafWRwwB.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>Z(()=>import(`./haml-o-Lgpxml.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>Z(()=>import(`./handlebars-C8OUH7g6.js`),__vite__mapDeps([54,2,3,1,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>Z(()=>import(`./haskell-D8IpX4py.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>Z(()=>import(`./haxe-C8oCnwJJ.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>Z(()=>import(`./hcl-Dh228itO.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>Z(()=>import(`./hjson-CxZEssPk.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>Z(()=>import(`./hlsl-Cvrh5tZx.js`),[]))},{id:`html`,name:`HTML`,import:(()=>Z(()=>import(`./html-CJzu28V2.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>Z(()=>import(`./html-derivative-Cb8okpVc.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>Z(()=>import(`./http-ttaoWHS4.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>Z(()=>import(`./hurl-DzAr45rI.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37])))},{id:`hxml`,name:`HXML`,import:(()=>Z(()=>import(`./hxml-Dcm88srW.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>Z(()=>import(`./hy-CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>Z(()=>import(`./imba-DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>Z(()=>import(`./ini-B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>Z(()=>import(`./java-B9M8FiDh.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>Z(()=>import(`./javascript-DsgDiit9.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>Z(()=>import(`./jinja-BpB_f_L5.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>Z(()=>import(`./jison-BBboHJLm.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>Z(()=>import(`./json-CjLBqelG.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>Z(()=>import(`./json5-BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>Z(()=>import(`./jsonc-CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>Z(()=>import(`./jsonl-CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>Z(()=>import(`./jsonnet-CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>Z(()=>import(`./jssm-DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>Z(()=>import(`./jsx-B86puyK5.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>Z(()=>import(`./julia-Dx4irgay.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>Z(()=>import(`./just-BaU8BkWf.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>Z(()=>import(`./kdl-CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>Z(()=>import(`./kotlin-DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>Z(()=>import(`./kusto-C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>Z(()=>import(`./latex-OCFtPaVb.js`),__vite__mapDeps([66,67,63])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>Z(()=>import(`./lean-CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>Z(()=>import(`./less-DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>Z(()=>import(`./liquid-B-HSosSR.js`),__vite__mapDeps([68,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>Z(()=>import(`./llvm-DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>Z(()=>import(`./log-BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>Z(()=>import(`./logo-Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>Z(()=>import(`./lua-DmtpgLJe.js`).then(e=>e.n),__vite__mapDeps([38,22])))},{id:`luau`,name:`Luau`,import:(()=>Z(()=>import(`./luau-C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>Z(()=>import(`./make-Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>Z(()=>import(`./markdown-BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>Z(()=>import(`./marko-DLvj6HlY.js`),__vite__mapDeps([69,3,5,11,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>Z(()=>import(`./matlab-D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>Z(()=>import(`./mdc-CLlpDeEH.js`),__vite__mapDeps([71,15,1,2,3,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>Z(()=>import(`./mdx-DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>Z(()=>import(`./mermaid-BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>Z(()=>import(`./mipsasm-BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>Z(()=>import(`./mojo-fg40_ntQ.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>Z(()=>import(`./moonbit-DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>Z(()=>import(`./move-BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>Z(()=>import(`./narrat-_X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>Z(()=>import(`./nextflow-BJtWHP5T.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>Z(()=>import(`./nextflow-groovy-DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>Z(()=>import(`./nginx-B6eJiJtn.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>Z(()=>import(`./nim-BjTTIyjo.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41])))},{id:`nix`,name:`Nix`,import:(()=>Z(()=>import(`./nix-IvuFDN5E.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>Z(()=>import(`./nsis-CjNLYCLg.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>Z(()=>import(`./nushell-DHYfO66s.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>Z(()=>import(`./objective-c-D1A_Heim.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>Z(()=>import(`./objective-cpp-BsSzOQcm.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>Z(()=>import(`./ocaml-O90oeIOV.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>Z(()=>import(`./odin-B1RWQWA5.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>Z(()=>import(`./openscad-BUDT5pXO.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>Z(()=>import(`./org-BbxkHpL7.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93])))},{id:`pascal`,name:`Pascal`,import:(()=>Z(()=>import(`./pascal-4ZHwLPI5.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>Z(()=>import(`./perl-7YBielDt.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>Z(()=>import(`./php--KPClthN.js`),__vite__mapDeps([87,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>Z(()=>import(`./pkl-ot-7Btpt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>Z(()=>import(`./plsql-DGHpHOYJ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>Z(()=>import(`./po-BiJDBrnU.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>Z(()=>import(`./polar-C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>Z(()=>import(`./postcss-BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>Z(()=>import(`./powerquery-DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>Z(()=>import(`./powershell-CCSX75yM.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>Z(()=>import(`./prisma-DMgNhnYS.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>Z(()=>import(`./prolog-iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>Z(()=>import(`./proto-DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>Z(()=>import(`./pug-C7XMl1L8.js`),__vite__mapDeps([94,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>Z(()=>import(`./puppet-CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>Z(()=>import(`./purescript-9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>Z(()=>import(`./python-gzcpVVnB.js`),[]))},{id:`qml`,name:`QML`,import:(()=>Z(()=>import(`./qml-CN9HGHWl.js`),__vite__mapDeps([95,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>Z(()=>import(`./qmldir-DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>Z(()=>import(`./qss-Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>Z(()=>import(`./r-BR7Z2WHy.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>Z(()=>import(`./racket-DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>Z(()=>import(`./raku-B3gFvitq.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>Z(()=>import(`./razor-C6ePkXhR.js`),__vite__mapDeps([96,1,2,3,78])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>Z(()=>import(`./rbs-C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>Z(()=>import(`./reg-CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>Z(()=>import(`./regexp-4j9D_ZJm.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>Z(()=>import(`./rel-BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>Z(()=>import(`./riscv-Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>Z(()=>import(`./ron-VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>Z(()=>import(`./rosmsg-CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>Z(()=>import(`./rst-DnVZxVCG.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>Z(()=>import(`./ruby-CcELT3hw.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>Z(()=>import(`./rust-Cfkwpbl8.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>Z(()=>import(`./sas-C0OZEEpB.js`),__vite__mapDeps([99,16])))},{id:`sass`,name:`Sass`,import:(()=>Z(()=>import(`./sass-DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>Z(()=>import(`./scala-BiFt_7mu.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>Z(()=>import(`./scheme-DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>Z(()=>import(`./scss-CsORv0BP.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>Z(()=>import(`./sdbl-bTVj8UrX.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>Z(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([100,101])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>Z(()=>import(`./shellscript-BTztjGqL.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>Z(()=>import(`./shellsession-Cl0t6nbx.js`),__vite__mapDeps([102,29])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>Z(()=>import(`./smalltalk-BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>Z(()=>import(`./smithy-Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>Z(()=>import(`./solidity-Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>Z(()=>import(`./soy-Dlpwi8rU.js`),__vite__mapDeps([103,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>Z(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([104,105])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>Z(()=>import(`./splunk-BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>Z(()=>import(`./sql-Dea5cDqJ.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>Z(()=>import(`./ssh-config-BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>Z(()=>import(`./stata-CI6WIEjb.js`),__vite__mapDeps([106,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>Z(()=>import(`./stylus-B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>Z(()=>import(`./surrealql-CMQ8lmEG.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>Z(()=>import(`./svelte-CL7YYnWK.js`),__vite__mapDeps([108,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>Z(()=>import(`./swift-CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>Z(()=>import(`./system-verilog-Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>Z(()=>import(`./systemd-BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>Z(()=>import(`./talonscript-CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>Z(()=>import(`./tasl-DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>Z(()=>import(`./tcl-CZd0xW_V.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>Z(()=>import(`./templ-BeZbGaJP.js`),__vite__mapDeps([109,2,3,81])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>Z(()=>import(`./terraform-DswuEJGm.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>Z(()=>import(`./tex-BSS8Q45r.js`).then(e=>e.n),__vite__mapDeps([67,63])))},{id:`toml`,name:`TOML`,import:(()=>Z(()=>import(`./toml-CcmNWLt0.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>Z(()=>import(`./ts-tags-BBdnNf-a.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22])))},{id:`tsv`,name:`TSV`,import:(()=>Z(()=>import(`./tsv-sltzmVWM.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>Z(()=>import(`./tsx-c1m_nKLG.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>Z(()=>import(`./turtle-ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>Z(()=>import(`./twig-psqnv4mB.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>Z(()=>import(`./typescript-ByR3P8c1.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>Z(()=>import(`./typespec-BRdr0IET.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>Z(()=>import(`./typst-Dg-RDIXz.js`),__vite__mapDeps([112,2,3,1,5,8,7,9,11,13,113,114,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,44,48,50,81,82,54,83,115,63,62,65,66,67,70,116,84,85,87,88,89,90,91,93,117,94,118,119,111,120])))},{id:`v`,name:`V`,import:(()=>Z(()=>import(`./v-DBj4K9d_.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>Z(()=>import(`./vala-zf12oZj6.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>Z(()=>import(`./vb-DOwzaHZ0.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>Z(()=>import(`./verilog-B2gwz-sJ.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>Z(()=>import(`./vhdl-BroJfC0k.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>Z(()=>import(`./viml-DvXPmvsu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>Z(()=>import(`./vue-DbsvoIfv.js`),__vite__mapDeps([121,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>Z(()=>import(`./vue-html-n7sDnKkW.js`),__vite__mapDeps([122,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>Z(()=>import(`./vue-vine-CUhVSAxO.js`),__vite__mapDeps([123,2,3,5,12,70,124])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>Z(()=>import(`./vyper-CgoNMtux.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>Z(()=>import(`./wasm-ByWQv1Qj.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>Z(()=>import(`./wenyan-C8pVoKbM.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>Z(()=>import(`./wgsl-BsKzXJz4.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>Z(()=>import(`./wikitext-ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>Z(()=>import(`./wit-DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>Z(()=>import(`./wolfram-DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>Z(()=>import(`./xml-mUdjR8gR.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>Z(()=>import(`./xsl-vKBVy2ER.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>Z(()=>import(`./yaml-BGDRkaBQ.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>Z(()=>import(`./zenscript-BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>Z(()=>import(`./zig-CMLA9XwU.js`),[]))}],vf=Object.fromEntries(_f.map(e=>[e.id,e.import])),yf=Object.fromEntries(_f.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),bf={...vf,...yf},xf=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>Z(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>Z(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>Z(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>Z(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>Z(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>Z(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>Z(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>Z(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>Z(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>Z(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>Z(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>Z(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>Z(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>Z(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>Z(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>Z(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>Z(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>Z(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>Z(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>Z(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>Z(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>Z(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>Z(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>Z(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>Z(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>Z(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>Z(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>Z(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>Z(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>Z(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>Z(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>Z(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>Z(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>Z(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>Z(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>Z(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>Z(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>Z(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>Z(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>Z(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>Z(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>Z(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>Z(()=>import(`./monokai-B_bV9PQ9.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>Z(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>Z(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>Z(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>Z(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>Z(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>Z(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>Z(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>Z(()=>import(`./red-DX1BQOs8.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>Z(()=>import(`./rose-pine-aMsaMD1D.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>Z(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>Z(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>Z(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>Z(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>Z(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>Z(()=>import(`./solarized-dark-UdsmMDCL.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>Z(()=>import(`./solarized-light-C1IUL_tW.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>Z(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>Z(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>Z(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>Z(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>Z(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>Z(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),Sf=s({createOnigurumaEngine:()=>Xf,getDefaultWasmLoader:()=>Yf,loadWasm:()=>Uf,setDefaultWasmLoader:()=>Jf}),Cf=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function wf(){return 2147483648}function Tf(){return typeof performance<`u`?performance.now():Date.now()}var Ef=(e,t)=>e+(t-e%t)%t;async function Df(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=wf();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,Ef(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:Tf,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var Of=Object.defineProperty,kf=(e,t,n)=>t in e?Of(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Af=(e,t,n)=>kf(e,typeof t==`symbol`?t:t+``,n),jf=null;function Mf(e){throw new Cf(e.UTF8ToString(e.getLastOnigError()))}var Nf=class e{constructor(t){Af(this,`utf16Length`),Af(this,`utf8Length`),Af(this,`utf16Value`),Af(this,`utf8Value`),Af(this,`utf16OffsetToUtf8`),Af(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Pf=class e{constructor(t){if(Af(this,`id`,++e.LAST_ID),Af(this,`_onigBinding`),Af(this,`content`),Af(this,`utf16Length`),Af(this,`utf8Length`),Af(this,`utf16OffsetToUtf8`),Af(this,`utf8OffsetToUtf16`),Af(this,`ptr`),!jf)throw new Cf(`Must invoke loadWasm first.`);this._onigBinding=jf,this.content=t;let n=new Nf(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=jf.omalloc(1e4),e._sharedPtrInUse=!0,jf.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(jf)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Af(Pf,`LAST_ID`,0),Af(Pf,`_sharedPtr`,0),Af(Pf,`_sharedPtrInUse`,!1);var Ff=Pf,If=class{constructor(e){if(Af(this,`_onigBinding`),Af(this,`_ptr`),!jf)throw new Cf(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Nf(e[r]);t[r]=i.createString(jf),n[r]=i.utf8Length}let r=jf.omalloc(4*e.length);jf.HEAPU32.set(t,r/4);let i=jf.omalloc(4*e.length);jf.HEAPU32.set(n,i/4);let a=jf.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)jf.ofree(t[n]);jf.ofree(i),jf.ofree(r),a===0&&Mf(jf),this._onigBinding=jf,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new Ff(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function Lf(e){return typeof e.instantiator==`function`}function Rf(e){return typeof e.default==`function`}function zf(e){return e.data!==void 0}function Bf(e){return typeof Response<`u`&&e instanceof Response}function Vf(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var Hf;function Uf(e){if(Hf)return Hf;async function t(){jf=await Df(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),Lf(n)?n=await n.instantiator(t):Rf(n)?n=await n.default(t):(zf(n)&&(n=n.data),Bf(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await Gf(n)(t):await Kf(n)(t):Vf(n)||n instanceof WebAssembly.Module?n=await Wf(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await Wf(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Hf=t(),Hf}function Wf(e){return t=>WebAssembly.instantiate(e,t)}function Gf(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Kf(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var qf;function Jf(e){qf=e}function Yf(){return qf}async function Xf(e){return e&&await Uf(e),{createScanner(e){return new If(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Ff(e)}}}var Zf=df({});pf(Zf,Sf);var Qf=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function $f(e){return ep(e)}function ep(e){return Array.isArray(e)?tp(e):e instanceof RegExp?e:typeof e==`object`?np(e):e}function tp(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=ep(e[n]);return t}function np(e){let t={};for(let n in e)t[n]=ep(e[n]);return t}function rp(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function ip(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?ip(e.substring(0,e.length-1)):e.substr(~t+1)}var ap=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,op=class{static hasCaptures(e){return e!==null&&(ap.lastIndex=0,ap.test(e))}static replaceCaptures(e,t,n){return e.replace(ap,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function sp(e,t){return e<t?-1:+(e>t)}function cp(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=sp(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function lp(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function up(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var dp=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},fp=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(_p(e),t)}static createFromParsedTheme(e,t){return bp(e,t)}_cachedMatchRoot=new dp(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>mp(e.parent,t.parentScopes));return n?new gp(n.fontStyle,n.foreground,n.background):null}},pp=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function mp(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!hp(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function hp(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var gp=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function _p(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&lp(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&lp(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new vp(l,u,e,o,s,c)}}return n}var vp=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},yp=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(yp||{});function bp(e,t){e.sort((e,t)=>{let n=sp(e.scope,t.scope);return n!==0||(n=cp(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new xp(t),o=new gp(n,a.getId(r),a.getId(i)),s=new wp(new Cp(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new fp(a,o,s)}var xp=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Sp=Object.freeze([]),Cp=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Sp,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},wp=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Cp.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(cp(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Cp(e,t,n,r,i))}},Tp=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Dp(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Ep(e){return e}function Dp(e){return e}function Op(e,t){let n=[],r=Ap(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(kp(i)){let e=[];do e.push(i),i=r.next();while(kp(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function kp(e){return!!e&&!!e.match(/[\w\.:]+/)}function Ap(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function jp(e){typeof e.dispose==`function`&&e.dispose()}var Mp=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Np=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Pp=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Fp=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Mp(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Pp;for(let n of e)Ip(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof Mp){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Ip(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof Mp?Rp({baseGrammar:a,selfGrammar:i},r):Lp(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new Mp(e))}function Lp(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];zp([r],t,n)}}function Rp(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&zp(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&zp(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function zp(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?rp({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&zp(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Gp(i);switch(a.kind){case 0:Rp({...t,selfGrammar:t.baseGrammar},n);break;case 1:Rp(t,n);break;case 2:Lp(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?Lp(a.ruleName,i,n):Rp(i,n)}else a.kind===4?n.add(new Np(a.scopeName,a.ruleName)):n.add(new Mp(a.scopeName))}}}var Bp=class{kind=0},Vp=class{kind=1},Hp=class{constructor(e){this.ruleName=e}kind=2},Up=class{constructor(e){this.scopeName=e}kind=3},Wp=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Gp(e){if(e===`$base`)return new Bp;if(e===`$self`)return new Vp;let t=e.indexOf(`#`);return t===-1?new Up(e):t===0?new Hp(e.substring(1)):new Wp(e.substring(0,t),e.substring(t+1))}var Kp=/\\(\d+)/,qp=/\\(\d+)/g,Jp=-1,Yp=-2;function Xp(e){return e}function Zp(e){return e}var Qp=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=op.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=op.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${ip(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:op.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:op.replaceCaptures(this._contentName,e,t)}},$p=class extends Qp{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},em=class extends Qp{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new am(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new om,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},tm=class extends Qp{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new om,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},nm=class extends Qp{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new am(i,this.id),this.beginCaptures=a,this._end=new am(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new om;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},rm=class extends Qp{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new am(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new am(o,Yp),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new om;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new om,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},im=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new $p(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new em(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=rp({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new tm(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new rm(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new nm(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Gp(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof tm||e instanceof nm||e instanceof rm)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},am=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&Kp.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return qp.lastIndex=0,this.source.replace(qp,(e,t)=>up(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},om=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new sm(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new sm(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},sm=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
10
+ `).replace($f,``)}function tp(e,t){return t=ep(t),ep(e)===t}function np(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||en(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&en(e,``+r);else return;break;case`className`:Bt(e,`class`,r);break;case`tabIndex`:Bt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Bt(e,n,r);break;case`style`:nn(e,r,o);return;case`data`:if(t!==`object`){Bt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=sn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&np(e,t,`name`,a.name,a,null),np(e,t,`formEncType`,a.formEncType,a,null),np(e,t,`formMethod`,a.formMethod,a,null),np(e,t,`formTarget`,a.formTarget,a,null)):(np(e,t,`encType`,a.encType,a,null),np(e,t,`method`,a.method,a,null),np(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=sn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=cn);return;case`onScroll`:r!=null&&Hf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Hf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=sn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`: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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Hf(`beforetoggle`,e),Hf(`toggle`,e),zt(e,`popover`,r);break;case`xlinkActuate`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:zt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=an.get(n)||n,zt(e,n,r);else return}Lt=!0}function rp(e,t,n,r,a,o){switch(n){case`style`:nn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)en(e,r);else if(typeof r==`number`||typeof r==`bigint`)en(e,``+r);else return;break;case`onScroll`:r!=null&&Hf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Hf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=cn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!At.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[ht]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Lt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):zt(e,n,r)}return}Lt=!0}function ip(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Hf(`error`,e),Hf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:np(e,t,o,s,n,null)}}a&&np(e,t,`srcSet`,n.srcSet,n,null),r&&np(e,t,`src`,n.src,n,null);return;case`input`:Hf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:np(e,t,r,d,n,null)}}Xt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Hf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:np(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Qt(e,!!r,n,!0):Qt(e,!!r,t,!1);return;case`textarea`:for(s in Hf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:np(e,t,s,c,n,null)}J(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:np(e,t,l,r,n,null)}return;case`dialog`:Hf(`beforetoggle`,e),Hf(`toggle`,e),Hf(`cancel`,e),Hf(`close`,e);break;case`iframe`:case`object`:Hf(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Hf(zf[r],e);break;case`image`:Hf(`error`,e),Hf(`load`,e);break;case`details`:Hf(`toggle`,e);break;case`embed`:case`source`:case`link`:Hf(`error`,e),Hf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:np(e,t,u,r,n,null)}return;default:if(rn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&rp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&np(e,t,c,r,n,null))}var ap={};function op(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||np(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Lt=!0),o=m;break;case`name`:m!==f&&(Lt=!0),a=m;break;case`checked`:m!==f&&(Lt=!0),u=m;break;case`defaultChecked`:m!==f&&(Lt=!0),d=m;break;case`value`:m!==f&&(Lt=!0),s=m;break;case`defaultValue`:m!==f&&(Lt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&np(e,t,p,m,r,f)}}Yt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||np(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Lt=!0),p=o;break;case`defaultValue`:o!==l&&(Lt=!0),c=o;break;case`multiple`:o!==l&&(Lt=!0),s=o;default:o!==l&&np(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Qt(e,!!n,n?[]:``,!1):Qt(e,!!n,t,!0)):Qt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:np(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Lt=!0),p=a;break;case`defaultValue`:a!==o&&(Lt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&np(e,t,s,a,r,o)}$t(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:np(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Lt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:np(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&np(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:np(e,t,u,p,r,m)}return;default:if(rn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&rp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||rp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&np(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||np(e,t,f,p,r,m)}function sp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function cp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&sp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&sp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var lp=null,up=null;function dp(e){return e.nodeType===9?e:e.ownerDocument}function fp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function pp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function mp(e,t,n,r){return n=dp(n).createElement(e),n[mt]=r,n[ht]=t,ip(n,e,t),Dt(n),n}function hp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var gp=null;function _p(){var e=window.event;return e&&e.type===`popstate`?e!==gp&&(gp=e,!0):(gp=null,!1)}var vp=typeof setTimeout==`function`?setTimeout:void 0,yp=typeof clearTimeout==`function`?clearTimeout:void 0,bp=typeof Promise==`function`?Promise:void 0,xp=typeof requestAnimationFrame==`function`?requestAnimationFrame:vp,Sp=typeof queueMicrotask==`function`?queueMicrotask:bp===void 0?vp:function(e){return bp.resolve(null).then(e).catch(Cp)};function Cp(e){setTimeout(function(){throw e})}function wp(e){return e===`head`}function Tp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Uh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)ym(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,ym(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[bt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&ym(e.ownerDocument.body)}n=i}while(n);Uh(t)}function Ep(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Dp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Op(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function kp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Ap(e){return kp(e.getBoundingClientRect(),getComputedStyle(e),e)}function jp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return kp(t,n,e)}function Mp(e){return e.documentElement.clientHeight}function Np(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Pp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Mp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Qm(f),u>th){s.length=o;break}f=new Promise(Np.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Fp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Fp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Fp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Fp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Ip(e){return{name:e,group:new Fp(`group`,e),imagePair:new Fp(`image-pair`,e),old:new Fp(`old`,e),new:new Fp(`new`,e)}}function Lp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Lp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Hp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Bp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Rp,e,s,r)}this._eventListeners=a}};function Rp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Lp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Hp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Bp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,zp,e,n,i),r.splice(t,1),a!==null&&a()}};function zp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Bp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Vp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Hp(e,t,n,r){if(e.length===0)return-1;r=Vp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Vp(a.optionsOrUseCapture)===r)return i}return-1}Lp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Bp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Bp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Lp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Up,e,void 0,void 0)};function Up(e,t){return e.tag!==6&&(e=b(e),hm(e,t))}Lp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Wp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Up(t[n],e);n--);};function Wp(e,t){return t.push(e),!1}Lp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=dp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Gp,e,void 0,void 0))};function Gp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Lp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Kp,e,void 0,void 0)};function Kp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Lp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,qp,e,void 0,void 0);for(var n=t=0;n<Jp.length;n++){var r=Jp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Jp[t++]=r}Jp.length=t}};function qp(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var Jp=[],Yp=!1;function Xp(e,t,n){Jp.push({fragmentInstance:e,observer:t,instance:n}),Yp||(Yp=!0,gm(function(){Yp=!1;var e=Jp;Jp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Lp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,Zp,e,void 0,void 0),e};function Zp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Lp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Lp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Wp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Qp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Qp(e,t,n,r,i){var a=Ct(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function $p(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Lp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Wp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),$p(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),$p(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function em(e,t){return e=b(e),tm(e,t),!1}function tm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function nm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Bp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Jp.length;i++){var a=Jp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Jp[r++]=a)}Jp.length=r,n.observe(e)}),tm(e,t))}function rm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Bp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Xp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function im(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:im(n),St(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function am(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[bt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=dm(e.nextSibling),e===null)break}return null}function om(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=dm(e.nextSibling),e===null))return null;return e}function sm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=dm(e.nextSibling),e===null))return null;return e}function cm(e){return e.data===`$?`||e.data===`$~`}function lm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function um(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function dm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var fm=null;function pm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return dm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function mm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function hm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function gm(e){xp(function(){xp(function(t){return e(t)})})}function _m(e,t,n){switch(t=dp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function vm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&np(e,t,r,null,ap,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===cn&&(e.onclick=null),St(e)}function ym(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);St(e)}var bm=new Map,xm=new Set;function Sm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Cm=oe.d;oe.d={f:wm,r:Tm,D:Om,C:km,L:Am,m:jm,X:Nm,S:Mm,M:Pm};function wm(){var e=Cm.f(),t=zd();return e||t}function Tm(e){var t=wt(e);t!==null&&t.tag===5&&t.type===`form`?Ys(t):Cm.r(e)}var Em=typeof document>`u`?null:document;function Dm(e,t,n){var r=Em;if(r&&typeof t==`string`&&t){var i=Jt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),xm.has(i)||(xm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),ip(t,`link`,e),Dt(t),r.head.appendChild(t)))}}function Om(e){Cm.D(e),Dm(`dns-prefetch`,e,null)}function km(e,t){Cm.C(e,t),Dm(`preconnect`,e,t)}function Am(e,t,n){Cm.L(e,t,n);var r=Em;if(r&&e&&t){var i=`link[rel="preload"][as="`+Jt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Jt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Jt(n.imageSizes)+`"]`)):i+=`[href="`+Jt(e)+`"]`;var a=i;switch(t){case`style`:a=Im(e);break;case`script`:a=Bm(e)}if(!(bm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),bm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lm(a))||t===`script`&&r.querySelector(Vm(a))))){var o=r.createElement(`link`);ip(o,`link`,e),t===`style`&&(o[xt]=!0,o.onload=o.onerror=function(){Ot(o)}),Dt(o),r.head.appendChild(o)}}}function jm(e,t){Cm.m(e,t);var n=Em;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Jt(r)+`"][href="`+Jt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bm(e)}if(!bm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),bm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vm(a)))return}r=n.createElement(`link`),ip(r,`link`,e),Dt(r),n.head.appendChild(r)}}}function Mm(e,t,n){Cm.S(e,t,n);var r=Em;if(r&&e){var i=Et(r).hoistableStyles,a=Im(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=bm.get(a))&&Wm(e,n);var c=o=r.createElement(`link`);Dt(c),ip(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Um(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nm(e,t){Cm.X(e,t);var n=Em;if(n&&e){var r=Et(n).hoistableScripts,i=Bm(e),a=r.get(i);a||(a=n.querySelector(Vm(i)),a||(e=D({src:e,async:!0},t),(t=bm.get(i))&&Gm(e,t),a=n.createElement(`script`),Dt(a),ip(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t){Cm.M(e,t);var n=Em;if(n&&e){var r=Et(n).hoistableScripts,i=Bm(e),a=r.get(i);a||(a=n.querySelector(Vm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=bm.get(i))&&Gm(e,t),a=n.createElement(`script`),Dt(a),ip(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Fm(e,t,n,r){var a=(a=he.current)?Sm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Im(n.href),t=Et(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Im(n.href);var o=Et(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Lm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=bm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},bm.set(e,o)),zm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Bm(n),t=Et(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Im(e){return`href="`+Jt(e)+`"`}function Lm(e){return`link[rel="stylesheet"][`+e+`]`}function Rm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function zm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[xt]){r.loading=1;return}}else t=e.createElement(`link`),t[xt]=!0,t.onload=t.onerror=Ot.bind(null,t),ip(t,`link`,n),Dt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Bm(e){return`[src="`+Jt(e)+`"]`}function Vm(e){return`script[async]`+e}function Hm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Jt(n.href)+`"]`);if(r)return t.instance=r,Dt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Dt(r),ip(r,`style`,a),Um(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Im(n.href);var o=e.querySelector(Lm(a));if(o)return t.state.loading|=4,t.instance=o,Dt(o),o;r=Rm(n),(a=bm.get(a))&&Wm(r,a),o=(e.ownerDocument||e).createElement(`link`),Dt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),ip(o,`link`,r),t.state.loading|=4,Um(o,n.precedence,e),t.instance=o;case`script`:return o=Bm(n.src),(a=e.querySelector(Vm(o)))?(t.instance=a,Dt(a),a):(r=n,(a=bm.get(o))&&(r=D({},n),Gm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Dt(a),ip(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Um(r,n.precedence,e));return t.instance}function Um(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Gm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Km=null;function qm(e,t,n){if(Km===null){var r=new Map,i=Km=new Map;i.set(n,r)}else i=Km,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[bt]||a[mt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Jm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Ym(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Xm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Zm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Qm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function $m(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Qm(t),e.suspenseyImages.push(t)),e=ah.bind(e),t.decode().then(e,e))}function eh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Im(r.href),a=t.querySelector(Lm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ih.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Dt(a);return}a=t.ownerDocument||t,r=Rm(r),(i=bm.get(i))&&Wm(r,i),a=a.createElement(`link`),Dt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),ip(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ih.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var th=0;function nh(e,t){return e.stylesheets&&e.count===0&&sh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&sh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&th===0&&(th=62500*cp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>th?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function rh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)sh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ih(){this.count--,rh(this)}function ah(){this.imgCount--,rh(this)}var oh=null;function sh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,oh=new Map,t.forEach(ch,e),oh=null,ih.call(e))}function ch(e,t){if(!(t.state.loading&4)){var n=oh.get(e);if(n)var r=n.get(null);else{n=new Map,oh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ih.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var lh={$$typeof:F,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function uh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=rt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rt(0),this.hiddenUpdates=rt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function dh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new uh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=xi(3,null,null,t),e.current=a,a.stateNode=e,t=Sa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},io(a),e}function fh(e){return e?(e=yi,e):yi}function ph(e,t,n,r,i,a){i=fh(i),r.context===null?r.context=i:r.pendingContext=i,r=oo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=so(e,r,t),n!==null&&(Pd(n,e,t),co(n,e,t))}function mh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hh(e,t){mh(e,t),(e=e.alternate)&&mh(e,t)}function gh(e){if(e.tag===13||e.tag===31){var t=gi(e,67108864);t!==null&&Pd(t,e,67108864),hh(e,67108864)}}function _h(e){if(e.tag===13||e.tag===31){var t=jd();t=lt(t);var n=gi(e,t);n!==null&&Pd(n,e,t),hh(e,t)}}var vh=!0;function yh(e,t,n,r){var i=G.T;G.T=null;var a=oe.p;try{oe.p=2,xh(e,t,n,r)}finally{oe.p=a,G.T=i}}function bh(e,t,n,r){var i=G.T;G.T=null;var a=oe.p;try{oe.p=8,xh(e,t,n,r)}finally{oe.p=a,G.T=i}}function xh(e,t,n,r){if(vh){var i=Sh(r);if(i===null)qf(e,t,r,Ch,n),Nh(e,r);else if(Fh(i,e,t,n,r))r.stopPropagation();else if(Nh(e,r),t&4&&-1<Mh.indexOf(e)){for(;i!==null;){var a=wt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-We(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(Yu&6)&&(gd=Ne()+500,Df(0,!1))}}break;case 31:case 13:s=gi(a,2),s!==null&&Pd(s,a,2),zd(),hh(a,2)}if(a=Sh(r),a===null&&qf(e,t,r,Ch,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else qf(e,t,r,null,n)}}function Sh(e){return e=un(e),wh(e)}var Ch=null;function wh(e){if(Ch=null,e=Ct(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ch=e,null}function Th(e){switch(e){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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Pe()){case Fe:return 2;case Ie:return 8;case Le:case Re:return 32;case ze:return 268435456;default:return 32}default:return 32}}var Eh=!1,Dh=null,Oh=null,kh=null,Ah=new Map,Q=new Map,jh=[],Mh=`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 Nh(e,t){switch(e){case`focusin`:case`focusout`:Dh=null;break;case`dragenter`:case`dragleave`:Oh=null;break;case`mouseover`:case`mouseout`:kh=null;break;case`pointerover`:case`pointerout`:Ah.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Q.delete(t.pointerId)}}function Ph(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=wt(t),t!==null&&gh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Fh(e,t,n,r,i){switch(t){case`focusin`:return Dh=Ph(Dh,e,t,n,r,i),!0;case`dragenter`:return Oh=Ph(Oh,e,t,n,r,i),!0;case`mouseover`:return kh=Ph(kh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ah.set(a,Ph(Ah.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Q.set(a,Ph(Q.get(a)||null,e,t,n,r,i)),!0}return!1}function Ih(e){var t=Ct(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ft(e.priority,function(){_h(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ft(e.priority,function(){_h(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Lh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ln=r,n.target.dispatchEvent(r),ln=null}else return t=wt(n),t!==null&&gh(t),e.blockedOn=n,!1;t.shift()}return!0}function Rh(e,t,n){Lh(e)&&n.delete(t)}function zh(){Eh=!1,Dh!==null&&Lh(Dh)&&(Dh=null),Oh!==null&&Lh(Oh)&&(Oh=null),kh!==null&&Lh(kh)&&(kh=null),Ah.forEach(Rh),Q.forEach(Rh)}function Bh(e,n){e.blockedOn===n&&(e.blockedOn=null,Eh||(Eh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,zh)))}var Vh=null;function Hh(e){Vh!==e&&(Vh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vh===e&&(Vh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(wh(r||n)===null)continue;break}var a=wt(n);a!==null&&(e.splice(t,3),t-=3,qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Uh(e){function t(t){return Bh(t,e)}Dh!==null&&Bh(Dh,e),Oh!==null&&Bh(Oh,e),kh!==null&&Bh(kh,e),Ah.forEach(t),Q.forEach(t);for(var n=0;n<jh.length;n++){var r=jh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<jh.length&&(n=jh[0],n.blockedOn===null);)Ih(n),n.blockedOn===null&&jh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ht]||null;if(typeof a==`function`)o||Hh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ht]||null)s=o.formAction;else if(wh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Hh(n)}}}function Wh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Gh(e){this._internalRoot=e}Kh.prototype.render=Gh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ph(n,jd(),e,t,null,null)},Kh.prototype.unmount=Gh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ph(e.current,2,null,e,null,null),zd(),t[gt]=null}};function Kh(e){this._internalRoot=e}Kh.prototype.unstable_scheduleHydration=function(e){if(e){var t=dt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jh.length&&t!==0&&t<jh[n].priority;n++);jh.splice(n,0,e),n===0&&Ih(e)}};var qh=n.version;if(qh!==`19.3.0`)throw Error(i(527,qh,`19.3.0`));oe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Jh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:G,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Yh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yh.isDisabled&&Yh.supportsFiber)try{He=Yh.inject(Jh),K=Yh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=gc,s=_c,c=vc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=dh(e,1,!1,null,null,n,r,null,o,s,c,Wh),e[gt]=t.current,Gf(e),new Gh(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=o((e=>{var t=d().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return t.H.useMemoCache(e)}})),y=o(((e,t)=>{t.exports=v()})),b=l(d(),1),x={};function S(e,t){let n=b.useRef(x);return n.current===x&&(n.current=e(t)),n}var C=[],w=void 0;function T(){return w}function E(e){C.push(e)}function D(e){let t=(t,n)=>{let r=S(k).current,i;try{w=r;for(let e of C)e.before(r);i=e(t,n);for(let e of C)e.after(r);r.didInitialize=!0}finally{w=void 0}return i};return t.displayName=e.displayName||e.name,t}function O(e){return b.forwardRef(D(e))}function k(){return{didInitialize:!1}}function A(){}var j=Object.freeze([]),M=Object.freeze({}),N=typeof document<`u`?b.useLayoutEffect:()=>{};function P(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var F=P(`https://base-ui.com/production-error`,`Base UI`),I=b.createContext(void 0);function L(e){let t=b.useContext(I);if(t===void 0&&!e)throw Error(F(72));return t}function R(e){b.useEffect(e,j)}var z=0,B=class e{static create(){return new e}currentId=z;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=z,t()},e)}isStarted(){return this.currentId!==z}clear=()=>{this.currentId!==z&&(clearTimeout(this.currentId),this.currentId=z)};disposeEffect=()=>this.clear};function V(){let e=S(B.create).current;return R(e.disposeEffect),e}function H(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:U,platform:ee,maxTouchPoints:te}=H(),ne=U.toLowerCase(),W=ee.toLowerCase(),re=/^i(os$|p)/.test(W)||W===`macintel`&&te>1,ie=`android`,ae=W===ie||ne.includes(ie),G=!re&&W.startsWith(`mac`);W.startsWith(`win`),!ae&&/^(linux|chrome os)/.test(W);var oe=G||re,se=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),ce=!se&&ne.includes(`firefox`);!se&&ne.includes(`chrom`);var le=oe,ue=/jsdom|happydom/.test(ne);function de(e){e.preventDefault(),e.stopPropagation()}function fe(e){return`nativeEvent`in e}function pe(e){return e.pointerType===``&&e.isTrusted?!0:ae&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function me(e){return ue?!1:!ae&&e.width===0&&e.height===0||ae&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function he(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function ge(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function _e(){return typeof window<`u`}function ve(e){return xe(e)?(e.nodeName||``).toLowerCase():`#document`}function ye(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function be(e){return((xe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function xe(e){return _e()?e instanceof Node||e instanceof ye(e).Node:!1}function Se(e){return _e()?e instanceof Element||e instanceof ye(e).Element:!1}function Ce(e){return _e()?e instanceof HTMLElement||e instanceof ye(e).HTMLElement:!1}function we(e){return!_e()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ye(e).ShadowRoot}function Te(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ie(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ee(e){return/^(table|td|th)$/.test(ve(e))}function De(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Oe=/transform|translate|scale|rotate|perspective|filter/,ke=/paint|layout|strict|content/,Ae=e=>!!e&&e!==`none`,je;function Me(e){let t=Se(e)?Ie(e):e;return Ae(t.transform)||Ae(t.translate)||Ae(t.scale)||Ae(t.rotate)||Ae(t.perspective)||!Pe()&&(Ae(t.backdropFilter)||Ae(t.filter))||Oe.test(t.willChange||``)||ke.test(t.contain||``)}function Ne(e){let t=Re(e);for(;Ce(t)&&!Fe(t);){if(Me(t))return t;if(De(t))return null;t=Re(t)}return null}function Pe(){return je??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),je}function Fe(e){return/^(html|body|#document)$/.test(ve(e))}function Ie(e){return ye(e).getComputedStyle(e)}function Le(e){return Se(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Re(e){if(ve(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||we(e)&&e.host||be(e);return we(t)?t.host:t}function ze(e){let t=Re(e);return Fe(t)?(e.ownerDocument||e).body:Ce(t)&&Te(t)?t:ze(t)}function Be(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ze(e),i=r===e.ownerDocument?.body,a=ye(r);if(i){let e=Ve(a);return t.concat(a,a.visualViewport||[],Te(r)?r:[],e&&n?Be(e):[])}return t.concat(r,Be(r,[],n))}function Ve(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function He(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function K(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&we(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ue(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var We=`data-base-ui-focusable`,Ge=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Ke=`ArrowLeft`,qe=`ArrowRight`,Je=`ArrowUp`,Ye=`ArrowDown`,Xe=`data-starting-style`,Ze=`data-ending-style`,Qe={[Xe]:``},$e={[Ze]:``},et={transitionStatus(e){return e===`starting`?Qe:e===`ending`?$e:null}},tt=`data-open`,nt=`data-closed`,rt=`data-anchor-hidden`,it=`data-popup-open`,at=`data-pressed`,ot={[it]:``},st={[it]:``,[at]:``},ct={[tt]:``},lt={[nt]:``},ut={[rt]:``},dt={open(e){return e?ot:null}},ft={open(e){return e?st:null}},pt={open(e){return e?ct:lt},anchorHidden(e){return e?ut:null}},mt={...pt,...et},ht=`data-trigger-disabled`;function gt(e,t){if(!Se(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(ht);for(let[,e]of t.entries())if(K(e,n))return!e.hasAttribute(ht);return!1}function q(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function _t(e){return e.matches(`html,body`)}function vt(e){return Ce(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function yt(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ge}`)!=null}function bt(e){return e?e.getAttribute(`role`)===`combobox`&&vt(e):!1}function xt(e){if(!e||ue)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function St(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Ct(e,t){return t!=null&&!he(t)?0:typeof e==`function`?e():e}function wt(e,t,n){let r=Ct(e,n);return typeof r==`number`?r:r?.[t]}function Tt(e){return typeof e==`function`?e():e}function Et(e,t){return t||e===`click`||e===`mousedown`}function Dt(e){return e?.includes(`mouse`)&&e!==`mousedown`}var Ot=`none`,kt=`trigger-press`,At=`trigger-hover`,jt=`trigger-focus`,Mt=`outside-press`,Nt=`item-press`,Pt=`close-press`,Ft=`increment-press`,It=`decrement-press`,Lt=`input-change`,Rt=`input-clear`,zt=`input-blur`,Bt=`input-paste`,Vt=`input-press`,Ht=`focus-out`,Ut=`escape-key`,Wt=`list-navigation`,Gt=`keyboard`,Kt=`pointer`,qt=`wheel`,Jt=`cancel-open`,Yt=`sibling-open`,Xt=`disabled`,Zt=`missing`,Qt=`initial`,$t=`imperative-action`;function J(e,t,n,r){let i=!1,a=!1,o=r??M;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function en(e,t,n){let r=n??M;return{reason:e,event:t??new Event(`base-ui`),...r}}var tn=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Y=o(((e,t)=>{t.exports=tn()}))(),nn=b.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new B,currentIdRef:{current:null},currentContextRef:{current:null}});function rn(e,t){e.current=t.current}function an(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=b.useRef(n),a=b.useRef(n),o=b.useRef(null),s=b.useRef(null),c=V();return N(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:wt(i.current,`open`),close:wt(n,`close`)}},[n,o,i,a]),(0,Y.jsx)(nn.Provider,{value:b.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function on(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=b.useContext(nn),[f,p]=b.useState(!1),m=b.useRef(n);return N(()=>{m.current=n},[n]),N(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),N(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:wt(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,J(Ot))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),N(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,rn(o,c),d.clear()}},[l,a,o,i,c,d]),b.useMemo(()=>({activeIdRef:a,hasProvider:u,delayRef:o,isInstantPhase:f}),[a,u,o,f])}function sn(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function cn(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function ln(e,t,n,r){let i=S(dn).current;return fn(i,e,t,n,r)&&mn(i,[e,t,n,r]),i.callback}function un(e){let t=S(dn).current;return pn(t,e)&&mn(t,e),t.callback}function dn(){return{callback:null,cleanup:null,refs:[]}}function fn(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function pn(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function mn(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function hn(e){let t=S(gn,e).current;return t.next=e,N(t.effect),t}function gn(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var _n={...b},vn=_n.useInsertionEffect,yn=vn&&vn!==_n.useLayoutEffect?vn:e=>e();function X(e){let t=S(bn).current;return t.next=e,yn(t.effect),t.trampoline}function bn(){let e={next:void 0,callback:xn,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function xn(){}var Sn=null;globalThis.requestAnimationFrame;var Cn=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},wn=class e{static create(){return new e}static request(e){return Cn.request(e)}static cancel(e){return Cn.cancel(e)}currentId=Sn;request(e){this.cancel(),this.currentId=Cn.request(()=>{this.currentId=Sn,e()})}cancel=()=>{this.currentId!==Sn&&(Cn.cancel(this.currentId),this.currentId=Sn)};disposeEffect=()=>this.cancel};function Tn(){let e=S(wn.create).current;return R(e.disposeEffect),e}function En(e){return e?.ownerDocument||document}var Dn={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},On={...Dn,position:`fixed`,top:0,left:0},kn={...Dn,position:`absolute`},An=b.forwardRef(function(e,t){let[n,r]=b.useState();N(()=>{le&&se&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Y.jsx)(`span`,{...e,ref:t,style:On,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),jn=Math.min,Mn=Math.max,Nn=Math.round,Pn=Math.floor,Fn=e=>({x:e,y:e}),In={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ln(e,t,n){return Mn(e,jn(t,n))}function Rn(e,t){return typeof e==`function`?e(t):e}function zn(e){return e.split(`-`)[0]}function Bn(e){return e.split(`-`)[1]}function Vn(e){return e===`x`?`y`:`x`}function Hn(e){return e===`y`?`height`:`width`}function Un(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Wn(e){return Vn(Un(e))}function Gn(e,t,n){n===void 0&&(n=!1);let r=Bn(e),i=Wn(e),a=Hn(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=er(o)),[o,er(o)]}function Kn(e){let t=er(e);return[qn(e),t,qn(t)]}function qn(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Jn=[`left`,`right`],Yn=[`right`,`left`],Xn=[`top`,`bottom`],Zn=[`bottom`,`top`];function Qn(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Yn:Jn:t?Jn:Yn;case`left`:case`right`:return t?Xn:Zn;default:return[]}}function $n(e,t,n,r){let i=Bn(e),a=Qn(zn(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(qn)))),a}function er(e){let t=zn(e);return In[t]+e.slice(t.length)}function tr(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function nr(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:tr(e)}function rr(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ir(e,t,n){return Math.floor(e/t)!==n}function ar(e,t){return t<0||t>=e.length}function or(e,t){return cr(e.current,{disabledIndices:t})}function sr(e,t){return cr(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function cr(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&ur(e,a,r));return a}function lr(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!ur(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Pn(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!ur(e,r,s))return r}};d&&de(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=cr(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=cr(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}ar(e,f)&&(f=u)}if(n===`both`){let n=Pn(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&de(t),u%o===o-1?r&&(f=cr(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=cr(e,{startingIndex:u,disabledIndices:s}),r&&ir(f,o,n)&&(f=cr(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),ir(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&de(t),u%o===0?r&&(f=cr(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=cr(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&ir(f,o,n)&&(f=cr(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),ir(f,o,n)&&(f=u));let c=Pn(l/o)===n;ar(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:cr(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function ur(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!fr(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function dr(e){return e.visibility===`hidden`||e.visibility===`collapse`}function fr(e,t=e?Ie(e):null){return!e||!e.isConnected||!t||dr(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var pr=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function mr(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return we(n)?n.host:null}function hr(e){for(let t of Array.from(e.children))if(ve(t)===`summary`)return t;return null}function gr(e,t){let n=hr(t);return!!n&&(e===n||K(n,e))}function _r(e){let t=e?ve(e):``;return e!=null&&e.matches(pr)&&(t!==`summary`||e.parentElement!=null&&ve(e.parentElement)===`details`&&hr(e.parentElement)===e)&&(t!==`details`||hr(e)==null)&&(t!==`input`||e.type!==`hidden`)}function vr(e){if(!_r(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=mr(t)){let n=t!==e,r=ve(t)===`slot`;if(t.hasAttribute(`inert`)||n&&ve(t)===`details`&&!t.open&&!gr(e,t)||t.hasAttribute(`hidden`)||!r&&!yr(t,n))return!1}return!0}function yr(e,t){let n=Ie(e);return t?n.display!==`none`:fr(e,n)}function br(e){let t=e.tabIndex;if(t<0){let t=ve(e);if(t===`details`||t===`audio`||t===`video`||Ce(e)&&e.isContentEditable)return 0}return t}function xr(e){if(ve(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Sr(e,t){let n=xr(e);if(!n)return!0;let r=t.find(e=>{let t=xr(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=xr(e);return t?.name===n.name&&t.form===n.form})===n}function Cr(e){if(Ce(e)&&ve(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Ce(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function wr(e,t){Cr(e).forEach(e=>{_r(e)&&t.push(e),wr(e,t)})}function Tr(e,t,n){Cr(e).forEach(e=>{Ce(e)&&e.matches(t)&&n.push(e),Tr(e,t,n)})}function Er(e){return vr(e)&&br(e)>=0}function Dr(e){let t=[];return wr(e,t),t.filter(vr)}function Or(e){let t=Dr(e);return t.filter(e=>br(e)>=0&&Sr(e,t))}function kr(e,t){let n=Or(e),r=n.length;if(r===0)return;let i=He(En(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Ar(e){return kr(En(e).body,1)||e}function jr(e){return kr(En(e).body,-1)||e}function Mr(e,t){if(!e)return null;let n=Or(En(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Nr(e){return Mr(e,1)}function Pr(e){return Mr(e,-1)}function Fr(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!K(n,r)}function Ir(e){Or(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Lr(e){let t=[];Tr(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Rr(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Rr(e,t.id,n)])}function zr(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Br(e){return`data-base-ui-${e}`}var Vr=0;function Hr(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Vr);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),A;let o=requestAnimationFrame(a);return Vr=o,()=>{Vr===o&&(cancelAnimationFrame(o),Vr=0)}}var Ur={inert:new WeakMap,"aria-hidden":new WeakMap},Wr=`data-base-ui-inert`,Gr={inert:new WeakSet,"aria-hidden":new WeakSet},Kr=new WeakMap,qr=0;function Jr(e){return Gr[e]}function Yr(e){return e?we(e)?e.host:Yr(e.parentNode):null}var Xr=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Yr(t);return e.contains(n)?n:null}).filter(e=>e!=null),Zr=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Qr=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{ve(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function $r(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Xr(t,e),l=i?Qr(t,Zr(c),new Set(c)):[],u=[],d=[];if(a){let e=Ur[a],n=Jr(a);s=n,o=e;let r=Xr(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);Qr(t,Zr(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(Kr.get(e)||0)+1;Kr.set(e,t),d.push(e),t===1&&e.setAttribute(Wr,``)}),qr+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(Kr.get(e)||0)-1;Kr.set(e,t),t||e.removeAttribute(Wr)}),--qr,qr||(Ur.inert=new WeakMap,Ur[`aria-hidden`]=new WeakMap,Gr.inert=new WeakSet,Gr[`aria-hidden`]=new WeakSet,Kr=new WeakMap)}}function ei(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=En(e[0]).body;return $r(e,a,n,r,{mark:i})}var ti=0;function ni(e,t=`mui`){let[n,r]=b.useState(e),i=e||n;return b.useEffect(()=>{n??(ti+=1,r(`${t}-${ti}`))},[n,t]),i}var ri=_n.useId;function ii(e,t){if(ri!==void 0){let n=ri();return e??(t?`${t}-${n}`:n)}return ni(e,t)}var ai=19;function oi(e){return ai>=e}function si(e){if(!b.isValidElement(e))return null;let t=e,n=t.props;return(oi(19)?n?.ref:t.ref)??null}function ci(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function li(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function ui(e,t){return typeof e==`function`?e(t):e}function di(e,t){return typeof e==`function`?e(t):e}var fi={};function pi(e,t,n,r,i){if(!n&&!r&&!i&&!e)return hi(t);let a=hi(e);return t&&(a=gi(a,t)),n&&(a=gi(a,n)),r&&(a=gi(a,r)),i&&(a=gi(a,i)),a}function mi(e){if(e.length===0)return fi;if(e.length===1)return hi(e[0]);let t=hi(e[0]);for(let n=1;n<e.length;n+=1)t=gi(t,e[n]);return t}function hi(e){return bi(e)?{...xi(e,fi)}:_i(e)}function gi(e,t){return bi(t)?xi(t,e):vi(e,t)}function _i(e){let t={...e};for(let e in t){let n=t[e];yi(e,n)&&(t[e]=Ci(n))}return t}function vi(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=ci(e.style,r);break;case`className`:e[n]=Ti(e.className,r);break;default:e[n]=yi(n,r)?Si(e[n],r):r}}return e}function yi(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function bi(e){return typeof e==`function`}function xi(e,t){return bi(e)?e(t):e??fi}function Si(e,t){return t?e?(...n)=>{let r=n[0];if(Ei(r)){let i=r;wi(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Ci(t):e}function Ci(e){return e&&((...t)=>{let n=t[0];return Ei(n)&&wi(n),e(...t)})}function wi(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ti(e,t){return t?e?t+` `+e:t:e}function Ei(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Di(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=ji(r));let i=Oi(t,n,r);if(n.enabled===!1)return null;let a=n.state??M;return Mi(e,r,i,a)}function Oi(e,t,n){let{className:r,style:i}=e,{state:a=M,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?ui(r,a):void 0,d=l?di(i,a):void 0,f=l?li(a,c):M,p=l&&s?ki(s):void 0,m=l?ci(f,p)??{}:M;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?un([m.ref,si(n),...o]):ln(m.ref,si(n),o):ln(null,null)),l?(u!==void 0&&(m.className=Ti(m.className,u)),d!==void 0&&(m.style=ci(m.style,d)),m):M}function ki(e){return Array.isArray(e)?mi(e):pi(void 0,e)}var Ai=Symbol.for(`react.lazy`);function ji(e){if(e?.$$typeof!==Ai)return e;let t=b.Children.toArray(e)[0];return b.isValidElement(t)?t:e}function Mi(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=pi(n,t.props);return e.ref=n.ref,b.cloneElement(t,e)}if(e&&typeof e==`string`)return Ni(e,n);throw Error(F(8))}function Ni(e,t){return e===`button`?(0,b.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,b.createElement)(`img`,{alt:``,...t,key:t.key}):b.createElement(e,t)}var Pi={style:{transition:`none`}},Fi=`data-base-ui-click-trigger`,Ii={fallbackAxisSide:`none`},Li={fallbackAxisSide:`end`},Ri={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},zi=l(h(),1),Bi=b.createContext(null),Vi=()=>b.useContext(Bi),Hi=Br(`portal`);function Ui(e={}){let{ref:t,container:n,componentProps:r=M,elementProps:i}=e,a=ii(),o=Vi()?.portalNode,[s,c]=b.useState(null),[l,u]=b.useState(null),d=X(e=>{e!==null&&u(e)}),f=b.useRef(null);N(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(xe(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Di(`div`,r,{ref:[t,d],props:[{id:a,[Hi]:``},i]}),m=s&&p?zi.createPortal(p,s):null;return{node:l,nodeId:b.isValidElement(p)?p.props.id:void 0,subtree:m}}var Wi=b.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=Ui({container:o,ref:t,componentProps:e,elementProps:c}),f=b.useRef(null),p=b.useRef(null),m=b.useRef(null),h=b.useRef(null),[g,_]=b.useState(null),v=b.useRef(!1),y=g?.modal,x=g?.open,S=!!g&&!g.modal&&g.open&&!!l;b.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&Fr(e)&&(e.type===`focusin`?v.current&&=(Lr(l),!1):(Ir(l),v.current=!0))}return cn(sn(l,`focusin`,e,!0),sn(l,`focusout`,e,!0))},[l,y]),N(()=>{l&&x===!0&&v.current&&(Lr(l),v.current=!1)},[x,l]);let C=b.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,Y.jsxs)(b.Fragment,{children:[d,(0,Y.jsxs)(Bi.Provider,{value:C,children:[S&&l&&(0,Y.jsx)(An,{"data-type":`outside`,ref:f,onFocus:e=>{Fr(e,l)?m.current?.focus():jr(g?g.domReference:null)?.focus()}}),S&&l&&(0,Y.jsx)(`span`,{role:s,"aria-owns":u,style:Ri}),l&&zi.createPortal(a,l),S&&l&&(0,Y.jsx)(An,{"data-type":`outside`,ref:p,onFocus:e=>{Fr(e,l)?h.current?.focus():(Ar(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,J(`focus-out`,e.nativeEvent)))}})]})]})});function Gi(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Ki=class{nodesRef={current:[]};events=Gi();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},qi=b.createContext(null),Ji=b.createContext(null),Yi=()=>b.useContext(qi)?.id||null,Xi=e=>{let t=b.useContext(Ji);return e??t};function Zi(e){let t=ii(),n=Xi(e),r=Yi();return N(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Qi(e){let{children:t,id:n}=e,r=Yi();return(0,Y.jsx)(qi.Provider,{value:b.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function $i(e){let{children:t,externalTree:n}=e,r=S(()=>n??new Ki).current;return(0,Y.jsx)(Ji.Provider,{value:r,children:t})}function ea(e){return e==null?e:`current`in e?e.current:e}function ta(e,t){let n=ye(Ue(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var na=20,ra=[];function ia(){ra=ra.filter(e=>e.deref()?.isConnected)}function aa(e){ia(),e&&ve(e)!==`body`&&(ra.push(new WeakRef(e)),ra.length>na&&(ra=ra.slice(-20)))}function oa(){return ia(),ra[ra.length-1]?.deref()}function sa(e){return e?Er(e)?e:Or(e)[0]||e:null}function ca(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Dr(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Er(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function la(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:x}=h.context,S=X(()=>x.current.floatingContext?.nodeId),C=i===!1,w=bt(_)&&C,T=hn(i),E=hn(a),D=hn(l),O=hn(g),k=Xi(p),A=Vi(),j=b.useRef(!1),M=b.useRef(!1),P=b.useRef(!1),F=b.useRef(null),I=b.useRef(``),L=b.useRef(``),R=b.useRef(null),z=b.useRef(null),B=ln(R,f,A?.beforeInsideRef),H=ln(z,A?.afterInsideRef),U=V(),ee=V(),te=Tn(),ne=A!=null,W=St(v),re=X((e=W)=>e?Or(e):[]),ie=X(()=>m?.().filter(e=>e!=null)??[]);b.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&K(W,He(En(W)))&&re().length===0&&!w&&de(e)}return sn(En(W),`keydown`,e)},[r,W,s,w,re]),b.useEffect(()=>{if(r||!g)return;let e=En(W);function t(){P.current=!1}function n(e){let t=Ue(e),n=ie(),r=K(v,t)||K(_,t)||K(A?.portalNode,t)||n.some(e=>e===t||K(e,t));P.current=!r,L.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,ee.start(0,()=>{M.current=!1}))}function i(){L.current=`keyboard`}return cn(sn(e,`pointerdown`,n,!0),sn(e,`pointerup`,t,!0),sn(e,`pointercancel`,t,!0),sn(e,`keydown`,i,!0),t)},[r,v,_,W,g,A,ee,ie]),b.useEffect(()=>{if(r||!c)return;let e=En(W);function t(){M.current=!0,ee.start(0,()=>{M.current=!1})}function n(e){let t=Ue(e);Er(t)&&(F.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=Ue(t);s&&n==null&&i!=null&&K(v,i)&&aa(i),queueMicrotask(()=>{let a=S(),c=h.context.triggerElements,l=ie(),f=n?.hasAttribute(Br(`focus-guard`))&&[R.current,z.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,ea(d),ea(u)].includes(n),p=!(K(_,n)||K(v,n)||K(n,v)||K(A?.portalNode,n)||l.some(e=>e===n||K(e,n))||c.hasMatchingElement(e=>K(e,n))||f||k&&(Rr(k.nodesRef.current,a).find(e=>K(e.context?.elements.floating,n)||K(e.context?.elements.domReference,n))||zr(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,St(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&W&&ca(W),o&&r!==_&&!fr(i)&&He(e)===e.body){if(Ce(W)&&(W.focus(),o===`popup`)){te.request(()=>{W.focus()});return}let e=re(),t=F.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;Ce(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!s)&&n&&p&&!M.current&&(w||n!==oa())&&(j.current=!0,h.setOpen(!1,J(Ht,t)))})}function a(){P.current||(x.current.insideReactTree=!0,U.start(0,()=>{x.current.insideReactTree=!1}))}let l=Ce(_)?_:null;if(v||l)return cn(l&&sn(l,`focusout`,i),l&&sn(l,`pointerdown`,t),v&&sn(v,`focusin`,n),v&&sn(v,`focusout`,i),v&&A&&sn(v,`focusout`,a,!0))},[r,_,v,W,s,k,A,h,c,o,re,w,S,x,U,ee,te,u,d,ie]),b.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${Br(`portal`)}]`)||[]),t=(k?zr(k.nodesRef.current,S()):[]).find(e=>bt(e.context?.elements.domReference||null))?.context?.elements.domReference,n=ei([v,...e,R.current,z.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...ie(),t,ea(d),ea(u),w?_:null].filter(e=>e!=null),{ariaHidden:s||w,mark:!1}),i=ei([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,A,w,k,S,u,d,ie]),N(()=>{if(!g||r||!Ce(W))return;I.current=``,L.current=``;let e=En(W),t=He(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||K(W,t))return;let i=null,a=()=>(i??=re(W),i[0]||W),o;o=r===!0||r===null?a():ea(r),o||=a();let s=K(W,He(e));Hr(o,{preventScroll:o===W,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=He(e);return!(t!==o&&K(W,t))}})})},[r,g,W,re,T,D,O]),N(()=>{if(r||!W)return;let e=En(W),t=He(e),n=D.current==null;aa(t);function i(e){if(e.open||(I.current=ta(e.nativeEvent,L.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(pe(e.nativeEvent)||me(e.nativeEvent))j.current=!1;else{let e=!1;En(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&ve(t)!==`body`?t:null,s=n?o||a:a||o;return s||=oa()||null,typeof i==`boolean`?s:ea(i)||s||null}return()=>{y.off(`openchange`,i);let t=He(e),n=ie(),r=K(v,t)||n.some(e=>e===t||K(e,t))||k&&Rr(k.nodesRef.current,S(),!1).some(e=>K(e.context?.elements.floating,t)),o=E.current,s=I.current,c=a(s);queueMicrotask(()=>{let n=sa(c),i=typeof o!=`boolean`;if(o&&!j.current&&Ce(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,W,E,D,y,k,_,S,ie]),N(()=>{if(!se||g||!v)return;let e=He(En(v));Ce(e)&&vt(e)&&K(v,e)&&e.blur()},[g,v]),N(()=>{if(!r&&A)return A.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,s,g,h,c,_]),N(()=>{if(!r&&W)return ca(W),()=>{queueMicrotask(ia)}},[r,W]);let ae=!r&&(!s||!w)&&(ne||s);return(0,Y.jsxs)(b.Fragment,{children:[ae&&(0,Y.jsx)(An,{"data-type":`inside`,ref:B,onFocus:e=>{if(s){let e=re();Hr(e[e.length-1])}else A?.portalNode&&(j.current=!1,Fr(e,A.portalNode)?Ar(_)?.focus():ea(d??A.beforeOutsideRef)?.focus())}}),n,ae&&(0,Y.jsx)(An,{"data-type":`inside`,ref:H,onFocus:e=>{s?Hr(re()[0]):A?.portalNode&&(c&&(j.current=!0),Fr(e,A.portalNode)?jr(_)?.focus():ea(u??A.afterOutsideRef)?.focus())}})]})}function ua(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=kt}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=b.useRef(void 0),f=Tn(),p=V(),m=b.useMemo(()=>{function e(e,t,n,r){let i=J(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=he(e.pointerType,!0)&&me(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||he(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=Ue(o);if(vt(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}he(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return b.useMemo(()=>n?{reference:m}:M,[n,m])}function da(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function fa(e){return e!=null&&e.clientX!=null}function pa(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=b.useRef(!1),u=b.useRef(null),[d,f]=b.useState(),[p,m]=b.useState([]),h=X(e=>{i.set(`positionReference`,e)}),g=X((e,t,n)=>{l.current||(!c.current.openEvent||fa(c.current.openEvent))&&i.set(`positionReference`,da(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=X(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=he(d)?o:a;b.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=ye(o);function r(t){let n=Ue(t);K(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||fa(c.current.openEvent)?u.current=sn(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),b.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),b.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),b.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=b.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return b.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function ma(){return!1}function ha(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function ga(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=ma,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f,events:p}=l.context,m=Xi(c),h=X(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=X(()=>a),{escapeKey:y,outsidePress:x}=ha(s),S=b.useRef(!1),C=b.useRef(!1),w=b.useRef(!1),T=b.useRef(!1),E=b.useRef(!1),D=b.useRef(``),O=b.useRef(null),k=V(),A=V(),j=X(()=>{A.clear(),f.current.insideReactTree=!1}),M=X(e=>{let t=f.current.floatingContext?.nodeId;return(m?Rr(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=X(e=>q(e,l.select(`floatingElement`))||q(e,l.select(`domReferenceElement`))),P=X(e=>{o()&&l.setOpen(!1,J(kt,e.nativeEvent))}),F=X(e=>{if(!u||!n||!r||e.key!==`Escape`||E.current||!y&&M(`__escapeKeyBubbles`))return;let t=J(Ut,fe(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),I=X(()=>{f.current.insideReactTree=!0,A.start(0,j)}),L=X(e=>{if(!u||!n||e.button!==0)return;let t=Ue(e.nativeEvent);K(l.select(`floatingElement`),t)&&(S.current||(S.current=!0,C.current=!1))}),R=X(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&S.current&&(C.current=!0)});b.useEffect(()=>{function e(e){e.open||(T.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),b.useEffect(()=>{if(!u||!n)return u||(T.current=!1),j;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=x;let e=new B,t=new B,i=En(d);function a(){e.clear(),E.current=!0}function o(){e.start(se?5:0,()=>{E.current=!1})}function s(){w.current=!0,t.start(0,()=>{w.current=!1})}function c(){S.current=!1,C.current=!1}function p(){let e=D.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function h(e){let t=p();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function b(e){let t=f.current.floatingContext?.nodeId,n=m&&Rr(m.nodesRef.current,t).some(t=>q(e,t.context?.elements.floating));return N(e)||n}function A(e){if(h(e)){e.type!==`click`&&!N(e)&&(t.clear(),w.current=!1),j();return}if(f.current.insideReactTree){j();return}let n=Ue(e),r=`[${Br(`inert`)}]`,i=Se(n)?n.getRootNode():null,a=Array.from((we(i)?i:En(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>K(e,n))))return;let s=Se(n)?n:null;for(;s&&!Fe(s);){let e=Re(s);if(Fe(e)||!Se(e))break;s=e}if(!(a.length&&Se(n)&&!_t(n)&&!K(n,l.select(`floatingElement`))&&a.every(e=>!K(s,e)))){if(Ce(n)&&!(`touches`in e)){let t=Fe(n),r=Ie(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!b(e)){if(p()===`intentional`){if(e.detail!==0&&!pe(e)&&!T.current)return;if(w.current){t.clear(),w.current=!1;return}}(typeof g!=`function`||g(e))&&(M(`__outsidePressBubbles`)||(l.setOpen(!1,J(Mt,e)),j()))}}}function P(e){p()===`sloppy`&&e.pointerType!==`touch`&&l.select(`open`)&&n&&!N(e)&&A(e)}function I(e){if(p()!==`sloppy`||!l.select(`open`)||!n||N(e))return;let t=e.touches[0];t&&(O.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{O.current&&(O.current.dismissOnTouchEnd=!1,O.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=Ue(e);if(!n)return;let r=sn(n,e.type,()=>{t(e),r()})}function R(e){D.current=`touch`,L(e,I)}function z(e){k.clear(),e.type===`pointerdown`&&(e.button===0&&(T.current=!0),D.current=e.pointerType),(e.type!==`mousedown`||!O.current||O.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):A(e)})}function V(e){if(e.type===`pointercancel`&&(T.current=!1),!S.current)return;let n=C.current;if(c(),p()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!b(e)){if(n){s();return}(typeof g!=`function`||g(e))&&(t.clear(),w.current=!0,j())}}}function H(e){if(p()!==`sloppy`||!O.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-O.current.startX),r=Math.abs(t.clientY-O.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(O.current.dismissOnTouchEnd=!0),i>10&&(A(e),k.clear(),O.current=null)}function U(e){L(e,H)}function ee(e){p()===`sloppy`&&O.current&&!N(e)&&(O.current.dismissOnTouchEnd&&A(e),k.clear(),O.current=null)}function te(e){L(e,ee)}let ne=cn(r&&cn(sn(i,`keydown`,F),sn(i,`compositionstart`,a),sn(i,`compositionend`,o)),_&&cn(sn(i,`click`,z,!0),sn(i,`pointerdown`,z,!0),sn(i,`pointerup`,V,!0),sn(i,`pointercancel`,V,!0),sn(i,`mousedown`,z,!0),sn(i,`mouseup`,V,!0),sn(i,`touchstart`,R,{capture:!0,passive:!0}),sn(i,`touchmove`,U,{capture:!0,passive:!0}),sn(i,`touchend`,te,{capture:!0,passive:!0})));return()=>{ne(),e.clear(),t.clear(),c(),w.current=!1,j()}},[f,d,r,_,g,u,n,y,x,F,j,v,M,N,m,l,k]);let z=b.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),H=b.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return b.useMemo(()=>n?{reference:z,floating:H,trigger:z}:{},[n,z,H])}function _a(e,t,n){let{reference:r,floating:i}=e,a=Un(t),o=Wn(t),s=Hn(o),c=zn(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Bn(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function va(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Rn(t,e),p=nr(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=rr(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=rr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ya=50,ba=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:va},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_a(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ya&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=_a(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xa=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Rn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=zn(r),_=Un(o),v=zn(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[er(o)]:Kn(o)),x=p!==`none`;!d&&x&&b.push(...$n(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Gn(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Un(t)||T.every(e=>Un(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Un(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Sa=new Set([`left`,`top`]);async function Ca(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=zn(n),s=Bn(n),c=Un(n)===`y`,l=Sa.has(o)?-1:1,u=a&&c?-1:1,d=Rn(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var wa=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ca(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ta=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Rn(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Un(i),p=Vn(f),m=u[p],h=u[f],g=(e,t)=>Ln(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ea=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Rn(e,t),u={x:n,y:r},d=Un(i),f=Vn(d),p=u[f],m=u[d],h=Rn(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Sa.has(zn(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Da=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Rn(e,t),c=await i.detectOverflow(t,s),l=zn(n),u=Bn(n),d=Un(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=jn(p-c[m],g),y=jn(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Mn(c.left,c.right):S=p-2*Mn(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Oa(e){let t=Ie(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ce(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Nn(n)!==a||Nn(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ka(e){return Se(e)?e:e.contextElement}function Aa(e){let t=ka(e);if(!Ce(t))return Fn(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Oa(t),o=(a?Nn(n.width):n.width)/r,s=(a?Nn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ja=Fn(0);function Ma(e){let t=ye(e);return!Pe()||!t.visualViewport?ja:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Na(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ye(e)}function Pa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ka(e),o=Fn(1);t&&(r?Se(r)&&(o=Aa(r)):o=Aa(e));let s=Na(a,n,r)?Ma(a):Fn(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=ye(a),t=Se(r)?ye(r):r,n=e,i=Ve(n);for(;i&&t!==n;){let e=Aa(i),t=i.getBoundingClientRect(),r=Ie(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ye(i),i=Ve(n)}}return rr({width:u,height:d,x:c,y:l})}function Fa(e,t){let n=Le(e).scrollLeft;return t?t.left+n:Pa(be(e)).left+n}function Ia(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Fa(e,n),y:n.top+t.scrollTop}}function La(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=be(r),s=t?De(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Fn(1),u=Fn(0),d=Ce(r);if((d||!a)&&((ve(r)!==`body`||Te(o))&&(c=Le(r)),d)){let e=Pa(r);l=Aa(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Ia(o,c):Fn(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ra(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function za(e){let t=Le(e),n=e.ownerDocument.body,r=Mn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Mn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Fa(e),o=-t.scrollTop;return Ie(n).direction===`rtl`&&(a+=Mn(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Ba=25;function Va(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ye(e),a=be(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Pe()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Fa(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Ba&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ha(e,t){let n=Pa(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Aa(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ua(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Va(e,n,t);else if(t===`document`)r=za(be(e));else if(Se(t))r=Ha(t,n);else{let n=Ma(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return rr(r)}function Wa(e,t){let n=t.get(e);if(n)return n;let r=Be(e,[],!1).filter(e=>Se(e)&&ve(e)!==`body`),i=null,a=Ie(e).position===`fixed`,o=a?Re(e):e;for(;Se(o)&&!Fe(o);){let e=Ie(o),t=Me(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Re(o)}return t.set(e,r),r}function Ga(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?De(t)?[]:Wa(t,this._c):[].concat(n),r],o=Ua(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ua(t,a[e],i);s=Mn(n.top,s),c=jn(n.right,c),l=jn(n.bottom,l),u=Mn(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ka(e){let{width:t,height:n}=Oa(e);return{width:t,height:n}}function qa(e,t,n){let r=Ce(t),i=be(t),a=n===`fixed`,o=Pa(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Fn(0);if((r||!a)&&((ve(t)!==`body`||Te(i))&&(s=Le(t)),r)){let e=Pa(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Fa(i));let l=i&&!r&&!a?Ia(i,s):Fn(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Ja(e){return Ie(e).position===`static`}function Ya(e,t){if(!Ce(e)||Ie(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return be(e)===n&&(n=n.ownerDocument.body),n}function Xa(e,t){let n=ye(e);if(De(e))return n;if(!Ce(e)){let t=Re(e);for(;t&&!Fe(t);){if(Se(t)&&!Ja(t))return t;t=Re(t)}return n}let r=Ya(e,t);for(;r&&Ee(r)&&Ja(r);)r=Ya(r,t);return r&&Fe(r)&&Ja(r)&&!Me(r)?n:r||Ne(e)||n}var Za=async function(e){let t=this.getOffsetParent||Xa,n=this.getDimensions,r=await n(e.floating);return{reference:qa(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Qa(e){return Ie(e).direction===`rtl`}var $a={convertOffsetParentRelativeRectToViewportRelativeRect:La,getDocumentElement:be,getClippingRect:Ga,getOffsetParent:Xa,getElementRects:Za,getClientRects:Ra,getDimensions:Ka,getScale:Aa,isElement:Se,isRTL:Qa};function eo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function to(e,t,n){let r=null,i,a=be(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Pn(d),h=Pn(a.clientWidth-(u+f)),g=Pn(a.clientHeight-(d+p)),_=Pn(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Mn(0,jn(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!eo(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=ye(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function no(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ka(e),u=i||a?[...l?Be(l):[],...t?Be(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?to(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Pa(e):null;c&&g();function g(){let t=Pa(e);h&&!eo(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ro=wa,io=Ta,ao=xa,oo=Da,so=Ea,co=(e,t,n)=>{let r=new Map,i=n??{},a={...$a,...i.platform,_c:r};return ba(e,t,{...i,platform:a})},lo=typeof document<`u`?b.useLayoutEffect:function(){};function uo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!uo(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!uo(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function fo(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function po(e,t){let n=fo(e);return Math.round(t*n)/n}function mo(e){let t=b.useRef(e);return lo(()=>{t.current=e}),t}function ho(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=b.useState(r);uo(f,r)||p(r);let[m,h]=b.useState(null),[g,_]=b.useState(null),v=b.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=b.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=b.useRef(null),w=b.useRef(null),T=b.useRef(u),E=c!=null,D=mo(c),O=mo(i),k=mo(l),A=b.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),co(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!uo(T.current,t)&&(T.current=t,zi.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);lo(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=b.useRef(!1);lo(()=>(j.current=!0,()=>{j.current=!1}),[]),lo(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=b.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:y}),[v,y]),N=b.useMemo(()=>({reference:x,floating:S}),[x,S]),P=b.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=po(N.floating,u.x),r=po(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...fo(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var go=(e,t)=>{let n=ro(e);return{name:n.name,fn:n.fn,options:[e,t]}},_o=(e,t)=>{let n=io(e);return{name:n.name,fn:n.fn,options:[e,t]}},vo=(e,t)=>({fn:so(e).fn,options:[e,t]}),yo=(e,t)=>{let n=ao(e);return{name:n.name,fn:n.fn,options:[e,t]}},bo=(e,t)=>{let n=oo(e);return{name:n.name,fn:n.fn,options:[e,t]}},xo=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),So=o(((e,t)=>{t.exports=xo()})),Co=o((e=>{var t=d(),n=So();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),wo=o(((e,t)=>{t.exports=Co()})),To=So(),Eo=wo(),Do=oi(19)?Ao:jo;function Oo(e,t,n,r,i){return Do(e,t,n,r,i)}function ko(e,t,n,r,i){let a=b.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,To.useSyncExternalStore)(e.subscribe,a,a)}E({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,To.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Ao(e,t,n,r,i){let a=T();if(!a)return ko(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function jo(e,t,n,r,i){return(0,Eo.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Mo=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Oo(this,e,t,n,r)}},No=class extends Mo{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){b.useDebugValue(e);let n=this;N(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;N(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;N(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){b.useDebugValue(e);let n=this,r=t!==void 0;N(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return b.useDebugValue(e),Oo(this,this.selectors[e],t,n,r)}useContextCallback(e,t){b.useDebugValue(e);let n=X(t??A);this.context[e]=n}useStateSetter(e){let t=b.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function Po(){let[,e]=b.useState({});return b.useCallback(()=>{e({})},[])}var Fo={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Io=class extends No{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Gi(),nested:n,triggerElements:i},Fo),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&ge(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Lo(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=b.useRef(null);r===void 0&&f.current===null&&(f.current=new Io({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),N(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};Se(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function Ro(e,t=!1,n=!1,r=!1){let[i,a]=b.useState(e&&t?`idle`:void 0),[o,s]=b.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),N(()=>{if(!e&&o&&i!==`ending`&&n){let e=wn.request(()=>{a(`ending`)});return()=>{wn.cancel(e)}}},[e,o,i,n]),N(()=>{if(!e||t)return;let n=wn.request(()=>{a(void 0)});return()=>{wn.cancel(n)}},[t,e]),N(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=wn.request(()=>{a(`idle`)});return()=>{wn.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var zo=null;function Bo(e){if(!zo){let e=[];zo=e,queueMicrotask(()=>{zo=null,zi.flushSync(()=>{for(let t of e)t()})})}zo.push(e)}function Vo(e,t=!1,n=!1){let r=Tn();return X((i,a=null)=>{r.cancel();let o=ea(e);if(o==null)return;let s=o,c=()=>{if(!n){zi.flushSync(i);return}Bo(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(s.getAnimations().some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=Xe;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function Ho(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=X(a),s=Vo(r,n,i);b.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var Uo={tabIndex:-1,[We]:``};function Wo(e){return t=>t!==`touch`||e.current}function Go(e,t=!1){let n=ii(),r=Yi()!=null,i=S(()=>e(n,r)).current;return Lo({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Ko({handle:e,store:t}){return N(()=>e.attachStore(t),[e,t]),null}function qo(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Jo(e,t){let n=b.useRef(null);return X(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),qo(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),qo(t))})}function Yo(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function Xo(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Zo(e,t,n,r={}){let i=n.reason,a=i===At,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Xo(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=Yo(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?zi.flushSync(l):l()}function Qo(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Jo(e,n),o=X(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=X(e=>{a(e),e&&o(e)});return N(()=>(s(t.current),()=>s(null)),[s,t,n,e]),N(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function $o(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=b.useRef(null),i=e.useState(`open`);N(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=J(Ot);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function es(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=Ro(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=X(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Ho({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function ts(e,t){e.useSyncedValues(t),N(()=>()=>{e.update({activeTriggerProps:M,inactiveTriggerProps:M,popupProps:M})},[e])}function ns(e,t){N(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),N(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var rs=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function is(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Io({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:M,inactiveTriggerProps:M,popupProps:M}}var as=e=>e.triggerIdProp??e.activeTriggerId,os=e=>e.openProp??e.open,ss=e=>(e.popupElement?.id??e.floatingId)||void 0;function cs(e,t){return t!==void 0&&os(e)&&as(e)===t}function ls(e,t){return cs(e,t)?!0:t!==void 0&&os(e)&&as(e)==null&&e.triggerCount===1}var us={open:os,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:as,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:ss,isTriggerActive:(e,t)=>t!==void 0&&as(e)===t,isOpenedByTrigger:(e,t)=>cs(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&as(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ls(e,t)?ss(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function ds(e){let t=b.useCallback(t=>e===void 0?A:e.subscribeStore(t),[e]),n=b.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,To.useSyncExternalStore)(t,n,()=>e?.serverStore)}function fs(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=ii(),a=Yi()!=null,o=S(()=>new Io({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new rs,floatingId:i,syncOnly:!1,nested:a})).current;return N(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Se(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function ps(e){return ms(e,e.rootContext)}function ms(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=b.useState(null),[d,f]=b.useState(void 0),[p,m]=b.useState(void 0),h=b.useRef(null),g=Xi(r),_=b.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=ho({...e,elements:{..._,...l&&{reference:l}}}),y=Se(d)?d:null,x=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,x);let S=b.useCallback(e=>{let t=Se(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),C=b.useCallback(e=>{(Se(e)||e===null)&&(h.current=e,f(e)),(Se(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!Se(e))&&v.refs.setReference(e)},[v.refs,f]),w=b.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),T=b.useMemo(()=>({...v.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:h}),[v.refs,C,w,S]),E=b.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),D=b.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:T,elements:E,nodeId:n,rootStore:t}),[v,T,E,n,t,s,c]);return N(()=>{o&&(h.current=o)},[o]),N(()=>{t.context.dataRef.current.floatingContext=D;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=D)}),b.useMemo(()=>({...v,context:D,refs:T,elements:E,rootStore:t}),[v,T,E,D,t])}var hs=G&&se;function gs(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=b.useRef(!1),c=b.useRef(null),l=b.useRef(!0),u=V();b.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=ye(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&Ce(e)&&e===He(En(e))&&(s.current=!0,c.current=e)}function a(){l.current=!0}function o(){l.current=!1}return cn(sn(t,`blur`,r),hs&&sn(t,`keydown`,a,!0),hs&&sn(t,`pointerdown`,o,!0))},[i,n]),b.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);Se(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=b.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=Ue(t.nativeEvent);if(Se(a)){if(hs&&!t.relatedTarget){if(!l.current&&!vt(a))return}else if(!xt(a))return}let o=gt(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,J(jt,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,J(jt,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=Se(n)&&n.hasAttribute(Br(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=He(En(e));(n||t!==e)&&(K(o.current.floatingContext?.refs.floating.current,t)||K(e,t)||a||gt(n??t,i.context.triggerElements)||i.setOpen(!1,J(jt,r)))})}}},[o,r,i,u]);return b.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var _s=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new B,this.restTimeout=new B,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},vs=new WeakMap;function ys(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&vs.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),vs.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function bs(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=vs.get(n);a&&a!==e&&ys(a),ys(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,vs.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function xs(e){let t=e.context.dataRef.current,n=S(()=>t.hoverInteractionState??_s.create()).current;return t.hoverInteractionState||=n,R(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Ss(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=Xi(),d=Yi(),f=xs(a),p=V(),m=X(()=>Et(l.current.openEvent?.type,f.interactedInside)),h=X(()=>Dt(l.current.openEvent?.type)),g=X(()=>{ys(f)});N(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),b.useEffect(()=>g,[g]),N(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&Se(c)&&s){let e=c,t=s,n=En(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return bs(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),b.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&Rr(u.nodesRef.current,d).length>0)}function t(e){let t=wt(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,J(At,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=Ue(e);if(!yt(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(gt(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&Se(o)&&Rr(u.nodesRef.current,r,!1).some(e=>K(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){u&&d&&!e()&&p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,J(At,t)),u.events.emit(`floating.closed`,t)})}let y=s;return cn(y&&sn(y,`mouseenter`,c),y&&sn(y,`mouseleave`,_),y&&sn(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var Cs={current:null};function ws(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Cs,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=Xi(l),y=xs(h),x=b.useRef(!1),S=hn(i),C=hn(r),w=hn(o),T=hn(n),E=hn(p),D=hn(f),O=X(()=>Et(g.current.openEvent?.type,y.interactedInside)),k=X(()=>E.current?.()!==!1),A=X((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!K(e,t);if(!Se(n))return!1;let i=n;return r.hasMatchingElement(e=>K(e,i))&&(!e||!K(e,i))}),j=X(()=>{y.handler&&=(En(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),M=X(()=>{ys(y)});return u&&(y.handleCloseOptions=i?.__options),b.useEffect(()=>j,[j]),b.useEffect(()=>{if(!n)return;function e(e){e.open?x.current=!1:(x.current=e.reason===At,j(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,j]),b.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=wt(C.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,J(At,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,J(At,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!Se(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!he(y.pointerType))return;let t=Tt(w.current),n=wt(C.current,`open`,y.pointerType),r=Ue(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(Se(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(K(e,r)){s=e;break}}Se(i)&&Se(o)&&!h.context.triggerElements.hasElement(i)&&K(i,o)&&(s=o);let c=s!=null&&A(o,s,r),l=h.select(`open`),u=D.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&x.current,f=!c&&Se(s)&&Se(o)&&K(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){k()&&h.setOpen(!0,J(At,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&k()&&h.setOpen(!0,J(At,e,s))}):g&&k()&&h.setOpen(!0,J(At,e,s)))}function i(t){if(O()){M();return}j();let n=En(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!gt(t.relatedTarget,h.context.triggerElements)){if(S.current&&r){h.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=S.current({...r,tree:v,x:t.clientX,y:t.clientY,onClose(){M(),j(),T.current&&!O()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!K(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){K(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?sn(t,`mouseout`,o):void 0;return s?cn(sn(t,`mousemove`,r,{once:!0}),sn(t,`mouseenter`,r),sn(t,`mouseleave`,i),l):cn(sn(t,`mouseenter`,r),sn(t,`mouseleave`,i),l)},[j,M,g,C,h,n,S,y,u,A,O,a,s,w,c,v,T,d,D,k,m]),b.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=A(r,n,e.target);if(a&&!he(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;bs(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Tt(w.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,O())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&k()&&h.setOpen(!0,J(At,t,n))}y.pointerType===`touch`?zi.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,O,A,a,h,w,k])}var Ts=`Escape`;function Es(e){return se&&e.movementX===0&&e.movementY===0}function Ds(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Os(e,t){return Ds(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function ks(e,t,n){return Ds(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function As(e,t,n){return Ds(t,n?e===Ke:e===qe,e===Ye)}function js(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===Ts:Ds(t,n?e===qe:e===Ke,e===Je)}function Ms(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:x,grid:S}=t,C=S!=null,w=`rootStore`in e?e.rootStore:e,T=w.useState(`open`),E=w.useState(`floatingElement`),D=w.useState(`domReferenceElement`),O=w.context.dataRef,k=St(E),A=bt(D),j=hn(k),M=Yi(),P=Xi(x),F=b.useRef(f),I=b.useRef(o??-1),L=b.useRef(null),R=b.useRef(!0),z=X(e=>{i(I.current===-1?null:I.current,e)}),B=b.useRef(!!E),V=b.useRef(T),H=b.useRef(!1),U=b.useRef(!1),ee=b.useRef(null),te=hn(h),ne=hn(T),W=hn(o),re=hn(y),ie=Tn(),ae=Tn(),G=X(()=>{function e(e){d?P?.events.emit(`virtualfocus`,e):ee.current=Hr(e,{sync:H.current,preventScroll:!0})}let t=n.current[I.current],r=U.current;t&&e(t),(H.current?e=>e():e=>ie.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),fe&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});N(()=>{O.current.orientation=g},[O,g]),N(()=>{a&&(T&&E?(I.current=o??-1,F.current&&o!=null&&(U.current=!0,z())):B.current&&(I.current=-1,z()))},[a,T,E,o,z]),N(()=>{if(a){if(!T){H.current=!1;return}if(E){if(r==null){if(H.current=!1,W.current!=null)return;if(B.current&&(I.current=-1,G()),(!V.current||!B.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ae.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||ks(L.current,g,u)||l?or(n):sr(n),L.current=null,z())};t()}}else ar(n.current,r)||(I.current=r,G(),U.current=!1)}}},[a,T,E,r,W,l,n,g,u,z,G,ae]),N(()=>{if(!a||E||!P||d||!B.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=He(En(D??t??null)),r=e.some(e=>e.context&&K(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,E,D,P,M,d]),N(()=>{V.current=T,B.current=!!E}),N(()=>{T||(L.current=null,F.current=f)},[T,f]);let oe=r!=null,se=X(e=>{if(!ne.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),ce=X(()=>_??P?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),le=X(()=>or(n,te.current)),ue=X(e=>{if(R.current=!1,H.current=!0,e.which===229||!ne.current&&e.currentTarget===j.current)return;if(l&&js(e.key,g,u,C)){Os(e.key,ce())||de(e),w.setOpen(!1,J(Wt,e.nativeEvent)),Ce(D)&&(d?P?.events.emit(`virtualfocus`,D):D.focus());return}let t=I.current,r=or(n,h),i=sr(n,h);if(A||(e.key===`Home`&&(de(e),I.current=r,z(e)),e.key===`End`&&(de(e),I.current=i,z(e))),S!=null){let t=S(e,I.current,n,g,c,u,h,r,i);if(t!=null&&(I.current=t,z(e)),g===`both`)return}if(Os(e.key,g)){if(de(e),T&&!d&&He(e.currentTarget.ownerDocument)===e.currentTarget){I.current=ks(e.key,g,u)?r:i,z(e);return}ks(e.key,g,u)?c?t>=i?s&&t!==n.current.length?I.current=-1:(H.current=!1,I.current=r):I.current=cr(n.current,{startingIndex:t,disabledIndices:h}):I.current=Math.min(i,cr(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?I.current=n.current.length:(H.current=!1,I.current=i):I.current=cr(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):I.current=Math.max(r,cr(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),ar(n.current,I.current)&&(I.current=-1),z(e)}}),fe=b.useMemo(()=>({onFocus(e){H.current=!0,se(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){Es(e)||(H.current=!0,U.current=!1,p&&se(e))},onPointerLeave(e){if(!ne.current||!R.current||e.pointerType===`touch`)return;H.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&re.current&&(ee.current?.(),ee.current=null,I.current=-1,z(e),!d)){let e=j.current,t=He(En(e));e&&K(e,t)&&e.focus({preventScroll:!0})}}}),[se,ne,j,p,n,z,re,d]),he=b.useMemo(()=>d&&T&&oe&&{"aria-activedescendant":`${v}-${r}`},[d,T,oe,v,r]),ge=b.useMemo(()=>({...A?{}:he,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&T&&!d){let t=Ue(e.nativeEvent);if(t&&!K(j.current,t))return;de(e),w.setOpen(!1,J(Ht,e.nativeEvent)),Ce(D)&&D.focus();return}ue(e)},onPointerMove(e){Es(e)||(R.current=!0)}}),[he,ue,j,A,w,T,d,D]),_e=b.useMemo(()=>{function e(e){w.setOpen(!0,J(Wt,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&pe(e.nativeEvent)&&(F.current=!d)}function n(e){F.current=f,f===`auto`&&me(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(t){let n=w.select(`open`);R.current=!1;let r=t.key.startsWith(`Arrow`),i=As(t.key,ce(),u),a=Os(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return ue(t);if(n||m||!r){if(o){let e=Os(t.key,ce());L.current=l&&e?null:t.key}if(l){i&&(de(t),n?(I.current=le(),z(t)):e(t));return}a&&(W.current!=null&&(I.current=W.current),de(t),!n&&m?e(t):ue(t),n&&z(t))}},onFocus(e){w.select(`open`)&&!d&&(I.current=-1,z(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[ue,f,le,l,z,w,m,g,ce,u,W,d]),ve=b.useMemo(()=>({...he,..._e}),[he,_e]);return b.useMemo(()=>a?{reference:ve,floating:ge,item:fe,trigger:_e}:{},[a,ve,ge,_e,fe])}function Ns(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=V(),m=b.useRef(``),h=b.useRef(u??i??-1),g=b.useRef(null),_=X(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!fr(n)||n?.matches(`:disabled`)?!1:o==null||!ur(j,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&c(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(de(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(de(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),v=X(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);K(n,t)||K(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});N(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let y=b.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return b.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var Ps=.1,Fs=Ps*Ps,Is=.5;function Ls(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Rs(e,t,n,r,i,a,o,s,c,l){let u=!1;return Ls(e,t,n,r,i,a)&&(u=!u),Ls(e,t,i,a,o,s)&&(u=!u),Ls(e,t,o,s,c,l)&&(u=!u),Ls(e,t,c,l,n,r)&&(u=!u),u}function zs(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Bs(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Vs(e={}){let{blockPointerEvents:t=!1}=e,n=new B,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Fs;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Ue(r),g=r.type===`mouseleave`,_=K(u,h),v=K(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&Se(r.relatedTarget)&&K(u,r.relatedTarget))return;function y(){return!!(s&&Rr(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Bs(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Bs(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Bs(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Bs(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!zs(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Is/2:Is*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Is+1,o=C||T?S.bottom-Is:S.top,s=C?T?S.bottom-Is:S.top:S.bottom-Is;M=Rs(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Is/2:Is*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Is,o=C||T?S.top+Is:S.bottom,s=C?T?S.top+Is:S.bottom:S.top+Is;M=Rs(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Is/2:Is*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Is+1,o=w||E?S.right-Is:S.left,s=w?E?S.right-Is:S.left:S.right-Is;M=Rs(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Is/2:Is*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Is,o=w||E?S.left+Is:S.right,s=w?E?S.left+Is:S.right:S.left+Is;M=Rs(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var Hs={...us,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Us=class extends No{constructor(e,t,n){let r=new rs;super(Ws(e,r,t,n),Gs(r),Hs)}setOpen=(e,t)=>{Zo(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,J(kt,e))}};function Ws(e,t,n,r=!1){return{...is(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function Gs(e){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var Ks=D(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Go((e,t)=>new Us({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),$o(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:x}=es(h,p),S=p.useState(`isInstantPhase`),C=p.useState(`instantType`),w=p.useState(`lastOpenChangeReason`),T=b.useRef(null);N(()=>{m&&t&&p.setOpen(!1,J(Xt))},[m,t,p]),N(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),p.set(`instantType`,`delay`)):T.current!==null&&(p.set(`instantType`,T.current),T.current=null)},[x,S,w,C,p]),N(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),b.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,J($t))}),[y,p]);let E=h||_||!t&&a!==`none`;return(0,Y.jsxs)(I.Provider,{value:p,children:[l&&(0,Y.jsx)(Ko,{handle:l,store:p}),E&&(0,Y.jsx)(qs,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function qs({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=ga(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=pa(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=b.useMemo(()=>pi(a.reference,i.reference),[a.reference,i.reference]);return ts(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??M}),null}function Js(e){return ii(e,`base-ui`)}var Ys=b.createContext(void 0);function Xs(){return b.useContext(Ys)}var Zs=`data-base-ui-tooltip-trigger`;function Qs(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(Se(n))return n}}let t=e.target;return Se(t)?t:null}function $s(e){let t=e;for(;t;){let e=t.closest(`[${Zs}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&Se(n.host)?n.host:null}return null}var ec=O(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=L(!0),m=ds(a)??p;if(!m)throw Error(F(82));let h=Js(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=b.useRef(null),x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=Qo(h,y,m,{payload:o,closeOnClick:l,closeDelay:x}),w=Xs(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=on(v,{open:_}),k=xs(v);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=hn(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),I=b.useRef(!1),R=V(),z=b.useRef(void 0);function B(){return O&&T.current!=null?0:c??w??600}function H(e){let t=y.current;if(!t||!e)return!1;let n=$s(e);return n!==null&&n!==t&&K(t,n)}function U(e){let t=H(e);return I.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,R.clear()),t}let ee=ws(v,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?Vs():null,restMs:B,delay(){return u==null&&O?{close:wt(E.current,`close`)}:{close:x}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!I.current}}),te=gs(v,{enabled:!j}).reference,ne=e=>{let t=I.current,n=Qs(e),r=U(n),i=y.current,a=i&&n&&K(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,J(At,e));return}if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&he(z.current)){let t=()=>{!I.current&&!M.current&&!m.select(`open`)&&m.setOpen(!0,J(At,e,i))},n=B();n===0?(R.clear(),t()):R.start(n,t)}},W=m.useState(`triggerProps`,C);return Di(`button`,e,{state:{open:_},ref:[t,S,y],props:[ee,te,C||N!==`none`?W:void 0,{onMouseOver(e){ne(e.nativeEvent)},onFocus(e){H(Qs(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){I.current=!1,R.clear(),z.current=void 0},onPointerEnter(e){z.current=e.pointerType},onPointerDown(e){z.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[ht]:j?``:void 0,[Zs]:j?void 0:``},f],stateAttributesMapping:dt})}),tc=b.createContext(void 0);function nc(){let e=b.useContext(tc);if(e===void 0)throw Error(F(70));return e}var rc=b.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=Ui({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,Y.jsxs)(b.Fragment,{children:[l,c&&zi.createPortal(n,c)]})}),ic=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return L().useState(`mounted`)||n?(0,Y.jsx)(tc.Provider,{value:n,children:(0,Y.jsx)(rc,{ref:t,...r})}):null}),ac=b.createContext(void 0);function oc(){let e=b.useContext(ac);if(e===void 0)throw Error(F(71));return e}var sc=b.createContext(void 0);function cc(){return b.useContext(sc)?.direction??`ltr`}var lc=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Rn(e,t)||{};if(l==null)return{};let f=nr(u),p={x:n,y:r},m=Wn(i),h=Hn(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=Ln(k,j,A),N=!c.arrow&&Bn(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),uc=(e,t)=>{let{name:n,fn:r}=lc(e);return{name:n,fn:r,options:[e,t]}},dc={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},fc={sideX:`left`,sideY:`top`},pc=`--available-width`,mc=`--available-height`,hc=`--anchor-width`,gc=`--anchor-height`,_c=`--transform-origin`,vc=pc,yc=mc;function bc(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function xc(e,t,n){let{rects:r,placement:i}=e;return{side:bc(t,zn(i),n),align:Bn(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Sc(e){return Cc(e,ps)}function Cc(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,[w,T]=b.useState(null);!g&&w!==null&&T(null);let E=_.side||`flip`,D=_.align||`flip`,O=_.fallbackAxisSide||`end`,k=v?.crossAxis??!1,A=v?.rootBoundary,j=typeof n==`function`?n:void 0,M=X(j),P=j?M:n,F=hn(n),I=hn(g),L=cc()===`rtl`,R=w||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":L?`left`:`right`,"inline-start":L?`right`:`left`}[i],z=o===`center`?R:`${R}-${o}`,B=l;typeof B==`number`?B={top:B,right:B,bottom:B,left:B}:B&&={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0};let V=+(i===`bottom`),H=+(i===`top`),U=+(i===`right`),ee=+(i===`left`),te={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:B},ne=b.useRef(null),W=hn(a),re=hn(s),ie=typeof a==`function`?0:a,ae=typeof s==`function`?0:s,G=[];p&&G.push(p),G.push(go(e=>{let t=xc(e,i,L),n=typeof W.current==`function`?W.current(t):W.current,r=typeof re.current==`function`?re.current(t):re.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ie,ae,L,i]));let oe=D===`none`&&E!==`shift`,se=!oe&&(u||k||E===`shift`),ce=E===`none`?null:yo({...te,padding:{top:B.top+1+V,right:B.right+1+ee,bottom:B.bottom+1+H,left:B.left+1+U},mainAxis:!k&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O}),le=oe?null:_o({...te,rootBoundary:A,mainAxis:D!==`none`,crossAxis:se,limiter:u||k?void 0:vo(e=>{if(!ne.current)return{};let{width:t,height:n}=ne.current.getBoundingClientRect(),r=Un(zn(e.placement)),i=r===`y`?t:n,a=r===`y`?B.left+B.right:B.top+B.bottom;return{offset:i/2+a/2}})},[te,u,k,A,B,D]);E===`shift`||D===`shift`||o===`center`?G.push(le,ce):G.push(ce,le),G.push(bo({...te,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!I.current)return;let i=e.style;i.setProperty(vc,`${t}px`),i.setProperty(yc,`${n}px`);let a=ye(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(hc,`${u}px`),i.setProperty(gc,`${d}px`)}}),uc(e=>({element:ne.current||En(e.elements.floating).createElement(`div`),padding:ne.current?d:0,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=zn(r),u=Bn(r),d=Un(l)===`y`,f=ne.current,p=typeof a==`function`?a(xc(e,i,L)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return se&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(_c,d?`${m} ${h}`:`${h} ${m}`),{}}},dc,x),N(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let ue=b.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:de,elements:fe,x:pe,y:me,middlewareData:he,update:ge,placement:_e,context:ve,isPositioned:be,floatingStyles:xe}=t({rootContext:h,open:m?g:void 0,placement:z,middleware:G,strategy:r,whileElementsMounted:m?void 0:(...e)=>no(...e,ue),nodeId:y,externalTree:C}),{sideX:Se,sideY:Ce}=he.adaptiveOrigin||fc,we=be?r:`fixed`,Te=b.useMemo(()=>{let e;return e=be?x?{position:we,[Se]:pe,[Ce]:me}:{...xe,position:we}:{position:we,top:0,left:0},e[vc]=`100vw`,e[yc]=`100vh`,be||(e.opacity=0),e},[x,we,Se,pe,Ce,me,xe,be]),Ee=b.useRef(null);N(()=>{if(!g)return;let e=F.current,t=typeof e==`function`?e():e,n=(wc(t)?t.current:t)||null;n!==Ee.current&&(de.setPositionReference(n),Ee.current=n)},[g,de,P,F]),b.useEffect(()=>{if(!g)return;let e=F.current;typeof e!=`function`&&wc(e)&&e.current!==Ee.current&&(de.setPositionReference(e.current),Ee.current=e.current)},[g,de,P,F]),b.useEffect(()=>{if(m&&g&&fe.reference&&fe.floating)return no(fe.reference,fe.floating,ge,ue)},[m,g,fe,ge,ue]);let De=zn(_e),Oe=bc(i,De,L),ke=Bn(_e)||`center`,Ae=!!he.hide?.referenceHidden;N(()=>{S&&g&&be&&De!==R&&T(De)},[S,g,be,De,R]);let je=b.useMemo(()=>({position:`absolute`,top:he.arrow?.y,left:he.arrow?.x}),[he.arrow]),Me=he.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:Te,arrowStyles:je,arrowRef:ne,arrowUncentered:Me,side:Oe,align:ke,physicalSide:De,anchorHidden:Ae,refs:de,context:ve,isPositioned:be,update:ge}),[Te,je,ne,Me,Oe,ke,De,Ae,de,ve,be,ge])}function wc(e){return e!=null&&`current`in e}function Tc(e){return e===`starting`?Pi:M}function Ec(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Di(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Tc(r),i],stateAttributesMapping:pt})}var Dc=b.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Li,style:g,..._}=e,v=L(),y=nc(),x=v.useState(`open`),S=v.useState(`mounted`),C=v.useState(`trackCursorAxis`),w=v.useState(`disableHoverablePopup`),T=v.useState(`floatingRootContext`),E=v.useState(`instantType`),D=v.useState(`transitionStatus`),O=Sc({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),k=Ec(e,b.useMemo(()=>({open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,O.side,O.align,O.anchorHidden,C,E]),{styles:O.positionerStyles,transitionStatus:D,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!S,inert:!x||C===`both`||w});return(0,Y.jsx)(ac.Provider,{value:O,children:k})}),Oc=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=L(),{side:s,align:c}=oc(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Ho({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Ss(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Di(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Uo,f,Tc(d),a],stateAttributesMapping:mt})}),kc=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=b.useMemo(()=>({open:t,close:n}),[t,n]);return(0,Y.jsx)(Ys.Provider,{value:t,children:(0,Y.jsx)(an,{delay:i,timeoutMs:r,children:e.children})})};function Ac(e){return oi(19)?e:e?`true`:void 0}function jc({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=b.useRef(e!==void 0),[a,o]=b.useState(t);return[i&&e!==void 0?e:a,b.useCallback(e=>{i||o(e)},[])]}var Mc=b.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Nc(){return b.useContext(Mc)}function Pc(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=X(i),[,o]=b.useState(!1),s=S(Ic).current,c=S(Fc).current,l=b.useRef(0),u=b.useRef(!0),d=b.useRef(null),f=b.useRef(null),p=X(()=>{u.current||(u.current=!0,o(e=>!e))}),m=X((e,t)=>{c.set(e,t),p()}),h=X(e=>{c.delete(e),p()}),g=X(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!zc(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&Bc(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Rc(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=X(()=>{let[e,t]=Lc(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});N(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),N(()=>{u.current&&v()}),N(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=X(e=>(s.add(e),()=>{s.delete(e)})),x=b.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,Y.jsx)(Mc.Provider,{value:x,children:t})}function Fc(){return new Map}function Ic(){return new Set}function Lc(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>Bc(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Rc(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function zc(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function Bc(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function Vc(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var Hc=`ArrowUp`,Uc=`ArrowDown`,Wc=`ArrowLeft`,Gc=`ArrowRight`,Kc=new Set([Hc,Uc,Wc,Gc,`Home`,`End`]),qc=[`Shift`,`Control`,`Alt`,`Meta`];function Jc(e){return Ce(e)&&e.tagName===`INPUT`}function Yc(e){return!!(Jc(e)&&e.selectionStart!=null||Ce(e)&&e.tagName===`TEXTAREA`)}function Xc(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=Zc(e,t,`left`),a=Qc(e),o=Qc(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=Zc(e,t,`top`),r=Qc(e),i=Qc(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function Zc(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Qc(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var $c=`data-composite-item-active`;function el(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=j}=e,[p,m]=b.useState(0),h=r!=null,g=b.useRef(null),_=ln(g,c),v=b.useRef([]),y=b.useRef(!1),x=b.useRef(null),S=o??p,C=X((e,t=!1)=>{if(x.current=v.current[e]??null,(s??m)(e),t){let t=v.current[e];Xc(g.current,t,a,n)}}),w=X(e=>{if(e.size===0)return;if(y.current){let e=v.current,t=e.indexOf(x.current);if(t===-1){let t=e[S];!t||ur(e,S,d)?C(tl(e,d)):x.current=t}else t!==S&&C(t);return}y.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)C(i);else if(ur(t,S,d)){let e=cr(t,{disabledIndices:d});ar(t,e)||C(e)}Xc(g.current,r,a,n)});N(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(ur(e,S,d)){let t=cr(e,{disabledIndices:d});ar(e,t)||C(t)}},[d,o,S,v,C]);let T=X((e,t,n)=>i?i(e,t,n,v):n),E=X(e=>{let o=e.key===`Home`||e.key===`End`;if(!Kc.has(e.key)||!l&&o||nl(e,f)||!g.current)return;let s=a===`rtl`,c=s?Wc:Gc,p=s?Gc:Wc,m=n===`vertical`?Uc:c,_=n===`vertical`?Hc:p,y=Ue(e.nativeEvent);if(y!=null&&Yc(y)&&!Vc(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=S,x=or(v,d),w=sr(v,d);r!=null&&(b=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:S,loopFocus:t,maxIndex:w,minIndex:x,onLoop:T,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=x:e.key===`End`&&(b=w)),b===S&&(E||D)&&(t&&b===w&&E?(b=x,i&&(b=i(e,S,b,v))):t&&b===x&&D?(b=w,i&&(b=i(e,S,b,v))):b=cr(v.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==S&&!ar(v.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),C(b,!0),queueMicrotask(()=>{v.current[b]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=Ue(e.nativeEvent);t&&n!=null&&Yc(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:E},highlightedIndex:S,onHighlightedIndexChange:C,elementsRef:v,onMapChange:w,relayKeyboardEvent:E}}function tl(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!ur(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function nl(e,t){for(let n of qc)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}var rl=b.createContext(void 0);function il(e=!1){let t=b.useContext(rl);if(t===void 0&&!e)throw Error(F(16));return t}function al(e){let{render:t,className:n,style:r,refs:i=j,props:a=j,state:o=M,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:x=!1,tag:S=`div`,...C}=e,{props:w,highlightedIndex:T,onHighlightedIndexChange:E,elementsRef:D,onMapChange:O,relayKeyboardEvent:k}=el({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:cc(),disabledIndices:v,modifierKeys:y}),A=Di(S,e,{state:o,ref:i,props:[w,...a,C],stateAttributesMapping:s}),N=b.useMemo(()=>({highlightedIndex:T,onHighlightedIndexChange:E,highlightItemOnHover:x,relayKeyboardEvent:k}),[T,E,x,k]);return(0,Y.jsx)(rl.Provider,{value:N,children:(0,Y.jsx)(Pc,{elementsRef:D,onMapChange:e=>{h?.(e),O(e)},children:A})})}var ol=b.createContext(void 0);function sl(e){let t=b.useContext(ol);if(t===void 0&&!e)throw Error(F(69));return t}var cl=b.createContext(void 0);function ll(){return b.useContext(cl)}var ul=b.createContext(void 0);function dl(){return b.useContext(ul)}var fl=b.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:a,orientation:o=`horizontal`,multiple:s=!1,value:c,className:l,render:u,style:d,...f}=e,p=sl(!0),m=ll(),h=n??j,g=c!==void 0||n!==void 0,_=(p?.disabled??!1)||(m?.disabled??!1)||r,[v,y]=jc({controlled:c,default:h,name:`ToggleGroup`,state:`value`}),x=X((e,t,n)=>{let r;s?(r=v.slice(),t?r.push(e):r.splice(v.indexOf(e),1)):r=t?[e]:[],a?.(r,n),!n.isCanceled&&y(r)}),S={disabled:_,multiple:s,orientation:o},C=b.useMemo(()=>({disabled:_,setGroupValue:x,value:v,isValueInitialized:g}),[_,x,v,g]),w={role:`group`},T=Di(`div`,e,{enabled:!!p,state:S,ref:t,props:[w,f]});return(0,Y.jsx)(ul.Provider,{value:C,children:p?T:(0,Y.jsx)(al,{render:u,className:l,style:d,state:S,refs:[t],props:[w,f],loopFocus:i,enableHomeAndEndKeys:!0,orientation:o})})});function pl(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:b.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function ml(e,t,{detail:n=0}={}){e.dispatchEvent(new(ye(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function hl(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=b.useRef(null),s=il(!0),c=a??s!==void 0,{props:l}=pl({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=b.useCallback(()=>{let e=o.current;gl(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return N(u,[u]),{getButtonProps:b.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return pi({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(wi(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=gl(r),s=!i&&_l(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),ml(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),ml(r,e)))},onKeyUp(e){if(!t){if(wi(e),a?.(e),e.target===e.currentTarget&&i&&c&&gl(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),ml(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:X(e=>{o.current=e,u()})}}function gl(e){return Ce(e)&&e.tagName===`BUTTON`}function _l(e){return Ce(e)&&e.tagName===`A`&&!!e.href}function vl(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Nc(),u=b.useRef(-1),[d,f]=b.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=b.useRef(null),h=b.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return N(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}function yl(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=il(),{ref:i,index:a}=vl(e),o=n===a,s=b.useRef(null),c=ln(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function bl(e){let{render:t,className:n,style:r,state:i=M,props:a=j,refs:o=j,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=yl({metadata:s});return Di(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}var xl=b.forwardRef(function(e,t){let{className:n,defaultPressed:r=!1,disabled:i=!1,form:a,onPressedChange:o,pressed:s,render:c,type:l,value:u,nativeButton:d=!0,style:f,...p}=e,m=Js(u||void 0),h=dl(),g=h?.value??[],_=(i||h?.disabled)??!1,[v,y]=jc({controlled:h?m!==void 0&&g.indexOf(m)>-1:s,default:r,name:`Toggle`,state:`pressed`}),{getButtonProps:x,buttonRef:S}=hl({disabled:_,native:d}),C={disabled:_,pressed:v},w=[S,t],T=[{"aria-pressed":v,onClick(e){let t=!v,n=J(Ot,e.nativeEvent);o?.(t,n),!n.isCanceled&&(m&&h?.setGroupValue?.(m,t,n),!n.isCanceled&&y(t))}},p,x],E=Di(`button`,e,{enabled:!h,state:C,ref:w,props:T}),D=b.useMemo(()=>({disabled:_,focusableWhenDisabled:!1}),[_]);return h?(0,Y.jsx)(bl,{tag:`button`,render:c,className:n,style:f,metadata:D,state:C,refs:w,props:T}):E}),Sl=b.createContext(void 0);function Cl(e){let t=b.useContext(Sl);if(!e&&t===void 0)throw Error(F(27));return t}var wl=b.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Cl(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Di(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:mt,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),Tl=b.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=Cl(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=hl({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,J(Pt,e.nativeEvent))}return Di(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),El=b.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Cl(),c=Js(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Di(`p`,e,{ref:t,props:[{id:c},o]})}),Dl=b.createContext(void 0);function Ol(){let e=b.useContext(Dl);if(e===void 0)throw Error(F(26));return e}var kl=`--nested-dialogs`,Al=`data-nested-dialog-open`,jl={...pt,...et,nestedDialogOpen(e){return e?{[Al]:``}:null}},Ml=b.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Cl(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);Ol(),Ho({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?Wo(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=Di(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...Uo,hidden:!m,onKeyDown(e){Kc.has(e.key)&&e.stopPropagation()},style:{[kl]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:jl});return(0,Y.jsx)(la,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),Nl=b.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Y.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Pl=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Cl(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Y.jsx)(Dl.Provider,{value:n,children:(0,Y.jsxs)(Wi,{ref:t,...r,children:[a&&o===!0&&(0,Y.jsx)(Nl,{ref:i.context.internalBackdropRef,inert:Ac(!s)}),e.children]})}):null}),Fl={},Il={},Ll=``;function Rl(e,t){return Te(e)?e:t}function zl(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Rl(t,n)).overflowY)}function Bl(e){if(typeof document>`u`)return!1;let t=En(e);return ye(t).innerWidth-t.documentElement.clientWidth>0}function Vl(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=En(e),n=t.documentElement,r=t.body,i=Rl(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Hl(e){let t=En(e),n=t.documentElement,r=t.body,i=Rl(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Ul(e){let t=En(e),n=t.documentElement,r=t.body,i=ye(n),a=0,o=0,s=!1,c=wn.create();if(se&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Fl={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ll=n.style.scrollBehavior,Il={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Rl(n,r);if(s=Vl(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,Fl),Object.assign(r.style,Il),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Ll)}function d(){u(),c.request(l)}l();let f=sn(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Wl=new class{lockCount=0;restore=null;timeoutLock=B.create();timeoutUnlock=B.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=En(e),n=t.documentElement,r=t.body,i=ye(n);if(zl(i,n,r)){let t=new i.MutationObserver(()=>{zl(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=re||!Bl(e);this.restore=a?Hl(e):Ul(e)}};function Gl(e=!0,t=null){N(()=>{if(e)return Wl.acquire(t)},[e,t])}function Kl({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=b.useState(0),[u,d]=b.useState(0),f=c===0,p=ga(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Ue(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||K(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return Gl(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),N(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),ts(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var ql={...us,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},Jl=class extends No{constructor(e,t,n){let r=new rs,i=Yl(e,r,t,n);super(i,Xl(r),ql)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(Yo(this.state,e,t.trigger)))}};function Yl(e,t,n,r=!1){return{...is(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Xl(e){return{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Zl(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=Cl(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},x=Go((e,t)=>new Jl({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(y),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`);ns(x,S),$o(x);let{forceUnmount:T}=es(S,x);b.useImperativeHandle(l,()=>({unmount:T,close:()=>x.setOpen(!1,J($t))}),[T,x]);let E=S||C;return(0,Y.jsxs)(Sl.Provider,{value:x,children:[u&&(0,Y.jsx)(Ko,{handle:u,store:x}),E&&(0,Y.jsx)(Kl,{store:x,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:w}):n]})}var Ql=D(function(e){return Zl(`dialog`,e)}),$l=b.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Cl(),c=Js(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Di(`h2`,e,{ref:t,props:[{id:c},o]})});function eu(e){let t=b.useRef(``),n=b.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:b.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function tu(e,t){let n=b.useRef(e),r=X(t);N(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function nu(e,t){let{onClick:n,onPointerDown:r}=eu(X((n,r)=>{(typeof e==`function`?e():e)||t(r||(re?`touch`:``))}));return b.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function ru(e){let[t,n]=b.useState(null),r=nu(e,n);return tu(e,t=>{t&&!e&&n(null)}),b.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var iu=O(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=Cl(!0),f=ds(l)??d;if(!f)throw Error(F(79));let p=Js(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),_=b.useRef(null),{registerTrigger:v,isMountedByThisTrigger:y}=Qo(p,_,f,{payload:c}),{getButtonProps:x,buttonRef:S}=hl({disabled:a,native:o}),C=ua(m),w=nu(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),T={disabled:a,open:h},E=f.useState(`triggerProps`,y);return Di(`button`,e,{state:T,ref:[S,t,v,_],props:[C.reference,E,w,{[Fi]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,x],stateAttributesMapping:dt})}),au=b.createContext(void 0);function ou(){let e=b.useContext(au);if(e===void 0)throw Error(F(64));return e}var su=`data-activation-direction`,cu={tabActivationDirection:e=>({[su]:e})},lu=b.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=b.useRef([]),[f,p]=b.useState(()=>new Map),[m,h]=jc({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[_,v]=b.useState(()=>new Map),y=b.useRef(void 0),x=b.useCallback(e=>uu(_,e),[_]),[S,C]=b.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:w,tabActivationDirection:T}=S,E=T,D=!1;w!==m&&(E=du(w,m,a,_),D=w!=null&&m!=null&&x(m)==null);let O=D?w:m,k=w!==O||T!==E;N(()=>{k&&C({previousValue:O,tabActivationDirection:E})},[O,k,E]);let A=X((e,t)=>{t.activationDirection=du(m,e,a,_),i?.(e,t),!t.isCanceled&&h(e)}),j=X((e,t)=>{i?.(e,J(t,void 0,void 0,{activationDirection:`none`}))}),M=X((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),P=b.useCallback(e=>f.get(e),[f]),F=b.useCallback(e=>{for(let t of _.values())if(e===t.value)return t.id},[_]),I=b.useMemo(()=>({getTabElementBySelectedValue:x,getTabIdByPanelValue:F,getTabPanelIdByValue:P,onValueChange:A,orientation:a,registerMountedTabPanel:M,setTabMap:v,tabActivationDirection:E,value:m}),[x,F,P,A,a,M,v,E,m]),L=b.useMemo(()=>{for(let e of _.values())if(e.value===m)return e},[_,m]),R=b.useMemo(()=>{for(let e of _.values())if(!e.disabled)return e.value},[_]),z=b.useRef(!u),B=b.useRef(r),V=b.useRef(u),H=b.useRef(!1);N(()=>{if(g)return;function e(e,t){h(e),C({previousValue:e,tabActivationDirection:`none`}),j(e,t),z.current=!1}if(_.size===0){H.current&&m!==null&&!y.current?.isConnected&&e(null,Zt);return}H.current=!0,y.current=_.keys().next().value;let t=L?.disabled,n=L==null&&m!==null;if(!t&&m===B.current&&(V.current=!1),V.current&&t&&m===B.current)return;let r=z.current;if(t||n){let n=R??null;if(m===n){z.current=!1;return}let i=Zt;r?i=Qt:t&&(i=Xt),e(n,i);return}r&&L!=null&&(j(m,Qt),z.current=!1)},[R,g,j,L,h,_,m]);let U=Di(`div`,e,{state:{orientation:a,tabActivationDirection:E},ref:t,props:l,stateAttributesMapping:cu});return(0,Y.jsx)(au.Provider,{value:I,children:(0,Y.jsx)(Pc,{elementsRef:d,children:U})})});function uu(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function du(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=uu(r,e),c=uu(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var fu=b.createContext(void 0);function pu(){let e=b.useContext(fu);if(e===void 0)throw Error(F(65));return e}var mu=b.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=ou(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:_}=pu(),{highlightedIndex:v,onHighlightedIndexChange:y}=il(),x=Js(o),{compositeProps:S,compositeRef:C,index:w}=yl({metadata:b.useMemo(()=>({disabled:r,id:x,value:a}),[r,x,a])}),T=a===u,E=b.useRef(!1),D=b.useRef(null),O=X(e=>{D.current?.(),D.current=e?g(e):null});N(()=>{if(E.current){E.current=!1;return}if(!(T&&w>-1&&v!==w))return;let e=_;if(e!=null){let t=He(En(e));if(t&&K(e,t))return}r||y(w)},[T,w,v,y,r,_]);let{getButtonProps:k,buttonRef:A}=hl({disabled:r,native:s,focusableWhenDisabled:!0}),j=d(a),M=b.useRef(!1),P=b.useRef(!1);function F(e){f(a,J(Ot,e.nativeEvent,void 0,{activationDirection:`none`}))}function I(e){T||r||F(e)}function L(e){T||r||h&&(!M.current||P.current)&&F(e)}function R(e){if(T||r)return;M.current=!0,P.current=e.button===0;let t=En(e.currentTarget);function n(){M.current=!1,P.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return Di(`button`,e,{state:{disabled:r,active:T,orientation:p,tabActivationDirection:m},ref:[t,A,C,O],props:[S,{role:`tab`,"aria-controls":j,"aria-selected":T,id:x,onClick:I,onFocus:L,onPointerDown:R,[$c]:T?``:void 0,onKeyDownCapture(){E.current=!0}},l,k],stateAttributesMapping:cu})}),hu=`data-index`,gu={...cu,...et},_u=b.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=ou(),p=Js(),{ref:m,index:h}=vl(),g=r===c,{mounted:_,transitionStatus:v,setMounted:y}=Ro(g),x=!_,S=l(r),C={hidden:x,orientation:u,tabActivationDirection:d,transitionStatus:v},w=b.useRef(null),T=Di(`div`,e,{state:C,ref:[t,m,w],props:[{"aria-labelledby":S,hidden:x,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:Ac(!g),[hu]:h},s],stateAttributesMapping:gu});return Ho({open:g,ref:w,onComplete(){g||y(!1)}}),N(()=>{if(!(p==null||x&&!a))return f(r,p)},[x,a,r,p,f]),a||_?T:null}),vu=b.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=ou(),[d,f]=b.useState(0),[p,m]=b.useState(null),h=b.useRef(new Set),g=b.useRef(new Set),_=b.useRef(null);N(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let v=X(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=X(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),x={orientation:c,tabActivationDirection:u},S={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},C=b.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:v,registerTabResizeObserverElement:y,tabsListElement:p}),[n,v,y,p]);return(0,Y.jsx)(fu.Provider,{value:C,children:(0,Y.jsx)(al,{render:a,className:r,style:o,state:x,refs:[t,m],props:[S,s],stateAttributesMapping:cu,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:j})})}),yu=b.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Di(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),bu=b.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=hl({disabled:i,focusableWhenDisabled:a,native:o});return Di(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),xu=b.createContext(void 0);function Su(e=!0){let t=b.useContext(xu);if(t===void 0&&!e)throw Error(F(25));return t}var Cu=b.createContext(void 0);function wu(e){let t=b.useContext(Cu);if(t===void 0&&!e)throw Error(F(33));return t}var Tu=b.createContext(void 0);function Eu(e){let t=b.useContext(Tu);if(t===void 0&&!e)throw Error(F(36));return t}function Du(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=Su(!0),f=d!==void 0;return b.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:Nt})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!G&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&ml(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var Ou={type:`regular-item`};function ku(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=b.useRef(null),{getButtonProps:d,buttonRef:f}=hl({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Du({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=b.useCallback(e=>pi(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=ln(u,f);return b.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var Au=b.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=vl({guess:!0,label:a}),f=wu(!0),p=Js(i),{store:m}=Eu(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=ku({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:Ou});return Di(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})}),ju=b.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=Eu(),{side:c,align:l}=wu(),u=sl(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),x=s.useState(`floatingRootContext`),S=s.useState(`floatingTreeRoot`),C=s.useState(`closeDelay`),w=s.useState(`hoverEnabled`),T=s.useState(`disabled`),E=s.useState(`openMethod`),D=_.type===`context-menu`;Ho({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),b.useEffect(()=>{function e(e){s.setOpen(!1,J(e.reason,e.domEvent))}return S.events.on(`close`,e),()=>{S.events.off(`close`,e)}},[S.events,s]),Ss(x,{enabled:w&&!T&&!D&&_.type!==`menubar`,closeDelay:C});let O=s.useStateSetter(`popupElement`),k=Di(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,O],stateAttributesMapping:mt,props:[p,{onKeyDown(e){u&&Kc.has(e.key)&&e.stopPropagation()}},Tc(f),o,{"data-rootownerid":y}]}),A=_.type===void 0||D;return(g||_.type===`menubar`&&v!==`outside-press`)&&(A=!0),(0,Y.jsx)(la,{context:x,openInteractionType:E,modal:D,disabled:!m,returnFocus:a===void 0?A:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:S,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:k})}),Mu=b.createContext(void 0);function Nu(){let e=b.useContext(Mu);if(e===void 0)throw Error(F(32));return e}var Pu=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=Eu();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,Y.jsx)(Mu.Provider,{value:n,children:(0,Y.jsx)(Wi,{ref:t,...r,portalOwnerRole:o})})}),Fu=20;function Iu(e,t,n,r){let[i,a]=b.useState(!1);N(()=>{if(!e||!t||n==null){a(!1);return}let r=En(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Fu)},[e,t,n]),Gl(e&&(!t||i),r)}var Lu=b.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Ii,style:g,..._}=e,{store:v}=Eu(),y=Nu(),x=Su(!0),S=v.useState(`parent`),C=v.useState(`floatingRootContext`),w=v.useState(`floatingTreeRoot`),T=v.useState(`mounted`),E=v.useState(`open`),D=v.useState(`modal`),O=v.useState(`openMethod`),k=v.useState(`activeTriggerElement`),A=v.useState(`transitionStatus`),j=v.useState(`positionerElement`),M=v.useState(`instantType`),P=v.useState(`adaptiveOrigin`),F=v.useState(`lastOpenChangeReason`),I=v.useState(`floatingNodeId`),L=v.useState(`floatingParentNodeId`),R=C.useState(`domReferenceElement`),z=b.useRef(null),B=Vo(j),H=n,U=c,ee=l,te=s,ne=h;S.type===`context-menu`&&(H=n??S.context?.anchor,te??=`start`,!o&&te!==`center`&&(ee=e.alignOffset??2,U=e.sideOffset??-5));let W=o,re=te;S.type===`menu`?(W??=`inline-end`,re??=`start`,ne=e.collisionAvoidance??Li):S.type===`menubar`&&(W??=S.context.orientation===`vertical`?`inline-end`:`bottom`,re??=`start`);let ie=S.type===`context-menu`,ae=Sc({anchor:H,floatingRootContext:C,positionMethod:x?`fixed`:r,mounted:T,side:W,sideOffset:U,align:re,alignOffset:ee,arrowPadding:ie?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:I,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:ne,shift:ie?{crossAxis:!(`side`in ne&&ne.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:w,adaptiveOrigin:P});b.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===I&&v.set(`hoverEnabled`,!1),e.nodeId!==I&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,J(Yt)))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[v,w.events,I]),b.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,J(t))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[w.events,v]);let G=V();b.useEffect(()=>{E||G.clear()},[E,G]),b.useEffect(()=>{function e(e){if(E&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&k&&k!==e.target){let e=v.select(`closeDelay`);e>0?G.isStarted()||G.start(e,()=>{v.setOpen(!1,J(Yt))}):v.setOpen(!1,J(Yt))}else G.clear()}}return w.events.on(`itemhover`,e),()=>{w.events.off(`itemhover`,e)}},[w.events,E,k,v,G]),b.useEffect(()=>{let e={open:E,nodeId:I,parentNodeId:L,reason:v.select(`lastOpenChangeReason`)};w.events.emit(`menuopenchange`,e)},[w.events,E,v,I,L]),N(()=>{let e=R,t=z.current;if(e&&(z.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return B(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[R,B,v]);let oe={open:E,side:ae.side,align:ae.align,anchorHidden:ae.anchorHidden,nested:S.type===`menu`,instant:M},se=S.type===`menubar`&&S.context.modal;Iu(E&&(se||D&&F!==`trigger-hover`),O===`touch`,j,k);let ce=Ec(e,oe,{styles:ae.positionerStyles,transitionStatus:A,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!T,inert:!E}),le=T&&S.type!==`menu`&&(S.type!==`menubar`&&D&&F!==`trigger-hover`||S.type===`menubar`&&S.context.modal),ue=null;return S.type===`menubar`?ue=S.context.contentElement:S.type===void 0&&(ue=k),(0,Y.jsxs)(Cu.Provider,{value:ae,children:[le&&(0,Y.jsx)(Nl,{ref:S.type===`context-menu`||S.type===`nested-context-menu`?S.context.internalBackdropRef:null,inert:Ac(!E),cutout:ue}),(0,Y.jsx)(Qi,{id:I,children:(0,Y.jsx)(Pc,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:ce})})]})}),Ru=b.createContext(null);function zu(e){let t=b.useContext(Ru);if(t===null&&!e)throw Error(F(5));return t}var Bu={...us,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Vu=class extends No{constructor(e,t,n=!1){let r=new rs,i=Uu(r,t,n,e);super(i,Hu(r),Bu),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null};function Hu(e){return{positionerRef:b.createRef(),popupRef:b.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function Uu(e,t,n=!1,r){return{...is(e,t,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Ki,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:M,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var Wu=b.createContext(void 0);function Gu(){return b.useContext(Wu)}var Ku=D(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=Su(!0),_=Eu(!0),v=zu(!0),y=Gu(),x=b.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),C=ii(),w=ii(),T=Yi(),E=x.type===`menu`?x.store:void 0,D=(n??a)&&E?.state.transitionStatus===`starting`,O=S(()=>D?E?.state.instantType:void 0).current,k=qu({open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:x,disabled:o,highlightItemOnHover:h,modal:x.type===void 0?s:void 0,rootId:C,instantType:O},w,T!=null);k.useControlledProp(`openProp`,n),k.useControlledProp(`triggerIdProp`,p),k.useContextCallback(`onOpenChangeComplete`,i);let A=k.useState(`floatingTreeRoot`),P=Zi(A),F=k.useState(`open`),I=k.useState(`activeTriggerElement`),L=k.useState(`positionerElement`),R=k.useState(`hoverEnabled`),z=k.useState(`disabled`),B=k.useState(`lastOpenChangeReason`),H=k.useState(`parent`),U=k.useState(`activeIndex`),ee=k.useState(`payload`),te=k.useState(`floatingParentNodeId`),ne=b.useRef(null),W=b.useRef(H.type!==`context-menu`),re=V(),ie=b.useRef(!0),ae=V(),G=te!=null,{openMethod:oe,triggerProps:se}=ru(F);k.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:H.type===void 0?s:void 0,openMethod:oe,rootId:C}),$o(k);let{forceUnmount:ce,transitionStatus:le}=es(F,k,()=>{k.set(`allowMouseEnter`,!1)},D),ue=Vo(k.context.popupRef);b.useEffect(()=>{if(O===void 0)return;let e=()=>{k.state.instantType===O&&k.set(`instantType`,void 0)};if(!F){e();return}if(le!==void 0)return;if(k.context.popupRef.current==null){e();return}let t=new AbortController;return ue(e,t.signal),()=>{t.abort()}},[O,F,le,ue,k]),N(()=>{g&&!_?k.update({parent:{type:`context-menu`,context:g},floatingNodeId:P,floatingParentNodeId:T}):_&&k.update({floatingNodeId:P,floatingParentNodeId:T})},[g,_,P,T,k]),b.useEffect(()=>{if(F||(ne.current=null),H.type===`context-menu`){if(!F){re.clear(),W.current=!1;return}re.start(500,()=>{W.current=!0})}},[re,F,H.type]),N(()=>{!F&&!R&&k.set(`hoverEnabled`,!0)},[F,R,k]);let de=X((e,t)=>{let n=t.reason;if(!e&&!k.select(`open`)||F===e&&t.trigger===I&&B===n)return;let i=Xo(t);if(!e&&t.trigger==null&&(t.trigger=I??void 0),r?.(e,t),t.isCanceled)return;k.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!ie.current)return;e&&n===`trigger-focus`?(ie.current=!1,ae.start(300,()=>{ie.current=!0})):(ie.current=!0,ae.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null);ne.current=t.event;let c=Yo(k.state,e,t.trigger,i());c.openChangeReason=n,c.instantType=H.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:o||s?o?`click`:`dismiss`:void 0,k.update(c)}),fe=Lo({popupStore:k,floatingRootContext:k.state.floatingRootContext,floatingId:w,nested:T!=null,onOpenChange:de}),pe=fe.context.events;N(()=>{let e=({open:e,eventDetails:t})=>de(e,t);return pe.on(`setOpen`,e),()=>{pe?.off(`setOpen`,e)}},[pe,de]);let me=b.useCallback(()=>{k.setOpen(!1,J($t))},[k]);b.useImperativeHandle(u,()=>({unmount:ce,close:me}),[ce,me]);let he;H.type===`context-menu`&&(he=H.context),b.useImperativeHandle(he?.positionerRef,()=>L,[L]),b.useImperativeHandle(he?.actionsRef,()=>({setOpen:de}),[de]);let ge=ga(fe,{enabled:!z,bubbles:{escapeKey:d&&H.type===`menu`},outsidePress(){return H.type!==`context-menu`||ne.current?.type===`contextmenu`||W.current},externalTree:G?A:void 0}),_e=cc(),ve=b.useCallback(e=>{k.select(`activeIndex`)!==e&&k.set(`activeIndex`,e)},[k]),ye=Ms(fe,{enabled:!z,listRef:k.context.itemDomElements,activeIndex:U,nested:H.type!==void 0,loopFocus:c,orientation:l,parentOrientation:H.type===`menubar`?H.context.orientation:void 0,rtl:_e===`rtl`,disabledIndices:j,onNavigate:ve,openOnArrowKeyDown:H.type!==`context-menu`,externalTree:G?A:void 0,focusItemOnHover:h}),be=b.useCallback(e=>{k.context.typingRef.current=e},[k]),xe=Ns(fe,{enabled:!z,listRef:k.context.itemLabels,elementsRef:k.context.itemDomElements,activeIndex:U,resetMs:500,onMatch:e=>{F&&e!==U&&k.set(`activeIndex`,e)},onTyping:be}),Se=b.useMemo(()=>{let e=pi(xe.reference,ye.reference,ge.reference,{onMouseMove(){k.set(`allowMouseEnter`,!0)}},se);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=F,e},[k,xe.reference,ye.reference,ge.reference,se,F]),Ce=b.useMemo(()=>{let e=pi(ye.trigger,ge.trigger,se);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[ye.trigger,ge.trigger,se]);S(()=>(k.update({inactiveTriggerProps:Ce}),null)),ts(k,{floatingRootContext:fe,activeTriggerProps:Se,inactiveTriggerProps:Ce,popupProps:b.useMemo(()=>pi(Uo,{id:w,role:`menu`,"aria-orientation":l===`horizontal`?`horizontal`:void 0,"aria-labelledby":I?.id,onMouseMove(){k.set(`allowMouseEnter`,!0),H.type===`menu`&&k.set(`hoverEnabled`,!1)},onClick(){k.select(`hoverEnabled`)&&k.set(`hoverEnabled`,!1)},onKeyDown(e){let t=k.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},xe.floating,ye.floating,ge.floating),[I,w,l,H.type,k,xe.floating,ye.floating,ge.floating]),itemProps:ye.item??M});let we=b.useMemo(()=>({store:k,parent:x}),[k,x]),Te=(0,Y.jsxs)(Tu.Provider,{value:we,children:[f&&(0,Y.jsx)(Ko,{handle:f,store:k}),typeof t==`function`?t({payload:ee}):t]});return H.type===void 0||H.type===`context-menu`?(0,Y.jsx)($i,{externalTree:A,children:Te}):Te});function qu(e,t,n){return S(()=>new Vu(e,t,n)).current}var Ju=5;function Yu(e,t){let n=Xu(t);return e.clientX>=n.left-Ju&&e.clientX<=n.right+Ju&&e.clientY>=n.top-Ju&&e.clientY<=n.bottom+Ju}function Xu(e){let t=e.getBoundingClientRect(),n=ye(e);if(ue)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Zu(e){if(Ce(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Fe(e))return Zu(Re(e))}function Qu(e,t){let n=b.useRef(null);function r(t){zi.flushSync(()=>{e.setOpen(!1,J(Ht,t.nativeEvent,t.currentTarget))}),Pr(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&Fr(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{zi.flushSync(()=>{e.setOpen(!1,J(Ht,n.nativeEvent,n.currentTarget))});let i=Nr(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&K(r,i);){let e=i;if(i=Ar(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function $u(e){let[t,n]=b.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=b.useRef(null),i=b.useRef(null),a=b.useRef(null),o=b.useRef(null),s=b.useRef(!0),c=b.useRef(null),l=ii(),u=b.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return(0,Y.jsx)(xu.Provider,{value:u,children:(0,Y.jsx)(Tu.Provider,{value:void 0,children:(0,Y.jsx)(Ku,{...e})})})}var ed=500,td=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{setAnchor:o,actionsRef:s,internalBackdropRef:c,backdropRef:l,positionerRef:u,allowMouseUpTriggerRef:d,initialCursorPointRef:f,rootId:p}=Su(!1),{store:m}=Eu(!1),h=m.useState(`open`),g=m.useState(`disabled`),_=b.useRef(null),v=b.useRef(null),y=V(),x=V(),S=b.useRef(!1),C=b.useRef(null);function w(e,t,n){let r=n.type.startsWith(`touch`);f.current={x:e,y:t},o({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),S.current=!1,s.current?.setOpen(!0,J(kt,n)),x.start(ed,()=>{S.current=!0})}function T(e){if(g)return;d.current=!0,de(e),w(e.clientX,e.clientY,e.nativeEvent);let t=En(_.current);C.current?.abort();let n=new AbortController;C.current=n,t.addEventListener(`mouseup`,e=>{if(d.current=!1,!S.current)return;x.clear(),S.current=!1;let t=Ue(e);K(u.current,t)||p&&t&&Zu(t)===p||s.current?.setOpen(!1,J(Jt,e))},{once:!0,signal:n.signal})}function E(){y.clear(),v.current=null}function D(e){if(g){E();return}if(d.current=!1,e.touches.length!==1){E();return}e.stopPropagation();let t=e.touches[0],n={x:t.clientX,y:t.clientY};v.current=n,y.start(ed,()=>{w(n.x,n.y,e.nativeEvent)})}function O(e){if(e.touches.length!==1){E();return}if(y.isStarted()&&v.current){let t=e.touches[0],n=Math.abs(t.clientX-v.current.x),r=Math.abs(t.clientY-v.current.y);(n>10||r>10)&&E()}}return b.useEffect(()=>()=>{C.current?.abort()},[]),b.useEffect(()=>{function e(e){if(g)return;let t=Ue(e);(K(_.current,t)||K(c.current,t)||K(l.current,t))&&e.preventDefault()}return sn(En(_.current),`contextmenu`,e)},[l,g,c]),Di(`div`,e,{state:{open:h},ref:[_,t],props:[{onContextMenu:T,onTouchStart:D,onTouchMove:O,onTouchEnd:E,onTouchCancel:E,style:{WebkitTouchCallout:`none`}},a],stateAttributesMapping:ft})}),nd=Lu;function rd(e){let t=(0,b.useRef)(e);return(0,b.useInsertionEffect)(()=>void(t.current=e)),(0,b.useCallback)((...e)=>t.current(...e),[])}var id=(0,b.createContext)(void 0);function ad(){return(0,b.useContext)(id)}var od={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},sd={display:`contents`};function cd(){return null}var ld=`diffs-container`,ud=/(?=^From [a-f0-9]+ .+$)/m,dd=/(?=^diff --git)/gm,fd=/(?<=\n)/,pd=/^(---|\+\+\+)\s+([^\t\r\n]+)/,md=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,hd=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,gd=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,_d=`header-prefix`,vd=`header-filename-suffix`,yd=`header-metadata`,bd=`header-custom`,xd={dark:`pierre-dark`,light:`pierre-light`},Sd=`data-theme-css`,Cd=`data-unsafe-css`,wd=`data-diffs-scrollbar-measure`,Td=`--diffs-scrollbar-gutter-measured`,Ed=1e5,Dd={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...Dd});var Od=Object.freeze({fromStart:0,fromEnd:0}),kd={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Ad={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function jd(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function Md({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function Nd(e,t){return e-(t===0?0:1)}function Pd(e,t){return Nd(e,t)+t}function Fd(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:Id(n,e.startContentIndex)}}function Id(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){let t=e.hunkContent[r];n+=t.type===`context`?t.lines:t.deletions+t.additions}return n}function Ld({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:i,renderHeaderMetadata:a,renderAnnotation:o,renderGutterUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:u,getInstance:d,getAnnotationSlotName:f=jd}){let p=n?.(e),m=r?.(e),h=i?.(e),g=a?.(e);return(0,Y.jsxs)(Y.Fragment,{children:[p==null?(0,Y.jsxs)(Y.Fragment,{children:[m!=null&&(0,Y.jsx)(`div`,{slot:`header-prefix`,children:m}),h!=null&&(0,Y.jsx)(`div`,{slot:`header-filename-suffix`,children:h}),g!=null&&(0,Y.jsx)(`div`,{slot:`header-metadata`,children:g})]}):(0,Y.jsx)(`div`,{slot:bd,children:p}),o!=null&&l?.map((e,t)=>(0,Y.jsx)(`div`,{slot:f(e),children:o(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=Rd(t,e);return(0,Y.jsx)(`div`,{slot:n,style:sd,children:c(t,d)},n)}),s!=null&&(0,Y.jsx)(`div`,{slot:`gutter-utility-slot`,style:od,children:s(u)})]})}function Rd(e,t){let n=Fd(e,t);return n==null?void 0:Md({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}var zd=new Map,Bd=new Map,Vd=new Map,Hd=new Set;function Ud(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!Hd.has(t))return!1;return!0}function Wd(e=xd){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}var Gd=new Set;function Kd(e){let t=[],n=new Set;for(let r of qd(e.themes)){let e=Xd(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return Kd({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return Kd({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function qd(e){return Jd(e)?[e]:e}function Jd(e){return Xd(e)||Yd(e)}function Yd(e){return typeof e.name==`string`&&typeof e.load==`function`}function Xd(e){return typeof e.getThemes==`function`}function Zd(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var Qd=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},$d=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},ef=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function tf(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new Qd(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new $d(i));let c=r,l=s().then(e=>{let a=Zd(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new ef(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var nf=tf();function rf(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=nf.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,nf.getResolvedTheme(n)??nf.seedResolvedTheme(n,e);Gd.has(n)||(Gd.add(n),t.loadThemeSync(e))}}function af(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(Hd.has(n.name))continue;let e=zd.get(n.name);e??(e=n,zd.set(n.name,e)),Hd.add(e.name),t.loadLanguageSync(e.data)}}function of(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var sf=Object.defineProperty,cf=Object.getOwnPropertyDescriptor,lf=Object.getOwnPropertyNames,uf=Object.prototype.hasOwnProperty,df=(e,t)=>{let n={};for(var r in e)sf(n,r,{get:e[r],enumerable:!0});return t||sf(n,Symbol.toStringTag,{value:`Module`}),n},ff=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=lf(t),a=0,o=i.length,s;a<o;a++)s=i[a],!uf.call(e,s)&&s!==n&&sf(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=cf(t,s))||r.enumerable});return e},pf=(e,t,n)=>(ff(e,t,`default`),n&&ff(n,t,`default`)),mf=`modulepreload`,hf=function(e){return`/`+e},gf={},Z=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=hf(t,n),t=s(t),t in gf)return;gf[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:mf,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},_f=[{id:`abap`,name:`ABAP`,import:(()=>Z(()=>import(`./abap-CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>Z(()=>import(`./actionscript-3-Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>Z(()=>import(`./ada-C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>Z(()=>import(`./ahk-CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>Z(()=>import(`./ahk2-_6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>Z(()=>import(`./angular-html-C76KiGzD.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>Z(()=>import(`./angular-ts-BD3Mnzbu.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>Z(()=>import(`./apache-U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>Z(()=>import(`./apex-KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>Z(()=>import(`./apl-DnigSV4a.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>Z(()=>import(`./applescript-CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>Z(()=>import(`./ara-4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>Z(()=>import(`./asciidoc-SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>Z(()=>import(`./asm-Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>Z(()=>import(`./astro-qsSokj8B.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>Z(()=>import(`./awk-BWXHIvNe.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>Z(()=>import(`./ballerina-B7ZEbQpA.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>Z(()=>import(`./bat-qdxAdBWQ.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>Z(()=>import(`./beancount-D-usSTwE.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>Z(()=>import(`./berry-DKpUyyne.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>Z(()=>import(`./bibtex-Ci_nEsc7.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>Z(()=>import(`./bicep-CUHmPFLl.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>Z(()=>import(`./bird2-CYIUgYqB.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>Z(()=>import(`./blade-U2J3SHwq.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>Z(()=>import(`./bsl-_VjlB9mv.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>Z(()=>import(`./c-Cy48DBYM.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>Z(()=>import(`./c3-D0apG41V.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>Z(()=>import(`./cadence-CQ2zXKGN.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>Z(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([19,20])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>Z(()=>import(`./chapel-DU0nbvcT.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>Z(()=>import(`./clarity-CtfBBspg.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>Z(()=>import(`./clojure-DqKBuwfJ.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>Z(()=>import(`./cmake-Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>Z(()=>import(`./cobol-APxYRU6S.js`),__vite__mapDeps([23,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>Z(()=>import(`./codeowners-C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>Z(()=>import(`./codeql-oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>Z(()=>import(`./coffee-CMVtIQ8B.js`),__vite__mapDeps([24,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>Z(()=>import(`./common-lisp-Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>Z(()=>import(`./coq-DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>Z(()=>import(`./cpp-DiEjTdBd.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>Z(()=>import(`./crystal-_rYX393W.js`),__vite__mapDeps([28,2,3,1,16,22,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>Z(()=>import(`./csharp-oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>Z(()=>import(`./css-BtU1DKpW.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>Z(()=>import(`./csv-Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>Z(()=>import(`./cue-CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>Z(()=>import(`./cypher-ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>Z(()=>import(`./d-qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>Z(()=>import(`./dart-CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>Z(()=>import(`./dax-BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>Z(()=>import(`./desktop-Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>Z(()=>import(`./diff-woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>Z(()=>import(`./docker-IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>Z(()=>import(`./dotenv-_5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>Z(()=>import(`./dream-maker-DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>Z(()=>import(`./edge-Br4ksFXa.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>Z(()=>import(`./elixir-Bv_4y_zG.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>Z(()=>import(`./elm-Cx-dMND_.js`),__vite__mapDeps([32,27,22])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>Z(()=>import(`./emacs-lisp-c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>Z(()=>import(`./erb-COPrSViz.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>Z(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>Z(()=>import(`./fennel-DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>Z(()=>import(`./fish-BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>Z(()=>import(`./fluent-C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>Z(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>Z(()=>import(`./fortran-free-form-CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>Z(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>Z(()=>import(`./gdresource-xMC7jr7x.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>Z(()=>import(`./gdscript-DYvRD3hg.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>Z(()=>import(`./gdshader-CBce3t8t.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>Z(()=>import(`./genie-CV2tkWYe.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>Z(()=>import(`./gherkin-DExj1W_8.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>Z(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>Z(()=>import(`./git-rebase-D4D90lTW.js`),__vite__mapDeps([50,29])))},{id:`gleam`,name:`Gleam`,import:(()=>Z(()=>import(`./gleam-CSRkHgEL.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>Z(()=>import(`./glimmer-js-C4gWrPQL.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>Z(()=>import(`./glimmer-ts-C99h3W7n.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>Z(()=>import(`./glsl-RHBJe3ld.js`).then(e=>e.n),__vite__mapDeps([27,22])))},{id:`gn`,name:`GN`,import:(()=>Z(()=>import(`./gn-ilITqXS6.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>Z(()=>import(`./gnuplot-7GGW24-e.js`),[]))},{id:`go`,name:`Go`,import:(()=>Z(()=>import(`./go-rLFTqkRN.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>Z(()=>import(`./graphql-BPqUaGZt.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37])))},{id:`groovy`,name:`Groovy`,import:(()=>Z(()=>import(`./groovy-CacY0gHj.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>Z(()=>import(`./hack-99V0ltvY.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>Z(()=>import(`./haml-xERa5XyT.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>Z(()=>import(`./handlebars-MxX_GTuw.js`),__vite__mapDeps([54,2,3,1,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>Z(()=>import(`./haskell-D8IpX4py.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>Z(()=>import(`./haxe-C8oCnwJJ.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>Z(()=>import(`./hcl-Dh228itO.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>Z(()=>import(`./hjson-CxZEssPk.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>Z(()=>import(`./hlsl-Cvrh5tZx.js`),[]))},{id:`html`,name:`HTML`,import:(()=>Z(()=>import(`./html-DQ9PwQ1m.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>Z(()=>import(`./html-derivative-Da9qILg2.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>Z(()=>import(`./http-BuqmB53K.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>Z(()=>import(`./hurl-XOQLnEit.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37])))},{id:`hxml`,name:`HXML`,import:(()=>Z(()=>import(`./hxml-Dcm88srW.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>Z(()=>import(`./hy-CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>Z(()=>import(`./imba-DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>Z(()=>import(`./ini-B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>Z(()=>import(`./java-UC978eZQ.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>Z(()=>import(`./javascript-Cd1RGTih.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>Z(()=>import(`./jinja-BHqpe9-0.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>Z(()=>import(`./jison-CyfJfEgg.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>Z(()=>import(`./json-DaP6JbRl.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>Z(()=>import(`./json5-BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>Z(()=>import(`./jsonc-CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>Z(()=>import(`./jsonl-CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>Z(()=>import(`./jsonnet-CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>Z(()=>import(`./jssm-DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>Z(()=>import(`./jsx-Cssoyj6k.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>Z(()=>import(`./julia-BjB65CXm.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>Z(()=>import(`./just-D2b48Zu1.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>Z(()=>import(`./kdl-CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>Z(()=>import(`./kotlin-DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>Z(()=>import(`./kusto-C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>Z(()=>import(`./latex-8j1UKNrn.js`),__vite__mapDeps([66,67,63])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>Z(()=>import(`./lean-CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>Z(()=>import(`./less-DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>Z(()=>import(`./liquid-D5v7uHS3.js`),__vite__mapDeps([68,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>Z(()=>import(`./llvm-DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>Z(()=>import(`./log-BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>Z(()=>import(`./logo-Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>Z(()=>import(`./lua-BkDLRwYN.js`).then(e=>e.n),__vite__mapDeps([38,22])))},{id:`luau`,name:`Luau`,import:(()=>Z(()=>import(`./luau-C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>Z(()=>import(`./make-Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>Z(()=>import(`./markdown-BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>Z(()=>import(`./marko-CDSu0yiU.js`),__vite__mapDeps([69,3,5,11,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>Z(()=>import(`./matlab-D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>Z(()=>import(`./mdc-DlSfqxlb.js`),__vite__mapDeps([71,15,1,2,3,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>Z(()=>import(`./mdx-DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>Z(()=>import(`./mermaid-BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>Z(()=>import(`./mipsasm-BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>Z(()=>import(`./mojo-fg40_ntQ.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>Z(()=>import(`./moonbit-DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>Z(()=>import(`./move-BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>Z(()=>import(`./narrat-_X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>Z(()=>import(`./nextflow-BJtWHP5T.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>Z(()=>import(`./nextflow-groovy-DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>Z(()=>import(`./nginx-DO1j2OMH.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>Z(()=>import(`./nim-DW4cM62z.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41])))},{id:`nix`,name:`Nix`,import:(()=>Z(()=>import(`./nix-IvuFDN5E.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>Z(()=>import(`./nsis-CjNLYCLg.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>Z(()=>import(`./nushell-DHYfO66s.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>Z(()=>import(`./objective-c-D1A_Heim.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>Z(()=>import(`./objective-cpp-BsSzOQcm.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>Z(()=>import(`./ocaml-O90oeIOV.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>Z(()=>import(`./odin-B1RWQWA5.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>Z(()=>import(`./openscad-BUDT5pXO.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>Z(()=>import(`./org-BAp2JzOV.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93])))},{id:`pascal`,name:`Pascal`,import:(()=>Z(()=>import(`./pascal-4ZHwLPI5.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>Z(()=>import(`./perl-DB9IU3wX.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>Z(()=>import(`./php-DXrf_D3v.js`),__vite__mapDeps([87,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>Z(()=>import(`./pkl-ot-7Btpt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>Z(()=>import(`./plsql-DGHpHOYJ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>Z(()=>import(`./po-BiJDBrnU.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>Z(()=>import(`./polar-C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>Z(()=>import(`./postcss-BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>Z(()=>import(`./powerquery-DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>Z(()=>import(`./powershell-CCSX75yM.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>Z(()=>import(`./prisma-DMgNhnYS.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>Z(()=>import(`./prolog-iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>Z(()=>import(`./proto-DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>Z(()=>import(`./pug-Bs1r0pSU.js`),__vite__mapDeps([94,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>Z(()=>import(`./puppet-CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>Z(()=>import(`./purescript-9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>Z(()=>import(`./python-gzcpVVnB.js`),[]))},{id:`qml`,name:`QML`,import:(()=>Z(()=>import(`./qml-Doo9Cky4.js`),__vite__mapDeps([95,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>Z(()=>import(`./qmldir-DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>Z(()=>import(`./qss-Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>Z(()=>import(`./r-VQJF91wR.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>Z(()=>import(`./racket-DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>Z(()=>import(`./raku-B3gFvitq.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>Z(()=>import(`./razor-Dk2kv2By.js`),__vite__mapDeps([96,1,2,3,78])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>Z(()=>import(`./rbs-C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>Z(()=>import(`./reg-CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>Z(()=>import(`./regexp-GqRnLewn.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>Z(()=>import(`./rel-BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>Z(()=>import(`./riscv-Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>Z(()=>import(`./ron-VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>Z(()=>import(`./rosmsg-CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>Z(()=>import(`./rst-C6ecNsTn.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>Z(()=>import(`./ruby-BabyW0G3.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>Z(()=>import(`./rust-Cfkwpbl8.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>Z(()=>import(`./sas-Cp-D0gCy.js`),__vite__mapDeps([99,16])))},{id:`sass`,name:`Sass`,import:(()=>Z(()=>import(`./sass-DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>Z(()=>import(`./scala-BiFt_7mu.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>Z(()=>import(`./scheme-DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>Z(()=>import(`./scss-CLMXRvFR.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>Z(()=>import(`./sdbl-bTVj8UrX.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>Z(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([100,101])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>Z(()=>import(`./shellscript-GvcLJj0i.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>Z(()=>import(`./shellsession-KR2Dmt63.js`),__vite__mapDeps([102,29])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>Z(()=>import(`./smalltalk-BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>Z(()=>import(`./smithy-Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>Z(()=>import(`./solidity-Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>Z(()=>import(`./soy-U6NbpSMz.js`),__vite__mapDeps([103,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>Z(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([104,105])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>Z(()=>import(`./splunk-BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>Z(()=>import(`./sql-DktaOtqw.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>Z(()=>import(`./ssh-config-BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>Z(()=>import(`./stata-yvKR4kbi.js`),__vite__mapDeps([106,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>Z(()=>import(`./stylus-B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>Z(()=>import(`./surrealql-B171yI6F.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>Z(()=>import(`./svelte-B_bXEc_n.js`),__vite__mapDeps([108,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>Z(()=>import(`./swift-CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>Z(()=>import(`./system-verilog-Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>Z(()=>import(`./systemd-BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>Z(()=>import(`./talonscript-CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>Z(()=>import(`./tasl-DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>Z(()=>import(`./tcl-CZd0xW_V.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>Z(()=>import(`./templ-tqWE5SlP.js`),__vite__mapDeps([109,2,3,81])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>Z(()=>import(`./terraform-DswuEJGm.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>Z(()=>import(`./tex-B6G2B11r.js`).then(e=>e.n),__vite__mapDeps([67,63])))},{id:`toml`,name:`TOML`,import:(()=>Z(()=>import(`./toml-CcmNWLt0.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>Z(()=>import(`./ts-tags-D5u9DmEU.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22])))},{id:`tsv`,name:`TSV`,import:(()=>Z(()=>import(`./tsv-sltzmVWM.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>Z(()=>import(`./tsx-CTl-K_ZZ.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>Z(()=>import(`./turtle-ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>Z(()=>import(`./twig-BUTDHjkY.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>Z(()=>import(`./typescript-CYAHNX2C.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>Z(()=>import(`./typespec-BRdr0IET.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>Z(()=>import(`./typst-Bio4TaT2.js`),__vite__mapDeps([112,2,3,1,5,8,7,9,11,13,113,114,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,44,48,50,81,82,54,83,115,63,62,65,66,67,70,116,84,85,87,88,89,90,91,93,117,94,118,119,111,120])))},{id:`v`,name:`V`,import:(()=>Z(()=>import(`./v-DBj4K9d_.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>Z(()=>import(`./vala-zf12oZj6.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>Z(()=>import(`./vb-DOwzaHZ0.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>Z(()=>import(`./verilog-B2gwz-sJ.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>Z(()=>import(`./vhdl-BroJfC0k.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>Z(()=>import(`./viml-DvXPmvsu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>Z(()=>import(`./vue-B-YWRyzE.js`),__vite__mapDeps([121,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>Z(()=>import(`./vue-html-Cb0eicOD.js`),__vite__mapDeps([122,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>Z(()=>import(`./vue-vine-DxrdWx_w.js`),__vite__mapDeps([123,2,3,5,12,70,124])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>Z(()=>import(`./vyper-CgoNMtux.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>Z(()=>import(`./wasm-ByWQv1Qj.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>Z(()=>import(`./wenyan-C8pVoKbM.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>Z(()=>import(`./wgsl-BsKzXJz4.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>Z(()=>import(`./wikitext-ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>Z(()=>import(`./wit-DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>Z(()=>import(`./wolfram-DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>Z(()=>import(`./xml-B2i4V3Dl.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>Z(()=>import(`./xsl-Cys3IUoN.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>Z(()=>import(`./yaml-CedrTYT2.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>Z(()=>import(`./zenscript-BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>Z(()=>import(`./zig-CMLA9XwU.js`),[]))}],vf=Object.fromEntries(_f.map(e=>[e.id,e.import])),yf=Object.fromEntries(_f.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),bf={...vf,...yf},xf=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>Z(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>Z(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>Z(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>Z(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>Z(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>Z(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>Z(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>Z(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>Z(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>Z(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>Z(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>Z(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>Z(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>Z(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>Z(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>Z(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>Z(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>Z(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>Z(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>Z(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>Z(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>Z(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>Z(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>Z(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>Z(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>Z(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>Z(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>Z(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>Z(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>Z(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>Z(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>Z(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>Z(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>Z(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>Z(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>Z(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>Z(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>Z(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>Z(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>Z(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>Z(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>Z(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>Z(()=>import(`./monokai-B_bV9PQ9.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>Z(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>Z(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>Z(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>Z(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>Z(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>Z(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>Z(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>Z(()=>import(`./red-DX1BQOs8.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>Z(()=>import(`./rose-pine-aMsaMD1D.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>Z(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>Z(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>Z(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>Z(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>Z(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>Z(()=>import(`./solarized-dark-UdsmMDCL.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>Z(()=>import(`./solarized-light-C1IUL_tW.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>Z(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>Z(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>Z(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>Z(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>Z(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>Z(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),Sf=s({createOnigurumaEngine:()=>Xf,getDefaultWasmLoader:()=>Yf,loadWasm:()=>Uf,setDefaultWasmLoader:()=>Jf}),Cf=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function wf(){return 2147483648}function Tf(){return typeof performance<`u`?performance.now():Date.now()}var Ef=(e,t)=>e+(t-e%t)%t;async function Df(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=wf();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,Ef(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:Tf,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var Of=Object.defineProperty,kf=(e,t,n)=>t in e?Of(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Af=(e,t,n)=>kf(e,typeof t==`symbol`?t:t+``,n),jf=null;function Mf(e){throw new Cf(e.UTF8ToString(e.getLastOnigError()))}var Nf=class e{constructor(t){Af(this,`utf16Length`),Af(this,`utf8Length`),Af(this,`utf16Value`),Af(this,`utf8Value`),Af(this,`utf16OffsetToUtf8`),Af(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Pf=class e{constructor(t){if(Af(this,`id`,++e.LAST_ID),Af(this,`_onigBinding`),Af(this,`content`),Af(this,`utf16Length`),Af(this,`utf8Length`),Af(this,`utf16OffsetToUtf8`),Af(this,`utf8OffsetToUtf16`),Af(this,`ptr`),!jf)throw new Cf(`Must invoke loadWasm first.`);this._onigBinding=jf,this.content=t;let n=new Nf(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=jf.omalloc(1e4),e._sharedPtrInUse=!0,jf.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(jf)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Af(Pf,`LAST_ID`,0),Af(Pf,`_sharedPtr`,0),Af(Pf,`_sharedPtrInUse`,!1);var Ff=Pf,If=class{constructor(e){if(Af(this,`_onigBinding`),Af(this,`_ptr`),!jf)throw new Cf(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Nf(e[r]);t[r]=i.createString(jf),n[r]=i.utf8Length}let r=jf.omalloc(4*e.length);jf.HEAPU32.set(t,r/4);let i=jf.omalloc(4*e.length);jf.HEAPU32.set(n,i/4);let a=jf.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)jf.ofree(t[n]);jf.ofree(i),jf.ofree(r),a===0&&Mf(jf),this._onigBinding=jf,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new Ff(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function Lf(e){return typeof e.instantiator==`function`}function Rf(e){return typeof e.default==`function`}function zf(e){return e.data!==void 0}function Bf(e){return typeof Response<`u`&&e instanceof Response}function Vf(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var Hf;function Uf(e){if(Hf)return Hf;async function t(){jf=await Df(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),Lf(n)?n=await n.instantiator(t):Rf(n)?n=await n.default(t):(zf(n)&&(n=n.data),Bf(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await Gf(n)(t):await Kf(n)(t):Vf(n)||n instanceof WebAssembly.Module?n=await Wf(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await Wf(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Hf=t(),Hf}function Wf(e){return t=>WebAssembly.instantiate(e,t)}function Gf(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Kf(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var qf;function Jf(e){qf=e}function Yf(){return qf}async function Xf(e){return e&&await Uf(e),{createScanner(e){return new If(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Ff(e)}}}var Zf=df({});pf(Zf,Sf);var Qf=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function $f(e){return ep(e)}function ep(e){return Array.isArray(e)?tp(e):e instanceof RegExp?e:typeof e==`object`?np(e):e}function tp(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=ep(e[n]);return t}function np(e){let t={};for(let n in e)t[n]=ep(e[n]);return t}function rp(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function ip(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?ip(e.substring(0,e.length-1)):e.substr(~t+1)}var ap=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,op=class{static hasCaptures(e){return e!==null&&(ap.lastIndex=0,ap.test(e))}static replaceCaptures(e,t,n){return e.replace(ap,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function sp(e,t){return e<t?-1:+(e>t)}function cp(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=sp(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function lp(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function up(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var dp=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},fp=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(_p(e),t)}static createFromParsedTheme(e,t){return bp(e,t)}_cachedMatchRoot=new dp(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>mp(e.parent,t.parentScopes));return n?new gp(n.fontStyle,n.foreground,n.background):null}},pp=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function mp(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!hp(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function hp(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var gp=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function _p(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&lp(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&lp(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new vp(l,u,e,o,s,c)}}return n}var vp=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},yp=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(yp||{});function bp(e,t){e.sort((e,t)=>{let n=sp(e.scope,t.scope);return n!==0||(n=cp(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new xp(t),o=new gp(n,a.getId(r),a.getId(i)),s=new wp(new Cp(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new fp(a,o,s)}var xp=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Sp=Object.freeze([]),Cp=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Sp,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},wp=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Cp.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(cp(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Cp(e,t,n,r,i))}},Tp=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Dp(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Ep(e){return e}function Dp(e){return e}function Op(e,t){let n=[],r=Ap(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(kp(i)){let e=[];do e.push(i),i=r.next();while(kp(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function kp(e){return!!e&&!!e.match(/[\w\.:]+/)}function Ap(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function jp(e){typeof e.dispose==`function`&&e.dispose()}var Mp=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Np=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Pp=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Fp=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Mp(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Pp;for(let n of e)Ip(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof Mp){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Ip(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof Mp?Rp({baseGrammar:a,selfGrammar:i},r):Lp(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new Mp(e))}function Lp(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];zp([r],t,n)}}function Rp(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&zp(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&zp(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function zp(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?rp({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&zp(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Gp(i);switch(a.kind){case 0:Rp({...t,selfGrammar:t.baseGrammar},n);break;case 1:Rp(t,n);break;case 2:Lp(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?Lp(a.ruleName,i,n):Rp(i,n)}else a.kind===4?n.add(new Np(a.scopeName,a.ruleName)):n.add(new Mp(a.scopeName))}}}var Bp=class{kind=0},Vp=class{kind=1},Hp=class{constructor(e){this.ruleName=e}kind=2},Up=class{constructor(e){this.scopeName=e}kind=3},Wp=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Gp(e){if(e===`$base`)return new Bp;if(e===`$self`)return new Vp;let t=e.indexOf(`#`);return t===-1?new Up(e):t===0?new Hp(e.substring(1)):new Wp(e.substring(0,t),e.substring(t+1))}var Kp=/\\(\d+)/,qp=/\\(\d+)/g,Jp=-1,Yp=-2;function Xp(e){return e}function Zp(e){return e}var Qp=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=op.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=op.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${ip(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:op.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:op.replaceCaptures(this._contentName,e,t)}},$p=class extends Qp{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},em=class extends Qp{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new am(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new om,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},tm=class extends Qp{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new om,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},nm=class extends Qp{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new am(i,this.id),this.beginCaptures=a,this._end=new am(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new om;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},rm=class extends Qp{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new am(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new am(o,Yp),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new om;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new om,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},im=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new $p(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new em(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=rp({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new tm(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new rm(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new nm(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Gp(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof tm||e instanceof nm||e instanceof rm)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},am=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&Kp.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return qp.lastIndex=0,this.source.replace(qp,(e,t)=>up(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},om=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new sm(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new sm(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},sm=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
11
11
  `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},cm=class{constructor(e,t){this.languageId=e,this.tokenType=t}},lm=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new cm(e,8),this._embeddedLanguagesMatcher=new um(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new cm(0,0);_getBasicScopeAttributes=new dp(e=>new cm(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},um=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>up(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var dm=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function fm(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=pm(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new dm(i,!0);f()}return new dm(i,!1);function f(){let o=mm(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Jp){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),ym(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof nm){let r=o;ym(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof rm){let r=o;ym(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(ym(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function pm(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof rm&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=vm(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Yp){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),ym(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function mm(e,t,n,r,i,a){let o=hm(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=gm(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function hm(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=_m(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function gm(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=_m(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function _m(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function vm(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function ym(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));fm(e,p,n&&d.start===0,d.start,f,i,!1,0),jp(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new bm(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var bm=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function xm(e,t,n,r,i,a,o,s){return new Tm(e,t,n,r,i,a,o,s)}function Sm(e,t,n,r,i){let a=Op(t,Cm),o=im.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function Cm(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(wm(t[r],e))return n=r+1,!0;return!1})}function wm(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var Tm=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new lm(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Em(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=Op(e,Cm);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)Sm(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&Sm(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Xp(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Zp(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Em(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=im.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Om.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=Tp.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?Dm.createRootAndLookUpScopeName(a,r,this):Dm.createRoot(`unknown`,r),t=new Om(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
12
12
  `;let a=this.createOnigString(e),o=a.content.length,s=new Am(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=fm(this,a,i,0,t,s,!0,r);return jp(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Em(e,t){return e=$f(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Dm=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=pp.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new pp(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new pp(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),Tp.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Om=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?Dm.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(1)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Zp(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=Dm.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Xp(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Dm.fromExtension(r,n.contentNameScopesList))}},km=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):Op(e,Cm).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Op(e,Cm).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Am=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=Tp.set(n,0,Ep(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=Tp.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},jm=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,xm(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Mm=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new jm(fp.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(fp.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new km(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new Fp(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},Nm=Om.NULL;function Pm(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function Fm(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Im(e){return Array.isArray(e)?e:[e]}async function Lm(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function Rm(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function zm(e){return e===`ansi`||Rm(e)}function Bm(e){return e===`none`}function Vm(e){return Bm(e)}var Hm=/(\r?\n)/g;function Um(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(Hm),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var Wm={light:`#333333`,dark:`#bbbbbb`},Gm={light:`#fffffe`,dark:`#1e1e1e`},Km=`__shiki_resolved`;function qm(e){if(e?.[Km])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?Wm.light:Wm.dark,n||=t.type===`light`?Gm.light:Gm.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,Km,{enumerable:!1,writable:!1,value:!0}),t}async function Jm(e){return[...new Set((await Promise.all(e.filter(e=>!zm(e)).map(async e=>await Lm(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function Ym(e){return(await Promise.all(e.map(async e=>Vm(e)?null:qm(await Lm(e))))).filter(e=>!!e)}function Xm(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Qf(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Zm=class extends Mm{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=qm(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=fp.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Xm(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new Qf(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Qm=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},$m=0;function eh(e){$m+=1,e.warnings!==!1&&$m>=10&&$m%10==0&&console.warn(`[Shiki] ${$m} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Qf("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(qm),i=new Zm(new Qm(e.engine,n),r,n,e.langAlias),a;function o(t){return Xm(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new Qf(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new Qf(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await Jm(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await Ym(e))}function g(){if(t)throw new Qf(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--$m)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function th(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Ym(e.themes||[]),Jm(e.langs||[]),e.engine]);return eh({...e,themes:t,langs:n,engine:r})}var nh=new WeakMap;function rh(e,t){nh.set(e,t)}function ih(e){return nh.get(e)}var ah=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(Im(n).map(e=>[e,Nm])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return oh(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function oh(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function sh(e,t){if(!(e instanceof ah))throw new Qf(`Invalid grammar state`);return e.getInternalStack(t)}var ch=/,/,lh=/ /;function uh(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(Rm(e.resolveLangAlias(n.lang||`text`))||Bm(r))return Um(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new Qf(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new Qf(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return fh(t,o,i,a,n)}function dh(...e){if(e.length===2)return ih(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(Rm(i)||Bm(a))throw new Qf(`Plain language does not have grammar state`);if(i===`ansi`)throw new Qf(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new ah(ph(n,c,o,s,r).stateStack,c.name,o.name)}function fh(e,t,n,r,i){let a=ph(e,t,n,r,i),o=new ah(a.stateStack,t.name,n.name);return rh(a.tokens,o),a.tokens}function ph(e,t,n,r,i){let a=Pm(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=Um(e),u=i.grammarState?sh(i.grammarState,n.name)??Nm:i.grammarContextCode==null?Nm:ph(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=Fm(r[Tp.getForeground(s)],a),u=Tp.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=Tp.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(ch).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(lh))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?mh(t.scopes):hh(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function mh(e){return e.map(e=>({scopeName:e}))}function hh(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:vh(e,i,t.slice(0,r))}}return n}function gh(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function _h(e,t,n){if(!gh(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)gh(e[r],n[i])&&--r,--i;return r===-1}function vh(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(_h(e,t,n)){r.push(a);break}return r}function yh(e,t,n,r=uh){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:ih(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=bh(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new ah(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&rh(s,c),s}function bh(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var xh=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Sh=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Sh.prototype.normal={},Sh.prototype.property={},Sh.prototype.space=void 0;function Ch(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Sh(n,r,t)}function wh(e){return e.toLowerCase()}var Th=class{constructor(e,t){this.attribute=t,this.property=e}};Th.prototype.attribute=``,Th.prototype.booleanish=!1,Th.prototype.boolean=!1,Th.prototype.commaOrSpaceSeparated=!1,Th.prototype.commaSeparated=!1,Th.prototype.defined=!1,Th.prototype.mustUseProperty=!1,Th.prototype.number=!1,Th.prototype.overloadedBoolean=!1,Th.prototype.property=``,Th.prototype.spaceSeparated=!1,Th.prototype.space=void 0;var Eh=s({boolean:()=>Oh,booleanish:()=>kh,commaOrSpaceSeparated:()=>Nh,commaSeparated:()=>Mh,number:()=>Q,overloadedBoolean:()=>Ah,spaceSeparated:()=>jh}),Dh=0,Oh=Ph(),kh=Ph(),Ah=Ph(),Q=Ph(),jh=Ph(),Mh=Ph(),Nh=Ph();function Ph(){return 2**++Dh}var Fh=Object.keys(Eh),Ih=class extends Th{constructor(e,t,n,r){let i=-1;if(super(e,t),Lh(this,`space`,r),typeof n==`number`)for(;++i<Fh.length;){let e=Fh[i];Lh(this,Fh[i],(n&Eh[e])===Eh[e])}}};Ih.prototype.defined=!0;function Lh(e,t,n){n&&(e[t]=n)}function Rh(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Ih(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[wh(r)]=r,n[wh(a.attribute)]=r}return new Sh(t,n,e.space)}var zh=Rh({properties:{ariaActiveDescendant:null,ariaAtomic:kh,ariaAutoComplete:null,ariaBusy:kh,ariaChecked:kh,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:jh,ariaCurrent:null,ariaDescribedBy:jh,ariaDetails:null,ariaDisabled:kh,ariaDropEffect:jh,ariaErrorMessage:null,ariaExpanded:kh,ariaFlowTo:jh,ariaGrabbed:kh,ariaHasPopup:null,ariaHidden:kh,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:jh,ariaLevel:Q,ariaLive:null,ariaModal:kh,ariaMultiLine:kh,ariaMultiSelectable:kh,ariaOrientation:null,ariaOwns:jh,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:kh,ariaReadOnly:kh,ariaRelevant:null,ariaRequired:kh,ariaRoleDescription:jh,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:kh,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Bh(e,t){return t in e?e[t]:t}function Vh(e,t){return Bh(e,t.toLowerCase())}var Hh=Rh({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Mh,acceptCharset:jh,accessKey:jh,action:null,allow:null,allowFullScreen:Oh,allowPaymentRequest:Oh,allowUserMedia:Oh,alpha:Oh,alt:null,as:null,async:Oh,autoCapitalize:null,autoComplete:jh,autoFocus:Oh,autoPlay:Oh,blocking:jh,capture:null,charSet:null,checked:Oh,cite:null,className:jh,closedBy:null,colorSpace:null,cols:Q,colSpan:Q,command:null,commandFor:null,content:null,contentEditable:kh,controls:Oh,controlsList:jh,coords:Q|Mh,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Oh,defer:Oh,dir:null,dirName:null,disabled:Oh,download:Ah,draggable:kh,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Oh,formTarget:null,headers:jh,height:Q,hidden:Ah,high:Q,href:null,hrefLang:null,htmlFor:jh,httpEquiv:jh,id:null,imageSizes:null,imageSrcSet:null,inert:Oh,inputMode:null,integrity:null,is:null,isMap:Oh,itemId:null,itemProp:jh,itemRef:jh,itemScope:Oh,itemType:jh,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Oh,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Oh,muted:Oh,name:null,nonce:null,noModule:Oh,noValidate:Oh,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Oh,optimum:Q,pattern:null,ping:jh,placeholder:null,playsInline:Oh,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Oh,referrerPolicy:null,rel:jh,required:Oh,reversed:Oh,rows:Q,rowSpan:Q,sandbox:jh,scope:null,scoped:Oh,seamless:Oh,selected:Oh,shadowRootClonable:Oh,shadowRootCustomElementRegistry:Oh,shadowRootDelegatesFocus:Oh,shadowRootMode:null,shadowRootSerializable:Oh,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:kh,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Oh,useMap:null,value:kh,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:jh,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Oh,declare:Oh,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Oh,noHref:Oh,noShade:Oh,noWrap:Oh,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:kh,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Oh,disablePictureInPicture:Oh,disableRemotePlayback:Oh,exportParts:Mh,part:jh,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:Vh}),Uh=Rh({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Nh,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:jh,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Oh,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Mh,g2:Mh,glyphName:Mh,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:Nh,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:jh,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Nh,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Nh,rev:Nh,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Nh,requiredFeatures:Nh,requiredFonts:Nh,requiredFormats:Nh,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:Nh,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Nh,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Nh,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Bh}),Wh=Rh({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Gh=Rh({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Vh}),Kh=Rh({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),qh=/[A-Z]/g,Jh=/-[a-z]/g,Yh=/^data[-\w.:]+$/i;function Xh(e,t){let n=wh(t),r=t,i=Th;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Yh.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Jh,Qh);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Jh.test(e)){let n=e.replace(qh,Zh);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Ih}return new i(r,t)}function Zh(e){return`-`+e.toLowerCase()}function Qh(e){return e.charAt(1).toUpperCase()}var $h=Ch([zh,Hh,Wh,Gh,Kh],`html`),eg=Ch([zh,Uh,Wh,Gh,Kh],`svg`),tg={}.hasOwnProperty;function ng(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&tg.call(t,e)){let n=String(t[e]);i=tg.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var rg=/["&'<>`]/g,ig=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ag=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,og=/[|\\{}()[\]^$+*?.]/g,sg=new WeakMap;function cg(e,t){return e=e.replace(t.subset?lg(t.subset):rg,r),t.subset||t.escapeOnly?e:e.replace(ig,n).replace(ag,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function lg(e){let t=sg.get(e);return t||(t=ug(e),sg.set(e,t)),t}function ug(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(og,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var dg=/[\dA-Fa-f]/;function fg(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!dg.test(String.fromCharCode(t))?r:r+`;`}var pg=/\d/;function mg(e,t,n){let r=`&#`+String(e);return n&&t&&!pg.test(String.fromCharCode(t))?r:r+`;`}var hg=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),gg={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},_g=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],vg={}.hasOwnProperty,yg={},bg;for(bg in gg)vg.call(gg,bg)&&(yg[gg[bg]]=bg);var xg=/[^\dA-Za-z]/;function Sg(e,t,n,r){let i=String.fromCharCode(e);if(vg.call(yg,i)){let e=yg[i],a=`&`+e;return n&&hg.includes(e)&&!_g.includes(e)&&(!r||t&&t!==61&&xg.test(String.fromCharCode(t)))?a:a+`;`}return``}function Cg(e,t,n){let r=fg(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Sg(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=mg(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function wg(e,t){return cg(e,Object.assign({format:Cg},t))}var Tg=/^>|^->|<!--|-->|--!>|<!-$/g,Eg=[`>`],Dg=[`<`,`>`];function Og(e,t,n,r){return r.settings.bogusComments?`<?`+wg(e.value,Object.assign({},r.settings.characterReferences,{subset:Eg}))+`>`:`<!--`+e.value.replace(Tg,i)+`-->`;function i(e){return wg(e,Object.assign({},r.settings.characterReferences,{subset:Dg}))}}function kg(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function Ag(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function jg(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function Mg(e){return e.join(` `).trim()}var Ng=/[ \t\n\f\r]/g;function Pg(e){return typeof e==`object`?e.type===`text`&&Fg(e.value):Fg(e)}function Fg(e){return e.replace(Ng,``)===``}var Ig=zg(1),Lg=zg(-1),Rg=[];function zg(e){return t;function t(t,n,r){let i=t?t.children:Rg,a=(n||0)+e,o=i[a];if(!r)for(;o&&Pg(o);)a+=e,o=i[a];return o}}var Bg={}.hasOwnProperty;function Vg(e){return t;function t(t,n,r){return Bg.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var Hg=Vg({body:Gg,caption:Ug,colgroup:Ug,dd:Yg,dt:Jg,head:Ug,html:Wg,li:qg,optgroup:Zg,option:Qg,p:Kg,rp:Xg,rt:Xg,tbody:e_,td:r_,tfoot:t_,th:r_,thead:$g,tr:n_});function Ug(e,t,n){let r=Ig(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&Pg(r.value.charAt(0)))}function Wg(e,t,n){let r=Ig(n,t);return!r||r.type!==`comment`}function Gg(e,t,n){let r=Ig(n,t);return!r||r.type!==`comment`}function Kg(e,t,n){let r=Ig(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function qg(e,t,n){let r=Ig(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Jg(e,t,n){let r=Ig(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function Yg(e,t,n){let r=Ig(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function Xg(e,t,n){let r=Ig(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Zg(e,t,n){let r=Ig(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Qg(e,t,n){let r=Ig(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function $g(e,t,n){let r=Ig(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function e_(e,t,n){let r=Ig(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function t_(e,t,n){return!Ig(n,t)}function n_(e,t,n){let r=Ig(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function r_(e,t,n){let r=Ig(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var i_=Vg({body:s_,colgroup:c_,head:o_,html:a_,tbody:l_});function a_(e){let t=Ig(e,-1);return!t||t.type!==`comment`}function o_(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function s_(e){let t=Ig(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&Pg(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function c_(e,t,n){let r=Lg(n,t),i=Ig(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&Hg(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function l_(e,t,n){let r=Lg(n,t),i=Ig(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&Hg(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var u_={name:[[`
13
13
  \f\r &/=>`.split(``),`
@@ -2797,4 +2797,4 @@ diff --git`)}function rO(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
2797
2797
  }`}function mP(e){return`${fP}
2798
2798
  @layer unsafe {
2799
2799
  ${e}
2800
- }`}var hP=new WeakMap;function gP(e){let t=hP.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(FM,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),hP.set(e,i),i}function _P(e,t){if(!e.isConnected)return;let n=gP(t);if(n==null)return;let r=t.querySelector(`style[${IM}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(IM,``),t.appendChild(i)),i.textContent=`:host { ${LM}: ${n}px; }`}var vP;function yP(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){vP??(vP=new CSSStyleSheet,vP.replaceSync(pP(dP)));let t=!1;try{e.adoptedStyleSheets=[vP],t=!0}catch{}if(t){e.querySelector(`style[${NM}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(NM,``),t.textContent=pP(dP),e.prepend(t)}}function bP(e,t){xP(e,t),yP(t),_P(e,t)}function xP(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});bP(this,e)}}if(customElements.define(MM,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(MM)))e instanceof HTMLElement&&bP(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var SP=5,CP=32,wP=128;function TP(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function EP(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function DP(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function OP(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function kP(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function AP(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function jP(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,FP(e,t)}function MP(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=OP(e).get(t);if(i===void 0)return;let a=i>>SP;e.childVisibleChunkSums[a]+=r}function NP(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=IP(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=CP}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function PP(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>SP;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<SP}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function FP(e,t){if(t.childIds.length<wP){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/CP),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>SP]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function IP(e,t,n,r){let i=Math.min(t.childIds.length,n+CP),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var LP=7,RP=3,zP=8,BP=4;function VP(e,t,n=0){return e<<BP|n<<RP|t}function HP(e){return e.depthAndFlags>>>BP}function UP(e){return(e.depthAndFlags&zP)>>RP}function WP(e){return(e.depthAndFlags&zP)!==0}function GP(e){return e.depthAndFlags&LP}function KP(e,t){return(GP(e)&t)!==0}function qP(e,t){e.depthAndFlags|=t}function JP(e,t){e.depthAndFlags=VP(t,GP(e),UP(e))}var YP=Symbol(`benchmarkInstrumentation`);function XP(e,t){return t==null||Object.defineProperty(e,YP,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function ZP(e){return e==null?null:e[YP]??null}function QP(e,t,n){return e==null?n():e.measurePhase(t,n)}function $P(e,t,n){Number.isFinite(n)&&e!=null&&e.setCounter(t,n)}function eF(e){return e>=48&&e<=57}function tF(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!eF(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&eF(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function nF(e){let t=e.toLowerCase();return{lowerValue:t,tokens:tF(t)}}function rF(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function iF(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=rF(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function aF(e,t,n){let r=iF(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function oF(e,t){return aF(e,t,nF)}function sF(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function cF(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=sF(e,r);return a===sF(t,r)?oF(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function lF(e,t){return cF(e,t)}function uF(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=nF(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=sF(e,n);return o===sF(t,n)?aF(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function dF(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=nF(r);return e.sortKeyById[t]=i,i}function fF(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function pF(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function mF(e){let{hasTrailingSlash:t,segments:n}=pF(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function hF(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=pF(e);return{requiresDirectory:t,segments:n}}function gF(){let e=new Map;return e.set(``,0),{idByValue:e,valueById:[``],sortKeyById:[nF(``)]}}function _F(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function vF(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var yF=Symbol(`pathStorePreparedInputKind`);function bF(e,t){return e[yF]=t,e}function xF(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function SF(e,t,n){return n==="default"?lF(e,t):n(xF(e),xF(t))}function CF(){return{depthAndFlags:VP(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function wF(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function TF(e){return e.isDirectory?e.segments.length:e.segments.length-1}function EF(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function DF(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function OF(e,t={}){return PF(e,t).map(e=>e.path)}function kF(e,t={}){let n=PF(e,t);return bF({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function AF(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return bF({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function jF(e){let t=e,n=t.preparedPaths;if(t[yF]===`prepared`&&n!=null)return n;if(!EF(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function MF(e){let t=e;return t[yF]===`presorted`&&t.presortedPaths!=null||DF(t.presortedPaths)?t.presortedPaths:null}function NF(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function PF(e,t={}){let n=fF(t),r=ZP(t);$P(r,`workload.inputFiles`,e.length);let i=QP(r,`store.preparePathEntries.parse`,()=>e.map(e=>mF(e)));return QP(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>SF(e,t,n.sort))),i}var FF=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[CF()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=gF();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=ZP(e),this.options=fF(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,TP())}appendPaths(e){return QP(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>mF(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,QP(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return QP(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null){if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:VP(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:VP(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d,m=a+1}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:VP(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=mF(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null){if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:VP(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:VP(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=mF(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(QP(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||QP(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?uF(this.lastPreparedPath,e,this.segmentSortKeyCache):SF(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=TF(e),i=n==null?0:TF(n),a=n==null?0:wF(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=_F(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:VP(HP(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),kP(i,s),s}createFileChildUnchecked(e,t){let n=_F(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:VP(HP(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),kP(r,a),a}getOrCreateDirectoryChild(e,t){let n=_F(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!WP(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:VP(HP(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),kP(r,a),this.directories.set(a,TP()),a}createDirectoryChild(e,t){let n=_F(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:VP(HP(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),kP(r,a),this.directories.set(a,TP()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!WP(n))throw Error(`Path is not a directory: "${t}"`);if(KP(n,1))throw Error(`Duplicate path: "${t}"`);qP(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,EP());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(WP(a)){let t=EP();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;WP(n)&&this.directories.set(t,TP());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),kP(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!WP(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return jP(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function IF(e,t=`closed`,n=null){let r=RF(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function LF(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function RF(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function zF(e,t){return KP(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion!==`closed`&&HP(t)<=e.defaultExpansion}function BF(e,t,n=e.snapshot.nodes[t]){return n==null||!WP(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:zF(e,n)}function VF(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!WP(r))return;let i=zF(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function HF(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function UF(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function WF(e,t){let n=HF(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function GF(e,t){let n=HF(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function KF(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function qF(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function JF(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function YF(e,t){e.directoryLoadInfoById.delete(t)}function XF(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function ZF(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function QF(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function $F(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function eI(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function tI(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function nI(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function rI(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function iI(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function aI(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function oI(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function sI(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function cI(e,t,n){return{...n,visibleCountDelta:yI(e)-t}}function lI(e,t){let n=yI(e),r=LF();e.transactionStack.push(r);try{t()}catch(t){throw fI(e,r,!1),t}fI(e,r,!0,yI(e)-n)}function uI(e,t){let n=e.instrumentation;if(n==null){dI(e,t);return}QP(n,`store.events.record`,()=>dI(e,t))}function dI(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){_I(e,t);return}n.events.push(t),gI(n,t)}function fI(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?hI(i,t):QP(n,`store.events.batch.merge`,()=>hI(i,t));return}let a=pI(t,r),o=e.instrumentation;if(o==null){_I(e,a);return}QP(o,`store.events.batch.commit`,()=>_I(e,a))}function pI(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function mI(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function hI(e,t){for(let n of t.events)e.events.push(n);mI(e,t)}function gI(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function _I(e,t){let n=e.instrumentation;if(n==null){vI(e,t);return}QP(n,`store.events.emit`,()=>vI(e,t))}function vI(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function yI(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function bI(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!WP(n)||KP(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!WP(a)?null:i}function xI(e,t){let n=t;for(;;){let t=bI(e,n);if(t==null)return n;n=t}}function SI(e,t){let n=[t],r=t;for(;;){let t=bI(e,r);if(t==null)return n;n.push(t),r=t}}function CI(e,t){let n=t==null?e.snapshot.rootId:NI(e,t);return n==null?[]:LI(e,n)}function wI(e,t){let n=mF(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=QI(e,ZI(e,r)),{createdNodeIds:a,directoryId:o}=RI(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=II(e,o);if(KP(n,1))throw Error(`Path already exists: "${t}"`);qP(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=BI(e,o,n.basename),s.add(c);AI(e,o);let l=QI(e,o);return ZF({affectedAncestorIds:MI(e,c),affectedNodeIds:[...s],path:t,projectionChanged:$I(i,l)})}function TI(e,t,n){let r=NI(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=II(e,r);if(KP(i,2))throw Error(`The root node cannot be removed`);if(WP(i)&&FI(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=QI(e,a),s=YI(e,r);UI(e,a,r,i.nameId),XI(e,a),AI(e,a);let c=QI(e,a);return QF({affectedAncestorIds:MI(e,a),affectedNodeIds:s,path:t,projectionChanged:$I(o,c),recursive:n.recursive===!0})}function EI(e,t,n,r){let i=NI(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=II(e,i);if(KP(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=qI(e,i,n),c=QI(e,a.parentId),l=QI(e,s.parentId),u=vF(e.snapshot.segmentTable,a.nameId),d=_F(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(WP(a)&&rL(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=DP(e.snapshot.nodes,FI(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&JI(e,p,o,UP(a))===`skip`)return null;let m=a.parentId;UI(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),nL(e,i),HI(e,s.parentId,i),XI(e,m),e.pathCacheVersion++,AI(e,m),s.parentId!==m&&AI(e,s.parentId);let h=QI(e,m),g=QI(e,s.parentId);return $F({affectedAncestorIds:[...new Set([...MI(e,m),...MI(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:eL([c,l],[h,g]),to:kI(e,i)})}function DI(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function OI(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function kI(e,t){let n=II(e,t),r=DI(e,t);if(r!=null)return r;if(KP(n,2))return OI(e,t,``);let i=kI(e,n.parentId),a=vF(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return OI(e,t,WP(n)?`${o}/`:o)}function AI(e,t){let n=e.instrumentation;if(n==null){aL(e,t);return}QP(n,`store.recomputeCountsUpwardFrom`,()=>aL(e,t))}function jI(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!WP(o)){iL(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){iL(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function MI(e,t){let n=[],r=t;for(;r!=null;){let t=II(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function NI(e,t){if(t.length===0)return e.snapshot.rootId;let n=hF(t);return PI(e,n.segments,n.requiresDirectory)}function PI(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=FI(e,r),a=DP(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=II(e,r);return n&&!WP(i)?null:r}function FI(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function II(e,t){let n=e.snapshot.nodes[t];if(n===void 0||KP(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function LI(e,t){let n=e.snapshot.nodes[t];if(n===void 0||KP(n,4))return[];if(!WP(n))return[kI(e,t)];if(FI(e,t).childIds.length===0)return KP(n,1)&&!KP(n,2)?[kI(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||KP(n,4)){i.pop();continue}if(!WP(n)){r.push(kI(e,t.nodeId)),i.pop();continue}let a=FI(e,t.nodeId);if(a.childIds.length===0){KP(n,1)&&!KP(n,2)&&r.push(kI(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function RI(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=_F(e.snapshot.segmentTable,i),a=FI(e,r),o=DP(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!WP(II(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=zI(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function zI(e,t,n){let r=II(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:VP(HP(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,TP()),HI(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function BI(e,t,n){let r=_F(e.snapshot.segmentTable,n),i=FI(e,t);if(DP(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${sL(e,t,n)}"`);let a=II(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:VP(HP(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),HI(e,t,o),e.activeNodeCount++,o}function VI(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}WI(e,n,o)<0?i=a:r=a+1}return r}function HI(e,t,n){let r=FI(e,t),i=II(e,n);DP(e.snapshot.nodes,r).set(i.nameId,n),MP(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=VI(e,r,n);r.childIds.splice(a,0,n),AP(r,a),FP(e.snapshot.nodes,r)}function UI(e,t,n,r){let i=FI(e,t),a=OP(i),o=a.get(n)??-1;DP(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&MP(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),AP(i,o),FP(e.snapshot.nodes,i))}function WI(e,t,n){let r=e.snapshot.options.sort;return r==="default"?GI(e,t,n):r(KI(e,t),KI(e,n))}function GI(e,t,n){let r=II(e,t),i=II(e,n),a=WP(r);if(a!==WP(i))return a?-1:1;let o=iF(dF(e.snapshot.segmentTable,r.nameId),dF(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=vF(e.snapshot.segmentTable,r.nameId),c=vF(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function KI(e,t){let n=II(e,t),r=kI(e,t),i=WP(n),a=i?r.slice(0,-1):r;return{basename:vF(e.snapshot.segmentTable,n.nameId),depth:HP(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function qI(e,t,n){let r=II(e,t),i=NI(e,n);if(i!=null){let t=II(e,i);if(WP(t))return{basename:vF(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=hF(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=hF(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:PI(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function JI(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${kI(e,t)}"`);let i=II(e,t);if(UP(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(WP(i)&&FI(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return YI(e,t),UI(e,a,t,o),XI(e,a),AI(e,a),`handled`}function YI(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=II(e,t.nodeId);if(t.visitedChildren||!WP(i)){WP(i)&&e.snapshot.directories.delete(t.nodeId),qP(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),YF(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=FI(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function XI(e,t){let n=t;for(;n!=null;){let t=II(e,n);if(!WP(t)||KP(t,2)||FI(e,n).childIds.length>0)return;qP(t,1),n=t.parentId===n?null:t.parentId}}function ZI(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=DP(e.snapshot.nodes,FI(e,n)).get(t);if(i==null||!WP(II(e,i)))break;n=i}return n}function QI(e,t){let n=tL(e,t);if(n==null)return null;let r=xI(e,n),i=II(e,r),a=n===r?null:SI(e,n).map(t=>kI(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:FI(e,r).childIds.length>0,path:kI(e,r),terminalKind:UP(i)})}function $I(e,t){return eL([e],[t])}function eL(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function tL(e,t){let n=t;for(;n!=null;){let t=II(e,n);if(!WP(t)||KP(t,2))return null;if(!BF(e,n,t))return n;n=t.parentId}return null}function nL(e,t){let n=II(e,t);if(JP(n,(t===e.snapshot.rootId?-1:HP(II(e,n.parentId)))+1),!WP(n))return;let r=FI(e,t);for(let t of r.childIds)nL(e,t)}function rL(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=II(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function iL(e,t,n=II(e,t),r=!1){let i=e.instrumentation;if(i==null){oL(e,t,n,r);return}QP(i,`store.recomputeNodeCounts`,()=>oL(e,t,n,r))}function aL(e,t){let n=t;for(;n!=null;){let t=II(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(iL(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&MP(FI(e,s),n,a,o),n=s}}function oL(e,t,n,r){if(!WP(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=FI(e,t);if(r){let t=e.instrumentation;t==null?jP(e.snapshot.nodes,i):QP(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>jP(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,KP(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=bI(e,t)==null?BF(e,t,n)?1+o:1:o}function sL(e,t,n){let r=kI(e,t);return r.length===0?n:`${r}${n}`}function cL(e){return e!=null&&!KP(e,4)}function lL(e,t){let n=e.snapshot.nodes[t];return!cL(n)||!WP(n)||KP(n,2)?null:n}function uL(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&cL(e.snapshot.nodes[n])&&(t+=1);return t}function dL(e){return Math.max(0,e.valueById.length-1)}function fL(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:uL(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:dL(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function pL(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function mL(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)lL(e,n)!=null&&t.push(kI(e,n));for(let t of e.expandedDirectoryIds)lL(e,t)!=null&&n.push(kI(e,t));return{collapsedPaths:t,expandedPaths:n}}function hL(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)lL(e,n)!=null&&UF(e,n)!==`loaded`&&t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:kI(e,n)});return t}function gL(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=NI(e,n);t!=null&&VF(e,t,!0,II(e,t))}for(let n of t.collapsedPaths){let t=NI(e,n);t!=null&&VF(e,t,!1,II(e,t))}}function _L(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=NI(e,n.path);t!=null&&lL(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function vL(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function yL(e){let t=e.snapshot.segmentTable,n=gF();for(let r of e.snapshot.nodes)if(cL(r)){if(KP(r,2)){r.nameId=0;continue}r.nameId=_F(n,vF(t,r.nameId))}e.snapshot.segmentTable=n}function bL(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!cL(r)||!WP(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return cL(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[II(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),jP(e.snapshot.nodes,n)}}function xL(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(cL(n))break;--t}e.snapshot.nodes.length=t+1}function SL(e){let t=mL(e),n=hL(e);QP(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>vL(e)),QP(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>yL(e)),QP(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>bL(e)),QP(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>xL(e)),QP(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>gL(e,t)),QP(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>_L(e,n)),QP(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>jI(e,e.snapshot.rootId))}function CL(e){let t=mL(e),n=hL(e),r=QP(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>CI(e)),i=XP({...e.snapshot.options},e.instrumentation),a=QP(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new FF(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,QP(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>gL(e,t)),QP(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>_L(e,n)),QP(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>jI(e,e.snapshot.rootId))}function wL(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function TL(e,t){let n=fL(e);t===`stable`?QP(e.instrumentation,`store.cleanup.stable`,()=>SL(e)):QP(e.instrumentation,`store.cleanup.aggressive`,()=>CL(e));let r=fL(e);return pL(t,t===`stable`,n,r)}var EL=64;function DL(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function OL(e){return II(e,e.snapshot.rootId).visibleSubtreeCount}function kL(e,t,n,r){let i=II(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function AL(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:YL(e,t.cursor),setSize:t.setSize,subtreeEndIndex:kL(e,t.cursor,t.index,n)}}function jL(e,t,n,r,i,a){let o=FI(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=NP(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return ML(e,u,l,r+c,i+1,s,o.childIds.length,a)}function ML(e,t,n,r,i,a,o,s){if(!WP(II(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=UL(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=II(e,c.terminalNodeId);if(!WP(l)||!BF(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return jL(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function NL(e,t){let n=OL(e);if(t<0||t>=n)return null;let r=jL(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>kI(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=AL(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:YL(e,r.cursor),setSize:r.setSize,subtreeEndIndex:kL(e,r.cursor,r.index,n)}}function PL(e,t,n){let r=e.instrumentation,i=OL(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return JL(e,o+1);let t=[],n=BL(e,a);for(let r=a;r<=o&&n!=null;r++){let r=YL(e,n);t.push(r),n=GL(e,n)}return t}let s=[],c=0,l=0,u=QP(r,`store.getVisibleSlice.selectFirstRow`,()=>BL(e,a));for(let t=a;t<=o&&u!=null;t++){let t=QP(r,`store.getVisibleSlice.materializeRow`,()=>YL(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=QP(r,`store.getVisibleSlice.advanceCursor`,()=>GL(e,u))}return $P(r,`workload.visibleRowsRead`,s.length),$P(r,`workload.flattenedRowsRead`,c),$P(r,`workload.flattenedSegmentsRead`,l),s}function FL(e,t=OL(e)){let n=e.instrumentation;return n==null?qL(e,t):QP(n,`store.getVisibleTreeProjection`,()=>qL(e,t))}function IL(e){return KL(FL(e))}function LL(e,t){let n=NI(e,t);if(n==null||n===e.snapshot.rootId||WP(II(e,n))&&xI(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=II(e,i).parentId,n=FI(e,t),s=OP(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=PP(a,n,s),t!==o){let n=II(e,t),a=bI(e,t);if(!BF(e,t,n)&&a!==i)return null;xI(e,t)===t&&(r+=1)}i=t}return r}function RL(e,t){let n=NI(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=II(e,n);if(!WP(r))throw Error(`Path is not a directory: "${t}"`);return BF(e,n,r)?null:(VF(e,n,!0,r),AI(e,n),eI({affectedAncestorIds:MI(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function zL(e,t){let n=NI(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=II(e,n);if(!WP(r))throw Error(`Path is not a directory: "${t}"`);return BF(e,n,r)?(VF(e,n,!1,r),AI(e,n),tI({affectedAncestorIds:MI(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function BL(e,t){return t<0||t>=OL(e)?null:VL(e,e.snapshot.rootId,t,-1)}function VL(e,t,n,r){let i=FI(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?NP(e.snapshot.nodes,i,n):QP(a,`store.getVisibleSlice.selectChildIndex`,()=>NP(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return HL(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function HL(e,t,n,r){if(!WP(II(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=UL(e,t,r);if(n===0)return i;let a=II(e,i.terminalNodeId);if(!WP(a)||!BF(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return VL(e,i.terminalNodeId,n-1,i.visibleDepth)}function UL(e,t,n){return WP(II(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:xI(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:QP(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>xI(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function WL(e,t){let n=II(e,t);if(!WP(n))return!0;let r=n.parentId;return r===e.snapshot.rootId||bI(e,r)!==t}function GL(e,t){let n=II(e,t.terminalNodeId);if(WP(n)){let r=FI(e,t.terminalNodeId);if(BF(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:HL(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=II(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=FI(e,n),o=OP(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return HL(e,s,0,i);WL(e,r)&&i--,r=n}}function KL(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function qL(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(EL);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=DL(o,y);let x,S=_;if(WP(v))S=f?xI(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:kI(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&WP(C)&&BF(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function JL(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!WP(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:kI(e,f)};continue}let h=l?xI(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=YL(e,g);let _=i[h];_!=null&&WP(_)&&BF(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function YL(e,t){let n=II(e,t.terminalNodeId),r=WP(n)?XL(e,t):null,i=kI(e,t.terminalNodeId),a=vF(e.snapshot.segmentTable,n.nameId),o=WP(n)&&FI(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?SI(e,t.headNodeId).map(n=>{let r=II(e,n);return{isTerminal:n===t.terminalNodeId,name:vF(e.snapshot.segmentTable,r.nameId),nodeId:n,path:kI(e,n)}}):QP(c,`store.getVisibleSlice.flatten.collectSegments`,()=>SI(e,t.headNodeId).map(n=>{let r=II(e,n);return{isTerminal:n===t.terminalNodeId,name:vF(e.snapshot.segmentTable,r.nameId),nodeId:n,path:kI(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:WP(n)&&BF(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:WP(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function XL(e,t){if(t.headNodeId===t.terminalNodeId)return UF(e,t.terminalNodeId);let n=SI(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=UF(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}var ZL=8;function QL(e){let{nodes:t,directories:n,rootId:r,options:i}=e,a=t.length,o=new Int32Array(a),s=new Int32Array(a),c=new Int32Array(a),l=new Int32Array(a),u=new Int32Array(a),d=new Int32Array(a),f=new Int32Array(a);for(let e=0;e<a;e+=1){let n=t[e];n!=null&&(o[e]=n.parentId,s[e]=n.nameId,c[e]=n.depthAndFlags,l[e]=n.subtreeNodeCount,u[e]=n.visibleSubtreeCount)}let p=0;for(let e of n.values())p+=e.childIds.length;let m=new Int32Array(p),h=0;for(let[e,t]of n){let n=t.childIds;d[e]=h,f[e]=n.length;for(let e=0;e<n.length;e+=1)m[h]=n[e],h+=1}return{nodeCount:a,rootId:r,flattenEmptyDirectories:i.flattenEmptyDirectories===!0,parentId:o,nameId:s,depthAndFlags:c,subtreeNodeCount:l,visibleSubtreeCount:u,childStart:d,childCount:f,childIdsFlat:m}}function $L(e){let{nodeCount:t,rootId:n,flattenEmptyDirectories:r,depthAndFlags:i,subtreeNodeCount:a,visibleSubtreeCount:o,childStart:s,childCount:c,childIdsFlat:l}=e;for(let e=t-1;e>=1;--e){if((i[e]&ZL)===0)continue;let t=s[e],n=c[e],u=0,d=0;for(let e=0;e<n;e+=1){let n=l[t+e];u+=a[n],d+=o[n]}a[e]=1+u;let f;f=r&&n===1?(i[l[t]]&ZL)===0?1+d:d:1+d,o[e]=f}let u=s[n],d=c[n],f=0,p=0;for(let e=0;e<d;e+=1){let t=l[u+e];f+=a[t],p+=o[t]}a[n]=1+f,o[n]=p}function eR(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!WP(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&FP(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&WP(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,FP(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function tR(e){let{directories:t,nodes:n,rootId:r}=e.snapshot,i=QL(e.snapshot);$L(i);let a=i.subtreeNodeCount,o=i.visibleSubtreeCount;for(let e=0;e<n.length;e+=1){let t=n[e];t!=null&&(t.subtreeNodeCount=a[e],t.visibleSubtreeCount=o[e])}for(let[e,i]of t){let t=i.childIds,a=t.length,o=0,s=0;for(let e=0;e<a;e++){let r=t[e];if(r==null)continue;let i=n[r];o+=i.subtreeNodeCount,s+=i.visibleSubtreeCount}i.totalChildSubtreeNodeCount=o,i.totalChildVisibleSubtreeCount=s,(e===r||a>=128)&&FP(n,i)}}function nR(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var rR=class e{#e;constructor(e={}){let t=ZP(e),n=QP(t,`store.builder.create`,()=>new FF(e));if(e.preparedInput!=null){let t=MF(e.preparedInput);t==null?n.appendPreparedPaths(jF(e.preparedInput),!1):n.appendPresortedPaths(t,NF(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(QP(t,`store.preparePathEntries`,()=>PF(r,e)))}let r=QP(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=QP(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=QP(t,`store.state.create`,()=>IF(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:QP(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||nR(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&QP(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?e.useSoaCountSweep===!0?QP(t,`store.state.initializeOpenVisibleCountsViaSoa`,()=>tR(this.#e)):QP(t,`store.state.initializeOpenVisibleCounts`,()=>eR(this.#e)):QP(t,`store.state.recomputeCounts`,()=>jI(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return OF(e,t)}static prepareInput(e,t={}){return kF(e,t)}static preparePresortedInput(e){return AF(e)}list(e){return QP(this.#e.instrumentation,`store.list`,()=>CI(this.#e,e))}add(e){QP(this.#e.instrumentation,`store.add`,()=>{let t=OL(this.#e);uI(this.#e,cI(this.#e,t,wI(this.#e,e)))})}remove(e,t={}){QP(this.#e.instrumentation,`store.remove`,()=>{let n=OL(this.#e);uI(this.#e,cI(this.#e,n,TI(this.#e,e,t)))})}move(e,t,n={}){QP(this.#e.instrumentation,`store.move`,()=>{let r=OL(this.#e),i=EI(this.#e,e,t,n);i!=null&&uI(this.#e,cI(this.#e,r,i))})}batch(e){lI(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision})}})}getVisibleCount(){return QP(this.#e.instrumentation,`store.getVisibleCount`,()=>OL(this.#e))}getVisibleSlice(e,t){return QP(this.#e.instrumentation,`store.getVisibleSlice`,()=>PL(this.#e,e,t))}getVisibleRowContext(e){return QP(this.#e.instrumentation,`store.getVisibleRowContext`,()=>NL(this.#e,e))}getVisibleTreeProjection(){return IL(this.#e)}getVisibleTreeProjectionData(e){return FL(this.#e,e)}getVisibleIndex(e){return QP(this.#e.instrumentation,`store.getVisibleIndex`,()=>LL(this.#e,e))}getPathInfo(e){return QP(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=NI(this.#e,e);if(t==null)return null;let n=II(this.#e,t);return{depth:HP(n),kind:WP(n)?`directory`:`file`,path:kI(this.#e,t)}})}isExpanded(e){return QP(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=II(this.#e,t);return BF(this.#e,t,n)})}expand(e){QP(this.#e.instrumentation,`store.expand`,()=>{let t=OL(this.#e),n=RL(this.#e,e);n!=null&&uI(this.#e,cI(this.#e,t,n))})}collapse(e){QP(this.#e.instrumentation,`store.collapse`,()=>{let t=OL(this.#e),n=zL(this.#e,e);n!=null&&uI(this.#e,cI(this.#e,t,n))})}on(e,t){return XF(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return UF(this.#e,t)}markDirectoryUnloaded(e){QP(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(FI(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=OL(this.#e);GF(this.#e,t),uI(this.#e,cI(this.#e,n,nI({affectedAncestorIds:MI(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return QP(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=OL(this.#e),r=WF(this.#e,t);return uI(this.#e,cI(this.#e,n,rI({affectedAncestorIds:MI(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return QP(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||UF(this.#e,n)!==`loading`||!qF(this.#e,n,e.attemptId))return!1;let r=kI(this.#e,n);this.validateChildPatch(r,t);let i=OL(this.#e),a=[];for(let e of t.operations){iR(r,e);let t=OL(this.#e);switch(e.type){case`add`:a.push(cI(this.#e,t,wI(this.#e,e.path)));break;case`remove`:a.push(cI(this.#e,t,TI(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=EI(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(cI(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return uI(this.#e,cI(this.#e,i,iI({affectedAncestorIds:MI(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:kI(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return QP(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=OL(this.#e),r=KF(this.#e,t,e.attemptId);return uI(this.#e,cI(this.#e,n,aI({affectedAncestorIds:MI(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:kI(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return QP(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=OL(this.#e),i=JF(this.#e,n,e.attemptId,t);return uI(this.#e,cI(this.#e,r,oI({affectedAncestorIds:MI(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:kI(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return QP(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(wL(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=OL(this.#e),n=TL(this.#e,e.mode??`stable`);return uI(this.#e,cI(this.#e,t,sI({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=FI(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??nF(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=iF(dF(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!WP(II(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=II(this.#e,n);BF(this.#e,n,i)||(VF(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=II(this.#e,e);if(!BF(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=NI(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!WP(II(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!WP(II(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=II(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=II(this.#e,e),r=bI(this.#e,e);if(!BF(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function iR(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`)}}var aR=e=>e.startsWith(`f::`)?e.slice(3):e;function oR(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function sR(e,t){return e===``?t:`${e}/${t}`}function cR({files:e,path:t,isFolder:n,nextBasename:r}){let i=aR(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=oR(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=sR(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function lR(e){return e.endsWith(`/`)}function uR(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function dR(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function fR(e,t){return t.includes(e)?dR(t):[e]}function pR(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function mR(e,t){return{draggedPaths:e,target:t}}function hR(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(lR(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function gR(e,t){return t.kind===`root`||t.directoryPath==null?uR(e):t.directoryPath}function _R(e,t){let n=e.map(e=>{let n=gR(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function vR(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function yR(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!vR(rR.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function bR(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function xR(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function SR(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function CR(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return SR(e,t.path)?n?e:null:e;case`move`:return xR(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=CR(r,e,n),r==null)return null;return r}}}function wR(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function TR(e){switch(e.operation){case`add`:return{...wR(e),operation:`add`,path:e.path};case`remove`:return{...wR(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...wR(e),from:e.from,operation:`move`,to:e.to}}}function ER(e){return{...wR(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>TR(e)),operation:`batch`}}function DR(e){switch(e.operation){case`add`:case`remove`:case`move`:return TR(e);case`batch`:return ER(e);default:return null}}function OR(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function kR(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function AR(e){return kR(e).at(-1)??null}function jR(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function MR(e){return e.endsWith(`/`)}var NR=e=>e.toLowerCase();function PR(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function FR(e){return e.endsWith(`/`)?e.slice(0,-1):e}function IR(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var LR=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},RR=Symbol(`FILE_TREE_RENAME_VIEW`),zR=512,BR=512;function VR(e){return e===`top`||e===`center`?e:`nearest`}function HR(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=kR(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function UR(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:HR(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var WR=class e{static{Object.defineProperty(e.prototype,RR,{configurable:!0,value(){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}},writable:!0})}#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=yR({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=AR(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:VR(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=BR){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t!=null&&this.#B.has(t)&&this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=fR(t,n);return this.#r.canDrag?.(r)!==!1&&(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=mR(t.draggedPaths,n);(hR(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}pR(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=mR(e.draggedPaths,t);if(hR(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=_R(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=MR(r),a=FR(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of kR(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=PR(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,MR(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,MR(e)?{recursive:!0}:void 0);return}let t=MR(e),n=cR({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:FR(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(IR(n.sourcePath,t),IR(n.destinationPath,t))}#Y(e){this.#T!=null&&this.#E!==e&&(this.#E=e,this.#De())}resetPaths(e,t={}){let n=!Array.isArray(e),r=n?void 0:e,i=n?e:t,a=this.#H.list().length,o=this.#G,s=yR({paths:r,preparedInput:i.preparedInput},`resetPaths`,this.#e.sort),c=this.#le(s.paths,s.preparedInput,i.initialExpandedPaths),l=this.#c,u=this.#T,d=this.getSelectedPaths(),f=this.#z;this.#K?.(),this.#H=c,this.#d.clear(),this.#he();let p=d.map(e=>c.getPathInfo(e)?.path??null).filter(e=>e!=null),m=!OR(this.#B,p);this.#B=new Set(p),m&&(this.#V+=1),this.#z=f==null?null:c.getPathInfo(f)?.path??null,this.#T=u==null?null:c.getPathInfo(u)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(l,l!=null||p.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:s.paths.length,pathCountBefore:a,projectionChanged:!0,usedPreparedInput:i.preparedInput!=null,visibleCountDelta:this.#G-o})}#X(e){this.#Ie();let t=AR(e),n=jR(e,t),r=null,i=null;for(let e of this.#be()){if(AR(e)!==t)continue;let a=jR(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=kR(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!OR(this.#B,r),a=this.#z!==t;(i||a)&&(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new rR({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of kR(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(NR),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(NR),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of kR(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:LR(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of kR(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of kR(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=UR(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,zR)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s!==e||this.#c!==n)&&(this.#s=e,this.#c=n,t&&this.#De())}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=CR(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=CR(this.#c,e,!0),r=[...this.#B].map(t=>CR(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=CR(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return OR(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&bR(e)&&(this.#i=null);let t=bR(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=DR(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},GR=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function KR(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(e[t]!==`/`&&t!==e.length){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function qR(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=[],r=0;for(;;){let e=t.indexOf(`/`,r);if(e===-1)break;n.push(t.slice(0,e+1)),r=e+1}return n}function JR(e,t){return t?`${e}/`:e}function YR(e,t=null){let n=GR(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set,o=new Map;for(let t of e??[]){let e=ZR(t);e!=null&&ez({canonicalPath:e.canonicalPath,changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,isDirectory:e.isDirectory,status:t.status,statusByPath:r})}return r.size===0?null:{changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}function XR(e,t){let n=t?.remove??[],r=t?.set??[];if(n.length===0&&r.length===0)return e;let i=new Map(e?.statusByPath),a=new Set(e?.directoriesWithChanges),o=new Set(e?.ignoredDirectoryPaths),s=new Map(e?.changeCountByDirectoryPath),c=!1;for(let e of n){let t=QR(e);t!=null&&(c=$R({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=ZR(e);t!=null&&(c=ez({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,isDirectory:t.isDirectory,status:e.status,statusByPath:i})||c)}return c?i.size===0?null:{changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,signature:rz(i),statusByPath:i}:e}function ZR(e){return QR(e.path)}function QR(e){let t=KR(e);if(t!=null)return{canonicalPath:JR(t.path,t.isDirectory),isDirectory:t.isDirectory}}function $R({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a!=null&&(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),nz(t,n,e),!0)}function ez({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??tz(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function tz(e,t,n){for(let r of qR(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function nz(e,t,n){for(let r of qR(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function rz(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var iz=e=>e.trim().toLowerCase(),az=e=>e.split(`/`).at(-1)??e,oz=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function sz(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function cz(e){let t=sP(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(iz(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let s=az(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return sz(l,e);for(let[t,n]of a)if(c.includes(t))return sz(n,e);let u=oz(s);for(let t of u){let n=i.get(t);if(n!=null)return sz(n,e)}let d=aP(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return sz(t,e)}return{name:rP(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:sz(s,e)}}}var lz,uz,dz,fz,pz,mz,hz,gz,_z,vz,yz={},bz=[],xz=Array.isArray,Sz=bz.slice,Cz=Object.assign;function wz(e){e&&e.parentNode&&e.remove()}function Tz(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?Sz.call(arguments,2):n),Ez(e,o,r,i,null)}function Ez(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++uz,__i:-1,__u:0};return i==null&&lz.vnode!=null&&lz.vnode(a),a}function Dz(e){return e.children}function Oz(e,t){this.props=e,this.context=t,this.__g=0}function kz(e,t){if(t==null)return e.__?kz(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?kz(e):null}function Az(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return Az(e)}}function jz(e){(8&e.__g||!(e.__g|=8)||!dz.push(e)||pz++)&&fz==lz.debounceRendering||((fz=lz.debounceRendering)||queueMicrotask)(Mz)}function Mz(){for(var e,t,n,r,i,a,o,s,c=1;dz.length;)dz.length>c&&dz.sort(mz),e=dz.shift(),c=dz.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=Cz({},r)).__v=r.__v+1,lz.vnode&&lz.vnode(n),Bz(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??kz(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,Hz(a,n,o),n.__e!=i&&Az(n)));pz=0}function Nz(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||bz,b=t.length;for(c=Pz(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?yz:y[m.__i]||yz,m.__i=f,_=Bz(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&Gz(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=Fz(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function Pz(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?Ez(null,o,null,null,null):xz(o)?Ez(Dz,{children:o},null,null,null):o.constructor==null&&o.__b>0?Ez(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=Iz(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=kz(s)),Kz(s,s));return r}function Fz(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=Fz(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=kz(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Iz(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function Lz(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function Rz(e,t,n,r,i){var a;n:if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||Lz(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||Lz(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(hz,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=gz,e.addEventListener(t,a?vz:_z,a)):e.removeEventListener(t,a?vz:_z,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function zz(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=gz++;else if(t.u<n.l)return;return n(lz.event?lz.event(t):t)}}}function Bz(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=lz.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new M(v,x):(t.__c=f=new Oz(v,x),f.constructor=M,f.render=qz),b&&b.sub(f),f.props=v,f.state||(f.state={}),f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Cz({},f.__s)),Cz(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=lz.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=Cz({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===Dz&&d.key==null&&(E=Uz(d.props.children)),s=Nz(e,xz(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null){if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)wz(a[j]);Vz(t)}}else t.__e=n.__e,t.__k=n.__k,e.then||Vz(t);lz.__e(e,t,n)}else s=t.__e=Wz(n.__e,t,n,r,i,a,o,c,l,u);return(d=lz.diffed)&&d(t),128&t.__u?void 0:s}function Vz(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(Vz)}function Hz(e,t,n){for(var r=0;r<n.length;r++)Gz(n[r],n[++r],n[++r]);lz.__c&&lz.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){lz.__e(e,t.__v)}})}function Uz(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:xz(e)?e.map(Uz):Cz({},e)}function Wz(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(lz.__m&&lz.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=Sz.call(e.childNodes),v=n.props||yz,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;Rz(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||Rz(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),Nz(b==`template`?e.content:e,xz(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&kz(n,0),s,c,l),a!=null)for(u=a.length;u--;)wz(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||Rz(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&Rz(e,u,g,v[u],i))}return e}function Gz(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){lz.__e(e,n)}}function Kz(e,t,n){var r,i;if(lz.unmount&&lz.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Gz(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){lz.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Kz(r[i],t,n||typeof e.type!=`function`);n||wz(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function qz(e,t,n){return this.constructor(e,n)}function Jz(e,t){var n,r,i,a;t==document&&(t=document.documentElement),lz.__&&lz.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=Tz(Dz,null,[e]),i=[],a=[],Bz(t,e,r||yz,yz,t.namespaceURI,r?null:t.firstChild?Sz.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),Hz(i,e,a)}function Yz(e,t){e.__u|=32,Jz(e,t)}lz={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw pz=0,e}},uz=0,Oz.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Cz({},this.state);typeof e==`function`&&(e=e(Cz({},n),this.props)),e&&Cz(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),jz(this))},Oz.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),jz(this))},Oz.prototype.render=Dz,dz=[],pz=0,mz=function(e,t){return e.__v.__b-t.__v.__b},hz=/(PointerCapture)$|Capture$/i,gz=0,_z=zz(!1),vz=zz(!0);var Xz=0;Array.isArray;function $(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Xz,__i:-1,__u:0,__source:i,__self:a};return lz.vnode&&lz.vnode(l),l}var Zz=16,Qz=16,$z={};function eB({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=$z[e]??{width:Zz,height:Qz},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return $(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:$(`use`,{href:c})})}var tB=e=>e!==void 0&&/\s/.test(e),nB=(e,t)=>{let n=t=>tB(e[t-1])||tB(e[t]);if(!n(t))return t;for(let r=1;r<e.length;r++){let i=t-r;if(i>0&&!n(i))return i;let a=t+r;if(a<e.length&&!n(a))return a}return t},rB=e=>nB(e,Math.ceil(e.length/2)),iB=e=>{if(e.length<2)return[e,``];let t=rB(e);return[e.slice(0,t),e.slice(t)]},aB=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:rB(e);return[e.slice(0,r),e.slice(r)]},oB=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},sB=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},cB=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},lB=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function uB({children:e,marker:t,variant:n=`default`}){"use no memo";return $(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:$(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?$(`span`,{"data-truncate-fade":!0}):t})})}function dB(e){"use no memo";let{mode:t,children:n}=e;return $(`div`,{children:[$(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?$(`span`,{children:n}):n}),$(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?$(`span`,{children:n}):n})]})}function fB({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=$(dB,{mode:t,children:e},`content`),o=$(uB,{marker:n,mode:t,variant:r},`marker`),s=$(`div`,{"data-truncate-fill":!0},`fill`);return $(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:$(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function pB({children:e,...t}){"use no memo";return $(fB,{mode:`truncate`,...t,children:e})}function mB({children:e,...t}){"use no memo";return $(fB,{mode:`fruncate`,...t,children:e})}function hB({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=$(pB,{...s,children:t[0]}),l=$(mB,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return $(`div`,{className:a,style:o});if(e.length<i)return $(n===`end`?mB:pB,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=iB:r===`extension`?t=aB:r===`leaf-path`&&(t=oB);else if(typeof r==`number`)t=sB,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=cB:e===`first`&&(t=lB)}else typeof r==`function`&&(t=r);t??=iB;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=$(pB,{...s,..._,children:f}),l=$(mB,{...s,...v,children:p})}return $(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[$(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),$(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var gB={endIndex:-1,startIndex:-1};function _B(e,t,n){return Math.min(Math.max(e,t),n)}function vB(e,t){return e<0||t<e?gB:{endIndex:t,startIndex:e}}function yB(e){return e.startIndex<0||e.endIndex<e.startIndex}function bB(e,t){return yB(e)?0:(e.endIndex-e.startIndex+1)*t}function xB(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function SB(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function CB(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function wB(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function TB(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function EB(e,t,n){if(e.length===0||t<=0)return[];let r=TB(e),i=CB(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=wB(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function DB(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=_B(t.scrollTop,0,o),c=t.stickyRows??EB(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=xB(s,n,t.itemHeight),m=xB(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?gB:vB(m,SB(u+d,n,t.itemHeight)),y=g+1,b=yB(v)?gB:vB(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=bB(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:yB(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var OB={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},kB={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},AB=`Contains git status items`;function jB(e){return e.current?!0:(e.current=!0,!1)}function MB(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function NB(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return MB({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function PB(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function FB(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function IB(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function LB(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function RB(e,t){return e!=null&&e>0?e:t}function zB(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function BB(e,t,n,r,i=0){let a=MB({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function VB(e,t,n,r,i,a,o=0){let s=NB({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function HB(e,t,n,r,i,a){let o=PB({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function UB(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function WB(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function GB({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return $(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function KB(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function qB(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var JB,YB,XB,ZB,QB=Object.is,$B=0,eV=[],tV=lz,nV=tV.__b,rV=tV.__r,iV=tV.diffed,aV=tV.__c,oV=tV.unmount,sV=tV.__;function cV(e,t){tV.__h&&tV.__h(YB,e,$B||t),$B=0;var n=YB.__H||(YB.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function lV(e){return $B=1,uV(SV,e)}function uV(e,t,n){var r=cV(JB++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):SV(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);QB(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=YB,!YB.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,QB(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};YB.__f=!0;var a=YB.shouldComponentUpdate,o=YB.componentWillUpdate;YB.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},YB.shouldComponentUpdate=i}return r.__N||r.__}function dV(e,t){var n=cV(JB++,3);!tV.__s&&xV(n.__H,t)&&(n.__=e,n.u=t,YB.__H.__h.push(n))}function fV(e,t){var n=cV(JB++,4);!tV.__s&&xV(n.__H,t)&&(n.__=e,n.u=t,YB.__h.push(n))}function pV(e){return $B=5,mV(function(){return{current:e}},[])}function mV(e,t){var n=cV(JB++,7);return xV(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function hV(e,t){return $B=8,mV(function(){return e},t)}function gV(){for(var e;e=eV.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(yV),e.__H.__h.forEach(bV),e.__H.__h=[]}catch(t){e.__H.__h=[],tV.__e(t,e.__v)}}tV.__b=function(e){YB=null,nV&&nV(e)},tV.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),sV&&sV(e,t)},tV.__r=function(e){rV&&rV(e),JB=0;var t=(YB=e.__c).__H;t&&(XB===YB?(t.__h=[],YB.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(yV),t.__h.forEach(bV),t.__h=[],JB=0)),XB=YB},tV.diffed=function(e){iV&&iV(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(eV.push(t)!==1&&ZB===tV.requestAnimationFrame||((ZB=tV.requestAnimationFrame)||vV)(gV)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),XB=YB=null},tV.__c=function(e,t){t.some(function(e){try{e.__h.forEach(yV),e.__h=e.__h.filter(function(e){return!e.__||bV(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],tV.__e(n,e.__v)}}),aV&&aV(e,t)},tV.unmount=function(e){oV&&oV(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{yV(e)}catch(e){t=e}}),n.__H=void 0,t&&tV.__e(t,n.__v))};var _V=typeof requestAnimationFrame==`function`;function vV(e){var t,n=function(){clearTimeout(r),_V&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);_V&&(t=requestAnimationFrame(n))}function yV(e){var t=YB,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),YB=t}function bV(e){var t=YB;e.__c=e.__(),YB=t}function xV(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!QB(t,e[n])})}function SV(e,t){return typeof t==`function`?t(e):t}function CV(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:$(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return $(Dz,{children:[$(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:$(pB,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function wV(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function TV(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function EV(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function DV({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=DB(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:EV(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?EV(u,1,t,o):i&&r<=0&&c.length>0?EB(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var OV=400,kV=40,AV=18;function jV(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?MV(e,t,n):a instanceof HTMLElement?a:null}function MV(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function NV(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function PV(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function FV(){return navigator.vendor!==`Apple Computer, Inc.`}function IV(e,t){let n=e-t.top;if(n<kV)return-Math.ceil((kV-Math.max(0,n))/kV*AV);let r=t.bottom-e;return r<kV?Math.ceil((kV-Math.max(0,r))/kV*AV):0}function LV(e,t){if(e!=null){let t=OB[e];return t==null?null:{text:t,title:kB[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:AB}:null}function RV(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function zV(e){return e!=null&&`toggle`in e}function BV(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function VV(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function HV(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function UV(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function WV(e,t){return t&&UV(e)||(e.ctrlKey||e.metaKey)&&BV(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var GV=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function KV(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function qV(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function JV(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function YV(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function XV(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function ZV(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function QV(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function $V(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function eH(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=$V(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function tH(e,t){return{kind:e.kind,name:TV(e),path:t}}function nH(e){return e==null?void 0:`${e}__tree`}function rH(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function iH(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function aH(e,t){if(e==null)return null;if(`text`in e)return e.parts==null?$(`span`,{title:e.title,children:e.text}):$(`span`,{title:e.title,children:e.parts.map((e,t)=>$(`span`,{style:{color:e.color},children:e.text},t))});let n=typeof e.icon==`string`?iH(e.icon)?t(e.icon):{name:e.icon}:iH(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return $(`span`,{title:e.title,children:$(eB,{...n})})}function oH(e){e!=null&&FB(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function sH(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=wV(e);return $(Dz,{children:[e.depth>0?$(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>$(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,$(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?$(eB,{...t(`file-tree-icon-chevron`)}):$(eB,{...t(`file-tree-icon-file`,u)})}),$(`div`,{"data-item-section":`content`,children:e.isFlattened?CV(e,c,a):c??$(hB,{minimumLength:5,split:`extension`,children:e.name})}),i?$(`div`,{"data-item-section":`decoration`,children:r==null?null:aH(r,t)}):null,s?$(`div`,{"data-item-section":`git`,children:aH(o,t)}):null,n?$(`div`,{"data-item-section":`action`,children:l?$(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:$(eB,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function cH(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=wV(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??RV(t.ancestorPaths,v,y),B=t.kind===`directory`&&(b?.has(P)??!1),V=A(t,P),H=LV(z,B),U=S&&w,ee=V!=null||x||U,te=U&&T===`always`,ne=a.getPath()===P,W=ne?a.getValue():``,re=R||!ne?null:$(GB,{ref:D,ariaLabel:`Rename ${TV(t)}`,isFlattened:t.isFlattened,value:W,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),ie=sH(t,k,{actionLaneEnabled:U,customDecoration:V,decorationLaneEnabled:ee,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:H,gitLaneActive:x,renameInput:re,showDecorativeActionAffordance:te}),ae={...KB({ariaLabel:TV(t),domId:t.isFocused?rH(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:U,contextMenuButtonVisibility:U?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:B,effectiveGitStatus:z,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(P),j(t,P,{anchorRect:JV(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&ne?$(`div`,{...ae,children:ie}):$(`button`,{...ae,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(R){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:ie})}function lH(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(wV(e))).map((n,r)=>cH(e,n,t.start+r))}function uH({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=uP,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=pV(null),v=pV(null),y=pV(!1),b=pV(null),x=pV(null),S=pV(null),C=pV(null),w=pV(null),T=pV(new Map),E=pV(new Map),D=pV(()=>{}),O=pV(null),k=pV(0),A=pV(!1),j=pV(null);j.current!==t&&(A.current=!1,j.current=t);let M=pV(!1),N=pV(null),P=pV(null),F=pV(!1),I=pV(null),L=pV(null),R=pV(null),z=pV(null),B=pV(null),V=pV(null),H=pV(null),U=pV(null),ee=pV(!1),te=pV(null),ne=pV(null),W=pV(null),re=pV(null),ie=mV(()=>new Map,[]),[,ae]=lV(0),G=pV(!1),[oe,se]=lV(null),[ce,le]=lV(null),[ue,de]=lV(null),[fe,pe]=lV(null),[me,he]=lV(0),[ge,_e]=lV(null),ve=pV(ge);ve.current=ge;let ye=pV(null),be=pV(null),xe=pV(null),Se=pV(null),Ce=pV(null),we=pV(!1),Te=()=>{be.current=null,xe.current=null,Se.current=null},Ee=(e,t)=>{be.current=e,xe.current=null,Se.current=t==null?null:{path:e,scrollTop:t}},De=(e,t)=>{be.current=null,xe.current={path:e,viewportOffset:t},Se.current=null},Oe=pV(d===`retain`&&t.isSearchOpen()),[ke,Ae]=lV(p);dV(()=>{p||Ae(!1)},[p]);let je=pV(!1),Me=hV(()=>{je.current=!0,Ae(e=>e&&!1)},[]),[Ne,Pe]=lV(()=>DV({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Fe,Ie]=lV(!1);dV(()=>{Ie(!0)},[]);let Le=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Re=e?.contextMenu?.triggerMode??(Le?`right-click`:`both`),ze=Re===`both`||Re===`button`,Be=e?.contextMenu?.buttonVisibility??`when-needed`,Ve=Re===`both`||Re===`right-click`;fV(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;Ce.current=t,le(t),pe(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(we.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let He=hV((e,t)=>{XV(T.current,e,t)},[]),K=hV((e,t)=>{XV(E.current,e,t)},[]),Ue=hV(e=>{x.current=e},[]),We=hV(e=>ZV(e,E.current,T.current),[]),Ge=n!=null||r!=null||i!=null,{resolveIcon:Ke}=mV(()=>cz(a),[a]),qe=t[RR](),Je=qe.getPath(),Ye=Je!=null,Xe=t.isSearchOpen(),Ze=t.getSearchValue(),Qe=t.getFocusedPath(),$e=t.getFocusedIndex(),et=t.getScrollRequest(),tt=t.isDragAndDropEnabled(),nt=t.getDragSession(),rt=mV(()=>nt==null?null:new Set(nt.draggedPaths),[nt]),it=nt?.target??null,at=nt?.primaryPath??null,ot=nH(o),{overlayHeight:st,overlayRows:ct,snapshot:lt,visibleRows:ut}=Ne,dt=lt.physical.viewportHeight,ft=mV(()=>({end:lt.window.endIndex,start:lt.window.startIndex}),[lt.window.endIndex,lt.window.startIndex]),pt=ct,mt=lt.sticky.rows,ht=lt.physical.totalHeight,gt=lt.sticky.height,q=mV(()=>new Set(mt.map(e=>wV(e.row))),[mt]),_t=$e>=0&&$e>=ft.start&&$e<=ft.end,vt=hV((e,t)=>u?.({item:tH(e,t),row:e})??null,[u]),yt=hV(e=>FB(e==null?null:T.current.get(e)??null)?!0:FB(S.current),[]),bt=hV(e=>{yt(t.focusNearestPath(e))},[t,yt]),xt=pV(bt);xt.current=bt;let St=pV(!0),Ct=pV(()=>{}),wt=hV((t=!0)=>{let n=ve.current;n!=null&&(St.current=St.current&&t,_e(null),e?.contextMenu?.onClose?.(),St.current&&bt(n.path))},[e?.contextMenu,bt]);Ct.current=wt;let Tt=hV(e=>{let t=e==null?null:YV(S.current,e);de(e=>e===t?e:t)},[]),Et=hV((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=We(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Ee(n,e?.scrollTop??null),M.current=!0,se(e=>e===n?e:n)}i.focus(),Tt(a),St.current=!0,_e({anchorRect:r?.anchorRect??null,item:tH(e,n),path:n,source:r?.source??`keyboard`})},[t,We,Tt]),Dt=hV(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=LB(e,dt);I.current=$e<0||e==null?null:Math.max(0,Math.min($e*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(pe(`focus`),ae(e=>e+1))}},[t,$e,s,l,dt]),Ot=hV((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=LB(i,dt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:DV({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,HB(i,a,s,l,u,d),D.current(),ye.current=n?e:null,!0},[t,s,c,dt,h]),kt=()=>y.current===!0||re.current!=null||ee.current===!0,At=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),jt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Mt=()=>{z.current!=null&&(clearTimeout(z.current),z.current=null),R.current=null},Nt=()=>{V.current?.remove(),V.current=null},Pt=()=>{jt(L.current),L.current=null,B.current=null},Ft=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},It=()=>{U.current?.(),U.current=null,re.current!=null&&(clearTimeout(re.current),re.current=null),ee.current=!1,te.current=null,W.current=null,ne.current!=null&&(ne.current.setAttribute(`draggable`,`true`),ne.current.style.removeProperty(`touch-action`),ne.current=null),Nt(),Mt(),Pt(),H.current=null},Lt=(e,n)=>{let r=S.current?.getRootNode(),i=NV(jV(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Rt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Mt();return}let r=t.getItem(e.directoryPath),i=zV(r)?r:null;if(i==null||i.isExpanded()){Mt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;R.current!==a&&(Mt(),R.current=a,z.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},zt=()=>{L.current=null;let e=B.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=IV(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),Rt(Lt(e.clientX,e.clientY)),L.current=At(zt)},Bt=(e,t)=>{B.current={clientX:e,clientY:t},L.current??=At(zt)},Vt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(It(),Nt(),Mt(),Pt(),t.startDrag(r)===!1){e.preventDefault();return}if(H.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),FV())){let t=PV(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Ft(t),V.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Ht=()=>{Nt(),Mt(),Pt(),H.current=null,t.cancelDrag()},Ut=(e,n,r)=>{if(re.current!=null||ee.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;W.current={clientX:i.clientX,clientY:i.clientY},ne.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!ee.current;re.current!=null&&(clearTimeout(re.current),re.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),U.current===o&&(U.current=null),t&&(a.setAttribute(`draggable`,`true`),ne.current===a&&(ne.current=null),W.current=null)},s=e=>{let t=e.touches[0],n=W.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=100||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),U.current=o,re.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),ne.current===a&&(ne.current=null),W.current=null;return}ee.current=!0,ne.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),H.current=n;let e=a.getBoundingClientRect(),s=PV(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Ft(s),V.current=s,te.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=te.current;n!=null&&V.current!=null&&(V.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Rt(Lt(t.clientX,t.clientY)),Bt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Lt(n.clientX,n.clientY),t.completeDrag(),It()},u=()=>{t.cancelDrag(),It()};U.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},OV)},Wt=e=>{if(ge!=null){if(e.key===`Escape`){wt(),e.preventDefault(),e.stopPropagation();return}GV.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(qe.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)qe.cancel();else if(e.key===`Enter`)qe.commit();else return;pe(`focus`),ae(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Dt(Qe??void 0),e.preventDefault(),e.stopPropagation();return}if(Xe){if(e.key===`Escape`)F.current=!1,I.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=LB(n,dt);I.current=$e<0||n==null?null:Math.max(0,Math.min($e*s-n.scrollTop,Math.max(0,r-s))),F.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;pe(`focus`),ae(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&VV(e)){t.openSearch(e.key),ae(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Le&&UV(e),r=WV(e,Le),i=r&&S.current!=null?IB(S.current):null,a=r?new Set(QV(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==Qe&&a.has(o)){let e=C.current;Ee(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=zV(p)?p:null,h=u!=null&&(q.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=ZV(u,E.current,T.current);e==null||n==null?y=!1:Et(e,u)}else if((e.ctrlKey||e.metaKey)&&BV(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;pe(`focus`);let b=t.getFocusedPath(),x=b!=null&&(q.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Ee(b,v?.scrollTop??null),M.current=!0,se(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(De(b,eH(S.current,v,i,u,s,gt,dt)),M.current=!0,se(e=>e===b?e:b)):Te()}ae(e=>e+1),e.preventDefault(),e.stopPropagation()};fV(()=>{if(f&&Xe){if(Oe.current){Oe.current=!1;return}FB(w.current)}},[Xe,f]),fV(()=>{let e=x.current;switch(WB({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Je})){case`reset`:P.current=null;return;case`reveal-canonical`:Je!=null&&Ot(Je,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(ye.current=null,P.current=Je,FB(e),e.select());return}},[ft.end,ft.start,Je,Ot,q]),fV(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=IB(e)?.dataset.itemPath??null;se(e=>e===t?e:t)},i=()=>{n(),M.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,IB(e)!=null){r();return}M.current=!1,se(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,se(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;se(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),fV(()=>{let e=S.current;e!=null&&(lt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[lt.physical.scrollTop]),fV(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=LB(n,g);let a=()=>{let e=t.getVisibleCount(),r=RB(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Pe(DV({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!A.current){A.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=RB(O.current,g),i=t.getVisibleRows(e,e)[0]??null;BB(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=t.subscribe(()=>{jB(G)&&ae(e=>e+1),a()}),l=()=>{we.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,he(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&we.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{if(a(),n.scrollTop>0&&d(),ve.current!=null&&y.current&&Ct.current(),we.current===!0){y.current=!1;return}le(e=>e==null?e:null),l()},m=()=>{l(),f()},_=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),v=e=>{_.has(e.key)&&m()};n.addEventListener(`scroll`,p,{passive:!0}),n.addEventListener(`wheel`,m,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`keydown`,v);let x=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:zB(e[0]))??LB(n,g),a()}):null;return x?.observe(n),()=>{D.current=()=>{},o(),n.removeEventListener(`scroll`,p),n.removeEventListener(`wheel`,m),n.removeEventListener(`touchmove`,m),n.removeEventListener(`keydown`,v),e!=null&&clearTimeout(e),u!=null&&clearTimeout(u),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,x?.disconnect()}},[t,g,s,c,h]),fV(()=>{Le||ge==null||wt(!1)},[wt,Le,ge]);let Gt=mV(()=>ge==null?null:`${ge.path}::${ge.source}`,[ge]);fV(()=>{if(Gt==null){m?.clearSlotContent(zM);return}let t=ve.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??qV(n.getBoundingClientRect()),close:e=>{Ct.current(e?.restoreFocus??!0)},restoreFocus:()=>{St.current&&xt.current(ve.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(zM,i),e?.contextMenu?.onOpen?.(t.item,r),oH(i),queueMicrotask(()=>{i!=null&&i.isConnected&&document.activeElement===i&&oH(i)}),()=>{m?.clearSlotContent(zM)}},[Gt,e?.contextMenu,m]),fV(()=>{ge!=null&&t.getItem(ge.path)==null&&wt()},[wt,ge,t]),fV(()=>{if(ge==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(KV(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&wt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),wt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[wt,ge]),fV(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=Qe;return}let r=Qe==null?null:T.current.get(Qe)??null,i=IB(n),a=i?.dataset.itemPath??null,o=Ye&&x.current===i,c=f&&w.current===i,l=F.current&&!Xe,u=I.current??0,d=ye.current,p=be.current,m=xe.current,g=Se.current,_=i!=null,v=M.current||_,y=N.current!==Qe,b=p!=null&&p===Qe&&Qe!=null,E=!1,O=!1;if(et!=null&&et.id!==k.current){k.current=et.id;let n=et.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,dt-s))):gt;E=!0,O=VB(e,n,s,dt,ht,et.offset,t)}t.clearScrollRequest(et.id)}let A=!E&&l&&HB(e,$e,s,dt,ht,u),j=!E&&d!=null&&d===Qe&&HB(e,$e,s,dt,ht,gt),P=!E&&m!=null&&m.path===Qe&&HB(e,$e,s,dt,ht,m.viewportOffset),L=!E&&g!=null&&g.path===Qe&&e.scrollTop!==g.scrollTop;if(L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==Qe&&!b&&BB(e,$e,s,dt,gt))&&D.current(),E){N.current=Qe;return}if(!v){N.current=Qe;return}if(o){N.current=Qe;return}if(c&&!l){N.current=Qe;return}if(r==null){l&&$e>=0&&(HB(e,$e,s,dt,ht,u),D.current()),N.current=Qe;return}(y||l||d===Qe||p===Qe||m?.path===Qe||g?.path===Qe||a==null||a!==Qe)&&(FB(r),d===Qe&&(ye.current=null),p===Qe&&(be.current=null),m?.path===Qe&&(xe.current=null),g?.path===Qe&&(Se.current=null),F.current=!1,I.current=null),N.current=Qe},[t,$e,Qe,_t,s,Ye,Xe,ft,dt,f,et,h,gt,ht,ut]);let Kt=$e>=0&&$e>=lt.visible.startIndex&&$e<=lt.visible.endIndex,qt=Qe!=null&&pt.some(e=>wV(e.row)===Qe),Jt=Kt||qt,Yt=ze&&M.current===!0&&Jt?Qe:null,Xt=fe===`pointer`?ce:null,Zt=ge?.path??Ce.current??Xt??Yt??ce,Qt=ge?.source===`right-click`;fV(()=>{y.current&&ge==null||Tt(We(Zt))},[ge,We,ft,dt,me,pt,Zt,Tt,ut]);let $t=hV(e=>{if(y.current||KV(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&pe(e=>e===`pointer`?e:`pointer`),le(e=>e===i?e:i)},[]),J=hV(()=>{le(null)},[]);fV(()=>{if(!tt)return;let e=()=>{It(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),It(),t.cancelDrag()}},[t,tt]);let en=e=>{if(!tt||t.getDragSession()==null||ee.current)return;let n=NV(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Rt(t.getDragSession()?.target??null),Bt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},tn=e=>{if(!tt||t.getDragSession()==null||ee.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Mt(),Pt(),t.setDragTarget(null))},Y=e=>{tt&&t.getDragSession()!=null&&!ee.current&&(e.preventDefault(),Lt(e.clientX,e.clientY),t.completeDrag(),Nt(),Mt(),Pt(),H.current=null)},nn=lt.window.height,rn=lt.window.offsetTop,an=Math.min(0,dt-nn),on=Math.min(0,dt-nn-gt),sn=oe===Qe||F.current,cn=Qe!=null&&sn&&!_t&&$e>=0?ut[$e]??t.getVisibleRows($e,$e)[0]??null:null,ln=cn==null?null:UB($e,s,ft,nn),un=H.current,dn=at!=null&&un!=null&&un.path===at&&un.index>=ft.start&&un.index<=ft.end,fn=at!=null&&un!=null&&un.path===at&&!dn&&un.path!==cn?.path?un:null,pn=fn==null?null:UB(fn.index,s,ft,nn),mn=HV(($e>=0?ut[$e]??t.getVisibleRows($e,$e)[0]??null:null)?.ancestorPaths.at(-1)??null),hn=Xe&&Qe!=null?rH(o,Qe,!_t):void 0,gn=ge?.path??(Xe?Qe:oe),_n=ge?.path??ce,vn=We(Zt),yn=Le&&ze&&!Qt&&!Ye&&vn!=null&&ue!=null&&Zt!=null,X=Le&&(yn||ge!=null),bn=ge?.anchorRect,xn=bn==null&&vn!=null&&ue!=null&&(ge!=null||yn)?ue:null,Sn=bn==null?xn==null?void 0:{top:`${xn}px`}:{left:`${bn.left}px`,position:`fixed`,right:`auto`,top:`${bn.top}px`},Cn=Qt?{opacity:`0`}:void 0,wn=hV((e,n,r,i)=>{let a=qB({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:Xe,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c)}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=lt.visible.startIndex&&n.index<=lt.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,se(e=>e===c?e:c),pe(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Ot(c,{targetOffset:`sticky-parents`})},[t,Xe,lt.visible.endIndex,lt.visible.startIndex,Ot]),Tn=()=>{if(y.current||!ze||Zt==null||vn==null)return;let e=t.getItem(Zt);e!=null&&(Tt(vn),St.current=!0,_e({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:vn.getAttribute(`aria-label`)??Zt,path:e.getPath()},path:e.getPath(),source:`button`}))},En={contextHoverPath:_n,contextMenuButtonTriggerEnabled:ze,contextMenuButtonVisibility:Be,contextMenuEnabled:Le,contextMenuRightClickEnabled:Ve,contextMenuTriggerMode:Re,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:tt,draggedPathSet:rt,dragTarget:it,gitLaneActive:Ge,gitStatusByPath:n,handleRowDragEnd:Ht,handleRowDragStart:Vt,handleRowTouchStart:Ut,ignoredGitDirectories:r,ignoredInheritanceCache:ie,instanceId:o,itemHeight:s,onKeyDown:Wt,onRowClick:wn,openContextMenuForRow:Et,registerButton:He,registerRenameInput:Ue,renameView:qe,renderDecorationForRow:vt,resolveIcon:Ke,shouldSuppressContextMenu:kt,visualFocusPath:gn},Dn={...En,registerButton:K};return $(`div`,{ref:S,id:ot,"data-file-tree-context-menu-button-visibility":Le&&ze?Be:void 0,"data-file-tree-context-menu-trigger-mode":Le?Re:void 0,"data-file-tree-has-context-menu-action-lane":Le&&ze?`true`:void 0,"data-file-tree-has-git-lane":Ge?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:tt?tn:void 0,onDragOver:tt?en:void 0,onDrop:tt?Y:void 0,onKeyDown:Wt,onPointerLeave:Le?J:void 0,onPointerOver:Le?$t:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[$(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:mn}}),$(`slot`,{name:RM,"data-type":`header-slot`}),f?$(`div`,{"data-file-tree-search-container":!0,"data-open":Xe?`true`:`false`,children:$(`input`,{ref:w,"aria-activedescendant":hn,"aria-controls":ot,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":ke?`true`:void 0,value:Ze,onBlur:()=>{(d!==`retain`||je.current)&&t.closeSearch()},onFocus:Me,onPointerDown:Me,onInput:e=>{Me();let n=e.currentTarget;t.setSearch(n.value)}})}):null,$(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Fe&&pt.length>0?$(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:$(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${st}px`},children:pt.map((e,t)=>cH(Dn,e.row,`sticky:${wV(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${pt.length-t}`}}))})}):null,$(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${ht}px`},children:[$(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${rn}px`}}),$(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${nn}px`,top:`${an}px`,bottom:`${on}px`},children:[lH(En,ft,q),cn!=null&&ln!=null?cH(En,cn,`parked:${cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:at===cn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${ln}px`}}):null,fn!=null&&pn!=null?cH(En,fn,`parked-drag:${fn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${pn}px`}}):null]})]})]}),Le?$(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":X?`true`:`false`,style:Sn,children:[$(`button`,{ref:v,type:`button`,"data-type":BM,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":ge==null?`false`:`true`,"data-visible":yn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),ge!=null){wt();return}Tn()},tabIndex:-1,style:Cn,children:$(eB,{...Ke(`file-tree-icon-ellipsis`)})}),ge==null?null:$(`slot`,{name:zM})]}):null,ge==null?null:$(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),wt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),wt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var dH={hydrateRoot:(e,t)=>{Yz(Tz(uH,t),e)},renderRoot:(e,t)=>{Jz(Tz(uH,t),e)},unmountRoot:e=>{Jz(null,e)}};function fH(e,t){dH.renderRoot(e,t)}function pH(e,t){dH.hydrateRoot(e,t)}function mH(e){dH.unmountRoot(e)}var hH=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}};Array.isArray;var gH=0;function _H(e){return e!=null&&e.length>0?e:(gH+=1,`pst_ft_${gH}`)}function vH({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??uP)}function yH(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function bH(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function xH(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var SH=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new hH;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=_H(a),this.#p=YR(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=lP(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new WR({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(mH(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getFocusedIndex(){return this.#t.getFocusedIndex()}getVisibleCount(){return this.#t.getVisibleCount()}getVisibleRows(e,t){return this.#t.getVisibleRows(e,t)}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}focusFirstItem(){this.#t.focusFirstItem()}focusLastItem(){this.#t.focusLastItem()}focusNextItem(){this.#t.focusNextItem()}focusPreviousItem(){this.#t.focusPreviousItem()}focusParentItem(){this.#t.focusParentItem()}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}applyGitStatusPatch(e){let t=XR(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&fH(n.wrapper,this.#w())}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){Array.isArray(e)?this.#t.resetPaths(e,t):this.#t.resetPaths(e)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),fH(t.wrapper,this.#w()))}setGitStatus(e){let t=YR(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&fH(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),fH(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),pH(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),fH(r,this.#w())}#C(){return{initialViewportHeight:vH({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(RM,e());return}this.#l.setSlotHtml(RM,this.#e?.header?.html??null)}#k(e){let t=xH(e).find(e=>bH(e)),n=yH(nP(sP(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=xH(e),n=t.find(e=>bH(e)),r=t.filter(e=>e!==n),i=sP(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=yH(i);if(a==null){for(let e of r)e.remove();return}if(r.length!==1||r[0].outerHTML!==a.outerHTML){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=sP(this.#m);t.colored&&iP(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${PM}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}(this.#g?.parentNode!==e||this.#_!==this.#h)&&(this.#g??=document.createElement(`style`),this.#g.setAttribute(PM,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=mP(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return bP(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}};function CH(e){let[t]=(0,b.useState)(()=>new SH(e)),n=(0,b.useRef)({timeout:null,model:t});return(0,b.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}function wH(e,t,n){return Object.is(e,t)||n?.(e,t)===!0}function TH(e,t,n){let r=(0,b.useRef)({hasValue:!1,model:null,selector:null,value:void 0}),i=(0,b.useCallback)(t=>e.subscribe(t),[e]),a=(0,b.useCallback)(()=>{let i=r.current,a=t(e);if(i.model!==e||i.selector!==t||!i.hasValue)return i.hasValue=!0,i.model=e,i.selector=t,i.value=a,a;let o=i.value;return wH(o,a,n)?o:(i.value=a,a)},[n,e,t]);return(0,b.useSyncExternalStore)(i,a,a)}function EH(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var DH=`data-checked`,OH=`data-unchecked`;function kH(e){return{checked(t){return e.indeterminate?{}:t?{[DH]:``}:{[OH]:``}},...uM}}var AH=b.createContext(void 0);function jH(){return b.useContext(AH)}var MH=b.createContext(void 0);function NH(){let e=b.useContext(MH);if(e===void 0)throw Error(F(14));return e}var PH=`data-parent`,FH=b.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":a,disabled:o=!1,form:s,id:c,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:f,parent:p=!1,readOnly:m=!1,render:h,required:g=!1,uncheckedValue:_,value:v,nativeButton:y=!1,style:x,...S}=e,{clearErrors:C}=_M(),{disabled:w,name:T,setDirty:E,setFilled:D,setFocused:O,setTouched:k,state:A,validationMode:j,validityData:P,validation:F}=pM(),I=OM(),{labelId:L,registerControlId:R,getDescriptionProps:z}=yM(),B=jH(),V=B?.allValues===void 0?void 0:B.parent,H=V!==void 0,U=w||I.disabled||B?.disabled||o,ee=T??d,te=v??ee,ne=Js(),W=B?.registerControlId!==R,re=CM({id:c||void 0,enabled:W}),ie=y?re:ne,ae={};H&&(p?ae=V.getParentProps():te!==void 0&&(ae=V.getChildProps(te)));let{checked:G=n,indeterminate:oe=l,onCheckedChange:se,...ce}=ae,le=B?.value,ue=b.useRef(null),{getButtonProps:de,buttonRef:fe}=hl({disabled:U,native:y}),pe=B?.validation??F,[me,he]=jc({controlled:te!==void 0&&le!==void 0&&!p?le.includes(te):G,default:i,name:`Checkbox`,state:`checked`}),ge=H?!!G:me,_e=H&&oe||l;kM(ue,ne,me,void 0,!B&&!U,d);let ve=V?.registerChildId,be=b.useRef(null),xe=pe.registerInput,Se=B?te:void 0,Ce=b.useCallback(e=>xe(e,{controlRef:ue,value:Se}),[xe,Se]),we=ln(u,be,p?void 0:Ce),Te=bM(a,L,be,!y,re);N(()=>{be.current&&(be.current.indeterminate=_e),B||D(me)},[me,_e,B,D]),tu(me,()=>{B||(C(ee),E(me!==P.initialValue),pe.change(me))});let Ee=pi({checked:me,disabled:U,form:s,name:p?void 0:ee,id:y?void 0:re,required:g,ref:we,style:ee?kn:On,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(m){e.preventDefault();return}let t=e.currentTarget.checked,n=J(Ot,e.nativeEvent);if(f?.(t,n),!n.isCanceled&&(se?.(t,n),!n.isCanceled&&(he(t),te!==void 0&&B!==void 0&&!p&&!H))){let e=t?[...B.value,te]:B.value.filter(e=>e!==te);B.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){ue.current?.focus()}},v===void 0?M:{value:(B?me&&v:v)||``},z,e=>pe.getValidationProps(U,e));b.useEffect(()=>{if(!V||te===void 0)return;let e=V.disabledStatesRef.current;return e.set(te,U),()=>{e.delete(te)}},[V,U,te]);let De=b.useMemo(()=>({...A,checked:ge,disabled:U,readOnly:m,required:g,indeterminate:_e}),[A,ge,U,m,g,_e]),Oe=kH(De),ke=Di(`span`,e,{state:De,ref:[fe,ue,t],props:[{id:ie,role:`checkbox`,"aria-checked":_e?`mixed`:ge,"aria-readonly":m||void 0,"aria-required":g||void 0,"aria-labelledby":Te,[PH]:p?``:void 0,onFocus(){U||O(!0)},onBlur(){let e=be.current;e&&(k(!0),O(!1),j===`onBlur`&&pe.commit(B?le:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=be.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),ye(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||EH(t)?.click()})},onClick(e){if(m||U)return;e.preventDefault();let t=be.current;t&&ml(t,e)}},S,ce,de,z,e=>pe.getValidationProps(U,e)],stateAttributesMapping:Oe}),Ae=ke.props.id;return N(()=>{if(ve&&!p&&te!==void 0&&Ae!==void 0)return ve(te,Ae)},[ve,p,te,Ae]),(0,Y.jsxs)(MH.Provider,{value:De,children:[ke,!me&&!B&&ee&&!p&&_!==void 0&&(0,Y.jsx)(`input`,{type:`hidden`,form:s,name:ee,value:_,disabled:U}),(0,Y.jsx)(`input`,{...Ee,suppressHydrationWarning:!0})]})}),IH=b.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=NH(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:d}=Ro(c),f=b.useRef(null),p={...s,transitionStatus:u};Ho({batch:!0,enabled:!c,open:c,ref:f,onComplete(){c||d(!1)}});let m={...kH(s),...et},h=a||l,g=Di(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:m,props:o});return h?g:null}),LH=b.createContext(void 0);function RH(e){let t=b.useContext(LH);if(t===void 0&&!e)throw Error(F(47));return t}var zH={...us,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},BH=class extends No{constructor(e,t,n){let r=new rs;super(VH(e,r,t,n),HH(r),zH)}setOpen=(e,t)=>{let n=t.reason===At,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=Xo(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=Yo(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),zi.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function VH(e,t,n,r=!1){let i={...is(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function HH(e){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),stickIfOpenTimeout:new B,triggerElements:e}}var UH=D(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=GH(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),ns(u,d),$o(u);let{forceUnmount:m}=es(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),b.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),b.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,J($t))}),[m,u]);let h=d||f;return(0,Y.jsxs)(LH.Provider,{value:u,children:[s&&(0,Y.jsx)(Ko,{handle:s,store:u}),h&&(0,Y.jsx)(KH,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function WH(e){return RH(!0)?(0,Y.jsx)(UH,{props:e}):(0,Y.jsx)($i,{children:(0,Y.jsx)(UH,{props:e})})}function GH(e,t){let n=Go((e,n)=>new BH(t,e,n));return b.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function KH({store:e,modal:t}){let n=ga(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return ts(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var qH=O(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=RH(!0),h=ds(s)??m;if(!h)throw Error(F(74));let g=Js(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerPopupId`,g),S=b.useRef(null),{registerTrigger:C,isMountedByThisTrigger:w}=Qo(g,S,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),T=h.useState(`openChangeReason`),E=h.useState(`stickIfOpen`),D=h.useState(`openMethod`),O=h.useState(`focusManagerModal`),k=ws(v,{enabled:!a&&l&&(D!==`touch`||T!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:Vs(),restMs:u,delay:{close:d},triggerElementRef:S,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),A=ua(v,{stickIfOpen:E}),j=nu(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),M=h.useState(`triggerProps`,w),{getButtonProps:N,buttonRef:P}=hl({disabled:a,native:o}),I={open(e){return e&&T===`trigger-press`?ft.open(e):dt.open(e)}},{preFocusGuardRef:L,handlePreFocusGuardFocus:R,handleFocusTargetFocus:z}=Qu(h,S),B=Di(`button`,e,{state:{disabled:a,open:y},ref:[P,t,C,S],props:[A.reference,k,M,j,{[Fi]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":x},p,N],stateAttributesMapping:I}),V=(0,Y.jsx)(b.Fragment,{children:B},g);return w&&!O?(0,Y.jsxs)(b.Fragment,{children:[(0,Y.jsx)(An,{ref:L,onFocus:R}),V,(0,Y.jsx)(An,{ref:h.context.triggerFocusTargetRef,onFocus:z})]}):V}),JH=b.createContext(void 0);function YH(){let e=b.useContext(JH);if(e===void 0)throw Error(F(45));return e}var XH=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return RH().useState(`mounted`)||n?(0,Y.jsx)(JH.Provider,{value:n,children:(0,Y.jsx)(Wi,{ref:t,...r})}):null}),ZH=b.createContext(void 0);function QH(){let e=b.useContext(ZH);if(!e)throw Error(F(46));return e}var $H=b.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=Li,..._}=e,v=RH(),y=YH(),x=Zi(),S=v.useState(`floatingRootContext`),C=v.useState(`mounted`),w=v.useState(`open`),T=v.useState(`openChangeReason`),E=v.useState(`activeTriggerElement`),D=v.useState(`modal`),O=v.useState(`openMethod`),k=v.useState(`positionerElement`),A=v.useState(`instantType`),j=v.useState(`transitionStatus`),M=v.useState(`adaptiveOrigin`),P=b.useRef(null),F=Vo(k),I=Sc({anchor:a,floatingRootContext:S,positionMethod:o,mounted:C,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:x,collisionAvoidance:g,adaptiveOrigin:M}),L=S.useState(`domReferenceElement`);N(()=>{let e=L,t=P.current;if(e&&(P.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return F(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[L,F,v]);let R=D===!0&&T!==`trigger-hover`;Iu(w&&R,O===`touch`,k,E);let z=v.useStateSetter(`positionerElement`),B=Ec(e,{open:w,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:A},{styles:I.positionerStyles,transitionStatus:j,props:_,refs:[t,z],hidden:!C,inert:!w});return(0,Y.jsxs)(ZH.Provider,{value:I,children:[C&&R&&(0,Y.jsx)(Nl,{inert:Ac(!w),cutout:E}),(0,Y.jsx)(Qi,{id:x,children:B})]})}),eU=b.createContext(void 0);function tU(){let[e,t]=b.useState(0),n=X(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:b.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function nU(){let e=b.useContext(eU);N(()=>e?.register(),[e])}var rU=b.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=RH(),l=QH(),u=sl(!0)!=null,{context:d,hasClosePart:f}=tU(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);Ho({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),Ss(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?Wo(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=Di(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...Uo,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&Kc.has(e.key)&&e.stopPropagation()}},Tc(g),s],stateAttributesMapping:mt});return(0,Y.jsx)(la,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:Ce(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,Y.jsx)(eU.Provider,{value:d,children:M})})}),iU=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=RH(),s=Js(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),Di(`h2`,e,{ref:t,props:[{id:s},a]})}),aU=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=RH(),s=Js(a.id);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),Di(`p`,e,{ref:t,props:[{id:s},a]})}),oU=b.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{buttonRef:c,getButtonProps:l}=hl({disabled:a,focusableWhenDisabled:!1,native:o}),u=RH();return nU(),Di(`button`,e,{ref:[t,c],props:[{onClick(e){u.setOpen(!1,J(Pt,e.nativeEvent))}},s,l]})});function sU(e){let t=b.useRef(!0);t.current&&(t.current=!1,e())}function cU(e,t,n,r,i,a,o,s,c,l=2){let u=lr(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return ar(n.current,u)?void 0:u}var lU=b.createContext(void 0),uU=b.createContext(void 0),dU=b.createContext(void 0),fU=b.createContext(!1),pU=b.createContext(``);function mU(){let e=b.useContext(lU);if(!e)throw Error(F(22));return e}function hU(){let e=b.useContext(uU);if(!e)throw Error(F(23));return e}function gU(){let e=b.useContext(dU);if(!e)throw Error(F(24));return e}function _U(){return b.useContext(pU)}function vU(){return b.useContext(fU)}function yU(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var bU=(e,t)=>Object.is(e,t);function xU(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function SU(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!yU(e,t,(e,t)=>xU(e,t,n)):e!==t}function CU(e,t,n){return e?e.some(e=>e!==void 0&&xU(t,e,n)):!1}function wU(e,t,n){return e?e.findIndex(e=>e!==void 0&&xU(e,t,n)):-1}function TU(e,t){if(t!==bU)return n=>CU(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function EU(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(TU(t,n)):wU(e,t,n);return i===-1?null:i}function DU(e,t,n,r,i,a){return CU(r,t,i)?a!=null&&e>a&&CU(r,n[a],i)?a:e:e===a?EU(n,r,i,!0):a}function OU(e,t,n){return e.filter(e=>!xU(t,e,n))}function kU(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function AU(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function jU(e){return AU(e?.[0])}function MU(e){return jU(e)?e.flatMap(e=>e.items):e}function NU(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(jU(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function PU(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return kU(e)}function FU(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?kU(e.value):kU(e)}function IU(e,t,n){function r(){return PU(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=MU(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function LU(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,Y.jsx)(b.Fragment,{children:IU(r,t,n)},i)),e),[])}var RU={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?NU(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>xU(t,e,n)):xU(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemProps:e=>e.itemProps,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight};function zU(e){return e==null?void 0:`${e}-popup`}function BU(e,t){return(n,r)=>n!=null&&e.contains(n,r,t)}function VU(e){return Array.isArray(e)?e.map(e=>VU(e)).join(`,`):e==null?``:String(e)}var HU=new Map;function UU(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${VU(e.locale)}|${JSON.stringify(t)}`,r=HU.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),a={contains(e,t,n){if(!t)return!0;let r=PU(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=PU(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=PU(e,n),a=t.length;return r.length>=a&&i.compare(r.slice(r.length-a),t)===0}};return HU.set(n,a),a}var WU=UU;function GU(e,t=!1){let{overflowY:n}=Ie(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}var KU=Symbol(`none`),qU={value:KU,index:-1};function JU(e,t,n){let r=e.get(t);if(r!==void 0||n===bU)return r;for(let[r,i]of e)if(xU(r,t,n))return i}function YU(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:o,inputValue:s,open:c,defaultOpen:l=!1,selectionMode:u,onItemHighlighted:d,name:f,form:p,disabled:m=!1,readOnly:h=!1,required:g=!1,inputRef:_,grid:v=!1,items:y,filteredItems:x,filter:C,filterQuery:w,openOnInputClick:T=!0,autoHighlight:E=!1,keepHighlight:D=!1,highlightItemOnHover:O=!0,loopFocus:k=!0,itemToStringLabel:P,itemToStringValue:I,isItemEqualToValue:L=bU,virtualized:R=!1,inline:z=!1,fillInputOnItemPress:B=!0,modal:V=!1,limit:H=-1,autoComplete:U=`list`,formAutoComplete:ee,locale:te,submitOnItemClick:ne=!1}=e,{clearErrors:W}=_M(),{setDirty:re,validityData:ie,setFilled:ae,name:G,disabled:oe,setTouched:se,setFocused:ce,validationMode:le,validation:ue}=pM(),de=cc(),fe=CM({id:t}),pe=WU({locale:te}),me=Array.isArray(y)?null:y;if(me&&typeof me.label!=`function`)throw Error(F(100));let he=me?me.data:y,ge=me?.value,_e=ge?void 0:he,ve=b.useMemo(()=>{if(!x||!ge)return;let e=MU(x),t=e.map(ge),n;return{values:t,findItem(r,i){if(!n){n=new Map;for(let r=0;r<t.length;r+=1)n.has(t[r])||n.set(t[r],e[r])}return JU(n,r,i)}}},[x,ge]),ye=b.useMemo(()=>me?e=>me.label(e,L,e=>{let t=ve?.findItem(e,L);return t==null?PU(e,P):me.itemLabel(t)}):P,[me,P,ve,L]),be=b.useMemo(()=>me?Object.assign(e=>me.itemLabel(e),{selected:e=>PU(e,ye)}):P,[me,ye,P]);function xe(e){return PU(e,ye)}let[Se,we]=b.useState(!1),[Te,Ee]=b.useState(null),De=b.useRef(Te),Oe=b.useRef([]),ke=b.useRef([]),Ae=b.useRef(null),je=b.useRef(null),Me=b.useRef(null),Ne=b.useRef(null),Pe=b.useRef(null),Fe=b.useRef(!0),Ie=b.useRef(!1),Le=b.useRef(null),Re=b.useRef(null),ze=b.useRef(null),Ve=b.useRef(qU),He=b.useRef(null),We=b.useRef([]),Ge=b.useRef(null),Ke=oe||m,qe=G??f,Je=u===`multiple`,Ye=u===`single`,Xe=s!==void 0||o!==void 0,Ze=he!==void 0,Qe=x!==void 0,$e;$e=E===`always`?`always`:E?`input-change`:!1;let[et,tt]=jc({controlled:i,default:Je?r??j:r,name:`Combobox`,state:`selectedValue`}),nt=b.useMemo(()=>C===null?()=>!0:C===void 0?BU(pe,be):C,[C,pe,be]),rt=S(()=>Xe?o??``:Ye?xe(et):``).current,[it,at]=jc({controlled:s,default:rt,name:`Combobox`,state:`inputValue`}),[ot,st]=jc({controlled:c,default:l,name:`Combobox`,state:`open`}),ct=jU(he),lt=!ot&&Te!==null?Te:String(it).trim(),ut=Ye?xe(et):``,dt=Ye&&!Se&&lt!==``&&ut.length===lt.length&&pe.contains(ut,lt),ft=dt?``:w??lt,pt=Ze&&Qe&&dt&&(!me||me.hasValue(et,L)),mt=b.useMemo(()=>he?MU(he):j,[he]),ht=b.useMemo(()=>{if(x&&!pt)return x;if(!he)return j;if(ct){let e=he,t=[],n=0;for(let r of e){if(H>-1&&n>=H)break;let e=H>-1?H-n:1/0,i=ft===``?r.items.slice(0,e):[];if(ft!==``)for(let t of r.items){if(i.length>=e)break;nt(t,ft,be)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if(ft===``)return H>-1?mt.slice(0,H):mt;let e=[];for(let t of mt){if(H>-1&&e.length>=H)break;nt(t,ft,be)&&e.push(t)}return e},[x,pt,he,ct,ft,H,nt,be,mt]),gt=b.useMemo(()=>{if(ve&&ht===x)return ve.values;let e=MU(ht);return ge?e.map(e=>ge(e)):e},[ht,x,ve,ge]),q=S(()=>{let e=null;return z&&ot&&Ze&&u!==`none`&&(e=EU(gt,et,L,Je)),new No({id:fe,labelId:void 0,selectedValue:et,open:ot,items:_e,selectionMode:u,name:qe,form:p,disabled:Ke,readOnly:h,required:g,grid:v,virtualized:R,openOnInputClick:T,itemToStringLabel:ye,isItemEqualToValue:L,modal:V,autoHighlight:$e,submitOnItemClick:ne,hasInputValue:Xe,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:z,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemProps:M,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:u===`none`},{onOpenChangeComplete:A,setOpen:A,setInputValue:A,setSelectedValue:A,setIndices:A,handleSelection:A,forceMount:A,requestSubmit:A,listRef:Oe,labelsRef:ke,popupRef:Ae,emptyRef:Pe,inputRef:je,startDismissRef:Me,endDismissRef:Ne,keyboardActiveRef:Fe,chipsContainerRef:Le,clearRef:Re,valuesRef:We,pointerDownItemRef:Ge,selectionEventRef:ze},RU)}).current,_t=u===`none`?it:et,vt=b.useMemo(()=>u===`none`?_t:Array.isArray(et)?et.map(e=>FU(e,I)):FU(et,I),[_t,I,u,et]),yt=X(d),bt=X(n),xt=q.useState(`activeIndex`),St=q.useState(`selectedIndex`),Ct=q.useState(`positionerElement`),wt=q.useState(`listElement`),Tt=q.useState(`triggerElement`),Et=q.useState(`inputElement`),Dt=q.useState(`inputGroupElement`),kt=q.useState(`inline`),At=q.useState(`inputInsidePopup`),jt=q.useState(`inputOwnsFormValue`),Mt=Ye&&!At&&it===ut,Pt=hn(Tt),{mounted:Ft,setMounted:It,transitionStatus:zt}=Ro(ot),{openMethod:Bt,triggerProps:Ht}=ru(ot),Ut=X(()=>vt);kM(At?Pt:je,fe,_t,Ut,!Ke,f);let Wt=X(()=>{he?ke.current=gt.map(xe):q.set(`forceMounted`,!0)}),qt=X((e,t,n)=>{if(t===-1){if(Ve.current===qU)return;Ve.current=qU}else Ve.current={value:e,index:t};yt(e,en(n,void 0,{index:t}))}),Jt=X(e=>{let t={};e.activeIndex!==void 0&&(t.activeIndex=e.activeIndex),e.selectedIndex!==void 0&&(t.selectedIndex=e.selectedIndex),q.update(t);let n=e.activeIndex;if(n===void 0)return;let r=e.type||`none`;n===null?qt(void 0,-1,r):qt(We.current[n],n,r)}),Yt=X((t,n)=>{if(e.onInputValueChange?.(t,n),!n.isCanceled){if(Ie.current=n.reason===Rt,n.reason===`input-change`){ot&&Te!==null&&Ee(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&we(!0),He.current={hasQuery:e};let n=q.state.listElement;if(!q.state.virtualized&&n){let e=Ae.current;for(let t of Be(n.firstElementChild??n)){if(!Ce(t)||(e?!K(e,t):t.getAttribute(`role`)===`dialog`))break;if(GU(t)){t.scrollTop=0;break}}}e&&$e&&q.state.activeIndex==null&&(ot||kt)&&q.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&q.state.inputInsidePopup&&(He.current={hasQuery:!1,selection:!0});at(t)}}),Xt=X(e=>{let t=!e&&At&&!kt&&it!==``&&(String(it).trim()===Te||it===ut);!e&&(t||it===``||Mt)&&we(!1),Ee(null),t&&Yt(``,J(Rt))}),Zt=X((t,n)=>{if(ot!==t&&(n.reason===`escape-key`&&Ze&&gt.length===0&&!Pe.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(t&&Te!==null&&Xt(n.reason===Lt),!t&&Se&&(Ye?(kt||Ee(lt),lt===``&&we(!1)):Je&&(kt||Ee(lt),At&&Jt({activeIndex:null}),(!At||kt)&&Yt(``,J(Rt,n.event,void 0,{isItemPress:n.reason===Nt})))),st(t),!t&&At&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(se(!0),ce(!1),le===`onBlur`)))){let e=u===`none`?it:et;ue.commit(e)}}),Qt=X((e,t)=>{a?.(e,t),!t.isCanceled&&(tt(e),(u===`none`&&Ae.current&&B||Ye&&!q.state.inputInsidePopup)&&Yt(xe(e),J(t.reason,t.event)))}),$t=X((e,t)=>{let n=Ue(e),r=ze.current??e;ze.current=null;let i=J(Nt,r),a=n?.closest(`a`)?.getAttribute(`href`);if(a){a.startsWith(`#`)&&Zt(!1,i);return}if(Je){let e=Array.isArray(et)?et:[],n=CU(e,t,L),r=n?OU(e,t,L):[...e,t];if(Qt(r,i),i.isCanceled||!(je.current&&je.current.value.trim()!==``))return;if(q.state.inputInsidePopup){Yt(``,J(Rt,i.event,void 0,{isItemPress:!0}));let e=He.current;e&&!n&&(e.toggledValue=t)}else Zt(!1,i)}else{if(Qt(t,i),i.isCanceled)return;Zt(!1,i)}}),tn=X(()=>{let e=ue.inputRef.current?.form??q.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),nn=X(()=>{if(It(!1),bt?.(!1),we(!1),Ee(null),Jt(u===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Je&&je.current&&je.current.value!==``&&!Ie.current&&Yt(``,J(Rt)),Ye){if(q.state.inputInsidePopup)je.current&&je.current.value!==``&&Yt(``,J(Rt));else{let e=xe(et);je.current&&je.current.value!==e&&Yt(e,J(e===``?Rt:Ot))}}}),rn=b.useMemo(()=>kt&&Ct?{current:Ct.closest(`[role="dialog"]`)}:Ae,[kt,Ct]);Ho({enabled:!e.actionsRef,open:ot,ref:rn,onComplete(){ot||nn()}}),b.useImperativeHandle(e.actionsRef,()=>({unmount:nn}),[nn]),N(function(){let e=De.current!==null&&Te===null;if(De.current=Te,ot&&(!e||!Ze)||(ot||(Ge.current=null),u===`none`))return;let t=Ze?gt:We.current;Jt({selectedIndex:EU(t,et,L,Je)})},[ot,Te,et,u,Je,Ze,gt,L,Jt]),N(()=>{he&&(We.current=gt,Oe.current.length=gt.length)},[he,gt]),N(()=>{let e=He.current;if(e){let t=ot||kt||q.state.positionerElement?.hidden===!1;if(e.hasQuery)$e&&t&&q.set(`activeIndex`,0),He.current=null;else if(String(it).trim()===``&&(He.current=null,t)){let t=e.selection;$e===`always`&&!t&&q.state.selectionMode===`none`&&q.set(`activeIndex`,0),queueMicrotask(()=>{if(!q.state.open&&!q.state.inline||je.current&&je.current.value.trim()!==``)return;let n=q.state.selectedValue,r=q.state.selectionMode===`multiple`;if(r&&Array.isArray(n)?n.length>0:q.state.selectionMode!==`none`&&n!=null){let t=Ze||Qe?gt:We.current,i=wU(t,e.toggledValue,q.state.isItemEqualToValue);q.set(`activeIndex`,i===-1?EU(t,n,q.state.isItemEqualToValue,r):i)}else t?q.set(`activeIndex`,null):$e===`always`&&q.set(`activeIndex`,0)})}}if(!ot&&!kt)return;let t=Ze||Qe?gt:We.current,n=q.state.activeIndex;if(n==null){if($e===`always`&&t.length>0){q.set(`activeIndex`,0);return}qt(void 0,-1,Ot);return}if(n>=t.length){qt(void 0,-1,Ot),q.set(`activeIndex`,null);return}let r=t[n],i=Ve.current.value,a=i!==KU&&xU(r,i,q.state.isItemEqualToValue);(Ve.current.index!==n||!a)&&qt(r,n,Ot)},[xt,$e,qt,Qe,Ze,gt,kt,ot,q,it]),N(()=>{if(u===`none`){ae(String(it)!==``);return}ae(Je?Array.isArray(et)&&et.length>0:et!=null)},[ae,u,it,et,Je]),b.useEffect(()=>{Ze&&$e&&gt.length===0&&Jt({activeIndex:null})},[Ze,$e,gt.length,Jt]);function an(){ot&&lt!==``&&lt!==String(rt)&&!Mt&&we(!0)}function on(){ot&&Te!==null&&Xt(!1)}let sn=!1;function cn(){!sn&&it!==ut&&(sn=!0,Yt(ut,J(Ot)))}function un(){u!==`none`&&(W(qe),re(SU(et,ie.initialValue,L)),ue.change(et),Ye&&!Xe&&!At&&cn())}function dn(){Ye&&!Xe&&!At&&!Se&&cn()}function fn(){u===`none`&&(W(qe),re(it!==ie.initialValue),ue.change(it))}tu(lt,an),tu(ot,on),tu(et,un),tu(ut,dn),tu(he,dn),tu(it,fn);let pn=fs({open:kt?!0:ot,onOpenChange:Zt,elements:{reference:At?Tt:Et,floating:Ct}}),mn=v?`grid`:`listbox`,gn=ot||kt,_n=gn?`true`:`false`,vn=b.useMemo(()=>{let e=Et?.tagName===`INPUT`,t=Et==null||e,n=t||gn,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=_n,r[`aria-haspopup`]=mn,r[`aria-controls`]=gn?wt?.id:void 0,r[`aria-autocomplete`]=h?`none`:U),{reference:r,floating:{role:`presentation`}}},[Et,gn,_n,mn,wt?.id,U,h]),yn=ua(pn,{enabled:!Ke&&T,event:`mousedown-only`,toggle:!1,touchOpenDelay:At?0:100,reason:Vt}),bn=ga(pn,{enabled:!Ke&&!kt,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:kt?!0:void 0,outsidePress(e){let t=Ue(e);return!K(Tt,t)&&!K(Re.current,t)&&!K(Le.current,t)&&!K(Dt,t)}}),xn=Ms(pn,{enabled:!Ke,id:fe,listRef:Oe,activeIndex:xt,selectedIndex:St,virtual:!0,loopFocus:k,allowEscape:k&&!$e,focusItemOnOpen:Se||u===`none`&&!$e?!1:`auto`,focusItemOnHover:O,resetOnPointerLeave:!D,orientation:v?`horizontal`:void 0,rtl:de===`rtl`,disabledIndices:j,grid:v?cU:void 0,onNavigate(e,t){(t||ot)&&zt!==`ending`&&Jt(t?{activeIndex:e,type:Fe.current?Gt:Kt}:{activeIndex:e})}}),Sn=b.useMemo(()=>pi(xn.reference,{onKeyDown(e){v&&q.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},bn.reference,yn.reference,vn.reference),[xn.reference,bn.reference,yn.reference,vn.reference,v,q]),Cn=b.useMemo(()=>pi(Uo,bn.floating),[bn.floating]),wn=b.useMemo(()=>pi(xn.floating,vn.floating),[xn.floating,vn.floating]),Tn=b.useMemo(()=>{let e=xn.item;return e?{...e,onFocus:void 0}:M},[xn.item]);q.useContextCallback(`setOpen`,Zt),q.useContextCallback(`setInputValue`,Yt),q.useContextCallback(`setSelectedValue`,Qt),q.useContextCallback(`setIndices`,Jt),q.useContextCallback(`handleSelection`,$t),q.useContextCallback(`forceMount`,Wt),q.useContextCallback(`requestSubmit`,tn),q.useContextCallback(`onOpenChangeComplete`,n),sU(()=>{q.update({inline:z,popupProps:Cn,listProps:wn,inputProps:Sn,triggerProps:Ht,itemProps:Tn})});let En={id:fe,selectedValue:et,open:ot,mounted:Ft,transitionStatus:zt,items:_e,inline:z,popupProps:Cn,listProps:wn,inputProps:Sn,triggerProps:Ht,itemProps:Tn,openMethod:Bt,selectionMode:u,name:qe,form:p,disabled:Ke,readOnly:h,required:g,grid:v,virtualized:R,openOnInputClick:T,itemToStringLabel:ye,modal:V,autoHighlight:$e,isItemEqualToValue:L,submitOnItemClick:ne,hasInputValue:Xe};N(()=>{q.update({...En,inputOwnsFormValue:u===`none`&&(z||!q.state.inputInsidePopup)})},[q,...Object.values(En)]);let Dn=ln(_,ue.inputRef),An=b.useMemo(()=>({query:lt,hasItems:Ze,filteredItems:ht,flatFilteredValues:gt}),[lt,Ze,ht,gt]),jn=b.useMemo(()=>Array.isArray(_t)?``:FU(_t,I),[_t,I]),Mn=Je&&Array.isArray(et)&&et.length>0,Nn=Je||u===`none`&&jt?void 0:qe,Pn=b.useMemo(()=>!Je||!Array.isArray(et)||!qe?null:et.map(e=>{let t=FU(e,I);return(0,Y.jsx)(`input`,{type:`hidden`,form:p,name:qe,value:t,disabled:Ke},t)}),[Je,et,p,qe,I,Ke]),Fn=(0,Y.jsxs)(b.Fragment,{children:[e.children,(0,Y.jsx)(`input`,{...ue.getValidationProps(Ke,{onFocus(){if(At){Tt?.focus();return}(je.current||Tt)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||Ke||h)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=J(Ot,e.nativeEvent),i=()=>We.current.findIndex(e=>FU(e,I).toLowerCase()===n||xe(e).toLowerCase()===n);function a(){if(Je)return;if(u===`none`){Yt(t,r);return}let e=i();e===-1&&(e=We.current.findIndex((e,t)=>{let r=ke.current[t];return r!=null&&r.toLowerCase()===n}));let a=e===-1?void 0:We.current[e];a!=null&&Qt?.(a,r)}Ye&&(Wt(),he&&i()===-1&&q.set(`forceMounted`,!0)),queueMicrotask(a)}}),id:fe&&Nn==null?`${fe}-hidden-input`:void 0,form:p,name:Nn,autoComplete:ee,disabled:Ke,required:g&&!Mn,readOnly:h,value:jn,ref:Dn,style:Nn?kn:On,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Pn]});return(0,Y.jsx)(lU.Provider,{value:q,children:(0,Y.jsx)(uU.Provider,{value:pn,children:(0,Y.jsx)(fU.Provider,{value:Ze,children:(0,Y.jsx)(dU.Provider,{value:An,children:(0,Y.jsx)(pU.Provider,{value:it,children:Fn})})})})})}function XU(e){let{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:a,...o}=e;return(0,Y.jsx)(YU,{...o,selectionMode:t?`multiple`:`single`,selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:a})}function ZU(e){return e==null?void 0:`${e}-label`}function QU(e,t){return e??t}var $U=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=a;delete o.id;let s=pM(),c=mU(),l=c.useState(`inputInsidePopup`),u=c.useState(`triggerElement`);c.useState(`inputElement`);let d=c.useState(`id`),f=TM({id:ZU(d),fallbackControlId:u?.id??(l?d:void 0),setLabelId(e){let t=typeof e==`function`?e(c.state.labelId):e;c.set(`labelId`,t)}});return Di(`div`,e,{ref:t,state:s.state,props:[f,a],stateAttributesMapping:uM})});function eW(e){let{children:t,placeholder:n}=e,r=mU(),i=r.useState(`itemToStringLabel`),a=r.useState(`selectedValue`),o=r.useState(`items`),s=r.useState(`selectionMode`)===`multiple`,c=r.useState(`hasSelectedValue`),l=!c&&n!=null&&t==null,u=r.useState(`hasNullItemLabel`,l),d=null;return d=typeof t==`function`?t(a):t??(!c&&n!=null&&!u?n:s&&Array.isArray(a)?LU(a,o,i):IU(a,o,i)),(0,Y.jsx)(b.Fragment,{children:d})}var tW=`data-popup-side`,nW=`data-list-empty`,rW={...ft,...uM,popupSide:e=>e?{[tW]:e}:null,listEmpty:e=>e?{[nW]:``}:null},iW=b.createContext(void 0);function aW(){return b.useContext(iW)}var oW=b.createContext(void 0);function sW(e){let t=b.useContext(oW);if(t===void 0&&!e)throw Error(F(21));return t}var cW=b.forwardRef(function(e,t){let n=mU(),{buttonRef:r,getButtonProps:i}=hl({native:!1}),a=ln(t,r);function o(e){n.context.setOpen(!1,J(Pt,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return(0,Y.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:kn})});function lW(e){let t=e.useState(`mounted`),n=e.useState(`popupSide`),r=e.useState(`positionerElement`);return t&&r?n:null}function uW(){return gU().filteredItems.length===0}function dW(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function fW(e,t){let n=e>=t-1?t-2:e;return n>=0?n:void 0}function pW(e,t,n){let r=e.context.listRef.current[t];r&&(e.context.selectionEventRef.current=n,r.click(),e.context.selectionEventRef.current=null)}var mW=b.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:o,...s}=e,{state:c,disabled:l,setTouched:u,setFocused:d,validationMode:f,validation:p}=pM(),{labelId:m}=yM(),h=aW(),g=!!sW(!0),_=mU(),v=_U(),y=cc(),x=_.useState(`required`),S=_.useState(`disabled`),C=_.useState(`readOnly`),w=_.useState(`name`),T=_.useState(`form`),E=_.useState(`selectionMode`),D=_.useState(`autoHighlight`),O=_.useState(`inputProps`),k=_.useState(`triggerProps`),A=_.useState(`open`),j=_.useState(`mounted`),M=_.useState(`selectedValue`),N=_.useState(`id`),P=_.useState(`inline`),F=_.useState(`modal`),I=!!D,L=lW(_),R=l||S||i,z=uW(),B=g||P,V=!B||F,H=Js(a??(B?void 0:N)),U=g?cM:c,[ee,te]=b.useState(null),ne=b.useRef(!1),W=b.useRef(null),re=b.useRef(!1),ie=E===`none`&&!g,G=X(e=>{let t=g||_.state.inline;t&&!_.state.hasInputValue&&_.context.setInputValue(``,J(Ot)),_.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:ie})}),oe=g?s:p.getValidationProps(R,s);function se(){_.context.setIndices({activeIndex:null,selectedIndex:null,type:_.context.keyboardActiveRef.current?Gt:Kt})}function le(){_.context.keyboardActiveRef.current=!1}let ue={...U,open:A,disabled:R,readOnly:C,popupSide:L,listEmpty:z};function fe(e){if(!h)return;let t,{highlightedChipIndex:n}=h,r=h.chipsRef.current.length,[i,a]=dW(y);return n===void 0?(e.key===i&&(e.currentTarget.selectionStart??0)===0&&M.length>0&&(e.preventDefault(),t=r>0?r-1:void 0),t):(e.key===i?(e.preventDefault(),t=n>0?n-1:void 0):e.key===a?(e.preventDefault(),t=n<r-1?n+1:void 0):(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),t=fW(n,M.length),se()),t)}let pe=Di(`input`,e,{state:ue,ref:[t,_.context.inputRef,G],props:[O,k,{value:ee??v,"aria-readonly":C||void 0,"aria-required":x||void 0,"aria-labelledby":m,disabled:R,readOnly:C,required:E===`none`?x:void 0,form:T,...ie&&w&&{name:w},id:H,onFocus(){if(d(!0),!P||!re.current)return;re.current=!1;let e=W.current;e!=null&&Object.hasOwn(_.context.valuesRef.current,e)&&_.context.setIndices({activeIndex:e})},onBlur(){u(!0),d(!1);let e=_.state.activeIndex;if(P&&e!==null&&D!==`always`&&(W.current=e,re.current=!0,_.context.setIndices({activeIndex:null})),f===`onBlur`){let e=E===`none`?v:M;p.commit(e)}},onCompositionStart(e){ae||(ne.current=!0,te(e.currentTarget.value))},onCompositionEnd(e){ne.current=!1;let t=e.currentTarget.value;te(null),_.context.setInputValue(t,J(Lt,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=ne.current||!r;function a(e){!C&&!R&&e&&i&&(_.context.setOpen(!0,J(Lt,t)),I||se())}if(ne.current){let n=e.currentTarget.value;te(n),n===``&&!_.state.openOnInputClick&&!_.state.inputInsidePopup&&_.context.setOpen(!1,J(Rt,t));let r=n.trim(),i=I&&r!==``;a(r),A&&_.state.activeIndex!==null&&!i&&se();return}let o=J(Lt,t);if(_.context.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=J(Rt,t);s&&!_.state.inputInsidePopup&&(E===`single`&&_.context.setSelectedValue(null,c),_.state.openOnInputClick||_.context.setOpen(!1,c)),a(e.currentTarget.value.trim()),A&&_.state.activeIndex!==null&&!I&&se()},onKeyDown(e){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(_.context.keyboardActiveRef.current=!0,R||C){C&&e.key===`Enter`&&A&&_.state.activeIndex!==null&&de(e);return}let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=y===`rtl`;if(e.key===`Home`){de(e);let n=ce&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){de(e);let i=ce&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!j&&e.key===`Escape`){let t=E===`multiple`&&Array.isArray(M)?M.length===0:M===null,n=J(Ut,e.nativeEvent),r=E===`multiple`?[]:null;_.context.setInputValue(``,n),_.context.setSelectedValue(r,n),!t&&!_.state.inline&&!n.isPropagationAllowed&&e.stopPropagation();return}if(h&&e.key===`Backspace`&&t.value===``&&h.highlightedChipIndex===void 0&&Array.isArray(M)&&M.length>0){let t=h.chipsRef.current.length,n=t>0?t-1:M.length-1,r=M.filter((e,t)=>t!==n);se(),_.context.setSelectedValue(r,J(Ot,e.nativeEvent));return}let i=h?.highlightedChipIndex!==void 0,a=fe(e);if(h?.setHighlightedChipIndex(a),a===void 0?i&&_.context.inputRef.current?.focus():h?.chipsRef.current[a]?.focus(),e.which!==229&&e.key===`Enter`&&A){let t=_.state.activeIndex,n=e.nativeEvent;if(t===null){if(P)return;_.context.setOpen(!1,J(Ot,n));return}de(e),pW(_,t,n)}},onPointerMove:le,onPointerDown:le},oe],stateAttributesMapping:rW}),me=g?(0,Y.jsx)(fM.Provider,{value:dM,children:pe}):pe;return(0,Y.jsxs)(b.Fragment,{children:[A&&V&&(0,Y.jsx)(cW,{ref:_.context.startDismissRef}),me]})}),hW=b.forwardRef(function(e,t){let{render:n,className:r,nativeButton:i=!0,disabled:a=!1,id:o,style:s,...c}=e,{state:l,disabled:u,setTouched:d,setFocused:f,validationMode:p,validation:m}=pM(),{labelId:h}=yM(),g=mU(),_=g.useState(`selectionMode`),v=g.useState(`disabled`),y=g.useState(`readOnly`),x=g.useState(`required`),S=g.useState(`positionerElement`),C=g.useState(`listElement`),w=g.useState(`popupId`),T=g.useState(`triggerProps`),E=g.useState(`inputInsidePopup`),D=g.useState(`id`),O=g.useState(`labelId`),k=g.useState(`open`),A=g.useState(`selectedValue`),j=g.useState(`activeIndex`),M=g.useState(`selectedIndex`),N=g.useState(`hasSelectedValue`),P=hU(),F=_U(),I=V(),L=u||v||a,R=uW(),z=lW(g);CM({id:E?o:void 0});let B=E?o??D:o,H=QU(h,O),U;k&&E?U=w??zU(D):k&&(U=C?.id);let ee=b.useRef(``);function te(e){ee.current=e.pointerType}let{reference:ne}=Ns(P,{enabled:!k&&!y&&!v&&_===`single`,listRef:g.context.labelsRef,activeIndex:j,selectedIndex:M,onMatch(e){let t=g.context.valuesRef.current[e];t!==void 0&&g.context.setSelectedValue(t,J(Ot))}}),{reference:W}=ua(P,{enabled:!v,event:`mousedown`}),{buttonRef:re,getButtonProps:ie}=hl({native:i,disabled:L}),ae={...l,readOnly:y,open:k,disabled:L,popupSide:z,listEmpty:R,placeholder:_!==`none`&&!N};return Di(`button`,e,{ref:[t,re,X(e=>{g.set(`triggerElement`,e)})],state:ae,props:[T,W,ne,{id:B,tabIndex:E?0:-1,role:E?`combobox`:void 0,"aria-expanded":k,"aria-haspopup":E?`dialog`:`listbox`,"aria-controls":U,"aria-required":E&&x||void 0,"aria-readonly":E&&y||void 0,"aria-labelledby":H,onPointerDown:te,onPointerEnter:te,onFocus(){f(!0),!L&&I.start(0,g.context.forceMount)},onBlur(e){if(!K(S,e.relatedTarget)&&(d(!0),f(!1),p===`onBlur`)){let e=_===`none`?F:A;m.commit(e)}},onMouseDown(e){if(L||(E||P.set(`domReferenceElement`,e.currentTarget),g.context.forceMount(),ee.current!==`touch`&&(g.context.inputRef.current?.focus(),E||e.preventDefault()),k))return;let t=En(e.currentTarget);function n(e){let t=g.state.triggerElement;if(!t)return;let n=Ue(e),r=g.state.positionerElement,i=g.state.listElement;K(t,n)||K(r,n)||K(i,n)||Yu(e,t)||g.context.setOpen(!1,J(Jt,e))}E&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(de(e),g.context.setOpen(!0,J(Wt,e.nativeEvent)),g.context.inputRef.current?.focus())}},m.getValidationProps(L,c),ie],stateAttributesMapping:rW})}),gW=b.createContext(null);function _W(){return b.useContext(gW)}function vW(e){let{children:t,items:n}=e,r=b.useMemo(()=>({items:n}),[n]);return(0,Y.jsx)(gW.Provider,{value:r,children:t})}function yW(e){let{children:t}=e,{filteredItems:n}=gU(),r=_W(),i=r?r.items:n;return(0,Y.jsx)(b.Fragment,{children:i.map(t)})}var bW=b.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=mU(),l=hU(),u=!!sW(!0),{filteredItems:d,hasItems:f}=gU(),p=c.useState(`selectionMode`),m=c.useState(`grid`),h=c.useState(`readOnly`),g=c.useState(`listProps`),_=c.useState(`virtualized`),v=c.useState(`forceMounted`),y=p===`multiple`,x=d.length===0,S=X(e=>{c.set(`positionerElement`,e)}),C=X(e=>{c.set(`listElement`,e)}),w=b.useMemo(()=>typeof o==`function`?n||=(0,Y.jsx)(yW,{children:o}):o,[o]),T={empty:x},E=l.useState(`floatingId`),D=Di(`div`,e,{state:T,ref:[t,C,u?null:S],props:[g,{children:w,tabIndex:-1,id:E,role:m?`grid`:`listbox`,"aria-multiselectable":y?`true`:void 0,"aria-readonly":!m&&h?!0:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;de(e),pW(c,t,e.nativeEvent)}},onKeyDownCapture(){c.context.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.context.keyboardActiveRef.current=!1}},s]});if(_)return D;let O=f&&!v?void 0:c.context.labelsRef;return(0,Y.jsx)(Pc,{elementsRef:c.context.listRef,labelsRef:O,children:D})}),xW=`⁠`;function SW(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=null;for(;t.nextNode();){let e=t.currentNode;e.nodeValue!==``&&(n=e)}return n}function CW(){let e=V(),t=b.useRef(null);return b.useEffect(()=>{if(re)return;let n=t.current;if(n==null)return;let r=SW(n);if(r==null)return;let i=r.data,a=`${i}${xW}`;return r.nodeValue=a,e.start(200,()=>{r.nodeValue===a&&(r.nodeValue=i)}),()=>{e.clear(),r.nodeValue===a&&(r.nodeValue=i)}},[t,e]),t}var wW=b.createContext(void 0);function TW(){let e=b.useContext(wW);if(e===void 0)throw Error(F(20));return e}var EW=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=mU(),a=i.useState(`mounted`),o=i.useState(`forceMounted`);return a||n||o?(0,Y.jsx)(wW.Provider,{value:n,children:(0,Y.jsx)(Wi,{ref:t,...r})}):null}),DW=b.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m=!1,collisionAvoidance:h=Ii,style:g,..._}=e,v=mU(),y=hU(),b=TW(),x=v.useState(`modal`),S=v.useState(`open`),C=v.useState(`mounted`),w=v.useState(`openMethod`),T=v.useState(`positionerElement`),E=v.useState(`triggerElement`),D=v.useState(`inputElement`),O=v.useState(`inputGroupElement`),k=v.useState(`inputInsidePopup`),A=v.useState(`transitionStatus`),j=uW(),M=Sc({anchor:i??(k?E:O??D),floatingRootContext:y,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,lazyFlip:!0});Iu(S&&x,w===`touch`,T,E);let P={open:S,side:M.side,align:M.align,anchorHidden:M.anchorHidden,empty:j};N(()=>{v.set(`popupSide`,M.side)},[v,M.side]);let F=X(e=>{v.set(`positionerElement`,e)}),I=Ec(e,P,{styles:M.positionerStyles,transitionStatus:A,props:_,refs:[t,F],hidden:!C,inert:!S});return(0,Y.jsxs)(oW.Provider,{value:M,children:[C&&x&&(0,Y.jsx)(Nl,{inert:Ac(!S),cutout:O??D??E}),I]})}),OW={...pt,...et},kW=b.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=mU(),l=sW(),u=hU(),d=c.useState(`mounted`),f=c.useState(`open`),p=c.useState(`openMethod`),m=c.useState(`popupProps`),h=c.useState(`transitionStatus`),g=c.useState(`inputInsidePopup`),_=c.useState(`inputElement`),v=c.useState(`modal`),y=c.useState(`id`),x=uW(),S=s.id??(g?zU(y):void 0);N(()=>(c.set(`popupId`,c.context.popupRef.current?.id||S),()=>{c.set(`popupId`,void 0)}),[c,S]),Ho({open:f,ref:c.context.popupRef,onComplete(){f&&c.context.onOpenChangeComplete(!0)}});let C=Di(`div`,e,{state:{open:f,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:x},ref:[t,c.context.popupRef],props:[m,{id:S,role:g?`dialog`:`presentation`,onFocus(e){let t=Ue(e.nativeEvent);p!==`touch`&&(K(c.state.listElement,t)||t===e.currentTarget)&&c.context.inputRef.current?.focus()}},Tc(h),s],stateAttributesMapping:OW}),w=a===void 0?g?e=>e===`touch`?c.context.popupRef.current:_:!1:a,T;T=o??(g?void 0:!1);let E=!g||v;return(0,Y.jsx)(la,{context:u,disabled:!d,modal:E,openInteractionType:p,initialFocus:w,returnFocus:T,getInsideElements:()=>[c.context.startDismissRef.current,c.context.endDismissRef.current],children:(0,Y.jsxs)(b.Fragment,{children:[C,E&&(0,Y.jsx)(cW,{ref:c.context.endDismissRef})]})})}),AW=b.createContext(void 0);function jW(){let e=b.useContext(AW);if(e===void 0)throw Error(F(18));return e}var MW=b.forwardRef(function(e,t){let{render:n,className:r,style:i,items:a,...o}=e,s=mU().useState(`grid`),[c,l]=b.useState(),u=b.useMemo(()=>({labelId:c,setLabelId:l,items:a}),[c,l,a]),d=Di(`div`,e,{ref:t,props:[{role:s?`rowgroup`:`group`,"aria-labelledby":c},o]}),f=(0,Y.jsx)(AW.Provider,{value:u,children:d});return a?(0,Y.jsx)(vW,{items:a,children:f}):f}),NW=b.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{setLabelId:s}=jW(),c=Js(a);return N(()=>(s(c),()=>{s(e=>e===c?void 0:e)}),[c,s]),Di(`div`,e,{ref:t,props:[{id:c,"aria-hidden":!0},o]})}),PW=b.createContext(void 0);function FW(){let e=b.useContext(PW);if(!e)throw Error(F(19));return e}var IW=b.createContext(!1);function LW(){return b.useContext(IW)}function RW(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:i}=e,{render:a,className:o,style:s,value:c=null,index:l,disabled:u=!1,nativeButton:d=!1,...f}=t,p=b.useRef(null),m=vl({guess:!0,index:l,textRef:p}),h=mU(),g=LW(),_=vU(),v=h.useState(`selectionMode`),y=h.useState(`disabled`),x=h.useState(`readOnly`),S=h.useState(`isItemEqualToValue`),C=y||u,w=v!==`none`,T=l??i??m.index,E=T!==-1,D=h.useState(`id`),O=h.useState(`isActive`,T),k=h.useState(`isSelected`,c),A=h.useState(`itemProps`),j=b.useRef(null),M=D!=null&&E?`${D}-${T}`:void 0,P=k&&w;N(()=>{if(!E||!r&&l==null)return;let e=h.context.listRef.current;return e[T]=j.current,()=>{delete e[T]}},[E,r,T,l,h]),N(()=>{if(!E||_)return;let e=h.context.valuesRef.current;return e[T]=c,()=>{delete e[T]}},[E,_,T,c,h]),N(()=>{if(!E||_)return;let e=h.state.selectedValue,t=h.state.selectedIndex;h.state.selectionMode===`multiple`&&Array.isArray(e)?t=DU(T,c,h.context.valuesRef.current,e,S,t):xU(c,e,S)&&(t=T),h.set(`selectedIndex`,t)},[E,_,h,T,c,S]);let{getButtonProps:F,buttonRef:I}=hl({disabled:C,focusableWhenDisabled:!0,native:d,composite:!0}),L={disabled:C,selected:P,highlighted:O};function R(e){function t(){h.context.handleSelection(e,c)}h.state.submitOnItemClick?(zi.flushSync(t),h.context.requestSubmit()):t()}let z={id:M,role:g?`gridcell`:`option`,"aria-selected":w?P:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(h.context.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){C||x||R(e.nativeEvent)},onMouseUp(e){let t=h.context.pointerDownItemRef.current===e.currentTarget;h.context.pointerDownItemRef.current=null,!(C||x||e.button!==0||t||!O)&&R(e.nativeEvent)}},B=Di(`div`,t,{ref:[I,n,m.ref,j],state:L,props:[A,z,f,F]}),V=b.useMemo(()=>({selected:P,textRef:p}),[P,p]);return(0,Y.jsx)(PW.Provider,{value:V,children:B})}function zW(e){let{componentProps:t,forwardedRef:n}=e,r=mU().useState(`isItemEqualToValue`),{flatFilteredValues:i}=gU(),a=wU(i,t.value??null,r);return(0,Y.jsx)(RW,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:a})}var BW=b.memo(b.forwardRef(function(e,t){let n=mU().useState(`virtualized`);return n&&e.index==null?(0,Y.jsx)(zW,{componentProps:e,forwardedRef:t}):(0,Y.jsx)(RW,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})})),VW=b.forwardRef(function(e,t){let{selected:n}=FW();return e.keepMounted||n?(0,Y.jsx)(HW,{...e,ref:t}):null}),HW=b.memo(b.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=FW(),c=b.useRef(null),{transitionStatus:l,setMounted:u}=Ro(s),d=Di(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:et});return Ho({batch:!0,enabled:!s,open:s,ref:c,onComplete(){s||u(!1)}}),d})),UW=b.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{filteredItems:s}=gU(),c=mU(),l=CW(),u=s.length===0?a:null;return Di(`div`,e,{ref:[t,c.context.emptyRef,l],props:[{children:u,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})});function WW(e){let t=(0,kA.c)(13),{label:n,children:r,onClick:i,disabled:a,pressed:o,className:s}=e,c=s===void 0?``:s,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Y.jsx)(bu,{}),t[0]=l):l=t[0];let u=`icon-button ${c}`,d;t[1]!==r||t[2]!==a||t[3]!==n||t[4]!==i||t[5]!==o||t[6]!==u?(d=(0,Y.jsx)(ec,{render:l,className:u,"aria-label":n,"aria-pressed":o,disabled:a,onClick:i,children:r}),t[1]=r,t[2]=a,t[3]=n,t[4]=i,t[5]=o,t[6]=u,t[7]=d):d=t[7];let f;t[8]===n?f=t[9]:(f=(0,Y.jsx)(ic,{children:(0,Y.jsx)(Dc,{sideOffset:8,children:(0,Y.jsx)(Oc,{className:`tooltip`,children:n})})}),t[8]=n,t[9]=f);let p;return t[10]!==d||t[11]!==f?(p=(0,Y.jsxs)(Ks,{children:[d,f]}),t[10]=d,t[11]=f,t[12]=p):p=t[12],p}function GW(e){let t=(0,kA.c)(35),{label:n,value:r,groups:i,onChange:a}=e,o;if(t[0]!==i||t[1]!==r){let e;t[3]===r?e=t[4]:(e=e=>e.value===r,t[3]=r,t[4]=e),o=i.flatMap(XW).find(e),t[0]=i,t[1]=r,t[2]=o}else o=t[2];let s=o,c;t[5]===i?c=t[6]:(c=i.filter(YW),t[5]=i,t[6]=c);let l;t[7]!==s||t[8]!==r?(l=s||{value:r,label:r},t[7]=s,t[8]=r,t[9]=l):l=t[9];let u;t[10]===a?u=t[11]:(u=e=>{e&&a(e.value)},t[10]=a,t[11]=u);let d;t[12]===n?d=t[13]:(d=(0,Y.jsx)($U,{className:`control-label`,children:n}),t[12]=n,t[13]=d);let f,p,m;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(wj,{}),p=(0,Y.jsx)(`span`,{children:(0,Y.jsx)(eW,{})}),m=(0,Y.jsx)(hj,{}),t[14]=f,t[15]=p,t[16]=m):(f=t[14],p=t[15],m=t[16]);let h;t[17]===n?h=t[18]:(h=(0,Y.jsxs)(hW,{className:`branch-trigger`,"aria-label":n,children:[f,p,m]}),t[17]=n,t[18]=h);let g;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Y.jsx)(Ej,{}),t[19]=g):g=t[19];let _;t[20]===n?_=t[21]:(_=n.toLowerCase(),t[20]=n,t[21]=_);let v=`Search ${_}`,y;t[22]===v?y=t[23]:(y=(0,Y.jsxs)(`div`,{className:`search-field`,children:[g,(0,Y.jsx)(mW,{"aria-label":v,placeholder:`Find a branch…`})]}),t[22]=v,t[23]=y);let b,x;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Y.jsx)(UW,{className:`popup-empty`,children:`No matching branches.`}),x=(0,Y.jsx)(bW,{className:`option-list`,children:KW}),t[24]=b,t[25]=x):(b=t[24],x=t[25]);let S;t[26]===y?S=t[27]:(S=(0,Y.jsx)(EW,{children:(0,Y.jsx)(DW,{sideOffset:6,align:`start`,className:`floating`,children:(0,Y.jsxs)(kW,{className:`popup branch-popup`,children:[y,b,x]})})}),t[26]=y,t[27]=S);let C;return t[28]!==S||t[29]!==c||t[30]!==l||t[31]!==u||t[32]!==d||t[33]!==h?(C=(0,Y.jsxs)(XU,{items:c,value:l,onValueChange:u,isItemEqualToValue:JW,limit:60,children:[d,h,S]}),t[28]=S,t[29]=c,t[30]=l,t[31]=u,t[32]=d,t[33]=h,t[34]=C):C=t[34],C}function KW(e){return(0,Y.jsxs)(MW,{items:e.items,className:`option-group`,children:[(0,Y.jsx)(NW,{className:`option-group-label`,children:e.value}),(0,Y.jsx)(yW,{children:qW})]},e.value)}function qW(e){return(0,Y.jsxs)(BW,{className:`option`,value:e,children:[(0,Y.jsx)(wj,{}),(0,Y.jsx)(`span`,{children:e.label}),(0,Y.jsx)(VW,{children:(0,Y.jsx)(gj,{})})]},e.value)}function JW(e,t){return e.value===t.value}function YW(e){return e.items.length}function XW(e){return e.items}function ZW(e){let t=(0,kA.c)(7),{lines:n,children:r}=e,i=n===void 0?2:n,a;t[0]===r?a=t[1]:(a=(0,Y.jsx)(`span`,{children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=Array.from({length:i},QW),t[2]=i,t[3]=o);let s;return t[4]!==a||t[5]!==o?(s=(0,Y.jsxs)(`div`,{className:`review-loading`,role:`status`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6],s}function QW(e,t){return(0,Y.jsx)(`div`,{},t)}function $W(e){let t=(0,kA.c)(10),{icon:n,title:r,children:i}=e,a;t[0]===n?a=t[1]:(a=(0,Y.jsx)(`div`,{className:`empty-icon`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,Y.jsx)(`h2`,{children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Y.jsx)(`p`,{children:i}),t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,Y.jsxs)(`div`,{className:`empty-state`,children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}var eG=window.location.hash.slice(1);async function tG(e,t={},n){let r;try{r=await fetch(`/api/${e}?${new URLSearchParams(t)}`,{...n,headers:{Authorization:`Bearer ${eG}`}})}catch(e){throw e instanceof DOMException&&e.name===`AbortError`?e:Error(`The polydiff server stopped responding. Is it still running?`,{cause:e})}if(!r.headers.get(`content-type`)?.includes(`application/json`))throw Error(`Start the local server with pnpm start to browse repositories.`);let i=await r.json();if(!r.ok)throw Error(i.error||`Request failed.`);return i}function nG(e,t){return tG(e,{},{method:`POST`,body:JSON.stringify(t)})}var rG={loading:!0};function iG(e,t){return`diff-${encodeURIComponent(e)}${t?`-${encodeURIComponent(t)}`:``}`}function aG(e){return e===`@working`?`working tree`:e}function oG(e){return e.flatMap(e=>e.hunks).reduce((e,t)=>({added:e.added+t.additionLines,removed:e.removed+t.deletionLines}),{added:0,removed:0})}function sG(e,t,n){let r={};return t.base&&t.base!==e.base&&(r.base=t.base),t.target&&t.target!==`@working`&&(r.target=t.target),n===`custom`&&t.selected!==void 0&&(r.selected=t.selected),r}function cG(e,t){let[n,r]=(0,b.useState)(e.root),[i,a]=(0,b.useState)([]),[o,s]=(0,b.useState)(e.repos),[c,l]=(0,b.useState)(e.selection),[u,d]=(0,b.useState)({}),[f,p]=(0,b.useState)(!0),[m,h]=(0,b.useState)(``),[g,_]=(0,b.useState)([]),v=(0,b.useRef)(null),y=(0,b.useRef)(new Map),x=(0,b.useRef)(0),S=(0,b.useRef)(o),C=(0,b.useRef)(``);(0,b.useEffect)(()=>{S.current=o},[o]);let w=(0,b.useMemo)(()=>i.map(e=>{let t=o[e.path];return{repo:e,base:t?.base||e.base,target:t?.target||`@working`,selected:t?.selected,...u[e.path]||rG}}),[i,o,u]),T=(0,b.useCallback)(e=>c===`all`?!0:c===`none`?!1:c===`custom`&&e.selected!==void 0?e.selected:!!e.data?.files.length,[c]),E=(0,b.useMemo)(()=>w.filter(T),[w,T]),D=(0,b.useCallback)(async(e,t,n,r)=>{if(r?.aborted)return;y.current.get(e.path)?.abort();let i=new AbortController;y.current.set(e.path,i);let a=()=>i.abort();r?.addEventListener(`abort`,a,{once:!0});let o=++x.current;d(t=>({...t,[e.path]:{...t[e.path],loading:!0}}));try{let r=await tG(`diff`,{repo:e.path,base:t,target:n},{signal:i.signal});if(i.signal.aborted)return;let a=VD(r.patch,`${e.path}:${o}`,!0).flatMap(e=>e.files);d(t=>({...t,[e.path]:{loading:!1,data:{files:a,mergeBase:r.mergeBase,targetRef:r.targetRef,warnings:r.warnings,version:o}}}))}catch(t){i.signal.aborted||d(n=>({...n,[e.path]:{loading:!1,error:t instanceof Error?t.message:`Could not load changes.`}}))}finally{r?.removeEventListener(`abort`,a),y.current.get(e.path)===i&&y.current.delete(e.path)}},[]),O=(0,b.useCallback)(async(e,t=!1)=>{v.current?.abort(),y.current.forEach(e=>e.abort()),y.current.clear();let n=new AbortController;v.current=n,p(!0),h(``);try{let i=await tG(`workspace`,{path:e},{signal:n.signal});if(n.signal.aborted)return;r(i.root),_(i.warnings),a(i.repos),t||d({}),p(!1);let o=0;await Promise.all(Array.from({length:Math.min(4,i.repos.length)},async()=>{for(;o<i.repos.length&&!n.signal.aborted;){let e=i.repos[o++],t=S.current[e.path];await D(e,t?.base||e.base,t?.target||`@working`,n.signal)}}))}catch(e){n.signal.aborted||(h(e instanceof Error?e.message:`Could not scan workspace.`),p(!1))}},[D]);return(0,b.useEffect)(()=>{O(e.root);let t=y.current;return()=>{v.current?.abort(),t.forEach(e=>e.abort())}},[O,e.root]),(0,b.useEffect)(()=>{if(!i.length)return;let e={};for(let t of i)e[t.path]=sG(t,o[t.path]||{},c);let n=JSON.stringify({repos:e,selection:c});n!==C.current&&(C.current=n,t({repos:e,selection:c}))},[i,o,c,t]),{root:n,entries:w,selected:E,included:T,selection:c,scanning:f,error:m,warnings:g,open:O,reload:(0,b.useCallback)(e=>D(e.repo,e.base,e.target),[D]),configure:(0,b.useCallback)((e,t)=>{s(n=>({...n,[e.repo.path]:{...n[e.repo.path],...t}})),D(e.repo,t.base??e.base,t.target??e.target)},[D]),select:(0,b.useCallback)((e,t)=>{s(n=>{let r={...n};if(c!==`custom`)for(let e of w)r[e.repo.path]={...r[e.repo.path],selected:T(e)};return r[e]={...r[e],selected:t},r}),l(`custom`)},[w,T,c]),setSelection:(0,b.useCallback)(e=>{l(e),e!==`custom`&&s(e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{base:t.base,target:t.target}])))},[])}}var lG=[{value:`changed`,label:`Changed`,hint:`Follow repositories that have changes`},{value:`all`,label:`All`,hint:`Include every repository`},{value:`none`,label:`None`,hint:`Clear the selection`}];function uG(e,t){let{local:n,remote:r}=e.repo.branches;return[{value:`Current`,items:[...t?[{value:`@working`,label:`working tree (${e.repo.branch})`}]:[],{value:`HEAD`,label:t?`HEAD (committed only)`:`HEAD`}]},{value:`Local`,items:n.map(e=>({value:e,label:e}))},{value:`Remote`,items:r.map(e=>({value:e,label:e}))}]}function dG(e){let t=(0,kA.c)(45),{entry:n,workspace:r}=e,i=`Comparison for ${n.repo.name}`,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(wj,{}),t[0]=a):a=t[0];let o=n.base,s;t[1]===n.target?s=t[2]:(s=aG(n.target),t[1]=n.target,t[2]=s);let c=`${o} → ${s}`,l=n.base,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(lj,{}),t[3]=u):u=t[3];let d;t[4]===n.target?d=t[5]:(d=aG(n.target),t[4]=n.target,t[5]=d);let f;t[6]!==n.base||t[7]!==c||t[8]!==d?(f=(0,Y.jsxs)(`span`,{title:c,children:[l,u,d]}),t[6]=n.base,t[7]=c,t[8]=d,t[9]=f):f=t[9];let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Y.jsx)(pj,{}),t[10]=p):p=t[10];let m;t[11]!==i||t[12]!==f?(m=(0,Y.jsxs)(qH,{className:`compare-chip`,"aria-label":i,children:[a,f,p]}),t[11]=i,t[12]=f,t[13]=m):m=t[13];let h;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Y.jsx)(iU,{children:`Compare`}),t[14]=h):h=t[14];let g=n.repo.worktree?` · worktree`:``,_;t[15]!==n.repo.name||t[16]!==g?(_=(0,Y.jsxs)(aU,{className:`muted`,children:[n.repo.name,g]}),t[15]=n.repo.name,t[16]=g,t[17]=_):_=t[17];let v=n.base,y;t[18]===n?y=t[19]:(y=uG(n,!1),t[18]=n,t[19]=y);let b;t[20]!==n||t[21]!==r?(b=e=>r.configure(n,{base:e}),t[20]=n,t[21]=r,t[22]=b):b=t[22];let x;t[23]!==n.base||t[24]!==y||t[25]!==b?(x=(0,Y.jsx)(GW,{label:`Base`,value:v,groups:y,onChange:b}),t[23]=n.base,t[24]=y,t[25]=b,t[26]=x):x=t[26];let S;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Y.jsx)(`div`,{className:`compare-connector`,children:(0,Y.jsx)(lj,{})}),t[27]=S):S=t[27];let C=n.target,w;t[28]===n?w=t[29]:(w=uG(n,!0),t[28]=n,t[29]=w);let T;t[30]!==n||t[31]!==r?(T=e=>r.configure(n,{target:e}),t[30]=n,t[31]=r,t[32]=T):T=t[32];let E;t[33]!==n.target||t[34]!==w||t[35]!==T?(E=(0,Y.jsx)(GW,{label:`Compare`,value:C,groups:w,onChange:T}),t[33]=n.target,t[34]=w,t[35]=T,t[36]=E):E=t[36];let D;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Y.jsx)(`p`,{className:`popup-note`,children:`Changes since the common ancestor. Uncommitted edits are included only for the working tree.`}),t[37]=D):D=t[37];let O;t[38]!==_||t[39]!==x||t[40]!==E?(O=(0,Y.jsx)(XH,{children:(0,Y.jsx)($H,{side:`right`,align:`start`,sideOffset:10,className:`floating`,children:(0,Y.jsxs)(rU,{className:`popup comparison-popup`,children:[h,_,x,S,E,D]})})}),t[38]=_,t[39]=x,t[40]=E,t[41]=O):O=t[41];let k;return t[42]!==m||t[43]!==O?(k=(0,Y.jsxs)(WH,{children:[m,O]}),t[42]=m,t[43]=O,t[44]=k):k=t[44],k}function fG(e){let t=(0,kA.c)(34),{entry:n,workspace:r}=e,i=n.repo,a;t[0]!==n||t[1]!==r?(a=r.included(n),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=a,s=`selector-row ${o?`is-selected`:``}`,c=`Include ${i.name}`,l;t[3]!==i.path||t[4]!==r?(l=e=>r.select(i.path,e),t[3]=i.path,t[4]=r,t[5]=l):l=t[5];let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(IH,{children:(0,Y.jsx)(gj,{weight:`bold`})}),t[6]=u):u=t[6];let d;t[7]!==o||t[8]!==c||t[9]!==l?(d=(0,Y.jsx)(FH,{className:`checkbox`,"aria-label":c,checked:o,onCheckedChange:l,children:u}),t[7]=o,t[8]=c,t[9]=l,t[10]=d):d=t[10];let f;t[11]===i.worktree?f=t[12]:(f=i.worktree&&(0,Y.jsx)(`span`,{className:`worktree-label`,children:`worktree`}),t[11]=i.worktree,t[12]=f);let p;t[13]!==i.name||t[14]!==i.path||t[15]!==f?(p=(0,Y.jsxs)(`span`,{className:`selector-name`,title:i.path,children:[i.name,f]}),t[13]=i.name,t[14]=i.path,t[15]=f,t[16]=p):p=t[16];let m=`selector-count ${n.error?`has-error`:``}`,h=n.error||`${n.data?.files.length||0} changed files`,g;t[17]!==n.data?.files||t[18]!==n.error||t[19]!==n.loading?(g=n.loading?(0,Y.jsx)(`span`,{className:`busy-dot`}):n.error?(0,Y.jsx)(Nj,{}):n.data?.files.length||`—`,t[17]=n.data?.files,t[18]=n.error,t[19]=n.loading,t[20]=g):g=t[20];let _;t[21]!==h||t[22]!==g||t[23]!==m?(_=(0,Y.jsx)(`span`,{className:m,title:h,children:g}),t[21]=h,t[22]=g,t[23]=m,t[24]=_):_=t[24];let v;t[25]!==n||t[26]!==r?(v=(0,Y.jsx)(dG,{entry:n,workspace:r}),t[25]=n,t[26]=r,t[27]=v):v=t[27];let y;return t[28]!==_||t[29]!==v||t[30]!==s||t[31]!==d||t[32]!==p?(y=(0,Y.jsxs)(`div`,{className:s,children:[d,p,_,v]}),t[28]=_,t[29]=v,t[30]=s,t[31]=d,t[32]=p,t[33]=y):y=t[33],y}function pG(e){let t=(0,kA.c)(71),{workspace:n}=e,[r,i]=(0,b.useState)(``),a,o,s,c,l,u,d,f,p,m,h,g,_,v;if(t[0]!==r||t[1]!==n){let e;t[16]===r?e=t[17]:(e=e=>e.repo.name.toLowerCase().includes(r.toLowerCase()),t[16]=r,t[17]=e),v=n.entries.filter(e),c=WH;let y,b;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Y.jsx)(Sj,{}),b=(0,Y.jsx)(`strong`,{children:`Repositories`}),t[18]=y,t[19]=b):(y=t[18],b=t[19]);let x=n.scanning?`Scanning…`:`${n.selected.length} of ${n.entries.length}`,S;t[20]===x?S=t[21]:(S=(0,Y.jsx)(`small`,{children:x}),t[20]=x,t[21]=S);let C;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Y.jsx)(pj,{}),t[22]=C):C=t[22],t[23]===S?_=t[24]:(_=(0,Y.jsxs)(qH,{className:`selector-trigger`,"aria-label":`Repositories`,children:[y,b,S,C]}),t[23]=S,t[24]=_),s=XH,o=$H,m=8,h=`start`,g=`floating`,a=rU,d=`popup selector-popup`;let w;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Y.jsx)(Ej,{}),t[25]=w):w=t[25],t[26]===r?f=t[27]:(f=(0,Y.jsxs)(`div`,{className:`search-field`,children:[w,(0,Y.jsx)(jM,{"aria-label":`Filter repositories`,placeholder:`Find a repository…`,value:r,onValueChange:i})]}),t[26]=r,t[27]=f);let T;t[28]===n.selection?T=t[29]:(T=n.selection===`custom`?[]:[n.selection],t[28]=n.selection,t[29]=T);let E;t[30]===n?E=t[31]:(E=e=>{e[0]&&n.setSelection(e[0])},t[30]=n,t[31]=E);let D;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(D=lG.map(mG),t[32]=D):D=t[32];let O;t[33]!==T||t[34]!==E?(O=(0,Y.jsx)(fl,{className:`segmented`,"aria-label":`Which repositories to review`,value:T,onValueChange:E,children:D}),t[33]=T,t[34]=E,t[35]=O):O=t[35];let k=n.selection===`custom`?`Custom · `:``,A;t[36]!==k||t[37]!==n.entries.length||t[38]!==n.selected.length?(A=(0,Y.jsxs)(`span`,{className:`selector-summary`,children:[k,n.selected.length,` of `,n.entries.length]}),t[36]=k,t[37]=n.entries.length,t[38]=n.selected.length,t[39]=A):A=t[39],t[40]!==O||t[41]!==A?(p=(0,Y.jsxs)(`div`,{className:`selector-actions`,children:[O,A]}),t[40]=O,t[41]=A,t[42]=p):p=t[42],l=`selector-list`;let j;t[43]===n?j=t[44]:(j=e=>(0,Y.jsx)(fG,{entry:e,workspace:n},e.repo.path),t[43]=n,t[44]=j),u=v.map(j),t[0]=r,t[1]=n,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_,t[15]=v}else a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15];let y;t[45]!==v.length||t[46]!==n.scanning?(y=!v.length&&(0,Y.jsx)(`p`,{className:`popup-empty`,children:n.scanning?`Discovering repositories…`:`No matching repositories.`}),t[45]=v.length,t[46]=n.scanning,t[47]=y):y=t[47];let x;t[48]!==l||t[49]!==y||t[50]!==u?(x=(0,Y.jsxs)(`div`,{className:l,children:[u,y]}),t[48]=l,t[49]=y,t[50]=u,t[51]=x):x=t[51];let S;t[52]!==a||t[53]!==x||t[54]!==d||t[55]!==f||t[56]!==p?(S=(0,Y.jsxs)(a,{className:d,children:[f,p,x]}),t[52]=a,t[53]=x,t[54]=d,t[55]=f,t[56]=p,t[57]=S):S=t[57];let C;t[58]!==o||t[59]!==S||t[60]!==m||t[61]!==h||t[62]!==g?(C=(0,Y.jsx)(o,{sideOffset:m,align:h,className:g,children:S}),t[58]=o,t[59]=S,t[60]=m,t[61]=h,t[62]=g,t[63]=C):C=t[63];let w;t[64]!==s||t[65]!==C?(w=(0,Y.jsx)(s,{children:C}),t[64]=s,t[65]=C,t[66]=w):w=t[66];let T;return t[67]!==c||t[68]!==w||t[69]!==_?(T=(0,Y.jsxs)(c,{children:[_,w]}),t[67]=c,t[68]=w,t[69]=_,t[70]=T):T=t[70],T}function mG(e){return(0,Y.jsx)(xl,{value:e.value,title:e.hint,children:e.label},e.value)}var hG=20;function gG(e){let t=(0,kA.c)(24),{entry:n,search:r,density:i,navigate:a}=e,o;t[0]===n.data?.files?o=t[1]:(o=n.data?.files||[],t[0]=n.data?.files,t[1]=o);let s=o,c;t[2]===s?c=t[3]:(c=s.map(yG),t[2]=s,t[3]=c);let l=c,u;t[4]===s?u=t[5]:(u=s.map(vG),t[4]=s,t[5]=u);let d;t[6]!==n.repo||t[7]!==s||t[8]!==a?(d=e=>{e[0]&&s.some(t=>t.name===e[0])&&a(n.repo.path,e[0])},t[6]=n.repo,t[7]=s,t[8]=a,t[9]=d):d=t[9];let f;t[10]!==i||t[11]!==l||t[12]!==u||t[13]!==d?(f={paths:u,gitStatus:l,initialExpansion:`open`,flattenEmptyDirectories:!0,density:i,onSelectionChange:d},t[10]=i,t[11]=l,t[12]=u,t[13]=d,t[14]=f):f=t[14];let{model:p}=CH(f),m,h;t[15]!==p||t[16]!==r?(m=()=>{p.setSearch(r||null)},h=[p,r],t[15]=p,t[16]=r,t[17]=m,t[18]=h):(m=t[17],h=t[18]),(0,b.useEffect)(m,h);let g=TH(p,_G),_=cP[i].itemHeight,v=Math.min(hG,g)*_,y;t[19]===v?y=t[20]:(y={height:v},t[19]=v,t[20]=y);let x;return t[21]!==p||t[22]!==y?(x=(0,Y.jsx)(KM,{model:p,className:`file-tree`,style:y}),t[21]=p,t[22]=y,t[23]=x):x=t[23],x}function _G(e){return e.getVisibleCount()}function vG(e){return e.name}function yG(e){return{path:e.name,status:e.type===`new`?`added`:e.type===`deleted`?`deleted`:e.type.startsWith(`rename`)?`renamed`:`modified`}}function bG(e){let t=(0,kA.c)(24),{entry:n,search:r,density:i,workspace:a,navigate:o}=e,[s,c]=(0,b.useState)(!0),l;t[0]===n.data?.files?l=t[1]:(l=n.data?.files||[],t[0]=n.data?.files,t[1]=l);let u;t[2]===l?u=t[3]:(u=oG(l),t[2]=l,t[3]=u);let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(mj,{className:`disclosure`}),t[4]=f):f=t[4];let p;t[5]===n.repo.name?p=t[6]:(p=(0,Y.jsx)(`span`,{children:n.repo.name}),t[5]=n.repo.name,t[6]=p);let m;t[7]!==n.loading||t[8]!==d?(m=n.loading?(0,Y.jsx)(`span`,{className:`busy-dot`}):(0,Y.jsxs)(`span`,{className:`diff-stat`,children:[(0,Y.jsx)(`span`,{className:`added`,children:d.added?`+${d.added}`:``}),(0,Y.jsx)(`span`,{className:`removed`,children:d.removed?`−${d.removed}`:``})]}),t[7]=n.loading,t[8]=d,t[9]=m):m=t[9];let h;t[10]!==n.repo.path||t[11]!==p||t[12]!==m?(h=(0,Y.jsxs)(Jj,{className:`sidebar-repo-heading`,title:n.repo.path,children:[f,p,m]}),t[10]=n.repo.path,t[11]=p,t[12]=m,t[13]=h):h=t[13];let g;t[14]!==i||t[15]!==n||t[16]!==o||t[17]!==r||t[18]!==a?(g=(0,Y.jsx)(iM,{className:`sidebar-repo-panel`,children:n.error?(0,Y.jsxs)(`p`,{className:`sidebar-error`,children:[(0,Y.jsx)(Nj,{}),n.error,(0,Y.jsx)(bu,{className:`text-button`,onClick:()=>void a.reload(n),children:`Retry`})]}):n.loading&&!n.data?(0,Y.jsxs)(`div`,{className:`tree-skeleton`,"aria-label":`Loading changed files`,children:[(0,Y.jsx)(`i`,{}),(0,Y.jsx)(`i`,{}),(0,Y.jsx)(`i`,{})]}):n.data?.files.length?(0,Y.jsx)(gG,{entry:n,search:r,density:i,navigate:o},n.data.version):(0,Y.jsx)(`p`,{className:`repo-note`,children:`No changes in this comparison.`})}),t[14]=i,t[15]=n,t[16]=o,t[17]=r,t[18]=a,t[19]=g):g=t[19];let _;return t[20]!==s||t[21]!==h||t[22]!==g?(_=(0,Y.jsxs)(Kj,{className:`sidebar-repo`,open:s,onOpenChange:c,children:[h,g]}),t[20]=s,t[21]=h,t[22]=g,t[23]=_):_=t[23],_}function xG(e){let t=(0,kA.c)(47),{workspace:n,density:r,navigate:i}=e,[a,o]=(0,b.useState)(``),s;t[0]===n.entries?s=t[1]:(s=n.entries.some(SG),t[0]=n.entries,t[1]=s);let c=s,l,u,d,f,p,m,h,g;if(t[2]!==r||t[3]!==i||t[4]!==c||t[5]!==a||t[6]!==n){let e=a.trim().toLowerCase();g=n.selected.flatMap(t=>!e||t.repo.name.toLowerCase().includes(e)?[{entry:t,search:``}]:t.data?.files.some(t=>t.name.toLowerCase().includes(e))?[{entry:t,search:a}]:[]),f=`sidebar`,p=`Workspace navigation`;let s;t[15]===n?s=t[16]:(s=(0,Y.jsx)(pG,{workspace:n}),t[15]=n,t[16]=s);let _=n.scanning||c,v;t[17]===n?v=t[18]:(v=()=>void n.open(n.root,!0),t[17]=n,t[18]=v);let y=c||n.scanning?`spinning`:``,b;t[19]===y?b=t[20]:(b=(0,Y.jsx)(uj,{className:y}),t[19]=y,t[20]=b);let x;t[21]!==_||t[22]!==v||t[23]!==b?(x=(0,Y.jsx)(WW,{label:`Rescan and reload changes`,disabled:_,onClick:v,children:b}),t[21]=_,t[22]=v,t[23]=b,t[24]=x):x=t[24],t[25]!==x||t[26]!==s?(m=(0,Y.jsxs)(`div`,{className:`sidebar-top`,children:[s,x]}),t[25]=x,t[26]=s,t[27]=m):m=t[27];let S;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Y.jsx)(Ej,{}),t[28]=S):S=t[28],t[29]===a?h=t[30]:(h=(0,Y.jsxs)(`div`,{className:`sidebar-search search-field`,children:[S,(0,Y.jsx)(jM,{"aria-label":`Filter changed files`,placeholder:`Find a file…`,value:a,onValueChange:o})]}),t[29]=a,t[30]=h),l=`repository-list`,u=`Changed files`,d=n.scanning&&!n.entries.length?(0,Y.jsxs)(`div`,{className:`tree-skeleton`,role:`status`,children:[(0,Y.jsx)(`i`,{}),(0,Y.jsx)(`i`,{}),(0,Y.jsx)(`i`,{}),(0,Y.jsx)(`span`,{children:`Discovering repositories…`})]}):g.map(e=>{let{entry:t,search:a}=e;return(0,Y.jsx)(bG,{entry:t,search:a,density:r,workspace:n,navigate:i},t.repo.path)}),t[2]=r,t[3]=i,t[4]=c,t[5]=a,t[6]=n,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h,t[14]=g}else l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14];let _;t[31]!==a||t[32]!==g||t[33]!==n.scanning||t[34]!==n.selected.length?(_=!n.scanning&&!g.length&&(0,Y.jsx)(`p`,{className:`repo-note`,children:a?`No matching files.`:n.selected.length?`No changes in the current comparisons.`:`Choose repositories to review.`}),t[31]=a,t[32]=g,t[33]=n.scanning,t[34]=n.selected.length,t[35]=_):_=t[35];let v;t[36]!==l||t[37]!==u||t[38]!==d||t[39]!==_?(v=(0,Y.jsxs)(`nav`,{className:l,"aria-label":u,children:[d,_]}),t[36]=l,t[37]=u,t[38]=d,t[39]=_,t[40]=v):v=t[40];let y;return t[41]!==v||t[42]!==f||t[43]!==p||t[44]!==m||t[45]!==h?(y=(0,Y.jsxs)(`aside`,{className:f,"aria-label":p,children:[m,h,v]}),t[41]=v,t[42]=f,t[43]=p,t[44]=m,t[45]=h,t[46]=y):y=t[46],y}function SG(e){return e.loading}function CG({entry:e,file:t,settings:n,collapsed:r,onCollapse:i}){let[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(!1),l=(0,b.useRef)(null),u=(0,b.useRef)(null),d=oG([t]),f=(0,b.useCallback)(async t=>{o(``),c(!0);try{return await tG(`file`,{repo:e.repo.path,name:t.name,oldName:t.prevName||t.name,oldRef:e.data.mergeBase,newRef:e.data.targetRef,expectedHash:t.newObjectId||``})}catch(e){throw o(e instanceof Error?e.message:`Could not expand context.`),e}finally{c(!1)}},[e.repo.path,e.data]);return(0,Y.jsxs)(`div`,{className:`diff-file`,id:iG(e.repo.path,t.name),children:[(0,Y.jsxs)(`button`,{className:`file-heading`,"aria-expanded":!r,onClick:()=>i(!r),children:[(0,Y.jsx)(mj,{className:`disclosure`}),(0,Y.jsx)(bj,{}),(0,Y.jsxs)(`span`,{className:`file-path`,children:[t.prevName&&(0,Y.jsxs)(`span`,{className:`muted`,children:[t.prevName,` → `]}),t.name]}),(0,Y.jsx)(`span`,{className:`file-status`,children:t.type===`new`?`Added`:t.type===`deleted`?`Deleted`:t.type.startsWith(`rename`)?`Renamed`:``}),(0,Y.jsxs)(`span`,{className:`diff-stat`,children:[(0,Y.jsx)(`span`,{className:`added`,children:d.added?`+${d.added}`:``}),(0,Y.jsx)(`span`,{className:`removed`,children:d.removed?`−${d.removed}`:``})]})]}),(0,Y.jsx)(`div`,{className:`file-panel`,"data-collapsed":r||void 0,ref:u,onMouseDownCapture:e=>{let t=e.nativeEvent.composedPath()[0];l.current=t instanceof Element?t:u.current},children:t.hunks.length?(0,Y.jsx)(DA,{fileDiff:t,options:{theme:{light:`pierre-light`,dark:`pierre-dark`},themeType:n.theme,diffStyle:n.layout,overflow:n.wrap?`wrap`:`scroll`,lineDiffType:n.wordDiff,expansionLineCount:n.expansionLines,disableFileHeader:!0,hunkSeparators:`line-info`,collapsed:r,loadDiffFiles:f}}):!r&&(0,Y.jsx)(`p`,{className:`file-note`,children:t.type===`rename-pure`?`File renamed without content changes.`:`No text hunks. Binary content, an empty file, or a file mode change.`})}),(0,Y.jsx)(WH,{open:!!a||s,onOpenChange:e=>!e&&o(``),children:(0,Y.jsx)(XH,{children:(0,Y.jsx)($H,{anchor:()=>l.current||u.current,side:`top`,align:`center`,sideOffset:6,className:`floating`,children:(0,Y.jsx)(rU,{className:`popup context-status`,role:a?`alert`:`status`,children:a?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Nj,{}),(0,Y.jsx)(`span`,{children:a}),(0,Y.jsx)(oU,{className:`text-button`,children:`Dismiss`})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`busy-dot`}),(0,Y.jsx)(`span`,{children:`Loading the full file…`})]})})})})})]})}var wG=b.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,...o}=e,[s,c]=b.useState(void 0),l=hM(!0)?.disabled||a,u=Di(`fieldset`,e,{ref:t,state:{disabled:l},props:[{"aria-labelledby":s,disabled:l},o]}),d=b.useMemo(()=>({legendId:s,setLegendId:c,disabled:l}),[s,c,l]);return(0,Y.jsx)(mM.Provider,{value:d,children:u})}),TG=b.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{disabled:s,setLegendId:c}=hM(),l=wM(a,c);return Di(`div`,e,{state:{disabled:s},ref:t,props:[{id:l},o]})}),EG=new Map;function DG(e,t){let n=JSON.stringify({locale:VU(e),options:t}),r=EG.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return EG.set(n,i),i}function OG(e,t,n){return e==null?``:DG(t,n).format(e)}var kG=b.createContext(void 0);function AG(){let e=b.useContext(kG);if(e===void 0)throw Error(F(43));return e}var jG={inputValue:()=>null,value:()=>null,...uM},MG=`零〇一二三四五六七八九`,NG=/[٠-٩۰-۹0-9]/g,PG=/[零〇一二三四五六七八九]/g,FG=[`%`,`٪`,`%`,`﹪`],IG=[`‰`,`؉`],LG=/[%٪%﹪]/,RG=/[‰؉]/,zG=/[%٪%﹪]/g,BG=/[‰؉]/g,VG=/[٠-٩۰-۹]/,HG=/[零〇一二三四五六七八九]/,UG=/[0-9٠-٩۰-۹0-9零〇一二三四五六七八九]/;function WG(e){return UG.test(e)}var GG=[`.`,`,`,`.`,`,`,`٫`,`٬`],KG=/\p{Zs}/u,qG=/\p{Cf}/u,JG=/\p{Cf}/gu,YG=[`+`,`+`,`﹢`],XG=[`-`,`−`,`-`,`‒`,`–`,`—`,`﹣`],ZG=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function QG(e,t){let[n,r=`0`]=String(e).split(`e`);return Number(`${n}e${Number(r)+t}`)}var $G=/[-−-‒–—﹣]/gu,eK=/[++﹢]/gu,tK=/[-−-‒–—﹣]/,nK=/[++﹢]/,rK=11111.1;function iK(e,t){return DG(e,t).formatToParts(rK)}function aK(e,t){let n=iK(e,t),r={};n.forEach(e=>{r[e.type]=e.value});let i=`.`;return DG(e).formatToParts(.1).forEach(e=>{e.type===`decimal`&&(i=e.value)}),{...r,decimal:i}}function oK(e,t,n){let r=e.replace(JG,``).trim();r=r.replace($G,`-`).replace(eK,`+`);let i=!1,a=(e,t)=>(t===`-`&&(i=!0),``);r=r.replace(/([+-])\s*$/,a).replace(/^\s*([+-])/,a);let o=t;o===void 0&&(VG.test(r)?o=`ar`:HG.test(r)&&(o=`zh`));let{group:s,decimal:c,currency:l,exponentSeparator:u}=aK(o,n),d=DG(o,n).formatToParts(1).filter(e=>e.type===`unit`).map(e=>ZG(e.value)),f=d.length?new RegExp(d.join(`|`),`g`):null,p=null;s&&(p=/\p{Zs}/u.test(s)?/\p{Zs}/gu:s===`'`||s===`’`?/['’]/g:new RegExp(ZG(s),`g`));let m=[[p,``],[new RegExp(ZG(c),`g`),`.`],[/[.٫]/g,`.`],[/[,٬]/g,``],[l?new RegExp(ZG(l),`g`):null,``],[f,``],[zG,``],[BG,``],[u?new RegExp(ZG(u),`g`):null,`e`],[NG,e=>String(e.charCodeAt(0)%16)],[PG,e=>String(Math.max(MG.indexOf(e)-1,0))]].reduce((e,[t,n])=>t?e.replace(t,n):e,r),h=m.lastIndexOf(`.`);if(h!==-1&&(m=`${m.slice(0,h).replace(/\./g,``)}.${m.slice(h+1).replace(/\./g,``)}`),/^[-+]?Infinity$/i.test(r)||r.includes(`∞`))return null;let g=(i?`-`:``)+m,_=parseFloat(g),v=n?.style,y=v===`unit`&&n?.unit===`percent`,b=LG.test(e)||v===`percent`;return RG.test(e)?_=QG(_,-3):!y&&b&&(_=QG(_,-2)),Number.isFinite(_)?_:null}function sK(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var cK=1e-10,lK=1e-10;function uK(e){return e?.maximumFractionDigits!=null||e?.minimumFractionDigits!=null||e?.maximumSignificantDigits!=null||e?.minimumSignificantDigits!=null||e?.roundingIncrement!=null||e?.roundingMode!=null||e?.roundingPriority!=null}function dK(e,t){if(!Number.isFinite(e))return e;if(!uK(t)){let t=parseFloat(e.toPrecision(15));return Math.abs(t-e)<=Math.min(2**-52*Math.max(1,Math.abs(e)),lK)?t:e}let n=DG(`en-US`,{...t,signDisplay:`auto`,currencySign:`standard`,notation:t.notation===`compact`?`standard`:t.notation,useGrouping:!1}),r=n.format(e),i=oK(r,`en-US`,t);return i===null?e:n.format(i)===r?i:e}function fK(e,t,n,r){let i=Math.abs(n),a=Math.sign(n),o=i*cK*a,s=e-t+o;return r?t+Math.round(s/n)*n:t+(a>0?Math.floor(s/i):Math.ceil(s/i))*i}function pK(e,t,n,r,i,a,o,s,c){if(e===null)return e;let l=e;if(t!=null&&o&&t!==0&&(l=fK(l,s||n===-(2**53-1)?i:n,t,s)),c&&(l=sK(l,n,r)),t==null&&!uK(a))return l;let u=dK(l,a);return c?sK(u,n,r):u}var mK=b.forwardRef(function(e,t){let{id:n,min:r,max:i,smallStep:a=.1,step:o=1,largeStep:s=10,required:c=!1,disabled:l=!1,readOnly:u=!1,form:d,name:f,defaultValue:p=null,value:m,onValueChange:h,onValueCommitted:g,allowWheelScrub:_=!1,snapOnStep:v=!1,allowOutOfRange:y=!1,format:x,locale:S,render:C,className:w,inputRef:T,style:E,...D}=e,{setDirty:O,validityData:k,disabled:A,setFilled:j,name:M,state:P,validation:F}=pM(),{clearErrors:I}=_M(),L=A||l,R=M??f,z=o===`any`?1:o,[B,V]=b.useState(!1),H=r??-(2**53-1),U=i??2**53-1,ee=r??0,te=x?.style,ne=b.useRef(null),W=ln(T,F.inputRef),ie=CM({id:n}),[ae,G]=jc({controlled:m,default:p,name:`NumberField`,state:`value`}),oe=hn(ae);N(()=>{j(ae!==null)},[j,ae]);let se=Po(),ce=hn(x),le=b.useRef(!1),ue=X((e,t)=>{le.current=!1,g?.(e,t)}),de=b.useRef(!0),fe=b.useRef(null),[pe,me]=b.useState(()=>OG(ae,S,x)),[he,ge]=b.useState(`numeric`),_e=X(()=>{let e=iK(S,x),t=new Set(GG),n=e=>e.forEach(e=>t.add(e)),r=e.find(e=>e.type===`decimal`)?.value??aK(S,x).decimal;t.add(r),e.forEach(e=>{e.type!==`integer`&&e.type!==`fraction`&&e.type!==`exponentInteger`&&e.type!==`compact`&&(n(Array.from(e.value)),KG.test(e.value)&&t.add(` `))});let i=te===`percent`||te===`unit`&&x?.unit===`percent`,a=te===`percent`||te===`unit`&&x?.unit===`permille`;return i&&n(FG),a&&n(IG),n(YG),(H<0||y)&&n(XG),t}),ve=X(e=>e?.altKey?a:e?.shiftKey?s:z),ye=X((e,t)=>{let n=t.event,r=t.direction,i=t.reason.startsWith(`input-`)||t.reason===`none`,a=!y||!i,o=pK(e,r?ve(n)*r:void 0,H,U,ee,ce.current,v,n?.altKey??!1,a),s=o!==ae||i&&(e!==ae||de.current===!1);if(s){if(h?.(o,t),t.isCanceled)return!1;G(o),O(o!==k.initialValue),le.current=!0}return fe.current=o,de.current&&me(OG(o,S,x)),se(),s}),be=X((e,{direction:t,currentValue:n,event:r,reason:i})=>{let a=n??oe.current,o=r;return typeof a==`number`?ye(a+e*t,J(i,o,void 0,{direction:t})):ye(0,J(i,o))});N(function(){if(!de.current)return;let e=OG(ae,S,x);e!==pe&&me(e)}),N(function(){if(!re)return;let e=`text`;H>=0&&(e=`decimal`),ge(e)},[H]);let xe=X(()=>{let e=ne.current;if(!e)return;let t=e.value.length;e.setSelectionRange(t,t),e.focus()});b.useEffect(function(){let e=ne.current;if(L||u||!_||!e)return;function t(e){if(e.ctrlKey||He(En(ne.current))!==ne.current)return;let t=Math.abs(e.deltaX)>Math.abs(e.deltaY),n=e.shiftKey&&t?e.deltaX:e.deltaY;if(n===0||!e.shiftKey&&t)return;e.preventDefault(),de.current=!0;let r=ve(e);be(r,{direction:n>0?-1:1,event:e,reason:`wheel`})&&ue(fe.current,en(qt,e))}return sn(e,`wheel`,t)},[_,be,L,u,ve,ue,fe,oe]);let Se=b.useMemo(()=>({...P,disabled:L,readOnly:u,required:c,value:ae,inputValue:pe,scrubbing:B}),[P,L,u,c,ae,pe,B]),Ce=b.useMemo(()=>({inputRef:ne,focusInput:xe,minWithDefault:H,maxWithDefault:U,id:ie,setValue:ye,incrementValue:be,getStepAmount:ve,allowInputSyncRef:de,formatOptionsRef:ce,valueRef:oe,lastChangedValueRef:fe,hasPendingCommitRef:le,name:R,nameProp:f,inputMode:he,getAllowedNonNumericKeys:_e,min:r,max:i,setInputValue:me,locale:S,setIsScrubbing:V,state:Se,onValueCommitted:ue}),[ne,xe,H,U,ie,ye,be,ve,ce,oe,R,f,he,_e,r,i,me,S,Se,ue]),we=Di(`div`,e,{ref:t,state:Se,props:D,stateAttributesMapping:jG});return(0,Y.jsxs)(kG.Provider,{value:Ce,children:[we,(0,Y.jsx)(`input`,{...F.getValidationProps(L,{onFocus(){xe()},onChange(e){if(e.nativeEvent.defaultPrevented||L||u)return;let t=e.currentTarget.valueAsNumber,n=Number.isNaN(t)?null:t,r=J(Ot,e.nativeEvent);ye(n,r),I(R),F.change(fe.current??n)}}),ref:W,type:`number`,form:d,name:R,value:ae??``,min:r,max:i,step:o,disabled:L,readOnly:u,required:c,"aria-hidden":!0,tabIndex:-1,style:R?kn:On,suppressHydrationWarning:!0})]})}),hK=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=AG();return Di(`div`,e,{ref:t,state:o,props:[{role:`group`},a],stateAttributesMapping:jG})}),gK=0,_K=class e extends B{static create(){return new e}start(e,t){this.clear(),this.currentId=setInterval(()=>{t()},e)}clear=()=>{this.currentId!==gK&&(clearInterval(this.currentId),this.currentId=gK)}};function vK(){let e=S(_K.create).current;return R(e.disposeEffect),e}var yK=60,bK=400,xK=8,SK=50,CK=3;function wK(e){return e===`touch`||e===`pen`}function TK(e){let{disabled:t,tick:n,onStop:r,tickDelay:i=yK,startDelay:a=bK,scrollDistance:o=xK,elementRef:s}=e,c=V(),l=vK(),u=V(),d=b.useRef(!1),f=b.useRef(0),p=b.useRef({x:0,y:0}),m=b.useRef(!1),h=b.useRef(!1),g=b.useRef(``),_=b.useRef(A),v=b.useRef(A),y=X(()=>{u.clear(),c.clear(),l.clear(),_.current(),f.current=0});function x(e){y();let t=s.current;if(!t)return;let o=ye(t);function u(e){e.preventDefault()}if(_.current=sn(o,`contextmenu`,u),v.current(),v.current=sn(o,`pointerup`,e=>{d.current=!1,y(),r?.(e)},{once:!0}),!n(e)){y();return}c.start(a,()=>{l.start(i,()=>{n(e)||y()})})}return b.useEffect(()=>()=>{y(),v.current()},[y]),b.useEffect(()=>{t&&(d.current=!1,m.current=!1,g.current=``,y())},[t,y]),{pointerHandlers:{onTouchStart(){m.current=!0},onTouchEnd(){m.current=!1},onPointerDown(e){e.defaultPrevented||e.button||t||(g.current=e.pointerType,h.current=!1,d.current=!0,p.current={x:e.clientX,y:e.clientY},wK(e.pointerType)?u.start(SK,()=>{let t=f.current;f.current=0,d.current&&t<CK?(x(e.nativeEvent),h.current=!0):(h.current=!1,y())}):(e.preventDefault(),x(e.nativeEvent)))},onPointerUp(e){wK(e.pointerType)&&(d.current=!1)},onPointerMove(e){if(t||!wK(e.pointerType)||!d.current)return;f.current+=1;let{x:n,y:r}=p.current,i=n-e.clientX,a=r-e.clientY;i**2+a**2>o**2&&y()},onMouseEnter(e){e.defaultPrevented||t||!d.current||m.current||wK(g.current)||x(e.nativeEvent)},onMouseLeave(){m.current||y()},onMouseUp(){m.current||y()}},shouldSkipClick:X(e=>e.defaultPrevented?!0:wK(g.current)?h.current:e.detail!==0)}}var EK={WebkitUserSelect:`none`,userSelect:`none`};function DK(e,t,n){let{render:r,className:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{allowInputSyncRef:l,formatOptionsRef:u,getStepAmount:d,id:f,incrementValue:p,inputRef:m,focusInput:h,maxWithDefault:g,minWithDefault:_,setValue:v,state:y,valueRef:b,locale:x,lastChangedValueRef:S,onValueCommitted:C}=AG(),{disabled:w,readOnly:T,value:E,inputValue:D}=y,O=a||w||E!=null&&(n?E>=g:E<=_),k=n?Ft:It;function A(e){let t=!l.current;if(l.current=!0,!t){S.current=b.current;return}let n=oK(D,x,u.current);if(n!==null){let t=J(k,e);v(n,t),t.isCanceled||(b.current=n)}}let{pointerHandlers:j,shouldSkipClick:M}=TK({disabled:O||T,elementRef:m,tick(e){let t=d(e);return p(t,{direction:n?1:-1,event:e,reason:k})},onStop(e){let t=S.current??b.current;C(t,en(k,e))}}),N={disabled:O,"aria-label":n?`Increase`:`Decrease`,"aria-controls":f,tabIndex:-1,style:EK,...j,onClick(e){let t=O||T;if(e.defaultPrevented||t||M(e))return;A(e.nativeEvent);let r=d(e),i=b.current;p(r,{direction:n?1:-1,event:e.nativeEvent,reason:k});let a=S.current??b.current;a!==i&&C(a,en(k,e.nativeEvent))},onPointerDown(e){e.defaultPrevented||T||e.button||O||(A(e.nativeEvent),S.current=null,wK(e.pointerType)||h(),j.onPointerDown(e))}},{getButtonProps:P,buttonRef:F}=hl({disabled:O||T,native:o,focusableWhenDisabled:!0}),I={...y,disabled:O};return Di(`button`,e,{ref:[t,F],state:I,props:[N,c,P],stateAttributesMapping:jG})}var OK=b.forwardRef(function(e,t){return DK(e,t,!0)}),kK=b.forwardRef(function(e,t){return DK(e,t,!1)}),AK=new Set([`Backspace`,`Delete`,`ArrowLeft`,`ArrowRight`,`Tab`,`Enter`,`Escape`]),jK=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{allowInputSyncRef:o,formatOptionsRef:s,getAllowedNonNumericKeys:c,getStepAmount:l,id:u,incrementValue:d,inputMode:f,max:p,min:m,name:h,nameProp:g,setValue:_,state:v,setInputValue:y,locale:x,inputRef:S,onValueCommitted:C,lastChangedValueRef:w,hasPendingCommitRef:T,valueRef:E}=AG(),{disabled:D,readOnly:O,required:k,value:A,inputValue:j}=v,{clearErrors:M}=_M(),{validationMode:P,setTouched:F,setFocused:I,invalid:L,shouldValidateOnChange:R,validation:z}=pM(),{labelId:B}=yM(),V=b.useRef(!1),H=b.useRef(null);return kM(S,u,A,void 0,!D,g),N(()=>{if(H.current!=null){let e=H.current;H.current=null,S.current?.setSelectionRange(e,e)}}),tu(A,()=>{if(M(h),V.current&&!R()){V.current=!1;return}z.change(A)}),Di(`input`,e,{ref:[t,S],state:v,props:[{id:u,required:k,disabled:D,readOnly:O,inputMode:f,value:j,type:`text`,autoComplete:`off`,autoCorrect:`off`,spellCheck:`false`,"aria-roledescription":`Number field`,"aria-invalid":!D&&L?!0:void 0,"aria-labelledby":B,suppressHydrationWarning:!0,onFocus(e){e.defaultPrevented||D||I(!0)},onBlur(e){if(e.defaultPrevented||D||(F(!0),I(!1),O))return;let t=!o.current,n=T.current;if(o.current=!0,j.trim()===``){let r=J(Rt,e.nativeEvent);if(_(null,r),r.isCanceled)return;P===`onBlur`&&z.commit(null),(t||n||A!==null)&&C(null,en(Rt,e.nativeEvent));return}let r=s.current,i=oK(j,x,r);if(i===null)return;let a=uK(r),c;c=!t&&!a?A:a?dK(i,r):i;let l=en(zt,e.nativeEvent),u=A!==c,d=t||u||n,f=c;if(u){let t=J(zt,e.nativeEvent);if(V.current=!0,_(c,t),t.isCanceled){V.current=!1;return}f=w.current,f===A&&(V.current=!1)}P===`onBlur`&&z.commit(f),d&&C(f,l);let p=OG(f,x,r);j!==p&&y(p)},onChange(e){if(e.nativeEvent.defaultPrevented)return;o.current=!1;let t=e.currentTarget.value;if(t.trim()===``){y(t),_(null,J(Rt,e.nativeEvent));return}let n=c();if(!Array.from(t).every(e=>WG(e)||tK.test(e)||n.has(e)||qG.test(e)))return;let r=oK(t,x,s.current);y(t),r!==null&&_(r,J(Lt,e.nativeEvent))},onKeyDown(e){if(e.defaultPrevented||O||D)return;let t=e.nativeEvent,n=!o.current,r=c(),i=r.has(e.key),{decimal:a,currency:u,percentSign:f}=aK(x,s.current),h=e.currentTarget.selectionStart,g=e.currentTarget.selectionEnd,v=h===0&&g===j.length,y=e=>h!=null&&g!=null&&e>=h&&e<g;[[tK,$G],[nK,eK]].forEach(([t,n])=>{if(t.test(e.key)&&Array.from(r).some(e=>t.test(e))){let e=j.search(n),t=e!==-1&&y(e);i=!(tK.test(j)||nK.test(j))||v||t}}),[a,u,f].forEach(t=>{if(e.key===t){let e=j.indexOf(t),n=y(e);i=e===-1||v||n}});let b=AK.has(e.key),S=e.key===`ArrowUp`||e.key===`ArrowDown`;if(e.which===229||e.altKey&&!S||e.ctrlKey||e.metaKey||i||WG(e.key)||b)return;let T=null;if(e.key===`Home`&&m!=null?T=m:e.key===`End`&&p!=null&&(T=p),e.key.length>1&&!S&&T===null)return;let k=n?oK(j,x,s.current):null,A=l(e);e.preventDefault(),e.stopPropagation();let M=en(Gt,t),N=!1;(S||T!==null)&&(o.current=!0),S?(n||(w.current=E.current),N=d(A,{direction:e.key===`ArrowUp`?1:-1,currentValue:k,event:t,reason:Gt})):T!==null&&(N=_(T,J(Gt,t))),N&&C(w.current,M)},onPaste(e){if(e.defaultPrevented||O||D)return;let t=``;try{t=e.clipboardData?.getData(`text/plain`)??``}catch{return}e.preventDefault();let n=e.currentTarget,r=n.selectionStart,i=n.selectionEnd,a=j.slice(0,r)+t+j.slice(i),c=oK(a,x,s.current);c!==null&&(o.current=!1,H.current=r+t.length,_(c,J(Bt,e.nativeEvent)),y(a))}},a,e=>z.getValidationProps(D,e)],stateAttributesMapping:jG})}),MK=b.createContext(void 0);function NK(){let e=b.useContext(MK);if(e===void 0)throw Error(F(63));return e}var PK=`data-checked`,FK=`data-unchecked`,IK={...uM,checked(e){return e?{[PK]:``}:{[FK]:``}}},LK=b.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,value:_,style:v,...y}=e,{clearErrors:x}=_M(),{state:S,setTouched:C,setDirty:w,validityData:T,setFilled:E,setFocused:D,validationMode:O,disabled:k,name:A,validation:j}=pM(),{labelId:P}=yM(),F=k||m,I=A??l,L=b.useRef(null),R=ln(L,c,j.inputRef),z=b.useRef(null),B=Js(),V=CM({id:s}),H=u?void 0:V,[U,ee]=jc({controlled:n,default:!!i,name:`Switch`,state:`checked`});kM(z,B,U,void 0,!F,l),N(()=>{E(U)},[U,E]),tu(U,()=>{x(I),w(U!==T.initialValue),j.change(U)});let{getButtonProps:te,buttonRef:ne}=hl({disabled:F,native:u}),W=bM(a,P,L,!u,H),re={id:u?V:B,role:`switch`,"aria-checked":U,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":W,onFocus(){F||D(!0)},onBlur(){let e=L.current;e&&!F&&(C(!0),D(!1),O===`onBlur`&&j.commit(e.checked))},onClick(e){if(f||F)return;e.preventDefault();let t=L.current;t&&ml(t,e)}},ie={...j.getValidationProps(F),checked:U,disabled:F,form:o,id:H,name:I,required:p,style:I?kn:On,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:R,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=J(Ot,e.nativeEvent);d?.(t,n),!n.isCanceled&&ee(t)},onClick(e){e.stopPropagation()},onFocus(){z.current?.focus()},..._===void 0?M:{value:_}},ae=b.useMemo(()=>({...S,checked:U,disabled:F,readOnly:f,required:p}),[S,U,F,f,p]),G=Di(`span`,e,{state:ae,ref:[t,z,ne],props:[re,y,te,e=>j.getValidationProps(F,e)],stateAttributesMapping:IK});return(0,Y.jsxs)(MK.Provider,{value:ae,children:[G,!U&&I&&g!==void 0&&(0,Y.jsx)(`input`,{type:`hidden`,form:o,name:I,value:g,disabled:F}),(0,Y.jsx)(`input`,{...ie,suppressHydrationWarning:!0})]})}),RK=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return Di(`span`,e,{state:NK(),ref:t,stateAttributesMapping:IK,props:a})});function zK(e){let t=(0,kA.c)(8),{label:n,hint:r,children:i}=e,a;t[0]===r?a=t[1]:(a=r&&(0,Y.jsx)(`small`,{children:r}),t[0]=r,t[1]=a);let o;t[2]!==n||t[3]!==a?(o=(0,Y.jsxs)(`span`,{className:`setting-text`,children:[n,a]}),t[2]=n,t[3]=a,t[4]=o):o=t[4];let s;return t[5]!==i||t[6]!==o?(s=(0,Y.jsxs)(`div`,{className:`setting`,children:[o,i]}),t[5]=i,t[6]=o,t[7]=s):s=t[7],s}function BK(e){let t=(0,kA.c)(11),{label:n,value:r,options:i,onChange:a}=e,o;t[0]===r?o=t[1]:(o=[r],t[0]=r,t[1]=o);let s;t[2]===a?s=t[3]:(s=e=>{e[0]&&a(e[0])},t[2]=a,t[3]=s);let c;t[4]===i?c=t[5]:(c=i.map(VK),t[4]=i,t[5]=c);let l;return t[6]!==n||t[7]!==o||t[8]!==s||t[9]!==c?(l=(0,Y.jsx)(fl,{className:`segmented`,"aria-label":n,value:o,onValueChange:s,children:c}),t[6]=n,t[7]=o,t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function VK(e){return(0,Y.jsx)(xl,{value:e.value,children:e.label},e.value)}function HK(e){let t=(0,kA.c)(20),{label:n,value:r,min:i,max:a,step:o,onChange:s}=e,c;t[0]===s?c=t[1]:(c=e=>e!==null&&s(e),t[0]=s,t[1]=c);let l=`Fewer ${n}`,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(Dj,{}),t[2]=u):u=t[2];let d;t[3]===l?d=t[4]:(d=(0,Y.jsx)(kK,{"aria-label":l,children:u}),t[3]=l,t[4]=d);let f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(jK,{}),t[5]=f):f=t[5];let p=`More ${n}`,m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Y.jsx)(Oj,{}),t[6]=m):m=t[6];let h;t[7]===p?h=t[8]:(h=(0,Y.jsx)(OK,{"aria-label":p,children:m}),t[7]=p,t[8]=h);let g;t[9]!==d||t[10]!==h?(g=(0,Y.jsxs)(hK,{className:`counter-group`,children:[d,f,h]}),t[9]=d,t[10]=h,t[11]=g):g=t[11];let _;return t[12]!==n||t[13]!==a||t[14]!==i||t[15]!==o||t[16]!==c||t[17]!==g||t[18]!==r?(_=(0,Y.jsx)(mK,{className:`counter`,"aria-label":n,value:r,min:i,max:a,step:o,onValueCommitted:c,children:g}),t[12]=n,t[13]=a,t[14]=i,t[15]=o,t[16]=c,t[17]=g,t[18]=r,t[19]=_):_=t[19],_}function UK(e){let t=(0,kA.c)(79),{settings:n,onChange:r}=e,i;t[0]===n.ignore?i=t[1]:(i=n.ignore.join(`, `),t[0]=n.ignore,t[1]=i);let[a,o]=(0,b.useState)(i),s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(bu,{}),t[2]=s):s=t[2];let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsx)(iu,{render:s,className:`icon-button`,"aria-label":`Settings`,children:(0,Y.jsx)(Cj,{})}),t[3]=c):c=t[3];let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Y.jsx)(wl,{className:`dialog-backdrop`}),t[4]=l):l=t[4];let u,d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsxs)(`header`,{className:`settings-header`,children:[(0,Y.jsx)(Mj,{}),(0,Y.jsx)($l,{children:`Settings`})]}),d=(0,Y.jsx)(El,{className:`muted`,children:`These apply to every tab. What each tab compares stays with the tab.`}),t[5]=u,t[6]=d):(u=t[5],d=t[6]);let f;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(TG,{className:`settings-legend`,children:`Appearance`}),t[7]=f):f=t[7];let p;t[8]===r?p=t[9]:(p=e=>r({theme:e}),t[8]=r,t[9]=p);let m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(m=[{value:`system`,label:`System`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}],t[10]=m):m=t[10];let h;t[11]!==n.theme||t[12]!==p?(h=(0,Y.jsx)(zK,{label:`Theme`,children:(0,Y.jsx)(BK,{label:`Theme`,value:n.theme,onChange:p,options:m})}),t[11]=n.theme,t[12]=p,t[13]=h):h=t[13];let g;t[14]===r?g=t[15]:(g=e=>r({layout:e}),t[14]=r,t[15]=g);let _;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=[{value:`unified`,label:`Unified`},{value:`split`,label:`Split`}],t[16]=_):_=t[16];let v;t[17]!==n.layout||t[18]!==g?(v=(0,Y.jsx)(zK,{label:`Diff layout`,children:(0,Y.jsx)(BK,{label:`Diff layout`,value:n.layout,onChange:g,options:_})}),t[17]=n.layout,t[18]=g,t[19]=v):v=t[19];let y;t[20]===r?y=t[21]:(y=e=>r({wrap:e}),t[20]=r,t[21]=y);let x;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Y.jsx)(RK,{className:`switch-thumb`}),t[22]=x):x=t[22];let S;t[23]!==n.wrap||t[24]!==y?(S=(0,Y.jsx)(zK,{label:`Wrap long lines`,children:(0,Y.jsx)(LK,{className:`switch`,checked:n.wrap,onCheckedChange:y,children:x})}),t[23]=n.wrap,t[24]=y,t[25]=S):S=t[25];let C;t[26]===r?C=t[27]:(C=e=>r({density:e}),t[26]=r,t[27]=C);let w;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(w=[{value:`compact`,label:`Compact`},{value:`default`,label:`Default`},{value:`relaxed`,label:`Relaxed`}],t[28]=w):w=t[28];let T;t[29]!==n.density||t[30]!==C?(T=(0,Y.jsx)(zK,{label:`Sidebar density`,hint:`Row height in the changed file trees`,children:(0,Y.jsx)(BK,{label:`Sidebar density`,value:n.density,onChange:C,options:w})}),t[29]=n.density,t[30]=C,t[31]=T):T=t[31];let E;t[32]!==h||t[33]!==v||t[34]!==S||t[35]!==T?(E=(0,Y.jsxs)(wG,{className:`settings-group`,children:[f,h,v,S,T]}),t[32]=h,t[33]=v,t[34]=S,t[35]=T,t[36]=E):E=t[36];let D;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Y.jsx)(TG,{className:`settings-legend`,children:`Diffs`}),t[37]=D):D=t[37];let O;t[38]===r?O=t[39]:(O=e=>r({wordDiff:e}),t[38]=r,t[39]=O);let k;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(k=[{value:`word-alt`,label:`Words`},{value:`char`,label:`Characters`},{value:`none`,label:`Off`}],t[40]=k):k=t[40];let A;t[41]!==n.wordDiff||t[42]!==O?(A=(0,Y.jsx)(zK,{label:`Highlight changes within a line`,children:(0,Y.jsx)(BK,{label:`Highlight changes within a line`,value:n.wordDiff,onChange:O,options:k})}),t[41]=n.wordDiff,t[42]=O,t[43]=A):A=t[43];let j;t[44]===r?j=t[45]:(j=e=>r({expansionLines:e}),t[44]=r,t[45]=j);let M;t[46]!==n.expansionLines||t[47]!==j?(M=(0,Y.jsx)(zK,{label:`Context lines per expansion`,hint:`How much surrounding code each expand reveals`,children:(0,Y.jsx)(HK,{label:`context lines`,value:n.expansionLines,min:5,max:200,step:5,onChange:j})}),t[46]=n.expansionLines,t[47]=j,t[48]=M):M=t[48];let N;t[49]!==A||t[50]!==M?(N=(0,Y.jsxs)(wG,{className:`settings-group`,children:[D,A,M]}),t[49]=A,t[50]=M,t[51]=N):N=t[51];let P;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Y.jsx)(TG,{className:`settings-legend`,children:`Discovery`}),t[52]=P):P=t[52];let F;t[53]===r?F=t[54]:(F=e=>r({scanDepth:e}),t[53]=r,t[54]=F);let I;t[55]!==n.scanDepth||t[56]!==F?(I=(0,Y.jsx)(zK,{label:`Search depth`,hint:`Directory levels below a workspace folder`,children:(0,Y.jsx)(HK,{label:`levels`,value:n.scanDepth,min:1,max:16,step:1,onChange:F})}),t[55]=n.scanDepth,t[56]=F,t[57]=I):I=t[57];let L;t[58]===r?L=t[59]:(L=e=>r({scanBudget:e}),t[58]=r,t[59]=L);let R;t[60]!==n.scanBudget||t[61]!==L?(R=(0,Y.jsx)(zK,{label:`Directory budget`,hint:`Stop searching after this many directories`,children:(0,Y.jsx)(HK,{label:`directories`,value:n.scanBudget,min:100,max:2e5,step:1e3,onChange:L})}),t[60]=n.scanBudget,t[61]=L,t[62]=R):R=t[62];let z;t[63]!==a||t[64]!==r?(z=()=>r({ignore:a.split(`,`).map(WK).filter(Boolean)}),t[63]=a,t[64]=r,t[65]=z):z=t[65];let B;t[66]!==a||t[67]!==z?(B=(0,Y.jsx)(zK,{label:`Skip these folders`,hint:`Added to the built-in list of dependency and cache folders`,children:(0,Y.jsx)(jM,{className:`input`,"aria-label":`Skip these folders`,placeholder:`target, Build`,value:a,onValueChange:o,onBlur:z})}),t[66]=a,t[67]=z,t[68]=B):B=t[68];let V;t[69]!==I||t[70]!==R||t[71]!==B?(V=(0,Y.jsxs)(wG,{className:`settings-group`,children:[P,I,R,B]}),t[69]=I,t[70]=R,t[71]=B,t[72]=V):V=t[72];let H;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Y.jsx)(`p`,{className:`popup-note`,children:`Discovery never walks inside a repository, so .gitignore never applies. Changes here take effect on the next rescan.`}),t[73]=H):H=t[73];let U;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Y.jsx)(`div`,{className:`settings-actions`,children:(0,Y.jsx)(Tl,{className:`primary-button`,children:`Done`})}),t[74]=U):U=t[74];let ee;return t[75]!==E||t[76]!==N||t[77]!==V?(ee=(0,Y.jsxs)(Ql,{children:[c,(0,Y.jsxs)(Pl,{children:[l,(0,Y.jsxs)(Ml,{className:`settings-dialog`,children:[u,d,E,N,V,H,U]})]})]}),t[75]=E,t[76]=N,t[77]=V,t[78]=ee):ee=t[78],ee}function WK(e){return e.trim()}var GK=/[\\/]+/;function KK(e){return e.split(GK).filter(Boolean)}function qK(e,t){let n=KK(e.root),r=n.at(-1)||e.root,i=t.some(t=>t.root!==e.root&&(KK(t.root).at(-1)||``)===r)&&n.length>1?`${n.at(-2)}/${r}`:r,a=t.filter(t=>t.root===e.root);if(a.length<2)return i;let o=a.findIndex(t=>t.id===e.id);return o>0?`${i} ${o+1}`:i}function JK(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)([]),c=(0,b.useRef)(null),l=(0,b.useRef)(Promise.resolve()),u=(0,b.useRef)(new Map),d=(0,b.useRef)(void 0),f=(0,b.useCallback)(e=>{c.current=e,t(e)},[]),p=(0,b.useCallback)(e=>{let t=l.current.then(()=>nG(`state`,e));return l.current=t.then(()=>{},()=>{}),t.then(e=>(f(e),e),e=>{throw r(e.message),e})},[f]),m=(0,b.useCallback)(async e=>{let t=await p(e),n=t.activeTab;return n&&s(e=>e.includes(n)?e:[...e,n]),t},[p]);(0,b.useEffect)(()=>{let e=!0;return tG(`state`).then(t=>{e&&(f(t),t.activeTab&&s([t.activeTab]))}).catch(t=>e&&r(t.message)),()=>{e=!1}},[f]);let h=(0,b.useCallback)(()=>{clearTimeout(d.current);let e=[...u.current];u.current.clear();for(let[t,n]of e)m({op:`tab`,id:t,...n}).catch(()=>{})},[m]);(0,b.useEffect)(()=>()=>clearTimeout(d.current),[]);let g=(0,b.useCallback)((e,t)=>{let n=u.current.get(e);u.current.set(e,{...n,...t,...n?.repos||t.repos?{repos:{...n?.repos,...t.repos}}:{}}),clearTimeout(d.current),d.current=setTimeout(h,400)},[h]),_=(0,b.useCallback)(e=>{s(t=>t.includes(e)?t:[...t,e]),t(t=>t&&{...t,activeTab:e}),p({op:`activate`,id:e}).catch(()=>{})},[p]),v=(0,b.useCallback)(e=>{t(t=>t&&{...t,settings:{...t.settings,...e}}),p({op:`settings`,settings:e}).catch(()=>{})},[p]),y=(0,b.useCallback)(async()=>{a(!0),r(``);try{let e=(c.current?.tabs||[]).find(e=>e.id===c.current?.activeTab),t=await tG(`choose-directory`,e?{path:e.root}:{});t.path&&await m({op:`open`,root:t.path})}catch(e){r(e instanceof Error?e.message:`Could not open a folder.`)}finally{a(!1)}},[m]),x=(0,b.useCallback)(e=>{s(t=>t.filter(t=>t!==e)),m({op:`close`,id:e}).catch(()=>{})},[m]),S=(0,b.useCallback)(e=>void m({op:`duplicate`,id:e}).catch(()=>{}),[m]),C=(0,b.useCallback)(()=>void m({op:`reopen`}).catch(()=>{}),[m]);return{settings:e?.settings,tabs:e?.tabs||[],recent:e?.recent||[],activeTab:e?.activeTab||null,ready:e!==null,visited:o,error:n,browsing:i,activate:_,browse:y,close:x,duplicate:S,reopen:C,saveTab:g,setSettings:v}}var YK={workerFactory:()=>new AA};function XK(e){let t=(0,kA.c)(31),{store:n,settings:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={weight:`duotone`,size:16},t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=n.tabs.map(e=>{let t=qK(e,n.tabs);return(0,Y.jsxs)($u,{children:[(0,Y.jsxs)(td,{render:(0,Y.jsx)(`span`,{className:`tab`}),children:[(0,Y.jsx)(mu,{className:`tab-label`,value:e.id,title:e.root,children:t}),(0,Y.jsx)(bu,{className:`tab-close`,"aria-label":`Close ${t}`,onClick:()=>n.close(e.id),children:(0,Y.jsx)(Pj,{})})]}),(0,Y.jsx)(Pu,{children:(0,Y.jsx)(nd,{className:`floating`,children:(0,Y.jsxs)(ju,{className:`popup menu`,children:[(0,Y.jsxs)(Au,{className:`menu-item`,onClick:()=>n.duplicate(e.id),children:[(0,Y.jsx)(yj,{}),`Duplicate tab`]}),(0,Y.jsxs)(Au,{className:`menu-item`,onClick:()=>n.close(e.id),children:[(0,Y.jsx)(Pj,{}),`Close tab`]})]})})})]},e.id)}),t[1]=n,t[2]=a);let o;t[3]===a?o=t[4]:(o=(0,Y.jsx)(vu,{className:`tab-list`,"aria-label":`Open workspaces`,children:a}),t[3]=a,t[4]=o);let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(yu,{orientation:`vertical`,className:`tab-separator`}),t[5]=s):s=t[5];let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsx)(bu,{}),t[6]=c):c=t[6];let l;t[7]===n?l=t[8]:(l=()=>void n.browse(),t[7]=n,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(kj,{}),t[9]=u):u=t[9];let d;t[10]!==n.browsing||t[11]!==l?(d=(0,Y.jsx)(ec,{render:c,className:`tab-new`,"aria-label":`Open a workspace folder`,disabled:n.browsing,onClick:l,children:u}),t[10]=n.browsing,t[11]=l,t[12]=d):d=t[12];let f;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(ic,{children:(0,Y.jsx)(Dc,{sideOffset:6,children:(0,Y.jsx)(Oc,{className:`tooltip`,children:`Open a workspace folder`})})}),t[13]=f):f=t[13];let p;t[14]===d?p=t[15]:(p=(0,Y.jsxs)(Ks,{children:[d,f]}),t[14]=d,t[15]=p);let m;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Y.jsx)(`div`,{className:`push`}),t[16]=m):m=t[16];let h;t[17]===n.error?h=t[18]:(h=n.error&&(0,Y.jsx)(`span`,{className:`tab-bar-error`,role:`alert`,children:n.error}),t[17]=n.error,t[18]=h);let g;t[19]!==n.recent||t[20]!==n.reopen?(g=!!n.recent.length&&(0,Y.jsx)(WW,{label:`Reopen ${qK(n.recent[0],n.recent)}`,onClick:n.reopen,children:(0,Y.jsx)(sj,{})}),t[19]=n.recent,t[20]=n.reopen,t[21]=g):g=t[21];let _;t[22]!==r||t[23]!==n.setSettings?(_=(0,Y.jsx)(UK,{settings:r,onChange:n.setSettings}),t[22]=r,t[23]=n.setSettings,t[24]=_):_=t[24];let v;return t[25]!==p||t[26]!==h||t[27]!==g||t[28]!==_||t[29]!==o?(v=(0,Y.jsx)(aj.Provider,{value:i,children:(0,Y.jsxs)(`div`,{className:`tab-bar`,children:[o,s,p,m,h,g,_]})}),t[25]=p,t[26]=h,t[27]=g,t[28]=_,t[29]=o,t[30]=v):v=t[30],v}function ZK(e){let t=(0,kA.c)(112),{tab:n,settings:r,setSettings:i,saveTab:a}=e,o;t[0]!==a||t[1]!==n.id?(o=e=>a(n.id,e),t[0]=a,t[1]=n.id,t[2]=o):o=t[2];let s=cG(n,o),[c,l]=(0,b.useState)(!1),u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=new Set,t[3]=u):u=t[3];let[d,f]=(0,b.useState)(u),{selected:p}=s,m,h;t[4]===p?(m=t[5],h=t[6]):(m=p.flatMap(nq),h=oG(m),t[4]=p,t[5]=m,t[6]=h);let g=h,_;t[7]!==s.entries||t[8]!==s.scanning?(_=s.scanning||s.entries.some(tq),t[7]=s.entries,t[8]=s.scanning,t[9]=_):_=t[9];let v=_,y;t[10]!==d||t[11]!==m.length||t[12]!==p?(y=m.length>0&&p.every(e=>e.data?.files.every(t=>d.has(iG(e.repo.path,t.name)))),t[10]=d,t[11]=m.length,t[12]=p,t[13]=y):y=t[13];let x=y,S;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(e,t){let n=iG(e,t);f(e=>{let t=new Set(e);return t.delete(n),t}),l(!1),requestAnimationFrame(()=>requestAnimationFrame(()=>document.getElementById(n)?.scrollIntoView({block:`start`})))},t[14]=S):S=t[14];let C=S,w;t[15]!==x||t[16]!==p?(w=function(){f(x?new Set:new Set(p.flatMap(eq)))},t[15]=x,t[16]=p,t[17]=w):w=t[17];let T=w,E;t[18]!==r.density||t[19]!==s?(E=(0,Y.jsx)(`div`,{className:`desktop-sidebar`,children:(0,Y.jsx)(xG,{workspace:s,density:r.density,navigate:C})}),t[18]=r.density,t[19]=s,t[20]=E):E=t[20];let D;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Y.jsx)(iu,{className:`icon-button mobile-only`,"aria-label":`Open sidebar`,children:(0,Y.jsx)(jj,{})}),t[21]=D):D=t[21];let O;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Y.jsx)(wl,{className:`dialog-backdrop`}),t[22]=O):O=t[22];let k;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Y.jsx)($l,{className:`sr-only`,children:`Workspace navigation`}),t[23]=k):k=t[23];let A;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Y.jsx)(Tl,{className:`icon-button mobile-close`,"aria-label":`Close sidebar`,children:(0,Y.jsx)(Pj,{})}),t[24]=A):A=t[24];let j;t[25]!==r.density||t[26]!==s?(j=(0,Y.jsxs)(Pl,{children:[O,(0,Y.jsxs)(Ml,{className:`mobile-sidebar`,children:[k,A,(0,Y.jsx)(xG,{workspace:s,density:r.density,navigate:C})]})]}),t[25]=r.density,t[26]=s,t[27]=j):j=t[27];let M;t[28]!==c||t[29]!==j?(M=(0,Y.jsxs)(Ql,{open:c,onOpenChange:l,children:[D,j]}),t[28]=c,t[29]=j,t[30]=M):M=t[30];let N,P;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Y.jsx)(Tj,{}),P=(0,Y.jsx)(`strong`,{children:`Changes`}),t[31]=N,t[32]=P):(N=t[31],P=t[32]);let F;t[33]===m.length?F=t[34]:(F=(0,Y.jsx)(`span`,{className:`count-badge`,children:m.length}),t[33]=m.length,t[34]=F);let I=p.length===1?`repository`:`repositories`,L;t[35]!==p.length||t[36]!==I?(L=(0,Y.jsxs)(`span`,{className:`toolbar-caption`,children:[p.length,` `,I]}),t[35]=p.length,t[36]=I,t[37]=L):L=t[37];let R;t[38]!==F||t[39]!==L?(R=(0,Y.jsxs)(`div`,{className:`review-title`,children:[N,P,F,L]}),t[38]=F,t[39]=L,t[40]=R):R=t[40];let z;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Y.jsx)(`div`,{className:`push`}),t[41]=z):z=t[41];let B=g.added?`+${g.added}`:``,V;t[42]===B?V=t[43]:(V=(0,Y.jsx)(`span`,{className:`added`,children:B}),t[42]=B,t[43]=V);let H=g.removed?`−${g.removed}`:``,U;t[44]===H?U=t[45]:(U=(0,Y.jsx)(`span`,{className:`removed`,children:H}),t[44]=H,t[45]=U);let ee;t[46]!==V||t[47]!==U?(ee=(0,Y.jsxs)(`span`,{className:`diff-stat toolbar-stat`,children:[V,U]}),t[46]=V,t[47]=U,t[48]=ee):ee=t[48];let te;t[49]===r.layout?te=t[50]:(te=[r.layout],t[49]=r.layout,t[50]=te);let ne;t[51]===i?ne=t[52]:(ne=e=>{(e[0]===`split`||e[0]===`unified`)&&i({layout:e[0]})},t[51]=i,t[52]=ne);let W;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Y.jsx)(xl,{value:`unified`,"aria-label":`Unified view`,title:`Unified view`,children:(0,Y.jsx)(Aj,{})}),t[53]=W):W=t[53];let re;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Y.jsx)(xl,{value:`split`,"aria-label":`Split view`,title:`Split view`,children:(0,Y.jsx)(vj,{})}),t[54]=re):re=t[54];let ie;t[55]!==te||t[56]!==ne?(ie=(0,Y.jsxs)(fl,{className:`view-toggle`,"aria-label":`Diff layout`,value:te,onValueChange:ne,children:[W,re]}),t[55]=te,t[56]=ne,t[57]=ie):ie=t[57];let ae;t[58]!==i||t[59]!==r.wrap?(ae=()=>i({wrap:!r.wrap}),t[58]=i,t[59]=r.wrap,t[60]=ae):ae=t[60];let G;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Y.jsx)(cj,{}),t[61]=G):G=t[61];let oe;t[62]!==r.wrap||t[63]!==ae?(oe=(0,Y.jsx)(WW,{label:`Wrap lines`,pressed:r.wrap,onClick:ae,children:G}),t[62]=r.wrap,t[63]=ae,t[64]=oe):oe=t[64];let se=x?`Expand all files`:`Collapse all files`,ce=!m.length,le;t[65]===x?le=t[66]:(le=x?(0,Y.jsx)(fj,{}):(0,Y.jsx)(dj,{}),t[65]=x,t[66]=le);let ue;t[67]!==T||t[68]!==se||t[69]!==ce||t[70]!==le?(ue=(0,Y.jsx)(WW,{label:se,disabled:ce,onClick:T,children:le}),t[67]=T,t[68]=se,t[69]=ce,t[70]=le,t[71]=ue):ue=t[71];let de;t[72]!==M||t[73]!==R||t[74]!==ee||t[75]!==ie||t[76]!==oe||t[77]!==ue?(de=(0,Y.jsxs)(`header`,{className:`review-toolbar`,children:[M,R,z,ee,ie,oe,ue]}),t[72]=M,t[73]=R,t[74]=ee,t[75]=ie,t[76]=oe,t[77]=ue,t[78]=de):de=t[78];let fe;t[79]===s.error?fe=t[80]:(fe=s.error&&(0,Y.jsx)(`p`,{className:`notice`,role:`alert`,children:s.error}),t[79]=s.error,t[80]=fe);let pe;t[81]===s.warnings?pe=t[82]:(pe=s.warnings.map($K),t[81]=s.warnings,t[82]=pe);let me;t[83]!==v||t[84]!==p.length||t[85]!==s.entries?(me=!p.length&&(v?(0,Y.jsx)(ZW,{lines:3,children:`Finding changes across your workspace…`}):(0,Y.jsx)($W,{icon:s.entries.length?(0,Y.jsx)(_j,{}):(0,Y.jsx)(xj,{}),title:s.entries.length?`Nothing selected`:`No repositories here`,children:s.entries.length?`Repositories without changes start deselected. Open the Repositories control to include more, or change what they compare against.`:`This folder has no Git repositories or worktrees inside it.`})),t[83]=v,t[84]=p.length,t[85]=s.entries,t[86]=me):me=t[86];let he;if(t[87]!==d||t[88]!==p||t[89]!==r||t[90]!==s){let e;t[92]!==d||t[93]!==r||t[94]!==s?(e=e=>(0,Y.jsxs)(`section`,{id:iG(e.repo.path),className:`repo-diffs`,"aria-label":`Changes in ${e.repo.name}`,children:[(0,Y.jsxs)(`div`,{className:`repo-divider`,children:[(0,Y.jsx)(`strong`,{children:e.repo.name}),(0,Y.jsxs)(`span`,{children:[e.data?.files.length||0,` files`]}),e.repo.worktree&&(0,Y.jsx)(`span`,{className:`worktree-label`,children:`worktree`}),(0,Y.jsxs)(`span`,{className:`divider-comparison`,children:[e.base,` → `,aG(e.target)]}),(0,Y.jsx)(`span`,{className:`divider-line`}),e.loading&&(0,Y.jsx)(`span`,{role:`status`,children:`Updating…`})]}),e.error?(0,Y.jsxs)(`p`,{role:`alert`,className:`notice`,children:[e.error,(0,Y.jsx)(bu,{className:`text-button`,onClick:()=>void s.reload(e),children:`Retry`})]}):e.loading&&!e.data?(0,Y.jsxs)(ZW,{lines:2,children:[`Loading `,e.repo.name,`…`]}):(0,Y.jsxs)(Y.Fragment,{children:[e.data?.warnings.map(QK),!e.data?.files.length&&(0,Y.jsxs)(`p`,{className:`file-note`,children:[`No changes against `,e.base,`.`]}),(0,Y.jsx)(`div`,{className:`diff-files`,"data-updating":e.loading||void 0,children:e.data?.files.map(t=>(0,Y.jsx)(CG,{entry:e,file:t,settings:r,collapsed:d.has(iG(e.repo.path,t.name)),onCollapse:n=>f(r=>{let i=new Set(r),a=iG(e.repo.path,t.name);return n?i.add(a):i.delete(a),i})},`${e.data.version}:${t.name}`))})]})]},e.repo.path),t[92]=d,t[93]=r,t[94]=s,t[95]=e):e=t[95],he=p.map(e),t[87]=d,t[88]=p,t[89]=r,t[90]=s,t[91]=he}else he=t[91];let ge;t[96]!==m.length||t[97]!==v?(ge=!!m.length&&!v&&(0,Y.jsxs)(`div`,{className:`review-end`,children:[(0,Y.jsx)(_j,{}),(0,Y.jsx)(`span`,{children:`End of changes`})]}),t[96]=m.length,t[97]=v,t[98]=ge):ge=t[98];let _e;t[99]!==fe||t[100]!==pe||t[101]!==me||t[102]!==he||t[103]!==ge?(_e=(0,Y.jsxs)(vA,{className:`review-scroll`,contentClassName:`review-content`,children:[fe,pe,me,he,ge]}),t[99]=fe,t[100]=pe,t[101]=me,t[102]=he,t[103]=ge,t[104]=_e):_e=t[104];let ve;t[105]!==v||t[106]!==de||t[107]!==_e?(ve=(0,Y.jsxs)(`main`,{className:`review-pane`,"aria-busy":v,children:[de,_e]}),t[105]=v,t[106]=de,t[107]=_e,t[108]=ve):ve=t[108];let ye;return t[109]!==ve||t[110]!==E?(ye=(0,Y.jsxs)(Y.Fragment,{children:[E,ve]}),t[109]=ve,t[110]=E,t[111]=ye):ye=t[111],ye}function QK(e){return(0,Y.jsx)(`p`,{className:`notice`,children:e},e)}function $K(e){return(0,Y.jsx)(`p`,{className:`notice`,children:e},e)}function eq(e){return e.data?.files.map(t=>iG(e.repo.path,t.name))||[]}function tq(e){return e.loading}function nq(e){return e.data?.files||[]}function rq(){let e=(0,kA.c)(27),t=JK(),n=t.settings,r=n?.theme,i,a;e[0]===r?(i=e[1],a=e[2]):(i=()=>{r&&(document.documentElement.dataset.theme=r)},a=[r],e[0]=r,e[1]=i,e[2]=a),(0,b.useEffect)(i,a);let o;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(o={weight:`duotone`,size:18},e[3]=o):o=e[3];let s;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(s={},e[4]=s):s=e[4];let c;e[5]===t?c=e[6]:(c=e=>t.activate(String(e)),e[5]=t,e[6]=c);let l;e[7]!==n||e[8]!==t?(l=n&&(0,Y.jsx)(XK,{store:t,settings:n}),e[7]=n,e[8]=t,e[9]=l):l=e[9];let u;e[10]!==n||e[11]!==t.saveTab||e[12]!==t.setSettings||e[13]!==t.tabs||e[14]!==t.visited?(u=n&&t.tabs.filter(e=>t.visited.includes(e.id)).map(e=>(0,Y.jsx)(_u,{value:e.id,keepMounted:!0,className:`workspace-view`,children:(0,Y.jsx)(ZK,{tab:e,settings:n,setSettings:t.setSettings,saveTab:t.saveTab})},e.id)),e[10]=n,e[11]=t.saveTab,e[12]=t.setSettings,e[13]=t.tabs,e[14]=t.visited,e[15]=u):u=e[15];let d;e[16]===t.ready?d=e[17]:(d=!t.ready&&(0,Y.jsx)(`div`,{className:`workspace-view`,children:(0,Y.jsx)(ZW,{lines:2,children:`Restoring your workspaces…`})}),e[16]=t.ready,e[17]=d);let f;e[18]===t?f=e[19]:(f=t.ready&&!t.tabs.length&&(0,Y.jsx)(`div`,{className:`workspace-view`,children:(0,Y.jsxs)($W,{icon:(0,Y.jsx)(xj,{}),title:`Open a workspace`,children:[`Choose a directory containing your repositories and feature worktrees. Every tab remembers its own directory, repositories, and comparison branches.`,(0,Y.jsxs)(bu,{className:`primary-button`,onClick:()=>void t.browse(),disabled:t.browsing,children:[(0,Y.jsx)(xj,{}),t.browsing?`Choosing…`:`Choose a folder`]})]})}),e[18]=t,e[19]=f);let p;return e[20]!==t.activeTab||e[21]!==c||e[22]!==l||e[23]!==u||e[24]!==d||e[25]!==f?(p=(0,Y.jsx)(aj.Provider,{value:o,children:(0,Y.jsx)(kc,{delay:350,children:(0,Y.jsx)(bT,{poolOptions:YK,highlighterOptions:s,children:(0,Y.jsxs)(lu,{className:`app-shell`,value:t.activeTab,onValueChange:c,children:[l,u,d,f]})})})}),e[20]=t.activeTab,e[21]=c,e[22]=l,e[23]=u,e[24]=d,e[25]=f,e[26]=p):p=e[26],p}(0,OA.createRoot)(document.getElementById(`root`)).render((0,Y.jsx)(b.StrictMode,{children:(0,Y.jsx)(rq,{})}));export{s as t};
2800
+ }`}var hP=new WeakMap;function gP(e){let t=hP.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(FM,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),hP.set(e,i),i}function _P(e,t){if(!e.isConnected)return;let n=gP(t);if(n==null)return;let r=t.querySelector(`style[${IM}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(IM,``),t.appendChild(i)),i.textContent=`:host { ${LM}: ${n}px; }`}var vP;function yP(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){vP??(vP=new CSSStyleSheet,vP.replaceSync(pP(dP)));let t=!1;try{e.adoptedStyleSheets=[vP],t=!0}catch{}if(t){e.querySelector(`style[${NM}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(NM,``),t.textContent=pP(dP),e.prepend(t)}}function bP(e,t){xP(e,t),yP(t),_P(e,t)}function xP(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});bP(this,e)}}if(customElements.define(MM,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(MM)))e instanceof HTMLElement&&bP(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var SP=5,CP=32,wP=128;function TP(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function EP(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function DP(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function OP(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function kP(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function AP(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function jP(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,FP(e,t)}function MP(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=OP(e).get(t);if(i===void 0)return;let a=i>>SP;e.childVisibleChunkSums[a]+=r}function NP(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=IP(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=CP}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function PP(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>SP;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<SP}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function FP(e,t){if(t.childIds.length<wP){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/CP),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>SP]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function IP(e,t,n,r){let i=Math.min(t.childIds.length,n+CP),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var LP=7,RP=3,zP=8,BP=4;function VP(e,t,n=0){return e<<BP|n<<RP|t}function HP(e){return e.depthAndFlags>>>BP}function UP(e){return(e.depthAndFlags&zP)>>RP}function WP(e){return(e.depthAndFlags&zP)!==0}function GP(e){return e.depthAndFlags&LP}function KP(e,t){return(GP(e)&t)!==0}function qP(e,t){e.depthAndFlags|=t}function JP(e,t){e.depthAndFlags=VP(t,GP(e),UP(e))}var YP=Symbol(`benchmarkInstrumentation`);function XP(e,t){return t==null||Object.defineProperty(e,YP,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function ZP(e){return e==null?null:e[YP]??null}function QP(e,t,n){return e==null?n():e.measurePhase(t,n)}function $P(e,t,n){Number.isFinite(n)&&e!=null&&e.setCounter(t,n)}function eF(e){return e>=48&&e<=57}function tF(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!eF(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&eF(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function nF(e){let t=e.toLowerCase();return{lowerValue:t,tokens:tF(t)}}function rF(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function iF(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=rF(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function aF(e,t,n){let r=iF(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function oF(e,t){return aF(e,t,nF)}function sF(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function cF(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=sF(e,r);return a===sF(t,r)?oF(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function lF(e,t){return cF(e,t)}function uF(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=nF(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=sF(e,n);return o===sF(t,n)?aF(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function dF(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=nF(r);return e.sortKeyById[t]=i,i}function fF(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function pF(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function mF(e){let{hasTrailingSlash:t,segments:n}=pF(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function hF(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=pF(e);return{requiresDirectory:t,segments:n}}function gF(){let e=new Map;return e.set(``,0),{idByValue:e,valueById:[``],sortKeyById:[nF(``)]}}function _F(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function vF(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var yF=Symbol(`pathStorePreparedInputKind`);function bF(e,t){return e[yF]=t,e}function xF(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function SF(e,t,n){return n==="default"?lF(e,t):n(xF(e),xF(t))}function CF(){return{depthAndFlags:VP(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function wF(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function TF(e){return e.isDirectory?e.segments.length:e.segments.length-1}function EF(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function DF(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function OF(e,t={}){return PF(e,t).map(e=>e.path)}function kF(e,t={}){let n=PF(e,t);return bF({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function AF(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return bF({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function jF(e){let t=e,n=t.preparedPaths;if(t[yF]===`prepared`&&n!=null)return n;if(!EF(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function MF(e){let t=e;return t[yF]===`presorted`&&t.presortedPaths!=null||DF(t.presortedPaths)?t.presortedPaths:null}function NF(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function PF(e,t={}){let n=fF(t),r=ZP(t);$P(r,`workload.inputFiles`,e.length);let i=QP(r,`store.preparePathEntries.parse`,()=>e.map(e=>mF(e)));return QP(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>SF(e,t,n.sort))),i}var FF=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[CF()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=gF();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=ZP(e),this.options=fF(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,TP())}appendPaths(e){return QP(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>mF(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,QP(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return QP(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null){if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:VP(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:VP(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d,m=a+1}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:VP(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=mF(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null){if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:VP(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:VP(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=mF(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(QP(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||QP(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?uF(this.lastPreparedPath,e,this.segmentSortKeyCache):SF(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=TF(e),i=n==null?0:TF(n),a=n==null?0:wF(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=_F(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:VP(HP(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),kP(i,s),s}createFileChildUnchecked(e,t){let n=_F(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:VP(HP(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),kP(r,a),a}getOrCreateDirectoryChild(e,t){let n=_F(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!WP(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:VP(HP(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),kP(r,a),this.directories.set(a,TP()),a}createDirectoryChild(e,t){let n=_F(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:VP(HP(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),kP(r,a),this.directories.set(a,TP()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!WP(n))throw Error(`Path is not a directory: "${t}"`);if(KP(n,1))throw Error(`Duplicate path: "${t}"`);qP(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,EP());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(WP(a)){let t=EP();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;WP(n)&&this.directories.set(t,TP());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),kP(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!WP(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return jP(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function IF(e,t=`closed`,n=null){let r=RF(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function LF(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function RF(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function zF(e,t){return KP(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion!==`closed`&&HP(t)<=e.defaultExpansion}function BF(e,t,n=e.snapshot.nodes[t]){return n==null||!WP(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:zF(e,n)}function VF(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!WP(r))return;let i=zF(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function HF(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function UF(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function WF(e,t){let n=HF(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function GF(e,t){let n=HF(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function KF(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function qF(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function JF(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function YF(e,t){e.directoryLoadInfoById.delete(t)}function XF(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function ZF(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function QF(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function $F(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function eI(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function tI(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function nI(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function rI(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function iI(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function aI(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function oI(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function sI(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function cI(e,t,n){return{...n,visibleCountDelta:yI(e)-t}}function lI(e,t){let n=yI(e),r=LF();e.transactionStack.push(r);try{t()}catch(t){throw fI(e,r,!1),t}fI(e,r,!0,yI(e)-n)}function uI(e,t){let n=e.instrumentation;if(n==null){dI(e,t);return}QP(n,`store.events.record`,()=>dI(e,t))}function dI(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){_I(e,t);return}n.events.push(t),gI(n,t)}function fI(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?hI(i,t):QP(n,`store.events.batch.merge`,()=>hI(i,t));return}let a=pI(t,r),o=e.instrumentation;if(o==null){_I(e,a);return}QP(o,`store.events.batch.commit`,()=>_I(e,a))}function pI(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function mI(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function hI(e,t){for(let n of t.events)e.events.push(n);mI(e,t)}function gI(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function _I(e,t){let n=e.instrumentation;if(n==null){vI(e,t);return}QP(n,`store.events.emit`,()=>vI(e,t))}function vI(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function yI(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function bI(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!WP(n)||KP(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!WP(a)?null:i}function xI(e,t){let n=t;for(;;){let t=bI(e,n);if(t==null)return n;n=t}}function SI(e,t){let n=[t],r=t;for(;;){let t=bI(e,r);if(t==null)return n;n.push(t),r=t}}function CI(e,t){let n=t==null?e.snapshot.rootId:NI(e,t);return n==null?[]:LI(e,n)}function wI(e,t){let n=mF(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=QI(e,ZI(e,r)),{createdNodeIds:a,directoryId:o}=RI(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=II(e,o);if(KP(n,1))throw Error(`Path already exists: "${t}"`);qP(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=BI(e,o,n.basename),s.add(c);AI(e,o);let l=QI(e,o);return ZF({affectedAncestorIds:MI(e,c),affectedNodeIds:[...s],path:t,projectionChanged:$I(i,l)})}function TI(e,t,n){let r=NI(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=II(e,r);if(KP(i,2))throw Error(`The root node cannot be removed`);if(WP(i)&&FI(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=QI(e,a),s=YI(e,r);UI(e,a,r,i.nameId),XI(e,a),AI(e,a);let c=QI(e,a);return QF({affectedAncestorIds:MI(e,a),affectedNodeIds:s,path:t,projectionChanged:$I(o,c),recursive:n.recursive===!0})}function EI(e,t,n,r){let i=NI(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=II(e,i);if(KP(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=qI(e,i,n),c=QI(e,a.parentId),l=QI(e,s.parentId),u=vF(e.snapshot.segmentTable,a.nameId),d=_F(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(WP(a)&&rL(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=DP(e.snapshot.nodes,FI(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&JI(e,p,o,UP(a))===`skip`)return null;let m=a.parentId;UI(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),nL(e,i),HI(e,s.parentId,i),XI(e,m),e.pathCacheVersion++,AI(e,m),s.parentId!==m&&AI(e,s.parentId);let h=QI(e,m),g=QI(e,s.parentId);return $F({affectedAncestorIds:[...new Set([...MI(e,m),...MI(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:eL([c,l],[h,g]),to:kI(e,i)})}function DI(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function OI(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function kI(e,t){let n=II(e,t),r=DI(e,t);if(r!=null)return r;if(KP(n,2))return OI(e,t,``);let i=kI(e,n.parentId),a=vF(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return OI(e,t,WP(n)?`${o}/`:o)}function AI(e,t){let n=e.instrumentation;if(n==null){aL(e,t);return}QP(n,`store.recomputeCountsUpwardFrom`,()=>aL(e,t))}function jI(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!WP(o)){iL(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){iL(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function MI(e,t){let n=[],r=t;for(;r!=null;){let t=II(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function NI(e,t){if(t.length===0)return e.snapshot.rootId;let n=hF(t);return PI(e,n.segments,n.requiresDirectory)}function PI(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=FI(e,r),a=DP(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=II(e,r);return n&&!WP(i)?null:r}function FI(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function II(e,t){let n=e.snapshot.nodes[t];if(n===void 0||KP(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function LI(e,t){let n=e.snapshot.nodes[t];if(n===void 0||KP(n,4))return[];if(!WP(n))return[kI(e,t)];if(FI(e,t).childIds.length===0)return KP(n,1)&&!KP(n,2)?[kI(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||KP(n,4)){i.pop();continue}if(!WP(n)){r.push(kI(e,t.nodeId)),i.pop();continue}let a=FI(e,t.nodeId);if(a.childIds.length===0){KP(n,1)&&!KP(n,2)&&r.push(kI(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function RI(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=_F(e.snapshot.segmentTable,i),a=FI(e,r),o=DP(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!WP(II(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=zI(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function zI(e,t,n){let r=II(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:VP(HP(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,TP()),HI(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function BI(e,t,n){let r=_F(e.snapshot.segmentTable,n),i=FI(e,t);if(DP(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${sL(e,t,n)}"`);let a=II(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:VP(HP(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),HI(e,t,o),e.activeNodeCount++,o}function VI(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}WI(e,n,o)<0?i=a:r=a+1}return r}function HI(e,t,n){let r=FI(e,t),i=II(e,n);DP(e.snapshot.nodes,r).set(i.nameId,n),MP(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=VI(e,r,n);r.childIds.splice(a,0,n),AP(r,a),FP(e.snapshot.nodes,r)}function UI(e,t,n,r){let i=FI(e,t),a=OP(i),o=a.get(n)??-1;DP(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&MP(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),AP(i,o),FP(e.snapshot.nodes,i))}function WI(e,t,n){let r=e.snapshot.options.sort;return r==="default"?GI(e,t,n):r(KI(e,t),KI(e,n))}function GI(e,t,n){let r=II(e,t),i=II(e,n),a=WP(r);if(a!==WP(i))return a?-1:1;let o=iF(dF(e.snapshot.segmentTable,r.nameId),dF(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=vF(e.snapshot.segmentTable,r.nameId),c=vF(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function KI(e,t){let n=II(e,t),r=kI(e,t),i=WP(n),a=i?r.slice(0,-1):r;return{basename:vF(e.snapshot.segmentTable,n.nameId),depth:HP(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function qI(e,t,n){let r=II(e,t),i=NI(e,n);if(i!=null){let t=II(e,i);if(WP(t))return{basename:vF(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=hF(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=hF(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:PI(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function JI(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${kI(e,t)}"`);let i=II(e,t);if(UP(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(WP(i)&&FI(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return YI(e,t),UI(e,a,t,o),XI(e,a),AI(e,a),`handled`}function YI(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=II(e,t.nodeId);if(t.visitedChildren||!WP(i)){WP(i)&&e.snapshot.directories.delete(t.nodeId),qP(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),YF(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=FI(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function XI(e,t){let n=t;for(;n!=null;){let t=II(e,n);if(!WP(t)||KP(t,2)||FI(e,n).childIds.length>0)return;qP(t,1),n=t.parentId===n?null:t.parentId}}function ZI(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=DP(e.snapshot.nodes,FI(e,n)).get(t);if(i==null||!WP(II(e,i)))break;n=i}return n}function QI(e,t){let n=tL(e,t);if(n==null)return null;let r=xI(e,n),i=II(e,r),a=n===r?null:SI(e,n).map(t=>kI(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:FI(e,r).childIds.length>0,path:kI(e,r),terminalKind:UP(i)})}function $I(e,t){return eL([e],[t])}function eL(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function tL(e,t){let n=t;for(;n!=null;){let t=II(e,n);if(!WP(t)||KP(t,2))return null;if(!BF(e,n,t))return n;n=t.parentId}return null}function nL(e,t){let n=II(e,t);if(JP(n,(t===e.snapshot.rootId?-1:HP(II(e,n.parentId)))+1),!WP(n))return;let r=FI(e,t);for(let t of r.childIds)nL(e,t)}function rL(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=II(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function iL(e,t,n=II(e,t),r=!1){let i=e.instrumentation;if(i==null){oL(e,t,n,r);return}QP(i,`store.recomputeNodeCounts`,()=>oL(e,t,n,r))}function aL(e,t){let n=t;for(;n!=null;){let t=II(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(iL(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&MP(FI(e,s),n,a,o),n=s}}function oL(e,t,n,r){if(!WP(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=FI(e,t);if(r){let t=e.instrumentation;t==null?jP(e.snapshot.nodes,i):QP(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>jP(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,KP(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=bI(e,t)==null?BF(e,t,n)?1+o:1:o}function sL(e,t,n){let r=kI(e,t);return r.length===0?n:`${r}${n}`}function cL(e){return e!=null&&!KP(e,4)}function lL(e,t){let n=e.snapshot.nodes[t];return!cL(n)||!WP(n)||KP(n,2)?null:n}function uL(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&cL(e.snapshot.nodes[n])&&(t+=1);return t}function dL(e){return Math.max(0,e.valueById.length-1)}function fL(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:uL(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:dL(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function pL(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function mL(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)lL(e,n)!=null&&t.push(kI(e,n));for(let t of e.expandedDirectoryIds)lL(e,t)!=null&&n.push(kI(e,t));return{collapsedPaths:t,expandedPaths:n}}function hL(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)lL(e,n)!=null&&UF(e,n)!==`loaded`&&t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:kI(e,n)});return t}function gL(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=NI(e,n);t!=null&&VF(e,t,!0,II(e,t))}for(let n of t.collapsedPaths){let t=NI(e,n);t!=null&&VF(e,t,!1,II(e,t))}}function _L(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=NI(e,n.path);t!=null&&lL(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function vL(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function yL(e){let t=e.snapshot.segmentTable,n=gF();for(let r of e.snapshot.nodes)if(cL(r)){if(KP(r,2)){r.nameId=0;continue}r.nameId=_F(n,vF(t,r.nameId))}e.snapshot.segmentTable=n}function bL(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!cL(r)||!WP(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return cL(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[II(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),jP(e.snapshot.nodes,n)}}function xL(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(cL(n))break;--t}e.snapshot.nodes.length=t+1}function SL(e){let t=mL(e),n=hL(e);QP(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>vL(e)),QP(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>yL(e)),QP(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>bL(e)),QP(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>xL(e)),QP(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>gL(e,t)),QP(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>_L(e,n)),QP(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>jI(e,e.snapshot.rootId))}function CL(e){let t=mL(e),n=hL(e),r=QP(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>CI(e)),i=XP({...e.snapshot.options},e.instrumentation),a=QP(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new FF(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,QP(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>gL(e,t)),QP(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>_L(e,n)),QP(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>jI(e,e.snapshot.rootId))}function wL(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function TL(e,t){let n=fL(e);t===`stable`?QP(e.instrumentation,`store.cleanup.stable`,()=>SL(e)):QP(e.instrumentation,`store.cleanup.aggressive`,()=>CL(e));let r=fL(e);return pL(t,t===`stable`,n,r)}var EL=64;function DL(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function OL(e){return II(e,e.snapshot.rootId).visibleSubtreeCount}function kL(e,t,n,r){let i=II(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function AL(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:YL(e,t.cursor),setSize:t.setSize,subtreeEndIndex:kL(e,t.cursor,t.index,n)}}function jL(e,t,n,r,i,a){let o=FI(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=NP(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return ML(e,u,l,r+c,i+1,s,o.childIds.length,a)}function ML(e,t,n,r,i,a,o,s){if(!WP(II(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=UL(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=II(e,c.terminalNodeId);if(!WP(l)||!BF(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return jL(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function NL(e,t){let n=OL(e);if(t<0||t>=n)return null;let r=jL(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>kI(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=AL(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:YL(e,r.cursor),setSize:r.setSize,subtreeEndIndex:kL(e,r.cursor,r.index,n)}}function PL(e,t,n){let r=e.instrumentation,i=OL(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return JL(e,o+1);let t=[],n=BL(e,a);for(let r=a;r<=o&&n!=null;r++){let r=YL(e,n);t.push(r),n=GL(e,n)}return t}let s=[],c=0,l=0,u=QP(r,`store.getVisibleSlice.selectFirstRow`,()=>BL(e,a));for(let t=a;t<=o&&u!=null;t++){let t=QP(r,`store.getVisibleSlice.materializeRow`,()=>YL(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=QP(r,`store.getVisibleSlice.advanceCursor`,()=>GL(e,u))}return $P(r,`workload.visibleRowsRead`,s.length),$P(r,`workload.flattenedRowsRead`,c),$P(r,`workload.flattenedSegmentsRead`,l),s}function FL(e,t=OL(e)){let n=e.instrumentation;return n==null?qL(e,t):QP(n,`store.getVisibleTreeProjection`,()=>qL(e,t))}function IL(e){return KL(FL(e))}function LL(e,t){let n=NI(e,t);if(n==null||n===e.snapshot.rootId||WP(II(e,n))&&xI(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=II(e,i).parentId,n=FI(e,t),s=OP(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=PP(a,n,s),t!==o){let n=II(e,t),a=bI(e,t);if(!BF(e,t,n)&&a!==i)return null;xI(e,t)===t&&(r+=1)}i=t}return r}function RL(e,t){let n=NI(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=II(e,n);if(!WP(r))throw Error(`Path is not a directory: "${t}"`);return BF(e,n,r)?null:(VF(e,n,!0,r),AI(e,n),eI({affectedAncestorIds:MI(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function zL(e,t){let n=NI(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=II(e,n);if(!WP(r))throw Error(`Path is not a directory: "${t}"`);return BF(e,n,r)?(VF(e,n,!1,r),AI(e,n),tI({affectedAncestorIds:MI(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function BL(e,t){return t<0||t>=OL(e)?null:VL(e,e.snapshot.rootId,t,-1)}function VL(e,t,n,r){let i=FI(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?NP(e.snapshot.nodes,i,n):QP(a,`store.getVisibleSlice.selectChildIndex`,()=>NP(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return HL(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function HL(e,t,n,r){if(!WP(II(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=UL(e,t,r);if(n===0)return i;let a=II(e,i.terminalNodeId);if(!WP(a)||!BF(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return VL(e,i.terminalNodeId,n-1,i.visibleDepth)}function UL(e,t,n){return WP(II(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:xI(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:QP(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>xI(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function WL(e,t){let n=II(e,t);if(!WP(n))return!0;let r=n.parentId;return r===e.snapshot.rootId||bI(e,r)!==t}function GL(e,t){let n=II(e,t.terminalNodeId);if(WP(n)){let r=FI(e,t.terminalNodeId);if(BF(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:HL(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=II(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=FI(e,n),o=OP(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return HL(e,s,0,i);WL(e,r)&&i--,r=n}}function KL(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function qL(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(EL);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=DL(o,y);let x,S=_;if(WP(v))S=f?xI(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:kI(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&WP(C)&&BF(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function JL(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!WP(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:kI(e,f)};continue}let h=l?xI(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=YL(e,g);let _=i[h];_!=null&&WP(_)&&BF(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function YL(e,t){let n=II(e,t.terminalNodeId),r=WP(n)?XL(e,t):null,i=kI(e,t.terminalNodeId),a=vF(e.snapshot.segmentTable,n.nameId),o=WP(n)&&FI(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?SI(e,t.headNodeId).map(n=>{let r=II(e,n);return{isTerminal:n===t.terminalNodeId,name:vF(e.snapshot.segmentTable,r.nameId),nodeId:n,path:kI(e,n)}}):QP(c,`store.getVisibleSlice.flatten.collectSegments`,()=>SI(e,t.headNodeId).map(n=>{let r=II(e,n);return{isTerminal:n===t.terminalNodeId,name:vF(e.snapshot.segmentTable,r.nameId),nodeId:n,path:kI(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:WP(n)&&BF(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:WP(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function XL(e,t){if(t.headNodeId===t.terminalNodeId)return UF(e,t.terminalNodeId);let n=SI(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=UF(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}var ZL=8;function QL(e){let{nodes:t,directories:n,rootId:r,options:i}=e,a=t.length,o=new Int32Array(a),s=new Int32Array(a),c=new Int32Array(a),l=new Int32Array(a),u=new Int32Array(a),d=new Int32Array(a),f=new Int32Array(a);for(let e=0;e<a;e+=1){let n=t[e];n!=null&&(o[e]=n.parentId,s[e]=n.nameId,c[e]=n.depthAndFlags,l[e]=n.subtreeNodeCount,u[e]=n.visibleSubtreeCount)}let p=0;for(let e of n.values())p+=e.childIds.length;let m=new Int32Array(p),h=0;for(let[e,t]of n){let n=t.childIds;d[e]=h,f[e]=n.length;for(let e=0;e<n.length;e+=1)m[h]=n[e],h+=1}return{nodeCount:a,rootId:r,flattenEmptyDirectories:i.flattenEmptyDirectories===!0,parentId:o,nameId:s,depthAndFlags:c,subtreeNodeCount:l,visibleSubtreeCount:u,childStart:d,childCount:f,childIdsFlat:m}}function $L(e){let{nodeCount:t,rootId:n,flattenEmptyDirectories:r,depthAndFlags:i,subtreeNodeCount:a,visibleSubtreeCount:o,childStart:s,childCount:c,childIdsFlat:l}=e;for(let e=t-1;e>=1;--e){if((i[e]&ZL)===0)continue;let t=s[e],n=c[e],u=0,d=0;for(let e=0;e<n;e+=1){let n=l[t+e];u+=a[n],d+=o[n]}a[e]=1+u;let f;f=r&&n===1?(i[l[t]]&ZL)===0?1+d:d:1+d,o[e]=f}let u=s[n],d=c[n],f=0,p=0;for(let e=0;e<d;e+=1){let t=l[u+e];f+=a[t],p+=o[t]}a[n]=1+f,o[n]=p}function eR(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!WP(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&FP(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&WP(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,FP(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function tR(e){let{directories:t,nodes:n,rootId:r}=e.snapshot,i=QL(e.snapshot);$L(i);let a=i.subtreeNodeCount,o=i.visibleSubtreeCount;for(let e=0;e<n.length;e+=1){let t=n[e];t!=null&&(t.subtreeNodeCount=a[e],t.visibleSubtreeCount=o[e])}for(let[e,i]of t){let t=i.childIds,a=t.length,o=0,s=0;for(let e=0;e<a;e++){let r=t[e];if(r==null)continue;let i=n[r];o+=i.subtreeNodeCount,s+=i.visibleSubtreeCount}i.totalChildSubtreeNodeCount=o,i.totalChildVisibleSubtreeCount=s,(e===r||a>=128)&&FP(n,i)}}function nR(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var rR=class e{#e;constructor(e={}){let t=ZP(e),n=QP(t,`store.builder.create`,()=>new FF(e));if(e.preparedInput!=null){let t=MF(e.preparedInput);t==null?n.appendPreparedPaths(jF(e.preparedInput),!1):n.appendPresortedPaths(t,NF(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(QP(t,`store.preparePathEntries`,()=>PF(r,e)))}let r=QP(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=QP(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=QP(t,`store.state.create`,()=>IF(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:QP(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||nR(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&QP(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?e.useSoaCountSweep===!0?QP(t,`store.state.initializeOpenVisibleCountsViaSoa`,()=>tR(this.#e)):QP(t,`store.state.initializeOpenVisibleCounts`,()=>eR(this.#e)):QP(t,`store.state.recomputeCounts`,()=>jI(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return OF(e,t)}static prepareInput(e,t={}){return kF(e,t)}static preparePresortedInput(e){return AF(e)}list(e){return QP(this.#e.instrumentation,`store.list`,()=>CI(this.#e,e))}add(e){QP(this.#e.instrumentation,`store.add`,()=>{let t=OL(this.#e);uI(this.#e,cI(this.#e,t,wI(this.#e,e)))})}remove(e,t={}){QP(this.#e.instrumentation,`store.remove`,()=>{let n=OL(this.#e);uI(this.#e,cI(this.#e,n,TI(this.#e,e,t)))})}move(e,t,n={}){QP(this.#e.instrumentation,`store.move`,()=>{let r=OL(this.#e),i=EI(this.#e,e,t,n);i!=null&&uI(this.#e,cI(this.#e,r,i))})}batch(e){lI(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision})}})}getVisibleCount(){return QP(this.#e.instrumentation,`store.getVisibleCount`,()=>OL(this.#e))}getVisibleSlice(e,t){return QP(this.#e.instrumentation,`store.getVisibleSlice`,()=>PL(this.#e,e,t))}getVisibleRowContext(e){return QP(this.#e.instrumentation,`store.getVisibleRowContext`,()=>NL(this.#e,e))}getVisibleTreeProjection(){return IL(this.#e)}getVisibleTreeProjectionData(e){return FL(this.#e,e)}getVisibleIndex(e){return QP(this.#e.instrumentation,`store.getVisibleIndex`,()=>LL(this.#e,e))}getPathInfo(e){return QP(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=NI(this.#e,e);if(t==null)return null;let n=II(this.#e,t);return{depth:HP(n),kind:WP(n)?`directory`:`file`,path:kI(this.#e,t)}})}isExpanded(e){return QP(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=II(this.#e,t);return BF(this.#e,t,n)})}expand(e){QP(this.#e.instrumentation,`store.expand`,()=>{let t=OL(this.#e),n=RL(this.#e,e);n!=null&&uI(this.#e,cI(this.#e,t,n))})}collapse(e){QP(this.#e.instrumentation,`store.collapse`,()=>{let t=OL(this.#e),n=zL(this.#e,e);n!=null&&uI(this.#e,cI(this.#e,t,n))})}on(e,t){return XF(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return UF(this.#e,t)}markDirectoryUnloaded(e){QP(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(FI(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=OL(this.#e);GF(this.#e,t),uI(this.#e,cI(this.#e,n,nI({affectedAncestorIds:MI(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return QP(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=OL(this.#e),r=WF(this.#e,t);return uI(this.#e,cI(this.#e,n,rI({affectedAncestorIds:MI(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return QP(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||UF(this.#e,n)!==`loading`||!qF(this.#e,n,e.attemptId))return!1;let r=kI(this.#e,n);this.validateChildPatch(r,t);let i=OL(this.#e),a=[];for(let e of t.operations){iR(r,e);let t=OL(this.#e);switch(e.type){case`add`:a.push(cI(this.#e,t,wI(this.#e,e.path)));break;case`remove`:a.push(cI(this.#e,t,TI(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=EI(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(cI(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return uI(this.#e,cI(this.#e,i,iI({affectedAncestorIds:MI(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:kI(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return QP(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=OL(this.#e),r=KF(this.#e,t,e.attemptId);return uI(this.#e,cI(this.#e,n,aI({affectedAncestorIds:MI(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:kI(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return QP(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=OL(this.#e),i=JF(this.#e,n,e.attemptId,t);return uI(this.#e,cI(this.#e,r,oI({affectedAncestorIds:MI(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:kI(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return QP(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(wL(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=OL(this.#e),n=TL(this.#e,e.mode??`stable`);return uI(this.#e,cI(this.#e,t,sI({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=FI(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??nF(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=iF(dF(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!WP(II(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=II(this.#e,n);BF(this.#e,n,i)||(VF(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=II(this.#e,e);if(!BF(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=NI(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!WP(II(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!WP(II(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=II(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=II(this.#e,e),r=bI(this.#e,e);if(!BF(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function iR(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`)}}var aR=e=>e.startsWith(`f::`)?e.slice(3):e;function oR(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function sR(e,t){return e===``?t:`${e}/${t}`}function cR({files:e,path:t,isFolder:n,nextBasename:r}){let i=aR(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=oR(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=sR(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function lR(e){return e.endsWith(`/`)}function uR(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function dR(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function fR(e,t){return t.includes(e)?dR(t):[e]}function pR(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function mR(e,t){return{draggedPaths:e,target:t}}function hR(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(lR(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function gR(e,t){return t.kind===`root`||t.directoryPath==null?uR(e):t.directoryPath}function _R(e,t){let n=e.map(e=>{let n=gR(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function vR(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function yR(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!vR(rR.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function bR(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function xR(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function SR(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function CR(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return SR(e,t.path)?n?e:null:e;case`move`:return xR(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=CR(r,e,n),r==null)return null;return r}}}function wR(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function TR(e){switch(e.operation){case`add`:return{...wR(e),operation:`add`,path:e.path};case`remove`:return{...wR(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...wR(e),from:e.from,operation:`move`,to:e.to}}}function ER(e){return{...wR(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>TR(e)),operation:`batch`}}function DR(e){switch(e.operation){case`add`:case`remove`:case`move`:return TR(e);case`batch`:return ER(e);default:return null}}function OR(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function kR(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function AR(e){return kR(e).at(-1)??null}function jR(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function MR(e){return e.endsWith(`/`)}var NR=e=>e.toLowerCase();function PR(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function FR(e){return e.endsWith(`/`)?e.slice(0,-1):e}function IR(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var LR=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},RR=Symbol(`FILE_TREE_RENAME_VIEW`),zR=512,BR=512;function VR(e){return e===`top`||e===`center`?e:`nearest`}function HR(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=kR(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function UR(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:HR(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var WR=class e{static{Object.defineProperty(e.prototype,RR,{configurable:!0,value(){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}},writable:!0})}#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=yR({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=AR(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:VR(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=BR){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t!=null&&this.#B.has(t)&&this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=fR(t,n);return this.#r.canDrag?.(r)!==!1&&(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=mR(t.draggedPaths,n);(hR(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}pR(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=mR(e.draggedPaths,t);if(hR(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=_R(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=MR(r),a=FR(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of kR(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=PR(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,MR(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,MR(e)?{recursive:!0}:void 0);return}let t=MR(e),n=cR({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:FR(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(IR(n.sourcePath,t),IR(n.destinationPath,t))}#Y(e){this.#T!=null&&this.#E!==e&&(this.#E=e,this.#De())}resetPaths(e,t={}){let n=!Array.isArray(e),r=n?void 0:e,i=n?e:t,a=this.#H.list().length,o=this.#G,s=yR({paths:r,preparedInput:i.preparedInput},`resetPaths`,this.#e.sort),c=this.#le(s.paths,s.preparedInput,i.initialExpandedPaths),l=this.#c,u=this.#T,d=this.getSelectedPaths(),f=this.#z;this.#K?.(),this.#H=c,this.#d.clear(),this.#he();let p=d.map(e=>c.getPathInfo(e)?.path??null).filter(e=>e!=null),m=!OR(this.#B,p);this.#B=new Set(p),m&&(this.#V+=1),this.#z=f==null?null:c.getPathInfo(f)?.path??null,this.#T=u==null?null:c.getPathInfo(u)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(l,l!=null||p.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:s.paths.length,pathCountBefore:a,projectionChanged:!0,usedPreparedInput:i.preparedInput!=null,visibleCountDelta:this.#G-o})}#X(e){this.#Ie();let t=AR(e),n=jR(e,t),r=null,i=null;for(let e of this.#be()){if(AR(e)!==t)continue;let a=jR(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=kR(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!OR(this.#B,r),a=this.#z!==t;(i||a)&&(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new rR({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of kR(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(NR),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(NR),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of kR(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:LR(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of kR(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of kR(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=UR(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,zR)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s!==e||this.#c!==n)&&(this.#s=e,this.#c=n,t&&this.#De())}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=CR(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=CR(this.#c,e,!0),r=[...this.#B].map(t=>CR(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=CR(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return OR(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&bR(e)&&(this.#i=null);let t=bR(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=DR(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},GR=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function KR(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(e[t]!==`/`&&t!==e.length){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function qR(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=[],r=0;for(;;){let e=t.indexOf(`/`,r);if(e===-1)break;n.push(t.slice(0,e+1)),r=e+1}return n}function JR(e,t){return t?`${e}/`:e}function YR(e,t=null){let n=GR(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set,o=new Map;for(let t of e??[]){let e=ZR(t);e!=null&&ez({canonicalPath:e.canonicalPath,changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,isDirectory:e.isDirectory,status:t.status,statusByPath:r})}return r.size===0?null:{changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}function XR(e,t){let n=t?.remove??[],r=t?.set??[];if(n.length===0&&r.length===0)return e;let i=new Map(e?.statusByPath),a=new Set(e?.directoriesWithChanges),o=new Set(e?.ignoredDirectoryPaths),s=new Map(e?.changeCountByDirectoryPath),c=!1;for(let e of n){let t=QR(e);t!=null&&(c=$R({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=ZR(e);t!=null&&(c=ez({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,isDirectory:t.isDirectory,status:e.status,statusByPath:i})||c)}return c?i.size===0?null:{changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,signature:rz(i),statusByPath:i}:e}function ZR(e){return QR(e.path)}function QR(e){let t=KR(e);if(t!=null)return{canonicalPath:JR(t.path,t.isDirectory),isDirectory:t.isDirectory}}function $R({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a!=null&&(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),nz(t,n,e),!0)}function ez({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??tz(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function tz(e,t,n){for(let r of qR(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function nz(e,t,n){for(let r of qR(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function rz(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var iz=e=>e.trim().toLowerCase(),az=e=>e.split(`/`).at(-1)??e,oz=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function sz(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function cz(e){let t=sP(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(iz(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let s=az(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return sz(l,e);for(let[t,n]of a)if(c.includes(t))return sz(n,e);let u=oz(s);for(let t of u){let n=i.get(t);if(n!=null)return sz(n,e)}let d=aP(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return sz(t,e)}return{name:rP(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:sz(s,e)}}}var lz,uz,dz,fz,pz,mz,hz,gz,_z,vz,yz={},bz=[],xz=Array.isArray,Sz=bz.slice,Cz=Object.assign;function wz(e){e&&e.parentNode&&e.remove()}function Tz(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?Sz.call(arguments,2):n),Ez(e,o,r,i,null)}function Ez(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++uz,__i:-1,__u:0};return i==null&&lz.vnode!=null&&lz.vnode(a),a}function Dz(e){return e.children}function Oz(e,t){this.props=e,this.context=t,this.__g=0}function kz(e,t){if(t==null)return e.__?kz(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?kz(e):null}function Az(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return Az(e)}}function jz(e){(8&e.__g||!(e.__g|=8)||!dz.push(e)||pz++)&&fz==lz.debounceRendering||((fz=lz.debounceRendering)||queueMicrotask)(Mz)}function Mz(){for(var e,t,n,r,i,a,o,s,c=1;dz.length;)dz.length>c&&dz.sort(mz),e=dz.shift(),c=dz.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=Cz({},r)).__v=r.__v+1,lz.vnode&&lz.vnode(n),Bz(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??kz(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,Hz(a,n,o),n.__e!=i&&Az(n)));pz=0}function Nz(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||bz,b=t.length;for(c=Pz(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?yz:y[m.__i]||yz,m.__i=f,_=Bz(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&Gz(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=Fz(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function Pz(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?Ez(null,o,null,null,null):xz(o)?Ez(Dz,{children:o},null,null,null):o.constructor==null&&o.__b>0?Ez(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=Iz(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=kz(s)),Kz(s,s));return r}function Fz(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=Fz(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=kz(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Iz(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function Lz(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function Rz(e,t,n,r,i){var a;n:if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||Lz(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||Lz(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(hz,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=gz,e.addEventListener(t,a?vz:_z,a)):e.removeEventListener(t,a?vz:_z,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function zz(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=gz++;else if(t.u<n.l)return;return n(lz.event?lz.event(t):t)}}}function Bz(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=lz.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new M(v,x):(t.__c=f=new Oz(v,x),f.constructor=M,f.render=qz),b&&b.sub(f),f.props=v,f.state||(f.state={}),f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Cz({},f.__s)),Cz(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=lz.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=Cz({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===Dz&&d.key==null&&(E=Uz(d.props.children)),s=Nz(e,xz(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null){if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)wz(a[j]);Vz(t)}}else t.__e=n.__e,t.__k=n.__k,e.then||Vz(t);lz.__e(e,t,n)}else s=t.__e=Wz(n.__e,t,n,r,i,a,o,c,l,u);return(d=lz.diffed)&&d(t),128&t.__u?void 0:s}function Vz(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(Vz)}function Hz(e,t,n){for(var r=0;r<n.length;r++)Gz(n[r],n[++r],n[++r]);lz.__c&&lz.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){lz.__e(e,t.__v)}})}function Uz(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:xz(e)?e.map(Uz):Cz({},e)}function Wz(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(lz.__m&&lz.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=Sz.call(e.childNodes),v=n.props||yz,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;Rz(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||Rz(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),Nz(b==`template`?e.content:e,xz(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&kz(n,0),s,c,l),a!=null)for(u=a.length;u--;)wz(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||Rz(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&Rz(e,u,g,v[u],i))}return e}function Gz(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){lz.__e(e,n)}}function Kz(e,t,n){var r,i;if(lz.unmount&&lz.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Gz(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){lz.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Kz(r[i],t,n||typeof e.type!=`function`);n||wz(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function qz(e,t,n){return this.constructor(e,n)}function Jz(e,t){var n,r,i,a;t==document&&(t=document.documentElement),lz.__&&lz.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=Tz(Dz,null,[e]),i=[],a=[],Bz(t,e,r||yz,yz,t.namespaceURI,r?null:t.firstChild?Sz.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),Hz(i,e,a)}function Yz(e,t){e.__u|=32,Jz(e,t)}lz={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw pz=0,e}},uz=0,Oz.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Cz({},this.state);typeof e==`function`&&(e=e(Cz({},n),this.props)),e&&Cz(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),jz(this))},Oz.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),jz(this))},Oz.prototype.render=Dz,dz=[],pz=0,mz=function(e,t){return e.__v.__b-t.__v.__b},hz=/(PointerCapture)$|Capture$/i,gz=0,_z=zz(!1),vz=zz(!0);var Xz=0;Array.isArray;function $(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Xz,__i:-1,__u:0,__source:i,__self:a};return lz.vnode&&lz.vnode(l),l}var Zz=16,Qz=16,$z={};function eB({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=$z[e]??{width:Zz,height:Qz},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return $(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:$(`use`,{href:c})})}var tB=e=>e!==void 0&&/\s/.test(e),nB=(e,t)=>{let n=t=>tB(e[t-1])||tB(e[t]);if(!n(t))return t;for(let r=1;r<e.length;r++){let i=t-r;if(i>0&&!n(i))return i;let a=t+r;if(a<e.length&&!n(a))return a}return t},rB=e=>nB(e,Math.ceil(e.length/2)),iB=e=>{if(e.length<2)return[e,``];let t=rB(e);return[e.slice(0,t),e.slice(t)]},aB=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:rB(e);return[e.slice(0,r),e.slice(r)]},oB=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},sB=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},cB=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},lB=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function uB({children:e,marker:t,variant:n=`default`}){"use no memo";return $(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:$(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?$(`span`,{"data-truncate-fade":!0}):t})})}function dB(e){"use no memo";let{mode:t,children:n}=e;return $(`div`,{children:[$(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?$(`span`,{children:n}):n}),$(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?$(`span`,{children:n}):n})]})}function fB({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=$(dB,{mode:t,children:e},`content`),o=$(uB,{marker:n,mode:t,variant:r},`marker`),s=$(`div`,{"data-truncate-fill":!0},`fill`);return $(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:$(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function pB({children:e,...t}){"use no memo";return $(fB,{mode:`truncate`,...t,children:e})}function mB({children:e,...t}){"use no memo";return $(fB,{mode:`fruncate`,...t,children:e})}function hB({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=$(pB,{...s,children:t[0]}),l=$(mB,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return $(`div`,{className:a,style:o});if(e.length<i)return $(n===`end`?mB:pB,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=iB:r===`extension`?t=aB:r===`leaf-path`&&(t=oB);else if(typeof r==`number`)t=sB,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=cB:e===`first`&&(t=lB)}else typeof r==`function`&&(t=r);t??=iB;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=$(pB,{...s,..._,children:f}),l=$(mB,{...s,...v,children:p})}return $(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[$(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),$(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var gB={endIndex:-1,startIndex:-1};function _B(e,t,n){return Math.min(Math.max(e,t),n)}function vB(e,t){return e<0||t<e?gB:{endIndex:t,startIndex:e}}function yB(e){return e.startIndex<0||e.endIndex<e.startIndex}function bB(e,t){return yB(e)?0:(e.endIndex-e.startIndex+1)*t}function xB(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function SB(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function CB(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function wB(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function TB(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function EB(e,t,n){if(e.length===0||t<=0)return[];let r=TB(e),i=CB(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=wB(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function DB(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=_B(t.scrollTop,0,o),c=t.stickyRows??EB(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=xB(s,n,t.itemHeight),m=xB(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?gB:vB(m,SB(u+d,n,t.itemHeight)),y=g+1,b=yB(v)?gB:vB(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=bB(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:yB(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var OB={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},kB={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},AB=`Contains git status items`;function jB(e){return e.current?!0:(e.current=!0,!1)}function MB(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function NB(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return MB({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function PB(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function FB(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function IB(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function LB(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function RB(e,t){return e!=null&&e>0?e:t}function zB(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function BB(e,t,n,r,i=0){let a=MB({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function VB(e,t,n,r,i,a,o=0){let s=NB({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function HB(e,t,n,r,i,a){let o=PB({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function UB(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function WB(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function GB({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return $(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function KB(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function qB(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var JB,YB,XB,ZB,QB=Object.is,$B=0,eV=[],tV=lz,nV=tV.__b,rV=tV.__r,iV=tV.diffed,aV=tV.__c,oV=tV.unmount,sV=tV.__;function cV(e,t){tV.__h&&tV.__h(YB,e,$B||t),$B=0;var n=YB.__H||(YB.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function lV(e){return $B=1,uV(SV,e)}function uV(e,t,n){var r=cV(JB++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):SV(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);QB(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=YB,!YB.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,QB(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};YB.__f=!0;var a=YB.shouldComponentUpdate,o=YB.componentWillUpdate;YB.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},YB.shouldComponentUpdate=i}return r.__N||r.__}function dV(e,t){var n=cV(JB++,3);!tV.__s&&xV(n.__H,t)&&(n.__=e,n.u=t,YB.__H.__h.push(n))}function fV(e,t){var n=cV(JB++,4);!tV.__s&&xV(n.__H,t)&&(n.__=e,n.u=t,YB.__h.push(n))}function pV(e){return $B=5,mV(function(){return{current:e}},[])}function mV(e,t){var n=cV(JB++,7);return xV(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function hV(e,t){return $B=8,mV(function(){return e},t)}function gV(){for(var e;e=eV.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(yV),e.__H.__h.forEach(bV),e.__H.__h=[]}catch(t){e.__H.__h=[],tV.__e(t,e.__v)}}tV.__b=function(e){YB=null,nV&&nV(e)},tV.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),sV&&sV(e,t)},tV.__r=function(e){rV&&rV(e),JB=0;var t=(YB=e.__c).__H;t&&(XB===YB?(t.__h=[],YB.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(yV),t.__h.forEach(bV),t.__h=[],JB=0)),XB=YB},tV.diffed=function(e){iV&&iV(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(eV.push(t)!==1&&ZB===tV.requestAnimationFrame||((ZB=tV.requestAnimationFrame)||vV)(gV)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),XB=YB=null},tV.__c=function(e,t){t.some(function(e){try{e.__h.forEach(yV),e.__h=e.__h.filter(function(e){return!e.__||bV(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],tV.__e(n,e.__v)}}),aV&&aV(e,t)},tV.unmount=function(e){oV&&oV(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{yV(e)}catch(e){t=e}}),n.__H=void 0,t&&tV.__e(t,n.__v))};var _V=typeof requestAnimationFrame==`function`;function vV(e){var t,n=function(){clearTimeout(r),_V&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);_V&&(t=requestAnimationFrame(n))}function yV(e){var t=YB,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),YB=t}function bV(e){var t=YB;e.__c=e.__(),YB=t}function xV(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!QB(t,e[n])})}function SV(e,t){return typeof t==`function`?t(e):t}function CV(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:$(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return $(Dz,{children:[$(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:$(pB,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function wV(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function TV(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function EV(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function DV({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=DB(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:EV(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?EV(u,1,t,o):i&&r<=0&&c.length>0?EB(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var OV=400,kV=40,AV=18;function jV(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?MV(e,t,n):a instanceof HTMLElement?a:null}function MV(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function NV(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function PV(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function FV(){return navigator.vendor!==`Apple Computer, Inc.`}function IV(e,t){let n=e-t.top;if(n<kV)return-Math.ceil((kV-Math.max(0,n))/kV*AV);let r=t.bottom-e;return r<kV?Math.ceil((kV-Math.max(0,r))/kV*AV):0}function LV(e,t){if(e!=null){let t=OB[e];return t==null?null:{text:t,title:kB[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:AB}:null}function RV(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function zV(e){return e!=null&&`toggle`in e}function BV(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function VV(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function HV(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function UV(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function WV(e,t){return t&&UV(e)||(e.ctrlKey||e.metaKey)&&BV(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var GV=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function KV(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function qV(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function JV(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function YV(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function XV(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function ZV(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function QV(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function $V(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function eH(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=$V(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function tH(e,t){return{kind:e.kind,name:TV(e),path:t}}function nH(e){return e==null?void 0:`${e}__tree`}function rH(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function iH(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function aH(e,t){if(e==null)return null;if(`text`in e)return e.parts==null?$(`span`,{title:e.title,children:e.text}):$(`span`,{title:e.title,children:e.parts.map((e,t)=>$(`span`,{style:{color:e.color},children:e.text},t))});let n=typeof e.icon==`string`?iH(e.icon)?t(e.icon):{name:e.icon}:iH(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return $(`span`,{title:e.title,children:$(eB,{...n})})}function oH(e){e!=null&&FB(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function sH(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=wV(e);return $(Dz,{children:[e.depth>0?$(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>$(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,$(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?$(eB,{...t(`file-tree-icon-chevron`)}):$(eB,{...t(`file-tree-icon-file`,u)})}),$(`div`,{"data-item-section":`content`,children:e.isFlattened?CV(e,c,a):c??$(hB,{minimumLength:5,split:`extension`,children:e.name})}),i?$(`div`,{"data-item-section":`decoration`,children:r==null?null:aH(r,t)}):null,s?$(`div`,{"data-item-section":`git`,children:aH(o,t)}):null,n?$(`div`,{"data-item-section":`action`,children:l?$(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:$(eB,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function cH(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=wV(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??RV(t.ancestorPaths,v,y),B=t.kind===`directory`&&(b?.has(P)??!1),V=A(t,P),H=LV(z,B),U=S&&w,ee=V!=null||x||U,te=U&&T===`always`,ne=a.getPath()===P,W=ne?a.getValue():``,re=R||!ne?null:$(GB,{ref:D,ariaLabel:`Rename ${TV(t)}`,isFlattened:t.isFlattened,value:W,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),ie=sH(t,k,{actionLaneEnabled:U,customDecoration:V,decorationLaneEnabled:ee,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:H,gitLaneActive:x,renameInput:re,showDecorativeActionAffordance:te}),ae={...KB({ariaLabel:TV(t),domId:t.isFocused?rH(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:U,contextMenuButtonVisibility:U?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:B,effectiveGitStatus:z,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(P),j(t,P,{anchorRect:JV(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&ne?$(`div`,{...ae,children:ie}):$(`button`,{...ae,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(R){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:ie})}function lH(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(wV(e))).map((n,r)=>cH(e,n,t.start+r))}function uH({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=uP,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=pV(null),v=pV(null),y=pV(!1),b=pV(null),x=pV(null),S=pV(null),C=pV(null),w=pV(null),T=pV(new Map),E=pV(new Map),D=pV(()=>{}),O=pV(null),k=pV(0),A=pV(!1),j=pV(null);j.current!==t&&(A.current=!1,j.current=t);let M=pV(!1),N=pV(null),P=pV(null),F=pV(!1),I=pV(null),L=pV(null),R=pV(null),z=pV(null),B=pV(null),V=pV(null),H=pV(null),U=pV(null),ee=pV(!1),te=pV(null),ne=pV(null),W=pV(null),re=pV(null),ie=mV(()=>new Map,[]),[,ae]=lV(0),G=pV(!1),[oe,se]=lV(null),[ce,le]=lV(null),[ue,de]=lV(null),[fe,pe]=lV(null),[me,he]=lV(0),[ge,_e]=lV(null),ve=pV(ge);ve.current=ge;let ye=pV(null),be=pV(null),xe=pV(null),Se=pV(null),Ce=pV(null),we=pV(!1),Te=()=>{be.current=null,xe.current=null,Se.current=null},Ee=(e,t)=>{be.current=e,xe.current=null,Se.current=t==null?null:{path:e,scrollTop:t}},De=(e,t)=>{be.current=null,xe.current={path:e,viewportOffset:t},Se.current=null},Oe=pV(d===`retain`&&t.isSearchOpen()),[ke,Ae]=lV(p);dV(()=>{p||Ae(!1)},[p]);let je=pV(!1),Me=hV(()=>{je.current=!0,Ae(e=>e&&!1)},[]),[Ne,Pe]=lV(()=>DV({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Fe,Ie]=lV(!1);dV(()=>{Ie(!0)},[]);let Le=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Re=e?.contextMenu?.triggerMode??(Le?`right-click`:`both`),ze=Re===`both`||Re===`button`,Be=e?.contextMenu?.buttonVisibility??`when-needed`,Ve=Re===`both`||Re===`right-click`;fV(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;Ce.current=t,le(t),pe(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(we.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let He=hV((e,t)=>{XV(T.current,e,t)},[]),K=hV((e,t)=>{XV(E.current,e,t)},[]),Ue=hV(e=>{x.current=e},[]),We=hV(e=>ZV(e,E.current,T.current),[]),Ge=n!=null||r!=null||i!=null,{resolveIcon:Ke}=mV(()=>cz(a),[a]),qe=t[RR](),Je=qe.getPath(),Ye=Je!=null,Xe=t.isSearchOpen(),Ze=t.getSearchValue(),Qe=t.getFocusedPath(),$e=t.getFocusedIndex(),et=t.getScrollRequest(),tt=t.isDragAndDropEnabled(),nt=t.getDragSession(),rt=mV(()=>nt==null?null:new Set(nt.draggedPaths),[nt]),it=nt?.target??null,at=nt?.primaryPath??null,ot=nH(o),{overlayHeight:st,overlayRows:ct,snapshot:lt,visibleRows:ut}=Ne,dt=lt.physical.viewportHeight,ft=mV(()=>({end:lt.window.endIndex,start:lt.window.startIndex}),[lt.window.endIndex,lt.window.startIndex]),pt=ct,mt=lt.sticky.rows,ht=lt.physical.totalHeight,gt=lt.sticky.height,q=mV(()=>new Set(mt.map(e=>wV(e.row))),[mt]),_t=$e>=0&&$e>=ft.start&&$e<=ft.end,vt=hV((e,t)=>u?.({item:tH(e,t),row:e})??null,[u]),yt=hV(e=>FB(e==null?null:T.current.get(e)??null)?!0:FB(S.current),[]),bt=hV(e=>{yt(t.focusNearestPath(e))},[t,yt]),xt=pV(bt);xt.current=bt;let St=pV(!0),Ct=pV(()=>{}),wt=hV((t=!0)=>{let n=ve.current;n!=null&&(St.current=St.current&&t,_e(null),e?.contextMenu?.onClose?.(),St.current&&bt(n.path))},[e?.contextMenu,bt]);Ct.current=wt;let Tt=hV(e=>{let t=e==null?null:YV(S.current,e);de(e=>e===t?e:t)},[]),Et=hV((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=We(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Ee(n,e?.scrollTop??null),M.current=!0,se(e=>e===n?e:n)}i.focus(),Tt(a),St.current=!0,_e({anchorRect:r?.anchorRect??null,item:tH(e,n),path:n,source:r?.source??`keyboard`})},[t,We,Tt]),Dt=hV(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=LB(e,dt);I.current=$e<0||e==null?null:Math.max(0,Math.min($e*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(pe(`focus`),ae(e=>e+1))}},[t,$e,s,l,dt]),Ot=hV((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=LB(i,dt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:DV({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,HB(i,a,s,l,u,d),D.current(),ye.current=n?e:null,!0},[t,s,c,dt,h]),kt=()=>y.current===!0||re.current!=null||ee.current===!0,At=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),jt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Mt=()=>{z.current!=null&&(clearTimeout(z.current),z.current=null),R.current=null},Nt=()=>{V.current?.remove(),V.current=null},Pt=()=>{jt(L.current),L.current=null,B.current=null},Ft=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},It=()=>{U.current?.(),U.current=null,re.current!=null&&(clearTimeout(re.current),re.current=null),ee.current=!1,te.current=null,W.current=null,ne.current!=null&&(ne.current.setAttribute(`draggable`,`true`),ne.current.style.removeProperty(`touch-action`),ne.current=null),Nt(),Mt(),Pt(),H.current=null},Lt=(e,n)=>{let r=S.current?.getRootNode(),i=NV(jV(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Rt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Mt();return}let r=t.getItem(e.directoryPath),i=zV(r)?r:null;if(i==null||i.isExpanded()){Mt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;R.current!==a&&(Mt(),R.current=a,z.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},zt=()=>{L.current=null;let e=B.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=IV(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),Rt(Lt(e.clientX,e.clientY)),L.current=At(zt)},Bt=(e,t)=>{B.current={clientX:e,clientY:t},L.current??=At(zt)},Vt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(It(),Nt(),Mt(),Pt(),t.startDrag(r)===!1){e.preventDefault();return}if(H.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),FV())){let t=PV(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Ft(t),V.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Ht=()=>{Nt(),Mt(),Pt(),H.current=null,t.cancelDrag()},Ut=(e,n,r)=>{if(re.current!=null||ee.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;W.current={clientX:i.clientX,clientY:i.clientY},ne.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!ee.current;re.current!=null&&(clearTimeout(re.current),re.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),U.current===o&&(U.current=null),t&&(a.setAttribute(`draggable`,`true`),ne.current===a&&(ne.current=null),W.current=null)},s=e=>{let t=e.touches[0],n=W.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=100||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),U.current=o,re.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),ne.current===a&&(ne.current=null),W.current=null;return}ee.current=!0,ne.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),H.current=n;let e=a.getBoundingClientRect(),s=PV(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Ft(s),V.current=s,te.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=te.current;n!=null&&V.current!=null&&(V.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Rt(Lt(t.clientX,t.clientY)),Bt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Lt(n.clientX,n.clientY),t.completeDrag(),It()},u=()=>{t.cancelDrag(),It()};U.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},OV)},Wt=e=>{if(ge!=null){if(e.key===`Escape`){wt(),e.preventDefault(),e.stopPropagation();return}GV.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(qe.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)qe.cancel();else if(e.key===`Enter`)qe.commit();else return;pe(`focus`),ae(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Dt(Qe??void 0),e.preventDefault(),e.stopPropagation();return}if(Xe){if(e.key===`Escape`)F.current=!1,I.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=LB(n,dt);I.current=$e<0||n==null?null:Math.max(0,Math.min($e*s-n.scrollTop,Math.max(0,r-s))),F.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;pe(`focus`),ae(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&VV(e)){t.openSearch(e.key),ae(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Le&&UV(e),r=WV(e,Le),i=r&&S.current!=null?IB(S.current):null,a=r?new Set(QV(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==Qe&&a.has(o)){let e=C.current;Ee(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=zV(p)?p:null,h=u!=null&&(q.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=ZV(u,E.current,T.current);e==null||n==null?y=!1:Et(e,u)}else if((e.ctrlKey||e.metaKey)&&BV(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;pe(`focus`);let b=t.getFocusedPath(),x=b!=null&&(q.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Ee(b,v?.scrollTop??null),M.current=!0,se(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(De(b,eH(S.current,v,i,u,s,gt,dt)),M.current=!0,se(e=>e===b?e:b)):Te()}ae(e=>e+1),e.preventDefault(),e.stopPropagation()};fV(()=>{if(f&&Xe){if(Oe.current){Oe.current=!1;return}FB(w.current)}},[Xe,f]),fV(()=>{let e=x.current;switch(WB({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Je})){case`reset`:P.current=null;return;case`reveal-canonical`:Je!=null&&Ot(Je,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(ye.current=null,P.current=Je,FB(e),e.select());return}},[ft.end,ft.start,Je,Ot,q]),fV(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=IB(e)?.dataset.itemPath??null;se(e=>e===t?e:t)},i=()=>{n(),M.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,IB(e)!=null){r();return}M.current=!1,se(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,se(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;se(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),fV(()=>{let e=S.current;e!=null&&(lt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[lt.physical.scrollTop]),fV(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=LB(n,g);let a=()=>{let e=t.getVisibleCount(),r=RB(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Pe(DV({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!A.current){A.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=RB(O.current,g),i=t.getVisibleRows(e,e)[0]??null;BB(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=t.subscribe(()=>{jB(G)&&ae(e=>e+1),a()}),l=()=>{we.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,he(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&we.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{if(a(),n.scrollTop>0&&d(),ve.current!=null&&y.current&&Ct.current(),we.current===!0){y.current=!1;return}le(e=>e==null?e:null),l()},m=()=>{l(),f()},_=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),v=e=>{_.has(e.key)&&m()};n.addEventListener(`scroll`,p,{passive:!0}),n.addEventListener(`wheel`,m,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`keydown`,v);let x=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:zB(e[0]))??LB(n,g),a()}):null;return x?.observe(n),()=>{D.current=()=>{},o(),n.removeEventListener(`scroll`,p),n.removeEventListener(`wheel`,m),n.removeEventListener(`touchmove`,m),n.removeEventListener(`keydown`,v),e!=null&&clearTimeout(e),u!=null&&clearTimeout(u),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,x?.disconnect()}},[t,g,s,c,h]),fV(()=>{Le||ge==null||wt(!1)},[wt,Le,ge]);let Gt=mV(()=>ge==null?null:`${ge.path}::${ge.source}`,[ge]);fV(()=>{if(Gt==null){m?.clearSlotContent(zM);return}let t=ve.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??qV(n.getBoundingClientRect()),close:e=>{Ct.current(e?.restoreFocus??!0)},restoreFocus:()=>{St.current&&xt.current(ve.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(zM,i),e?.contextMenu?.onOpen?.(t.item,r),oH(i),queueMicrotask(()=>{i!=null&&i.isConnected&&document.activeElement===i&&oH(i)}),()=>{m?.clearSlotContent(zM)}},[Gt,e?.contextMenu,m]),fV(()=>{ge!=null&&t.getItem(ge.path)==null&&wt()},[wt,ge,t]),fV(()=>{if(ge==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(KV(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&wt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),wt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[wt,ge]),fV(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=Qe;return}let r=Qe==null?null:T.current.get(Qe)??null,i=IB(n),a=i?.dataset.itemPath??null,o=Ye&&x.current===i,c=f&&w.current===i,l=F.current&&!Xe,u=I.current??0,d=ye.current,p=be.current,m=xe.current,g=Se.current,_=i!=null,v=M.current||_,y=N.current!==Qe,b=p!=null&&p===Qe&&Qe!=null,E=!1,O=!1;if(et!=null&&et.id!==k.current){k.current=et.id;let n=et.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,dt-s))):gt;E=!0,O=VB(e,n,s,dt,ht,et.offset,t)}t.clearScrollRequest(et.id)}let A=!E&&l&&HB(e,$e,s,dt,ht,u),j=!E&&d!=null&&d===Qe&&HB(e,$e,s,dt,ht,gt),P=!E&&m!=null&&m.path===Qe&&HB(e,$e,s,dt,ht,m.viewportOffset),L=!E&&g!=null&&g.path===Qe&&e.scrollTop!==g.scrollTop;if(L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==Qe&&!b&&BB(e,$e,s,dt,gt))&&D.current(),E){N.current=Qe;return}if(!v){N.current=Qe;return}if(o){N.current=Qe;return}if(c&&!l){N.current=Qe;return}if(r==null){l&&$e>=0&&(HB(e,$e,s,dt,ht,u),D.current()),N.current=Qe;return}(y||l||d===Qe||p===Qe||m?.path===Qe||g?.path===Qe||a==null||a!==Qe)&&(FB(r),d===Qe&&(ye.current=null),p===Qe&&(be.current=null),m?.path===Qe&&(xe.current=null),g?.path===Qe&&(Se.current=null),F.current=!1,I.current=null),N.current=Qe},[t,$e,Qe,_t,s,Ye,Xe,ft,dt,f,et,h,gt,ht,ut]);let Kt=$e>=0&&$e>=lt.visible.startIndex&&$e<=lt.visible.endIndex,qt=Qe!=null&&pt.some(e=>wV(e.row)===Qe),Jt=Kt||qt,Yt=ze&&M.current===!0&&Jt?Qe:null,Xt=fe===`pointer`?ce:null,Zt=ge?.path??Ce.current??Xt??Yt??ce,Qt=ge?.source===`right-click`;fV(()=>{y.current&&ge==null||Tt(We(Zt))},[ge,We,ft,dt,me,pt,Zt,Tt,ut]);let $t=hV(e=>{if(y.current||KV(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&pe(e=>e===`pointer`?e:`pointer`),le(e=>e===i?e:i)},[]),J=hV(()=>{le(null)},[]);fV(()=>{if(!tt)return;let e=()=>{It(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),It(),t.cancelDrag()}},[t,tt]);let en=e=>{if(!tt||t.getDragSession()==null||ee.current)return;let n=NV(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Rt(t.getDragSession()?.target??null),Bt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},tn=e=>{if(!tt||t.getDragSession()==null||ee.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Mt(),Pt(),t.setDragTarget(null))},Y=e=>{tt&&t.getDragSession()!=null&&!ee.current&&(e.preventDefault(),Lt(e.clientX,e.clientY),t.completeDrag(),Nt(),Mt(),Pt(),H.current=null)},nn=lt.window.height,rn=lt.window.offsetTop,an=Math.min(0,dt-nn),on=Math.min(0,dt-nn-gt),sn=oe===Qe||F.current,cn=Qe!=null&&sn&&!_t&&$e>=0?ut[$e]??t.getVisibleRows($e,$e)[0]??null:null,ln=cn==null?null:UB($e,s,ft,nn),un=H.current,dn=at!=null&&un!=null&&un.path===at&&un.index>=ft.start&&un.index<=ft.end,fn=at!=null&&un!=null&&un.path===at&&!dn&&un.path!==cn?.path?un:null,pn=fn==null?null:UB(fn.index,s,ft,nn),mn=HV(($e>=0?ut[$e]??t.getVisibleRows($e,$e)[0]??null:null)?.ancestorPaths.at(-1)??null),hn=Xe&&Qe!=null?rH(o,Qe,!_t):void 0,gn=ge?.path??(Xe?Qe:oe),_n=ge?.path??ce,vn=We(Zt),yn=Le&&ze&&!Qt&&!Ye&&vn!=null&&ue!=null&&Zt!=null,X=Le&&(yn||ge!=null),bn=ge?.anchorRect,xn=bn==null&&vn!=null&&ue!=null&&(ge!=null||yn)?ue:null,Sn=bn==null?xn==null?void 0:{top:`${xn}px`}:{left:`${bn.left}px`,position:`fixed`,right:`auto`,top:`${bn.top}px`},Cn=Qt?{opacity:`0`}:void 0,wn=hV((e,n,r,i)=>{let a=qB({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:Xe,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c)}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=lt.visible.startIndex&&n.index<=lt.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,se(e=>e===c?e:c),pe(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Ot(c,{targetOffset:`sticky-parents`})},[t,Xe,lt.visible.endIndex,lt.visible.startIndex,Ot]),Tn=()=>{if(y.current||!ze||Zt==null||vn==null)return;let e=t.getItem(Zt);e!=null&&(Tt(vn),St.current=!0,_e({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:vn.getAttribute(`aria-label`)??Zt,path:e.getPath()},path:e.getPath(),source:`button`}))},En={contextHoverPath:_n,contextMenuButtonTriggerEnabled:ze,contextMenuButtonVisibility:Be,contextMenuEnabled:Le,contextMenuRightClickEnabled:Ve,contextMenuTriggerMode:Re,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:tt,draggedPathSet:rt,dragTarget:it,gitLaneActive:Ge,gitStatusByPath:n,handleRowDragEnd:Ht,handleRowDragStart:Vt,handleRowTouchStart:Ut,ignoredGitDirectories:r,ignoredInheritanceCache:ie,instanceId:o,itemHeight:s,onKeyDown:Wt,onRowClick:wn,openContextMenuForRow:Et,registerButton:He,registerRenameInput:Ue,renameView:qe,renderDecorationForRow:vt,resolveIcon:Ke,shouldSuppressContextMenu:kt,visualFocusPath:gn},Dn={...En,registerButton:K};return $(`div`,{ref:S,id:ot,"data-file-tree-context-menu-button-visibility":Le&&ze?Be:void 0,"data-file-tree-context-menu-trigger-mode":Le?Re:void 0,"data-file-tree-has-context-menu-action-lane":Le&&ze?`true`:void 0,"data-file-tree-has-git-lane":Ge?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:tt?tn:void 0,onDragOver:tt?en:void 0,onDrop:tt?Y:void 0,onKeyDown:Wt,onPointerLeave:Le?J:void 0,onPointerOver:Le?$t:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[$(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:mn}}),$(`slot`,{name:RM,"data-type":`header-slot`}),f?$(`div`,{"data-file-tree-search-container":!0,"data-open":Xe?`true`:`false`,children:$(`input`,{ref:w,"aria-activedescendant":hn,"aria-controls":ot,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":ke?`true`:void 0,value:Ze,onBlur:()=>{(d!==`retain`||je.current)&&t.closeSearch()},onFocus:Me,onPointerDown:Me,onInput:e=>{Me();let n=e.currentTarget;t.setSearch(n.value)}})}):null,$(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Fe&&pt.length>0?$(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:$(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${st}px`},children:pt.map((e,t)=>cH(Dn,e.row,`sticky:${wV(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${pt.length-t}`}}))})}):null,$(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${ht}px`},children:[$(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${rn}px`}}),$(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${nn}px`,top:`${an}px`,bottom:`${on}px`},children:[lH(En,ft,q),cn!=null&&ln!=null?cH(En,cn,`parked:${cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:at===cn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${ln}px`}}):null,fn!=null&&pn!=null?cH(En,fn,`parked-drag:${fn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${pn}px`}}):null]})]})]}),Le?$(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":X?`true`:`false`,style:Sn,children:[$(`button`,{ref:v,type:`button`,"data-type":BM,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":ge==null?`false`:`true`,"data-visible":yn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),ge!=null){wt();return}Tn()},tabIndex:-1,style:Cn,children:$(eB,{...Ke(`file-tree-icon-ellipsis`)})}),ge==null?null:$(`slot`,{name:zM})]}):null,ge==null?null:$(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),wt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),wt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var dH={hydrateRoot:(e,t)=>{Yz(Tz(uH,t),e)},renderRoot:(e,t)=>{Jz(Tz(uH,t),e)},unmountRoot:e=>{Jz(null,e)}};function fH(e,t){dH.renderRoot(e,t)}function pH(e,t){dH.hydrateRoot(e,t)}function mH(e){dH.unmountRoot(e)}var hH=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}};Array.isArray;var gH=0;function _H(e){return e!=null&&e.length>0?e:(gH+=1,`pst_ft_${gH}`)}function vH({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??uP)}function yH(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function bH(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function xH(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var SH=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new hH;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=_H(a),this.#p=YR(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=lP(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new WR({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(mH(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getFocusedIndex(){return this.#t.getFocusedIndex()}getVisibleCount(){return this.#t.getVisibleCount()}getVisibleRows(e,t){return this.#t.getVisibleRows(e,t)}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}focusFirstItem(){this.#t.focusFirstItem()}focusLastItem(){this.#t.focusLastItem()}focusNextItem(){this.#t.focusNextItem()}focusPreviousItem(){this.#t.focusPreviousItem()}focusParentItem(){this.#t.focusParentItem()}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}applyGitStatusPatch(e){let t=XR(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&fH(n.wrapper,this.#w())}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){Array.isArray(e)?this.#t.resetPaths(e,t):this.#t.resetPaths(e)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),fH(t.wrapper,this.#w()))}setGitStatus(e){let t=YR(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&fH(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),fH(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),pH(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),fH(r,this.#w())}#C(){return{initialViewportHeight:vH({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(RM,e());return}this.#l.setSlotHtml(RM,this.#e?.header?.html??null)}#k(e){let t=xH(e).find(e=>bH(e)),n=yH(nP(sP(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=xH(e),n=t.find(e=>bH(e)),r=t.filter(e=>e!==n),i=sP(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=yH(i);if(a==null){for(let e of r)e.remove();return}if(r.length!==1||r[0].outerHTML!==a.outerHTML){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=sP(this.#m);t.colored&&iP(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${PM}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}(this.#g?.parentNode!==e||this.#_!==this.#h)&&(this.#g??=document.createElement(`style`),this.#g.setAttribute(PM,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=mP(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return bP(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}};function CH(e){let[t]=(0,b.useState)(()=>new SH(e)),n=(0,b.useRef)({timeout:null,model:t});return(0,b.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}function wH(e,t,n){return Object.is(e,t)||n?.(e,t)===!0}function TH(e,t,n){let r=(0,b.useRef)({hasValue:!1,model:null,selector:null,value:void 0}),i=(0,b.useCallback)(t=>e.subscribe(t),[e]),a=(0,b.useCallback)(()=>{let i=r.current,a=t(e);if(i.model!==e||i.selector!==t||!i.hasValue)return i.hasValue=!0,i.model=e,i.selector=t,i.value=a,a;let o=i.value;return wH(o,a,n)?o:(i.value=a,a)},[n,e,t]);return(0,b.useSyncExternalStore)(i,a,a)}function EH(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var DH=`data-checked`,OH=`data-unchecked`;function kH(e){return{checked(t){return e.indeterminate?{}:t?{[DH]:``}:{[OH]:``}},...uM}}var AH=b.createContext(void 0);function jH(){return b.useContext(AH)}var MH=b.createContext(void 0);function NH(){let e=b.useContext(MH);if(e===void 0)throw Error(F(14));return e}var PH=`data-parent`,FH=b.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":a,disabled:o=!1,form:s,id:c,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:f,parent:p=!1,readOnly:m=!1,render:h,required:g=!1,uncheckedValue:_,value:v,nativeButton:y=!1,style:x,...S}=e,{clearErrors:C}=_M(),{disabled:w,name:T,setDirty:E,setFilled:D,setFocused:O,setTouched:k,state:A,validationMode:j,validityData:P,validation:F}=pM(),I=OM(),{labelId:L,registerControlId:R,getDescriptionProps:z}=yM(),B=jH(),V=B?.allValues===void 0?void 0:B.parent,H=V!==void 0,U=w||I.disabled||B?.disabled||o,ee=T??d,te=v??ee,ne=Js(),W=B?.registerControlId!==R,re=CM({id:c||void 0,enabled:W}),ie=y?re:ne,ae={};H&&(p?ae=V.getParentProps():te!==void 0&&(ae=V.getChildProps(te)));let{checked:G=n,indeterminate:oe=l,onCheckedChange:se,...ce}=ae,le=B?.value,ue=b.useRef(null),{getButtonProps:de,buttonRef:fe}=hl({disabled:U,native:y}),pe=B?.validation??F,[me,he]=jc({controlled:te!==void 0&&le!==void 0&&!p?le.includes(te):G,default:i,name:`Checkbox`,state:`checked`}),ge=H?!!G:me,_e=H&&oe||l;kM(ue,ne,me,void 0,!B&&!U,d);let ve=V?.registerChildId,be=b.useRef(null),xe=pe.registerInput,Se=B?te:void 0,Ce=b.useCallback(e=>xe(e,{controlRef:ue,value:Se}),[xe,Se]),we=ln(u,be,p?void 0:Ce),Te=bM(a,L,be,!y,re);N(()=>{be.current&&(be.current.indeterminate=_e),B||D(me)},[me,_e,B,D]),tu(me,()=>{B||(C(ee),E(me!==P.initialValue),pe.change(me))});let Ee=pi({checked:me,disabled:U,form:s,name:p?void 0:ee,id:y?void 0:re,required:g,ref:we,style:ee?kn:On,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(m){e.preventDefault();return}let t=e.currentTarget.checked,n=J(Ot,e.nativeEvent);if(f?.(t,n),!n.isCanceled&&(se?.(t,n),!n.isCanceled&&(he(t),te!==void 0&&B!==void 0&&!p&&!H))){let e=t?[...B.value,te]:B.value.filter(e=>e!==te);B.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){ue.current?.focus()}},v===void 0?M:{value:(B?me&&v:v)||``},z,e=>pe.getValidationProps(U,e));b.useEffect(()=>{if(!V||te===void 0)return;let e=V.disabledStatesRef.current;return e.set(te,U),()=>{e.delete(te)}},[V,U,te]);let De=b.useMemo(()=>({...A,checked:ge,disabled:U,readOnly:m,required:g,indeterminate:_e}),[A,ge,U,m,g,_e]),Oe=kH(De),ke=Di(`span`,e,{state:De,ref:[fe,ue,t],props:[{id:ie,role:`checkbox`,"aria-checked":_e?`mixed`:ge,"aria-readonly":m||void 0,"aria-required":g||void 0,"aria-labelledby":Te,[PH]:p?``:void 0,onFocus(){U||O(!0)},onBlur(){let e=be.current;e&&(k(!0),O(!1),j===`onBlur`&&pe.commit(B?le:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=be.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),ye(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||EH(t)?.click()})},onClick(e){if(m||U)return;e.preventDefault();let t=be.current;t&&ml(t,e)}},S,ce,de,z,e=>pe.getValidationProps(U,e)],stateAttributesMapping:Oe}),Ae=ke.props.id;return N(()=>{if(ve&&!p&&te!==void 0&&Ae!==void 0)return ve(te,Ae)},[ve,p,te,Ae]),(0,Y.jsxs)(MH.Provider,{value:De,children:[ke,!me&&!B&&ee&&!p&&_!==void 0&&(0,Y.jsx)(`input`,{type:`hidden`,form:s,name:ee,value:_,disabled:U}),(0,Y.jsx)(`input`,{...Ee,suppressHydrationWarning:!0})]})}),IH=b.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=NH(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:d}=Ro(c),f=b.useRef(null),p={...s,transitionStatus:u};Ho({batch:!0,enabled:!c,open:c,ref:f,onComplete(){c||d(!1)}});let m={...kH(s),...et},h=a||l,g=Di(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:m,props:o});return h?g:null}),LH=b.createContext(void 0);function RH(e){let t=b.useContext(LH);if(t===void 0&&!e)throw Error(F(47));return t}var zH={...us,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},BH=class extends No{constructor(e,t,n){let r=new rs;super(VH(e,r,t,n),HH(r),zH)}setOpen=(e,t)=>{let n=t.reason===At,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=Xo(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=Yo(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),zi.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function VH(e,t,n,r=!1){let i={...is(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function HH(e){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),stickIfOpenTimeout:new B,triggerElements:e}}var UH=D(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=GH(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),ns(u,d),$o(u);let{forceUnmount:m}=es(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),b.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),b.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,J($t))}),[m,u]);let h=d||f;return(0,Y.jsxs)(LH.Provider,{value:u,children:[s&&(0,Y.jsx)(Ko,{handle:s,store:u}),h&&(0,Y.jsx)(KH,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function WH(e){return RH(!0)?(0,Y.jsx)(UH,{props:e}):(0,Y.jsx)($i,{children:(0,Y.jsx)(UH,{props:e})})}function GH(e,t){let n=Go((e,n)=>new BH(t,e,n));return b.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function KH({store:e,modal:t}){let n=ga(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return ts(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var qH=O(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=RH(!0),h=ds(s)??m;if(!h)throw Error(F(74));let g=Js(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerPopupId`,g),S=b.useRef(null),{registerTrigger:C,isMountedByThisTrigger:w}=Qo(g,S,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),T=h.useState(`openChangeReason`),E=h.useState(`stickIfOpen`),D=h.useState(`openMethod`),O=h.useState(`focusManagerModal`),k=ws(v,{enabled:!a&&l&&(D!==`touch`||T!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:Vs(),restMs:u,delay:{close:d},triggerElementRef:S,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),A=ua(v,{stickIfOpen:E}),j=nu(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),M=h.useState(`triggerProps`,w),{getButtonProps:N,buttonRef:P}=hl({disabled:a,native:o}),I={open(e){return e&&T===`trigger-press`?ft.open(e):dt.open(e)}},{preFocusGuardRef:L,handlePreFocusGuardFocus:R,handleFocusTargetFocus:z}=Qu(h,S),B=Di(`button`,e,{state:{disabled:a,open:y},ref:[P,t,C,S],props:[A.reference,k,M,j,{[Fi]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":x},p,N],stateAttributesMapping:I}),V=(0,Y.jsx)(b.Fragment,{children:B},g);return w&&!O?(0,Y.jsxs)(b.Fragment,{children:[(0,Y.jsx)(An,{ref:L,onFocus:R}),V,(0,Y.jsx)(An,{ref:h.context.triggerFocusTargetRef,onFocus:z})]}):V}),JH=b.createContext(void 0);function YH(){let e=b.useContext(JH);if(e===void 0)throw Error(F(45));return e}var XH=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return RH().useState(`mounted`)||n?(0,Y.jsx)(JH.Provider,{value:n,children:(0,Y.jsx)(Wi,{ref:t,...r})}):null}),ZH=b.createContext(void 0);function QH(){let e=b.useContext(ZH);if(!e)throw Error(F(46));return e}var $H=b.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=Li,..._}=e,v=RH(),y=YH(),x=Zi(),S=v.useState(`floatingRootContext`),C=v.useState(`mounted`),w=v.useState(`open`),T=v.useState(`openChangeReason`),E=v.useState(`activeTriggerElement`),D=v.useState(`modal`),O=v.useState(`openMethod`),k=v.useState(`positionerElement`),A=v.useState(`instantType`),j=v.useState(`transitionStatus`),M=v.useState(`adaptiveOrigin`),P=b.useRef(null),F=Vo(k),I=Sc({anchor:a,floatingRootContext:S,positionMethod:o,mounted:C,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:x,collisionAvoidance:g,adaptiveOrigin:M}),L=S.useState(`domReferenceElement`);N(()=>{let e=L,t=P.current;if(e&&(P.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return F(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[L,F,v]);let R=D===!0&&T!==`trigger-hover`;Iu(w&&R,O===`touch`,k,E);let z=v.useStateSetter(`positionerElement`),B=Ec(e,{open:w,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:A},{styles:I.positionerStyles,transitionStatus:j,props:_,refs:[t,z],hidden:!C,inert:!w});return(0,Y.jsxs)(ZH.Provider,{value:I,children:[C&&R&&(0,Y.jsx)(Nl,{inert:Ac(!w),cutout:E}),(0,Y.jsx)(Qi,{id:x,children:B})]})}),eU=b.createContext(void 0);function tU(){let[e,t]=b.useState(0),n=X(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:b.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function nU(){let e=b.useContext(eU);N(()=>e?.register(),[e])}var rU=b.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=RH(),l=QH(),u=sl(!0)!=null,{context:d,hasClosePart:f}=tU(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);Ho({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),Ss(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?Wo(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=Di(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...Uo,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&Kc.has(e.key)&&e.stopPropagation()}},Tc(g),s],stateAttributesMapping:mt});return(0,Y.jsx)(la,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:Ce(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,Y.jsx)(eU.Provider,{value:d,children:M})})}),iU=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=RH(),s=Js(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),Di(`h2`,e,{ref:t,props:[{id:s},a]})}),aU=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=RH(),s=Js(a.id);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),Di(`p`,e,{ref:t,props:[{id:s},a]})}),oU=b.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{buttonRef:c,getButtonProps:l}=hl({disabled:a,focusableWhenDisabled:!1,native:o}),u=RH();return nU(),Di(`button`,e,{ref:[t,c],props:[{onClick(e){u.setOpen(!1,J(Pt,e.nativeEvent))}},s,l]})});function sU(e){let t=b.useRef(!0);t.current&&(t.current=!1,e())}function cU(e,t,n,r,i,a,o,s,c,l=2){let u=lr(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return ar(n.current,u)?void 0:u}var lU=b.createContext(void 0),uU=b.createContext(void 0),dU=b.createContext(void 0),fU=b.createContext(!1),pU=b.createContext(``);function mU(){let e=b.useContext(lU);if(!e)throw Error(F(22));return e}function hU(){let e=b.useContext(uU);if(!e)throw Error(F(23));return e}function gU(){let e=b.useContext(dU);if(!e)throw Error(F(24));return e}function _U(){return b.useContext(pU)}function vU(){return b.useContext(fU)}function yU(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var bU=(e,t)=>Object.is(e,t);function xU(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function SU(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!yU(e,t,(e,t)=>xU(e,t,n)):e!==t}function CU(e,t,n){return e?e.some(e=>e!==void 0&&xU(t,e,n)):!1}function wU(e,t,n){return e?e.findIndex(e=>e!==void 0&&xU(e,t,n)):-1}function TU(e,t){if(t!==bU)return n=>CU(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function EU(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(TU(t,n)):wU(e,t,n);return i===-1?null:i}function DU(e,t,n,r,i,a){return CU(r,t,i)?a!=null&&e>a&&CU(r,n[a],i)?a:e:e===a?EU(n,r,i,!0):a}function OU(e,t,n){return e.filter(e=>!xU(t,e,n))}function kU(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function AU(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function jU(e){return AU(e?.[0])}function MU(e){return jU(e)?e.flatMap(e=>e.items):e}function NU(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(jU(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function PU(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return kU(e)}function FU(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?kU(e.value):kU(e)}function IU(e,t,n){function r(){return PU(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=MU(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function LU(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,Y.jsx)(b.Fragment,{children:IU(r,t,n)},i)),e),[])}var RU={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?NU(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>xU(t,e,n)):xU(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemProps:e=>e.itemProps,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight};function zU(e){return e==null?void 0:`${e}-popup`}function BU(e,t){return(n,r)=>n!=null&&e.contains(n,r,t)}function VU(e){return Array.isArray(e)?e.map(e=>VU(e)).join(`,`):e==null?``:String(e)}var HU=new Map;function UU(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${VU(e.locale)}|${JSON.stringify(t)}`,r=HU.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),a={contains(e,t,n){if(!t)return!0;let r=PU(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=PU(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=PU(e,n),a=t.length;return r.length>=a&&i.compare(r.slice(r.length-a),t)===0}};return HU.set(n,a),a}var WU=UU;function GU(e,t=!1){let{overflowY:n}=Ie(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}var KU=Symbol(`none`),qU={value:KU,index:-1};function JU(e,t,n){let r=e.get(t);if(r!==void 0||n===bU)return r;for(let[r,i]of e)if(xU(r,t,n))return i}function YU(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:o,inputValue:s,open:c,defaultOpen:l=!1,selectionMode:u,onItemHighlighted:d,name:f,form:p,disabled:m=!1,readOnly:h=!1,required:g=!1,inputRef:_,grid:v=!1,items:y,filteredItems:x,filter:C,filterQuery:w,openOnInputClick:T=!0,autoHighlight:E=!1,keepHighlight:D=!1,highlightItemOnHover:O=!0,loopFocus:k=!0,itemToStringLabel:P,itemToStringValue:I,isItemEqualToValue:L=bU,virtualized:R=!1,inline:z=!1,fillInputOnItemPress:B=!0,modal:V=!1,limit:H=-1,autoComplete:U=`list`,formAutoComplete:ee,locale:te,submitOnItemClick:ne=!1}=e,{clearErrors:W}=_M(),{setDirty:re,validityData:ie,setFilled:ae,name:G,disabled:oe,setTouched:se,setFocused:ce,validationMode:le,validation:ue}=pM(),de=cc(),fe=CM({id:t}),pe=WU({locale:te}),me=Array.isArray(y)?null:y;if(me&&typeof me.label!=`function`)throw Error(F(100));let he=me?me.data:y,ge=me?.value,_e=ge?void 0:he,ve=b.useMemo(()=>{if(!x||!ge)return;let e=MU(x),t=e.map(ge),n;return{values:t,findItem(r,i){if(!n){n=new Map;for(let r=0;r<t.length;r+=1)n.has(t[r])||n.set(t[r],e[r])}return JU(n,r,i)}}},[x,ge]),ye=b.useMemo(()=>me?e=>me.label(e,L,e=>{let t=ve?.findItem(e,L);return t==null?PU(e,P):me.itemLabel(t)}):P,[me,P,ve,L]),be=b.useMemo(()=>me?Object.assign(e=>me.itemLabel(e),{selected:e=>PU(e,ye)}):P,[me,ye,P]);function xe(e){return PU(e,ye)}let[Se,we]=b.useState(!1),[Te,Ee]=b.useState(null),De=b.useRef(Te),Oe=b.useRef([]),ke=b.useRef([]),Ae=b.useRef(null),je=b.useRef(null),Me=b.useRef(null),Ne=b.useRef(null),Pe=b.useRef(null),Fe=b.useRef(!0),Ie=b.useRef(!1),Le=b.useRef(null),Re=b.useRef(null),ze=b.useRef(null),Ve=b.useRef(qU),He=b.useRef(null),We=b.useRef([]),Ge=b.useRef(null),Ke=oe||m,qe=G??f,Je=u===`multiple`,Ye=u===`single`,Xe=s!==void 0||o!==void 0,Ze=he!==void 0,Qe=x!==void 0,$e;$e=E===`always`?`always`:E?`input-change`:!1;let[et,tt]=jc({controlled:i,default:Je?r??j:r,name:`Combobox`,state:`selectedValue`}),nt=b.useMemo(()=>C===null?()=>!0:C===void 0?BU(pe,be):C,[C,pe,be]),rt=S(()=>Xe?o??``:Ye?xe(et):``).current,[it,at]=jc({controlled:s,default:rt,name:`Combobox`,state:`inputValue`}),[ot,st]=jc({controlled:c,default:l,name:`Combobox`,state:`open`}),ct=jU(he),lt=!ot&&Te!==null?Te:String(it).trim(),ut=Ye?xe(et):``,dt=Ye&&!Se&&lt!==``&&ut.length===lt.length&&pe.contains(ut,lt),ft=dt?``:w??lt,pt=Ze&&Qe&&dt&&(!me||me.hasValue(et,L)),mt=b.useMemo(()=>he?MU(he):j,[he]),ht=b.useMemo(()=>{if(x&&!pt)return x;if(!he)return j;if(ct){let e=he,t=[],n=0;for(let r of e){if(H>-1&&n>=H)break;let e=H>-1?H-n:1/0,i=ft===``?r.items.slice(0,e):[];if(ft!==``)for(let t of r.items){if(i.length>=e)break;nt(t,ft,be)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if(ft===``)return H>-1?mt.slice(0,H):mt;let e=[];for(let t of mt){if(H>-1&&e.length>=H)break;nt(t,ft,be)&&e.push(t)}return e},[x,pt,he,ct,ft,H,nt,be,mt]),gt=b.useMemo(()=>{if(ve&&ht===x)return ve.values;let e=MU(ht);return ge?e.map(e=>ge(e)):e},[ht,x,ve,ge]),q=S(()=>{let e=null;return z&&ot&&Ze&&u!==`none`&&(e=EU(gt,et,L,Je)),new No({id:fe,labelId:void 0,selectedValue:et,open:ot,items:_e,selectionMode:u,name:qe,form:p,disabled:Ke,readOnly:h,required:g,grid:v,virtualized:R,openOnInputClick:T,itemToStringLabel:ye,isItemEqualToValue:L,modal:V,autoHighlight:$e,submitOnItemClick:ne,hasInputValue:Xe,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:z,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemProps:M,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:u===`none`},{onOpenChangeComplete:A,setOpen:A,setInputValue:A,setSelectedValue:A,setIndices:A,handleSelection:A,forceMount:A,requestSubmit:A,listRef:Oe,labelsRef:ke,popupRef:Ae,emptyRef:Pe,inputRef:je,startDismissRef:Me,endDismissRef:Ne,keyboardActiveRef:Fe,chipsContainerRef:Le,clearRef:Re,valuesRef:We,pointerDownItemRef:Ge,selectionEventRef:ze},RU)}).current,_t=u===`none`?it:et,vt=b.useMemo(()=>u===`none`?_t:Array.isArray(et)?et.map(e=>FU(e,I)):FU(et,I),[_t,I,u,et]),yt=X(d),bt=X(n),xt=q.useState(`activeIndex`),St=q.useState(`selectedIndex`),Ct=q.useState(`positionerElement`),wt=q.useState(`listElement`),Tt=q.useState(`triggerElement`),Et=q.useState(`inputElement`),Dt=q.useState(`inputGroupElement`),kt=q.useState(`inline`),At=q.useState(`inputInsidePopup`),jt=q.useState(`inputOwnsFormValue`),Mt=Ye&&!At&&it===ut,Pt=hn(Tt),{mounted:Ft,setMounted:It,transitionStatus:zt}=Ro(ot),{openMethod:Bt,triggerProps:Ht}=ru(ot),Ut=X(()=>vt);kM(At?Pt:je,fe,_t,Ut,!Ke,f);let Wt=X(()=>{he?ke.current=gt.map(xe):q.set(`forceMounted`,!0)}),qt=X((e,t,n)=>{if(t===-1){if(Ve.current===qU)return;Ve.current=qU}else Ve.current={value:e,index:t};yt(e,en(n,void 0,{index:t}))}),Jt=X(e=>{let t={};e.activeIndex!==void 0&&(t.activeIndex=e.activeIndex),e.selectedIndex!==void 0&&(t.selectedIndex=e.selectedIndex),q.update(t);let n=e.activeIndex;if(n===void 0)return;let r=e.type||`none`;n===null?qt(void 0,-1,r):qt(We.current[n],n,r)}),Yt=X((t,n)=>{if(e.onInputValueChange?.(t,n),!n.isCanceled){if(Ie.current=n.reason===Rt,n.reason===`input-change`){ot&&Te!==null&&Ee(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&we(!0),He.current={hasQuery:e};let n=q.state.listElement;if(!q.state.virtualized&&n){let e=Ae.current;for(let t of Be(n.firstElementChild??n)){if(!Ce(t)||(e?!K(e,t):t.getAttribute(`role`)===`dialog`))break;if(GU(t)){t.scrollTop=0;break}}}e&&$e&&q.state.activeIndex==null&&(ot||kt)&&q.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&q.state.inputInsidePopup&&(He.current={hasQuery:!1,selection:!0});at(t)}}),Xt=X(e=>{let t=!e&&At&&!kt&&it!==``&&(String(it).trim()===Te||it===ut);!e&&(t||it===``||Mt)&&we(!1),Ee(null),t&&Yt(``,J(Rt))}),Zt=X((t,n)=>{if(ot!==t&&(n.reason===`escape-key`&&Ze&&gt.length===0&&!Pe.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(t&&Te!==null&&Xt(n.reason===Lt),!t&&Se&&(Ye?(kt||Ee(lt),lt===``&&we(!1)):Je&&(kt||Ee(lt),At&&Jt({activeIndex:null}),(!At||kt)&&Yt(``,J(Rt,n.event,void 0,{isItemPress:n.reason===Nt})))),st(t),!t&&At&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(se(!0),ce(!1),le===`onBlur`)))){let e=u===`none`?it:et;ue.commit(e)}}),Qt=X((e,t)=>{a?.(e,t),!t.isCanceled&&(tt(e),(u===`none`&&Ae.current&&B||Ye&&!q.state.inputInsidePopup)&&Yt(xe(e),J(t.reason,t.event)))}),$t=X((e,t)=>{let n=Ue(e),r=ze.current??e;ze.current=null;let i=J(Nt,r),a=n?.closest(`a`)?.getAttribute(`href`);if(a){a.startsWith(`#`)&&Zt(!1,i);return}if(Je){let e=Array.isArray(et)?et:[],n=CU(e,t,L),r=n?OU(e,t,L):[...e,t];if(Qt(r,i),i.isCanceled||!(je.current&&je.current.value.trim()!==``))return;if(q.state.inputInsidePopup){Yt(``,J(Rt,i.event,void 0,{isItemPress:!0}));let e=He.current;e&&!n&&(e.toggledValue=t)}else Zt(!1,i)}else{if(Qt(t,i),i.isCanceled)return;Zt(!1,i)}}),tn=X(()=>{let e=ue.inputRef.current?.form??q.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),nn=X(()=>{if(It(!1),bt?.(!1),we(!1),Ee(null),Jt(u===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Je&&je.current&&je.current.value!==``&&!Ie.current&&Yt(``,J(Rt)),Ye){if(q.state.inputInsidePopup)je.current&&je.current.value!==``&&Yt(``,J(Rt));else{let e=xe(et);je.current&&je.current.value!==e&&Yt(e,J(e===``?Rt:Ot))}}}),rn=b.useMemo(()=>kt&&Ct?{current:Ct.closest(`[role="dialog"]`)}:Ae,[kt,Ct]);Ho({enabled:!e.actionsRef,open:ot,ref:rn,onComplete(){ot||nn()}}),b.useImperativeHandle(e.actionsRef,()=>({unmount:nn}),[nn]),N(function(){let e=De.current!==null&&Te===null;if(De.current=Te,ot&&(!e||!Ze)||(ot||(Ge.current=null),u===`none`))return;let t=Ze?gt:We.current;Jt({selectedIndex:EU(t,et,L,Je)})},[ot,Te,et,u,Je,Ze,gt,L,Jt]),N(()=>{he&&(We.current=gt,Oe.current.length=gt.length)},[he,gt]),N(()=>{let e=He.current;if(e){let t=ot||kt||q.state.positionerElement?.hidden===!1;if(e.hasQuery)$e&&t&&q.set(`activeIndex`,0),He.current=null;else if(String(it).trim()===``&&(He.current=null,t)){let t=e.selection;$e===`always`&&!t&&q.state.selectionMode===`none`&&q.set(`activeIndex`,0),queueMicrotask(()=>{if(!q.state.open&&!q.state.inline||je.current&&je.current.value.trim()!==``)return;let n=q.state.selectedValue,r=q.state.selectionMode===`multiple`;if(r&&Array.isArray(n)?n.length>0:q.state.selectionMode!==`none`&&n!=null){let t=Ze||Qe?gt:We.current,i=wU(t,e.toggledValue,q.state.isItemEqualToValue);q.set(`activeIndex`,i===-1?EU(t,n,q.state.isItemEqualToValue,r):i)}else t?q.set(`activeIndex`,null):$e===`always`&&q.set(`activeIndex`,0)})}}if(!ot&&!kt)return;let t=Ze||Qe?gt:We.current,n=q.state.activeIndex;if(n==null){if($e===`always`&&t.length>0){q.set(`activeIndex`,0);return}qt(void 0,-1,Ot);return}if(n>=t.length){qt(void 0,-1,Ot),q.set(`activeIndex`,null);return}let r=t[n],i=Ve.current.value,a=i!==KU&&xU(r,i,q.state.isItemEqualToValue);(Ve.current.index!==n||!a)&&qt(r,n,Ot)},[xt,$e,qt,Qe,Ze,gt,kt,ot,q,it]),N(()=>{if(u===`none`){ae(String(it)!==``);return}ae(Je?Array.isArray(et)&&et.length>0:et!=null)},[ae,u,it,et,Je]),b.useEffect(()=>{Ze&&$e&&gt.length===0&&Jt({activeIndex:null})},[Ze,$e,gt.length,Jt]);function an(){ot&&lt!==``&&lt!==String(rt)&&!Mt&&we(!0)}function on(){ot&&Te!==null&&Xt(!1)}let sn=!1;function cn(){!sn&&it!==ut&&(sn=!0,Yt(ut,J(Ot)))}function un(){u!==`none`&&(W(qe),re(SU(et,ie.initialValue,L)),ue.change(et),Ye&&!Xe&&!At&&cn())}function dn(){Ye&&!Xe&&!At&&!Se&&cn()}function fn(){u===`none`&&(W(qe),re(it!==ie.initialValue),ue.change(it))}tu(lt,an),tu(ot,on),tu(et,un),tu(ut,dn),tu(he,dn),tu(it,fn);let pn=fs({open:kt?!0:ot,onOpenChange:Zt,elements:{reference:At?Tt:Et,floating:Ct}}),mn=v?`grid`:`listbox`,gn=ot||kt,_n=gn?`true`:`false`,vn=b.useMemo(()=>{let e=Et?.tagName===`INPUT`,t=Et==null||e,n=t||gn,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=_n,r[`aria-haspopup`]=mn,r[`aria-controls`]=gn?wt?.id:void 0,r[`aria-autocomplete`]=h?`none`:U),{reference:r,floating:{role:`presentation`}}},[Et,gn,_n,mn,wt?.id,U,h]),yn=ua(pn,{enabled:!Ke&&T,event:`mousedown-only`,toggle:!1,touchOpenDelay:At?0:100,reason:Vt}),bn=ga(pn,{enabled:!Ke&&!kt,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:kt?!0:void 0,outsidePress(e){let t=Ue(e);return!K(Tt,t)&&!K(Re.current,t)&&!K(Le.current,t)&&!K(Dt,t)}}),xn=Ms(pn,{enabled:!Ke,id:fe,listRef:Oe,activeIndex:xt,selectedIndex:St,virtual:!0,loopFocus:k,allowEscape:k&&!$e,focusItemOnOpen:Se||u===`none`&&!$e?!1:`auto`,focusItemOnHover:O,resetOnPointerLeave:!D,orientation:v?`horizontal`:void 0,rtl:de===`rtl`,disabledIndices:j,grid:v?cU:void 0,onNavigate(e,t){(t||ot)&&zt!==`ending`&&Jt(t?{activeIndex:e,type:Fe.current?Gt:Kt}:{activeIndex:e})}}),Sn=b.useMemo(()=>pi(xn.reference,{onKeyDown(e){v&&q.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},bn.reference,yn.reference,vn.reference),[xn.reference,bn.reference,yn.reference,vn.reference,v,q]),Cn=b.useMemo(()=>pi(Uo,bn.floating),[bn.floating]),wn=b.useMemo(()=>pi(xn.floating,vn.floating),[xn.floating,vn.floating]),Tn=b.useMemo(()=>{let e=xn.item;return e?{...e,onFocus:void 0}:M},[xn.item]);q.useContextCallback(`setOpen`,Zt),q.useContextCallback(`setInputValue`,Yt),q.useContextCallback(`setSelectedValue`,Qt),q.useContextCallback(`setIndices`,Jt),q.useContextCallback(`handleSelection`,$t),q.useContextCallback(`forceMount`,Wt),q.useContextCallback(`requestSubmit`,tn),q.useContextCallback(`onOpenChangeComplete`,n),sU(()=>{q.update({inline:z,popupProps:Cn,listProps:wn,inputProps:Sn,triggerProps:Ht,itemProps:Tn})});let En={id:fe,selectedValue:et,open:ot,mounted:Ft,transitionStatus:zt,items:_e,inline:z,popupProps:Cn,listProps:wn,inputProps:Sn,triggerProps:Ht,itemProps:Tn,openMethod:Bt,selectionMode:u,name:qe,form:p,disabled:Ke,readOnly:h,required:g,grid:v,virtualized:R,openOnInputClick:T,itemToStringLabel:ye,modal:V,autoHighlight:$e,isItemEqualToValue:L,submitOnItemClick:ne,hasInputValue:Xe};N(()=>{q.update({...En,inputOwnsFormValue:u===`none`&&(z||!q.state.inputInsidePopup)})},[q,...Object.values(En)]);let Dn=ln(_,ue.inputRef),An=b.useMemo(()=>({query:lt,hasItems:Ze,filteredItems:ht,flatFilteredValues:gt}),[lt,Ze,ht,gt]),jn=b.useMemo(()=>Array.isArray(_t)?``:FU(_t,I),[_t,I]),Mn=Je&&Array.isArray(et)&&et.length>0,Nn=Je||u===`none`&&jt?void 0:qe,Pn=b.useMemo(()=>!Je||!Array.isArray(et)||!qe?null:et.map(e=>{let t=FU(e,I);return(0,Y.jsx)(`input`,{type:`hidden`,form:p,name:qe,value:t,disabled:Ke},t)}),[Je,et,p,qe,I,Ke]),Fn=(0,Y.jsxs)(b.Fragment,{children:[e.children,(0,Y.jsx)(`input`,{...ue.getValidationProps(Ke,{onFocus(){if(At){Tt?.focus();return}(je.current||Tt)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||Ke||h)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=J(Ot,e.nativeEvent),i=()=>We.current.findIndex(e=>FU(e,I).toLowerCase()===n||xe(e).toLowerCase()===n);function a(){if(Je)return;if(u===`none`){Yt(t,r);return}let e=i();e===-1&&(e=We.current.findIndex((e,t)=>{let r=ke.current[t];return r!=null&&r.toLowerCase()===n}));let a=e===-1?void 0:We.current[e];a!=null&&Qt?.(a,r)}Ye&&(Wt(),he&&i()===-1&&q.set(`forceMounted`,!0)),queueMicrotask(a)}}),id:fe&&Nn==null?`${fe}-hidden-input`:void 0,form:p,name:Nn,autoComplete:ee,disabled:Ke,required:g&&!Mn,readOnly:h,value:jn,ref:Dn,style:Nn?kn:On,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Pn]});return(0,Y.jsx)(lU.Provider,{value:q,children:(0,Y.jsx)(uU.Provider,{value:pn,children:(0,Y.jsx)(fU.Provider,{value:Ze,children:(0,Y.jsx)(dU.Provider,{value:An,children:(0,Y.jsx)(pU.Provider,{value:it,children:Fn})})})})})}function XU(e){let{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:a,...o}=e;return(0,Y.jsx)(YU,{...o,selectionMode:t?`multiple`:`single`,selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:a})}function ZU(e){return e==null?void 0:`${e}-label`}function QU(e,t){return e??t}var $U=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=a;delete o.id;let s=pM(),c=mU(),l=c.useState(`inputInsidePopup`),u=c.useState(`triggerElement`);c.useState(`inputElement`);let d=c.useState(`id`),f=TM({id:ZU(d),fallbackControlId:u?.id??(l?d:void 0),setLabelId(e){let t=typeof e==`function`?e(c.state.labelId):e;c.set(`labelId`,t)}});return Di(`div`,e,{ref:t,state:s.state,props:[f,a],stateAttributesMapping:uM})});function eW(e){let{children:t,placeholder:n}=e,r=mU(),i=r.useState(`itemToStringLabel`),a=r.useState(`selectedValue`),o=r.useState(`items`),s=r.useState(`selectionMode`)===`multiple`,c=r.useState(`hasSelectedValue`),l=!c&&n!=null&&t==null,u=r.useState(`hasNullItemLabel`,l),d=null;return d=typeof t==`function`?t(a):t??(!c&&n!=null&&!u?n:s&&Array.isArray(a)?LU(a,o,i):IU(a,o,i)),(0,Y.jsx)(b.Fragment,{children:d})}var tW=`data-popup-side`,nW=`data-list-empty`,rW={...ft,...uM,popupSide:e=>e?{[tW]:e}:null,listEmpty:e=>e?{[nW]:``}:null},iW=b.createContext(void 0);function aW(){return b.useContext(iW)}var oW=b.createContext(void 0);function sW(e){let t=b.useContext(oW);if(t===void 0&&!e)throw Error(F(21));return t}var cW=b.forwardRef(function(e,t){let n=mU(),{buttonRef:r,getButtonProps:i}=hl({native:!1}),a=ln(t,r);function o(e){n.context.setOpen(!1,J(Pt,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return(0,Y.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:kn})});function lW(e){let t=e.useState(`mounted`),n=e.useState(`popupSide`),r=e.useState(`positionerElement`);return t&&r?n:null}function uW(){return gU().filteredItems.length===0}function dW(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function fW(e,t){let n=e>=t-1?t-2:e;return n>=0?n:void 0}function pW(e,t,n){let r=e.context.listRef.current[t];r&&(e.context.selectionEventRef.current=n,r.click(),e.context.selectionEventRef.current=null)}var mW=b.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:o,...s}=e,{state:c,disabled:l,setTouched:u,setFocused:d,validationMode:f,validation:p}=pM(),{labelId:m}=yM(),h=aW(),g=!!sW(!0),_=mU(),v=_U(),y=cc(),x=_.useState(`required`),S=_.useState(`disabled`),C=_.useState(`readOnly`),w=_.useState(`name`),T=_.useState(`form`),E=_.useState(`selectionMode`),D=_.useState(`autoHighlight`),O=_.useState(`inputProps`),k=_.useState(`triggerProps`),A=_.useState(`open`),j=_.useState(`mounted`),M=_.useState(`selectedValue`),N=_.useState(`id`),P=_.useState(`inline`),F=_.useState(`modal`),I=!!D,L=lW(_),R=l||S||i,z=uW(),B=g||P,V=!B||F,H=Js(a??(B?void 0:N)),U=g?cM:c,[ee,te]=b.useState(null),ne=b.useRef(!1),W=b.useRef(null),re=b.useRef(!1),ie=E===`none`&&!g,G=X(e=>{let t=g||_.state.inline;t&&!_.state.hasInputValue&&_.context.setInputValue(``,J(Ot)),_.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:ie})}),oe=g?s:p.getValidationProps(R,s);function se(){_.context.setIndices({activeIndex:null,selectedIndex:null,type:_.context.keyboardActiveRef.current?Gt:Kt})}function le(){_.context.keyboardActiveRef.current=!1}let ue={...U,open:A,disabled:R,readOnly:C,popupSide:L,listEmpty:z};function fe(e){if(!h)return;let t,{highlightedChipIndex:n}=h,r=h.chipsRef.current.length,[i,a]=dW(y);return n===void 0?(e.key===i&&(e.currentTarget.selectionStart??0)===0&&M.length>0&&(e.preventDefault(),t=r>0?r-1:void 0),t):(e.key===i?(e.preventDefault(),t=n>0?n-1:void 0):e.key===a?(e.preventDefault(),t=n<r-1?n+1:void 0):(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),t=fW(n,M.length),se()),t)}let pe=Di(`input`,e,{state:ue,ref:[t,_.context.inputRef,G],props:[O,k,{value:ee??v,"aria-readonly":C||void 0,"aria-required":x||void 0,"aria-labelledby":m,disabled:R,readOnly:C,required:E===`none`?x:void 0,form:T,...ie&&w&&{name:w},id:H,onFocus(){if(d(!0),!P||!re.current)return;re.current=!1;let e=W.current;e!=null&&Object.hasOwn(_.context.valuesRef.current,e)&&_.context.setIndices({activeIndex:e})},onBlur(){u(!0),d(!1);let e=_.state.activeIndex;if(P&&e!==null&&D!==`always`&&(W.current=e,re.current=!0,_.context.setIndices({activeIndex:null})),f===`onBlur`){let e=E===`none`?v:M;p.commit(e)}},onCompositionStart(e){ae||(ne.current=!0,te(e.currentTarget.value))},onCompositionEnd(e){ne.current=!1;let t=e.currentTarget.value;te(null),_.context.setInputValue(t,J(Lt,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=ne.current||!r;function a(e){!C&&!R&&e&&i&&(_.context.setOpen(!0,J(Lt,t)),I||se())}if(ne.current){let n=e.currentTarget.value;te(n),n===``&&!_.state.openOnInputClick&&!_.state.inputInsidePopup&&_.context.setOpen(!1,J(Rt,t));let r=n.trim(),i=I&&r!==``;a(r),A&&_.state.activeIndex!==null&&!i&&se();return}let o=J(Lt,t);if(_.context.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=J(Rt,t);s&&!_.state.inputInsidePopup&&(E===`single`&&_.context.setSelectedValue(null,c),_.state.openOnInputClick||_.context.setOpen(!1,c)),a(e.currentTarget.value.trim()),A&&_.state.activeIndex!==null&&!I&&se()},onKeyDown(e){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(_.context.keyboardActiveRef.current=!0,R||C){C&&e.key===`Enter`&&A&&_.state.activeIndex!==null&&de(e);return}let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=y===`rtl`;if(e.key===`Home`){de(e);let n=ce&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){de(e);let i=ce&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!j&&e.key===`Escape`){let t=E===`multiple`&&Array.isArray(M)?M.length===0:M===null,n=J(Ut,e.nativeEvent),r=E===`multiple`?[]:null;_.context.setInputValue(``,n),_.context.setSelectedValue(r,n),!t&&!_.state.inline&&!n.isPropagationAllowed&&e.stopPropagation();return}if(h&&e.key===`Backspace`&&t.value===``&&h.highlightedChipIndex===void 0&&Array.isArray(M)&&M.length>0){let t=h.chipsRef.current.length,n=t>0?t-1:M.length-1,r=M.filter((e,t)=>t!==n);se(),_.context.setSelectedValue(r,J(Ot,e.nativeEvent));return}let i=h?.highlightedChipIndex!==void 0,a=fe(e);if(h?.setHighlightedChipIndex(a),a===void 0?i&&_.context.inputRef.current?.focus():h?.chipsRef.current[a]?.focus(),e.which!==229&&e.key===`Enter`&&A){let t=_.state.activeIndex,n=e.nativeEvent;if(t===null){if(P)return;_.context.setOpen(!1,J(Ot,n));return}de(e),pW(_,t,n)}},onPointerMove:le,onPointerDown:le},oe],stateAttributesMapping:rW}),me=g?(0,Y.jsx)(fM.Provider,{value:dM,children:pe}):pe;return(0,Y.jsxs)(b.Fragment,{children:[A&&V&&(0,Y.jsx)(cW,{ref:_.context.startDismissRef}),me]})}),hW=b.forwardRef(function(e,t){let{render:n,className:r,nativeButton:i=!0,disabled:a=!1,id:o,style:s,...c}=e,{state:l,disabled:u,setTouched:d,setFocused:f,validationMode:p,validation:m}=pM(),{labelId:h}=yM(),g=mU(),_=g.useState(`selectionMode`),v=g.useState(`disabled`),y=g.useState(`readOnly`),x=g.useState(`required`),S=g.useState(`positionerElement`),C=g.useState(`listElement`),w=g.useState(`popupId`),T=g.useState(`triggerProps`),E=g.useState(`inputInsidePopup`),D=g.useState(`id`),O=g.useState(`labelId`),k=g.useState(`open`),A=g.useState(`selectedValue`),j=g.useState(`activeIndex`),M=g.useState(`selectedIndex`),N=g.useState(`hasSelectedValue`),P=hU(),F=_U(),I=V(),L=u||v||a,R=uW(),z=lW(g);CM({id:E?o:void 0});let B=E?o??D:o,H=QU(h,O),U;k&&E?U=w??zU(D):k&&(U=C?.id);let ee=b.useRef(``);function te(e){ee.current=e.pointerType}let{reference:ne}=Ns(P,{enabled:!k&&!y&&!v&&_===`single`,listRef:g.context.labelsRef,activeIndex:j,selectedIndex:M,onMatch(e){let t=g.context.valuesRef.current[e];t!==void 0&&g.context.setSelectedValue(t,J(Ot))}}),{reference:W}=ua(P,{enabled:!v,event:`mousedown`}),{buttonRef:re,getButtonProps:ie}=hl({native:i,disabled:L}),ae={...l,readOnly:y,open:k,disabled:L,popupSide:z,listEmpty:R,placeholder:_!==`none`&&!N};return Di(`button`,e,{ref:[t,re,X(e=>{g.set(`triggerElement`,e)})],state:ae,props:[T,W,ne,{id:B,tabIndex:E?0:-1,role:E?`combobox`:void 0,"aria-expanded":k,"aria-haspopup":E?`dialog`:`listbox`,"aria-controls":U,"aria-required":E&&x||void 0,"aria-readonly":E&&y||void 0,"aria-labelledby":H,onPointerDown:te,onPointerEnter:te,onFocus(){f(!0),!L&&I.start(0,g.context.forceMount)},onBlur(e){if(!K(S,e.relatedTarget)&&(d(!0),f(!1),p===`onBlur`)){let e=_===`none`?F:A;m.commit(e)}},onMouseDown(e){if(L||(E||P.set(`domReferenceElement`,e.currentTarget),g.context.forceMount(),ee.current!==`touch`&&(g.context.inputRef.current?.focus(),E||e.preventDefault()),k))return;let t=En(e.currentTarget);function n(e){let t=g.state.triggerElement;if(!t)return;let n=Ue(e),r=g.state.positionerElement,i=g.state.listElement;K(t,n)||K(r,n)||K(i,n)||Yu(e,t)||g.context.setOpen(!1,J(Jt,e))}E&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(de(e),g.context.setOpen(!0,J(Wt,e.nativeEvent)),g.context.inputRef.current?.focus())}},m.getValidationProps(L,c),ie],stateAttributesMapping:rW})}),gW=b.createContext(null);function _W(){return b.useContext(gW)}function vW(e){let{children:t,items:n}=e,r=b.useMemo(()=>({items:n}),[n]);return(0,Y.jsx)(gW.Provider,{value:r,children:t})}function yW(e){let{children:t}=e,{filteredItems:n}=gU(),r=_W(),i=r?r.items:n;return(0,Y.jsx)(b.Fragment,{children:i.map(t)})}var bW=b.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=mU(),l=hU(),u=!!sW(!0),{filteredItems:d,hasItems:f}=gU(),p=c.useState(`selectionMode`),m=c.useState(`grid`),h=c.useState(`readOnly`),g=c.useState(`listProps`),_=c.useState(`virtualized`),v=c.useState(`forceMounted`),y=p===`multiple`,x=d.length===0,S=X(e=>{c.set(`positionerElement`,e)}),C=X(e=>{c.set(`listElement`,e)}),w=b.useMemo(()=>typeof o==`function`?n||=(0,Y.jsx)(yW,{children:o}):o,[o]),T={empty:x},E=l.useState(`floatingId`),D=Di(`div`,e,{state:T,ref:[t,C,u?null:S],props:[g,{children:w,tabIndex:-1,id:E,role:m?`grid`:`listbox`,"aria-multiselectable":y?`true`:void 0,"aria-readonly":!m&&h?!0:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;de(e),pW(c,t,e.nativeEvent)}},onKeyDownCapture(){c.context.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.context.keyboardActiveRef.current=!1}},s]});if(_)return D;let O=f&&!v?void 0:c.context.labelsRef;return(0,Y.jsx)(Pc,{elementsRef:c.context.listRef,labelsRef:O,children:D})}),xW=`⁠`;function SW(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=null;for(;t.nextNode();){let e=t.currentNode;e.nodeValue!==``&&(n=e)}return n}function CW(){let e=V(),t=b.useRef(null);return b.useEffect(()=>{if(re)return;let n=t.current;if(n==null)return;let r=SW(n);if(r==null)return;let i=r.data,a=`${i}${xW}`;return r.nodeValue=a,e.start(200,()=>{r.nodeValue===a&&(r.nodeValue=i)}),()=>{e.clear(),r.nodeValue===a&&(r.nodeValue=i)}},[t,e]),t}var wW=b.createContext(void 0);function TW(){let e=b.useContext(wW);if(e===void 0)throw Error(F(20));return e}var EW=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=mU(),a=i.useState(`mounted`),o=i.useState(`forceMounted`);return a||n||o?(0,Y.jsx)(wW.Provider,{value:n,children:(0,Y.jsx)(Wi,{ref:t,...r})}):null}),DW=b.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m=!1,collisionAvoidance:h=Ii,style:g,..._}=e,v=mU(),y=hU(),b=TW(),x=v.useState(`modal`),S=v.useState(`open`),C=v.useState(`mounted`),w=v.useState(`openMethod`),T=v.useState(`positionerElement`),E=v.useState(`triggerElement`),D=v.useState(`inputElement`),O=v.useState(`inputGroupElement`),k=v.useState(`inputInsidePopup`),A=v.useState(`transitionStatus`),j=uW(),M=Sc({anchor:i??(k?E:O??D),floatingRootContext:y,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,lazyFlip:!0});Iu(S&&x,w===`touch`,T,E);let P={open:S,side:M.side,align:M.align,anchorHidden:M.anchorHidden,empty:j};N(()=>{v.set(`popupSide`,M.side)},[v,M.side]);let F=X(e=>{v.set(`positionerElement`,e)}),I=Ec(e,P,{styles:M.positionerStyles,transitionStatus:A,props:_,refs:[t,F],hidden:!C,inert:!S});return(0,Y.jsxs)(oW.Provider,{value:M,children:[C&&x&&(0,Y.jsx)(Nl,{inert:Ac(!S),cutout:O??D??E}),I]})}),OW={...pt,...et},kW=b.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=mU(),l=sW(),u=hU(),d=c.useState(`mounted`),f=c.useState(`open`),p=c.useState(`openMethod`),m=c.useState(`popupProps`),h=c.useState(`transitionStatus`),g=c.useState(`inputInsidePopup`),_=c.useState(`inputElement`),v=c.useState(`modal`),y=c.useState(`id`),x=uW(),S=s.id??(g?zU(y):void 0);N(()=>(c.set(`popupId`,c.context.popupRef.current?.id||S),()=>{c.set(`popupId`,void 0)}),[c,S]),Ho({open:f,ref:c.context.popupRef,onComplete(){f&&c.context.onOpenChangeComplete(!0)}});let C=Di(`div`,e,{state:{open:f,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:x},ref:[t,c.context.popupRef],props:[m,{id:S,role:g?`dialog`:`presentation`,onFocus(e){let t=Ue(e.nativeEvent);p!==`touch`&&(K(c.state.listElement,t)||t===e.currentTarget)&&c.context.inputRef.current?.focus()}},Tc(h),s],stateAttributesMapping:OW}),w=a===void 0?g?e=>e===`touch`?c.context.popupRef.current:_:!1:a,T;T=o??(g?void 0:!1);let E=!g||v;return(0,Y.jsx)(la,{context:u,disabled:!d,modal:E,openInteractionType:p,initialFocus:w,returnFocus:T,getInsideElements:()=>[c.context.startDismissRef.current,c.context.endDismissRef.current],children:(0,Y.jsxs)(b.Fragment,{children:[C,E&&(0,Y.jsx)(cW,{ref:c.context.endDismissRef})]})})}),AW=b.createContext(void 0);function jW(){let e=b.useContext(AW);if(e===void 0)throw Error(F(18));return e}var MW=b.forwardRef(function(e,t){let{render:n,className:r,style:i,items:a,...o}=e,s=mU().useState(`grid`),[c,l]=b.useState(),u=b.useMemo(()=>({labelId:c,setLabelId:l,items:a}),[c,l,a]),d=Di(`div`,e,{ref:t,props:[{role:s?`rowgroup`:`group`,"aria-labelledby":c},o]}),f=(0,Y.jsx)(AW.Provider,{value:u,children:d});return a?(0,Y.jsx)(vW,{items:a,children:f}):f}),NW=b.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{setLabelId:s}=jW(),c=Js(a);return N(()=>(s(c),()=>{s(e=>e===c?void 0:e)}),[c,s]),Di(`div`,e,{ref:t,props:[{id:c,"aria-hidden":!0},o]})}),PW=b.createContext(void 0);function FW(){let e=b.useContext(PW);if(!e)throw Error(F(19));return e}var IW=b.createContext(!1);function LW(){return b.useContext(IW)}function RW(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:i}=e,{render:a,className:o,style:s,value:c=null,index:l,disabled:u=!1,nativeButton:d=!1,...f}=t,p=b.useRef(null),m=vl({guess:!0,index:l,textRef:p}),h=mU(),g=LW(),_=vU(),v=h.useState(`selectionMode`),y=h.useState(`disabled`),x=h.useState(`readOnly`),S=h.useState(`isItemEqualToValue`),C=y||u,w=v!==`none`,T=l??i??m.index,E=T!==-1,D=h.useState(`id`),O=h.useState(`isActive`,T),k=h.useState(`isSelected`,c),A=h.useState(`itemProps`),j=b.useRef(null),M=D!=null&&E?`${D}-${T}`:void 0,P=k&&w;N(()=>{if(!E||!r&&l==null)return;let e=h.context.listRef.current;return e[T]=j.current,()=>{delete e[T]}},[E,r,T,l,h]),N(()=>{if(!E||_)return;let e=h.context.valuesRef.current;return e[T]=c,()=>{delete e[T]}},[E,_,T,c,h]),N(()=>{if(!E||_)return;let e=h.state.selectedValue,t=h.state.selectedIndex;h.state.selectionMode===`multiple`&&Array.isArray(e)?t=DU(T,c,h.context.valuesRef.current,e,S,t):xU(c,e,S)&&(t=T),h.set(`selectedIndex`,t)},[E,_,h,T,c,S]);let{getButtonProps:F,buttonRef:I}=hl({disabled:C,focusableWhenDisabled:!0,native:d,composite:!0}),L={disabled:C,selected:P,highlighted:O};function R(e){function t(){h.context.handleSelection(e,c)}h.state.submitOnItemClick?(zi.flushSync(t),h.context.requestSubmit()):t()}let z={id:M,role:g?`gridcell`:`option`,"aria-selected":w?P:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(h.context.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){C||x||R(e.nativeEvent)},onMouseUp(e){let t=h.context.pointerDownItemRef.current===e.currentTarget;h.context.pointerDownItemRef.current=null,!(C||x||e.button!==0||t||!O)&&R(e.nativeEvent)}},B=Di(`div`,t,{ref:[I,n,m.ref,j],state:L,props:[A,z,f,F]}),V=b.useMemo(()=>({selected:P,textRef:p}),[P,p]);return(0,Y.jsx)(PW.Provider,{value:V,children:B})}function zW(e){let{componentProps:t,forwardedRef:n}=e,r=mU().useState(`isItemEqualToValue`),{flatFilteredValues:i}=gU(),a=wU(i,t.value??null,r);return(0,Y.jsx)(RW,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:a})}var BW=b.memo(b.forwardRef(function(e,t){let n=mU().useState(`virtualized`);return n&&e.index==null?(0,Y.jsx)(zW,{componentProps:e,forwardedRef:t}):(0,Y.jsx)(RW,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})})),VW=b.forwardRef(function(e,t){let{selected:n}=FW();return e.keepMounted||n?(0,Y.jsx)(HW,{...e,ref:t}):null}),HW=b.memo(b.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=FW(),c=b.useRef(null),{transitionStatus:l,setMounted:u}=Ro(s),d=Di(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:et});return Ho({batch:!0,enabled:!s,open:s,ref:c,onComplete(){s||u(!1)}}),d})),UW=b.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{filteredItems:s}=gU(),c=mU(),l=CW(),u=s.length===0?a:null;return Di(`div`,e,{ref:[t,c.context.emptyRef,l],props:[{children:u,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})});function WW(e){let t=(0,kA.c)(13),{label:n,children:r,onClick:i,disabled:a,pressed:o,className:s}=e,c=s===void 0?``:s,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Y.jsx)(bu,{}),t[0]=l):l=t[0];let u=`icon-button ${c}`,d;t[1]!==r||t[2]!==a||t[3]!==n||t[4]!==i||t[5]!==o||t[6]!==u?(d=(0,Y.jsx)(ec,{render:l,className:u,"aria-label":n,"aria-pressed":o,disabled:a,onClick:i,children:r}),t[1]=r,t[2]=a,t[3]=n,t[4]=i,t[5]=o,t[6]=u,t[7]=d):d=t[7];let f;t[8]===n?f=t[9]:(f=(0,Y.jsx)(ic,{children:(0,Y.jsx)(Dc,{sideOffset:8,children:(0,Y.jsx)(Oc,{className:`tooltip`,children:n})})}),t[8]=n,t[9]=f);let p;return t[10]!==d||t[11]!==f?(p=(0,Y.jsxs)(Ks,{children:[d,f]}),t[10]=d,t[11]=f,t[12]=p):p=t[12],p}function GW(e){let t=(0,kA.c)(35),{label:n,value:r,groups:i,onChange:a}=e,o;if(t[0]!==i||t[1]!==r){let e;t[3]===r?e=t[4]:(e=e=>e.value===r,t[3]=r,t[4]=e),o=i.flatMap(XW).find(e),t[0]=i,t[1]=r,t[2]=o}else o=t[2];let s=o,c;t[5]===i?c=t[6]:(c=i.filter(YW),t[5]=i,t[6]=c);let l;t[7]!==s||t[8]!==r?(l=s||{value:r,label:r},t[7]=s,t[8]=r,t[9]=l):l=t[9];let u;t[10]===a?u=t[11]:(u=e=>{e&&a(e.value)},t[10]=a,t[11]=u);let d;t[12]===n?d=t[13]:(d=(0,Y.jsx)($U,{className:`control-label`,children:n}),t[12]=n,t[13]=d);let f,p,m;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(wj,{}),p=(0,Y.jsx)(`span`,{children:(0,Y.jsx)(eW,{})}),m=(0,Y.jsx)(hj,{}),t[14]=f,t[15]=p,t[16]=m):(f=t[14],p=t[15],m=t[16]);let h;t[17]===n?h=t[18]:(h=(0,Y.jsxs)(hW,{className:`branch-trigger`,"aria-label":n,children:[f,p,m]}),t[17]=n,t[18]=h);let g;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Y.jsx)(Ej,{}),t[19]=g):g=t[19];let _;t[20]===n?_=t[21]:(_=n.toLowerCase(),t[20]=n,t[21]=_);let v=`Search ${_}`,y;t[22]===v?y=t[23]:(y=(0,Y.jsxs)(`div`,{className:`search-field`,children:[g,(0,Y.jsx)(mW,{"aria-label":v,placeholder:`Find a branch…`})]}),t[22]=v,t[23]=y);let b,x;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Y.jsx)(UW,{className:`popup-empty`,children:`No matching branches.`}),x=(0,Y.jsx)(bW,{className:`option-list`,children:KW}),t[24]=b,t[25]=x):(b=t[24],x=t[25]);let S;t[26]===y?S=t[27]:(S=(0,Y.jsx)(EW,{children:(0,Y.jsx)(DW,{sideOffset:6,align:`start`,className:`floating`,children:(0,Y.jsxs)(kW,{className:`popup branch-popup`,children:[y,b,x]})})}),t[26]=y,t[27]=S);let C;return t[28]!==S||t[29]!==c||t[30]!==l||t[31]!==u||t[32]!==d||t[33]!==h?(C=(0,Y.jsxs)(XU,{items:c,value:l,onValueChange:u,isItemEqualToValue:JW,limit:60,children:[d,h,S]}),t[28]=S,t[29]=c,t[30]=l,t[31]=u,t[32]=d,t[33]=h,t[34]=C):C=t[34],C}function KW(e){return(0,Y.jsxs)(MW,{items:e.items,className:`option-group`,children:[(0,Y.jsx)(NW,{className:`option-group-label`,children:e.value}),(0,Y.jsx)(yW,{children:qW})]},e.value)}function qW(e){return(0,Y.jsxs)(BW,{className:`option`,value:e,children:[(0,Y.jsx)(wj,{}),(0,Y.jsx)(`span`,{children:e.label}),(0,Y.jsx)(VW,{children:(0,Y.jsx)(gj,{})})]},e.value)}function JW(e,t){return e.value===t.value}function YW(e){return e.items.length}function XW(e){return e.items}function ZW(e){let t=(0,kA.c)(7),{lines:n,children:r}=e,i=n===void 0?2:n,a;t[0]===r?a=t[1]:(a=(0,Y.jsx)(`span`,{children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=Array.from({length:i},QW),t[2]=i,t[3]=o);let s;return t[4]!==a||t[5]!==o?(s=(0,Y.jsxs)(`div`,{className:`review-loading`,role:`status`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6],s}function QW(e,t){return(0,Y.jsx)(`div`,{},t)}function $W(e){let t=(0,kA.c)(10),{icon:n,title:r,children:i}=e,a;t[0]===n?a=t[1]:(a=(0,Y.jsx)(`div`,{className:`empty-icon`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,Y.jsx)(`h2`,{children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Y.jsx)(`p`,{children:i}),t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,Y.jsxs)(`div`,{className:`empty-state`,children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}var eG=window.location.hash.slice(1);async function tG(e,t={},n){let r;try{r=await fetch(`/api/${e}?${new URLSearchParams(t)}`,{...n,headers:{Authorization:`Bearer ${eG}`}})}catch(e){throw e instanceof DOMException&&e.name===`AbortError`?e:Error(`The polydiff server stopped responding. Is it still running?`,{cause:e})}if(!r.headers.get(`content-type`)?.includes(`application/json`))throw Error(`Start polydiff in your terminal and open the URL it prints.`);let i=await r.json();if(!r.ok)throw Error(i.error||`Request failed.`);return i}function nG(e,t){return tG(e,{},{method:`POST`,body:JSON.stringify(t)})}var rG={loading:!0};function iG(e,t){return`diff-${encodeURIComponent(e)}${t?`-${encodeURIComponent(t)}`:``}`}function aG(e){return e===`@working`?`working tree`:e}function oG(e){return e.flatMap(e=>e.hunks).reduce((e,t)=>({added:e.added+t.additionLines,removed:e.removed+t.deletionLines}),{added:0,removed:0})}function sG(e,t,n){let r={};return t.base&&t.base!==e.base&&(r.base=t.base),t.target&&t.target!==`@working`&&(r.target=t.target),n===`custom`&&t.selected!==void 0&&(r.selected=t.selected),r}function cG(e,t){let[n,r]=(0,b.useState)(e.root),[i,a]=(0,b.useState)([]),[o,s]=(0,b.useState)(e.repos),[c,l]=(0,b.useState)(e.selection),[u,d]=(0,b.useState)({}),[f,p]=(0,b.useState)(!0),[m,h]=(0,b.useState)(``),[g,_]=(0,b.useState)([]),v=(0,b.useRef)(null),y=(0,b.useRef)(new Map),x=(0,b.useRef)(0),S=(0,b.useRef)(o),C=(0,b.useRef)(``);(0,b.useEffect)(()=>{S.current=o},[o]);let w=(0,b.useMemo)(()=>i.map(e=>{let t=o[e.path];return{repo:e,base:t?.base||e.base,target:t?.target||`@working`,selected:t?.selected,...u[e.path]||rG}}),[i,o,u]),T=(0,b.useCallback)(e=>c===`all`?!0:c===`none`?!1:c===`custom`&&e.selected!==void 0?e.selected:!!e.data?.files.length,[c]),E=(0,b.useMemo)(()=>w.filter(T),[w,T]),D=(0,b.useCallback)(async(e,t,n,r)=>{if(r?.aborted)return;y.current.get(e.path)?.abort();let i=new AbortController;y.current.set(e.path,i);let a=()=>i.abort();r?.addEventListener(`abort`,a,{once:!0});let o=++x.current;d(t=>({...t,[e.path]:{...t[e.path],loading:!0}}));try{let r=await tG(`diff`,{repo:e.path,base:t,target:n},{signal:i.signal});if(i.signal.aborted)return;let a=VD(r.patch,`${e.path}:${o}`,!0).flatMap(e=>e.files);d(t=>({...t,[e.path]:{loading:!1,data:{files:a,mergeBase:r.mergeBase,targetRef:r.targetRef,warnings:r.warnings,version:o}}}))}catch(t){i.signal.aborted||d(n=>({...n,[e.path]:{loading:!1,error:t instanceof Error?t.message:`Could not load changes.`}}))}finally{r?.removeEventListener(`abort`,a),y.current.get(e.path)===i&&y.current.delete(e.path)}},[]),O=(0,b.useCallback)(async(e,t=!1)=>{v.current?.abort(),y.current.forEach(e=>e.abort()),y.current.clear();let n=new AbortController;v.current=n,p(!0),h(``);try{let i=await tG(`workspace`,{path:e},{signal:n.signal});if(n.signal.aborted)return;r(i.root),_(i.warnings),a(i.repos),t||d({}),p(!1);let o=0;await Promise.all(Array.from({length:Math.min(4,i.repos.length)},async()=>{for(;o<i.repos.length&&!n.signal.aborted;){let e=i.repos[o++],t=S.current[e.path];await D(e,t?.base||e.base,t?.target||`@working`,n.signal)}}))}catch(e){n.signal.aborted||(h(e instanceof Error?e.message:`Could not scan workspace.`),p(!1))}},[D]);return(0,b.useEffect)(()=>{O(e.root);let t=y.current;return()=>{v.current?.abort(),t.forEach(e=>e.abort())}},[O,e.root]),(0,b.useEffect)(()=>{if(!i.length)return;let e={};for(let t of i)e[t.path]=sG(t,o[t.path]||{},c);let n=JSON.stringify({repos:e,selection:c});n!==C.current&&(C.current=n,t({repos:e,selection:c}))},[i,o,c,t]),{root:n,entries:w,selected:E,included:T,selection:c,scanning:f,error:m,warnings:g,open:O,reload:(0,b.useCallback)(e=>D(e.repo,e.base,e.target),[D]),configure:(0,b.useCallback)((e,t)=>{s(n=>({...n,[e.repo.path]:{...n[e.repo.path],...t}})),D(e.repo,t.base??e.base,t.target??e.target)},[D]),select:(0,b.useCallback)((e,t)=>{s(n=>{let r={...n};if(c!==`custom`)for(let e of w)r[e.repo.path]={...r[e.repo.path],selected:T(e)};return r[e]={...r[e],selected:t},r}),l(`custom`)},[w,T,c]),setSelection:(0,b.useCallback)(e=>{l(e),e!==`custom`&&s(e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{base:t.base,target:t.target}])))},[])}}var lG=[{value:`changed`,label:`Changed`,hint:`Follow repositories that have changes`},{value:`all`,label:`All`,hint:`Include every repository`},{value:`none`,label:`None`,hint:`Clear the selection`}];function uG(e,t){let{local:n,remote:r}=e.repo.branches;return[{value:`Current`,items:[...t?[{value:`@working`,label:`working tree (${e.repo.branch})`}]:[],{value:`HEAD`,label:t?`HEAD (committed only)`:`HEAD`}]},{value:`Local`,items:n.map(e=>({value:e,label:e}))},{value:`Remote`,items:r.map(e=>({value:e,label:e}))}]}function dG(e){let t=(0,kA.c)(45),{entry:n,workspace:r}=e,i=`Comparison for ${n.repo.name}`,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(wj,{}),t[0]=a):a=t[0];let o=n.base,s;t[1]===n.target?s=t[2]:(s=aG(n.target),t[1]=n.target,t[2]=s);let c=`${o} → ${s}`,l=n.base,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(lj,{}),t[3]=u):u=t[3];let d;t[4]===n.target?d=t[5]:(d=aG(n.target),t[4]=n.target,t[5]=d);let f;t[6]!==n.base||t[7]!==c||t[8]!==d?(f=(0,Y.jsxs)(`span`,{title:c,children:[l,u,d]}),t[6]=n.base,t[7]=c,t[8]=d,t[9]=f):f=t[9];let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Y.jsx)(pj,{}),t[10]=p):p=t[10];let m;t[11]!==i||t[12]!==f?(m=(0,Y.jsxs)(qH,{className:`compare-chip`,"aria-label":i,children:[a,f,p]}),t[11]=i,t[12]=f,t[13]=m):m=t[13];let h;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Y.jsx)(iU,{children:`Compare`}),t[14]=h):h=t[14];let g=n.repo.worktree?` · worktree`:``,_;t[15]!==n.repo.name||t[16]!==g?(_=(0,Y.jsxs)(aU,{className:`muted`,children:[n.repo.name,g]}),t[15]=n.repo.name,t[16]=g,t[17]=_):_=t[17];let v=n.base,y;t[18]===n?y=t[19]:(y=uG(n,!1),t[18]=n,t[19]=y);let b;t[20]!==n||t[21]!==r?(b=e=>r.configure(n,{base:e}),t[20]=n,t[21]=r,t[22]=b):b=t[22];let x;t[23]!==n.base||t[24]!==y||t[25]!==b?(x=(0,Y.jsx)(GW,{label:`Base`,value:v,groups:y,onChange:b}),t[23]=n.base,t[24]=y,t[25]=b,t[26]=x):x=t[26];let S;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Y.jsx)(`div`,{className:`compare-connector`,children:(0,Y.jsx)(lj,{})}),t[27]=S):S=t[27];let C=n.target,w;t[28]===n?w=t[29]:(w=uG(n,!0),t[28]=n,t[29]=w);let T;t[30]!==n||t[31]!==r?(T=e=>r.configure(n,{target:e}),t[30]=n,t[31]=r,t[32]=T):T=t[32];let E;t[33]!==n.target||t[34]!==w||t[35]!==T?(E=(0,Y.jsx)(GW,{label:`Compare`,value:C,groups:w,onChange:T}),t[33]=n.target,t[34]=w,t[35]=T,t[36]=E):E=t[36];let D;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Y.jsx)(`p`,{className:`popup-note`,children:`Changes since the common ancestor. Uncommitted edits are included only for the working tree.`}),t[37]=D):D=t[37];let O;t[38]!==_||t[39]!==x||t[40]!==E?(O=(0,Y.jsx)(XH,{children:(0,Y.jsx)($H,{side:`right`,align:`start`,sideOffset:10,className:`floating`,children:(0,Y.jsxs)(rU,{className:`popup comparison-popup`,children:[h,_,x,S,E,D]})})}),t[38]=_,t[39]=x,t[40]=E,t[41]=O):O=t[41];let k;return t[42]!==m||t[43]!==O?(k=(0,Y.jsxs)(WH,{children:[m,O]}),t[42]=m,t[43]=O,t[44]=k):k=t[44],k}function fG(e){let t=(0,kA.c)(34),{entry:n,workspace:r}=e,i=n.repo,a;t[0]!==n||t[1]!==r?(a=r.included(n),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=a,s=`selector-row ${o?`is-selected`:``}`,c=`Include ${i.name}`,l;t[3]!==i.path||t[4]!==r?(l=e=>r.select(i.path,e),t[3]=i.path,t[4]=r,t[5]=l):l=t[5];let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(IH,{children:(0,Y.jsx)(gj,{weight:`bold`})}),t[6]=u):u=t[6];let d;t[7]!==o||t[8]!==c||t[9]!==l?(d=(0,Y.jsx)(FH,{className:`checkbox`,"aria-label":c,checked:o,onCheckedChange:l,children:u}),t[7]=o,t[8]=c,t[9]=l,t[10]=d):d=t[10];let f;t[11]===i.worktree?f=t[12]:(f=i.worktree&&(0,Y.jsx)(`span`,{className:`worktree-label`,children:`worktree`}),t[11]=i.worktree,t[12]=f);let p;t[13]!==i.name||t[14]!==i.path||t[15]!==f?(p=(0,Y.jsxs)(`span`,{className:`selector-name`,title:i.path,children:[i.name,f]}),t[13]=i.name,t[14]=i.path,t[15]=f,t[16]=p):p=t[16];let m=`selector-count ${n.error?`has-error`:``}`,h=n.error||`${n.data?.files.length||0} changed ${n.data?.files.length===1?`file`:`files`}`,g;t[17]!==n.data?.files||t[18]!==n.error||t[19]!==n.loading?(g=n.loading?(0,Y.jsx)(`span`,{className:`busy-dot`}):n.error?(0,Y.jsx)(Nj,{}):n.data?.files.length||`—`,t[17]=n.data?.files,t[18]=n.error,t[19]=n.loading,t[20]=g):g=t[20];let _;t[21]!==h||t[22]!==g||t[23]!==m?(_=(0,Y.jsx)(`span`,{className:m,title:h,children:g}),t[21]=h,t[22]=g,t[23]=m,t[24]=_):_=t[24];let v;t[25]!==n||t[26]!==r?(v=(0,Y.jsx)(dG,{entry:n,workspace:r}),t[25]=n,t[26]=r,t[27]=v):v=t[27];let y;return t[28]!==_||t[29]!==v||t[30]!==s||t[31]!==d||t[32]!==p?(y=(0,Y.jsxs)(`div`,{className:s,children:[d,p,_,v]}),t[28]=_,t[29]=v,t[30]=s,t[31]=d,t[32]=p,t[33]=y):y=t[33],y}function pG(e){let t=(0,kA.c)(71),{workspace:n}=e,[r,i]=(0,b.useState)(``),a,o,s,c,l,u,d,f,p,m,h,g,_,v;if(t[0]!==r||t[1]!==n){let e;t[16]===r?e=t[17]:(e=e=>e.repo.name.toLowerCase().includes(r.toLowerCase()),t[16]=r,t[17]=e),v=n.entries.filter(e),c=WH;let y,b;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Y.jsx)(Sj,{}),b=(0,Y.jsx)(`strong`,{children:`Repositories`}),t[18]=y,t[19]=b):(y=t[18],b=t[19]);let x=n.scanning?`Scanning…`:`${n.selected.length} of ${n.entries.length}`,S;t[20]===x?S=t[21]:(S=(0,Y.jsx)(`small`,{children:x}),t[20]=x,t[21]=S);let C;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Y.jsx)(pj,{}),t[22]=C):C=t[22],t[23]===S?_=t[24]:(_=(0,Y.jsxs)(qH,{className:`selector-trigger`,"aria-label":`Repositories`,children:[y,b,S,C]}),t[23]=S,t[24]=_),s=XH,o=$H,m=8,h=`start`,g=`floating`,a=rU,d=`popup selector-popup`;let w;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Y.jsx)(Ej,{}),t[25]=w):w=t[25],t[26]===r?f=t[27]:(f=(0,Y.jsxs)(`div`,{className:`search-field`,children:[w,(0,Y.jsx)(jM,{"aria-label":`Filter repositories`,placeholder:`Find a repository…`,value:r,onValueChange:i})]}),t[26]=r,t[27]=f);let T;t[28]===n.selection?T=t[29]:(T=n.selection===`custom`?[]:[n.selection],t[28]=n.selection,t[29]=T);let E;t[30]===n?E=t[31]:(E=e=>{e[0]&&n.setSelection(e[0])},t[30]=n,t[31]=E);let D;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(D=lG.map(mG),t[32]=D):D=t[32];let O;t[33]!==T||t[34]!==E?(O=(0,Y.jsx)(fl,{className:`segmented`,"aria-label":`Which repositories to review`,value:T,onValueChange:E,children:D}),t[33]=T,t[34]=E,t[35]=O):O=t[35];let k=n.selection===`custom`?`Custom · `:``,A;t[36]!==k||t[37]!==n.entries.length||t[38]!==n.selected.length?(A=(0,Y.jsxs)(`span`,{className:`selector-summary`,children:[k,n.selected.length,` of `,n.entries.length]}),t[36]=k,t[37]=n.entries.length,t[38]=n.selected.length,t[39]=A):A=t[39],t[40]!==O||t[41]!==A?(p=(0,Y.jsxs)(`div`,{className:`selector-actions`,children:[O,A]}),t[40]=O,t[41]=A,t[42]=p):p=t[42],l=`selector-list`;let j;t[43]===n?j=t[44]:(j=e=>(0,Y.jsx)(fG,{entry:e,workspace:n},e.repo.path),t[43]=n,t[44]=j),u=v.map(j),t[0]=r,t[1]=n,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_,t[15]=v}else a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15];let y;t[45]!==v.length||t[46]!==n.scanning?(y=!v.length&&(0,Y.jsx)(`p`,{className:`popup-empty`,children:n.scanning?`Discovering repositories…`:`No matching repositories.`}),t[45]=v.length,t[46]=n.scanning,t[47]=y):y=t[47];let x;t[48]!==l||t[49]!==y||t[50]!==u?(x=(0,Y.jsxs)(`div`,{className:l,children:[u,y]}),t[48]=l,t[49]=y,t[50]=u,t[51]=x):x=t[51];let S;t[52]!==a||t[53]!==x||t[54]!==d||t[55]!==f||t[56]!==p?(S=(0,Y.jsxs)(a,{className:d,children:[f,p,x]}),t[52]=a,t[53]=x,t[54]=d,t[55]=f,t[56]=p,t[57]=S):S=t[57];let C;t[58]!==o||t[59]!==S||t[60]!==m||t[61]!==h||t[62]!==g?(C=(0,Y.jsx)(o,{sideOffset:m,align:h,className:g,children:S}),t[58]=o,t[59]=S,t[60]=m,t[61]=h,t[62]=g,t[63]=C):C=t[63];let w;t[64]!==s||t[65]!==C?(w=(0,Y.jsx)(s,{children:C}),t[64]=s,t[65]=C,t[66]=w):w=t[66];let T;return t[67]!==c||t[68]!==w||t[69]!==_?(T=(0,Y.jsxs)(c,{children:[_,w]}),t[67]=c,t[68]=w,t[69]=_,t[70]=T):T=t[70],T}function mG(e){return(0,Y.jsx)(xl,{value:e.value,title:e.hint,children:e.label},e.value)}var hG=20;function gG(e){let t=(0,kA.c)(24),{entry:n,search:r,density:i,navigate:a}=e,o;t[0]===n.data?.files?o=t[1]:(o=n.data?.files||[],t[0]=n.data?.files,t[1]=o);let s=o,c;t[2]===s?c=t[3]:(c=s.map(yG),t[2]=s,t[3]=c);let l=c,u;t[4]===s?u=t[5]:(u=s.map(vG),t[4]=s,t[5]=u);let d;t[6]!==n.repo||t[7]!==s||t[8]!==a?(d=e=>{e[0]&&s.some(t=>t.name===e[0])&&a(n.repo.path,e[0])},t[6]=n.repo,t[7]=s,t[8]=a,t[9]=d):d=t[9];let f;t[10]!==i||t[11]!==l||t[12]!==u||t[13]!==d?(f={paths:u,gitStatus:l,initialExpansion:`open`,flattenEmptyDirectories:!0,density:i,onSelectionChange:d},t[10]=i,t[11]=l,t[12]=u,t[13]=d,t[14]=f):f=t[14];let{model:p}=CH(f),m,h;t[15]!==p||t[16]!==r?(m=()=>{p.setSearch(r||null)},h=[p,r],t[15]=p,t[16]=r,t[17]=m,t[18]=h):(m=t[17],h=t[18]),(0,b.useEffect)(m,h);let g=TH(p,_G),_=cP[i].itemHeight,v=Math.min(hG,g)*_,y;t[19]===v?y=t[20]:(y={height:v},t[19]=v,t[20]=y);let x;return t[21]!==p||t[22]!==y?(x=(0,Y.jsx)(KM,{model:p,className:`file-tree`,style:y}),t[21]=p,t[22]=y,t[23]=x):x=t[23],x}function _G(e){return e.getVisibleCount()}function vG(e){return e.name}function yG(e){return{path:e.name,status:e.type===`new`?`added`:e.type===`deleted`?`deleted`:e.type.startsWith(`rename`)?`renamed`:`modified`}}function bG(e){let t=(0,kA.c)(24),{entry:n,search:r,density:i,workspace:a,navigate:o}=e,[s,c]=(0,b.useState)(!0),l;t[0]===n.data?.files?l=t[1]:(l=n.data?.files||[],t[0]=n.data?.files,t[1]=l);let u;t[2]===l?u=t[3]:(u=oG(l),t[2]=l,t[3]=u);let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(mj,{className:`disclosure`}),t[4]=f):f=t[4];let p;t[5]===n.repo.name?p=t[6]:(p=(0,Y.jsx)(`span`,{children:n.repo.name}),t[5]=n.repo.name,t[6]=p);let m;t[7]!==n.loading||t[8]!==d?(m=n.loading?(0,Y.jsx)(`span`,{className:`busy-dot`}):(0,Y.jsxs)(`span`,{className:`diff-stat`,children:[(0,Y.jsx)(`span`,{className:`added`,children:d.added?`+${d.added}`:``}),(0,Y.jsx)(`span`,{className:`removed`,children:d.removed?`−${d.removed}`:``})]}),t[7]=n.loading,t[8]=d,t[9]=m):m=t[9];let h;t[10]!==n.repo.path||t[11]!==p||t[12]!==m?(h=(0,Y.jsxs)(Jj,{className:`sidebar-repo-heading`,title:n.repo.path,children:[f,p,m]}),t[10]=n.repo.path,t[11]=p,t[12]=m,t[13]=h):h=t[13];let g;t[14]!==i||t[15]!==n||t[16]!==o||t[17]!==r||t[18]!==a?(g=(0,Y.jsx)(iM,{className:`sidebar-repo-panel`,children:n.error?(0,Y.jsxs)(`p`,{className:`sidebar-error`,children:[(0,Y.jsx)(Nj,{}),n.error,(0,Y.jsx)(bu,{className:`text-button`,onClick:()=>void a.reload(n),children:`Retry`})]}):n.loading&&!n.data?(0,Y.jsxs)(`div`,{className:`tree-skeleton`,"aria-label":`Loading changed files`,children:[(0,Y.jsx)(`i`,{}),(0,Y.jsx)(`i`,{}),(0,Y.jsx)(`i`,{})]}):n.data?.files.length?(0,Y.jsx)(gG,{entry:n,search:r,density:i,navigate:o},n.data.version):(0,Y.jsx)(`p`,{className:`repo-note`,children:`No changes in this comparison.`})}),t[14]=i,t[15]=n,t[16]=o,t[17]=r,t[18]=a,t[19]=g):g=t[19];let _;return t[20]!==s||t[21]!==h||t[22]!==g?(_=(0,Y.jsxs)(Kj,{className:`sidebar-repo`,open:s,onOpenChange:c,children:[h,g]}),t[20]=s,t[21]=h,t[22]=g,t[23]=_):_=t[23],_}function xG(e){let t=(0,kA.c)(47),{workspace:n,density:r,navigate:i}=e,[a,o]=(0,b.useState)(``),s;t[0]===n.entries?s=t[1]:(s=n.entries.some(SG),t[0]=n.entries,t[1]=s);let c=s,l,u,d,f,p,m,h,g;if(t[2]!==r||t[3]!==i||t[4]!==c||t[5]!==a||t[6]!==n){let e=a.trim().toLowerCase();g=n.selected.flatMap(t=>!e||t.repo.name.toLowerCase().includes(e)?[{entry:t,search:``}]:t.data?.files.some(t=>t.name.toLowerCase().includes(e))?[{entry:t,search:a}]:[]),f=`sidebar`,p=`Workspace navigation`;let s;t[15]===n?s=t[16]:(s=(0,Y.jsx)(pG,{workspace:n}),t[15]=n,t[16]=s);let _=n.scanning||c,v;t[17]===n?v=t[18]:(v=()=>void n.open(n.root,!0),t[17]=n,t[18]=v);let y=c||n.scanning?`spinning`:``,b;t[19]===y?b=t[20]:(b=(0,Y.jsx)(uj,{className:y}),t[19]=y,t[20]=b);let x;t[21]!==_||t[22]!==v||t[23]!==b?(x=(0,Y.jsx)(WW,{label:`Rescan and reload changes`,disabled:_,onClick:v,children:b}),t[21]=_,t[22]=v,t[23]=b,t[24]=x):x=t[24],t[25]!==x||t[26]!==s?(m=(0,Y.jsxs)(`div`,{className:`sidebar-top`,children:[s,x]}),t[25]=x,t[26]=s,t[27]=m):m=t[27];let S;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Y.jsx)(Ej,{}),t[28]=S):S=t[28],t[29]===a?h=t[30]:(h=(0,Y.jsxs)(`div`,{className:`sidebar-search search-field`,children:[S,(0,Y.jsx)(jM,{"aria-label":`Filter changed files`,placeholder:`Find a file…`,value:a,onValueChange:o})]}),t[29]=a,t[30]=h),l=`repository-list`,u=`Changed files`,d=n.scanning&&!n.entries.length?(0,Y.jsxs)(`div`,{className:`tree-skeleton`,role:`status`,children:[(0,Y.jsx)(`i`,{}),(0,Y.jsx)(`i`,{}),(0,Y.jsx)(`i`,{}),(0,Y.jsx)(`span`,{children:`Discovering repositories…`})]}):g.map(e=>{let{entry:t,search:a}=e;return(0,Y.jsx)(bG,{entry:t,search:a,density:r,workspace:n,navigate:i},t.repo.path)}),t[2]=r,t[3]=i,t[4]=c,t[5]=a,t[6]=n,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h,t[14]=g}else l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14];let _;t[31]!==a||t[32]!==g||t[33]!==n.scanning||t[34]!==n.selected.length?(_=!n.scanning&&!g.length&&(0,Y.jsx)(`p`,{className:`repo-note`,children:a?`No matching files.`:n.selected.length?`No changes in the current comparisons.`:`Choose repositories to review.`}),t[31]=a,t[32]=g,t[33]=n.scanning,t[34]=n.selected.length,t[35]=_):_=t[35];let v;t[36]!==l||t[37]!==u||t[38]!==d||t[39]!==_?(v=(0,Y.jsxs)(`nav`,{className:l,"aria-label":u,children:[d,_]}),t[36]=l,t[37]=u,t[38]=d,t[39]=_,t[40]=v):v=t[40];let y;return t[41]!==v||t[42]!==f||t[43]!==p||t[44]!==m||t[45]!==h?(y=(0,Y.jsxs)(`aside`,{className:f,"aria-label":p,children:[m,h,v]}),t[41]=v,t[42]=f,t[43]=p,t[44]=m,t[45]=h,t[46]=y):y=t[46],y}function SG(e){return e.loading}function CG({entry:e,file:t,settings:n,collapsed:r,onCollapse:i}){let[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(!1),l=(0,b.useRef)(null),u=(0,b.useRef)(null),d=oG([t]),f=(0,b.useCallback)(async t=>{o(``),c(!0);try{return await tG(`file`,{repo:e.repo.path,name:t.name,oldName:t.prevName||t.name,oldRef:e.data.mergeBase,newRef:e.data.targetRef,expectedHash:t.newObjectId||``})}catch(e){throw o(e instanceof Error?e.message:`Could not expand context.`),e}finally{c(!1)}},[e.repo.path,e.data]);return(0,Y.jsxs)(`div`,{className:`diff-file`,id:iG(e.repo.path,t.name),children:[(0,Y.jsxs)(`button`,{className:`file-heading`,"aria-expanded":!r,onClick:()=>i(!r),children:[(0,Y.jsx)(mj,{className:`disclosure`}),(0,Y.jsx)(bj,{}),(0,Y.jsxs)(`span`,{className:`file-path`,children:[t.prevName&&(0,Y.jsxs)(`span`,{className:`muted`,children:[t.prevName,` → `]}),t.name]}),(0,Y.jsx)(`span`,{className:`file-status`,children:t.type===`new`?`Added`:t.type===`deleted`?`Deleted`:t.type.startsWith(`rename`)?`Renamed`:``}),(0,Y.jsxs)(`span`,{className:`diff-stat`,children:[(0,Y.jsx)(`span`,{className:`added`,children:d.added?`+${d.added}`:``}),(0,Y.jsx)(`span`,{className:`removed`,children:d.removed?`−${d.removed}`:``})]})]}),(0,Y.jsx)(`div`,{className:`file-panel`,"data-collapsed":r||void 0,ref:u,onMouseDownCapture:e=>{let t=e.nativeEvent.composedPath()[0];l.current=t instanceof Element?t:u.current},children:t.hunks.length?(0,Y.jsx)(DA,{fileDiff:t,options:{theme:{light:`pierre-light`,dark:`pierre-dark`},themeType:n.theme,diffStyle:n.layout,overflow:n.wrap?`wrap`:`scroll`,lineDiffType:n.wordDiff,expansionLineCount:n.expansionLines,disableFileHeader:!0,hunkSeparators:`line-info`,collapsed:r,loadDiffFiles:f}}):!r&&(0,Y.jsx)(`p`,{className:`file-note`,children:t.type===`rename-pure`?`File renamed without content changes.`:`No text hunks. Binary content, an empty file, or a file mode change.`})}),(0,Y.jsx)(WH,{open:!!a||s,onOpenChange:e=>!e&&o(``),children:(0,Y.jsx)(XH,{children:(0,Y.jsx)($H,{anchor:()=>l.current||u.current,side:`top`,align:`center`,sideOffset:6,className:`floating`,children:(0,Y.jsx)(rU,{className:`popup context-status`,role:a?`alert`:`status`,children:a?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Nj,{}),(0,Y.jsx)(`span`,{children:a}),(0,Y.jsx)(oU,{className:`text-button`,children:`Dismiss`})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`busy-dot`}),(0,Y.jsx)(`span`,{children:`Loading the full file…`})]})})})})})]})}var wG=b.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,...o}=e,[s,c]=b.useState(void 0),l=hM(!0)?.disabled||a,u=Di(`fieldset`,e,{ref:t,state:{disabled:l},props:[{"aria-labelledby":s,disabled:l},o]}),d=b.useMemo(()=>({legendId:s,setLegendId:c,disabled:l}),[s,c,l]);return(0,Y.jsx)(mM.Provider,{value:d,children:u})}),TG=b.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{disabled:s,setLegendId:c}=hM(),l=wM(a,c);return Di(`div`,e,{state:{disabled:s},ref:t,props:[{id:l},o]})}),EG=new Map;function DG(e,t){let n=JSON.stringify({locale:VU(e),options:t}),r=EG.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return EG.set(n,i),i}function OG(e,t,n){return e==null?``:DG(t,n).format(e)}var kG=b.createContext(void 0);function AG(){let e=b.useContext(kG);if(e===void 0)throw Error(F(43));return e}var jG={inputValue:()=>null,value:()=>null,...uM},MG=`零〇一二三四五六七八九`,NG=/[٠-٩۰-۹0-9]/g,PG=/[零〇一二三四五六七八九]/g,FG=[`%`,`٪`,`%`,`﹪`],IG=[`‰`,`؉`],LG=/[%٪%﹪]/,RG=/[‰؉]/,zG=/[%٪%﹪]/g,BG=/[‰؉]/g,VG=/[٠-٩۰-۹]/,HG=/[零〇一二三四五六七八九]/,UG=/[0-9٠-٩۰-۹0-9零〇一二三四五六七八九]/;function WG(e){return UG.test(e)}var GG=[`.`,`,`,`.`,`,`,`٫`,`٬`],KG=/\p{Zs}/u,qG=/\p{Cf}/u,JG=/\p{Cf}/gu,YG=[`+`,`+`,`﹢`],XG=[`-`,`−`,`-`,`‒`,`–`,`—`,`﹣`],ZG=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function QG(e,t){let[n,r=`0`]=String(e).split(`e`);return Number(`${n}e${Number(r)+t}`)}var $G=/[-−-‒–—﹣]/gu,eK=/[++﹢]/gu,tK=/[-−-‒–—﹣]/,nK=/[++﹢]/,rK=11111.1;function iK(e,t){return DG(e,t).formatToParts(rK)}function aK(e,t){let n=iK(e,t),r={};n.forEach(e=>{r[e.type]=e.value});let i=`.`;return DG(e).formatToParts(.1).forEach(e=>{e.type===`decimal`&&(i=e.value)}),{...r,decimal:i}}function oK(e,t,n){let r=e.replace(JG,``).trim();r=r.replace($G,`-`).replace(eK,`+`);let i=!1,a=(e,t)=>(t===`-`&&(i=!0),``);r=r.replace(/([+-])\s*$/,a).replace(/^\s*([+-])/,a);let o=t;o===void 0&&(VG.test(r)?o=`ar`:HG.test(r)&&(o=`zh`));let{group:s,decimal:c,currency:l,exponentSeparator:u}=aK(o,n),d=DG(o,n).formatToParts(1).filter(e=>e.type===`unit`).map(e=>ZG(e.value)),f=d.length?new RegExp(d.join(`|`),`g`):null,p=null;s&&(p=/\p{Zs}/u.test(s)?/\p{Zs}/gu:s===`'`||s===`’`?/['’]/g:new RegExp(ZG(s),`g`));let m=[[p,``],[new RegExp(ZG(c),`g`),`.`],[/[.٫]/g,`.`],[/[,٬]/g,``],[l?new RegExp(ZG(l),`g`):null,``],[f,``],[zG,``],[BG,``],[u?new RegExp(ZG(u),`g`):null,`e`],[NG,e=>String(e.charCodeAt(0)%16)],[PG,e=>String(Math.max(MG.indexOf(e)-1,0))]].reduce((e,[t,n])=>t?e.replace(t,n):e,r),h=m.lastIndexOf(`.`);if(h!==-1&&(m=`${m.slice(0,h).replace(/\./g,``)}.${m.slice(h+1).replace(/\./g,``)}`),/^[-+]?Infinity$/i.test(r)||r.includes(`∞`))return null;let g=(i?`-`:``)+m,_=parseFloat(g),v=n?.style,y=v===`unit`&&n?.unit===`percent`,b=LG.test(e)||v===`percent`;return RG.test(e)?_=QG(_,-3):!y&&b&&(_=QG(_,-2)),Number.isFinite(_)?_:null}function sK(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var cK=1e-10,lK=1e-10;function uK(e){return e?.maximumFractionDigits!=null||e?.minimumFractionDigits!=null||e?.maximumSignificantDigits!=null||e?.minimumSignificantDigits!=null||e?.roundingIncrement!=null||e?.roundingMode!=null||e?.roundingPriority!=null}function dK(e,t){if(!Number.isFinite(e))return e;if(!uK(t)){let t=parseFloat(e.toPrecision(15));return Math.abs(t-e)<=Math.min(2**-52*Math.max(1,Math.abs(e)),lK)?t:e}let n=DG(`en-US`,{...t,signDisplay:`auto`,currencySign:`standard`,notation:t.notation===`compact`?`standard`:t.notation,useGrouping:!1}),r=n.format(e),i=oK(r,`en-US`,t);return i===null?e:n.format(i)===r?i:e}function fK(e,t,n,r){let i=Math.abs(n),a=Math.sign(n),o=i*cK*a,s=e-t+o;return r?t+Math.round(s/n)*n:t+(a>0?Math.floor(s/i):Math.ceil(s/i))*i}function pK(e,t,n,r,i,a,o,s,c){if(e===null)return e;let l=e;if(t!=null&&o&&t!==0&&(l=fK(l,s||n===-(2**53-1)?i:n,t,s)),c&&(l=sK(l,n,r)),t==null&&!uK(a))return l;let u=dK(l,a);return c?sK(u,n,r):u}var mK=b.forwardRef(function(e,t){let{id:n,min:r,max:i,smallStep:a=.1,step:o=1,largeStep:s=10,required:c=!1,disabled:l=!1,readOnly:u=!1,form:d,name:f,defaultValue:p=null,value:m,onValueChange:h,onValueCommitted:g,allowWheelScrub:_=!1,snapOnStep:v=!1,allowOutOfRange:y=!1,format:x,locale:S,render:C,className:w,inputRef:T,style:E,...D}=e,{setDirty:O,validityData:k,disabled:A,setFilled:j,name:M,state:P,validation:F}=pM(),{clearErrors:I}=_M(),L=A||l,R=M??f,z=o===`any`?1:o,[B,V]=b.useState(!1),H=r??-(2**53-1),U=i??2**53-1,ee=r??0,te=x?.style,ne=b.useRef(null),W=ln(T,F.inputRef),ie=CM({id:n}),[ae,G]=jc({controlled:m,default:p,name:`NumberField`,state:`value`}),oe=hn(ae);N(()=>{j(ae!==null)},[j,ae]);let se=Po(),ce=hn(x),le=b.useRef(!1),ue=X((e,t)=>{le.current=!1,g?.(e,t)}),de=b.useRef(!0),fe=b.useRef(null),[pe,me]=b.useState(()=>OG(ae,S,x)),[he,ge]=b.useState(`numeric`),_e=X(()=>{let e=iK(S,x),t=new Set(GG),n=e=>e.forEach(e=>t.add(e)),r=e.find(e=>e.type===`decimal`)?.value??aK(S,x).decimal;t.add(r),e.forEach(e=>{e.type!==`integer`&&e.type!==`fraction`&&e.type!==`exponentInteger`&&e.type!==`compact`&&(n(Array.from(e.value)),KG.test(e.value)&&t.add(` `))});let i=te===`percent`||te===`unit`&&x?.unit===`percent`,a=te===`percent`||te===`unit`&&x?.unit===`permille`;return i&&n(FG),a&&n(IG),n(YG),(H<0||y)&&n(XG),t}),ve=X(e=>e?.altKey?a:e?.shiftKey?s:z),ye=X((e,t)=>{let n=t.event,r=t.direction,i=t.reason.startsWith(`input-`)||t.reason===`none`,a=!y||!i,o=pK(e,r?ve(n)*r:void 0,H,U,ee,ce.current,v,n?.altKey??!1,a),s=o!==ae||i&&(e!==ae||de.current===!1);if(s){if(h?.(o,t),t.isCanceled)return!1;G(o),O(o!==k.initialValue),le.current=!0}return fe.current=o,de.current&&me(OG(o,S,x)),se(),s}),be=X((e,{direction:t,currentValue:n,event:r,reason:i})=>{let a=n??oe.current,o=r;return typeof a==`number`?ye(a+e*t,J(i,o,void 0,{direction:t})):ye(0,J(i,o))});N(function(){if(!de.current)return;let e=OG(ae,S,x);e!==pe&&me(e)}),N(function(){if(!re)return;let e=`text`;H>=0&&(e=`decimal`),ge(e)},[H]);let xe=X(()=>{let e=ne.current;if(!e)return;let t=e.value.length;e.setSelectionRange(t,t),e.focus()});b.useEffect(function(){let e=ne.current;if(L||u||!_||!e)return;function t(e){if(e.ctrlKey||He(En(ne.current))!==ne.current)return;let t=Math.abs(e.deltaX)>Math.abs(e.deltaY),n=e.shiftKey&&t?e.deltaX:e.deltaY;if(n===0||!e.shiftKey&&t)return;e.preventDefault(),de.current=!0;let r=ve(e);be(r,{direction:n>0?-1:1,event:e,reason:`wheel`})&&ue(fe.current,en(qt,e))}return sn(e,`wheel`,t)},[_,be,L,u,ve,ue,fe,oe]);let Se=b.useMemo(()=>({...P,disabled:L,readOnly:u,required:c,value:ae,inputValue:pe,scrubbing:B}),[P,L,u,c,ae,pe,B]),Ce=b.useMemo(()=>({inputRef:ne,focusInput:xe,minWithDefault:H,maxWithDefault:U,id:ie,setValue:ye,incrementValue:be,getStepAmount:ve,allowInputSyncRef:de,formatOptionsRef:ce,valueRef:oe,lastChangedValueRef:fe,hasPendingCommitRef:le,name:R,nameProp:f,inputMode:he,getAllowedNonNumericKeys:_e,min:r,max:i,setInputValue:me,locale:S,setIsScrubbing:V,state:Se,onValueCommitted:ue}),[ne,xe,H,U,ie,ye,be,ve,ce,oe,R,f,he,_e,r,i,me,S,Se,ue]),we=Di(`div`,e,{ref:t,state:Se,props:D,stateAttributesMapping:jG});return(0,Y.jsxs)(kG.Provider,{value:Ce,children:[we,(0,Y.jsx)(`input`,{...F.getValidationProps(L,{onFocus(){xe()},onChange(e){if(e.nativeEvent.defaultPrevented||L||u)return;let t=e.currentTarget.valueAsNumber,n=Number.isNaN(t)?null:t,r=J(Ot,e.nativeEvent);ye(n,r),I(R),F.change(fe.current??n)}}),ref:W,type:`number`,form:d,name:R,value:ae??``,min:r,max:i,step:o,disabled:L,readOnly:u,required:c,"aria-hidden":!0,tabIndex:-1,style:R?kn:On,suppressHydrationWarning:!0})]})}),hK=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=AG();return Di(`div`,e,{ref:t,state:o,props:[{role:`group`},a],stateAttributesMapping:jG})}),gK=0,_K=class e extends B{static create(){return new e}start(e,t){this.clear(),this.currentId=setInterval(()=>{t()},e)}clear=()=>{this.currentId!==gK&&(clearInterval(this.currentId),this.currentId=gK)}};function vK(){let e=S(_K.create).current;return R(e.disposeEffect),e}var yK=60,bK=400,xK=8,SK=50,CK=3;function wK(e){return e===`touch`||e===`pen`}function TK(e){let{disabled:t,tick:n,onStop:r,tickDelay:i=yK,startDelay:a=bK,scrollDistance:o=xK,elementRef:s}=e,c=V(),l=vK(),u=V(),d=b.useRef(!1),f=b.useRef(0),p=b.useRef({x:0,y:0}),m=b.useRef(!1),h=b.useRef(!1),g=b.useRef(``),_=b.useRef(A),v=b.useRef(A),y=X(()=>{u.clear(),c.clear(),l.clear(),_.current(),f.current=0});function x(e){y();let t=s.current;if(!t)return;let o=ye(t);function u(e){e.preventDefault()}if(_.current=sn(o,`contextmenu`,u),v.current(),v.current=sn(o,`pointerup`,e=>{d.current=!1,y(),r?.(e)},{once:!0}),!n(e)){y();return}c.start(a,()=>{l.start(i,()=>{n(e)||y()})})}return b.useEffect(()=>()=>{y(),v.current()},[y]),b.useEffect(()=>{t&&(d.current=!1,m.current=!1,g.current=``,y())},[t,y]),{pointerHandlers:{onTouchStart(){m.current=!0},onTouchEnd(){m.current=!1},onPointerDown(e){e.defaultPrevented||e.button||t||(g.current=e.pointerType,h.current=!1,d.current=!0,p.current={x:e.clientX,y:e.clientY},wK(e.pointerType)?u.start(SK,()=>{let t=f.current;f.current=0,d.current&&t<CK?(x(e.nativeEvent),h.current=!0):(h.current=!1,y())}):(e.preventDefault(),x(e.nativeEvent)))},onPointerUp(e){wK(e.pointerType)&&(d.current=!1)},onPointerMove(e){if(t||!wK(e.pointerType)||!d.current)return;f.current+=1;let{x:n,y:r}=p.current,i=n-e.clientX,a=r-e.clientY;i**2+a**2>o**2&&y()},onMouseEnter(e){e.defaultPrevented||t||!d.current||m.current||wK(g.current)||x(e.nativeEvent)},onMouseLeave(){m.current||y()},onMouseUp(){m.current||y()}},shouldSkipClick:X(e=>e.defaultPrevented?!0:wK(g.current)?h.current:e.detail!==0)}}var EK={WebkitUserSelect:`none`,userSelect:`none`};function DK(e,t,n){let{render:r,className:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{allowInputSyncRef:l,formatOptionsRef:u,getStepAmount:d,id:f,incrementValue:p,inputRef:m,focusInput:h,maxWithDefault:g,minWithDefault:_,setValue:v,state:y,valueRef:b,locale:x,lastChangedValueRef:S,onValueCommitted:C}=AG(),{disabled:w,readOnly:T,value:E,inputValue:D}=y,O=a||w||E!=null&&(n?E>=g:E<=_),k=n?Ft:It;function A(e){let t=!l.current;if(l.current=!0,!t){S.current=b.current;return}let n=oK(D,x,u.current);if(n!==null){let t=J(k,e);v(n,t),t.isCanceled||(b.current=n)}}let{pointerHandlers:j,shouldSkipClick:M}=TK({disabled:O||T,elementRef:m,tick(e){let t=d(e);return p(t,{direction:n?1:-1,event:e,reason:k})},onStop(e){let t=S.current??b.current;C(t,en(k,e))}}),N={disabled:O,"aria-label":n?`Increase`:`Decrease`,"aria-controls":f,tabIndex:-1,style:EK,...j,onClick(e){let t=O||T;if(e.defaultPrevented||t||M(e))return;A(e.nativeEvent);let r=d(e),i=b.current;p(r,{direction:n?1:-1,event:e.nativeEvent,reason:k});let a=S.current??b.current;a!==i&&C(a,en(k,e.nativeEvent))},onPointerDown(e){e.defaultPrevented||T||e.button||O||(A(e.nativeEvent),S.current=null,wK(e.pointerType)||h(),j.onPointerDown(e))}},{getButtonProps:P,buttonRef:F}=hl({disabled:O||T,native:o,focusableWhenDisabled:!0}),I={...y,disabled:O};return Di(`button`,e,{ref:[t,F],state:I,props:[N,c,P],stateAttributesMapping:jG})}var OK=b.forwardRef(function(e,t){return DK(e,t,!0)}),kK=b.forwardRef(function(e,t){return DK(e,t,!1)}),AK=new Set([`Backspace`,`Delete`,`ArrowLeft`,`ArrowRight`,`Tab`,`Enter`,`Escape`]),jK=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{allowInputSyncRef:o,formatOptionsRef:s,getAllowedNonNumericKeys:c,getStepAmount:l,id:u,incrementValue:d,inputMode:f,max:p,min:m,name:h,nameProp:g,setValue:_,state:v,setInputValue:y,locale:x,inputRef:S,onValueCommitted:C,lastChangedValueRef:w,hasPendingCommitRef:T,valueRef:E}=AG(),{disabled:D,readOnly:O,required:k,value:A,inputValue:j}=v,{clearErrors:M}=_M(),{validationMode:P,setTouched:F,setFocused:I,invalid:L,shouldValidateOnChange:R,validation:z}=pM(),{labelId:B}=yM(),V=b.useRef(!1),H=b.useRef(null);return kM(S,u,A,void 0,!D,g),N(()=>{if(H.current!=null){let e=H.current;H.current=null,S.current?.setSelectionRange(e,e)}}),tu(A,()=>{if(M(h),V.current&&!R()){V.current=!1;return}z.change(A)}),Di(`input`,e,{ref:[t,S],state:v,props:[{id:u,required:k,disabled:D,readOnly:O,inputMode:f,value:j,type:`text`,autoComplete:`off`,autoCorrect:`off`,spellCheck:`false`,"aria-roledescription":`Number field`,"aria-invalid":!D&&L?!0:void 0,"aria-labelledby":B,suppressHydrationWarning:!0,onFocus(e){e.defaultPrevented||D||I(!0)},onBlur(e){if(e.defaultPrevented||D||(F(!0),I(!1),O))return;let t=!o.current,n=T.current;if(o.current=!0,j.trim()===``){let r=J(Rt,e.nativeEvent);if(_(null,r),r.isCanceled)return;P===`onBlur`&&z.commit(null),(t||n||A!==null)&&C(null,en(Rt,e.nativeEvent));return}let r=s.current,i=oK(j,x,r);if(i===null)return;let a=uK(r),c;c=!t&&!a?A:a?dK(i,r):i;let l=en(zt,e.nativeEvent),u=A!==c,d=t||u||n,f=c;if(u){let t=J(zt,e.nativeEvent);if(V.current=!0,_(c,t),t.isCanceled){V.current=!1;return}f=w.current,f===A&&(V.current=!1)}P===`onBlur`&&z.commit(f),d&&C(f,l);let p=OG(f,x,r);j!==p&&y(p)},onChange(e){if(e.nativeEvent.defaultPrevented)return;o.current=!1;let t=e.currentTarget.value;if(t.trim()===``){y(t),_(null,J(Rt,e.nativeEvent));return}let n=c();if(!Array.from(t).every(e=>WG(e)||tK.test(e)||n.has(e)||qG.test(e)))return;let r=oK(t,x,s.current);y(t),r!==null&&_(r,J(Lt,e.nativeEvent))},onKeyDown(e){if(e.defaultPrevented||O||D)return;let t=e.nativeEvent,n=!o.current,r=c(),i=r.has(e.key),{decimal:a,currency:u,percentSign:f}=aK(x,s.current),h=e.currentTarget.selectionStart,g=e.currentTarget.selectionEnd,v=h===0&&g===j.length,y=e=>h!=null&&g!=null&&e>=h&&e<g;[[tK,$G],[nK,eK]].forEach(([t,n])=>{if(t.test(e.key)&&Array.from(r).some(e=>t.test(e))){let e=j.search(n),t=e!==-1&&y(e);i=!(tK.test(j)||nK.test(j))||v||t}}),[a,u,f].forEach(t=>{if(e.key===t){let e=j.indexOf(t),n=y(e);i=e===-1||v||n}});let b=AK.has(e.key),S=e.key===`ArrowUp`||e.key===`ArrowDown`;if(e.which===229||e.altKey&&!S||e.ctrlKey||e.metaKey||i||WG(e.key)||b)return;let T=null;if(e.key===`Home`&&m!=null?T=m:e.key===`End`&&p!=null&&(T=p),e.key.length>1&&!S&&T===null)return;let k=n?oK(j,x,s.current):null,A=l(e);e.preventDefault(),e.stopPropagation();let M=en(Gt,t),N=!1;(S||T!==null)&&(o.current=!0),S?(n||(w.current=E.current),N=d(A,{direction:e.key===`ArrowUp`?1:-1,currentValue:k,event:t,reason:Gt})):T!==null&&(N=_(T,J(Gt,t))),N&&C(w.current,M)},onPaste(e){if(e.defaultPrevented||O||D)return;let t=``;try{t=e.clipboardData?.getData(`text/plain`)??``}catch{return}e.preventDefault();let n=e.currentTarget,r=n.selectionStart,i=n.selectionEnd,a=j.slice(0,r)+t+j.slice(i),c=oK(a,x,s.current);c!==null&&(o.current=!1,H.current=r+t.length,_(c,J(Bt,e.nativeEvent)),y(a))}},a,e=>z.getValidationProps(D,e)],stateAttributesMapping:jG})}),MK=b.createContext(void 0);function NK(){let e=b.useContext(MK);if(e===void 0)throw Error(F(63));return e}var PK=`data-checked`,FK=`data-unchecked`,IK={...uM,checked(e){return e?{[PK]:``}:{[FK]:``}}},LK=b.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,value:_,style:v,...y}=e,{clearErrors:x}=_M(),{state:S,setTouched:C,setDirty:w,validityData:T,setFilled:E,setFocused:D,validationMode:O,disabled:k,name:A,validation:j}=pM(),{labelId:P}=yM(),F=k||m,I=A??l,L=b.useRef(null),R=ln(L,c,j.inputRef),z=b.useRef(null),B=Js(),V=CM({id:s}),H=u?void 0:V,[U,ee]=jc({controlled:n,default:!!i,name:`Switch`,state:`checked`});kM(z,B,U,void 0,!F,l),N(()=>{E(U)},[U,E]),tu(U,()=>{x(I),w(U!==T.initialValue),j.change(U)});let{getButtonProps:te,buttonRef:ne}=hl({disabled:F,native:u}),W=bM(a,P,L,!u,H),re={id:u?V:B,role:`switch`,"aria-checked":U,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":W,onFocus(){F||D(!0)},onBlur(){let e=L.current;e&&!F&&(C(!0),D(!1),O===`onBlur`&&j.commit(e.checked))},onClick(e){if(f||F)return;e.preventDefault();let t=L.current;t&&ml(t,e)}},ie={...j.getValidationProps(F),checked:U,disabled:F,form:o,id:H,name:I,required:p,style:I?kn:On,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:R,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=J(Ot,e.nativeEvent);d?.(t,n),!n.isCanceled&&ee(t)},onClick(e){e.stopPropagation()},onFocus(){z.current?.focus()},..._===void 0?M:{value:_}},ae=b.useMemo(()=>({...S,checked:U,disabled:F,readOnly:f,required:p}),[S,U,F,f,p]),G=Di(`span`,e,{state:ae,ref:[t,z,ne],props:[re,y,te,e=>j.getValidationProps(F,e)],stateAttributesMapping:IK});return(0,Y.jsxs)(MK.Provider,{value:ae,children:[G,!U&&I&&g!==void 0&&(0,Y.jsx)(`input`,{type:`hidden`,form:o,name:I,value:g,disabled:F}),(0,Y.jsx)(`input`,{...ie,suppressHydrationWarning:!0})]})}),RK=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return Di(`span`,e,{state:NK(),ref:t,stateAttributesMapping:IK,props:a})});function zK(e){let t=(0,kA.c)(8),{label:n,hint:r,children:i}=e,a;t[0]===r?a=t[1]:(a=r&&(0,Y.jsx)(`small`,{children:r}),t[0]=r,t[1]=a);let o;t[2]!==n||t[3]!==a?(o=(0,Y.jsxs)(`span`,{className:`setting-text`,children:[n,a]}),t[2]=n,t[3]=a,t[4]=o):o=t[4];let s;return t[5]!==i||t[6]!==o?(s=(0,Y.jsxs)(`div`,{className:`setting`,children:[o,i]}),t[5]=i,t[6]=o,t[7]=s):s=t[7],s}function BK(e){let t=(0,kA.c)(11),{label:n,value:r,options:i,onChange:a}=e,o;t[0]===r?o=t[1]:(o=[r],t[0]=r,t[1]=o);let s;t[2]===a?s=t[3]:(s=e=>{e[0]&&a(e[0])},t[2]=a,t[3]=s);let c;t[4]===i?c=t[5]:(c=i.map(VK),t[4]=i,t[5]=c);let l;return t[6]!==n||t[7]!==o||t[8]!==s||t[9]!==c?(l=(0,Y.jsx)(fl,{className:`segmented`,"aria-label":n,value:o,onValueChange:s,children:c}),t[6]=n,t[7]=o,t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function VK(e){return(0,Y.jsx)(xl,{value:e.value,children:e.label},e.value)}function HK(e){let t=(0,kA.c)(20),{label:n,value:r,min:i,max:a,step:o,onChange:s}=e,c;t[0]===s?c=t[1]:(c=e=>e!==null&&s(e),t[0]=s,t[1]=c);let l=`Fewer ${n}`,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(Dj,{}),t[2]=u):u=t[2];let d;t[3]===l?d=t[4]:(d=(0,Y.jsx)(kK,{"aria-label":l,children:u}),t[3]=l,t[4]=d);let f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(jK,{}),t[5]=f):f=t[5];let p=`More ${n}`,m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Y.jsx)(Oj,{}),t[6]=m):m=t[6];let h;t[7]===p?h=t[8]:(h=(0,Y.jsx)(OK,{"aria-label":p,children:m}),t[7]=p,t[8]=h);let g;t[9]!==d||t[10]!==h?(g=(0,Y.jsxs)(hK,{className:`counter-group`,children:[d,f,h]}),t[9]=d,t[10]=h,t[11]=g):g=t[11];let _;return t[12]!==n||t[13]!==a||t[14]!==i||t[15]!==o||t[16]!==c||t[17]!==g||t[18]!==r?(_=(0,Y.jsx)(mK,{className:`counter`,"aria-label":n,value:r,min:i,max:a,step:o,onValueCommitted:c,children:g}),t[12]=n,t[13]=a,t[14]=i,t[15]=o,t[16]=c,t[17]=g,t[18]=r,t[19]=_):_=t[19],_}function UK(e){let t=(0,kA.c)(79),{settings:n,onChange:r}=e,i;t[0]===n.ignore?i=t[1]:(i=n.ignore.join(`, `),t[0]=n.ignore,t[1]=i);let[a,o]=(0,b.useState)(i),s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(bu,{}),t[2]=s):s=t[2];let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsx)(iu,{render:s,className:`icon-button`,"aria-label":`Settings`,children:(0,Y.jsx)(Cj,{})}),t[3]=c):c=t[3];let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Y.jsx)(wl,{className:`dialog-backdrop`}),t[4]=l):l=t[4];let u,d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsxs)(`header`,{className:`settings-header`,children:[(0,Y.jsx)(Mj,{}),(0,Y.jsx)($l,{children:`Settings`})]}),d=(0,Y.jsx)(El,{className:`muted`,children:`These apply to every tab. What each tab compares stays with the tab.`}),t[5]=u,t[6]=d):(u=t[5],d=t[6]);let f;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(TG,{className:`settings-legend`,children:`Appearance`}),t[7]=f):f=t[7];let p;t[8]===r?p=t[9]:(p=e=>r({theme:e}),t[8]=r,t[9]=p);let m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(m=[{value:`system`,label:`System`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}],t[10]=m):m=t[10];let h;t[11]!==n.theme||t[12]!==p?(h=(0,Y.jsx)(zK,{label:`Theme`,children:(0,Y.jsx)(BK,{label:`Theme`,value:n.theme,onChange:p,options:m})}),t[11]=n.theme,t[12]=p,t[13]=h):h=t[13];let g;t[14]===r?g=t[15]:(g=e=>r({layout:e}),t[14]=r,t[15]=g);let _;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=[{value:`unified`,label:`Unified`},{value:`split`,label:`Split`}],t[16]=_):_=t[16];let v;t[17]!==n.layout||t[18]!==g?(v=(0,Y.jsx)(zK,{label:`Diff layout`,children:(0,Y.jsx)(BK,{label:`Diff layout`,value:n.layout,onChange:g,options:_})}),t[17]=n.layout,t[18]=g,t[19]=v):v=t[19];let y;t[20]===r?y=t[21]:(y=e=>r({wrap:e}),t[20]=r,t[21]=y);let x;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Y.jsx)(RK,{className:`switch-thumb`}),t[22]=x):x=t[22];let S;t[23]!==n.wrap||t[24]!==y?(S=(0,Y.jsx)(zK,{label:`Wrap long lines`,children:(0,Y.jsx)(LK,{className:`switch`,checked:n.wrap,onCheckedChange:y,children:x})}),t[23]=n.wrap,t[24]=y,t[25]=S):S=t[25];let C;t[26]===r?C=t[27]:(C=e=>r({density:e}),t[26]=r,t[27]=C);let w;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(w=[{value:`compact`,label:`Compact`},{value:`default`,label:`Default`},{value:`relaxed`,label:`Relaxed`}],t[28]=w):w=t[28];let T;t[29]!==n.density||t[30]!==C?(T=(0,Y.jsx)(zK,{label:`Sidebar density`,hint:`Row height in the changed file trees`,children:(0,Y.jsx)(BK,{label:`Sidebar density`,value:n.density,onChange:C,options:w})}),t[29]=n.density,t[30]=C,t[31]=T):T=t[31];let E;t[32]!==h||t[33]!==v||t[34]!==S||t[35]!==T?(E=(0,Y.jsxs)(wG,{className:`settings-group`,children:[f,h,v,S,T]}),t[32]=h,t[33]=v,t[34]=S,t[35]=T,t[36]=E):E=t[36];let D;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Y.jsx)(TG,{className:`settings-legend`,children:`Diffs`}),t[37]=D):D=t[37];let O;t[38]===r?O=t[39]:(O=e=>r({wordDiff:e}),t[38]=r,t[39]=O);let k;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(k=[{value:`word-alt`,label:`Words`},{value:`char`,label:`Characters`},{value:`none`,label:`Off`}],t[40]=k):k=t[40];let A;t[41]!==n.wordDiff||t[42]!==O?(A=(0,Y.jsx)(zK,{label:`Highlight changes within a line`,children:(0,Y.jsx)(BK,{label:`Highlight changes within a line`,value:n.wordDiff,onChange:O,options:k})}),t[41]=n.wordDiff,t[42]=O,t[43]=A):A=t[43];let j;t[44]===r?j=t[45]:(j=e=>r({expansionLines:e}),t[44]=r,t[45]=j);let M;t[46]!==n.expansionLines||t[47]!==j?(M=(0,Y.jsx)(zK,{label:`Context lines per expansion`,hint:`How much surrounding code each expand reveals`,children:(0,Y.jsx)(HK,{label:`context lines`,value:n.expansionLines,min:5,max:200,step:5,onChange:j})}),t[46]=n.expansionLines,t[47]=j,t[48]=M):M=t[48];let N;t[49]!==A||t[50]!==M?(N=(0,Y.jsxs)(wG,{className:`settings-group`,children:[D,A,M]}),t[49]=A,t[50]=M,t[51]=N):N=t[51];let P;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Y.jsx)(TG,{className:`settings-legend`,children:`Discovery`}),t[52]=P):P=t[52];let F;t[53]===r?F=t[54]:(F=e=>r({scanDepth:e}),t[53]=r,t[54]=F);let I;t[55]!==n.scanDepth||t[56]!==F?(I=(0,Y.jsx)(zK,{label:`Search depth`,hint:`Directory levels below a workspace folder`,children:(0,Y.jsx)(HK,{label:`levels`,value:n.scanDepth,min:1,max:16,step:1,onChange:F})}),t[55]=n.scanDepth,t[56]=F,t[57]=I):I=t[57];let L;t[58]===r?L=t[59]:(L=e=>r({scanBudget:e}),t[58]=r,t[59]=L);let R;t[60]!==n.scanBudget||t[61]!==L?(R=(0,Y.jsx)(zK,{label:`Directory budget`,hint:`Stop searching after this many directories`,children:(0,Y.jsx)(HK,{label:`directories`,value:n.scanBudget,min:100,max:2e5,step:1e3,onChange:L})}),t[60]=n.scanBudget,t[61]=L,t[62]=R):R=t[62];let z;t[63]!==a||t[64]!==r?(z=()=>r({ignore:a.split(`,`).map(WK).filter(Boolean)}),t[63]=a,t[64]=r,t[65]=z):z=t[65];let B;t[66]!==a||t[67]!==z?(B=(0,Y.jsx)(zK,{label:`Skip these folders`,hint:`Added to the built-in list of dependency and cache folders`,children:(0,Y.jsx)(jM,{className:`input`,"aria-label":`Skip these folders`,placeholder:`target, Build`,value:a,onValueChange:o,onBlur:z})}),t[66]=a,t[67]=z,t[68]=B):B=t[68];let V;t[69]!==I||t[70]!==R||t[71]!==B?(V=(0,Y.jsxs)(wG,{className:`settings-group`,children:[P,I,R,B]}),t[69]=I,t[70]=R,t[71]=B,t[72]=V):V=t[72];let H;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Y.jsx)(`p`,{className:`popup-note`,children:`Discovery never walks inside a repository, so .gitignore never applies. Changes here take effect on the next rescan.`}),t[73]=H):H=t[73];let U;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Y.jsx)(`div`,{className:`settings-actions`,children:(0,Y.jsx)(Tl,{className:`primary-button`,children:`Done`})}),t[74]=U):U=t[74];let ee;return t[75]!==E||t[76]!==N||t[77]!==V?(ee=(0,Y.jsxs)(Ql,{children:[c,(0,Y.jsxs)(Pl,{children:[l,(0,Y.jsxs)(Ml,{className:`settings-dialog`,children:[u,d,E,N,V,H,U]})]})]}),t[75]=E,t[76]=N,t[77]=V,t[78]=ee):ee=t[78],ee}function WK(e){return e.trim()}var GK=/[\\/]+/;function KK(e){return e.split(GK).filter(Boolean)}function qK(e,t){let n=KK(e.root),r=n.at(-1)||e.root,i=t.some(t=>t.root!==e.root&&(KK(t.root).at(-1)||``)===r)&&n.length>1?`${n.at(-2)}/${r}`:r,a=t.filter(t=>t.root===e.root);if(a.length<2)return i;let o=a.findIndex(t=>t.id===e.id);return o>0?`${i} ${o+1}`:i}function JK(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)([]),c=(0,b.useRef)(null),l=(0,b.useRef)(Promise.resolve()),u=(0,b.useRef)(new Map),d=(0,b.useRef)(void 0),f=(0,b.useCallback)(e=>{c.current=e,t(e)},[]),p=(0,b.useCallback)(e=>{let t=l.current.then(()=>nG(`state`,e));return l.current=t.then(()=>{},()=>{}),t.then(e=>(f(e),e),e=>{throw r(e.message),e})},[f]),m=(0,b.useCallback)(async e=>{let t=await p(e),n=t.activeTab;return n&&s(e=>e.includes(n)?e:[...e,n]),t},[p]);(0,b.useEffect)(()=>{let e=!0;return tG(`state`).then(t=>{e&&(f(t),t.activeTab&&s([t.activeTab]))}).catch(t=>e&&r(t.message)),()=>{e=!1}},[f]);let h=(0,b.useCallback)(()=>{clearTimeout(d.current);let e=[...u.current];u.current.clear();for(let[t,n]of e)m({op:`tab`,id:t,...n}).catch(()=>{})},[m]);(0,b.useEffect)(()=>()=>clearTimeout(d.current),[]);let g=(0,b.useCallback)((e,t)=>{let n=u.current.get(e);u.current.set(e,{...n,...t,...n?.repos||t.repos?{repos:{...n?.repos,...t.repos}}:{}}),clearTimeout(d.current),d.current=setTimeout(h,400)},[h]),_=(0,b.useCallback)(e=>{s(t=>t.includes(e)?t:[...t,e]),t(t=>t&&{...t,activeTab:e}),p({op:`activate`,id:e}).catch(()=>{})},[p]),v=(0,b.useCallback)(e=>{t(t=>t&&{...t,settings:{...t.settings,...e}}),p({op:`settings`,settings:e}).catch(()=>{})},[p]),y=(0,b.useCallback)(async()=>{a(!0),r(``);try{let e=(c.current?.tabs||[]).find(e=>e.id===c.current?.activeTab),t=await tG(`choose-directory`,e?{path:e.root}:{});t.path&&await m({op:`open`,root:t.path})}catch(e){r(e instanceof Error?e.message:`Could not open a folder.`)}finally{a(!1)}},[m]),x=(0,b.useCallback)(e=>{s(t=>t.filter(t=>t!==e)),m({op:`close`,id:e}).catch(()=>{})},[m]),S=(0,b.useCallback)(e=>void m({op:`duplicate`,id:e}).catch(()=>{}),[m]),C=(0,b.useCallback)(()=>void m({op:`reopen`}).catch(()=>{}),[m]);return{settings:e?.settings,tabs:e?.tabs||[],recent:e?.recent||[],activeTab:e?.activeTab||null,ready:e!==null,visited:o,error:n,browsing:i,activate:_,browse:y,close:x,duplicate:S,reopen:C,saveTab:g,setSettings:v}}var YK={workerFactory:()=>new AA};function XK(e){let t=(0,kA.c)(31),{store:n,settings:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={weight:`duotone`,size:16},t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=n.tabs.map(e=>{let t=qK(e,n.tabs);return(0,Y.jsxs)($u,{children:[(0,Y.jsxs)(td,{render:(0,Y.jsx)(`span`,{className:`tab`}),children:[(0,Y.jsx)(mu,{className:`tab-label`,value:e.id,title:e.root,children:t}),(0,Y.jsx)(bu,{className:`tab-close`,"aria-label":`Close ${t}`,onClick:()=>n.close(e.id),children:(0,Y.jsx)(Pj,{})})]}),(0,Y.jsx)(Pu,{children:(0,Y.jsx)(nd,{className:`floating`,children:(0,Y.jsxs)(ju,{className:`popup menu`,children:[(0,Y.jsxs)(Au,{className:`menu-item`,onClick:()=>n.duplicate(e.id),children:[(0,Y.jsx)(yj,{}),`Duplicate tab`]}),(0,Y.jsxs)(Au,{className:`menu-item`,onClick:()=>n.close(e.id),children:[(0,Y.jsx)(Pj,{}),`Close tab`]})]})})})]},e.id)}),t[1]=n,t[2]=a);let o;t[3]===a?o=t[4]:(o=(0,Y.jsx)(vu,{className:`tab-list`,"aria-label":`Open workspaces`,children:a}),t[3]=a,t[4]=o);let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(yu,{orientation:`vertical`,className:`tab-separator`}),t[5]=s):s=t[5];let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsx)(bu,{}),t[6]=c):c=t[6];let l;t[7]===n?l=t[8]:(l=()=>void n.browse(),t[7]=n,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(kj,{}),t[9]=u):u=t[9];let d;t[10]!==n.browsing||t[11]!==l?(d=(0,Y.jsx)(ec,{render:c,className:`tab-new`,"aria-label":`Open a workspace folder`,disabled:n.browsing,onClick:l,children:u}),t[10]=n.browsing,t[11]=l,t[12]=d):d=t[12];let f;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(ic,{children:(0,Y.jsx)(Dc,{sideOffset:6,children:(0,Y.jsx)(Oc,{className:`tooltip`,children:`Open a workspace folder`})})}),t[13]=f):f=t[13];let p;t[14]===d?p=t[15]:(p=(0,Y.jsxs)(Ks,{children:[d,f]}),t[14]=d,t[15]=p);let m;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Y.jsx)(`div`,{className:`push`}),t[16]=m):m=t[16];let h;t[17]===n.error?h=t[18]:(h=n.error&&(0,Y.jsx)(`span`,{className:`tab-bar-error`,role:`alert`,children:n.error}),t[17]=n.error,t[18]=h);let g;t[19]!==n.recent||t[20]!==n.reopen?(g=!!n.recent.length&&(0,Y.jsx)(WW,{label:`Reopen ${qK(n.recent[0],n.recent)}`,onClick:n.reopen,children:(0,Y.jsx)(sj,{})}),t[19]=n.recent,t[20]=n.reopen,t[21]=g):g=t[21];let _;t[22]!==r||t[23]!==n.setSettings?(_=(0,Y.jsx)(UK,{settings:r,onChange:n.setSettings}),t[22]=r,t[23]=n.setSettings,t[24]=_):_=t[24];let v;return t[25]!==p||t[26]!==h||t[27]!==g||t[28]!==_||t[29]!==o?(v=(0,Y.jsx)(aj.Provider,{value:i,children:(0,Y.jsxs)(`div`,{className:`tab-bar`,children:[o,s,p,m,h,g,_]})}),t[25]=p,t[26]=h,t[27]=g,t[28]=_,t[29]=o,t[30]=v):v=t[30],v}function ZK(e){let t=(0,kA.c)(112),{tab:n,settings:r,setSettings:i,saveTab:a}=e,o;t[0]!==a||t[1]!==n.id?(o=e=>a(n.id,e),t[0]=a,t[1]=n.id,t[2]=o):o=t[2];let s=cG(n,o),[c,l]=(0,b.useState)(!1),u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=new Set,t[3]=u):u=t[3];let[d,f]=(0,b.useState)(u),{selected:p}=s,m,h;t[4]===p?(m=t[5],h=t[6]):(m=p.flatMap(nq),h=oG(m),t[4]=p,t[5]=m,t[6]=h);let g=h,_;t[7]!==s.entries||t[8]!==s.scanning?(_=s.scanning||s.entries.some(tq),t[7]=s.entries,t[8]=s.scanning,t[9]=_):_=t[9];let v=_,y;t[10]!==d||t[11]!==m.length||t[12]!==p?(y=m.length>0&&p.every(e=>e.data?.files.every(t=>d.has(iG(e.repo.path,t.name)))),t[10]=d,t[11]=m.length,t[12]=p,t[13]=y):y=t[13];let x=y,S;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(e,t){let n=iG(e,t);f(e=>{let t=new Set(e);return t.delete(n),t}),l(!1),requestAnimationFrame(()=>requestAnimationFrame(()=>document.getElementById(n)?.scrollIntoView({block:`start`})))},t[14]=S):S=t[14];let C=S,w;t[15]!==x||t[16]!==p?(w=function(){f(x?new Set:new Set(p.flatMap(eq)))},t[15]=x,t[16]=p,t[17]=w):w=t[17];let T=w,E;t[18]!==r.density||t[19]!==s?(E=(0,Y.jsx)(`div`,{className:`desktop-sidebar`,children:(0,Y.jsx)(xG,{workspace:s,density:r.density,navigate:C})}),t[18]=r.density,t[19]=s,t[20]=E):E=t[20];let D;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Y.jsx)(iu,{className:`icon-button mobile-only`,"aria-label":`Open sidebar`,children:(0,Y.jsx)(jj,{})}),t[21]=D):D=t[21];let O;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Y.jsx)(wl,{className:`dialog-backdrop`}),t[22]=O):O=t[22];let k;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Y.jsx)($l,{className:`sr-only`,children:`Workspace navigation`}),t[23]=k):k=t[23];let A;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Y.jsx)(Tl,{className:`icon-button mobile-close`,"aria-label":`Close sidebar`,children:(0,Y.jsx)(Pj,{})}),t[24]=A):A=t[24];let j;t[25]!==r.density||t[26]!==s?(j=(0,Y.jsxs)(Pl,{children:[O,(0,Y.jsxs)(Ml,{className:`mobile-sidebar`,children:[k,A,(0,Y.jsx)(xG,{workspace:s,density:r.density,navigate:C})]})]}),t[25]=r.density,t[26]=s,t[27]=j):j=t[27];let M;t[28]!==c||t[29]!==j?(M=(0,Y.jsxs)(Ql,{open:c,onOpenChange:l,children:[D,j]}),t[28]=c,t[29]=j,t[30]=M):M=t[30];let N,P;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Y.jsx)(Tj,{}),P=(0,Y.jsx)(`strong`,{children:`Changes`}),t[31]=N,t[32]=P):(N=t[31],P=t[32]);let F;t[33]===m.length?F=t[34]:(F=(0,Y.jsx)(`span`,{className:`count-badge`,children:m.length}),t[33]=m.length,t[34]=F);let I=p.length===1?`repository`:`repositories`,L;t[35]!==p.length||t[36]!==I?(L=(0,Y.jsxs)(`span`,{className:`toolbar-caption`,children:[p.length,` `,I]}),t[35]=p.length,t[36]=I,t[37]=L):L=t[37];let R;t[38]!==F||t[39]!==L?(R=(0,Y.jsxs)(`div`,{className:`review-title`,children:[N,P,F,L]}),t[38]=F,t[39]=L,t[40]=R):R=t[40];let z;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Y.jsx)(`div`,{className:`push`}),t[41]=z):z=t[41];let B=g.added?`+${g.added}`:``,V;t[42]===B?V=t[43]:(V=(0,Y.jsx)(`span`,{className:`added`,children:B}),t[42]=B,t[43]=V);let H=g.removed?`−${g.removed}`:``,U;t[44]===H?U=t[45]:(U=(0,Y.jsx)(`span`,{className:`removed`,children:H}),t[44]=H,t[45]=U);let ee;t[46]!==V||t[47]!==U?(ee=(0,Y.jsxs)(`span`,{className:`diff-stat toolbar-stat`,children:[V,U]}),t[46]=V,t[47]=U,t[48]=ee):ee=t[48];let te;t[49]===r.layout?te=t[50]:(te=[r.layout],t[49]=r.layout,t[50]=te);let ne;t[51]===i?ne=t[52]:(ne=e=>{(e[0]===`split`||e[0]===`unified`)&&i({layout:e[0]})},t[51]=i,t[52]=ne);let W;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Y.jsx)(xl,{value:`unified`,"aria-label":`Unified view`,title:`Unified view`,children:(0,Y.jsx)(Aj,{})}),t[53]=W):W=t[53];let re;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Y.jsx)(xl,{value:`split`,"aria-label":`Split view`,title:`Split view`,children:(0,Y.jsx)(vj,{})}),t[54]=re):re=t[54];let ie;t[55]!==te||t[56]!==ne?(ie=(0,Y.jsxs)(fl,{className:`view-toggle`,"aria-label":`Diff layout`,value:te,onValueChange:ne,children:[W,re]}),t[55]=te,t[56]=ne,t[57]=ie):ie=t[57];let ae;t[58]!==i||t[59]!==r.wrap?(ae=()=>i({wrap:!r.wrap}),t[58]=i,t[59]=r.wrap,t[60]=ae):ae=t[60];let G;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Y.jsx)(cj,{}),t[61]=G):G=t[61];let oe;t[62]!==r.wrap||t[63]!==ae?(oe=(0,Y.jsx)(WW,{label:`Wrap lines`,pressed:r.wrap,onClick:ae,children:G}),t[62]=r.wrap,t[63]=ae,t[64]=oe):oe=t[64];let se=x?`Expand all files`:`Collapse all files`,ce=!m.length,le;t[65]===x?le=t[66]:(le=x?(0,Y.jsx)(fj,{}):(0,Y.jsx)(dj,{}),t[65]=x,t[66]=le);let ue;t[67]!==T||t[68]!==se||t[69]!==ce||t[70]!==le?(ue=(0,Y.jsx)(WW,{label:se,disabled:ce,onClick:T,children:le}),t[67]=T,t[68]=se,t[69]=ce,t[70]=le,t[71]=ue):ue=t[71];let de;t[72]!==M||t[73]!==R||t[74]!==ee||t[75]!==ie||t[76]!==oe||t[77]!==ue?(de=(0,Y.jsxs)(`header`,{className:`review-toolbar`,children:[M,R,z,ee,ie,oe,ue]}),t[72]=M,t[73]=R,t[74]=ee,t[75]=ie,t[76]=oe,t[77]=ue,t[78]=de):de=t[78];let fe;t[79]===s.error?fe=t[80]:(fe=s.error&&(0,Y.jsx)(`p`,{className:`notice`,role:`alert`,children:s.error}),t[79]=s.error,t[80]=fe);let pe;t[81]===s.warnings?pe=t[82]:(pe=s.warnings.map($K),t[81]=s.warnings,t[82]=pe);let me;t[83]!==v||t[84]!==p.length||t[85]!==s.entries?(me=!p.length&&(v?(0,Y.jsx)(ZW,{lines:3,children:`Finding changes across your workspace…`}):(0,Y.jsx)($W,{icon:s.entries.length?(0,Y.jsx)(_j,{}):(0,Y.jsx)(xj,{}),title:s.entries.length?`Nothing selected`:`No repositories here`,children:s.entries.length?`Repositories without changes start deselected. Open the Repositories control to include more, or change what they compare against.`:`This folder has no Git repositories or worktrees inside it.`})),t[83]=v,t[84]=p.length,t[85]=s.entries,t[86]=me):me=t[86];let he;if(t[87]!==d||t[88]!==p||t[89]!==r||t[90]!==s){let e;t[92]!==d||t[93]!==r||t[94]!==s?(e=e=>(0,Y.jsxs)(`section`,{id:iG(e.repo.path),className:`repo-diffs`,"aria-label":`Changes in ${e.repo.name}`,children:[(0,Y.jsxs)(`div`,{className:`repo-divider`,children:[(0,Y.jsx)(`strong`,{children:e.repo.name}),(0,Y.jsxs)(`span`,{children:[e.data?.files.length||0,` `,e.data?.files.length===1?`file`:`files`]}),e.repo.worktree&&(0,Y.jsx)(`span`,{className:`worktree-label`,children:`worktree`}),(0,Y.jsxs)(`span`,{className:`divider-comparison`,children:[e.base,` → `,aG(e.target)]}),(0,Y.jsx)(`span`,{className:`divider-line`}),e.loading&&(0,Y.jsx)(`span`,{role:`status`,children:`Updating…`})]}),e.error?(0,Y.jsxs)(`p`,{role:`alert`,className:`notice`,children:[e.error,(0,Y.jsx)(bu,{className:`text-button`,onClick:()=>void s.reload(e),children:`Retry`})]}):e.loading&&!e.data?(0,Y.jsxs)(ZW,{lines:2,children:[`Loading `,e.repo.name,`…`]}):(0,Y.jsxs)(Y.Fragment,{children:[e.data?.warnings.map(QK),!e.data?.files.length&&(0,Y.jsxs)(`p`,{className:`file-note`,children:[`No changes against `,e.base,`.`]}),(0,Y.jsx)(`div`,{className:`diff-files`,"data-updating":e.loading||void 0,children:e.data?.files.map(t=>(0,Y.jsx)(CG,{entry:e,file:t,settings:r,collapsed:d.has(iG(e.repo.path,t.name)),onCollapse:n=>f(r=>{let i=new Set(r),a=iG(e.repo.path,t.name);return n?i.add(a):i.delete(a),i})},`${e.data.version}:${t.name}`))})]})]},e.repo.path),t[92]=d,t[93]=r,t[94]=s,t[95]=e):e=t[95],he=p.map(e),t[87]=d,t[88]=p,t[89]=r,t[90]=s,t[91]=he}else he=t[91];let ge;t[96]!==m.length||t[97]!==v?(ge=!!m.length&&!v&&(0,Y.jsxs)(`div`,{className:`review-end`,children:[(0,Y.jsx)(_j,{}),(0,Y.jsx)(`span`,{children:`End of changes`})]}),t[96]=m.length,t[97]=v,t[98]=ge):ge=t[98];let _e;t[99]!==fe||t[100]!==pe||t[101]!==me||t[102]!==he||t[103]!==ge?(_e=(0,Y.jsxs)(vA,{className:`review-scroll`,contentClassName:`review-content`,children:[fe,pe,me,he,ge]}),t[99]=fe,t[100]=pe,t[101]=me,t[102]=he,t[103]=ge,t[104]=_e):_e=t[104];let ve;t[105]!==v||t[106]!==de||t[107]!==_e?(ve=(0,Y.jsxs)(`main`,{className:`review-pane`,"aria-busy":v,children:[de,_e]}),t[105]=v,t[106]=de,t[107]=_e,t[108]=ve):ve=t[108];let ye;return t[109]!==ve||t[110]!==E?(ye=(0,Y.jsxs)(Y.Fragment,{children:[E,ve]}),t[109]=ve,t[110]=E,t[111]=ye):ye=t[111],ye}function QK(e){return(0,Y.jsx)(`p`,{className:`notice`,children:e},e)}function $K(e){return(0,Y.jsx)(`p`,{className:`notice`,children:e},e)}function eq(e){return e.data?.files.map(t=>iG(e.repo.path,t.name))||[]}function tq(e){return e.loading}function nq(e){return e.data?.files||[]}function rq(){let e=(0,kA.c)(27),t=JK(),n=t.settings,r=n?.theme,i,a;e[0]===r?(i=e[1],a=e[2]):(i=()=>{r&&(document.documentElement.dataset.theme=r)},a=[r],e[0]=r,e[1]=i,e[2]=a),(0,b.useEffect)(i,a);let o;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(o={weight:`duotone`,size:18},e[3]=o):o=e[3];let s;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(s={},e[4]=s):s=e[4];let c;e[5]===t?c=e[6]:(c=e=>t.activate(String(e)),e[5]=t,e[6]=c);let l;e[7]!==n||e[8]!==t?(l=n&&(0,Y.jsx)(XK,{store:t,settings:n}),e[7]=n,e[8]=t,e[9]=l):l=e[9];let u;e[10]!==n||e[11]!==t.saveTab||e[12]!==t.setSettings||e[13]!==t.tabs||e[14]!==t.visited?(u=n&&t.tabs.filter(e=>t.visited.includes(e.id)).map(e=>(0,Y.jsx)(_u,{value:e.id,keepMounted:!0,className:`workspace-view`,children:(0,Y.jsx)(ZK,{tab:e,settings:n,setSettings:t.setSettings,saveTab:t.saveTab})},e.id)),e[10]=n,e[11]=t.saveTab,e[12]=t.setSettings,e[13]=t.tabs,e[14]=t.visited,e[15]=u):u=e[15];let d;e[16]===t.ready?d=e[17]:(d=!t.ready&&(0,Y.jsx)(`div`,{className:`workspace-view`,children:(0,Y.jsx)(ZW,{lines:2,children:`Restoring your workspaces…`})}),e[16]=t.ready,e[17]=d);let f;e[18]===t?f=e[19]:(f=t.ready&&!t.tabs.length&&(0,Y.jsx)(`div`,{className:`workspace-view`,children:(0,Y.jsxs)($W,{icon:(0,Y.jsx)(xj,{}),title:`Open a workspace`,children:[`Choose a directory containing your repositories and feature worktrees. Every tab remembers its own directory, repositories, and comparison branches.`,(0,Y.jsxs)(bu,{className:`primary-button`,onClick:()=>void t.browse(),disabled:t.browsing,children:[(0,Y.jsx)(xj,{}),t.browsing?`Choosing…`:`Choose a folder`]})]})}),e[18]=t,e[19]=f);let p;return e[20]!==t.activeTab||e[21]!==c||e[22]!==l||e[23]!==u||e[24]!==d||e[25]!==f?(p=(0,Y.jsx)(aj.Provider,{value:o,children:(0,Y.jsx)(kc,{delay:350,children:(0,Y.jsx)(bT,{poolOptions:YK,highlighterOptions:s,children:(0,Y.jsxs)(lu,{className:`app-shell`,value:t.activeTab,onValueChange:c,children:[l,u,d,f]})})})}),e[20]=t.activeTab,e[21]=c,e[22]=l,e[23]=u,e[24]=d,e[25]=f,e[26]=p):p=e[26],p}(0,OA.createRoot)(document.getElementById(`root`)).render((0,Y.jsx)(b.StrictMode,{children:(0,Y.jsx)(rq,{})}));export{s as t};