@economic/agents-playground 2.1.5 → 2.1.7
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.
- package/dist/assets/{architectureDiagram-3BPJPVTR-CkaCebgh.js → architectureDiagram-3BPJPVTR-5eev2A3B.js} +1 -1
- package/dist/assets/{chunk-727SXJPM-BgMxYIBg.js → chunk-727SXJPM-DQwsqjEy.js} +1 -1
- package/dist/assets/{chunk-AQP2D5EJ-fxdkQVWa.js → chunk-AQP2D5EJ-fULMnBTu.js} +1 -1
- package/dist/assets/{classDiagram-v2-Q7XG4LA2-ildlFf3k.js → classDiagram-4FO5ZUOK-EDX_swvj.js} +1 -1
- package/dist/assets/{classDiagram-4FO5ZUOK-B6P6vqOW.js → classDiagram-v2-Q7XG4LA2-BSUKcOCo.js} +1 -1
- package/dist/assets/{diagram-2AECGRRQ-BOmxTvSB.js → diagram-2AECGRRQ-B3A9U7BG.js} +1 -1
- package/dist/assets/{diagram-5GNKFQAL-3q_IwD5O.js → diagram-5GNKFQAL-DoLrxuqk.js} +1 -1
- package/dist/assets/{diagram-LMA3HP47-WRPy-o0L.js → diagram-LMA3HP47-D7eMQWl3.js} +1 -1
- package/dist/assets/{diagram-OG6HWLK6-CcpJ6pbQ.js → diagram-OG6HWLK6-DfQnGeYY.js} +1 -1
- package/dist/assets/{erDiagram-TEJ5UH35-A_v6dsXs.js → erDiagram-TEJ5UH35-CH2oGPRs.js} +1 -1
- package/dist/assets/{flowDiagram-I6XJVG4X-B2P0DenG.js → flowDiagram-I6XJVG4X-txN3D2EM.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-CJVZJFzG.js → highlighted-body-OFNGDK62-CWOOg70T.js} +1 -1
- package/dist/assets/{index-7F-5v729.js → index-wy4I4-jw.js} +8 -8
- package/dist/assets/{infoDiagram-5YYISTIA-BYFD-rZu.js → infoDiagram-5YYISTIA-DdQ6jOTC.js} +1 -1
- package/dist/assets/{ishikawaDiagram-YF4QCWOH-DkHrXjtG.js → ishikawaDiagram-YF4QCWOH-B87X_YyR.js} +1 -1
- package/dist/assets/{kanban-definition-UN3LZRKU-DqOYz8H4.js → kanban-definition-UN3LZRKU-CnByYvNc.js} +1 -1
- package/dist/assets/mermaid-GHXKKRXX-C5k8G86C.js +1 -0
- package/dist/assets/{mindmap-definition-RKZ34NQL-CITTX7cd.js → mindmap-definition-RKZ34NQL-wOCMY6Z8.js} +1 -1
- package/dist/assets/{pieDiagram-4H26LBE5-BCUWyCeo.js → pieDiagram-4H26LBE5-BtJvFpVV.js} +1 -1
- package/dist/assets/{requirementDiagram-4Y6WPE33-BSoEfvT7.js → requirementDiagram-4Y6WPE33-DQFHE1oU.js} +1 -1
- package/dist/assets/{sequenceDiagram-3UESZ5HK-CYbve3k2.js → sequenceDiagram-3UESZ5HK-DY-Krvh1.js} +1 -1
- package/dist/assets/{stateDiagram-AJRCARHV-7TMO867-.js → stateDiagram-AJRCARHV-C-BwTDN9.js} +1 -1
- package/dist/assets/{stateDiagram-v2-BHNVJYJU-DPjv14aL.js → stateDiagram-v2-BHNVJYJU-JXy5bBzJ.js} +1 -1
- package/dist/assets/{timeline-definition-PNZ67QCA-DAALN7nA.js → timeline-definition-PNZ67QCA-D9F3XBMb.js} +1 -1
- package/dist/assets/{vennDiagram-CIIHVFJN-JbTOcssb.js → vennDiagram-CIIHVFJN-Z8xCS8bp.js} +1 -1
- package/dist/assets/{wardleyDiagram-YWT4CUSO-faWft95_.js → wardleyDiagram-YWT4CUSO-D4E49ej3.js} +1 -1
- package/dist/assets/{xychartDiagram-2RQKCTM6-3_6RImSx.js → xychartDiagram-2RQKCTM6-BnaYKX3_.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/mermaid-GHXKKRXX-Bc-xhAE7.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CKG_JfFm.js","assets/chunk-BNv3lrIs.js","assets/html-jDxH5U-T.js","assets/css-nTRqEtqS.js","assets/javascript-irzFNmvQ.js","assets/angular-ts-OQjFO9Ij.js","assets/scss-bG0qHMW5.js","assets/apl-CHQpTmn_.js","assets/json-0tQUkJud.js","assets/xml-BwKsBFhA.js","assets/java-HC2eF0N8.js","assets/astro-Dbrci-OL.js","assets/postcss-D1__3wMa.js","assets/tsx-fgMo1GP0.js","assets/typescript-CB83Ehne.js","assets/blade-DO_YTgu7.js","assets/html-derivative-CDZF9MDk.js","assets/sql-CcyDfTXc.js","assets/bsl-HsKFScbj.js","assets/sdbl-Dpx5LW07.js","assets/c-BLA01pi7.js","assets/cairo-C8ZHV9zd.js","assets/python-BcwRHoQd.js","assets/cobol-BhKXHq63.js","assets/coffee-zdOAknWQ.js","assets/cpp-C0nZ5_dJ.js","assets/glsl-CuG8vpub.js","assets/regexp-ii7GAXR-.js","assets/crystal-Dkg8U9s8.js","assets/shellscript-DmgdaDlZ.js","assets/edge-C7XJxEnu.js","assets/elixir-Dwn-WRwC.js","assets/elm-Bf2IQ6jE.js","assets/erb-Dm7muVqp.js","assets/ruby-CuIYBR4i.js","assets/graphql-hSLUeHOi.js","assets/jsx-B0sv7_GA.js","assets/haml-CO--YY2G.js","assets/lua-Di3p4m3y.js","assets/yaml-DqOO8ReB.js","assets/erlang-8YzINMFZ.js","assets/markdown-y8SIDL9w.js","assets/fortran-fixed-form-CDv-T8WN.js","assets/fortran-free-form-CPnWnBJW.js","assets/fsharp-CNZm2v53.js","assets/gdresource-C5AdcNee.js","assets/gdscript-BO6C8SUe.js","assets/gdshader-Cz1qA8sU.js","assets/git-commit-CoKikzXi.js","assets/diff-jsbvMAmI.js","assets/git-rebase-BR94-0Tq.js","assets/glimmer-js-BfcHC0YW.js","assets/glimmer-ts-BzV97LDI.js","assets/hack-GAfTv0LA.js","assets/handlebars-Djddut9-.js","assets/http-LNVKfoyP.js","assets/hurl-CB0ZC1hn.js","assets/csv-DdF8koPb.js","assets/hxml-BOTq93Bi.js","assets/haxe-BGRd8Y8O.js","assets/jinja-DCkXClrT.js","assets/jison-BuuPl3bI.js","assets/julia-CROn01VT.js","assets/r-8Z1FVQnP.js","assets/just-salOGEJs.js","assets/perl-B2382A5F.js","assets/latex-D1D5RHX8.js","assets/tex-DlYtEd8m.js","assets/liquid-ewzC2Lg5.js","assets/marko-Ua2FYk5r.js","assets/less-BnA6XbnB.js","assets/mdc-DRqfxnxq.js","assets/nextflow-DA7YXO1y.js","assets/nextflow-groovy-B7W926DN.js","assets/nginx-YiBdQLqU.js","assets/nim-wudxqxYC.js","assets/php-BXFf-sYP.js","assets/pug-liPyBJbY.js","assets/qml-ARIN0-cW.js","assets/razor-CtJ6Egz9.js","assets/csharp-DM7Z_I9J.js","assets/rst-4nXf2YHT.js","assets/cmake-C6O2XJyZ.js","assets/sas-DqsQLi64.js","assets/shaderlab-BSvVO9_-.js","assets/hlsl-DzVKvoXv.js","assets/shellsession-2lSeV2NZ.js","assets/soy-D-2W0ns4.js","assets/sparql-DTlhh8tg.js","assets/turtle-UyMW4Kun.js","assets/stata-DVLy99jR.js","assets/surrealql-BYf73UKU.js","assets/svelte-_yNL66nM.js","assets/templ-CDGceQLG.js","assets/go-MxMoti4c.js","assets/ts-tags-BU1DnYmg.js","assets/twig-CBYGtkS9.js","assets/vue-BIvznpP7.js","assets/vue-html-DhGvo8OM.js","assets/vue-vine-BLZfWFbg.js","assets/stylus-CV4l4-4V.js","assets/xsl-B-4A7cth.js","assets/dagre-BM42HDAG-BvSi4ped.js","assets/chunk-O5CBEL6O-DlGQVK_q.js","assets/src-Bczt29fk.js","assets/chunk-5ZQYHXKU-cbF4P0vG.js","assets/dist-DTKv5Ibn.js","assets/chunk-CSCIHK7Q-wJZRfr9d.js","assets/preload-helper-DSXbuxSR.js","assets/dagre-Dkv27yFg.js","assets/graphlib-DXV5Nyx4.js","assets/chunk-3OPIFGDE-BehKbGmz.js","assets/chunk-L5ZTLDWV-Cn4H8tma.js","assets/chunk-NZK2D7GU-BWcKGYAY.js","assets/rough.esm-MuJqrtdI.js","assets/chunk-BSJP7CBP-BhTIjPDt.js","assets/chunk-KSCS5N6A-XemRA3th.js","assets/line-D70GAWFC.js","assets/path-BoFZ_ZCz.js","assets/array-CYHT4lxU.js","assets/cose-bilkent-S5V4N54A-CyT47_9y.js","assets/cytoscape.esm-BtX9h6tV.js","assets/c4Diagram-AAUBKEIU-3llRQO71.js","assets/chunk-ND2GUHAM-PHlnWBke.js","assets/flowDiagram-I6XJVG4X-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CKG_JfFm.js","assets/chunk-BNv3lrIs.js","assets/html-jDxH5U-T.js","assets/css-nTRqEtqS.js","assets/javascript-irzFNmvQ.js","assets/angular-ts-OQjFO9Ij.js","assets/scss-bG0qHMW5.js","assets/apl-CHQpTmn_.js","assets/json-0tQUkJud.js","assets/xml-BwKsBFhA.js","assets/java-HC2eF0N8.js","assets/astro-Dbrci-OL.js","assets/postcss-D1__3wMa.js","assets/tsx-fgMo1GP0.js","assets/typescript-CB83Ehne.js","assets/blade-DO_YTgu7.js","assets/html-derivative-CDZF9MDk.js","assets/sql-CcyDfTXc.js","assets/bsl-HsKFScbj.js","assets/sdbl-Dpx5LW07.js","assets/c-BLA01pi7.js","assets/cairo-C8ZHV9zd.js","assets/python-BcwRHoQd.js","assets/cobol-BhKXHq63.js","assets/coffee-zdOAknWQ.js","assets/cpp-C0nZ5_dJ.js","assets/glsl-CuG8vpub.js","assets/regexp-ii7GAXR-.js","assets/crystal-Dkg8U9s8.js","assets/shellscript-DmgdaDlZ.js","assets/edge-C7XJxEnu.js","assets/elixir-Dwn-WRwC.js","assets/elm-Bf2IQ6jE.js","assets/erb-Dm7muVqp.js","assets/ruby-CuIYBR4i.js","assets/graphql-hSLUeHOi.js","assets/jsx-B0sv7_GA.js","assets/haml-CO--YY2G.js","assets/lua-Di3p4m3y.js","assets/yaml-DqOO8ReB.js","assets/erlang-8YzINMFZ.js","assets/markdown-y8SIDL9w.js","assets/fortran-fixed-form-CDv-T8WN.js","assets/fortran-free-form-CPnWnBJW.js","assets/fsharp-CNZm2v53.js","assets/gdresource-C5AdcNee.js","assets/gdscript-BO6C8SUe.js","assets/gdshader-Cz1qA8sU.js","assets/git-commit-CoKikzXi.js","assets/diff-jsbvMAmI.js","assets/git-rebase-BR94-0Tq.js","assets/glimmer-js-BfcHC0YW.js","assets/glimmer-ts-BzV97LDI.js","assets/hack-GAfTv0LA.js","assets/handlebars-Djddut9-.js","assets/http-LNVKfoyP.js","assets/hurl-CB0ZC1hn.js","assets/csv-DdF8koPb.js","assets/hxml-BOTq93Bi.js","assets/haxe-BGRd8Y8O.js","assets/jinja-DCkXClrT.js","assets/jison-BuuPl3bI.js","assets/julia-CROn01VT.js","assets/r-8Z1FVQnP.js","assets/just-salOGEJs.js","assets/perl-B2382A5F.js","assets/latex-D1D5RHX8.js","assets/tex-DlYtEd8m.js","assets/liquid-ewzC2Lg5.js","assets/marko-Ua2FYk5r.js","assets/less-BnA6XbnB.js","assets/mdc-DRqfxnxq.js","assets/nextflow-DA7YXO1y.js","assets/nextflow-groovy-B7W926DN.js","assets/nginx-YiBdQLqU.js","assets/nim-wudxqxYC.js","assets/php-BXFf-sYP.js","assets/pug-liPyBJbY.js","assets/qml-ARIN0-cW.js","assets/razor-CtJ6Egz9.js","assets/csharp-DM7Z_I9J.js","assets/rst-4nXf2YHT.js","assets/cmake-C6O2XJyZ.js","assets/sas-DqsQLi64.js","assets/shaderlab-BSvVO9_-.js","assets/hlsl-DzVKvoXv.js","assets/shellsession-2lSeV2NZ.js","assets/soy-D-2W0ns4.js","assets/sparql-DTlhh8tg.js","assets/turtle-UyMW4Kun.js","assets/stata-DVLy99jR.js","assets/surrealql-BYf73UKU.js","assets/svelte-_yNL66nM.js","assets/templ-CDGceQLG.js","assets/go-MxMoti4c.js","assets/ts-tags-BU1DnYmg.js","assets/twig-CBYGtkS9.js","assets/vue-BIvznpP7.js","assets/vue-html-DhGvo8OM.js","assets/vue-vine-BLZfWFbg.js","assets/stylus-CV4l4-4V.js","assets/xsl-B-4A7cth.js","assets/dagre-BM42HDAG-BvSi4ped.js","assets/chunk-O5CBEL6O-DlGQVK_q.js","assets/src-Bczt29fk.js","assets/chunk-5ZQYHXKU-cbF4P0vG.js","assets/dist-DTKv5Ibn.js","assets/chunk-CSCIHK7Q-wJZRfr9d.js","assets/preload-helper-DSXbuxSR.js","assets/dagre-Dkv27yFg.js","assets/graphlib-DXV5Nyx4.js","assets/chunk-3OPIFGDE-BehKbGmz.js","assets/chunk-L5ZTLDWV-Cn4H8tma.js","assets/chunk-NZK2D7GU-BWcKGYAY.js","assets/rough.esm-MuJqrtdI.js","assets/chunk-BSJP7CBP-BhTIjPDt.js","assets/chunk-KSCS5N6A-XemRA3th.js","assets/line-D70GAWFC.js","assets/path-BoFZ_ZCz.js","assets/array-CYHT4lxU.js","assets/cose-bilkent-S5V4N54A-CyT47_9y.js","assets/cytoscape.esm-BtX9h6tV.js","assets/c4Diagram-AAUBKEIU-3llRQO71.js","assets/chunk-ND2GUHAM-PHlnWBke.js","assets/flowDiagram-I6XJVG4X-txN3D2EM.js","assets/channel-BH-8Atou.js","assets/chunk-2J33WTMH-BB5ATK0k.js","assets/chunk-55IACEB6-BIMwpGRA.js","assets/chunk-FMBD7UC4-LrB4SWaa.js","assets/erDiagram-TEJ5UH35-CH2oGPRs.js","assets/gitGraphDiagram-PVQCEYII-2JmhRXUT.js","assets/mermaid-parser.core-DuIR3pOv.js","assets/chunk-4EGX6M5U-C5SHZY5t.js","assets/chunk-NNHCCRGN-R8lmejY6.js","assets/chunk-5DO6E6H7-BvRtJG-b.js","assets/chunk-BR22UD5L-CMbA_7zi.js","assets/chunk-FHYWG6QK-DpLqOkK7.js","assets/chunk-MPE355IW-Bm6LdhAi.js","assets/chunk-MZUSXYTE-v7h2c1h1.js","assets/chunk-N66VUXT2-CX1fso4R.js","assets/chunk-PUPMXCY4-9anN8Uz5.js","assets/chunk-UIBZB4QT-DIG38ead.js","assets/chunk-WCWK7LTN-Doy8-Vhx.js","assets/chunk-4BX2VUAB-0O05y97U.js","assets/chunk-QZHKN3VN-DKTrdmlH.js","assets/ganttDiagram-6RSMTGT7-BEzcrIzY.js","assets/linear-DyunZ9v-.js","assets/defaultLocale-DL4ssfbz.js","assets/init-D0iKTvvc.js","assets/infoDiagram-5YYISTIA-DdQ6jOTC.js","assets/pieDiagram-4H26LBE5-BtJvFpVV.js","assets/ordinal-t_ha_BUo.js","assets/arc-CaQrDxc7.js","assets/quadrantDiagram-W4KKPZXB-DKqVquhI.js","assets/xychartDiagram-2RQKCTM6-BnaYKX3_.js","assets/requirementDiagram-4Y6WPE33-DQFHE1oU.js","assets/sequenceDiagram-3UESZ5HK-DY-Krvh1.js","assets/classDiagram-4FO5ZUOK-EDX_swvj.js","assets/chunk-727SXJPM-DQwsqjEy.js","assets/classDiagram-v2-Q7XG4LA2-BSUKcOCo.js","assets/stateDiagram-AJRCARHV-C-BwTDN9.js","assets/chunk-AQP2D5EJ-fULMnBTu.js","assets/stateDiagram-v2-BHNVJYJU-JXy5bBzJ.js","assets/journeyDiagram-JHISSGLW-Dqf9Usx-.js","assets/timeline-definition-PNZ67QCA-D9F3XBMb.js","assets/mindmap-definition-RKZ34NQL-wOCMY6Z8.js","assets/kanban-definition-UN3LZRKU-CnByYvNc.js","assets/sankeyDiagram-5OEKKPKP-CPEo_IdT.js","assets/diagram-LMA3HP47-D7eMQWl3.js","assets/diagram-2AECGRRQ-B3A9U7BG.js","assets/blockDiagram-GPEHLZMM-WHzKaDoW.js","assets/diagram-5GNKFQAL-DoLrxuqk.js","assets/architectureDiagram-3BPJPVTR-5eev2A3B.js","assets/diagram-KO2AKTUF-DwcLgbwe.js","assets/ishikawaDiagram-YF4QCWOH-B87X_YyR.js","assets/vennDiagram-CIIHVFJN-Z8xCS8bp.js","assets/diagram-OG6HWLK6-DfQnGeYY.js","assets/wardleyDiagram-YWT4CUSO-D4E49ej3.js","assets/highlighted-body-OFNGDK62-CWOOg70T.js","assets/angular-html-CN-oUuJC.js","assets/html-D8iPLU6I.js","assets/css-C3CK0M7i.js","assets/javascript-DAbF-03M.js","assets/angular-ts-CEjZNKjD.js","assets/scss-BzL89aQS.js","assets/apl-DACEo0-x.js","assets/json-DAgnK7sT.js","assets/xml-BdbcNzO9.js","assets/java-VNxxuvqq.js","assets/astro-HPRMwo6l.js","assets/postcss-9eGaqiLc.js","assets/tsx-BMhIw2y-.js","assets/typescript-DKzlP5dN.js","assets/blade-Bjl4HM5c.js","assets/html-derivative-DqiucELS.js","assets/sql-CxglZSwu.js","assets/bsl-B3BrAsEz.js","assets/sdbl-CDokzS_i.js","assets/c-DEubApYE.js","assets/cairo-L63OfEBR.js","assets/python-DpfQVtm0.js","assets/cobol-gniUFOQQ.js","assets/coffee-7S08yxyy.js","assets/cpp-BilQwc5N.js","assets/glsl-CC87e7NK.js","assets/regexp-Bi9ZWB-y.js","assets/crystal-DAdHHBqa.js","assets/shellscript--2FuAbxC.js","assets/edge-BQAK3QiZ.js","assets/elixir-DKTCBd6g.js","assets/elm-Cjv0Jh-u.js","assets/erb-K6mwyzz7.js","assets/ruby-CNbgP4lj.js","assets/graphql-DAjFE8Zq.js","assets/jsx-IPXvK94g.js","assets/haml-CaM4dYj1.js","assets/lua-NRA7hr4c.js","assets/yaml-jjteOoGO.js","assets/erlang-854X-Vkg.js","assets/markdown-BUyNNbS6.js","assets/fortran-fixed-form-BlmyIOK8.js","assets/fortran-free-form-CI2ch69g.js","assets/fsharp-D3Ezbq1E.js","assets/gdresource-BvGFcTeE.js","assets/gdscript-Cn_fDlI9.js","assets/gdshader-DLLpHgjs.js","assets/git-commit-ByANLFBY.js","assets/diff-B2brsVH-.js","assets/git-rebase-Gmx06j0y.js","assets/glimmer-js-CNdBQpaG.js","assets/glimmer-ts-CVzFNZoD.js","assets/hack-C8GWHc9h.js","assets/handlebars-DjNwk9Sx.js","assets/http-DpYDdgnl.js","assets/hurl-CcMs5xSG.js","assets/csv-B5Jk7o4Y.js","assets/hxml-os4YOtH3.js","assets/haxe-DPy34i1e.js","assets/jinja-KAOzhQ3w.js","assets/jison-DW7mGPaf.js","assets/julia-CZ7LtBOW.js","assets/r-dds2hvQq.js","assets/just-C4ZEGXKz.js","assets/perl-CuqDFkdl.js","assets/latex-D5mgYlGy.js","assets/tex-fm1tDdhM.js","assets/liquid-dGJBZQSH.js","assets/marko-BnzvVMtv.js","assets/less-B3Az5CZP.js","assets/mdc-C2AkezyX.js","assets/nextflow-COAS20q4.js","assets/nextflow-groovy-CaPjvDOT.js","assets/nginx-DogIU8Cr.js","assets/nim-BMEfrxHp.js","assets/php--PLUnv1_.js","assets/pug-D0RI5zMQ.js","assets/qml-oj8IuGxt.js","assets/razor-2QM_kJd8.js","assets/csharp-5rgSmf3e.js","assets/rst-D68_Abm0.js","assets/cmake-DN3FQlbu.js","assets/sas-DNzvYLSr.js","assets/shaderlab-DdzrHzhQ.js","assets/hlsl-hBgRvA5h.js","assets/shellsession-BaLMs3ov.js","assets/soy-BhlV2IGI.js","assets/sparql-Is31kmha.js","assets/turtle-DaqgDcgI.js","assets/stata-DZdYbt2n.js","assets/surrealql-_wgtTEYI.js","assets/svelte-CTPa36az.js","assets/templ-CT6Esmfg.js","assets/go-8OtLvWbL.js","assets/ts-tags-Dw0RLmha.js","assets/twig-DtNCkasW.js","assets/vue-CRmOVaU2.js","assets/vue-html-BdZhxJqn.js","assets/vue-vine-6M9IMSQp.js","assets/stylus-B1u-SVqg.js","assets/xsl-B8fg-QX6.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{a as e,i as t,n,r,t as i}from"./chunk-BNv3lrIs.js";import{t as a}from"./preload-helper-DSXbuxSR.js";import{t as o}from"./katex-Cx9EIVKh.js";import{_ as s,g as c,h as l,p as u}from"./src-Bczt29fk.js";import{$ as d,C as f,E as p,I as m,L as h,N as g,P as _,Q as v,S as y,T as b,V as x,W as S,X as C,Z as w,_ as T,b as E,c as D,g as O,l as k,m as A,n as j,p as M,q as N,r as P,s as ee,t as F,u as te,x as ne}from"./chunk-CSCIHK7Q-wJZRfr9d.js";import{G as re,a as ie,b as ae,d as oe,f as se,g as ce,h as le,i as ue,o as de,v as fe,y as pe}from"./chunk-5ZQYHXKU-cbF4P0vG.js";import"./chunk-BSJP7CBP-BhTIjPDt.js";import"./chunk-L5ZTLDWV-Cn4H8tma.js";import"./chunk-NZK2D7GU-BWcKGYAY.js";import{i as me,o as he}from"./chunk-O5CBEL6O-DlGQVK_q.js";import{a as ge,i as _e,s as ve}from"./chunk-3OPIFGDE-BehKbGmz.js";import{a as ye,i as be,n as xe,r as Se}from"./chunk-KSCS5N6A-XemRA3th.js";(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Ce=i((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.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(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 N(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,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(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 P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ee(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var F=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)},te={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=te,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},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=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.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 E(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)T.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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ee}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.6`})),we=i(((e,t)=>{t.exports=Ce()})),Te=i((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}}}})),Ee=i(((e,t)=>{t.exports=Te()})),De=i((e=>{var t=we();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`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(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.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 o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.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=c(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=c(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})}}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=c(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=c(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})}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 s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.6`})),Oe=i(((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=De()})),ke=i((e=>{var t=Ee(),n=we(),r=Oe();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){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n: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 d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var M=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},F=[],te=-1;function ne(e){return{current:e}}function re(e){0>te||(e.current=F[te],F[te]=null,te--)}function ie(e,t){te++,F[te]=e.current,e.current=t}var ae=ne(null),oe=ne(null),se=ne(null),ce=ne(null);function le(e,t){switch(ie(se,t),ie(oe,e),ie(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Qd(t),e=$d(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}re(ae),ie(ae,e)}function ue(){re(ae),re(oe),re(se)}function de(e){e.memoizedState!==null&&ie(ce,e);var t=ae.current,n=$d(t,e.type);t!==n&&(ie(oe,e),ie(ae,n))}function fe(e){oe.current===e&&(re(ae),re(oe)),ce.current===e&&(re(ce),lp._currentValue=ee)}var pe,me;function he(e){if(pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||``,me=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+pe+e+me}var ge=!1;function _e(e,t){if(!e||ge)return``;ge=!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}e.call(n.prototype)}}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(`
|
|
@@ -184,7 +184,7 @@ ${t}`,l++;break;case`id`:s=t.includes(`\0`)?void 0:t;break;case`retry`:/^\d+$/.t
|
|
|
184
184
|
`;return t&&t.length>0?t[0]:null}getAllStreamMetadata(){return this.sql`select id, status, request_id, created_at from cf_ai_chat_stream_metadata`||[]}insertStaleStream(e,t,n){let r=Date.now()-n;this.sql`
|
|
185
185
|
insert into cf_ai_chat_stream_metadata (id, request_id, status, created_at)
|
|
186
186
|
values (${e}, ${t}, 'streaming', ${r})
|
|
187
|
-
`}};Dp.CHUNK_MAX_BYTES=18e5,yp.STREAM_RESUME_NONE;var Op=i(((e,t)=>{function n(e,t){if(typeof e!=`function`)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...i){clearTimeout(n);let a=Date.now(),o=t-(a-r);o<=0?(r=a,e.apply(this,i)):n=setTimeout(()=>{r=Date.now(),e.apply(this,i)},o)}}t.exports=n})),kp=i((e=>{var t=we();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 d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Ap=i(((e,t)=>{t.exports=kp()})),jp=e(Op(),1),Mp=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},Np=(e,t,n)=>(Mp(e,t,`read from private field`),n?n.call(e):t.get(e)),Pp=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Fp=(e,t,n,r)=>(Mp(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n);function Ip(e,t){return t==null?e:(0,jp.default)(e,t)}var Lp,Rp,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp=class{constructor(e=[]){Pp(this,Lp,void 0),Pp(this,Rp,`ready`),Pp(this,zp,void 0),Pp(this,Bp,new Set),Pp(this,Vp,new Set),Pp(this,Hp,new Set),this.pushMessage=e=>{Fp(this,Lp,Np(this,Lp).concat(e)),Np(this,Up).call(this)},this.popMessage=()=>{Fp(this,Lp,Np(this,Lp).slice(0,-1)),Np(this,Up).call(this)},this.replaceMessage=(e,t)=>{Fp(this,Lp,[...Np(this,Lp).slice(0,e),this.snapshot(t),...Np(this,Lp).slice(e+1)]),Np(this,Up).call(this)},this.snapshot=e=>structuredClone(e),this[`~registerMessagesCallback`]=(e,t)=>{let n=t?Ip(e,t):e;return Np(this,Bp).add(n),()=>{Np(this,Bp).delete(n)}},this[`~registerStatusCallback`]=e=>(Np(this,Vp).add(e),()=>{Np(this,Vp).delete(e)}),this[`~registerErrorCallback`]=e=>(Np(this,Hp).add(e),()=>{Np(this,Hp).delete(e)}),Pp(this,Up,()=>{Np(this,Bp).forEach(e=>e())}),Pp(this,Wp,()=>{Np(this,Vp).forEach(e=>e())}),Pp(this,Gp,()=>{Np(this,Hp).forEach(e=>e())}),Fp(this,Lp,e)}get status(){return Np(this,Rp)}set status(e){Fp(this,Rp,e),Np(this,Wp).call(this)}get error(){return Np(this,zp)}set error(e){Fp(this,zp,e),Np(this,Gp).call(this)}get messages(){return Np(this,Lp)}set messages(e){Fp(this,Lp,[...e]),Np(this,Up).call(this)}};Lp=new WeakMap,Rp=new WeakMap,zp=new WeakMap,Bp=new WeakMap,Vp=new WeakMap,Hp=new WeakMap,Up=new WeakMap,Wp=new WeakMap,Gp=new WeakMap;var qp,Jp=class extends pp{constructor({messages:e,...t}){let n=new Kp(e);super({...t,state:n}),Pp(this,qp,void 0),this[`~registerMessagesCallback`]=(e,t)=>Np(this,qp)[`~registerMessagesCallback`](e,t),this[`~registerStatusCallback`]=e=>Np(this,qp)[`~registerStatusCallback`](e),this[`~registerErrorCallback`]=e=>Np(this,qp)[`~registerErrorCallback`](e),Fp(this,qp,n)}};qp=new WeakMap;function Yp({experimental_throttle:e,resume:t=!1,...n}={}){let r=(0,I.useRef)(`chat`in n?{}:{onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});`chat`in n||(r.current={onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});let i={...n,onToolCall:e=>{var t;return(t=r.current).onToolCall?.call(t,e)},onData:e=>{var t;return(t=r.current).onData?.call(t,e)},onFinish:e=>{var t;return(t=r.current).onFinish?.call(t,e)},onError:e=>{var t;return(t=r.current).onError?.call(t,e)},sendAutomaticallyWhen:e=>{var t;return(t=r.current).sendAutomaticallyWhen?.call(t,e)??!1}},a=(0,I.useRef)(`chat`in n?n.chat:new Jp(i));(`chat`in n&&n.chat!==a.current||`id`in n&&a.current.id!==n.id)&&(a.current=`chat`in n?n.chat:new Jp(i));let o=(0,I.useSyncExternalStore)((0,I.useCallback)(t=>a.current[`~registerMessagesCallback`](t,e),[e,a.current.id]),()=>a.current.messages,()=>a.current.messages),s=(0,I.useSyncExternalStore)(a.current[`~registerStatusCallback`],()=>a.current.status,()=>a.current.status),c=(0,I.useSyncExternalStore)(a.current[`~registerErrorCallback`],()=>a.current.error,()=>a.current.error),l=(0,I.useCallback)(e=>{typeof e==`function`&&(e=e(a.current.messages)),a.current.messages=e},[a]);return(0,I.useEffect)(()=>{t&&a.current.resumeStream()},[t,a]),{id:a.current.id,messages:o,setMessages:l,sendMessage:a.current.sendMessage,regenerate:a.current.regenerate,clearError:a.current.clearError,stop:a.current.stop,error:c,resumeStream:a.current.resumeStream,status:s,addToolResult:a.current.addToolOutput,addToolOutput:a.current.addToolOutput,addToolApprovalResponse:a.current.addToolApprovalResponse}}var Xp=class{constructor(e){this._resumeResolver=null,this._resumeNoneResolver=null,this._expectToolContinuation=!1,this._abortToolContinuation=null,this._activeServerTurnId=null,this._cancelAttachedStream=null,this.agent=e.agent,this.prepareBody=e.prepareBody,this.activeRequestIds=e.activeRequestIds,this.cancelOnClientAbort=e.cancelOnClientAbort??!1}setCancelOnClientAbort(e){this.cancelOnClientAbort=e}cancelActiveServerTurn(){let e=this._activeServerTurnId,t=!1;e&&(this.sendCancelFrame(e),this._cancelAttachedStream?.(),this.clearActiveServerTurn(e),t=!0);let n=this.abortActiveToolContinuation();return t||n}sendCancelFrame(e){try{this.agent.send(JSON.stringify({id:e,type:`cf_agent_chat_request_cancel`}))}catch{}}setActiveServerTurn(e,t){this._activeServerTurnId=e,this._cancelAttachedStream=t}clearActiveServerTurn(e){this._activeServerTurnId===e&&(this._activeServerTurnId=null,this._cancelAttachedStream=null)}expectToolContinuation(){this._expectToolContinuation=!0}abortActiveToolContinuation(){return this._abortToolContinuation?.()??!1}isAwaitingResume(){return this._resumeResolver!==null||this._resumeNoneResolver!==null}handleStreamResuming(e){return this._resumeResolver?(this._resumeResolver(e),!0):!1}handleStreamResumeNone(){return this._resumeNoneResolver?(this._resumeNoneResolver(),!0):!1}handleServerTurnCompleted(e){this.clearActiveServerTurn(e)}observeServerTurn(e){this.setActiveServerTurn(e,null)}async sendMessages(e){let t=hp(8),n=new AbortController,r=!1,i=!1,a={};this.prepareBody&&(a=await this.prepareBody({messages:e.messages,trigger:e.trigger,messageId:e.messageId})),e.body&&(a={...a,...e.body});let o=JSON.stringify({messages:e.messages,trigger:e.trigger,...a});this.activeRequestIds?.add(t);let s=this.agent,c=this.activeRequestIds,l=(e,i=!1,a=!0)=>{if(!r){r=!0,a&&this.clearActiveServerTurn(t);try{e()}catch{}i||c?.delete(t),n.abort()}},u=Error(`Aborted`);u.name=`AbortError`,this.setActiveServerTurn(t,()=>r?!1:(l(()=>f.error(u),!0),!0));let d=()=>{r||(this.cancelOnClientAbort?(i&&this.sendCancelFrame(t),l(()=>f.error(u),i)):l(()=>f.error(u),!1,!i))},f,p=new ReadableStream({start(e){f=e,s.addEventListener(`message`,n=>{try{let r=JSON.parse(n.data);if(r.type!==`cf_agent_use_chat_response`||r.id!==t)return;if(r.error){l(()=>e.error(Error(r.body||`Stream error`)));return}if(r.body?.trim())try{let t=JSON.parse(r.body);e.enqueue(t)}catch{}r.done&&l(()=>e.close())}catch{}},{signal:n.signal}),s.addEventListener(`close`,()=>{l(()=>e.close(),!1,!1)},{signal:n.signal})},cancel(){d()}});return e.abortSignal&&(e.abortSignal.addEventListener(`abort`,d,{once:!0}),e.abortSignal.aborted&&d()),r?p:(i=!0,s.send(JSON.stringify({id:t,init:{method:`POST`,body:o},type:`cf_agent_use_chat_request`})),p)}async reconnectToStream(e){if(this._expectToolContinuation)return this._expectToolContinuation=!1,this._createToolContinuationStream();let t=this.activeRequestIds;return new Promise(e=>{let n=!1,r,i=t=>{n||(n=!0,this._resumeResolver=null,this._resumeNoneResolver=null,r&&clearTimeout(r),e(t))};this._resumeNoneResolver=()=>i(null),this._resumeResolver=e=>{let n=e.id;t?.add(n);let r=this._createResumeStream(n);this.agent.send(JSON.stringify({type:`cf_agent_stream_resume_ack`,id:n})),i(r)};try{this.agent.send(JSON.stringify({type:`cf_agent_stream_resume_request`}))}catch{}r=setTimeout(()=>i(null),5e3)})}_createToolContinuationStream(){let e=this.agent,t=this.activeRequestIds,n=new AbortController,r=Error(`Aborted`);r.name=`AbortError`;let i=!1,a=null,o,s=null,c=null,l=(e,t)=>{if(e===void 0&&t===void 0){this._resumeResolver=null,this._resumeNoneResolver=null;return}e&&this._resumeResolver===e&&(this._resumeResolver=null),t&&this._resumeNoneResolver===t&&(this._resumeNoneResolver=null)},u=(e,r,o,s=!1)=>{if(!i){i=!0,this._abortToolContinuation=null,l(r,o);try{e()}catch{}a&&!s&&t?.delete(a),n.abort()}};this._abortToolContinuation=()=>{if(i)return!1;if(a===null)return u(()=>o.error(r),s,c),!0;try{e.send(JSON.stringify({type:`cf_agent_chat_request_cancel`,id:a}))}catch{}return u(()=>o.error(r),s,c,!0),!0};let d=this;return new ReadableStream({start(r){o=r;let i,f=()=>{i&&clearTimeout(i),u(()=>r.close(),p,f)},p=n=>{a||(a=n.id,t?.add(a),l(p,f),i&&clearTimeout(i),e.send(JSON.stringify({type:`cf_agent_stream_resume_ack`,id:a})))};s=p,c=f,i=setTimeout(()=>u(()=>r.close(),p,f),5e3),d._resumeResolver=p,d._resumeNoneResolver=f,e.addEventListener(`message`,e=>{try{let t=JSON.parse(e.data);if(t.type!==`cf_agent_use_chat_response`||a==null||t.id!==a)return;if(t.error){u(()=>r.error(Error(t.body||`Stream error`)),p,f);return}if(t.body?.trim())try{let e=JSON.parse(t.body);r.enqueue(e)}catch{}t.done&&u(()=>r.close(),p,f)}catch{}},{signal:n.signal}),e.addEventListener(`close`,()=>{i&&clearTimeout(i),u(()=>r.close(),p,f)},{signal:n.signal});try{e.send(JSON.stringify({type:`cf_agent_stream_resume_request`}))}catch{u(()=>r.close())}},cancel(){a&&d.cancelOnClientAbort?(d.sendCancelFrame(a),u(()=>{},s,c,!0)):u(()=>{},s,c)}})}_createResumeStream(e){let t=this.agent,n=this.activeRequestIds,r=new AbortController,i=Error(`Aborted`);i.name=`AbortError`;let a=!1,o=(t,i=!1,o=!0)=>{if(!a){a=!0,o&&this.clearActiveServerTurn(e);try{t()}catch{}i||n?.delete(e),r.abort()}};this.setActiveServerTurn(e,()=>a?!1:(o(()=>s.error(i),!0),!0));let s,c=this;return new ReadableStream({start(n){s=n,t.addEventListener(`message`,t=>{try{let r=JSON.parse(t.data);if(r.type!==`cf_agent_use_chat_response`||r.id!==e)return;if(r.error){o(()=>n.error(Error(r.body||`Stream error`)));return}if(r.body?.trim())try{let e=JSON.parse(r.body);n.enqueue(e)}catch{}r.done&&o(()=>n.close())}catch{}},{signal:r.signal}),t.addEventListener(`close`,()=>{o(()=>n.close(),!1,!1)},{signal:r.signal})},cancel(){c.cancelOnClientAbort?(c.sendCancelFrame(e),o(()=>{},!0)):o(()=>{},!1,!1)}})}},Zp=new Set;function Qp(e,t){Zp.has(e)||(Zp.add(e),console.warn(`[@cloudflare/ai-chat] Deprecated: ${t}`))}function $p(e){if(!e)return;let t=Object.entries(e).filter(([e,t])=>t.execute).map(([e,t])=>(t.inputSchema&&!t.parameters&&console.warn(`[useAgentChat] Tool "${e}" uses deprecated 'inputSchema'. Please migrate to 'parameters'.`),{name:e,description:t.description,parameters:t.parameters??t.inputSchema}));return t.length>0?t:void 0}var em=new Map;function tm(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.role===`assistant`)return{index:t,message:n}}return null}function eee(e,t){let n=e.findIndex(e=>e.id===t);if(n<0||n===e.length-1)return e;let r=[...e],[i]=r.splice(n,1);return i?(r.push(i),r):e}function tee(e,t){if(t.length===0)return e;let n=new Set(t.map(e=>e.id)),r=e.filter(e=>!n.has(e.id));return r.length===0?t:[...r,...t]}function nm(e){let{agent:t,getInitialMessages:n,messages:r,onToolCall:i,onData:a,experimental_automaticToolResolution:o,tools:s,toolsRequiringConfirmation:c,autoContinueAfterToolResult:l=!0,autoSendAfterAllConfirmationsResolved:u=!0,resume:d=!0,cancelOnClientAbort:f=!1,body:p,prepareSendMessagesRequest:m,...h}=e;c&&Qp(`useAgentChat.toolsRequiringConfirmation`,`The 'toolsRequiringConfirmation' option is deprecated. Use needsApproval on server-side tools instead. Will be removed in the next major version.`),o&&Qp(`useAgentChat.experimental_automaticToolResolution`,`The 'experimental_automaticToolResolution' option is deprecated. Use the onToolCall callback instead. Will be removed in the next major version.`),e.autoSendAfterAllConfirmationsResolved!==void 0&&Qp(`useAgentChat.autoSendAfterAllConfirmationsResolved`,`The 'autoSendAfterAllConfirmationsResolved' option is deprecated. Use sendAutomaticallyWhen from AI SDK instead. Will be removed in the next major version.`);let g=(0,I.useMemo)(()=>c||(s?Object.entries(s).filter(([e,t])=>!t.execute).map(([e])=>e):[]),[c,s]),_=(0,I.useRef)(i);_.current=i;let v=(0,I.useRef)(a);v.current=a;let y=t.getHttpUrl(),b=y?new URL(y):null;b&&b.searchParams.delete(`_pk`);let x=b?.toString()??null,S=Array.isArray(t.path)?JSON.stringify(t.path.map(e=>[e.agent,e.name])):JSON.stringify([[t.agent??``,t.name??``]]),C=b?`${b.origin}${b.pathname}|${S}`:null,w=S,T=(0,I.useRef)(null),E=(0,I.useRef)(null),D=(0,I.useRef)(null),O=S,k=Array.isArray(t.path)&&D.current!==null&&D.current!==S;(T.current===null||E.current!==t||k)&&(T.current=C??O),E.current=t,D.current=S;let A=(0,I.useRef)(t);A.current=t;async function j({url:t}){if(!t)return[];let n=new URL(t);n.pathname+=`/get-messages`;let r=await fetch(n.toString(),{credentials:e.credentials,headers:e.headers});if(!r.ok)return console.warn(`Failed to fetch initial messages: ${r.status} ${r.statusText}`),[];let i=await r.text();if(!i.trim())return[];try{return JSON.parse(i)}catch(e){return console.warn(`Failed to parse initial messages JSON:`,e),[]}}let M=n||j;function N(e,t){if(em.has(t))return em.get(t);let n=M(e);return em.set(t,n),n}let P=n!==null&&(n||x)?N({agent:t.agent,name:t.name,url:x??void 0},w):null,ee=P?(0,I.use)(P):r??[];(0,I.useEffect)(()=>{if(P)return em.set(w,P),()=>{em.get(w)===P&&em.delete(w)}},[w,P]);let F=(0,I.useRef)(s);F.current=s;let te=(0,I.useRef)(m);te.current=m;let ne=(0,I.useRef)(p);ne.current=p;let re=(0,I.useRef)(new Set),ie=(0,I.useRef)(new Set),ae=(0,I.useRef)(new Set),oe=(0,I.useRef)(null);oe.current===null&&(oe.current=new Xp({agent:A.current,activeRequestIds:re.current,cancelOnClientAbort:f,prepareBody:async({messages:e,trigger:t,messageId:n})=>{let r={},i=ne.current;if(i&&(r={...typeof i==`function`?await i():i}),F.current){let e=$p(F.current);e&&(r.clientTools=e)}if(te.current){let i=await te.current({id:A.current._pk,messages:e,trigger:t,messageId:n});i.body&&Object.assign(r,i.body)}return r}})),oe.current.agent=A.current,oe.current.setCancelOnClientAbort(f);let se=oe.current,ce=Yp({...h,onData:a,messages:ee,transport:se,id:T.current,resume:d}),{messages:le,setMessages:ue,addToolResult:de,addToolApprovalResponse:fe,sendMessage:pe,resumeStream:me,status:he,stop:ge}=ce,_e=(0,I.useRef)(he);_e.current=he;let ve=(0,I.useRef)(!1),ye=(0,I.useRef)(0),[be,xe]=(0,I.useState)(!1),Se=(0,I.useCallback)(()=>{ye.current++,ve.current=!1,xe(!1)},[]),Ce=(0,I.useCallback)(()=>{if(!l||ve.current)return;let e=++ye.current;ve.current=!0,xe(!0),se.expectToolContinuation(),me().finally(()=>{ye.current===e&&(ve.current=!1,xe(!1))})},[l,se,me]),we=(0,I.useCallback)(async()=>{try{se.cancelActiveServerTurn(),await ge()}finally{se.abortActiveToolContinuation()}},[ge,se]),Te=(0,I.useRef)(new Set),Ee=(0,I.useRef)(!1),[De,Oe]=(0,I.useState)(0),[ke,Ae]=(0,I.useState)(new Map),je=(0,I.useRef)(le);je.current=le;let Me=(0,I.useRef)(ee);Me.current=ee;let Ne=(0,I.useRef)(null),Pe=(0,I.useCallback)(()=>{Ne.current=w},[w]);(0,I.useEffect)(()=>{P&&Ne.current!==w&&(Pe(),ue(e=>tee(Me.current,e)))},[w,P,Pe,ue]);let Fe=(0,I.useRef)(new Map),Ie=(0,I.useRef)(null),Le=(0,I.useCallback)(e=>{let t=Ie.current;if(!t)return[...e];let n=je.current.find(e=>e.id===t.assistantId)??e.find(e=>e.id===t.assistantId);return n?[...e.filter(e=>e.id!==t.assistantId),n]:[...e]},[]),Re=(0,I.useCallback)(()=>{if(_e.current!==`streaming`)return;let e=tm(je.current);e&&(Ie.current?.assistantId!==e.message.id&&(Ie.current={assistantId:e.message.id,anchorMessageId:je.current[e.index-1]?.id??null}),ue(e=>{let t=Ie.current;return t?eee(e,t.assistantId):e}))},[ue]),ze=(0,I.useCallback)(e=>{let t=Ie.current;!t||e!==void 0&&t.assistantId!==e||(Ie.current=null,ue(e=>{let n=e.findIndex(e=>e.id===t.assistantId);if(n<0)return e;let r=[...e],[i]=r.splice(n,1);if(!i)return e;if(t.anchorMessageId===null)r.unshift(i);else{let e=r.findIndex(e=>e.id===t.anchorMessageId);r.splice(e>=0?e+1:n,0,i)}return r}))},[ue]),Be=(0,I.useCallback)(e=>{ue(t=>{let n=t[t.length-1];if(!n||n.role!==`assistant`||n.id!==e)return t;ae.current.add(e);let r=[...t];return r[r.length-1]={...n,parts:[]},r})},[ue]),Ve=(0,I.useCallback)(e=>{let t=e.parts,n=t.filter((e,n)=>e.type!==`text`||!(`text`in e)||!e.text?!0:!t.some((t,r)=>r<=n||t.type!==`text`||!(`text`in t)||!t.text?!1:t.text.startsWith(e.text)));return n.length===t.length?e:{...e,parts:n}},[]);(0,I.useEffect)(()=>{if(ae.current.size===0)return;let e=new Set(le.filter(e=>ae.current.has(e.id)&&e.role===`assistant`&&Ve(e)!==e).map(e=>e.id));e.size!==0&&ue(t=>{let n=!1,r=t.map(t=>{if(!e.has(t.id))return t;let r=Ve(t);return r!==t&&(n=!0),r});return n?r:t})},[le,Ve,ue]);let He=(0,I.useCallback)(()=>{Pe(),ue([]),Ae(new Map),Se(),Te.current.clear(),Fe.current.clear(),ie.current.clear(),ae.current.clear(),Ie.current=null},[Pe,ue,Se]),Ue=(0,I.useCallback)(async(e,t)=>{let n=pe(e,t);return e!==void 0&&!(typeof e==`object`&&e&&`messageId`in e&&e.messageId!=null)&&Re(),n},[pe,Re]),We=le[le.length-1],Ge=(()=>{if(!We||We.role!==`assistant`)return{messageId:void 0,toolCallIds:new Set};let e=new Set;for(let t of We.parts??[])rp(t)&&t.state===`input-available`&&g.includes(ap(t))&&e.add(t.toolCallId);return{messageId:We.id,toolCallIds:e}})(),Ke=(0,I.useRef)(Ge);Ke.current=Ge,(0,I.useEffect)(()=>{if(!o||Ee.current)return;let e=le[le.length-1];if(!e||e.role!==`assistant`)return;let t=e.parts.filter(e=>rp(e)&&e.state===`input-available`&&!Te.current.has(e.toolCallId));if(t.length>0){let e=F.current,n=t.filter(t=>rp(t)&&!g.includes(ap(t))&&e?.[ap(t)]?.execute);n.length>0&&(Ee.current=!0,(async()=>{try{let t=[];for(let r of n)if(rp(r)){let n=null,i=ap(r),a=e?.[i];if(a?.execute&&r.input!==void 0)try{n=await a.execute(r.input)}catch(e){n=`Error executing tool: ${e instanceof Error?e.message:String(e)}`}Te.current.add(r.toolCallId),t.push({toolCallId:r.toolCallId,toolName:i,output:n})}if(t.length>0){let n=$p(e);for(let e of t)A.current.send(JSON.stringify({type:`cf_agent_tool_result`,toolCallId:e.toolCallId,toolName:e.toolName,output:e.output,autoContinue:l,clientTools:n}));await Promise.all(t.map(e=>de({tool:e.toolName,toolCallId:e.toolCallId,output:e.output}))),Ae(e=>{let n=new Map(e);for(let e of t)n.set(e.toolCallId,e.output);return n}),Ce()}}finally{Ee.current=!1,Oe(e=>e+1)}})())}},[le,o,de,g,l,Ce,De]);let qe=(0,I.useCallback)((e,t,n,r,i)=>{let a=r===`output-error`?!1:l;A.current.send(JSON.stringify({type:`cf_agent_tool_result`,toolCallId:e,toolName:t,output:n,...r?{state:r}:{},...i===void 0?{}:{errorText:i},autoContinue:a,clientTools:F.current?$p(F.current):void 0})),r!==`output-error`&&Ae(t=>new Map(t).set(e,n)),a&&Ce()},[l,Ce]),Je=(0,I.useCallback)((e,t)=>{A.current.send(JSON.stringify({type:`cf_agent_tool_approval`,toolCallId:e,approved:t,autoContinue:l})),l&&Ce()},[l,Ce]);(0,I.useEffect)(()=>{let e=_.current;if(!e)return;let t=le[le.length-1];if(!t||t.role!==`assistant`)return;let n=t.parts.filter(e=>rp(e)&&e.state===`input-available`&&!Te.current.has(e.toolCallId));for(let t of n)if(rp(t)){let n=t.toolCallId,r=ap(t);Te.current.add(n),e({toolCall:{toolCallId:n,toolName:r,input:t.input},addToolOutput:e=>{qe(e.toolCallId,r,e.output,e.state,e.errorText),de({tool:r,toolCallId:e.toolCallId,output:e.state===`output-error`?e.errorText??`Tool execution denied by user`:e.output})}})}},[le,qe,de]);let Ye=(0,I.useRef)({status:`idle`}),[Xe,Ze]=(0,I.useState)(!1);(0,I.useEffect)(()=>{let e=Fe.current;function n(t){if(typeof t.data!=`string`)return;let n;try{n=JSON.parse(t.data)}catch{return}switch(n.type){case`cf_agent_chat_clear`:Ye.current=vp(Ye.current,{type:`clear`}).state,Ze(!1),He();break;case`cf_agent_chat_messages`:ue(Le(n.messages));break;case`cf_agent_message_updated`:ue(e=>{let t=n.message,r=e.findIndex(e=>e.id===t.id);if(r<0){let n=new Set(t.parts.filter(e=>`toolCallId`in e&&e.toolCallId).map(e=>e.toolCallId));n.size>0&&(r=e.findIndex(e=>e.parts.some(e=>`toolCallId`in e&&n.has(e.toolCallId))))}if(r>=0){let n=[...e];return n[r]={...t,id:e[r].id},n}return e});break;case`cf_agent_stream_resume_none`:se.handleStreamResumeNone();break;case`cf_agent_stream_resuming`:if(!d&&!se.isAwaitingResume()||(ve.current||ie.current.add(n.id),se.handleStreamResuming(n))||re.current.has(n.id))return;Ye.current=vp(Ye.current,{type:`resume-fallback`,streamId:n.id,messageId:hp()}).state,se.observeServerTurn(n.id),Ze(!0),A.current.send(JSON.stringify({type:`cf_agent_stream_resume_ack`,id:n.id}));break;case`cf_agent_use_chat_response`:{if(re.current.has(n.id)){if(n.body?.trim())try{let t=JSON.parse(n.body);t.type===`start`&&typeof t.messageId==`string`&&(e.set(n.id,t.messageId),n.replay&&ie.current.has(n.id)&&(ie.current.delete(n.id),Be(t.messageId)))}catch{}(n.done||n.replayComplete)&&ie.current.delete(n.id),n.done&&(Ye.current.status===`observing`&&Ye.current.streamId===n.id&&(Ye.current={status:`idle`},Ze(!1)),se.handleServerTurnCompleted(n.id),ze(e.get(n.id)),e.delete(n.id),re.current.delete(n.id));return}let t;if(n.replay&&Ye.current.status!==`observing`&&!ie.current.has(n.id))return;if(n.body?.trim())try{t=JSON.parse(n.body),n.replay&&ie.current.has(n.id)&&typeof t.messageId==`string`&&t.type===`start`&&(ie.current.delete(n.id),Be(t.messageId)),typeof t.type==`string`&&t.type.startsWith(`data-`)&&v.current&&v.current(t)}catch(e){console.warn(`[useAgentChat] Failed to parse stream chunk:`,e instanceof Error?e.message:e,`body:`,n.body?.slice(0,100))}(n.done||n.replayComplete)&&ie.current.delete(n.id),n.done&&se.handleServerTurnCompleted(n.id);let r=vp(Ye.current,{type:`response`,streamId:n.id,messageId:hp(),chunkData:t,done:n.done,error:n.error,replay:n.replay,replayComplete:n.replayComplete,continuation:n.continuation,currentMessages:n.continuation?je.current:void 0});Ye.current=r.state,r.messagesUpdate&&ue(r.messagesUpdate),Ze(r.isStreaming);break}}}return t.addEventListener(`message`,n),()=>{t.removeEventListener(`message`,n),Ye.current={status:`idle`},Ze(!1),Ie.current=null,e.clear()}},[t,ue,d,se,Le,Be,ze,He]);let Qe=async e=>{let{toolCallId:t}=e,n=`tool`in e?e.tool:``,r=`output`in e?e.output:void 0;if(A.current.send(JSON.stringify({type:`cf_agent_tool_result`,toolCallId:t,toolName:n,output:r,autoContinue:l,clientTools:F.current?$p(F.current):void 0})),Ae(e=>new Map(e).set(t,r)),de(e),l&&Ce(),!l){if(!u){pe();return}let e=Ke.current?.toolCallIds;if(!e){pe();return}let n=e.size===1&&e.has(t);e.has(t)&&e.delete(t),(n||e.size===0)&&pe()}},$e=e=>{let{id:t,approved:n}=e,r;for(let e of je.current){for(let n of e.parts)if(`toolCallId`in n&&`approval`in n&&n.approval?.id===t){r=n.toolCallId;break}if(r)break}r?Je(r,n):console.warn(`[useAgentChat] addToolApprovalResponse: Could not find toolCallId for approval ID "${t}". Server will not be notified, which may cause duplicate messages.`),fe(e)},et=(0,I.useMemo)(()=>ke.size===0?le:le.map(e=>({...e,parts:e.parts.map(e=>!(`toolCallId`in e)||!(`state`in e)||e.state!==`input-available`||!ke.has(e.toolCallId)?e:{...e,state:`output-available`,output:ke.get(e.toolCallId)})})),[le,ke]);(0,I.useEffect)(()=>{let e=new Set;for(let t of le)for(let n of t.parts)`toolCallId`in n&&n.toolCallId&&e.add(n.toolCallId);Ae(t=>{if(t.size===0)return t;let n=!1;for(let r of t.keys())if(!e.has(r)){n=!0;break}if(!n)return t;let r=new Map;for(let[n,i]of t)e.has(n)&&r.set(n,i);return r});for(let t of Te.current)e.has(t)||Te.current.delete(t)},[le]);let tt=(0,I.useCallback)(e=>{let t=e.toolName??``;qe(e.toolCallId,t,e.output,e.state,e.errorText),de({tool:t,toolCallId:e.toolCallId,output:e.state===`output-error`?e.errorText??`Tool execution denied by user`:e.output})},[qe,de]),nt=et[et.length-1],rt=(()=>{let e=!!i;if(!e&&!s||!nt||nt.role!==`assistant`)return!1;for(let t of nt.parts){if(!rp(t)||t.state!==`input-available`)continue;let n=ap(t);if(!g.includes(n)&&(e||s?.[n]?.execute))return!0}return!1})(),it=Xe||rt,at=he===`streaming`||it;return{...ce,messages:et,isServerStreaming:it,isStreaming:at,isToolContinuation:be,sendMessage:Ue,stop:we,addToolOutput:tt,addToolResult:Qe,addToolApprovalResponse:$e,clearHistory:()=>{He(),t.send(JSON.stringify({type:`cf_agent_chat_clear`}))},setMessages:e=>{let n;n=typeof e==`function`?e(je.current):e,n.length===0&&Pe(),ue(n),t.send(JSON.stringify({messages:n,type:`cf_agent_chat_messages`}))}}}function rm(e){return e?{headers:{Authorization:`Bearer ${e}`},protocols:[`bearer`,e]}:{}}function im(e){let{enabled:t,host:n,agentName:r,actorId:i,name:a,sub:o,authToken:s,onError:c,onOpen:l,onClose:u}=e;return mt({enabled:t,host:n,agent:r,name:i?`${i}:${a}`:a,sub:o,onOpen:l,onClose:u,onError:c,...rm(s)})}function am(e){let{toolContext:t,welcomeMessage:n,...r}=e,i=im({...r,enabled:r.enabled??!!r.name}),a=i.state?.status??`connecting`,o=nm({agent:i,body:t??{},getInitialMessages:r.name&&a===`connected`?void 0:null}),s=(0,I.useRef)(!1);(0,I.useEffect)(()=>{n&&a===`connected`&&o.messages.length===0&&!s.current&&(s.current=!0,o.setMessages([{id:`welcome-message`,role:`assistant`,parts:[{type:`text`,text:n}]}]))},[a,o.messages.length,n]);async function c(e,t,n){return i.call(`rateMessage`,[e,t,n])}async function l(){return i.call(`getMessageRatings`)}return{status:a,agent:i,chat:o,rateMessage:c,getMessageRatings:l}}function nee(e){let{toolContext:t,welcomeMessage:n,...r}=e,[i,a]=(0,I.useState)(),o=im(r),s=async()=>(await o.call(`getChats`)).map(e=>{let t={...e,chatId:e.durable_object_name};return delete t.durable_object_name,t}),c=async()=>{let e=await o.call(`createChat`);return a(e),await s(),e},l=e=>{a(e)},u=async e=>{await o.call(`deleteChat`,[e]),a(void 0),await s()},d=!!i&&o.state?.status===`connected`,f=am({...r,enabled:!!i,sub:i?[{agent:o.state?.subAgentName??``,name:i}]:void 0,getInitialMessages:d?void 0:null,toolContext:t,welcomeMessage:n});return{currentChatName:i,status:(i?f.agent.state?.status:o.state?.status)??`connecting`,assistant:{getChats:s,createChat:c,openChat:l,deleteChat:u},chat:f}}function om({status:e,chatKey:t,rateMessage:n,getMessageRatings:r}){let[i,a]=(0,I.useState)({}),o=(0,I.useRef)(n),s=(0,I.useRef)(r);o.current=n,s.current=r;let c=(0,I.useCallback)(()=>{s.current().then(e=>a(e??{})).catch(()=>{})},[]);return(0,I.useEffect)(()=>{e===`connected`?c():a({})},[e,t,c]),{ratings:i,onRate:(0,I.useCallback)((e,t,n)=>{a(r=>({...r,[e]:{rating:t,comment:n}})),Promise.resolve(o.current(e,t,n)).catch(()=>c())},[c])}}function sm(){return typeof window<`u`}function cm(e){return dm(e)?(e.nodeName||``).toLowerCase():`#document`}function lm(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function um(e){return((dm(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function dm(e){return sm()?e instanceof Node||e instanceof lm(e).Node:!1}function fm(e){return sm()?e instanceof Element||e instanceof lm(e).Element:!1}function pm(e){return sm()?e instanceof HTMLElement||e instanceof lm(e).HTMLElement:!1}function mm(e){return!sm()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof lm(e).ShadowRoot}function hm(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Cm(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ree(e){return/^(table|td|th)$/.test(cm(e))}function gm(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var iee=/transform|translate|scale|rotate|perspective|filter/,aee=/paint|layout|strict|content/,_m=e=>!!e&&e!==`none`,vm;function ym(e){let t=fm(e)?Cm(e):e;return _m(t.transform)||_m(t.translate)||_m(t.scale)||_m(t.rotate)||_m(t.perspective)||!xm()&&(_m(t.backdropFilter)||_m(t.filter))||iee.test(t.willChange||``)||aee.test(t.contain||``)}function bm(e){let t=Tm(e);for(;pm(t)&&!Sm(t);){if(ym(t))return t;if(gm(t))return null;t=Tm(t)}return null}function xm(){return vm??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),vm}function Sm(e){return/^(html|body|#document)$/.test(cm(e))}function Cm(e){return lm(e).getComputedStyle(e)}function wm(e){return fm(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Tm(e){if(cm(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||mm(e)&&e.host||um(e);return mm(t)?t.host:t}function Em(e){let t=Tm(e);return Sm(t)?e.ownerDocument?e.ownerDocument.body:e.body:pm(t)&&hm(t)?t:Em(t)}function Dm(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Em(e),i=r===e.ownerDocument?.body,a=lm(r);if(i){let e=Om(a);return t.concat(a,a.visualViewport||[],hm(r)?r:[],e&&n?Dm(e):[])}else return t.concat(r,Dm(r,[],n))}function Om(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var km={};function Am(e,t){let n=I.useRef(km);return n.current===km&&(n.current=e(t)),n}var jm=I[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Mm=jm&&jm!==I.useLayoutEffect?jm:e=>e();function Nm(e){let t=Am(Pm).current;return t.next=e,Mm(t.effect),t.trampoline}function Pm(){let e={next:void 0,callback:Fm,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Fm(){}var Im={...I},Lm=typeof document<`u`?I.useLayoutEffect:()=>{};function Rm(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var zm={};function Bm(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Vm(t);let a=Vm(e);return t&&(a=Hm(a,t)),n&&(a=Hm(a,n)),r&&(a=Hm(a,r)),i&&(a=Hm(a,i)),a}function oee(e){if(e.length===0)return zm;if(e.length===1)return Vm(e[0]);let t=Vm(e[0]);for(let n=1;n<e.length;n+=1)t=Hm(t,e[n]);return t}function Vm(e){return Km(e)?{...qm(e,zm)}:Um(e)}function Hm(e,t){return Km(t)?qm(t,e):Wm(e,t)}function Um(e){let t={...e};for(let e in t){let n=t[e];Gm(e,n)&&(t[e]=Ym(n))}return t}function Wm(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Rm(e.style,r);break;case`className`:e[n]=Zm(e.className,r);break;default:Gm(n,r)?e[n]=Jm(e[n],r):e[n]=r}}return e}function Gm(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 Km(e){return typeof e==`function`}function qm(e,t){return Km(e)?e(t):e??zm}function Jm(e,t){return t?e?(...n)=>{let r=n[0];if(Qm(r)){let i=r;Xm(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Ym(t):e}function Ym(e){return e&&((...t)=>{let n=t[0];return Qm(n)&&Xm(n),e(...t)})}function Xm(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Zm(e,t){return t?e?t+` `+e:t:e}function Qm(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function $m(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 eh=$m(`https://base-ui.com/production-error`,`Base UI`),th=I.createContext(void 0);function see(e=!1){let t=I.useContext(th);if(t===void 0&&!e)throw Error(eh(16));return t}function cee(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:I.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 nh(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=I.useRef(null),s=see(!0),c=a??s!==void 0,{props:l}=cee({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=I.useCallback(()=>{let e=o.current;rh(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Lm(u,[u]),{getButtonProps:I.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Bm({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Xm(e),o?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,a=e.currentTarget,s=rh(a),l=!i&&lee(a),u=r&&(i?s:!l),d=e.key===`Enter`,f=e.key===` `,p=a.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(r&&c&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),l||i&&s?(a.click(),e.preventBaseUIHandler()):u&&(n?.(e),e.preventBaseUIHandler());return}u&&(!i&&(f||d)&&e.preventDefault(),!i&&d&&n?.(e))},onKeyUp(e){if(!t){if(Xm(e),a?.(e),e.target===e.currentTarget&&i&&c&&rh(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&e.key===` `&&n?.(e)}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?void 0:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Nm(e=>{o.current=e,u()})}}function rh(e){return pm(e)&&e.tagName===`BUTTON`}function lee(e){return!!(e?.tagName===`A`&&e?.href)}function ih(e,t,n,r){let i=Am(ah).current;return dee(i,e,t,n,r)&&oh(i,[e,t,n,r]),i.callback}function uee(e){let t=Am(ah).current;return fee(t,e)&&oh(t,e),t.callback}function ah(){return{callback:null,cleanup:null,refs:[]}}function dee(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function fee(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function oh(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;break;default:}}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;break;default:}}}}}}var pee=19;function sh(e){return pee>=e}function ch(e){if(!I.isValidElement(e))return null;let t=e,n=t.props;return(sh(19)?n?.ref:t.ref)??null}function lh(){}Object.freeze([]);var uh=Object.freeze({});function dh(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 fh(e,t){return typeof e==`function`?e(t):e}function ph(e,t){return typeof e==`function`?e(t):e}function mh(e,t,n={}){let r=t.render,i=hh(t,n);return n.enabled===!1?null:vh(e,r,i,n.state??uh)}function hh(e,t={}){let{className:n,style:r,render:i}=e,{state:a=uh,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?fh(n,a):void 0,d=l?ph(r,a):void 0,f=l?dh(a,c):uh,p=l&&s?gh(s):void 0,m=l?Rm(f,p)??{}:uh;return typeof document<`u`&&(l?Array.isArray(o)?m.ref=uee([m.ref,ch(i),...o]):m.ref=ih(m.ref,ch(i),o):ih(null,null)),l?(u!==void 0&&(m.className=Zm(m.className,u)),d!==void 0&&(m.style=Rm(m.style,d)),m):uh}function gh(e){return Array.isArray(e)?oee(e):Bm(void 0,e)}var _h=Symbol.for(`react.lazy`);function vh(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Bm(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===_h&&(i=I.Children.toArray(t)[0]),I.cloneElement(i,e)}if(e&&typeof e==`string`)return yh(e,n);throw Error(eh(8))}function yh(e,t){return e===`button`?(0,I.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,I.createElement)(`img`,{alt:``,...t,key:t.key}):I.createElement(e,t)}var bh=I.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}=nh({disabled:i,focusableWhenDisabled:a,native:o});return mh(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function xh(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=xh(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Sh(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xh(e))&&(r&&(r+=` `),r+=t);return r}var Ch=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,wh=Sh,Th=(e,t)=>n=>{if(t?.variants==null)return wh(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Ch(t)||Ch(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return wh(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Eh=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Dh=(e,t)=>({classGroupId:e,validator:t}),Oh=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),kh=`-`,Ah=[],jh=`arbitrary..`,Mh=e=>{let t=Fh(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Ph(e);let n=e.split(kh);return Nh(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Eh(i,t):t:i||Ah}return n[e]||Ah}}},Nh=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Nh(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(kh):e.slice(t).join(kh),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Ph=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?jh+r:void 0})(),Fh=e=>{let{theme:t,classGroups:n}=e;return Ih(n,t)},Ih=(e,t)=>{let n=Oh();for(let r in e){let i=e[r];Lh(i,n,r,t)}return n},Lh=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Rh(i,t,n,r)}},Rh=(e,t,n,r)=>{if(typeof e==`string`){zh(e,t,n);return}if(typeof e==`function`){Bh(e,t,n,r);return}mee(e,t,n,r)},zh=(e,t,n)=>{let r=e===``?t:Vh(t,e);r.classGroupId=n},Bh=(e,t,n,r)=>{if(hee(e)){Lh(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Dh(n,e))},mee=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Lh(o,Vh(t,a),n,r)}},Vh=(e,t)=>{let n=e,r=t.split(kh),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Oh(),n.nextPart.set(t,i)),n=i}return n},hee=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,gee=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Hh=`!`,Uh=`:`,_ee=[],Wh=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),vee=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Uh){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Hh)?(c=s.slice(0,-1),l=!0):s.startsWith(Hh)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Wh(t,l,c,u)};if(t){let e=t+Uh,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Wh(_ee,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},yee=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},bee=e=>({cache:gee(e.cacheSize),parseClassName:vee(e),sortModifiers:yee(e),postfixLookupClassGroupIds:xee(e),...Mh(e)}),xee=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},See=/\s+/,Cee=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(See),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Hh:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},wee=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Gh(n))&&(i&&(i+=` `),i+=r);return i},Gh=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Gh(e[r]))&&(n&&(n+=` `),n+=t);return n},Tee=(e,...t)=>{let n,r,i,a,o=o=>(n=bee(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Cee(e,n);return i(e,a),a};return a=o,(...e)=>a(wee(...e))},Eee=[],Kh=e=>{let t=t=>t[e]||Eee;return t.isThemeGetter=!0,t},qh=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Jh=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Dee=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Oee=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kee=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Aee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jee=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Mee=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yh=e=>Dee.test(e),Xh=e=>!!e&&!Number.isNaN(Number(e)),Zh=e=>!!e&&Number.isInteger(Number(e)),Qh=e=>e.endsWith(`%`)&&Xh(e.slice(0,-1)),$h=e=>Oee.test(e),eg=()=>!0,Nee=e=>kee.test(e)&&!Aee.test(e),tg=()=>!1,ng=e=>jee.test(e),rg=e=>Mee.test(e),ig=e=>!sg(e)&&!hg(e),ag=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),og=e=>Cg(e,Dg,tg),sg=e=>qh.test(e),cg=e=>Cg(e,Og,Nee),lg=e=>Cg(e,kg,Xh),ug=e=>Cg(e,jg,eg),dg=e=>Cg(e,Ag,tg),fg=e=>Cg(e,Tg,tg),pg=e=>Cg(e,Eg,rg),mg=e=>Cg(e,Mg,ng),hg=e=>Jh.test(e),gg=e=>wg(e,Og),_g=e=>wg(e,Ag),vg=e=>wg(e,Tg),yg=e=>wg(e,Dg),bg=e=>wg(e,Eg),xg=e=>wg(e,Mg,!0),Sg=e=>wg(e,jg,!0),Cg=(e,t,n)=>{let r=qh.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},wg=(e,t,n=!1)=>{let r=Jh.exec(e);return r?r[1]?t(r[1]):n:!1},Tg=e=>e===`position`||e===`percentage`,Eg=e=>e===`image`||e===`url`,Dg=e=>e===`length`||e===`size`||e===`bg-size`,Og=e=>e===`length`,kg=e=>e===`number`,Ag=e=>e===`family-name`,jg=e=>e===`number`||e===`weight`,Mg=e=>e===`shadow`,Ng=Tee(()=>{let e=Kh(`color`),t=Kh(`font`),n=Kh(`text`),r=Kh(`font-weight`),i=Kh(`tracking`),a=Kh(`leading`),o=Kh(`breakpoint`),s=Kh(`container`),c=Kh(`spacing`),l=Kh(`radius`),u=Kh(`shadow`),d=Kh(`inset-shadow`),f=Kh(`text-shadow`),p=Kh(`drop-shadow`),m=Kh(`blur`),h=Kh(`perspective`),g=Kh(`aspect`),_=Kh(`ease`),v=Kh(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),hg,sg],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[hg,sg,c],T=()=>[Yh,`full`,`auto`,...w()],E=()=>[Zh,`none`,`subgrid`,hg,sg],D=()=>[`auto`,{span:[`full`,Zh,hg,sg]},Zh,hg,sg],O=()=>[Zh,`auto`,hg,sg],k=()=>[`auto`,`min`,`max`,`fr`,hg,sg],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Yh,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Yh,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ee=()=>[Yh,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],F=()=>[e,hg,sg],te=()=>[...b(),vg,fg,{position:[hg,sg]}],ne=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],re=()=>[`auto`,`cover`,`contain`,yg,og,{size:[hg,sg]}],ie=()=>[Qh,gg,cg],ae=()=>[``,`none`,`full`,l,hg,sg],oe=()=>[``,Xh,gg,cg],se=()=>[`solid`,`dashed`,`dotted`,`double`],ce=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],le=()=>[Xh,Qh,vg,fg],ue=()=>[``,`none`,m,hg,sg],de=()=>[`none`,Xh,hg,sg],fe=()=>[`none`,Xh,hg,sg],pe=()=>[Xh,hg,sg],me=()=>[Yh,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[$h],breakpoint:[$h],color:[eg],container:[$h],"drop-shadow":[$h],ease:[`in`,`out`,`in-out`],font:[ig],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[$h],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[$h],shadow:[$h],spacing:[`px`,Xh],text:[$h],"text-shadow":[$h],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Yh,sg,hg,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,hg,sg]}],"container-named":[ag],columns:[{columns:[Xh,sg,hg,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Zh,`auto`,hg,sg]}],basis:[{basis:[Yh,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Xh,Yh,`auto`,`initial`,`none`,sg]}],grow:[{grow:[``,Xh,hg,sg]}],shrink:[{shrink:[``,Xh,hg,sg]}],order:[{order:[Zh,`first`,`last`,`none`,hg,sg]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...ee()]}],"min-block-size":[{"min-block":[`auto`,...ee()]}],"max-block-size":[{"max-block":[`none`,...ee()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,gg,cg]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Sg,ug]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Qh,sg]}],"font-family":[{font:[_g,dg,t]}],"font-features":[{"font-features":[sg]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,hg,sg]}],"line-clamp":[{"line-clamp":[Xh,`none`,hg,lg]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,hg,sg]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,hg,sg]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...se(),`wavy`]}],"text-decoration-thickness":[{decoration:[Xh,`from-font`,`auto`,hg,cg]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[Xh,`auto`,hg,sg]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Zh,hg,sg]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,hg,sg]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,hg,sg]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:te()}],"bg-repeat":[{bg:ne()}],"bg-size":[{bg:re()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Zh,hg,sg],radial:[``,hg,sg],conic:[Zh,hg,sg]},bg,pg]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...se(),`hidden`,`none`]}],"divide-style":[{divide:[...se(),`hidden`,`none`]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...se(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Xh,hg,sg]}],"outline-w":[{outline:[``,Xh,gg,cg]}],"outline-color":[{outline:F()}],shadow:[{shadow:[``,`none`,u,xg,mg]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":[`none`,d,xg,mg]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:oe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[Xh,cg]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":[`none`,f,xg,mg]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[Xh,hg,sg]}],"mix-blend":[{"mix-blend":[...ce(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Xh]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[hg,sg]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Xh]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:te()}],"mask-repeat":[{mask:ne()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,hg,sg]}],filter:[{filter:[``,`none`,hg,sg]}],blur:[{blur:ue()}],brightness:[{brightness:[Xh,hg,sg]}],contrast:[{contrast:[Xh,hg,sg]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,xg,mg]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:[``,Xh,hg,sg]}],"hue-rotate":[{"hue-rotate":[Xh,hg,sg]}],invert:[{invert:[``,Xh,hg,sg]}],saturate:[{saturate:[Xh,hg,sg]}],sepia:[{sepia:[``,Xh,hg,sg]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,hg,sg]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[Xh,hg,sg]}],"backdrop-contrast":[{"backdrop-contrast":[Xh,hg,sg]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Xh,hg,sg]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xh,hg,sg]}],"backdrop-invert":[{"backdrop-invert":[``,Xh,hg,sg]}],"backdrop-opacity":[{"backdrop-opacity":[Xh,hg,sg]}],"backdrop-saturate":[{"backdrop-saturate":[Xh,hg,sg]}],"backdrop-sepia":[{"backdrop-sepia":[``,Xh,hg,sg]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,hg,sg]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Xh,`initial`,hg,sg]}],ease:[{ease:[`linear`,`initial`,_,hg,sg]}],delay:[{delay:[Xh,hg,sg]}],animate:[{animate:[`none`,v,hg,sg]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,hg,sg]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":[`scale-3d`],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[hg,sg,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":[`translate-none`],zoom:[{zoom:[Zh,hg,sg]}],accent:[{accent:F()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,hg,sg]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":F()}],"scrollbar-track-color":[{"scrollbar-track":F()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,hg,sg]}],fill:[{fill:[`none`,...F()]}],"stroke-w":[{stroke:[Xh,gg,cg,lg]}],stroke:[{stroke:[`none`,...F()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Pg(...e){return Ng(Sh(e))}var Fg=i((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})),Ig=i(((e,t)=>{t.exports=Fg()})),U=Ig(),Lg=Th(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Rg({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,U.jsx)(bh,{"data-slot":`button`,className:Pg(Lg({variant:t,size:n,className:e})),...r})}var zg=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Bg=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Vg=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Hg=e=>{let t=Vg(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ug={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Wg=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Gg=(0,I.createContext)({}),Kg=()=>(0,I.useContext)(Gg),qg=(0,I.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Kg()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,I.createElement)(`svg`,{ref:c,...Ug,width:t??l??Ug.width,height:t??l??Ug.height,stroke:e??f,strokeWidth:m,className:zg(`lucide`,p,i),...!a&&!Wg(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,I.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Jg=(e,t)=>{let n=(0,I.forwardRef)(({className:n,...r},i)=>(0,I.createElement)(qg,{ref:i,iconNode:t,className:zg(`lucide-${Bg(Hg(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Hg(e),n},Yg=Jg(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Xg=Jg(`book`,[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}]]),Zg=Jg(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),Qg=Jg(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),$g=Jg(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),e_=Jg(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),t_=Jg(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),n_=Jg(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),r_=Jg(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),i_=Jg(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),a_=Jg(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),o_=Jg(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Pee=Jg(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Fee=Jg(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Iee=Jg(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),s_=Jg(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),Lee=Jg(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),Ree=Jg(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),zee=Jg(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Bee=Jg(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),c_=Jg(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Vee=Jg(`thumbs-down`,[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]),Hee=Jg(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]),Uee=Jg(`trash`,[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Wee=Jg(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),l_=Jg(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Gee={damping:.7,stiffness:.05,mass:1.25},Kee=70,qee=1e3/60,Jee=350,u_=!1;globalThis.document?.addEventListener(`mousedown`,()=>{u_=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{u_=!1}),globalThis.document?.addEventListener(`click`,()=>{u_=!1});var Yee=(e={})=>{let[t,n]=(0,I.useState)(!1),[r,i]=(0,I.useState)(e.initial!==!1),[a,o]=(0,I.useState)(!1),s=(0,I.useRef)(null);s.current=e;let c=(0,I.useCallback)(()=>{if(!u_)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(g.current)||g.current?.contains(t.commonAncestorContainer)},[]),l=(0,I.useCallback)(e=>{d.isAtBottom=e,i(e)},[]),u=(0,I.useCallback)(e=>{d.escapedFromLock=e,n(e)},[]),d=(0,I.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(e){if(g.current){let{scrollBehavior:t}=getComputedStyle(g.current);t!==`auto`&&(g.current.style.scrollBehavior=`auto`),g.current.scrollTop=e,d.ignoreScrollToTop=g.current.scrollTop,t!==`auto`&&(g.current.style.scrollBehavior=t)}},get targetScrollTop(){return!g.current||!_.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!_.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let r=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:g.current,contentElement:_.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:r},requestAnimationFrame(()=>{n=void 0}),r},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Kee}}},[]),f=(0,I.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=p_(s.current,e.animation),{ignoreEscapes:r=!1}=e,i,a=d.calculatedTargetScrollTop;e.duration instanceof Promise?e.duration.finally(()=>{i=Date.now()}):i=t+(e.duration??0);let o=async()=>{let e=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;let{scrollTop:l}=d,u=performance.now(),p=(u-(d.lastTick??u))/qee;if(d.animation||={behavior:n,promise:e,ignoreEscapes:r},d.animation.behavior===n&&(d.lastTick=u),c()||t>Date.now())return o();if(l<Math.min(a,d.calculatedTargetScrollTop)){if(d.animation?.behavior===n){if(n===`instant`)return d.scrollTop=d.calculatedTargetScrollTop,o();d.velocity=(n.damping*d.velocity+n.stiffness*d.scrollDifference)/n.mass,d.accumulated+=d.velocity*p,d.scrollTop+=d.accumulated,d.scrollTop!==l&&(d.accumulated=0)}return o()}return i>Date.now()?(a=d.calculatedTargetScrollTop,o()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:p_(s.current,s.current.resize),ignoreEscapes:r,duration:Math.max(0,i-Date.now())||void 0}):d.isAtBottom)});return e.then(e=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),e))};return e.wait!==!0&&(d.animation=void 0),d.animation?.behavior===n?d.animation.promise:o()},[l,c,d]),p=(0,I.useCallback)(()=>{u(!0),l(!1)},[u,l]),m=(0,I.useCallback)(({target:e})=>{if(e!==g.current)return;let{scrollTop:t,ignoreScrollToTop:n}=d,{lastScrollTop:r=t}=d;d.lastScrollTop=t,d.ignoreScrollToTop=void 0,n&&n>t&&(r=n),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||t===n)return;if(c()){u(!0),l(!1);return}let e=t>r,i=t<r;if(d.animation?.ignoreEscapes){d.scrollTop=r;return}i&&(u(!0),l(!1)),e&&u(!1),!d.escapedFromLock&&d.isNearBottom&&l(!0)},1)},[u,l,c,d]),h=(0,I.useCallback)(({target:e,deltaY:t})=>{let n=e;for(;![`scroll`,`auto`].includes(getComputedStyle(n).overflow);){if(!n.parentElement)return;n=n.parentElement}n===g.current&&t<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),l(!1))},[u,l,d]),g=d_(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=d_(e=>{if(d.resizeObserver?.disconnect(),!e)return;let t;d.resizeObserver=new ResizeObserver(([e])=>{let{height:n}=e.contentRect,r=n-(t??n);if(d.resizeDifference=r,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),r>=0){let e=p_(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:Jee})}else d.isNearBottom&&(u(!1),l(!0));t=n,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===r&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(e)},[]);return{contentRef:_,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:d}};function d_(e,t){let n=(0,I.useCallback)(t=>(n.current=t,e(t)),t);return n}var f_=new Map;function p_(...e){let t={...Gee},n=!1;for(let r of e){if(r===`instant`){n=!0;continue}typeof r==`object`&&(n=!1,t.damping=r.damping??t.damping,t.stiffness=r.stiffness??t.stiffness,t.mass=r.mass??t.mass)}let r=JSON.stringify(t);return f_.has(r)||f_.set(r,Object.freeze(t)),n?`instant`:f_.get(r)}var m_=(0,I.createContext)(null),Xee=typeof window<`u`?I.useLayoutEffect:I.useEffect;function h_({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:o,targetScrollTop:s,contextRef:c,...l}){let u=(0,I.useRef)(null),d=Yee({mass:i,damping:a,stiffness:o,resize:n,initial:r,targetScrollTop:I.useCallback((e,t)=>(y?.targetScrollTop??s)?.(e,t)??e,[s])}),{scrollRef:f,contentRef:p,scrollToBottom:m,stopScroll:h,isAtBottom:g,escapedFromLock:_,state:v}=e??d,y=(0,I.useMemo)(()=>({scrollToBottom:m,stopScroll:h,scrollRef:f,isAtBottom:g,escapedFromLock:_,contentRef:p,state:v,get targetScrollTop(){return u.current},set targetScrollTop(e){u.current=e}}),[m,g,p,f,h,_,v]);return(0,I.useImperativeHandle)(c,()=>y,[y]),Xee(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),I.createElement(m_.Provider,{value:y},I.createElement(`div`,{...l},typeof t==`function`?t(y):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=g_();return I.createElement(`div`,{ref:r.scrollRef,style:{height:`100%`,width:`100%`,scrollbarGutter:`stable both-edges`},className:t},I.createElement(`div`,{...n,ref:r.contentRef},typeof e==`function`?e(r):e))}e.Content=t})(h_||={});function g_(){let e=(0,I.useContext)(m_);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}var Zee=({className:e,...t})=>(0,U.jsx)(h_,{className:Pg(`relative flex-1 overflow-y-hidden`,e),initial:`smooth`,resize:`smooth`,role:`log`,...t}),Qee=({className:e,...t})=>(0,U.jsx)(h_.Content,{className:Pg(`flex flex-col gap-8 p-4`,e),...t}),$ee=({className:e,...t})=>{let{isAtBottom:n,scrollToBottom:r}=g_(),i=(0,I.useCallback)(()=>{r()},[r]);return!n&&(0,U.jsx)(Rg,{className:Pg(`absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted`,e),onClick:i,size:`icon`,type:`button`,variant:`outline`,...t,children:(0,U.jsx)(Yg,{className:`size-4`})})};function __(e){return mh(e.defaultTagName??`div`,e,e)}var ete=Th(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0`,vertical:`flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0`}},defaultVariants:{orientation:`horizontal`}});function tte({className:e,orientation:t,...n}){return(0,U.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:Pg(ete({orientation:t}),e),...n})}function nte({className:e,render:t,...n}){return __({defaultTagName:`div`,props:Bm({className:Pg(`flex items-center gap-2 rounded-lg border bg-muted px-2.5 text-sm font-medium [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e)},n),render:t,state:{slot:`button-group-text`}})}var v_=[],y_=void 0;function rte(){return y_}function ite(e){v_.push(e)}function b_(e){let t=(t,n)=>{let r=Am(ote).current,i;try{y_=r;for(let e of v_)e.before(r);i=e(t,n);for(let e of v_)e.after(r);r.didInitialize=!0}finally{y_=void 0}return i};return t.displayName=e.displayName||e.name,t}function ate(e){return I.forwardRef(b_(e))}function ote(){return{didInitialize:!1}}function x_(e){let t=I.useRef(!0);t.current&&(t.current=!1,e())}var S_=I.createContext(void 0);function C_(e){let t=I.useContext(S_);if(t===void 0&&!e)throw Error(eh(72));return t}var ste=[];function w_(e){I.useEffect(e,ste)}var T_=0,E_=class e{static create(){return new e}currentId=T_;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=T_,t()},e)}isStarted(){return this.currentId!==T_}clear=()=>{this.currentId!==T_&&(clearTimeout(this.currentId),this.currentId=T_)};disposeEffect=()=>this.clear};function D_(){let e=Am(E_.create).current;return w_(e.disposeEffect),e}var O_=typeof navigator<`u`,k_=lte(),A_=dte(),j_=ute(),M_=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),N_=k_.platform===`MacIntel`&&k_.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(k_.platform);O_&&/firefox/i.test(j_);var P_=O_&&/apple/i.test(navigator.vendor);O_&&/Edg/i.test(j_);var F_=O_&&/android/i.test(A_)||/android/i.test(j_),cte=O_&&A_.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,I_=j_.includes(`jsdom/`);function lte(){if(!O_)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function ute(){if(!O_)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function dte(){if(!O_)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}function fte(e){e.preventDefault(),e.stopPropagation()}function pte(e){return`nativeEvent`in e}function mte(e){return e.pointerType===``&&e.isTrusted?!0:F_&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function hte(e){return I_?!1:!F_&&e.width===0&&e.height===0||F_&&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 L_(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function R_(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function gte(e,t){return t!=null&&!L_(t)?0:typeof e==`function`?e():e}function z_(e,t,n){let r=gte(e,n);return typeof r==`number`?r:r?.[t]}function B_(e){return typeof e==`function`?e():e}function V_(e,t){return t||e===`click`||e===`mousedown`}var H_=`none`,U_=`trigger-press`,W_=`trigger-hover`,G_=`trigger-focus`,K_=`outside-press`,q_=`close-press`,J_=`focus-out`,Y_=`escape-key`,X_=`disabled`,Z_=`imperative-action`;function Q_(e,t,n,r){let i=!1,a=!1,o=r??uh;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}}var $_=I.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new E_,currentIdRef:{current:null},currentContextRef:{current:null}});function ev(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=I.useRef(n),a=I.useRef(n),o=I.useRef(null),s=I.useRef(null),c=D_();return(0,U.jsx)($_.Provider,{value:I.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function tv(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{open:i}=t,{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=I.useContext($_),[f,p]=I.useState(!1);return Lm(()=>{function e(){p(!1),l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current}if(a.current&&!i&&a.current===r){if(p(!1),s){let t=r;return d.start(s,()=>{n.select(`open`)||a.current&&a.current!==t||e()}),()=>{d.clear()}}e()}},[i,r,a,o,s,c,l,d,n]),Lm(()=>{if(!i)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:n.setOpen,setIsInstantPhase:p},a.current=r,o.current={open:0,close:z_(c.current,`close`)},t!==null&&t!==r?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Q_(H_))):(p(!1),e?.setIsInstantPhase(!1))},[i,r,n,a,o,s,c,l,d]),Lm(()=>()=>{l.current=null},[l]),I.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function nv(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function rv(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function iv(e){let t=Am(av,e).current;return t.next=e,Lm(t.effect),t}function av(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var ov=null;globalThis.requestAnimationFrame;var sv=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.callbacksCount)}},cv=class e{static create(){return new e}static request(e){return sv.request(e)}static cancel(e){return sv.cancel(e)}currentId=ov;request(e){this.cancel(),this.currentId=sv.request(()=>{this.currentId=ov,e()})}cancel=()=>{this.currentId!==ov&&(sv.cancel(this.currentId),this.currentId=ov)};disposeEffect=()=>this.cancel};function lv(){let e=Am(cv.create).current;return w_(e.disposeEffect),e}function uv(e){return e?.ownerDocument||document}var dv={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},fv={...dv,position:`fixed`,top:0,left:0},pv={...dv,position:`absolute`},mv=I.forwardRef(function(e,t){let[n,r]=I.useState();Lm(()=>{P_&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,U.jsx)(`span`,{...e,ref:t,style:fv,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})}),hv=`data-base-ui-focusable`,gv=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function _v(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function vv(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&mm(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function yv(e){return`composedPath`in e?e.composedPath()[0]:e.target}function bv(e,t){if(!fm(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(vv(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function xv(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 Sv(e){return e.matches(`html,body`)}function Cv(e){return pm(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function wv(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${gv}`)!=null}function Tv(e){return e?e.getAttribute(`role`)===`combobox`&&Cv(e):!1}function Ev(e){if(!e||I_)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Dv(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}var Ov=[`top`,`right`,`bottom`,`left`],kv=Math.min,Av=Math.max,jv=Math.round,Mv=Math.floor,Nv=e=>({x:e,y:e}),Pv={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Fv(e,t,n){return Av(e,kv(t,n))}function Iv(e,t){return typeof e==`function`?e(t):e}function Lv(e){return e.split(`-`)[0]}function Rv(e){return e.split(`-`)[1]}function zv(e){return e===`x`?`y`:`x`}function Bv(e){return e===`y`?`height`:`width`}function Vv(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Hv(e){return zv(Vv(e))}function Uv(e,t,n){n===void 0&&(n=!1);let r=Rv(e),i=Hv(e),a=Bv(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Qv(o)),[o,Qv(o)]}function Wv(e){let t=Qv(e);return[Gv(e),t,Gv(t)]}function Gv(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Kv=[`left`,`right`],qv=[`right`,`left`],Jv=[`top`,`bottom`],Yv=[`bottom`,`top`];function Xv(e,t,n){switch(e){case`top`:case`bottom`:return n?t?qv:Kv:t?Kv:qv;case`left`:case`right`:return t?Jv:Yv;default:return[]}}function Zv(e,t,n,r){let i=Rv(e),a=Xv(Lv(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Gv)))),a}function Qv(e){let t=Lv(e);return Pv[t]+e.slice(t.length)}function $v(e){return{top:0,right:0,bottom:0,left:0,...e}}function ey(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:$v(e)}function ty(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 ny(e){return e.visibility===`hidden`||e.visibility===`collapse`}function ry(e,t=e?Cm(e):null){return!e||!e.isConnected||!t||ny(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var iy=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function ay(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return mm(n)?n.host:null}function oy(e){for(let t of Array.from(e.children))if(cm(t)===`summary`)return t;return null}function sy(e,t){let n=oy(t);return!!n&&(e===n||vv(n,e))}function cy(e){let t=e?cm(e):``;return e!=null&&e.matches(iy)&&(t!==`summary`||e.parentElement!=null&&cm(e.parentElement)===`details`&&oy(e.parentElement)===e)&&(t!==`details`||oy(e)==null)&&(t!==`input`||e.type!==`hidden`)}function ly(e){if(!cy(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=ay(t)){let n=t!==e,r=cm(t)===`slot`;if(t.hasAttribute(`inert`)||n&&cm(t)===`details`&&!t.open&&!sy(e,t)||t.hasAttribute(`hidden`)||!r&&!uy(t,n))return!1}return!0}function uy(e,t){let n=Cm(e);return t?n.display!==`none`:ry(e,n)}function dy(e){let t=e.tabIndex;if(t<0){let t=cm(e);if(t===`details`||t===`audio`||t===`video`||pm(e)&&e.isContentEditable)return 0}return t}function fy(e){if(cm(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function py(e,t){let n=fy(e);if(!n)return!0;let r=t.find(e=>{let t=fy(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=fy(e);return t?.name===n.name&&t.form===n.form})===n}function my(e){if(pm(e)&&cm(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return pm(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function hy(e,t){my(e).forEach(e=>{cy(e)&&t.push(e),hy(e,t)})}function gy(e,t,n){my(e).forEach(e=>{pm(e)&&e.matches(t)&&n.push(e),gy(e,t,n)})}function _y(e){return ly(e)&&dy(e)>=0}function vy(e){let t=[];return hy(e,t),t.filter(ly)}function yy(e){let t=vy(e);return t.filter(e=>dy(e)>=0&&py(e,t))}function by(e,t){let n=yy(e),r=n.length;if(r===0)return;let i=_v(uv(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function xy(e){return by(uv(e).body,1)||e}function Sy(e){return by(uv(e).body,-1)||e}function Cy(e,t){if(!e)return null;let n=yy(uv(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 _te(e){return Cy(e,1)}function vte(e){return Cy(e,-1)}function wy(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!vv(n,r)}function yte(e){yy(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Ty(e){let t=[];gy(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 Ey(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Ey(e,t.id,n)])}function Dy(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 Oy(e){return`data-base-ui-${e}`}var ky=0;function Ay(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(ky);let a=()=>e?.focus({preventScroll:n});if(i)return a(),lh;let o=requestAnimationFrame(a);return ky=o,()=>{ky===o&&(cancelAnimationFrame(o),ky=0)}}var jy={inert:new WeakMap,"aria-hidden":new WeakMap},My=`data-base-ui-inert`,Ny={inert:new WeakSet,"aria-hidden":new WeakSet},Py=new WeakMap,Fy=0;function bte(e){return Ny[e]}function Iy(e){return e?mm(e)?e.host:Iy(e.parentNode):null}var Ly=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Iy(t);return e.contains(n)?n:null}).filter(e=>e!=null),Ry=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},zy=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{cm(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function xte(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let o=r?`inert`:n?`aria-hidden`:null,s=null,c=null,l=Ly(t,e),u=i?Ly(t,a):[],d=new Set(u),f=i?zy(t,Ry(l),new Set(l)).filter(e=>!d.has(e)):[],p=[],m=[];if(o){let e=jy[o],n=bte(o);c=n,s=e;let r=Ly(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=l.concat(r);zy(t,Ry(i),new Set(i)).forEach(t=>{let r=t.getAttribute(o),i=r!==null&&r!==`false`,a=(e.get(t)||0)+1;e.set(t,a),p.push(t),a===1&&i&&n.add(t),i||t.setAttribute(o,o===`inert`?``:`true`)})}return i&&f.forEach(e=>{let t=(Py.get(e)||0)+1;Py.set(e,t),m.push(e),t===1&&e.setAttribute(My,``)}),Fy+=1,()=>{s&&p.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&o&&e.removeAttribute(o),c?.delete(e))}),i&&m.forEach(e=>{let t=(Py.get(e)||0)-1;Py.set(e,t),t||e.removeAttribute(My)}),--Fy,Fy||(jy.inert=new WeakMap,jy[`aria-hidden`]=new WeakMap,Ny.inert=new WeakSet,Ny[`aria-hidden`]=new WeakSet,Py=new WeakMap)}}function By(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,o=uv(e[0]).body;return xte(e,o,n,r,{mark:i,markerIgnoreElements:a})}var Vy=0;function Ste(e,t=`mui`){let[n,r]=I.useState(e),i=e||n;return I.useEffect(()=>{n??(Vy+=1,r(`${t}-${Vy}`))},[n,t]),i}var Hy=Im.useId;function Uy(e,t){if(Hy!==void 0){let n=Hy();return e??(t?`${t}-${n}`:n)}return Ste(e,t)}var Cte={style:{transition:`none`}},Wy=`data-base-ui-click-trigger`,Gy={fallbackAxisSide:`end`},wte={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Ky=e(Oe()),qy=I.createContext(null),Jy=()=>I.useContext(qy),Tte=Oy(`portal`);function Yy(e={}){let{ref:t,container:n,componentProps:r=uh,elementProps:i}=e,a=Uy(),o=Jy()?.portalNode,[s,c]=I.useState(null),[l,u]=I.useState(null),d=Nm(e=>{e!==null&&u(e)}),f=I.useRef(null);Lm(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}if(a==null)return;let e=(n&&(dm(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,a]);let p=mh(`div`,r,{ref:[t,d],props:[{id:a,[Tte]:``},i]});return{portalNode:l,portalSubtree:s&&p?Ky.createPortal(p,s):null}}var Xy=I.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,style:s,...c}=e,{portalNode:l,portalSubtree:u}=Yy({container:r,ref:t,componentProps:e,elementProps:c}),d=I.useRef(null),f=I.useRef(null),p=I.useRef(null),m=I.useRef(null),[h,g]=I.useState(null),_=I.useRef(!1),v=h?.modal,y=h?.open,b=typeof o==`boolean`?o:!!h&&!h.modal&&h.open&&!!l;I.useEffect(()=>{if(!l||v)return;function e(e){l&&e.relatedTarget&&wy(e)&&(e.type===`focusin`?_.current&&=(Ty(l),!1):(yte(l),_.current=!0))}return rv(nv(l,`focusin`,e,!0),nv(l,`focusout`,e,!0))},[l,v]),I.useEffect(()=>{!l||y!==!1||(Ty(l),_.current=!1)},[y,l]);let x=I.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:l,setFocusManagerState:g}),[l]);return(0,U.jsxs)(I.Fragment,{children:[u,(0,U.jsxs)(qy.Provider,{value:x,children:[b&&l&&(0,U.jsx)(mv,{"data-type":`outside`,ref:d,onFocus:e=>{wy(e,l)?p.current?.focus():Sy(h?h.domReference:null)?.focus()}}),b&&l&&(0,U.jsx)(`span`,{"aria-owns":l.id,style:wte}),l&&Ky.createPortal(n,l),b&&l&&(0,U.jsx)(mv,{"data-type":`outside`,ref:f,onFocus:e=>{wy(e,l)?m.current?.focus():(xy(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,Q_(`focus-out`,e.nativeEvent)))}})]})]})});function Zy(){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 Ete=class{nodesRef={current:[]};events=Zy();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)}},Qy=I.createContext(null),$y=I.createContext(null),eb=()=>I.useContext(Qy)?.id||null,tb=e=>{let t=I.useContext($y);return e??t};function Dte(e){let t=Uy(),n=tb(e),r=eb();return Lm(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Ote(e){let{children:t,id:n}=e,r=eb();return(0,U.jsx)(Qy.Provider,{value:I.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function kte(e){let{children:t,externalTree:n}=e,r=Am(()=>n??new Ete).current;return(0,U.jsx)($y.Provider,{value:r,children:t})}function nb(e){return e==null?e:`current`in e?e.current:e}function Ate(e,t){let n=lm(yv(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 rb=20,ib=[];function ab(){ib=ib.filter(e=>e.deref()?.isConnected)}function jte(e){ab(),e&&cm(e)!==`body`&&(ib.push(new WeakRef(e)),ib.length>rb&&(ib=ib.slice(-rb)))}function ob(){return ab(),ib[ib.length-1]?.deref()}function Mte(e){return e?_y(e)?e:yy(e)[0]||e:null}function sb(e,t){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=vy(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return _y(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),r=e.getAttribute(`tabindex`);t.current.includes(`floating`)||n.length===0?r!==`0`&&e.setAttribute(`tabindex`,`0`):(r!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function cb(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:b}=h.context,x=Nm(()=>b.current.floatingContext?.nodeId),S=i===!1,C=Tv(_)&&S,w=I.useRef([`content`]),T=iv(i),E=iv(a),D=iv(l),O=tb(p),k=Jy(),A=I.useRef(!1),j=I.useRef(!1),M=I.useRef(!1),N=I.useRef(null),P=I.useRef(``),ee=I.useRef(``),F=I.useRef(null),te=I.useRef(null),ne=ih(F,f,k?.beforeInsideRef),re=ih(te,k?.afterInsideRef),ie=D_(),ae=D_(),oe=lv(),se=k!=null,ce=Dv(v),le=Nm((e=ce)=>e?yy(e):[]),ue=Nm(()=>m?.().filter(e=>e!=null)??[]);I.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&vv(ce,_v(uv(ce)))&&le().length===0&&!C&&fte(e)}return nv(uv(ce),`keydown`,e)},[r,_,ce,s,w,C,le]),I.useEffect(()=>{if(r||!g)return;let e=uv(ce);function t(){M.current=!1}function n(e){let t=yv(e),n=ue();M.current=!(vv(v,t)||vv(_,t)||vv(k?.portalNode,t)||n.some(e=>e===t||vv(e,t))),ee.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(j.current=!0)}function i(){ee.current=`keyboard`}return rv(nv(e,`pointerdown`,n,!0),nv(e,`pointerup`,t,!0),nv(e,`pointercancel`,t,!0),nv(e,`keydown`,i,!0))},[r,v,_,ce,g,k,ue]),I.useEffect(()=>{if(r||!c)return;let e=uv(ce);function t(){j.current=!0,ae.start(0,()=>{j.current=!1})}function n(e){let t=yv(e);_y(t)&&(N.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=yv(t);queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=ue(),f=n?.hasAttribute(Oy(`focus-guard`))&&[F.current,te.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,nb(d),nb(u)].includes(n),p=!(vv(_,n)||vv(v,n)||vv(n,v)||vv(k?.portalNode,n)||l.some(e=>e===n||vv(e,n))||n!=null&&c.hasElement(n)||c.hasMatchingElement(e=>vv(e,n))||f||O&&(Ey(O.nodesRef.current,a).find(e=>vv(e.context?.elements.floating,n)||vv(e.context?.elements.domReference,n))||Dy(O.nodesRef.current,a).find(e=>[e.context?.elements.floating,Dv(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&ce&&sb(ce,w),o&&r!==_&&!ry(i)&&_v(e)===e.body){if(pm(ce)&&(ce.focus(),o===`popup`)){oe.request(()=>{ce.focus()});return}let e=le(),t=N.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||ce;pm(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!j.current&&(C||n!==ob())&&(A.current=!0,h.setOpen(!1,Q_(J_,t)))})}function a(){M.current||(b.current.insideReactTree=!0,ie.start(0,()=>{b.current.insideReactTree=!1}))}let l=pm(_)?_:null;if(!(!v&&!l))return rv(l&&nv(l,`focusout`,i),l&&nv(l,`pointerdown`,t),v&&nv(v,`focusin`,n),v&&nv(v,`focusout`,i),v&&k&&nv(v,`focusout`,a,!0))},[r,_,v,ce,s,O,k,h,c,o,le,C,x,w,b,ie,ae,oe,u,d,ue]),I.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(k?.portalNode?.querySelectorAll(`[${Oy(`portal`)}]`)||[]),t=(O?Dy(O.nodesRef.current,x()):[]).find(e=>Tv(e.context?.elements.domReference||null))?.context?.elements.domReference,n=By([v,...e,F.current,te.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...ue(),t,nb(d),nb(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=By([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,w,k,C,O,x,u,d,ue]),Lm(()=>{if(!g||r||!pm(ce))return;let e=_v(uv(ce));queueMicrotask(()=>{let t=T.current,n=typeof t==`function`?t(D.current||``):t;if(n===void 0||n===!1||vv(ce,e))return;let r=null,i=()=>(r??=le(ce),r[0]||ce),a;a=n===!0||n===null?i():nb(n),a||=i(),Ay(a,{preventScroll:a===ce})})},[r,g,ce,S,le,T,D]),Lm(()=>{if(r||!ce)return;let e=uv(ce);jte(_v(e));function t(e){if(e.open||(P.current=Ate(e.nativeEvent,ee.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(A.current=!0),e.reason===`outside-press`)if(e.nested)A.current=!1;else if(mte(e.nativeEvent)||hte(e.nativeEvent))A.current=!1;else{let e=!1;uv(ce).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?A.current=!1:A.current=!0}}y.on(`openchange`,t);function n(){let e=E.current,t=typeof e==`function`?e(P.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=_||ob();return e&&e.isConnected?e:null}let n=_||ob();return nb(t)||n||null}return()=>{y.off(`openchange`,t);let r=_v(e),i=ue(),a=vv(v,r)||i.some(e=>e===r||vv(e,r))||O&&Ey(O.nodesRef.current,x(),!1).some(e=>vv(e.context?.elements.floating,r)),o=E.current,s=n();queueMicrotask(()=>{let t=Mte(s),n=typeof o!=`boolean`;o&&!A.current&&pm(t)&&(!(!n&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),A.current=!1})}},[r,v,ce,E,b,y,O,_,x,ue]),Lm(()=>{if(!M_||g||!v)return;let e=_v(uv(v));!pm(e)||!Cv(e)||vv(v,e)&&e.blur()},[g,v]),Lm(()=>{if(!(r||!k))return k.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{k.setFocusManagerState(null)}},[r,k,s,g,h,c,_]),Lm(()=>{if(!(r||!ce))return sb(ce,w),()=>{queueMicrotask(ab)}},[r,ce,w]);let de=!r&&(s?!C:!0)&&(se||s);return(0,U.jsxs)(I.Fragment,{children:[de&&(0,U.jsx)(mv,{"data-type":`inside`,ref:ne,onFocus:e=>{if(s){let e=le();Ay(e[e.length-1])}else k?.portalNode&&(A.current=!1,wy(e,k.portalNode)?xy(_)?.focus():nb(d??k.beforeOutsideRef)?.focus())}}),n,de&&(0,U.jsx)(mv,{"data-type":`inside`,ref:re,onFocus:e=>{s?Ay(le()[0]):k?.portalNode&&(c&&(A.current=!0),wy(e,k.portalNode)?Sy(_)?.focus():nb(u??k.afterOutsideRef)?.focus())}})]})}function lb(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,{enabled:i=!0,event:a=`click`,toggle:o=!0,ignoreMouse:s=!1,stickIfOpen:c=!0,touchOpenDelay:l=0,reason:u=U_}=t,d=I.useRef(void 0),f=lv(),p=D_(),m=I.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){let t=d.current,i=e.nativeEvent,m=n.select(`open`);if(e.button!==0||a===`click`||L_(t,!0)&&s)return;let h=r.current.openEvent,g=h?.type,_=n.select(`domReferenceElement`)!==e.currentTarget,v=m&&_||!(m&&o&&(!(h&&c)||g===`click`||g===`mousedown`)),y=yv(i);if(Cv(y)){let e=Q_(u,i,y);v&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(v,e);return}let b=e.currentTarget;f.request(()=>{let e=Q_(u,i,b);v&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(v,e)})},onClick(e){if(a===`mousedown-only`)return;let t=d.current;if(a===`mousedown`&&t){d.current=void 0;return}if(L_(t,!0)&&s)return;let i=n.select(`open`),f=r.current.openEvent,m=n.select(`domReferenceElement`)!==e.currentTarget,h=i&&m||!(i&&o&&(!(f&&c)||R_(f))),g=Q_(u,e.nativeEvent,e.currentTarget);h&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,g)}):n.setOpen(h,g)},onKeyDown(){d.current=void 0}}),[r,a,s,n,c,o,f,p,l,u]);return I.useMemo(()=>i?{reference:m}:uh,[i,m])}function Nte(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 ub(e){return e!=null&&e.clientX!=null}function Pte(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`}=t,l=I.useRef(!1),u=I.useRef(null),[d,f]=I.useState(),[p,m]=I.useState([]),h=Nm((e,t,r)=>{l.current||o.current.openEvent&&!ub(o.current.openEvent)||n.set(`positionReference`,Nte(r??a,{x:e,y:t,axis:c,dataRef:o,pointerType:d}))}),g=Nm(e=>{r?u.current||m([]):h(e.clientX,e.clientY,e.currentTarget)}),_=L_(d)?i:r,v=I.useCallback(()=>{if(!_||!s)return;let e=lm(i);function t(e){vv(i,yv(e))?(u.current?.(),u.current=null):h(e.clientX,e.clientY)}if(!o.current.openEvent||ub(o.current.openEvent))return u.current=nv(e,`mousemove`,t),()=>{u.current?.(),u.current=null};n.set(`positionReference`,a)},[_,s,i,o,a,n,h]);I.useEffect(()=>v(),[v,p]),I.useEffect(()=>{s&&!i&&(l.current=!1)},[s,i]),I.useEffect(()=>{!s&&r&&(l.current=!0)},[s,r]);let y=I.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return I.useMemo(()=>s?{reference:y,trigger:y}:{},[s,y])}var Fte={intentional:`onClick`,sloppy:`onPointerDown`};function Ite(){return!1}function Lte(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function db(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),{dataRef:a}=n.context,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`sloppy`,referencePress:u=Ite,referencePressEvent:d=`sloppy`,bubbles:f,externalTree:p}=t,m=tb(p),h=Nm(typeof c==`function`?c:()=>!1),g=typeof c==`function`?h:c,_=g!==!1,v=Nm(()=>l),y=I.useRef(!1),b=I.useRef(!1),x=I.useRef(!1),{escapeKey:S,outsidePress:C}=Lte(f),w=I.useRef(null),T=D_(),E=D_(),D=Nm(()=>{E.clear(),a.current.insideReactTree=!1}),O=I.useRef(!1),k=I.useRef(``),A=Nm(u),j=Nm(e=>{if(!r||!o||!s||e.key!==`Escape`||O.current)return;let t=a.current.floatingContext?.nodeId,i=m?Ey(m.nodesRef.current,t):[];if(!S&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let c=Q_(Y_,pte(e)?e.nativeEvent:e);n.setOpen(!1,c),!S&&!c.isPropagationAllowed&&e.stopPropagation()}),M=Nm(()=>{a.current.insideReactTree=!0,E.start(0,D)});I.useEffect(()=>{if(!r||!o)return;a.current.__escapeKeyBubbles=S,a.current.__outsidePressBubbles=C;let e=new E_,t=new E_;function c(){e.clear(),O.current=!0}function l(){e.start(xm()?5:0,()=>{O.current=!1})}function u(){x.current=!0,t.start(0,()=>{x.current=!1})}function d(){y.current=!1,b.current=!1}function f(){let e=k.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=a.current.floatingContext?.nodeId,r=m&&Ey(m.nodesRef.current,t).some(t=>xv(e,t.context?.elements.floating));return xv(e,n.select(`floatingElement`))||xv(e,n.select(`domReferenceElement`))||r}function E(e){if(p(e)){D();return}if(a.current.insideReactTree){D();return}let r=yv(e),i=`[${Oy(`inert`)}]`,o=fm(r)?r.getRootNode():null,s=Array.from((mm(o)?o:uv(n.select(`floatingElement`))).querySelectorAll(i)),c=n.context.triggerElements;if(r&&(c.hasElement(r)||c.hasMatchingElement(e=>vv(e,r))))return;let l=fm(r)?r:null;for(;l&&!Sm(l);){let e=Tm(l);if(Sm(e)||!fm(e))break;l=e}if(s.length&&fm(r)&&!Sv(r)&&!vv(r,n.select(`floatingElement`))&&s.every(e=>!vv(l,e)))return;if(pm(r)&&!(`touches`in e)){let t=Sm(r),n=Cm(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}if(h(e))return;if(f()===`intentional`&&x.current){t.clear(),x.current=!1;return}if(typeof g==`function`&&!g(e))return;let u=a.current.floatingContext?.nodeId,d=m?Ey(m.nodesRef.current,u):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,Q_(K_,e)),D()}function A(e){f()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!o||xv(e,n.select(`floatingElement`))||xv(e,n.select(`domReferenceElement`))||E(e)}function M(e){if(f()!==`sloppy`||!n.select(`open`)||!o||xv(e,n.select(`floatingElement`))||xv(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(w.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{w.current&&(w.current.dismissOnTouchEnd=!1,w.current.dismissOnMouseDown=!1)}))}function N(e,t){let n=yv(e);if(!n)return;let r=nv(n,e.type,()=>{t(e),r()})}function P(e){k.current=`touch`,N(e,M)}function ee(e){T.clear(),e.type===`pointerdown`&&(k.current=e.pointerType),!(e.type===`mousedown`&&w.current&&!w.current.dismissOnMouseDown)&&N(e,e=>{e.type===`pointerdown`?A(e):E(e)})}function F(e){if(!y.current)return;let n=b.current;if(d(),f()===`intentional`){if(e.type===`pointercancel`){n&&u();return}if(!h(e)){if(n){u();return}typeof g==`function`&&!g(e)||(t.clear(),x.current=!0,D())}}}function te(e){if(f()!==`sloppy`||!w.current||xv(e,n.select(`floatingElement`))||xv(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-w.current.startX),i=Math.abs(t.clientY-w.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(w.current.dismissOnTouchEnd=!0),a>10&&(E(e),T.clear(),w.current=null)}function ne(e){N(e,te)}function re(e){f()!==`sloppy`||!w.current||xv(e,n.select(`floatingElement`))||xv(e,n.select(`domReferenceElement`))||(w.current.dismissOnTouchEnd&&E(e),T.clear(),w.current=null)}function ie(e){N(e,re)}let ae=uv(i),oe=rv(s&&rv(nv(ae,`keydown`,j),nv(ae,`compositionstart`,c),nv(ae,`compositionend`,l)),_&&rv(nv(ae,`click`,ee,!0),nv(ae,`pointerdown`,ee,!0),nv(ae,`pointerup`,F,!0),nv(ae,`pointercancel`,F,!0),nv(ae,`mousedown`,ee,!0),nv(ae,`mouseup`,F,!0),nv(ae,`touchstart`,P,!0),nv(ae,`touchmove`,ne,!0),nv(ae,`touchend`,ie,!0)));return()=>{oe(),e.clear(),t.clear(),d(),x.current=!1}},[a,i,s,_,g,r,o,S,C,j,D,v,m,n,T]),I.useEffect(D,[g,D]);let N=I.useMemo(()=>({onKeyDown:j,[Fte[d]]:e=>{A()&&n.setOpen(!1,Q_(U_,e.nativeEvent))},...d!==`intentional`&&{onClick(e){A()&&n.setOpen(!1,Q_(`trigger-press`,e.nativeEvent))}}}),[j,n,d,A]),P=Nm(e=>{if(!r||!o||e.button!==0)return;let t=yv(e.nativeEvent);vv(n.select(`floatingElement`),t)&&(y.current||(y.current=!0,b.current=!1))}),ee=Nm(e=>{!r||!o||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&y.current&&(b.current=!0)}),F=I.useMemo(()=>({onKeyDown:j,onPointerDown:ee,onMouseDown:ee,onClickCapture:M,onMouseDownCapture(e){M(),P(e)},onPointerDownCapture(e){M(),P(e)},onMouseUpCapture:M,onTouchEndCapture:M,onTouchMoveCapture:M}),[j,M,P,ee]);return I.useMemo(()=>o?{reference:N,floating:F,trigger:N}:{},[o,N,F])}function fb(e,t,n){let{reference:r,floating:i}=e,a=Vv(t),o=Hv(t),s=Bv(o),c=Lv(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}}switch(Rv(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Rte(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}=Iv(t,e),p=ey(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ty(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=ty(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 zte=50,Bte=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Rte},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=fb(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<zte&&(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}=fb(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Vte=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}=Iv(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Lv(r),_=Vv(o),v=Lv(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Qv(o)]:Wv(o)),x=p!==`none`;!d&&x&&b.push(...Zv(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=Uv(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`&&_!==Vv(t))||T.every(e=>Vv(e.placement)===_?e.overflows[0]>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=Vv(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function pb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function mb(e){return Ov.some(t=>e[t]>=0)}var Hte=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Iv(e,t);switch(i){case`referenceHidden`:{let e=pb(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:mb(e)}}}case`escaped`:{let e=pb(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:mb(e)}}}default:return{}}}}},hb=new Set([`left`,`top`]);async function Ute(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Lv(n),s=Rv(n),c=Vv(n)===`y`,l=hb.has(o)?-1:1,u=a&&c?-1:1,d=Iv(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 Wte=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 Ute(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}}}}},Gte=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}=Iv(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Vv(Lv(i)),p=zv(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Fv(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Fv(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Kte=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}=Iv(e,t),u={x:n,y:r},d=Vv(i),f=zv(d),p=u[f],m=u[d],h=Iv(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=hb.has(Lv(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}}}},qte=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Iv(e,t),u=await o.detectOverflow(t,l),d=Lv(i),f=Rv(i),p=Vv(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=kv(h-u[g],v),x=kv(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Av(u.left,0),t=Av(u.right,0),n=Av(u.top,0),r=Av(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Av(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Av(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function gb(e){let t=Cm(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=pm(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=jv(n)!==a||jv(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function _b(e){return fm(e)?e:e.contextElement}function vb(e){let t=_b(e);if(!pm(t))return Nv(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=gb(t),o=(a?jv(n.width):n.width)/r,s=(a?jv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Jte=Nv(0);function yb(e){let t=lm(e);return!xm()||!t.visualViewport?Jte:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yte(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==lm(e)?!1:t}function bb(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=_b(e),o=Nv(1);t&&(r?fm(r)&&(o=vb(r)):o=vb(e));let s=Yte(a,n,r)?yb(a):Nv(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){let e=lm(a),t=r&&fm(r)?lm(r):r,n=e,i=Om(n);for(;i&&r&&t!==n;){let e=vb(i),t=i.getBoundingClientRect(),r=Cm(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=lm(i),i=Om(n)}}return ty({width:u,height:d,x:c,y:l})}function xb(e,t){let n=wm(e).scrollLeft;return t?t.left+n:bb(um(e)).left+n}function Sb(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-xb(e,n),y:n.top+t.scrollTop}}function Xte(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=um(r),s=t?gm(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Nv(1),u=Nv(0),d=pm(r);if((d||!d&&!a)&&((cm(r)!==`body`||hm(o))&&(c=wm(r)),d)){let e=bb(r);l=vb(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Sb(o,c):Nv(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 Zte(e){return Array.from(e.getClientRects())}function Qte(e){let t=um(e),n=wm(e),r=e.ownerDocument.body,i=Av(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Av(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+xb(e),s=-n.scrollTop;return Cm(r).direction===`rtl`&&(o+=Av(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Cb=25;function $te(e,t){let n=lm(e),r=um(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=xm();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=xb(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Cb&&(a-=o)}else l<=Cb&&(a+=l);return{width:a,height:o,x:s,y:c}}function ene(e,t){let n=bb(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=pm(e)?vb(e):Nv(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function wb(e,t,n){let r;if(t===`viewport`)r=$te(e,n);else if(t===`document`)r=Qte(um(e));else if(fm(t))r=ene(t,n);else{let n=yb(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ty(r)}function Tb(e,t){let n=Tm(e);return n===t||!fm(n)||Sm(n)?!1:Cm(n).position===`fixed`||Tb(n,t)}function tne(e,t){let n=t.get(e);if(n)return n;let r=Dm(e,[],!1).filter(e=>fm(e)&&cm(e)!==`body`),i=null,a=Cm(e).position===`fixed`,o=a?Tm(e):e;for(;fm(o)&&!Sm(o);){let t=Cm(o),n=ym(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||hm(o)&&!n&&Tb(e,o))?r=r.filter(e=>e!==o):i=t,o=Tm(o)}return t.set(e,r),r}function nne(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?gm(t)?[]:tne(t,this._c):[].concat(n),r],o=wb(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=wb(t,a[e],i);s=Av(n.top,s),c=kv(n.right,c),l=kv(n.bottom,l),u=Av(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function rne(e){let{width:t,height:n}=gb(e);return{width:t,height:n}}function ine(e,t,n){let r=pm(t),i=um(t),a=n===`fixed`,o=bb(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Nv(0);function l(){c.x=xb(i)}if(r||!r&&!a)if((cm(t)!==`body`||hm(i))&&(s=wm(t)),r){let e=bb(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Sb(i,s):Nv(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Eb(e){return Cm(e).position===`static`}function Db(e,t){if(!pm(e)||Cm(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return um(e)===n&&(n=n.ownerDocument.body),n}function Ob(e,t){let n=lm(e);if(gm(e))return n;if(!pm(e)){let t=Tm(e);for(;t&&!Sm(t);){if(fm(t)&&!Eb(t))return t;t=Tm(t)}return n}let r=Db(e,t);for(;r&&ree(r)&&Eb(r);)r=Db(r,t);return r&&Sm(r)&&Eb(r)&&!ym(r)?n:r||bm(e)||n}var ane=async function(e){let t=this.getOffsetParent||Ob,n=this.getDimensions,r=await n(e.floating);return{reference:ine(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function one(e){return Cm(e).direction===`rtl`}var sne={convertOffsetParentRelativeRectToViewportRelativeRect:Xte,getDocumentElement:um,getClippingRect:nne,getOffsetParent:Ob,getElementRects:ane,getClientRects:Zte,getDimensions:rne,getScale:vb,isElement:fm,isRTL:one};function kb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cne(e,t){let n=null,r,i=um(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Mv(d),h=Mv(i.clientWidth-(u+f)),g=Mv(i.clientHeight-(d+p)),_=Mv(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Av(0,kv(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!kb(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ab(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=_b(e),u=i||a?[...l?Dm(l):[],...t?Dm(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?cne(l,n):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?bb(e):null;c&&g();function g(){let t=bb(e);h&&!kb(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 lne=Wte,une=Gte,dne=Vte,fne=qte,pne=Hte,mne=Kte,hne=(e,t,n)=>{let r=new Map,i={platform:sne,...n},a={...i.platform,_c:r};return Bte(e,t,{...i,platform:a})},jb=typeof document<`u`?I.useLayoutEffect:function(){};function Mb(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(!Mb(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)&&!Mb(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Nb(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Pb(e,t){let n=Nb(e);return Math.round(t*n)/n}function Fb(e){let t=I.useRef(e);return jb(()=>{t.current=e}),t}function gne(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]=I.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=I.useState(r);Mb(f,r)||p(r);let[m,h]=I.useState(null),[g,_]=I.useState(null),v=I.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=I.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=I.useRef(null),C=I.useRef(null),w=I.useRef(u),T=c!=null,E=Fb(c),D=Fb(i),O=Fb(l),k=I.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),hne(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Mb(w.current,t)&&(w.current=t,Ky.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);jb(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=I.useRef(!1);jb(()=>(A.current=!0,()=>{A.current=!1}),[]),jb(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=I.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=I.useMemo(()=>({reference:b,floating:x}),[b,x]),N=I.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Pb(M.floating,u.x),r=Pb(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Nb(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return I.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var _ne=(e,t)=>{let n=lne(e);return{name:n.name,fn:n.fn,options:[e,t]}},vne=(e,t)=>{let n=une(e);return{name:n.name,fn:n.fn,options:[e,t]}},yne=(e,t)=>({fn:mne(e).fn,options:[e,t]}),bne=(e,t)=>{let n=dne(e);return{name:n.name,fn:n.fn,options:[e,t]}},xne=(e,t)=>{let n=fne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Sne=(e,t)=>{let n=pne(e);return{name:n.name,fn:n.fn,options:[e,t]}},W=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(eh(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},Cne=i((e=>{var t=we(),n=Ap();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}})),wne=i(((e,t)=>{t.exports=Cne()})),Ib=Ap(),Tne=wne(),Ene=sh(19)?One:kne;function Lb(e,t,n,r,i){return Ene(e,t,n,r,i)}function Dne(e,t,n,r,i){let a=I.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Ib.useSyncExternalStore)(e.subscribe,a,a)}ite({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);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}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,Ib.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function One(e,t,n,r,i){let a=rte();if(!a)return Dne(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.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function kne(e,t,n,r,i){return(0,Tne.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Ane=class{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 Lb(this,e,t,n,r)}},Rb=class extends Ane{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){I.useDebugValue(e),Lm(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;Lm(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Lm(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){I.useDebugValue(e);let n=t!==void 0;Lm(()=>{n&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return I.useDebugValue(e),Lb(this,this.selectors[e],t,n,r)}useContextCallback(e,t){I.useDebugValue(e);let n=Nm(t??lh);this.context[e]=n}useStateSetter(e){let t=I.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)}})}},zb={open:W(e=>e.open),transitionStatus:W(e=>e.transitionStatus),domReferenceElement:W(e=>e.domReferenceElement),referenceElement:W(e=>e.positionReference??e.referenceElement),floatingElement:W(e=>e.floatingElement),floatingId:W(e=>e.floatingId)},Bb=class extends Rb{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:Zy(),nested:n,triggerElements:i},zb),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&R_(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 Vb(e,t=!1,n=!1){let[r,i]=I.useState(e&&t?`idle`:void 0),[a,o]=I.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),Lm(()=>{if(!e&&a&&r!==`ending`&&n){let e=cv.request(()=>{i(`ending`)});return()=>{cv.cancel(e)}}},[e,a,r,n]),Lm(()=>{if(!e||t)return;let n=cv.request(()=>{i(void 0)});return()=>{cv.cancel(n)}},[t,e]),Lm(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=cv.request(()=>{i(`idle`)});return()=>{cv.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}var Hb=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),Ub={[Hb.startingStyle]:``},Wb={[Hb.endingStyle]:``},Gb={transitionStatus(e){return e===`starting`?Ub:e===`ending`?Wb:null}};function Kb(e,t=!1,n=!0){let r=lv();return Nm((i,a=null)=>{r.cancel();let o=nb(e);if(o==null)return;let s=o,c=()=>{Ky.flushSync(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()}).catch(()=>{if(n){a?.aborted||c();return}let e=s.getAnimations();!a?.aborted&&e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&l()})}if(t){let e=Hb.startingStyle;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 qb(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=Nm(i),o=Kb(r,n,!1);I.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}function Jb(e,t){let n=I.useRef(null),r=I.useRef(null);return I.useCallback(i=>{if(e!==void 0){if(n.current!==null){let e=n.current,i=r.current,a=t.context.triggerElements.getById(e);i&&a===i&&t.context.triggerElements.delete(e),n.current=null,r.current=null}i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function Yb(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Jb(e,n),o=Nm(t=>{if(a(t),!t||!n.select(`open`))return;let i=n.select(`activeTriggerId`);if(i===e){n.update({activeTriggerElement:t,...r});return}i??n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return Lm(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function Xb(e){let t=e.useState(`open`);Lm(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function Zb(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Vb(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=Nm(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return qb({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var Qb=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function $b(){return new Bb({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Qb,floatingId:``,syncOnly:!1,nested:!1,onOpenChange:void 0})}function ex(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:$b(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:uh,inactiveTriggerProps:uh,popupProps:uh}}var tx=W(e=>e.triggerIdProp??e.activeTriggerId),nx={open:W(e=>e.openProp??e.open),mounted:W(e=>e.mounted),transitionStatus:W(e=>e.transitionStatus),floatingRootContext:W(e=>e.floatingRootContext),preventUnmountingOnClose:W(e=>e.preventUnmountingOnClose),payload:W(e=>e.payload),activeTriggerId:tx,activeTriggerElement:W(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:W((e,t)=>t!==void 0&&tx(e)===t),isOpenedByTrigger:W((e,t)=>t!==void 0&&tx(e)===t&&e.open),isMountedByTrigger:W((e,t)=>t!==void 0&&tx(e)===t&&e.mounted),triggerProps:W((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:W(e=>e.popupProps),popupElement:W(e=>e.popupElement),positionerElement:W(e=>e.positionerElement)};function rx(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Uy(),a=eb()!=null,o=Am(()=>new Bb({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Qb,floatingId:i,syncOnly:!1,nested:a})).current;return Lm(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=fm(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 ix(e={}){let{nodeId:t,externalTree:n}=e,r=rx(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=I.useState(null),c=I.useRef(null),l=tb(n);Lm(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let u=gne({...e,elements:{...a,...o&&{reference:o}}}),d=I.useCallback(e=>{let t=fm(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[f,p]=I.useState(void 0),[m,h]=I.useState(null);i.useSyncedValue(`referenceElement`,f??null);let g=fm(f)?f:null;i.useSyncedValue(`domReferenceElement`,f===void 0?a.domReference:g),i.useSyncedValue(`floatingElement`,m);let _=I.useCallback(e=>{(fm(e)||e===null)&&(c.current=e,p(e)),(fm(u.refs.reference.current)||u.refs.reference.current===null||e!==null&&!fm(e))&&u.refs.setReference(e)},[u.refs,p]),v=I.useCallback(e=>{h(e),u.refs.setFloating(e)},[u.refs]),y=I.useMemo(()=>({...u.refs,setReference:_,setFloating:v,setPositionReference:d,domReference:c}),[u.refs,_,v,d]),b=I.useMemo(()=>({...u.elements,domReference:a.domReference}),[u.elements,a.domReference]),x=i.useState(`open`),S=i.useState(`floatingId`),C=I.useMemo(()=>({...u,dataRef:i.context.dataRef,open:x,onOpenChange:i.setOpen,events:i.context.events,floatingId:S,refs:y,elements:b,nodeId:t,rootStore:i}),[u,y,b,t,i,x,S]);return Lm(()=>{i.context.dataRef.current.floatingContext=C;let e=l?.nodesRef.current.find(e=>e.id===t);e&&(e.context=C)}),I.useMemo(()=>({...u,context:C,refs:y,elements:b,rootStore:i}),[u,y,b,C,i])}function ax(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,onOpenChange:r}=e,i=Uy(),a=eb()!=null,o=t.useState(`open`),s=t.useState(`activeTriggerElement`),c=t.useState(n?`popupElement`:`positionerElement`),l=t.context.triggerElements,u=Am(()=>new Bb({open:o,transitionStatus:void 0,referenceElement:s,floatingElement:c,triggerElements:l,onOpenChange:r,floatingId:i,syncOnly:!0,nested:a})).current;return Lm(()=>{let e={open:o,floatingId:i,referenceElement:s,floatingElement:c};fm(s)&&(e.domReferenceElement=s),u.state.positionReference===u.state.referenceElement&&(e.positionReference=s),u.update(e)},[o,i,s,c,u]),u.context.onOpenChange=r,u.context.nested=a,u}var ox=cte&&P_;function sx(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,delay:o}=t,s=I.useRef(!1),c=I.useRef(null),l=D_(),u=I.useRef(!0);I.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=lm(e);function r(){let e=n.select(`domReferenceElement`);!n.select(`open`)&&pm(e)&&e===_v(uv(e))&&(s.current=!0)}function i(){u.current=!0}function o(){u.current=!1}return rv(nv(t,`blur`,r),ox&&nv(t,`keydown`,i,!0),ox&&nv(t,`pointerdown`,o,!0))},[n,a]),I.useEffect(()=>{if(!a)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=n.select(`domReferenceElement`);fm(e)&&(c.current=e,s.current=!0)}}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a,n]);let d=I.useMemo(()=>({onMouseLeave(){s.current=!1,c.current=null},onFocus(e){let t=e.currentTarget;if(s.current){if(c.current===t)return;s.current=!1,c.current=null}let r=yv(e.nativeEvent);if(fm(r)){if(ox&&!e.relatedTarget){if(!u.current&&!Cv(r))return}else if(!Ev(r))return}let i=bv(e.relatedTarget,n.context.triggerElements),{nativeEvent:a,currentTarget:d}=e,f=typeof o==`function`?o():o;if(n.select(`open`)&&i||f===0||f===void 0){n.setOpen(!0,Q_(G_,a,d));return}l.start(f,()=>{s.current||n.setOpen(!0,Q_(G_,a,d))})},onBlur(e){s.current=!1,c.current=null;let t=e.relatedTarget,r=e.nativeEvent,a=fm(t)&&t.hasAttribute(Oy(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let e=n.select(`domReferenceElement`),o=_v(uv(e));!t&&o===e||vv(i.current.floatingContext?.refs.floating.current,o)||vv(e,o)||a||bv(t??o,n.context.triggerElements)||n.setOpen(!1,Q_(G_,r))})}}),[i,n,l,o]);return I.useMemo(()=>a?{reference:d,trigger:d}:{},[a,d])}var cx=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 E_,this.restTimeout=new E_,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},lx=new WeakMap;function ux(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&lx.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),lx.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function dx(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=lx.get(n);a&&a!==e&&ux(a),ux(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,lx.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function fx(e){let t=Am(cx.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||=t,w_(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function px(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0,nodeId:l}=t,u=fx(n),d=tb(),f=eb(),p=Nm(()=>V_(o.current.openEvent?.type,u.interactedInside)),m=Nm(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),h=Nm(e=>bv(e,n.context.triggerElements)),g=I.useCallback(e=>{let t=z_(c,`close`,u.pointerType),r=()=>{n.setOpen(!1,Q_(W_,e)),d?.events.emit(`floating.closed`,e)};t?u.openChangeTimeout.start(t,r):(u.openChangeTimeout.clear(),r())},[c,n,u,d]),_=Nm(()=>{ux(u)}),v=Nm(e=>{let t=yv(e);if(!wv(t)){u.interactedInside=!1;return}u.interactedInside=t?.closest(`[aria-haspopup]`)!=null});Lm(()=>{r||(u.pointerType=void 0,u.restTimeoutPending=!1,u.interactedInside=!1,_())},[r,u,_]),I.useEffect(()=>_,[_]),Lm(()=>{if(s&&r&&u.handleCloseOptions?.blockPointerEvents&&m()&&fm(a)&&i){let e=a,t=i,n=uv(i),r=d?.nodesRef.current.find(e=>e.id===f)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),dx(u,{scopeElement:u.handleCloseOptions?.getScope?.()??u.pointerEventsScopeElement??r??e.closest(`[data-rootownerid]`)??n.body,referenceElement:e,floatingElement:t}),()=>{_()}}},[s,r,a,i,u,m,d,f,_]);let y=D_();I.useEffect(()=>{if(!s)return;function e(){u.openChangeTimeout.clear(),y.clear(),d?.events.off(`floating.closed`,r),_()}function t(e){if(d&&f&&Ey(d.nodesRef.current,f).length>0){d.events.on(`floating.closed`,r);return}if(h(e.relatedTarget))return;let t=o.current.floatingContext?.nodeId??l,n=e.relatedTarget;if(!(d&&t&&fm(n)&&Ey(d.nodesRef.current,t,!1).some(e=>vv(e.context?.elements.floating,n)))){if(u.handler){u.handler(e);return}_(),p()||g(e)}}function r(e){!d||!f||Ey(d.nodesRef.current,f).length>0||y.start(0,()=>{d.events.off(`floating.closed`,r),n.setOpen(!1,Q_(W_,e)),d.events.emit(`floating.closed`,e)})}let a=i;return rv(a&&nv(a,`mouseenter`,e),a&&nv(a,`mouseleave`,t),a&&nv(a,`pointerdown`,v,!0),()=>{d?.events.off(`floating.closed`,r)})},[s,i,n,o,l,p,h,g,_,v,u,d,f,y])}var mx={current:null};function hx(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=mx,externalTree:f,isActiveTrigger:p=!0,getHandleCloseContext:m,isClosing:h}=t,g=tb(f),_=fx(n),v=I.useRef(!1),y=iv(s),b=iv(o),x=iv(l),S=iv(a),C=iv(h);p&&(_.handleCloseOptions=y.current?.__options);let w=Nm(()=>V_(r.current.openEvent?.type,_.interactedInside)),T=Nm(e=>bv(e,n.context.triggerElements)),E=Nm((e,t,r)=>{let i=n.context.triggerElements;if(i.hasElement(t))return!e||!vv(e,t);if(!fm(r))return!1;let a=r;return i.hasMatchingElement(e=>vv(e,a))&&(!e||!vv(e,a))}),D=Nm((e,t=!0)=>{let r=z_(b.current,`close`,_.pointerType);r?_.openChangeTimeout.start(r,()=>{n.setOpen(!1,Q_(W_,e)),g?.events.emit(`floating.closed`,e)}):t&&(_.openChangeTimeout.clear(),n.setOpen(!1,Q_(W_,e)),g?.events.emit(`floating.closed`,e))}),O=Nm(()=>{_.handler&&=(uv(n.select(`domReferenceElement`)).removeEventListener(`mousemove`,_.handler),void 0)}),k=Nm(()=>{ux(_)});return I.useEffect(()=>O,[O]),I.useEffect(()=>{if(!a)return;function e(e){e.open?v.current=!1:(v.current=e.reason===W_,O(),_.openChangeTimeout.clear(),_.restTimeout.clear(),_.blockMouseMove=!0,_.restTimeoutPending=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,_,O]),I.useEffect(()=>{if(!a)return;let e=d.current??(p?n.select(`domReferenceElement`):null);if(!fm(e))return;function t(e){if(_.openChangeTimeout.clear(),_.blockMouseMove=!1,c&&!L_(_.pointerType))return;let t=B_(x.current),r=z_(b.current,`open`,_.pointerType),i=yv(e),a=e.currentTarget??null,o=n.select(`domReferenceElement`),s=a;if(fm(i)&&!n.context.triggerElements.hasElement(i)){for(let e of n.context.triggerElements.elements())if(vv(e,i)){s=e;break}}fm(a)&&fm(o)&&!n.context.triggerElements.hasElement(a)&&vv(a,o)&&(s=o);let l=s==null?!1:E(o,s,i),u=n.select(`open`),d=C.current?.()??n.select(`transitionStatus`)===`ending`,f=!u&&d&&v.current,p=!l&&fm(s)&&fm(o)&&vv(o,s)&&f,m=t>0&&!r,h=l&&(u||f)||p,g=!u||l;if(h){n.setOpen(!0,Q_(W_,e,s));return}m||(r?_.openChangeTimeout.start(r,()=>{g&&n.setOpen(!0,Q_(W_,e,s))}):g&&n.setOpen(!0,Q_(W_,e,s)))}function i(e){if(w()){k();return}O();let t=uv(n.select(`domReferenceElement`));_.restTimeout.clear(),_.restTimeoutPending=!1;let i=r.current.floatingContext??m?.();if(!T(e.relatedTarget)){if(y.current&&i){n.select(`open`)||_.openChangeTimeout.clear();let r=d.current;_.handler=y.current({...i,tree:g,x:e.clientX,y:e.clientY,onClose(){k(),O(),S.current&&!w()&&r===n.select(`domReferenceElement`)&&D(e,!0)}}),t.addEventListener(`mousemove`,_.handler),_.handler(e);return}(_.pointerType!==`touch`||!vv(n.select(`floatingElement`),e.relatedTarget))&&D(e)}}return u?rv(nv(e,`mousemove`,t,{once:!0}),nv(e,`mouseenter`,t),nv(e,`mouseleave`,i)):rv(nv(e,`mouseenter`,t),nv(e,`mouseleave`,i))},[O,k,r,b,D,n,a,y,_,p,E,w,T,c,u,x,d,g,S,m,C]),I.useMemo(()=>{if(!a)return;function e(e){_.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.select(`open`),o=E(i,r,e.target);if(c&&!L_(_.pointerType))return;if(a&&o&&_.handleCloseOptions?.blockPointerEvents){let e=n.select(`floatingElement`);e&&dx(_,{scopeElement:_.handleCloseOptions?.getScope?.()??r.ownerDocument.body,referenceElement:r,floatingElement:e})}let s=B_(x.current);if(a&&!o||s===0||!o&&_.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;_.restTimeout.clear();function l(){if(_.restTimeoutPending=!1,w())return;let e=n.select(`open`);!_.blockMouseMove&&(!e||o)&&n.setOpen(!0,Q_(W_,t,r))}_.pointerType===`touch`?Ky.flushSync(()=>{l()}):o&&a?l():(_.restTimeoutPending=!0,_.restTimeout.start(s,l))}}},[a,_,w,E,c,n,x])}function gx(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=I.useCallback(t=>_x(t,e,`reference`),t),o=I.useCallback(t=>_x(t,e,`floating`),n),s=I.useCallback(t=>_x(t,e,`item`),r),c=I.useCallback(t=>_x(t,e,`trigger`),i);return I.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function _x(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[hv]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&vx(a,s,i,r)}return vx(a,e,i,r),a}function vx(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var yx=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function bx(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{role:s=`dialog`}=t,c=Uy(),l=a?.id||c,u=I.useMemo(()=>Dv(o)?.id||i,[o,i]),d=yx.get(s)??s,f=eb()!=null,p=I.useMemo(()=>d===`tooltip`||s===`label`?uh:{"aria-haspopup":d===`alertdialog`?`dialog`:d,"aria-expanded":`false`,...d===`listbox`&&{role:`combobox`},...d===`menu`&&f&&{role:`menuitem`},...s===`select`&&{"aria-autocomplete":`none`},...s===`combobox`&&{"aria-autocomplete":`list`}},[d,f,s]),m=I.useMemo(()=>d===`tooltip`||s===`label`?{[`aria-${s===`label`?`labelledby`:`describedby`}`]:r?u:void 0}:{...p,"aria-expanded":r?`true`:`false`,"aria-controls":r?u:void 0,...d===`menu`&&{id:l}},[d,u,r,l,s,p]),h=I.useMemo(()=>{let e={id:u,...d&&{role:d}};return d===`tooltip`||s===`label`?e:{...e,...d===`menu`&&{"aria-labelledby":l}}},[d,u,l,s]),g=I.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${u}-fui-option`}};switch(s){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[u,s]);return I.useMemo(()=>({reference:m,floating:h,item:g,trigger:p}),[m,h,p,g])}var xx=.1,Sx=xx*xx,Cx=.5;function wx(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Tx(e,t,n,r,i,a,o,s,c,l){let u=!1;return wx(e,t,n,r,i,a)&&(u=!u),wx(e,t,i,a,o,s)&&(u=!u),wx(e,t,o,s,c,l)&&(u=!u),wx(e,t,c,l,n,r)&&(u=!u),u}function Ex(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Dx(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 Ox(e={}){let{blockPointerEvents:t=!1}=e,n=new E_,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*Sx;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=yv(r),g=r.type===`mouseleave`,_=vv(u,h),v=vv(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&fm(r.relatedTarget)&&vv(u,r.relatedTarget))return;function y(){return!!(s&&Ey(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=Dx(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Dx(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Dx(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Dx(d,f,x.right-1,A,S.left+1,k);break;default:}if(j)return;if(l&&!Ex(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Cx/2:Cx*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Cx+1,o=C||T?S.bottom-Cx:S.top,s=C?T?S.bottom-Cx:S.top:S.bottom-Cx;M=Tx(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Cx/2:Cx*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Cx,o=C||T?S.top+Cx:S.bottom,s=C?T?S.top+Cx:S.bottom:S.top+Cx;M=Tx(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Cx/2:Cx*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Cx+1,o=w||E?S.right-Cx:S.left,s=w?E?S.right-Cx:S.left:S.right-Cx;M=Tx(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Cx/2:Cx*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Cx,o=w||E?S.left+Cx:S.right,s=w?E?S.left+Cx:S.right:S.left+Cx;M=Tx(d,f,a,r,a,i,o,S.top,s,S.bottom);break}default:}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var kx={...nx,disabled:W(e=>e.disabled),instantType:W(e=>e.instantType),isInstantPhase:W(e=>e.isInstantPhase),trackCursorAxis:W(e=>e.trackCursorAxis),disableHoverablePopup:W(e=>e.disableHoverablePopup),lastOpenChangeReason:W(e=>e.openChangeReason),closeOnClick:W(e=>e.closeOnClick),closeDelay:W(e=>e.closeDelay),hasViewport:W(e=>e.hasViewport)},Ax=class e extends Rb{constructor(e){super({...jx(),...e},{popupRef:I.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Qb},kx)}setOpen=(e,t)=>{let n=t.reason,r=n===W_,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?Ky.flushSync(o):o()};static useStore(t,n){let r=Am(()=>new e(n)).current,i=t??r,a=ax({popupStore:i,onOpenChange:i.setOpen});return i.state.floatingRootContext=a,i}};function jx(){return{...ex(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var Mx=b_(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=Ax.useStore(l?.store,{open:n,openProp:r,activeTriggerId:d,triggerIdProp:u});x_(()=>{r===void 0&&p.state.open===!1&&n===!0&&p.update({open:!0,activeTriggerId:d})}),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(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i}),Lm(()=>{m&&t&&p.setOpen(!1,Q_(X_))},[m,t,p]),p.useSyncedValue(`disabled`,t),Xb(p);let{forceUnmount:v,transitionStatus:y}=Zb(h,p),b=p.select(`floatingRootContext`),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=I.useRef(null);Lm(()=>{y===`ending`&&C===`none`||y!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[y,x,C,S,p]),Lm(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]);let T=I.useCallback(()=>{p.setOpen(!1,Q_(Z_))},[p]);I.useImperativeHandle(o,()=>({unmount:v,close:T}),[v,T]);let{getReferenceProps:E,getFloatingProps:D,getTriggerProps:O}=gx([db(b,{enabled:!t,referencePress:()=>p.select(`closeOnClick`)}),Pte(b,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),k=I.useMemo(()=>E(),[E]),A=I.useMemo(()=>O(),[O]),j=I.useMemo(()=>D(),[D]);return p.useSyncedValues({activeTriggerProps:k,inactiveTriggerProps:A,popupProps:j}),(0,U.jsx)(S_.Provider,{value:p,children:typeof f==`function`?f({payload:_}):f})}),Nx=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Hb.startingStyle]=`startingStyle`,e[e.endingStyle=Hb.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),Px=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),Fx={[Px.popupOpen]:``},Ix={[Px.popupOpen]:``,[Px.pressed]:``},Lx={[Nx.open]:``},Rx={[Nx.closed]:``},zx={[Nx.anchorHidden]:``},Bx={open(e){return e?Fx:null}},Vx={open(e){return e?Ix:null}},Hx={open(e){return e?Lx:Rx},anchorHidden(e){return e?zx:null}};function Ux(e){return Uy(e,`base-ui`)}var Wx=I.createContext(void 0);function Gx(){return I.useContext(Wx)}var Kx=function(e){return e[e.popupOpen=Px.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({}),qx=ate(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeOnClick:c=!0,closeDelay:l,id:u,style:d,...f}=e,p=C_(!0),m=i?.store??p;if(!m)throw Error(eh(82));let h=Ux(u),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=I.useRef(null),b=s??600,x=l??0,{registerTrigger:S,isMountedByThisTrigger:C}=Yb(h,y,m,{payload:a,closeOnClick:c,closeDelay:x}),w=Gx(),{delayRef:T,isInstantPhase:E,hasProvider:D}=tv(v,{open:_});m.useSyncedValue(`isInstantPhase`,E);let O=m.useState(`disabled`),k=o??O,A=m.useState(`trackCursorAxis`),j=m.useState(`disableHoverablePopup`),M=hx(v,{enabled:!k,mouseOnly:!0,move:!1,handleClose:!j&&A!==`both`?Ox():null,restMs(){let e=w?.delay,t=typeof T.current==`object`?T.current.open:void 0,n=b;return D&&(n=t===0?0:s??e??b),n},delay(){let e=typeof T.current==`object`?T.current.close:void 0,t=x;return l==null&&D&&(t=e),{close:t}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`}),N=sx(v,{enabled:!k}).reference,P={open:_},ee=m.useState(`triggerProps`,C);return mh(`button`,e,{state:P,ref:[t,S,y],props:[M,N,ee,{onPointerDown(){m.set(`closeOnClick`,c)},id:h,[Kx.triggerDisabled]:k?``:void 0},f],stateAttributesMapping:Bx})}),Jx=I.createContext(void 0);function Yx(){let e=I.useContext(Jx);if(e===void 0)throw Error(eh(70));return e}var Xx=I.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{portalNode:c,portalSubtree:l}=Yy({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,U.jsxs)(I.Fragment,{children:[l,c&&Ky.createPortal(n,c)]})}),Zx=I.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return C_().useState(`mounted`)||n?(0,U.jsx)(Jx.Provider,{value:n,children:(0,U.jsx)(Xx,{ref:t,...r})}):null}),Qx=I.createContext(void 0);function $x(){let e=I.useContext(Qx);if(e===void 0)throw Error(eh(71));return e}var eS=I.createContext(void 0);function tS(){return I.useContext(eS)?.direction??`ltr`}var nS=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`}=Iv(e,t)||{};if(l==null)return{};let f=ey(u),p={x:n,y:r},m=Hv(i),h=Bv(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=Fv(k,j,A),N=!c.arrow&&Rv(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}}}),rS=(e,t)=>({...nS(e),options:[e,t]}),iS={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;return{data:{referenceHidden:(await Sne().fn(e)).data?.referenceHidden||a}}}},aS={sideX:`left`,sideY:`top`},oS={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=lm(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:aS};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=uv(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Lv(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:aS.sideX,g=f===`top`?`bottom`:aS.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function sS(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 cS(e,t,n){let{rects:r,placement:i}=e;return{side:sS(t,Lv(i),n),align:Rv(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function lS(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:y=!1,externalTree:b}=e,[x,S]=I.useState(null);!m&&x!==null&&S(null);let C=h.side||`flip`,w=h.align||`flip`,T=h.fallbackAxisSide||`end`,E=typeof t==`function`?t:void 0,D=Nm(E),O=E?D:t,k=iv(t),A=iv(m),j=tS()===`rtl`,M=x||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":j?`left`:`right`,"inline-start":j?`right`:`left`}[r],N=a===`center`?M:`${M}-${a}`,P=c,ee=+(r===`bottom`),F=+(r===`top`),te=+(r===`right`),ne=+(r===`left`);typeof P==`number`?P={top:P+ee,right:P+ne,bottom:P+F,left:P+te}:P&&={top:(P.top||0)+ee,right:(P.right||0)+ne,bottom:(P.bottom||0)+F,left:(P.left||0)+te};let re={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:P},ie=I.useRef(null),ae=iv(i),oe=iv(o),se=[_ne(e=>{let t=cS(e,r,j),n=typeof ae.current==`function`?ae.current(t):ae.current,i=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,j,r])],ce=w===`none`&&C!==`shift`,le=!ce&&(l||g||C===`shift`),ue=C===`none`?null:bne({...re,padding:{top:P.top+1,right:P.right+1,bottom:P.bottom+1,left:P.left+1},mainAxis:!g&&C===`flip`,crossAxis:w===`flip`?`alignment`:!1,fallbackAxisSideDirection:T}),de=ce?null:vne(e=>{let t=uv(e.elements.floating).documentElement;return{...re,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:w!==`none`,crossAxis:le,limiter:l||g?void 0:yne(e=>{if(!ie.current)return{};let{width:t,height:n}=ie.current.getBoundingClientRect(),r=Vv(Lv(e.placement)),i=r===`y`?t:n,a=r===`y`?P.left+P.right:P.top+P.bottom;return{offset:i/2+a/2}})}},[re,l,g,P,w]);C===`shift`||w===`shift`||a===`center`?se.push(de,ue):se.push(ue,de),se.push(xne({...re,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!A.current)return;let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=lm(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(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),rS(()=>({element:ie.current||uv(ie.current).createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=Lv(a),l=Vv(c),u=ie.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(cS(e,r,j)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,le&&l===`y`&&b?S:x),{}}},iS,v),Lm(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[m,p]);let fe=I.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:pe,elements:me,x:he,y:ge,middlewareData:_e,update:ve,placement:ye,context:be,isPositioned:xe,floatingStyles:Se}=ix({rootContext:p,open:f?m:void 0,placement:N,middleware:se,strategy:n,whileElementsMounted:f?void 0:(...e)=>Ab(...e,fe),nodeId:_,externalTree:b}),{sideX:Ce,sideY:we}=_e.adaptiveOrigin||aS,Te=xe?n:`fixed`,Ee=I.useMemo(()=>{let e=v?{position:Te,[Ce]:he,[we]:ge}:{position:Te,...Se};return xe||(e.opacity=0),e},[v,Te,Ce,he,we,ge,Se,xe]),De=I.useRef(null);Lm(()=>{if(!m)return;let e=k.current,t=typeof e==`function`?e():e,n=(uS(t)?t.current:t)||null;n!==De.current&&(pe.setPositionReference(n),De.current=n)},[m,pe,O,k]),I.useEffect(()=>{if(!m)return;let e=k.current;typeof e!=`function`&&uS(e)&&e.current!==De.current&&(pe.setPositionReference(e.current),De.current=e.current)},[m,pe,O,k]),I.useEffect(()=>{if(f&&m&&me.domReference&&me.floating)return Ab(me.domReference,me.floating,ve,fe)},[f,m,me,ve,fe]);let Oe=Lv(ye),ke=sS(r,Oe,j),Ae=Rv(ye)||`center`,je=!!_e.hide?.referenceHidden;Lm(()=>{y&&m&&xe&&S(Oe)},[y,m,xe,Oe]);let Me=I.useMemo(()=>({position:`absolute`,top:_e.arrow?.y,left:_e.arrow?.x}),[_e.arrow]),Ne=_e.arrow?.centerOffset!==0;return I.useMemo(()=>({positionerStyles:Ee,arrowStyles:Me,arrowRef:ie,arrowUncentered:Ne,side:ke,align:Ae,physicalSide:Oe,anchorHidden:je,refs:pe,context:be,isPositioned:xe,update:ve}),[Ee,Me,ie,Ne,ke,Ae,Oe,je,pe,be,xe,ve])}function uS(e){return e!=null&&`current`in e}function dS(e){return e===`starting`?Cte:uh}function fS(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),mh(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},dS(r),i],stateAttributesMapping:Hx})}var pS=I.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=Gy,style:g,..._}=e,v=C_(),y=Yx(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=lS({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,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(`hasViewport`)?oS:void 0}),O=fS(e,I.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,U.jsx)(Qx.Provider,{value:D,children:O})}),mS={...Hx,...Gb},hS=I.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,o=C_(),{side:s,align:c}=$x(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`);qb({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}});let m=o.useState(`disabled`),h=o.useState(`closeDelay`);return px(p,{enabled:!m,closeDelay:h}),mh(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,o.useStateSetter(`popupElement`)],props:[f,dS(d),a],stateAttributesMapping:mS})}),gS=I.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,o=C_(),s=o.useState(`open`),c=o.useState(`instantType`),{arrowRef:l,side:u,align:d,arrowUncentered:f,arrowStyles:p}=$x();return mh(`div`,e,{state:{open:s,side:u,align:d,uncentered:f,instant:c},ref:[t,l],props:[{style:p,"aria-hidden":!0},a],stateAttributesMapping:Hx})}),_S=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=I.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=I.useMemo(()=>({open:t,close:n}),[t,n]);return(0,U.jsx)(Wx.Provider,{value:i,children:(0,U.jsx)(ev,{delay:a,timeoutMs:r,children:e.children})})};function vS(e){return sh(19)?e:e?`true`:void 0}function yS({delay:e=0,...t}){return(0,U.jsx)(_S,{"data-slot":`tooltip-provider`,delay:e,...t})}function bS({...e}){return(0,U.jsx)(Mx,{"data-slot":`tooltip`,...e})}function xS({...e}){return(0,U.jsx)(qx,{"data-slot":`tooltip-trigger`,...e})}function SS({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,U.jsx)(Zx,{children:(0,U.jsx)(pS,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,U.jsxs)(hS,{"data-slot":`tooltip-content`,className:Pg(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,U.jsx)(gS,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var CS={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},wS={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},TS={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},ES=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],DS=[12288,12288,65281,65376,65504,65510],OS=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],kS=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],AS=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],jS=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},MS=19968,[NS,PS]=FS(AS);function FS(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(MS>=i&&MS<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var IS=e=>e<161||e>1114109?!1:jS(ES,e),LS=e=>e<12288||e>65510?!1:jS(DS,e),RS=e=>e<8361||e>65518?!1:jS(OS,e),zS=e=>e<32||e>10630?!1:jS(kS,e),BS=e=>e>=NS&&e<=PS?!0:e<4352||e>262141?!1:jS(AS,e);function VS(e){return IS(e)?`ambiguous`:LS(e)?`fullwidth`:RS(e)?`halfwidth`:zS(e)?`narrow`:BS(e)?`wide`:`neutral`}function HS(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function US(e){return HS(e),VS(e)}function WS(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function GS(e){if(!e||e<4352)return!1;switch(US(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!WS(e);case`narrow`:return!1;case`ambiguous`:return 917760<=e&&e<=917999?null:!1;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function KS(e,t){return t!==65025||!e||e<8216?!1:e===8216||e===8217||e===8220||e===8221}function qS(e){return e!==null&&e>=65024&&e<=65038}var JS=XS(/\p{P}|\p{S}/u),YS=XS(/\s/);function XS(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCodePoint(t))}}function ZS(e){return!!(e&wS.characterGroupWhitespace)}function QS(e){return(e&_C.cjkPunctuation)===wS.characterGroupPunctuation}function $S(e){return!!(e&_C.cjk)}function eC(e){return e===_C.ivs}function tC(e){return!!(e&_C.cjkOrIvs)}function nC(e){return e===_C.nonEmojiGeneralUseVS}function rC(e){return!!(e&_C.spaceOrPunctuation)}var iC=gC(/[A-Za-z]/),aC=gC(/[\dA-Za-z]/),oC=gC(/[#-'*+\--9=?A-Z^-~]/);function sC(e){return e!==null&&(e<32||e===127)}var cC=gC(/\d/),lC=gC(/[\dA-Fa-f]/),uC=gC(/[!-/:-@[-`{-~]/);function dC(e){return e!==null&&e<-2}function fC(e){return e!==null&&(e<0||e===32)}function pC(e){return e===-2||e===-1||e===32}var mC=gC(/\p{P}|\p{S}/u),hC=gC(/\s/);function gC(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var _C;(function(e){e.spaceOrPunctuation=3,e.cjk=4096,e.cjkPunctuation=4098,e.ivs=8192,e.cjkOrIvs=12288,e.nonEmojiGeneralUseVS=16384,e.variationSelector=24576,e.ivsToCjkRightShift=1})(_C||={});function vC(e){if(e===CS.eof||fC(e)||YS(e))return wS.characterGroupWhitespace;let t=0;if(e>=4352){if(qS(e))return _C.nonEmojiGeneralUseVS;switch(GS(e)){case null:return _C.ivs;case!0:t|=_C.cjk;break}}return JS(e)&&(t|=wS.characterGroupPunctuation),t}function yC(e,t,n){if(!nC(e))return e;let r=t(),i=vC(r);return!r||ZS(i)?e:KS(r,n)?_C.cjkPunctuation:bC(i)}function bC(e){return e&~_C.ivs}function xC(e){return!!(e&&e>=55296&&e<=56319)}function SC(e){return!!(e&&e>=56320&&e<=57343)}function CC(e,t,n){if(t._bufferIndex<2)return e;let r=n({start:{...t,_bufferIndex:t._bufferIndex-2},end:t}).codePointAt(0);return r&&r>=65536?r:e}function wC(e,t,n){let r=e>=65536?2:1;if(t._bufferIndex<1+r)return null;let i=t._bufferIndex-r-2,a=n({start:{...t,_bufferIndex:i>=0?i:0},end:{...t,_bufferIndex:t._bufferIndex-r}}),o=a.charCodeAt(a.length-1);if(Number.isNaN(o))return null;if(a.length<2||o<56320||57343<o)return o;let s=a.codePointAt(0);return s&&s>=65536?s:o}var TC=class{cachedValue=void 0;constructor(e,t,n){this.previousCode=e,this.nowPoint=t,this.sliceSerialize=n}value(){return this.cachedValue===void 0&&(this.cachedValue=wC(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function EC(e,t,n){let r=n({start:t,end:{...t,_bufferIndex:t._bufferIndex+2}}).codePointAt(0);return r&&r>=65536?r:e}function DC(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function OC(e,t){return e.length>0?(DC(e,e.length,0,t),e):t}function kC(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var AC={name:`attention`,resolveAll:jC,tokenize:MC};function jC(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};NC(d,-c),NC(f,c),o={type:c>1?TS.strongSequence:TS.emphasisSequence,start:d,end:{...e[r][1].end}},s={type:c>1?TS.strongSequence:TS.emphasisSequence,start:{...e[n][1].start},end:f},a={type:c>1?TS.strongText:TS.emphasisText,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?TS.strong:TS.emphasis,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=OC(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=OC(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),t.parser.constructs.insideSpan.null,l=OC(l,kC(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=OC(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=OC(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,DC(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function MC(e,t){let n=this.parser.constructs.attentionMarkers.null,{now:r,sliceSerialize:i,previous:a}=this,o=SC(a)?CC(a,r(),i):a,s=vC(o),c=new TC(o,r(),i),l=yC(s,c.value.bind(c),o),u;return d;function d(t){return t===CS.asterisk||CS.underscore,u=t,e.enter(`attentionSequence`),f(t)}function f(a){if(a===u)return e.consume(a),f;let s=e.exit(`attentionSequence`),c=vC(xC(a)?EC(a,r(),i):a),d=QS(l),p=d||ZS(l),m=QS(c),h=m||ZS(c),g=tC(l),_=!h||m&&(p||g)||n.includes(a),v=!p||d&&(h||$S(c))||n.includes(o);return s._open=!!(u===CS.asterisk?_:_&&(rC(l)||!v)),s._close=!!(u===CS.asterisk?v:v&&(rC(c)||!_)),t(a)}}function NC(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function PC(){return{text:{[CS.asterisk]:AC,[CS.underscore]:AC},insideSpan:{null:[AC]}}}function FC(){let e=this.data();(e.micromarkExtensions||=[]).push(PC())}function IC(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{[CS.tilde]:n},insideSpan:{null:[n]},attentionMarkers:{null:[CS.tilde]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&DC(o,o.length,0,kC(s,e.slice(r+1,n),t)),DC(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),DC(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=TS.data);return e}function i(e,n,r){let{now:i,sliceSerialize:a,previous:o}=this,s=SC(o)?CC(o,i(),a):o,c=vC(s),l=new TC(s,i(),a),u=yC(c,l.value.bind(l),s),d=this.events,f=0;return p;function p(t){return CS.tilde,s===CS.tilde&&d[d.length-1][1].type!==TS.characterEscape?r(t):(e.enter(`strikethroughSequenceTemporary`),m(t))}function m(o){let c=vC(s);if(o===CS.tilde)return f>1?r(o):(e.consume(o),f++,m);if(f<2&&!t)return r(o);let l=e.exit(`strikethroughSequenceTemporary`),d=vC(xC(o)?EC(o,i(),a):o),p=QS(u)||ZS(u),h=QS(d)||ZS(d),g=$S(u)||eC(c);return l._open=!h||d===wS.attentionSideAfter&&(p||g),l._close=!p||c===wS.attentionSideAfter&&(h||$S(d)),n(o)}}}function LC(e){let t=this.data();(t.micromarkExtensions||=[]).push(IC(e))}var RC=(function(e){if(e==null)return Nne;if(typeof e==`function`)return BC(e);if(typeof e==`object`)return Array.isArray(e)?zC(e):jne(e);if(typeof e==`string`)return Mne(e);throw Error(`Expected function, string, or object as test`)});function zC(e){let t=[],n=-1;for(;++n<e.length;)t[n]=RC(e[n]);return BC(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function jne(e){let t=e;return BC(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Mne(e){return BC(t);function t(t){return t&&t.type===e}}function BC(e){return t;function t(t,n,r){return!!(Pne(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Nne(){return!0}function Pne(e){return typeof e==`object`&&!!e&&`type`in e}function Fne(e){return e}var VC=[],HC=`skip`;function UC(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=RC(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+Fne(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=VC,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Ine(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Ine(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?VC:[e]}function WC(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),UC(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Lne=new Set([`。`,`.`,`,`,`、`,`?`,`!`,`:`,`;`,`(`,`)`,`【`,`】`,`「`,`」`,`『`,`』`,`〈`,`〉`,`《`,`》`]),Rne=/^(https?:\/\/|mailto:|www\.)/i,zne=e=>{if(e.children.length!==1)return!1;let t=e.children[0];return t.type===`text`&&t.value===e.url},Bne=e=>{let t=0;for(let n of e){if(Lne.has(n))return t;t+=n.length}return null},Vne=(e,t)=>({...t,url:e,children:[{type:`text`,value:e}]}),Hne=e=>({type:`text`,value:e}),Une=()=>e=>{WC(e,`link`,(e,t,n)=>{if(!n||typeof t!=`number`||!zne(e)||!Rne.test(e.url))return;let r=Bne(e.url);if(r===null||r===0)return;let i=e.url.slice(0,r),a=e.url.slice(r),o=Vne(i,e),s=Hne(a);return n.children.splice(t,1,o,s),t+1})};function Wne(){let e=[FC],t=[Une,LC];return{name:`cjk`,type:`cjk`,remarkPluginsBefore:e,remarkPluginsAfter:t,remarkPlugins:[...e,...t]}}var GC=Wne(),KC=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Gne(e){return qC(e)}function qC(e){return Array.isArray(e)?Kne(e):e instanceof RegExp?e:typeof e==`object`?qne(e):e}function Kne(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=qC(e[n]);return t}function qne(e){let t={};for(let n in e)t[n]=qC(e[n]);return t}function JC(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function YC(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?YC(e.substring(0,e.length-1)):e.substr(~t+1)}var XC=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ZC=class{static hasCaptures(e){return e===null?!1:(XC.lastIndex=0,XC.test(e))}static replaceCaptures(e,t,n){return e.replace(XC,(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 QC(e,t){return e<t?-1:+(e>t)}function $C(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=QC(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function ew(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 tw(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var nw=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}},rw=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Xne(e),t)}static createFromParsedTheme(e,t){return Qne(e,t)}_cachedMatchRoot=new nw(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=>Jne(e.parent,t.parentScopes));return n?new aw(n.fontStyle,n.foreground,n.background):null}},iw=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?!0:this.parent===null?!1: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 Jne(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&&!Yne(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Yne(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var aw=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Xne(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;break}}let s=null;typeof i.settings.foreground==`string`&&ew(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&ew(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 Zne(l,u,e,o,s,c)}}return n}var Zne=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}},ow=(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))(ow||{});function Qne(e,t){e.sort((e,t)=>{let n=QC(e.scope,t.scope);return n!==0||(n=$C(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 $ne(t),o=new aw(n,a.getId(r),a.getId(i)),s=new tre(new sw(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 rw(a,o,s)}var $ne=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)}},ere=Object.freeze([]),sw=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||ere,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)}},tre=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(),sw.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($C(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 sw(e,t,n,r,i))}},cw=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)!=0}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=rre(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 nre(e){return e}function rre(e){return e}function lw(e,t){let n=[],r=ire(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(uw(i)){let e=[];do e.push(i),i=r.next();while(uw(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 uw(e){return!!e&&!!e.match(/[\w\.:]+/)}function ire(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 dw(e){typeof e.dispose==`function`&&e.dispose()}var fw=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},are=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},ore=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))}},sre=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new fw(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new ore;for(let n of e)cre(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof fw){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 cre(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 fw?mw({baseGrammar:a,selfGrammar:i},r):pw(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 fw(e))}function pw(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];hw([r],t,n)}}function mw(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&hw(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&hw(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function hw(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?JC({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&hw(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=gw(i);switch(a.kind){case 0:mw({...t,selfGrammar:t.baseGrammar},n);break;case 1:mw(t,n);break;case 2:pw(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?pw(a.ruleName,i,n):mw(i,n)}else a.kind===4?n.add(new are(a.scopeName,a.ruleName)):n.add(new fw(a.scopeName));break}}}var lre=class{kind=0},ure=class{kind=1},dre=class{constructor(e){this.ruleName=e}kind=2},fre=class{constructor(e){this.scopeName=e}kind=3},pre=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function gw(e){if(e===`$base`)return new lre;if(e===`$self`)return new ure;let t=e.indexOf(`#`);return t===-1?new fre(e):t===0?new dre(e.substring(1)):new pre(e.substring(0,t),e.substring(t+1))}var mre=/\\(\d+)/,_w=/\\(\d+)/g,hre=-1,vw=-2;function yw(e){return e}function bw(e){return e}var xw=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=ZC.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=ZC.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${YC(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:ZC.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:ZC.replaceCaptures(this._contentName,e,t)}},gre=class extends xw{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!`)}},_re=class extends xw{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Ew(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 Dw,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Sw=class extends xw{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 Dw,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Cw=class extends xw{_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 Ew(i,this.id),this.beginCaptures=a,this._end=new Ew(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 Dw;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}},ww=class extends xw{_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 Ew(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Ew(o,vw),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 Dw;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 Dw,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},Tw=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new gre(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new _re(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=JC({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Sw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new ww(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 Cw(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=gw(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);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Sw||e instanceof Cw||e instanceof ww)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Ew=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.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=mre.test(this.source):this.hasBackReferences=!1}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 _w.lastIndex=0,this.source.replace(_w,(e,t)=>tw(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}},Dw=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 Ow(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 Ow(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Ow=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(`
|
|
187
|
+
`}};Dp.CHUNK_MAX_BYTES=18e5,yp.STREAM_RESUME_NONE;var Op=i(((e,t)=>{function n(e,t){if(typeof e!=`function`)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...i){clearTimeout(n);let a=Date.now(),o=t-(a-r);o<=0?(r=a,e.apply(this,i)):n=setTimeout(()=>{r=Date.now(),e.apply(this,i)},o)}}t.exports=n})),kp=i((e=>{var t=we();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 d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Ap=i(((e,t)=>{t.exports=kp()})),jp=e(Op(),1),Mp=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},Np=(e,t,n)=>(Mp(e,t,`read from private field`),n?n.call(e):t.get(e)),Pp=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Fp=(e,t,n,r)=>(Mp(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n);function Ip(e,t){return t==null?e:(0,jp.default)(e,t)}var Lp,Rp,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp=class{constructor(e=[]){Pp(this,Lp,void 0),Pp(this,Rp,`ready`),Pp(this,zp,void 0),Pp(this,Bp,new Set),Pp(this,Vp,new Set),Pp(this,Hp,new Set),this.pushMessage=e=>{Fp(this,Lp,Np(this,Lp).concat(e)),Np(this,Up).call(this)},this.popMessage=()=>{Fp(this,Lp,Np(this,Lp).slice(0,-1)),Np(this,Up).call(this)},this.replaceMessage=(e,t)=>{Fp(this,Lp,[...Np(this,Lp).slice(0,e),this.snapshot(t),...Np(this,Lp).slice(e+1)]),Np(this,Up).call(this)},this.snapshot=e=>structuredClone(e),this[`~registerMessagesCallback`]=(e,t)=>{let n=t?Ip(e,t):e;return Np(this,Bp).add(n),()=>{Np(this,Bp).delete(n)}},this[`~registerStatusCallback`]=e=>(Np(this,Vp).add(e),()=>{Np(this,Vp).delete(e)}),this[`~registerErrorCallback`]=e=>(Np(this,Hp).add(e),()=>{Np(this,Hp).delete(e)}),Pp(this,Up,()=>{Np(this,Bp).forEach(e=>e())}),Pp(this,Wp,()=>{Np(this,Vp).forEach(e=>e())}),Pp(this,Gp,()=>{Np(this,Hp).forEach(e=>e())}),Fp(this,Lp,e)}get status(){return Np(this,Rp)}set status(e){Fp(this,Rp,e),Np(this,Wp).call(this)}get error(){return Np(this,zp)}set error(e){Fp(this,zp,e),Np(this,Gp).call(this)}get messages(){return Np(this,Lp)}set messages(e){Fp(this,Lp,[...e]),Np(this,Up).call(this)}};Lp=new WeakMap,Rp=new WeakMap,zp=new WeakMap,Bp=new WeakMap,Vp=new WeakMap,Hp=new WeakMap,Up=new WeakMap,Wp=new WeakMap,Gp=new WeakMap;var qp,Jp=class extends pp{constructor({messages:e,...t}){let n=new Kp(e);super({...t,state:n}),Pp(this,qp,void 0),this[`~registerMessagesCallback`]=(e,t)=>Np(this,qp)[`~registerMessagesCallback`](e,t),this[`~registerStatusCallback`]=e=>Np(this,qp)[`~registerStatusCallback`](e),this[`~registerErrorCallback`]=e=>Np(this,qp)[`~registerErrorCallback`](e),Fp(this,qp,n)}};qp=new WeakMap;function Yp({experimental_throttle:e,resume:t=!1,...n}={}){let r=(0,I.useRef)(`chat`in n?{}:{onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});`chat`in n||(r.current={onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});let i={...n,onToolCall:e=>{var t;return(t=r.current).onToolCall?.call(t,e)},onData:e=>{var t;return(t=r.current).onData?.call(t,e)},onFinish:e=>{var t;return(t=r.current).onFinish?.call(t,e)},onError:e=>{var t;return(t=r.current).onError?.call(t,e)},sendAutomaticallyWhen:e=>{var t;return(t=r.current).sendAutomaticallyWhen?.call(t,e)??!1}},a=(0,I.useRef)(`chat`in n?n.chat:new Jp(i));(`chat`in n&&n.chat!==a.current||`id`in n&&a.current.id!==n.id)&&(a.current=`chat`in n?n.chat:new Jp(i));let o=(0,I.useSyncExternalStore)((0,I.useCallback)(t=>a.current[`~registerMessagesCallback`](t,e),[e,a.current.id]),()=>a.current.messages,()=>a.current.messages),s=(0,I.useSyncExternalStore)(a.current[`~registerStatusCallback`],()=>a.current.status,()=>a.current.status),c=(0,I.useSyncExternalStore)(a.current[`~registerErrorCallback`],()=>a.current.error,()=>a.current.error),l=(0,I.useCallback)(e=>{typeof e==`function`&&(e=e(a.current.messages)),a.current.messages=e},[a]);return(0,I.useEffect)(()=>{t&&a.current.resumeStream()},[t,a]),{id:a.current.id,messages:o,setMessages:l,sendMessage:a.current.sendMessage,regenerate:a.current.regenerate,clearError:a.current.clearError,stop:a.current.stop,error:c,resumeStream:a.current.resumeStream,status:s,addToolResult:a.current.addToolOutput,addToolOutput:a.current.addToolOutput,addToolApprovalResponse:a.current.addToolApprovalResponse}}var Xp=class{constructor(e){this._resumeResolver=null,this._resumeNoneResolver=null,this._expectToolContinuation=!1,this._abortToolContinuation=null,this._activeServerTurnId=null,this._cancelAttachedStream=null,this.agent=e.agent,this.prepareBody=e.prepareBody,this.activeRequestIds=e.activeRequestIds,this.cancelOnClientAbort=e.cancelOnClientAbort??!1}setCancelOnClientAbort(e){this.cancelOnClientAbort=e}cancelActiveServerTurn(){let e=this._activeServerTurnId,t=!1;e&&(this.sendCancelFrame(e),this._cancelAttachedStream?.(),this.clearActiveServerTurn(e),t=!0);let n=this.abortActiveToolContinuation();return t||n}sendCancelFrame(e){try{this.agent.send(JSON.stringify({id:e,type:`cf_agent_chat_request_cancel`}))}catch{}}setActiveServerTurn(e,t){this._activeServerTurnId=e,this._cancelAttachedStream=t}clearActiveServerTurn(e){this._activeServerTurnId===e&&(this._activeServerTurnId=null,this._cancelAttachedStream=null)}expectToolContinuation(){this._expectToolContinuation=!0}abortActiveToolContinuation(){return this._abortToolContinuation?.()??!1}isAwaitingResume(){return this._resumeResolver!==null||this._resumeNoneResolver!==null}handleStreamResuming(e){return this._resumeResolver?(this._resumeResolver(e),!0):!1}handleStreamResumeNone(){return this._resumeNoneResolver?(this._resumeNoneResolver(),!0):!1}handleServerTurnCompleted(e){this.clearActiveServerTurn(e)}observeServerTurn(e){this.setActiveServerTurn(e,null)}async sendMessages(e){let t=hp(8),n=new AbortController,r=!1,i=!1,a={};this.prepareBody&&(a=await this.prepareBody({messages:e.messages,trigger:e.trigger,messageId:e.messageId})),e.body&&(a={...a,...e.body});let o=JSON.stringify({messages:e.messages,trigger:e.trigger,...a});this.activeRequestIds?.add(t);let s=this.agent,c=this.activeRequestIds,l=(e,i=!1,a=!0)=>{if(!r){r=!0,a&&this.clearActiveServerTurn(t);try{e()}catch{}i||c?.delete(t),n.abort()}},u=Error(`Aborted`);u.name=`AbortError`,this.setActiveServerTurn(t,()=>r?!1:(l(()=>f.error(u),!0),!0));let d=()=>{r||(this.cancelOnClientAbort?(i&&this.sendCancelFrame(t),l(()=>f.error(u),i)):l(()=>f.error(u),!1,!i))},f,p=new ReadableStream({start(e){f=e,s.addEventListener(`message`,n=>{try{let r=JSON.parse(n.data);if(r.type!==`cf_agent_use_chat_response`||r.id!==t)return;if(r.error){l(()=>e.error(Error(r.body||`Stream error`)));return}if(r.body?.trim())try{let t=JSON.parse(r.body);e.enqueue(t)}catch{}r.done&&l(()=>e.close())}catch{}},{signal:n.signal}),s.addEventListener(`close`,()=>{l(()=>e.close(),!1,!1)},{signal:n.signal})},cancel(){d()}});return e.abortSignal&&(e.abortSignal.addEventListener(`abort`,d,{once:!0}),e.abortSignal.aborted&&d()),r?p:(i=!0,s.send(JSON.stringify({id:t,init:{method:`POST`,body:o},type:`cf_agent_use_chat_request`})),p)}async reconnectToStream(e){if(this._expectToolContinuation)return this._expectToolContinuation=!1,this._createToolContinuationStream();let t=this.activeRequestIds;return new Promise(e=>{let n=!1,r,i=t=>{n||(n=!0,this._resumeResolver=null,this._resumeNoneResolver=null,r&&clearTimeout(r),e(t))};this._resumeNoneResolver=()=>i(null),this._resumeResolver=e=>{let n=e.id;t?.add(n);let r=this._createResumeStream(n);this.agent.send(JSON.stringify({type:`cf_agent_stream_resume_ack`,id:n})),i(r)};try{this.agent.send(JSON.stringify({type:`cf_agent_stream_resume_request`}))}catch{}r=setTimeout(()=>i(null),5e3)})}_createToolContinuationStream(){let e=this.agent,t=this.activeRequestIds,n=new AbortController,r=Error(`Aborted`);r.name=`AbortError`;let i=!1,a=null,o,s=null,c=null,l=(e,t)=>{if(e===void 0&&t===void 0){this._resumeResolver=null,this._resumeNoneResolver=null;return}e&&this._resumeResolver===e&&(this._resumeResolver=null),t&&this._resumeNoneResolver===t&&(this._resumeNoneResolver=null)},u=(e,r,o,s=!1)=>{if(!i){i=!0,this._abortToolContinuation=null,l(r,o);try{e()}catch{}a&&!s&&t?.delete(a),n.abort()}};this._abortToolContinuation=()=>{if(i)return!1;if(a===null)return u(()=>o.error(r),s,c),!0;try{e.send(JSON.stringify({type:`cf_agent_chat_request_cancel`,id:a}))}catch{}return u(()=>o.error(r),s,c,!0),!0};let d=this;return new ReadableStream({start(r){o=r;let i,f=()=>{i&&clearTimeout(i),u(()=>r.close(),p,f)},p=n=>{a||(a=n.id,t?.add(a),l(p,f),i&&clearTimeout(i),e.send(JSON.stringify({type:`cf_agent_stream_resume_ack`,id:a})))};s=p,c=f,i=setTimeout(()=>u(()=>r.close(),p,f),5e3),d._resumeResolver=p,d._resumeNoneResolver=f,e.addEventListener(`message`,e=>{try{let t=JSON.parse(e.data);if(t.type!==`cf_agent_use_chat_response`||a==null||t.id!==a)return;if(t.error){u(()=>r.error(Error(t.body||`Stream error`)),p,f);return}if(t.body?.trim())try{let e=JSON.parse(t.body);r.enqueue(e)}catch{}t.done&&u(()=>r.close(),p,f)}catch{}},{signal:n.signal}),e.addEventListener(`close`,()=>{i&&clearTimeout(i),u(()=>r.close(),p,f)},{signal:n.signal});try{e.send(JSON.stringify({type:`cf_agent_stream_resume_request`}))}catch{u(()=>r.close())}},cancel(){a&&d.cancelOnClientAbort?(d.sendCancelFrame(a),u(()=>{},s,c,!0)):u(()=>{},s,c)}})}_createResumeStream(e){let t=this.agent,n=this.activeRequestIds,r=new AbortController,i=Error(`Aborted`);i.name=`AbortError`;let a=!1,o=(t,i=!1,o=!0)=>{if(!a){a=!0,o&&this.clearActiveServerTurn(e);try{t()}catch{}i||n?.delete(e),r.abort()}};this.setActiveServerTurn(e,()=>a?!1:(o(()=>s.error(i),!0),!0));let s,c=this;return new ReadableStream({start(n){s=n,t.addEventListener(`message`,t=>{try{let r=JSON.parse(t.data);if(r.type!==`cf_agent_use_chat_response`||r.id!==e)return;if(r.error){o(()=>n.error(Error(r.body||`Stream error`)));return}if(r.body?.trim())try{let e=JSON.parse(r.body);n.enqueue(e)}catch{}r.done&&o(()=>n.close())}catch{}},{signal:r.signal}),t.addEventListener(`close`,()=>{o(()=>n.close(),!1,!1)},{signal:r.signal})},cancel(){c.cancelOnClientAbort?(c.sendCancelFrame(e),o(()=>{},!0)):o(()=>{},!1,!1)}})}},Zp=new Set;function Qp(e,t){Zp.has(e)||(Zp.add(e),console.warn(`[@cloudflare/ai-chat] Deprecated: ${t}`))}function $p(e){if(!e)return;let t=Object.entries(e).filter(([e,t])=>t.execute).map(([e,t])=>(t.inputSchema&&!t.parameters&&console.warn(`[useAgentChat] Tool "${e}" uses deprecated 'inputSchema'. Please migrate to 'parameters'.`),{name:e,description:t.description,parameters:t.parameters??t.inputSchema}));return t.length>0?t:void 0}var em=new Map;function tm(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.role===`assistant`)return{index:t,message:n}}return null}function eee(e,t){let n=e.findIndex(e=>e.id===t);if(n<0||n===e.length-1)return e;let r=[...e],[i]=r.splice(n,1);return i?(r.push(i),r):e}function tee(e,t){if(t.length===0)return e;let n=new Set(t.map(e=>e.id)),r=e.filter(e=>!n.has(e.id));return r.length===0?t:[...r,...t]}function nm(e){let{agent:t,getInitialMessages:n,messages:r,onToolCall:i,onData:a,experimental_automaticToolResolution:o,tools:s,toolsRequiringConfirmation:c,autoContinueAfterToolResult:l=!0,autoSendAfterAllConfirmationsResolved:u=!0,resume:d=!0,cancelOnClientAbort:f=!1,body:p,prepareSendMessagesRequest:m,...h}=e;c&&Qp(`useAgentChat.toolsRequiringConfirmation`,`The 'toolsRequiringConfirmation' option is deprecated. Use needsApproval on server-side tools instead. Will be removed in the next major version.`),o&&Qp(`useAgentChat.experimental_automaticToolResolution`,`The 'experimental_automaticToolResolution' option is deprecated. Use the onToolCall callback instead. Will be removed in the next major version.`),e.autoSendAfterAllConfirmationsResolved!==void 0&&Qp(`useAgentChat.autoSendAfterAllConfirmationsResolved`,`The 'autoSendAfterAllConfirmationsResolved' option is deprecated. Use sendAutomaticallyWhen from AI SDK instead. Will be removed in the next major version.`);let g=(0,I.useMemo)(()=>c||(s?Object.entries(s).filter(([e,t])=>!t.execute).map(([e])=>e):[]),[c,s]),_=(0,I.useRef)(i);_.current=i;let v=(0,I.useRef)(a);v.current=a;let y=t.getHttpUrl(),b=y?new URL(y):null;b&&b.searchParams.delete(`_pk`);let x=b?.toString()??null,S=Array.isArray(t.path)?JSON.stringify(t.path.map(e=>[e.agent,e.name])):JSON.stringify([[t.agent??``,t.name??``]]),C=b?`${b.origin}${b.pathname}|${S}`:null,w=S,T=(0,I.useRef)(null),E=(0,I.useRef)(null),D=(0,I.useRef)(null),O=S,k=Array.isArray(t.path)&&D.current!==null&&D.current!==S;(T.current===null||E.current!==t||k)&&(T.current=C??O),E.current=t,D.current=S;let A=(0,I.useRef)(t);A.current=t;async function j({url:t}){if(!t)return[];let n=new URL(t);n.pathname+=`/get-messages`;let r=await fetch(n.toString(),{credentials:e.credentials,headers:e.headers});if(!r.ok)return console.warn(`Failed to fetch initial messages: ${r.status} ${r.statusText}`),[];let i=await r.text();if(!i.trim())return[];try{return JSON.parse(i)}catch(e){return console.warn(`Failed to parse initial messages JSON:`,e),[]}}let M=n||j;function N(e,t){if(em.has(t))return em.get(t);let n=M(e);return em.set(t,n),n}let P=n!==null&&(n||x)?N({agent:t.agent,name:t.name,url:x??void 0},w):null,ee=P?(0,I.use)(P):r??[];(0,I.useEffect)(()=>{if(P)return em.set(w,P),()=>{em.get(w)===P&&em.delete(w)}},[w,P]);let F=(0,I.useRef)(s);F.current=s;let te=(0,I.useRef)(m);te.current=m;let ne=(0,I.useRef)(p);ne.current=p;let re=(0,I.useRef)(new Set),ie=(0,I.useRef)(new Set),ae=(0,I.useRef)(new Set),oe=(0,I.useRef)(null);oe.current===null&&(oe.current=new Xp({agent:A.current,activeRequestIds:re.current,cancelOnClientAbort:f,prepareBody:async({messages:e,trigger:t,messageId:n})=>{let r={},i=ne.current;if(i&&(r={...typeof i==`function`?await i():i}),F.current){let e=$p(F.current);e&&(r.clientTools=e)}if(te.current){let i=await te.current({id:A.current._pk,messages:e,trigger:t,messageId:n});i.body&&Object.assign(r,i.body)}return r}})),oe.current.agent=A.current,oe.current.setCancelOnClientAbort(f);let se=oe.current,ce=Yp({...h,onData:a,messages:ee,transport:se,id:T.current,resume:d}),{messages:le,setMessages:ue,addToolResult:de,addToolApprovalResponse:fe,sendMessage:pe,resumeStream:me,status:he,stop:ge}=ce,_e=(0,I.useRef)(he);_e.current=he;let ve=(0,I.useRef)(!1),ye=(0,I.useRef)(0),[be,xe]=(0,I.useState)(!1),Se=(0,I.useCallback)(()=>{ye.current++,ve.current=!1,xe(!1)},[]),Ce=(0,I.useCallback)(()=>{if(!l||ve.current)return;let e=++ye.current;ve.current=!0,xe(!0),se.expectToolContinuation(),me().finally(()=>{ye.current===e&&(ve.current=!1,xe(!1))})},[l,se,me]),we=(0,I.useCallback)(async()=>{try{se.cancelActiveServerTurn(),await ge()}finally{se.abortActiveToolContinuation()}},[ge,se]),Te=(0,I.useRef)(new Set),Ee=(0,I.useRef)(!1),[De,Oe]=(0,I.useState)(0),[ke,Ae]=(0,I.useState)(new Map),je=(0,I.useRef)(le);je.current=le;let Me=(0,I.useRef)(ee);Me.current=ee;let Ne=(0,I.useRef)(null),Pe=(0,I.useCallback)(()=>{Ne.current=w},[w]);(0,I.useEffect)(()=>{P&&Ne.current!==w&&(Pe(),ue(e=>tee(Me.current,e)))},[w,P,Pe,ue]);let Fe=(0,I.useRef)(new Map),Ie=(0,I.useRef)(null),Le=(0,I.useCallback)(e=>{let t=Ie.current;if(!t)return[...e];let n=je.current.find(e=>e.id===t.assistantId)??e.find(e=>e.id===t.assistantId);return n?[...e.filter(e=>e.id!==t.assistantId),n]:[...e]},[]),Re=(0,I.useCallback)(()=>{if(_e.current!==`streaming`)return;let e=tm(je.current);e&&(Ie.current?.assistantId!==e.message.id&&(Ie.current={assistantId:e.message.id,anchorMessageId:je.current[e.index-1]?.id??null}),ue(e=>{let t=Ie.current;return t?eee(e,t.assistantId):e}))},[ue]),ze=(0,I.useCallback)(e=>{let t=Ie.current;!t||e!==void 0&&t.assistantId!==e||(Ie.current=null,ue(e=>{let n=e.findIndex(e=>e.id===t.assistantId);if(n<0)return e;let r=[...e],[i]=r.splice(n,1);if(!i)return e;if(t.anchorMessageId===null)r.unshift(i);else{let e=r.findIndex(e=>e.id===t.anchorMessageId);r.splice(e>=0?e+1:n,0,i)}return r}))},[ue]),Be=(0,I.useCallback)(e=>{ue(t=>{let n=t[t.length-1];if(!n||n.role!==`assistant`||n.id!==e)return t;ae.current.add(e);let r=[...t];return r[r.length-1]={...n,parts:[]},r})},[ue]),Ve=(0,I.useCallback)(e=>{let t=e.parts,n=t.filter((e,n)=>e.type!==`text`||!(`text`in e)||!e.text?!0:!t.some((t,r)=>r<=n||t.type!==`text`||!(`text`in t)||!t.text?!1:t.text.startsWith(e.text)));return n.length===t.length?e:{...e,parts:n}},[]);(0,I.useEffect)(()=>{if(ae.current.size===0)return;let e=new Set(le.filter(e=>ae.current.has(e.id)&&e.role===`assistant`&&Ve(e)!==e).map(e=>e.id));e.size!==0&&ue(t=>{let n=!1,r=t.map(t=>{if(!e.has(t.id))return t;let r=Ve(t);return r!==t&&(n=!0),r});return n?r:t})},[le,Ve,ue]);let He=(0,I.useCallback)(()=>{Pe(),ue([]),Ae(new Map),Se(),Te.current.clear(),Fe.current.clear(),ie.current.clear(),ae.current.clear(),Ie.current=null},[Pe,ue,Se]),Ue=(0,I.useCallback)(async(e,t)=>{let n=pe(e,t);return e!==void 0&&!(typeof e==`object`&&e&&`messageId`in e&&e.messageId!=null)&&Re(),n},[pe,Re]),We=le[le.length-1],Ge=(()=>{if(!We||We.role!==`assistant`)return{messageId:void 0,toolCallIds:new Set};let e=new Set;for(let t of We.parts??[])rp(t)&&t.state===`input-available`&&g.includes(ap(t))&&e.add(t.toolCallId);return{messageId:We.id,toolCallIds:e}})(),Ke=(0,I.useRef)(Ge);Ke.current=Ge,(0,I.useEffect)(()=>{if(!o||Ee.current)return;let e=le[le.length-1];if(!e||e.role!==`assistant`)return;let t=e.parts.filter(e=>rp(e)&&e.state===`input-available`&&!Te.current.has(e.toolCallId));if(t.length>0){let e=F.current,n=t.filter(t=>rp(t)&&!g.includes(ap(t))&&e?.[ap(t)]?.execute);n.length>0&&(Ee.current=!0,(async()=>{try{let t=[];for(let r of n)if(rp(r)){let n=null,i=ap(r),a=e?.[i];if(a?.execute&&r.input!==void 0)try{n=await a.execute(r.input)}catch(e){n=`Error executing tool: ${e instanceof Error?e.message:String(e)}`}Te.current.add(r.toolCallId),t.push({toolCallId:r.toolCallId,toolName:i,output:n})}if(t.length>0){let n=$p(e);for(let e of t)A.current.send(JSON.stringify({type:`cf_agent_tool_result`,toolCallId:e.toolCallId,toolName:e.toolName,output:e.output,autoContinue:l,clientTools:n}));await Promise.all(t.map(e=>de({tool:e.toolName,toolCallId:e.toolCallId,output:e.output}))),Ae(e=>{let n=new Map(e);for(let e of t)n.set(e.toolCallId,e.output);return n}),Ce()}}finally{Ee.current=!1,Oe(e=>e+1)}})())}},[le,o,de,g,l,Ce,De]);let qe=(0,I.useCallback)((e,t,n,r,i)=>{let a=r===`output-error`?!1:l;A.current.send(JSON.stringify({type:`cf_agent_tool_result`,toolCallId:e,toolName:t,output:n,...r?{state:r}:{},...i===void 0?{}:{errorText:i},autoContinue:a,clientTools:F.current?$p(F.current):void 0})),r!==`output-error`&&Ae(t=>new Map(t).set(e,n)),a&&Ce()},[l,Ce]),Je=(0,I.useCallback)((e,t)=>{A.current.send(JSON.stringify({type:`cf_agent_tool_approval`,toolCallId:e,approved:t,autoContinue:l})),l&&Ce()},[l,Ce]);(0,I.useEffect)(()=>{let e=_.current;if(!e)return;let t=le[le.length-1];if(!t||t.role!==`assistant`)return;let n=t.parts.filter(e=>rp(e)&&e.state===`input-available`&&!Te.current.has(e.toolCallId));for(let t of n)if(rp(t)){let n=t.toolCallId,r=ap(t);Te.current.add(n),e({toolCall:{toolCallId:n,toolName:r,input:t.input},addToolOutput:e=>{qe(e.toolCallId,r,e.output,e.state,e.errorText),de({tool:r,toolCallId:e.toolCallId,output:e.state===`output-error`?e.errorText??`Tool execution denied by user`:e.output})}})}},[le,qe,de]);let Ye=(0,I.useRef)({status:`idle`}),[Xe,Ze]=(0,I.useState)(!1);(0,I.useEffect)(()=>{let e=Fe.current;function n(t){if(typeof t.data!=`string`)return;let n;try{n=JSON.parse(t.data)}catch{return}switch(n.type){case`cf_agent_chat_clear`:Ye.current=vp(Ye.current,{type:`clear`}).state,Ze(!1),He();break;case`cf_agent_chat_messages`:ue(Le(n.messages));break;case`cf_agent_message_updated`:ue(e=>{let t=n.message,r=e.findIndex(e=>e.id===t.id);if(r<0){let n=new Set(t.parts.filter(e=>`toolCallId`in e&&e.toolCallId).map(e=>e.toolCallId));n.size>0&&(r=e.findIndex(e=>e.parts.some(e=>`toolCallId`in e&&n.has(e.toolCallId))))}if(r>=0){let n=[...e];return n[r]={...t,id:e[r].id},n}return e});break;case`cf_agent_stream_resume_none`:se.handleStreamResumeNone();break;case`cf_agent_stream_resuming`:if(!d&&!se.isAwaitingResume()||(ve.current||ie.current.add(n.id),se.handleStreamResuming(n))||re.current.has(n.id))return;Ye.current=vp(Ye.current,{type:`resume-fallback`,streamId:n.id,messageId:hp()}).state,se.observeServerTurn(n.id),Ze(!0),A.current.send(JSON.stringify({type:`cf_agent_stream_resume_ack`,id:n.id}));break;case`cf_agent_use_chat_response`:{if(re.current.has(n.id)){if(n.body?.trim())try{let t=JSON.parse(n.body);t.type===`start`&&typeof t.messageId==`string`&&(e.set(n.id,t.messageId),n.replay&&ie.current.has(n.id)&&(ie.current.delete(n.id),Be(t.messageId)))}catch{}(n.done||n.replayComplete)&&ie.current.delete(n.id),n.done&&(Ye.current.status===`observing`&&Ye.current.streamId===n.id&&(Ye.current={status:`idle`},Ze(!1)),se.handleServerTurnCompleted(n.id),ze(e.get(n.id)),e.delete(n.id),re.current.delete(n.id));return}let t;if(n.replay&&Ye.current.status!==`observing`&&!ie.current.has(n.id))return;if(n.body?.trim())try{t=JSON.parse(n.body),n.replay&&ie.current.has(n.id)&&typeof t.messageId==`string`&&t.type===`start`&&(ie.current.delete(n.id),Be(t.messageId)),typeof t.type==`string`&&t.type.startsWith(`data-`)&&v.current&&v.current(t)}catch(e){console.warn(`[useAgentChat] Failed to parse stream chunk:`,e instanceof Error?e.message:e,`body:`,n.body?.slice(0,100))}(n.done||n.replayComplete)&&ie.current.delete(n.id),n.done&&se.handleServerTurnCompleted(n.id);let r=vp(Ye.current,{type:`response`,streamId:n.id,messageId:hp(),chunkData:t,done:n.done,error:n.error,replay:n.replay,replayComplete:n.replayComplete,continuation:n.continuation,currentMessages:n.continuation?je.current:void 0});Ye.current=r.state,r.messagesUpdate&&ue(r.messagesUpdate),Ze(r.isStreaming);break}}}return t.addEventListener(`message`,n),()=>{t.removeEventListener(`message`,n),Ye.current={status:`idle`},Ze(!1),Ie.current=null,e.clear()}},[t,ue,d,se,Le,Be,ze,He]);let Qe=async e=>{let{toolCallId:t}=e,n=`tool`in e?e.tool:``,r=`output`in e?e.output:void 0;if(A.current.send(JSON.stringify({type:`cf_agent_tool_result`,toolCallId:t,toolName:n,output:r,autoContinue:l,clientTools:F.current?$p(F.current):void 0})),Ae(e=>new Map(e).set(t,r)),de(e),l&&Ce(),!l){if(!u){pe();return}let e=Ke.current?.toolCallIds;if(!e){pe();return}let n=e.size===1&&e.has(t);e.has(t)&&e.delete(t),(n||e.size===0)&&pe()}},$e=e=>{let{id:t,approved:n}=e,r;for(let e of je.current){for(let n of e.parts)if(`toolCallId`in n&&`approval`in n&&n.approval?.id===t){r=n.toolCallId;break}if(r)break}r?Je(r,n):console.warn(`[useAgentChat] addToolApprovalResponse: Could not find toolCallId for approval ID "${t}". Server will not be notified, which may cause duplicate messages.`),fe(e)},et=(0,I.useMemo)(()=>ke.size===0?le:le.map(e=>({...e,parts:e.parts.map(e=>!(`toolCallId`in e)||!(`state`in e)||e.state!==`input-available`||!ke.has(e.toolCallId)?e:{...e,state:`output-available`,output:ke.get(e.toolCallId)})})),[le,ke]);(0,I.useEffect)(()=>{let e=new Set;for(let t of le)for(let n of t.parts)`toolCallId`in n&&n.toolCallId&&e.add(n.toolCallId);Ae(t=>{if(t.size===0)return t;let n=!1;for(let r of t.keys())if(!e.has(r)){n=!0;break}if(!n)return t;let r=new Map;for(let[n,i]of t)e.has(n)&&r.set(n,i);return r});for(let t of Te.current)e.has(t)||Te.current.delete(t)},[le]);let tt=(0,I.useCallback)(e=>{let t=e.toolName??``;qe(e.toolCallId,t,e.output,e.state,e.errorText),de({tool:t,toolCallId:e.toolCallId,output:e.state===`output-error`?e.errorText??`Tool execution denied by user`:e.output})},[qe,de]),nt=et[et.length-1],rt=(()=>{let e=!!i;if(!e&&!s||!nt||nt.role!==`assistant`)return!1;for(let t of nt.parts){if(!rp(t)||t.state!==`input-available`)continue;let n=ap(t);if(!g.includes(n)&&(e||s?.[n]?.execute))return!0}return!1})(),it=Xe||rt,at=he===`streaming`||it;return{...ce,messages:et,isServerStreaming:it,isStreaming:at,isToolContinuation:be,sendMessage:Ue,stop:we,addToolOutput:tt,addToolResult:Qe,addToolApprovalResponse:$e,clearHistory:()=>{He(),t.send(JSON.stringify({type:`cf_agent_chat_clear`}))},setMessages:e=>{let n;n=typeof e==`function`?e(je.current):e,n.length===0&&Pe(),ue(n),t.send(JSON.stringify({messages:n,type:`cf_agent_chat_messages`}))}}}function rm(e){return e?{headers:{Authorization:`Bearer ${e}`},protocols:[`bearer`,e]}:{}}function im(e){let{enabled:t,host:n,agentName:r,actorId:i,name:a,sub:o,authToken:s,onError:c,onOpen:l,onClose:u}=e;return mt({enabled:t,host:n,agent:r,name:i?`${i}:${a}`:a,sub:o,onOpen:l,onClose:u,onError:c,...rm(s)})}function am(e){let{toolContext:t,welcomeMessage:n,...r}=e,i=im({...r,enabled:r.enabled??!!r.name}),a=i.state?.status??`connecting`,o=nm({agent:i,body:t??{},getInitialMessages:r.name&&a===`connected`?void 0:null}),s=(0,I.useRef)(!1);(0,I.useEffect)(()=>{n&&a===`connected`&&o.messages.length===0&&!s.current&&(s.current=!0,o.setMessages([{id:`welcome-message`,role:`assistant`,parts:[{type:`text`,text:n}]}]))},[a,o.messages.length,n]);async function c(e,t,n){return i.call(`submitMessageFeedback`,[e,t,n])}async function l(){return await i.call(`getMessageFeedback`)}return{status:a,agent:i,chat:o,submitMessageFeedback:c,getMessageFeedback:l}}function nee(e){let{toolContext:t,welcomeMessage:n,...r}=e,[i,a]=(0,I.useState)(),o=im(r),s=async()=>(await o.call(`getChats`)).map(e=>{let t={...e,name:e.durable_object_name};return delete t.durable_object_name,t}),c=async()=>{let e=await o.call(`createChat`);return a(e),await s(),e},l=e=>{a(e)},u=async e=>{await o.call(`deleteChat`,[e]),a(void 0),await s()},d=!!i&&o.state?.status===`connected`,f=am({...r,enabled:!!i,sub:i?[{agent:o.state?.subAgentName??``,name:i}]:void 0,getInitialMessages:d?void 0:null,toolContext:t,welcomeMessage:n});return{currentChatName:i,status:(i?f.agent.state?.status:o.state?.status)??`connecting`,assistant:{getChats:s,createChat:c,openChat:l,deleteChat:u},chat:f}}function om({status:e,chatKey:t,submitMessageFeedback:n,getMessageFeedback:r}){let[i,a]=(0,I.useState)({}),o=(0,I.useRef)(n),s=(0,I.useRef)(r);o.current=n,s.current=r;let c=(0,I.useCallback)(()=>{s.current().then(e=>a(e??{})).catch(()=>{})},[]);return(0,I.useEffect)(()=>{e===`connected`?c():a({})},[e,t,c]),{feedback:i,onFeedback:(0,I.useCallback)((e,t,n)=>{a(r=>({...r,[e]:{rating:t,comment:n}})),Promise.resolve(o.current(e,t,n)).catch(()=>c())},[c])}}function sm(){return typeof window<`u`}function cm(e){return dm(e)?(e.nodeName||``).toLowerCase():`#document`}function lm(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function um(e){return((dm(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function dm(e){return sm()?e instanceof Node||e instanceof lm(e).Node:!1}function fm(e){return sm()?e instanceof Element||e instanceof lm(e).Element:!1}function pm(e){return sm()?e instanceof HTMLElement||e instanceof lm(e).HTMLElement:!1}function mm(e){return!sm()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof lm(e).ShadowRoot}function hm(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Cm(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ree(e){return/^(table|td|th)$/.test(cm(e))}function gm(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var iee=/transform|translate|scale|rotate|perspective|filter/,aee=/paint|layout|strict|content/,_m=e=>!!e&&e!==`none`,vm;function ym(e){let t=fm(e)?Cm(e):e;return _m(t.transform)||_m(t.translate)||_m(t.scale)||_m(t.rotate)||_m(t.perspective)||!xm()&&(_m(t.backdropFilter)||_m(t.filter))||iee.test(t.willChange||``)||aee.test(t.contain||``)}function bm(e){let t=Tm(e);for(;pm(t)&&!Sm(t);){if(ym(t))return t;if(gm(t))return null;t=Tm(t)}return null}function xm(){return vm??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),vm}function Sm(e){return/^(html|body|#document)$/.test(cm(e))}function Cm(e){return lm(e).getComputedStyle(e)}function wm(e){return fm(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Tm(e){if(cm(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||mm(e)&&e.host||um(e);return mm(t)?t.host:t}function Em(e){let t=Tm(e);return Sm(t)?e.ownerDocument?e.ownerDocument.body:e.body:pm(t)&&hm(t)?t:Em(t)}function Dm(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Em(e),i=r===e.ownerDocument?.body,a=lm(r);if(i){let e=Om(a);return t.concat(a,a.visualViewport||[],hm(r)?r:[],e&&n?Dm(e):[])}else return t.concat(r,Dm(r,[],n))}function Om(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var km={};function Am(e,t){let n=I.useRef(km);return n.current===km&&(n.current=e(t)),n}var jm=I[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Mm=jm&&jm!==I.useLayoutEffect?jm:e=>e();function Nm(e){let t=Am(Pm).current;return t.next=e,Mm(t.effect),t.trampoline}function Pm(){let e={next:void 0,callback:Fm,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Fm(){}var Im={...I},Lm=typeof document<`u`?I.useLayoutEffect:()=>{};function Rm(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var zm={};function Bm(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Vm(t);let a=Vm(e);return t&&(a=Hm(a,t)),n&&(a=Hm(a,n)),r&&(a=Hm(a,r)),i&&(a=Hm(a,i)),a}function oee(e){if(e.length===0)return zm;if(e.length===1)return Vm(e[0]);let t=Vm(e[0]);for(let n=1;n<e.length;n+=1)t=Hm(t,e[n]);return t}function Vm(e){return Km(e)?{...qm(e,zm)}:Um(e)}function Hm(e,t){return Km(t)?qm(t,e):Wm(e,t)}function Um(e){let t={...e};for(let e in t){let n=t[e];Gm(e,n)&&(t[e]=Ym(n))}return t}function Wm(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Rm(e.style,r);break;case`className`:e[n]=Zm(e.className,r);break;default:Gm(n,r)?e[n]=Jm(e[n],r):e[n]=r}}return e}function Gm(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 Km(e){return typeof e==`function`}function qm(e,t){return Km(e)?e(t):e??zm}function Jm(e,t){return t?e?(...n)=>{let r=n[0];if(Qm(r)){let i=r;Xm(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Ym(t):e}function Ym(e){return e&&((...t)=>{let n=t[0];return Qm(n)&&Xm(n),e(...t)})}function Xm(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Zm(e,t){return t?e?t+` `+e:t:e}function Qm(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function $m(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 eh=$m(`https://base-ui.com/production-error`,`Base UI`),th=I.createContext(void 0);function see(e=!1){let t=I.useContext(th);if(t===void 0&&!e)throw Error(eh(16));return t}function cee(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:I.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 nh(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=I.useRef(null),s=see(!0),c=a??s!==void 0,{props:l}=cee({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=I.useCallback(()=>{let e=o.current;rh(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Lm(u,[u]),{getButtonProps:I.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Bm({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Xm(e),o?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,a=e.currentTarget,s=rh(a),l=!i&&lee(a),u=r&&(i?s:!l),d=e.key===`Enter`,f=e.key===` `,p=a.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(r&&c&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),l||i&&s?(a.click(),e.preventBaseUIHandler()):u&&(n?.(e),e.preventBaseUIHandler());return}u&&(!i&&(f||d)&&e.preventDefault(),!i&&d&&n?.(e))},onKeyUp(e){if(!t){if(Xm(e),a?.(e),e.target===e.currentTarget&&i&&c&&rh(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&e.key===` `&&n?.(e)}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?void 0:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Nm(e=>{o.current=e,u()})}}function rh(e){return pm(e)&&e.tagName===`BUTTON`}function lee(e){return!!(e?.tagName===`A`&&e?.href)}function ih(e,t,n,r){let i=Am(ah).current;return dee(i,e,t,n,r)&&oh(i,[e,t,n,r]),i.callback}function uee(e){let t=Am(ah).current;return fee(t,e)&&oh(t,e),t.callback}function ah(){return{callback:null,cleanup:null,refs:[]}}function dee(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function fee(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function oh(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;break;default:}}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;break;default:}}}}}}var pee=19;function sh(e){return pee>=e}function ch(e){if(!I.isValidElement(e))return null;let t=e,n=t.props;return(sh(19)?n?.ref:t.ref)??null}function lh(){}Object.freeze([]);var uh=Object.freeze({});function dh(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 fh(e,t){return typeof e==`function`?e(t):e}function ph(e,t){return typeof e==`function`?e(t):e}function mh(e,t,n={}){let r=t.render,i=hh(t,n);return n.enabled===!1?null:vh(e,r,i,n.state??uh)}function hh(e,t={}){let{className:n,style:r,render:i}=e,{state:a=uh,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?fh(n,a):void 0,d=l?ph(r,a):void 0,f=l?dh(a,c):uh,p=l&&s?gh(s):void 0,m=l?Rm(f,p)??{}:uh;return typeof document<`u`&&(l?Array.isArray(o)?m.ref=uee([m.ref,ch(i),...o]):m.ref=ih(m.ref,ch(i),o):ih(null,null)),l?(u!==void 0&&(m.className=Zm(m.className,u)),d!==void 0&&(m.style=Rm(m.style,d)),m):uh}function gh(e){return Array.isArray(e)?oee(e):Bm(void 0,e)}var _h=Symbol.for(`react.lazy`);function vh(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Bm(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===_h&&(i=I.Children.toArray(t)[0]),I.cloneElement(i,e)}if(e&&typeof e==`string`)return yh(e,n);throw Error(eh(8))}function yh(e,t){return e===`button`?(0,I.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,I.createElement)(`img`,{alt:``,...t,key:t.key}):I.createElement(e,t)}var bh=I.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}=nh({disabled:i,focusableWhenDisabled:a,native:o});return mh(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function xh(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=xh(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Sh(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xh(e))&&(r&&(r+=` `),r+=t);return r}var Ch=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,wh=Sh,Th=(e,t)=>n=>{if(t?.variants==null)return wh(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Ch(t)||Ch(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return wh(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Eh=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Dh=(e,t)=>({classGroupId:e,validator:t}),Oh=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),kh=`-`,Ah=[],jh=`arbitrary..`,Mh=e=>{let t=Fh(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Ph(e);let n=e.split(kh);return Nh(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Eh(i,t):t:i||Ah}return n[e]||Ah}}},Nh=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Nh(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(kh):e.slice(t).join(kh),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Ph=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?jh+r:void 0})(),Fh=e=>{let{theme:t,classGroups:n}=e;return Ih(n,t)},Ih=(e,t)=>{let n=Oh();for(let r in e){let i=e[r];Lh(i,n,r,t)}return n},Lh=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Rh(i,t,n,r)}},Rh=(e,t,n,r)=>{if(typeof e==`string`){zh(e,t,n);return}if(typeof e==`function`){Bh(e,t,n,r);return}mee(e,t,n,r)},zh=(e,t,n)=>{let r=e===``?t:Vh(t,e);r.classGroupId=n},Bh=(e,t,n,r)=>{if(hee(e)){Lh(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Dh(n,e))},mee=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Lh(o,Vh(t,a),n,r)}},Vh=(e,t)=>{let n=e,r=t.split(kh),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Oh(),n.nextPart.set(t,i)),n=i}return n},hee=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,gee=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Hh=`!`,Uh=`:`,_ee=[],Wh=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),vee=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Uh){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Hh)?(c=s.slice(0,-1),l=!0):s.startsWith(Hh)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Wh(t,l,c,u)};if(t){let e=t+Uh,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Wh(_ee,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},yee=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},bee=e=>({cache:gee(e.cacheSize),parseClassName:vee(e),sortModifiers:yee(e),postfixLookupClassGroupIds:xee(e),...Mh(e)}),xee=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},See=/\s+/,Cee=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(See),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Hh:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},wee=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Gh(n))&&(i&&(i+=` `),i+=r);return i},Gh=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Gh(e[r]))&&(n&&(n+=` `),n+=t);return n},Tee=(e,...t)=>{let n,r,i,a,o=o=>(n=bee(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Cee(e,n);return i(e,a),a};return a=o,(...e)=>a(wee(...e))},Eee=[],Kh=e=>{let t=t=>t[e]||Eee;return t.isThemeGetter=!0,t},qh=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Jh=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Dee=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Oee=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kee=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Aee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jee=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Mee=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yh=e=>Dee.test(e),Xh=e=>!!e&&!Number.isNaN(Number(e)),Zh=e=>!!e&&Number.isInteger(Number(e)),Qh=e=>e.endsWith(`%`)&&Xh(e.slice(0,-1)),$h=e=>Oee.test(e),eg=()=>!0,Nee=e=>kee.test(e)&&!Aee.test(e),tg=()=>!1,ng=e=>jee.test(e),rg=e=>Mee.test(e),ig=e=>!sg(e)&&!hg(e),ag=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),og=e=>Cg(e,Dg,tg),sg=e=>qh.test(e),cg=e=>Cg(e,Og,Nee),lg=e=>Cg(e,kg,Xh),ug=e=>Cg(e,jg,eg),dg=e=>Cg(e,Ag,tg),fg=e=>Cg(e,Tg,tg),pg=e=>Cg(e,Eg,rg),mg=e=>Cg(e,Mg,ng),hg=e=>Jh.test(e),gg=e=>wg(e,Og),_g=e=>wg(e,Ag),vg=e=>wg(e,Tg),yg=e=>wg(e,Dg),bg=e=>wg(e,Eg),xg=e=>wg(e,Mg,!0),Sg=e=>wg(e,jg,!0),Cg=(e,t,n)=>{let r=qh.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},wg=(e,t,n=!1)=>{let r=Jh.exec(e);return r?r[1]?t(r[1]):n:!1},Tg=e=>e===`position`||e===`percentage`,Eg=e=>e===`image`||e===`url`,Dg=e=>e===`length`||e===`size`||e===`bg-size`,Og=e=>e===`length`,kg=e=>e===`number`,Ag=e=>e===`family-name`,jg=e=>e===`number`||e===`weight`,Mg=e=>e===`shadow`,Ng=Tee(()=>{let e=Kh(`color`),t=Kh(`font`),n=Kh(`text`),r=Kh(`font-weight`),i=Kh(`tracking`),a=Kh(`leading`),o=Kh(`breakpoint`),s=Kh(`container`),c=Kh(`spacing`),l=Kh(`radius`),u=Kh(`shadow`),d=Kh(`inset-shadow`),f=Kh(`text-shadow`),p=Kh(`drop-shadow`),m=Kh(`blur`),h=Kh(`perspective`),g=Kh(`aspect`),_=Kh(`ease`),v=Kh(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),hg,sg],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[hg,sg,c],T=()=>[Yh,`full`,`auto`,...w()],E=()=>[Zh,`none`,`subgrid`,hg,sg],D=()=>[`auto`,{span:[`full`,Zh,hg,sg]},Zh,hg,sg],O=()=>[Zh,`auto`,hg,sg],k=()=>[`auto`,`min`,`max`,`fr`,hg,sg],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Yh,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Yh,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ee=()=>[Yh,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],F=()=>[e,hg,sg],te=()=>[...b(),vg,fg,{position:[hg,sg]}],ne=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],re=()=>[`auto`,`cover`,`contain`,yg,og,{size:[hg,sg]}],ie=()=>[Qh,gg,cg],ae=()=>[``,`none`,`full`,l,hg,sg],oe=()=>[``,Xh,gg,cg],se=()=>[`solid`,`dashed`,`dotted`,`double`],ce=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],le=()=>[Xh,Qh,vg,fg],ue=()=>[``,`none`,m,hg,sg],de=()=>[`none`,Xh,hg,sg],fe=()=>[`none`,Xh,hg,sg],pe=()=>[Xh,hg,sg],me=()=>[Yh,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[$h],breakpoint:[$h],color:[eg],container:[$h],"drop-shadow":[$h],ease:[`in`,`out`,`in-out`],font:[ig],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[$h],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[$h],shadow:[$h],spacing:[`px`,Xh],text:[$h],"text-shadow":[$h],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Yh,sg,hg,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,hg,sg]}],"container-named":[ag],columns:[{columns:[Xh,sg,hg,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Zh,`auto`,hg,sg]}],basis:[{basis:[Yh,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Xh,Yh,`auto`,`initial`,`none`,sg]}],grow:[{grow:[``,Xh,hg,sg]}],shrink:[{shrink:[``,Xh,hg,sg]}],order:[{order:[Zh,`first`,`last`,`none`,hg,sg]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...ee()]}],"min-block-size":[{"min-block":[`auto`,...ee()]}],"max-block-size":[{"max-block":[`none`,...ee()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,gg,cg]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Sg,ug]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Qh,sg]}],"font-family":[{font:[_g,dg,t]}],"font-features":[{"font-features":[sg]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,hg,sg]}],"line-clamp":[{"line-clamp":[Xh,`none`,hg,lg]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,hg,sg]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,hg,sg]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...se(),`wavy`]}],"text-decoration-thickness":[{decoration:[Xh,`from-font`,`auto`,hg,cg]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[Xh,`auto`,hg,sg]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Zh,hg,sg]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,hg,sg]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,hg,sg]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:te()}],"bg-repeat":[{bg:ne()}],"bg-size":[{bg:re()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Zh,hg,sg],radial:[``,hg,sg],conic:[Zh,hg,sg]},bg,pg]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...se(),`hidden`,`none`]}],"divide-style":[{divide:[...se(),`hidden`,`none`]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...se(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Xh,hg,sg]}],"outline-w":[{outline:[``,Xh,gg,cg]}],"outline-color":[{outline:F()}],shadow:[{shadow:[``,`none`,u,xg,mg]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":[`none`,d,xg,mg]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:oe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[Xh,cg]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":[`none`,f,xg,mg]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[Xh,hg,sg]}],"mix-blend":[{"mix-blend":[...ce(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Xh]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[hg,sg]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Xh]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:te()}],"mask-repeat":[{mask:ne()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,hg,sg]}],filter:[{filter:[``,`none`,hg,sg]}],blur:[{blur:ue()}],brightness:[{brightness:[Xh,hg,sg]}],contrast:[{contrast:[Xh,hg,sg]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,xg,mg]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:[``,Xh,hg,sg]}],"hue-rotate":[{"hue-rotate":[Xh,hg,sg]}],invert:[{invert:[``,Xh,hg,sg]}],saturate:[{saturate:[Xh,hg,sg]}],sepia:[{sepia:[``,Xh,hg,sg]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,hg,sg]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[Xh,hg,sg]}],"backdrop-contrast":[{"backdrop-contrast":[Xh,hg,sg]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Xh,hg,sg]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xh,hg,sg]}],"backdrop-invert":[{"backdrop-invert":[``,Xh,hg,sg]}],"backdrop-opacity":[{"backdrop-opacity":[Xh,hg,sg]}],"backdrop-saturate":[{"backdrop-saturate":[Xh,hg,sg]}],"backdrop-sepia":[{"backdrop-sepia":[``,Xh,hg,sg]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,hg,sg]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Xh,`initial`,hg,sg]}],ease:[{ease:[`linear`,`initial`,_,hg,sg]}],delay:[{delay:[Xh,hg,sg]}],animate:[{animate:[`none`,v,hg,sg]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,hg,sg]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":[`scale-3d`],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[hg,sg,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":[`translate-none`],zoom:[{zoom:[Zh,hg,sg]}],accent:[{accent:F()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,hg,sg]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":F()}],"scrollbar-track-color":[{"scrollbar-track":F()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,hg,sg]}],fill:[{fill:[`none`,...F()]}],"stroke-w":[{stroke:[Xh,gg,cg,lg]}],stroke:[{stroke:[`none`,...F()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Pg(...e){return Ng(Sh(e))}var Fg=i((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})),Ig=i(((e,t)=>{t.exports=Fg()})),U=Ig(),Lg=Th(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Rg({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,U.jsx)(bh,{"data-slot":`button`,className:Pg(Lg({variant:t,size:n,className:e})),...r})}var zg=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Bg=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Vg=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Hg=e=>{let t=Vg(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ug={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Wg=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Gg=(0,I.createContext)({}),Kg=()=>(0,I.useContext)(Gg),qg=(0,I.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Kg()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,I.createElement)(`svg`,{ref:c,...Ug,width:t??l??Ug.width,height:t??l??Ug.height,stroke:e??f,strokeWidth:m,className:zg(`lucide`,p,i),...!a&&!Wg(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,I.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Jg=(e,t)=>{let n=(0,I.forwardRef)(({className:n,...r},i)=>(0,I.createElement)(qg,{ref:i,iconNode:t,className:zg(`lucide-${Bg(Hg(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Hg(e),n},Yg=Jg(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Xg=Jg(`book`,[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}]]),Zg=Jg(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),Qg=Jg(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),$g=Jg(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),e_=Jg(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),t_=Jg(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),n_=Jg(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),r_=Jg(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),i_=Jg(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),a_=Jg(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),o_=Jg(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Pee=Jg(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Fee=Jg(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Iee=Jg(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),s_=Jg(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),Lee=Jg(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),Ree=Jg(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),zee=Jg(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Bee=Jg(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),c_=Jg(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Vee=Jg(`thumbs-down`,[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]),Hee=Jg(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]),Uee=Jg(`trash`,[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Wee=Jg(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),l_=Jg(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Gee={damping:.7,stiffness:.05,mass:1.25},Kee=70,qee=1e3/60,Jee=350,u_=!1;globalThis.document?.addEventListener(`mousedown`,()=>{u_=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{u_=!1}),globalThis.document?.addEventListener(`click`,()=>{u_=!1});var Yee=(e={})=>{let[t,n]=(0,I.useState)(!1),[r,i]=(0,I.useState)(e.initial!==!1),[a,o]=(0,I.useState)(!1),s=(0,I.useRef)(null);s.current=e;let c=(0,I.useCallback)(()=>{if(!u_)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(g.current)||g.current?.contains(t.commonAncestorContainer)},[]),l=(0,I.useCallback)(e=>{d.isAtBottom=e,i(e)},[]),u=(0,I.useCallback)(e=>{d.escapedFromLock=e,n(e)},[]),d=(0,I.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(e){if(g.current){let{scrollBehavior:t}=getComputedStyle(g.current);t!==`auto`&&(g.current.style.scrollBehavior=`auto`),g.current.scrollTop=e,d.ignoreScrollToTop=g.current.scrollTop,t!==`auto`&&(g.current.style.scrollBehavior=t)}},get targetScrollTop(){return!g.current||!_.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!_.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let r=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:g.current,contentElement:_.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:r},requestAnimationFrame(()=>{n=void 0}),r},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Kee}}},[]),f=(0,I.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=p_(s.current,e.animation),{ignoreEscapes:r=!1}=e,i,a=d.calculatedTargetScrollTop;e.duration instanceof Promise?e.duration.finally(()=>{i=Date.now()}):i=t+(e.duration??0);let o=async()=>{let e=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;let{scrollTop:l}=d,u=performance.now(),p=(u-(d.lastTick??u))/qee;if(d.animation||={behavior:n,promise:e,ignoreEscapes:r},d.animation.behavior===n&&(d.lastTick=u),c()||t>Date.now())return o();if(l<Math.min(a,d.calculatedTargetScrollTop)){if(d.animation?.behavior===n){if(n===`instant`)return d.scrollTop=d.calculatedTargetScrollTop,o();d.velocity=(n.damping*d.velocity+n.stiffness*d.scrollDifference)/n.mass,d.accumulated+=d.velocity*p,d.scrollTop+=d.accumulated,d.scrollTop!==l&&(d.accumulated=0)}return o()}return i>Date.now()?(a=d.calculatedTargetScrollTop,o()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:p_(s.current,s.current.resize),ignoreEscapes:r,duration:Math.max(0,i-Date.now())||void 0}):d.isAtBottom)});return e.then(e=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),e))};return e.wait!==!0&&(d.animation=void 0),d.animation?.behavior===n?d.animation.promise:o()},[l,c,d]),p=(0,I.useCallback)(()=>{u(!0),l(!1)},[u,l]),m=(0,I.useCallback)(({target:e})=>{if(e!==g.current)return;let{scrollTop:t,ignoreScrollToTop:n}=d,{lastScrollTop:r=t}=d;d.lastScrollTop=t,d.ignoreScrollToTop=void 0,n&&n>t&&(r=n),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||t===n)return;if(c()){u(!0),l(!1);return}let e=t>r,i=t<r;if(d.animation?.ignoreEscapes){d.scrollTop=r;return}i&&(u(!0),l(!1)),e&&u(!1),!d.escapedFromLock&&d.isNearBottom&&l(!0)},1)},[u,l,c,d]),h=(0,I.useCallback)(({target:e,deltaY:t})=>{let n=e;for(;![`scroll`,`auto`].includes(getComputedStyle(n).overflow);){if(!n.parentElement)return;n=n.parentElement}n===g.current&&t<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),l(!1))},[u,l,d]),g=d_(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=d_(e=>{if(d.resizeObserver?.disconnect(),!e)return;let t;d.resizeObserver=new ResizeObserver(([e])=>{let{height:n}=e.contentRect,r=n-(t??n);if(d.resizeDifference=r,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),r>=0){let e=p_(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:Jee})}else d.isNearBottom&&(u(!1),l(!0));t=n,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===r&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(e)},[]);return{contentRef:_,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:d}};function d_(e,t){let n=(0,I.useCallback)(t=>(n.current=t,e(t)),t);return n}var f_=new Map;function p_(...e){let t={...Gee},n=!1;for(let r of e){if(r===`instant`){n=!0;continue}typeof r==`object`&&(n=!1,t.damping=r.damping??t.damping,t.stiffness=r.stiffness??t.stiffness,t.mass=r.mass??t.mass)}let r=JSON.stringify(t);return f_.has(r)||f_.set(r,Object.freeze(t)),n?`instant`:f_.get(r)}var m_=(0,I.createContext)(null),Xee=typeof window<`u`?I.useLayoutEffect:I.useEffect;function h_({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:o,targetScrollTop:s,contextRef:c,...l}){let u=(0,I.useRef)(null),d=Yee({mass:i,damping:a,stiffness:o,resize:n,initial:r,targetScrollTop:I.useCallback((e,t)=>(y?.targetScrollTop??s)?.(e,t)??e,[s])}),{scrollRef:f,contentRef:p,scrollToBottom:m,stopScroll:h,isAtBottom:g,escapedFromLock:_,state:v}=e??d,y=(0,I.useMemo)(()=>({scrollToBottom:m,stopScroll:h,scrollRef:f,isAtBottom:g,escapedFromLock:_,contentRef:p,state:v,get targetScrollTop(){return u.current},set targetScrollTop(e){u.current=e}}),[m,g,p,f,h,_,v]);return(0,I.useImperativeHandle)(c,()=>y,[y]),Xee(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),I.createElement(m_.Provider,{value:y},I.createElement(`div`,{...l},typeof t==`function`?t(y):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=g_();return I.createElement(`div`,{ref:r.scrollRef,style:{height:`100%`,width:`100%`,scrollbarGutter:`stable both-edges`},className:t},I.createElement(`div`,{...n,ref:r.contentRef},typeof e==`function`?e(r):e))}e.Content=t})(h_||={});function g_(){let e=(0,I.useContext)(m_);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}var Zee=({className:e,...t})=>(0,U.jsx)(h_,{className:Pg(`relative flex-1 overflow-y-hidden`,e),initial:`smooth`,resize:`smooth`,role:`log`,...t}),Qee=({className:e,...t})=>(0,U.jsx)(h_.Content,{className:Pg(`flex flex-col gap-8 p-4`,e),...t}),$ee=({className:e,...t})=>{let{isAtBottom:n,scrollToBottom:r}=g_(),i=(0,I.useCallback)(()=>{r()},[r]);return!n&&(0,U.jsx)(Rg,{className:Pg(`absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted`,e),onClick:i,size:`icon`,type:`button`,variant:`outline`,...t,children:(0,U.jsx)(Yg,{className:`size-4`})})};function __(e){return mh(e.defaultTagName??`div`,e,e)}var ete=Th(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0`,vertical:`flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0`}},defaultVariants:{orientation:`horizontal`}});function tte({className:e,orientation:t,...n}){return(0,U.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:Pg(ete({orientation:t}),e),...n})}function nte({className:e,render:t,...n}){return __({defaultTagName:`div`,props:Bm({className:Pg(`flex items-center gap-2 rounded-lg border bg-muted px-2.5 text-sm font-medium [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e)},n),render:t,state:{slot:`button-group-text`}})}var v_=[],y_=void 0;function rte(){return y_}function ite(e){v_.push(e)}function b_(e){let t=(t,n)=>{let r=Am(ote).current,i;try{y_=r;for(let e of v_)e.before(r);i=e(t,n);for(let e of v_)e.after(r);r.didInitialize=!0}finally{y_=void 0}return i};return t.displayName=e.displayName||e.name,t}function ate(e){return I.forwardRef(b_(e))}function ote(){return{didInitialize:!1}}function x_(e){let t=I.useRef(!0);t.current&&(t.current=!1,e())}var S_=I.createContext(void 0);function C_(e){let t=I.useContext(S_);if(t===void 0&&!e)throw Error(eh(72));return t}var ste=[];function w_(e){I.useEffect(e,ste)}var T_=0,E_=class e{static create(){return new e}currentId=T_;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=T_,t()},e)}isStarted(){return this.currentId!==T_}clear=()=>{this.currentId!==T_&&(clearTimeout(this.currentId),this.currentId=T_)};disposeEffect=()=>this.clear};function D_(){let e=Am(E_.create).current;return w_(e.disposeEffect),e}var O_=typeof navigator<`u`,k_=lte(),A_=dte(),j_=ute(),M_=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),N_=k_.platform===`MacIntel`&&k_.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(k_.platform);O_&&/firefox/i.test(j_);var P_=O_&&/apple/i.test(navigator.vendor);O_&&/Edg/i.test(j_);var F_=O_&&/android/i.test(A_)||/android/i.test(j_),cte=O_&&A_.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,I_=j_.includes(`jsdom/`);function lte(){if(!O_)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function ute(){if(!O_)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function dte(){if(!O_)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}function fte(e){e.preventDefault(),e.stopPropagation()}function pte(e){return`nativeEvent`in e}function mte(e){return e.pointerType===``&&e.isTrusted?!0:F_&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function hte(e){return I_?!1:!F_&&e.width===0&&e.height===0||F_&&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 L_(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function R_(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function gte(e,t){return t!=null&&!L_(t)?0:typeof e==`function`?e():e}function z_(e,t,n){let r=gte(e,n);return typeof r==`number`?r:r?.[t]}function B_(e){return typeof e==`function`?e():e}function V_(e,t){return t||e===`click`||e===`mousedown`}var H_=`none`,U_=`trigger-press`,W_=`trigger-hover`,G_=`trigger-focus`,K_=`outside-press`,q_=`close-press`,J_=`focus-out`,Y_=`escape-key`,X_=`disabled`,Z_=`imperative-action`;function Q_(e,t,n,r){let i=!1,a=!1,o=r??uh;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}}var $_=I.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new E_,currentIdRef:{current:null},currentContextRef:{current:null}});function ev(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=I.useRef(n),a=I.useRef(n),o=I.useRef(null),s=I.useRef(null),c=D_();return(0,U.jsx)($_.Provider,{value:I.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function tv(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{open:i}=t,{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=I.useContext($_),[f,p]=I.useState(!1);return Lm(()=>{function e(){p(!1),l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current}if(a.current&&!i&&a.current===r){if(p(!1),s){let t=r;return d.start(s,()=>{n.select(`open`)||a.current&&a.current!==t||e()}),()=>{d.clear()}}e()}},[i,r,a,o,s,c,l,d,n]),Lm(()=>{if(!i)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:n.setOpen,setIsInstantPhase:p},a.current=r,o.current={open:0,close:z_(c.current,`close`)},t!==null&&t!==r?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Q_(H_))):(p(!1),e?.setIsInstantPhase(!1))},[i,r,n,a,o,s,c,l,d]),Lm(()=>()=>{l.current=null},[l]),I.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function nv(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function rv(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function iv(e){let t=Am(av,e).current;return t.next=e,Lm(t.effect),t}function av(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var ov=null;globalThis.requestAnimationFrame;var sv=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.callbacksCount)}},cv=class e{static create(){return new e}static request(e){return sv.request(e)}static cancel(e){return sv.cancel(e)}currentId=ov;request(e){this.cancel(),this.currentId=sv.request(()=>{this.currentId=ov,e()})}cancel=()=>{this.currentId!==ov&&(sv.cancel(this.currentId),this.currentId=ov)};disposeEffect=()=>this.cancel};function lv(){let e=Am(cv.create).current;return w_(e.disposeEffect),e}function uv(e){return e?.ownerDocument||document}var dv={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},fv={...dv,position:`fixed`,top:0,left:0},pv={...dv,position:`absolute`},mv=I.forwardRef(function(e,t){let[n,r]=I.useState();Lm(()=>{P_&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,U.jsx)(`span`,{...e,ref:t,style:fv,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})}),hv=`data-base-ui-focusable`,gv=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function _v(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function vv(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&mm(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function yv(e){return`composedPath`in e?e.composedPath()[0]:e.target}function bv(e,t){if(!fm(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(vv(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function xv(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 Sv(e){return e.matches(`html,body`)}function Cv(e){return pm(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function wv(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${gv}`)!=null}function Tv(e){return e?e.getAttribute(`role`)===`combobox`&&Cv(e):!1}function Ev(e){if(!e||I_)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Dv(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}var Ov=[`top`,`right`,`bottom`,`left`],kv=Math.min,Av=Math.max,jv=Math.round,Mv=Math.floor,Nv=e=>({x:e,y:e}),Pv={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Fv(e,t,n){return Av(e,kv(t,n))}function Iv(e,t){return typeof e==`function`?e(t):e}function Lv(e){return e.split(`-`)[0]}function Rv(e){return e.split(`-`)[1]}function zv(e){return e===`x`?`y`:`x`}function Bv(e){return e===`y`?`height`:`width`}function Vv(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Hv(e){return zv(Vv(e))}function Uv(e,t,n){n===void 0&&(n=!1);let r=Rv(e),i=Hv(e),a=Bv(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Qv(o)),[o,Qv(o)]}function Wv(e){let t=Qv(e);return[Gv(e),t,Gv(t)]}function Gv(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Kv=[`left`,`right`],qv=[`right`,`left`],Jv=[`top`,`bottom`],Yv=[`bottom`,`top`];function Xv(e,t,n){switch(e){case`top`:case`bottom`:return n?t?qv:Kv:t?Kv:qv;case`left`:case`right`:return t?Jv:Yv;default:return[]}}function Zv(e,t,n,r){let i=Rv(e),a=Xv(Lv(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Gv)))),a}function Qv(e){let t=Lv(e);return Pv[t]+e.slice(t.length)}function $v(e){return{top:0,right:0,bottom:0,left:0,...e}}function ey(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:$v(e)}function ty(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 ny(e){return e.visibility===`hidden`||e.visibility===`collapse`}function ry(e,t=e?Cm(e):null){return!e||!e.isConnected||!t||ny(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var iy=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function ay(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return mm(n)?n.host:null}function oy(e){for(let t of Array.from(e.children))if(cm(t)===`summary`)return t;return null}function sy(e,t){let n=oy(t);return!!n&&(e===n||vv(n,e))}function cy(e){let t=e?cm(e):``;return e!=null&&e.matches(iy)&&(t!==`summary`||e.parentElement!=null&&cm(e.parentElement)===`details`&&oy(e.parentElement)===e)&&(t!==`details`||oy(e)==null)&&(t!==`input`||e.type!==`hidden`)}function ly(e){if(!cy(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=ay(t)){let n=t!==e,r=cm(t)===`slot`;if(t.hasAttribute(`inert`)||n&&cm(t)===`details`&&!t.open&&!sy(e,t)||t.hasAttribute(`hidden`)||!r&&!uy(t,n))return!1}return!0}function uy(e,t){let n=Cm(e);return t?n.display!==`none`:ry(e,n)}function dy(e){let t=e.tabIndex;if(t<0){let t=cm(e);if(t===`details`||t===`audio`||t===`video`||pm(e)&&e.isContentEditable)return 0}return t}function fy(e){if(cm(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function py(e,t){let n=fy(e);if(!n)return!0;let r=t.find(e=>{let t=fy(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=fy(e);return t?.name===n.name&&t.form===n.form})===n}function my(e){if(pm(e)&&cm(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return pm(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function hy(e,t){my(e).forEach(e=>{cy(e)&&t.push(e),hy(e,t)})}function gy(e,t,n){my(e).forEach(e=>{pm(e)&&e.matches(t)&&n.push(e),gy(e,t,n)})}function _y(e){return ly(e)&&dy(e)>=0}function vy(e){let t=[];return hy(e,t),t.filter(ly)}function yy(e){let t=vy(e);return t.filter(e=>dy(e)>=0&&py(e,t))}function by(e,t){let n=yy(e),r=n.length;if(r===0)return;let i=_v(uv(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function xy(e){return by(uv(e).body,1)||e}function Sy(e){return by(uv(e).body,-1)||e}function Cy(e,t){if(!e)return null;let n=yy(uv(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 _te(e){return Cy(e,1)}function vte(e){return Cy(e,-1)}function wy(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!vv(n,r)}function yte(e){yy(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Ty(e){let t=[];gy(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 Ey(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Ey(e,t.id,n)])}function Dy(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 Oy(e){return`data-base-ui-${e}`}var ky=0;function Ay(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(ky);let a=()=>e?.focus({preventScroll:n});if(i)return a(),lh;let o=requestAnimationFrame(a);return ky=o,()=>{ky===o&&(cancelAnimationFrame(o),ky=0)}}var jy={inert:new WeakMap,"aria-hidden":new WeakMap},My=`data-base-ui-inert`,Ny={inert:new WeakSet,"aria-hidden":new WeakSet},Py=new WeakMap,Fy=0;function bte(e){return Ny[e]}function Iy(e){return e?mm(e)?e.host:Iy(e.parentNode):null}var Ly=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Iy(t);return e.contains(n)?n:null}).filter(e=>e!=null),Ry=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},zy=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{cm(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function xte(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let o=r?`inert`:n?`aria-hidden`:null,s=null,c=null,l=Ly(t,e),u=i?Ly(t,a):[],d=new Set(u),f=i?zy(t,Ry(l),new Set(l)).filter(e=>!d.has(e)):[],p=[],m=[];if(o){let e=jy[o],n=bte(o);c=n,s=e;let r=Ly(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=l.concat(r);zy(t,Ry(i),new Set(i)).forEach(t=>{let r=t.getAttribute(o),i=r!==null&&r!==`false`,a=(e.get(t)||0)+1;e.set(t,a),p.push(t),a===1&&i&&n.add(t),i||t.setAttribute(o,o===`inert`?``:`true`)})}return i&&f.forEach(e=>{let t=(Py.get(e)||0)+1;Py.set(e,t),m.push(e),t===1&&e.setAttribute(My,``)}),Fy+=1,()=>{s&&p.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&o&&e.removeAttribute(o),c?.delete(e))}),i&&m.forEach(e=>{let t=(Py.get(e)||0)-1;Py.set(e,t),t||e.removeAttribute(My)}),--Fy,Fy||(jy.inert=new WeakMap,jy[`aria-hidden`]=new WeakMap,Ny.inert=new WeakSet,Ny[`aria-hidden`]=new WeakSet,Py=new WeakMap)}}function By(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,o=uv(e[0]).body;return xte(e,o,n,r,{mark:i,markerIgnoreElements:a})}var Vy=0;function Ste(e,t=`mui`){let[n,r]=I.useState(e),i=e||n;return I.useEffect(()=>{n??(Vy+=1,r(`${t}-${Vy}`))},[n,t]),i}var Hy=Im.useId;function Uy(e,t){if(Hy!==void 0){let n=Hy();return e??(t?`${t}-${n}`:n)}return Ste(e,t)}var Cte={style:{transition:`none`}},Wy=`data-base-ui-click-trigger`,Gy={fallbackAxisSide:`end`},wte={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Ky=e(Oe()),qy=I.createContext(null),Jy=()=>I.useContext(qy),Tte=Oy(`portal`);function Yy(e={}){let{ref:t,container:n,componentProps:r=uh,elementProps:i}=e,a=Uy(),o=Jy()?.portalNode,[s,c]=I.useState(null),[l,u]=I.useState(null),d=Nm(e=>{e!==null&&u(e)}),f=I.useRef(null);Lm(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}if(a==null)return;let e=(n&&(dm(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,a]);let p=mh(`div`,r,{ref:[t,d],props:[{id:a,[Tte]:``},i]});return{portalNode:l,portalSubtree:s&&p?Ky.createPortal(p,s):null}}var Xy=I.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,style:s,...c}=e,{portalNode:l,portalSubtree:u}=Yy({container:r,ref:t,componentProps:e,elementProps:c}),d=I.useRef(null),f=I.useRef(null),p=I.useRef(null),m=I.useRef(null),[h,g]=I.useState(null),_=I.useRef(!1),v=h?.modal,y=h?.open,b=typeof o==`boolean`?o:!!h&&!h.modal&&h.open&&!!l;I.useEffect(()=>{if(!l||v)return;function e(e){l&&e.relatedTarget&&wy(e)&&(e.type===`focusin`?_.current&&=(Ty(l),!1):(yte(l),_.current=!0))}return rv(nv(l,`focusin`,e,!0),nv(l,`focusout`,e,!0))},[l,v]),I.useEffect(()=>{!l||y!==!1||(Ty(l),_.current=!1)},[y,l]);let x=I.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:l,setFocusManagerState:g}),[l]);return(0,U.jsxs)(I.Fragment,{children:[u,(0,U.jsxs)(qy.Provider,{value:x,children:[b&&l&&(0,U.jsx)(mv,{"data-type":`outside`,ref:d,onFocus:e=>{wy(e,l)?p.current?.focus():Sy(h?h.domReference:null)?.focus()}}),b&&l&&(0,U.jsx)(`span`,{"aria-owns":l.id,style:wte}),l&&Ky.createPortal(n,l),b&&l&&(0,U.jsx)(mv,{"data-type":`outside`,ref:f,onFocus:e=>{wy(e,l)?m.current?.focus():(xy(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,Q_(`focus-out`,e.nativeEvent)))}})]})]})});function Zy(){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 Ete=class{nodesRef={current:[]};events=Zy();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)}},Qy=I.createContext(null),$y=I.createContext(null),eb=()=>I.useContext(Qy)?.id||null,tb=e=>{let t=I.useContext($y);return e??t};function Dte(e){let t=Uy(),n=tb(e),r=eb();return Lm(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Ote(e){let{children:t,id:n}=e,r=eb();return(0,U.jsx)(Qy.Provider,{value:I.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function kte(e){let{children:t,externalTree:n}=e,r=Am(()=>n??new Ete).current;return(0,U.jsx)($y.Provider,{value:r,children:t})}function nb(e){return e==null?e:`current`in e?e.current:e}function Ate(e,t){let n=lm(yv(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 rb=20,ib=[];function ab(){ib=ib.filter(e=>e.deref()?.isConnected)}function jte(e){ab(),e&&cm(e)!==`body`&&(ib.push(new WeakRef(e)),ib.length>rb&&(ib=ib.slice(-rb)))}function ob(){return ab(),ib[ib.length-1]?.deref()}function Mte(e){return e?_y(e)?e:yy(e)[0]||e:null}function sb(e,t){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=vy(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return _y(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),r=e.getAttribute(`tabindex`);t.current.includes(`floating`)||n.length===0?r!==`0`&&e.setAttribute(`tabindex`,`0`):(r!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function cb(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:b}=h.context,x=Nm(()=>b.current.floatingContext?.nodeId),S=i===!1,C=Tv(_)&&S,w=I.useRef([`content`]),T=iv(i),E=iv(a),D=iv(l),O=tb(p),k=Jy(),A=I.useRef(!1),j=I.useRef(!1),M=I.useRef(!1),N=I.useRef(null),P=I.useRef(``),ee=I.useRef(``),F=I.useRef(null),te=I.useRef(null),ne=ih(F,f,k?.beforeInsideRef),re=ih(te,k?.afterInsideRef),ie=D_(),ae=D_(),oe=lv(),se=k!=null,ce=Dv(v),le=Nm((e=ce)=>e?yy(e):[]),ue=Nm(()=>m?.().filter(e=>e!=null)??[]);I.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&vv(ce,_v(uv(ce)))&&le().length===0&&!C&&fte(e)}return nv(uv(ce),`keydown`,e)},[r,_,ce,s,w,C,le]),I.useEffect(()=>{if(r||!g)return;let e=uv(ce);function t(){M.current=!1}function n(e){let t=yv(e),n=ue();M.current=!(vv(v,t)||vv(_,t)||vv(k?.portalNode,t)||n.some(e=>e===t||vv(e,t))),ee.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(j.current=!0)}function i(){ee.current=`keyboard`}return rv(nv(e,`pointerdown`,n,!0),nv(e,`pointerup`,t,!0),nv(e,`pointercancel`,t,!0),nv(e,`keydown`,i,!0))},[r,v,_,ce,g,k,ue]),I.useEffect(()=>{if(r||!c)return;let e=uv(ce);function t(){j.current=!0,ae.start(0,()=>{j.current=!1})}function n(e){let t=yv(e);_y(t)&&(N.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=yv(t);queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=ue(),f=n?.hasAttribute(Oy(`focus-guard`))&&[F.current,te.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,nb(d),nb(u)].includes(n),p=!(vv(_,n)||vv(v,n)||vv(n,v)||vv(k?.portalNode,n)||l.some(e=>e===n||vv(e,n))||n!=null&&c.hasElement(n)||c.hasMatchingElement(e=>vv(e,n))||f||O&&(Ey(O.nodesRef.current,a).find(e=>vv(e.context?.elements.floating,n)||vv(e.context?.elements.domReference,n))||Dy(O.nodesRef.current,a).find(e=>[e.context?.elements.floating,Dv(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&ce&&sb(ce,w),o&&r!==_&&!ry(i)&&_v(e)===e.body){if(pm(ce)&&(ce.focus(),o===`popup`)){oe.request(()=>{ce.focus()});return}let e=le(),t=N.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||ce;pm(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!j.current&&(C||n!==ob())&&(A.current=!0,h.setOpen(!1,Q_(J_,t)))})}function a(){M.current||(b.current.insideReactTree=!0,ie.start(0,()=>{b.current.insideReactTree=!1}))}let l=pm(_)?_:null;if(!(!v&&!l))return rv(l&&nv(l,`focusout`,i),l&&nv(l,`pointerdown`,t),v&&nv(v,`focusin`,n),v&&nv(v,`focusout`,i),v&&k&&nv(v,`focusout`,a,!0))},[r,_,v,ce,s,O,k,h,c,o,le,C,x,w,b,ie,ae,oe,u,d,ue]),I.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(k?.portalNode?.querySelectorAll(`[${Oy(`portal`)}]`)||[]),t=(O?Dy(O.nodesRef.current,x()):[]).find(e=>Tv(e.context?.elements.domReference||null))?.context?.elements.domReference,n=By([v,...e,F.current,te.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...ue(),t,nb(d),nb(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=By([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,w,k,C,O,x,u,d,ue]),Lm(()=>{if(!g||r||!pm(ce))return;let e=_v(uv(ce));queueMicrotask(()=>{let t=T.current,n=typeof t==`function`?t(D.current||``):t;if(n===void 0||n===!1||vv(ce,e))return;let r=null,i=()=>(r??=le(ce),r[0]||ce),a;a=n===!0||n===null?i():nb(n),a||=i(),Ay(a,{preventScroll:a===ce})})},[r,g,ce,S,le,T,D]),Lm(()=>{if(r||!ce)return;let e=uv(ce);jte(_v(e));function t(e){if(e.open||(P.current=Ate(e.nativeEvent,ee.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(A.current=!0),e.reason===`outside-press`)if(e.nested)A.current=!1;else if(mte(e.nativeEvent)||hte(e.nativeEvent))A.current=!1;else{let e=!1;uv(ce).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?A.current=!1:A.current=!0}}y.on(`openchange`,t);function n(){let e=E.current,t=typeof e==`function`?e(P.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=_||ob();return e&&e.isConnected?e:null}let n=_||ob();return nb(t)||n||null}return()=>{y.off(`openchange`,t);let r=_v(e),i=ue(),a=vv(v,r)||i.some(e=>e===r||vv(e,r))||O&&Ey(O.nodesRef.current,x(),!1).some(e=>vv(e.context?.elements.floating,r)),o=E.current,s=n();queueMicrotask(()=>{let t=Mte(s),n=typeof o!=`boolean`;o&&!A.current&&pm(t)&&(!(!n&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),A.current=!1})}},[r,v,ce,E,b,y,O,_,x,ue]),Lm(()=>{if(!M_||g||!v)return;let e=_v(uv(v));!pm(e)||!Cv(e)||vv(v,e)&&e.blur()},[g,v]),Lm(()=>{if(!(r||!k))return k.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{k.setFocusManagerState(null)}},[r,k,s,g,h,c,_]),Lm(()=>{if(!(r||!ce))return sb(ce,w),()=>{queueMicrotask(ab)}},[r,ce,w]);let de=!r&&(s?!C:!0)&&(se||s);return(0,U.jsxs)(I.Fragment,{children:[de&&(0,U.jsx)(mv,{"data-type":`inside`,ref:ne,onFocus:e=>{if(s){let e=le();Ay(e[e.length-1])}else k?.portalNode&&(A.current=!1,wy(e,k.portalNode)?xy(_)?.focus():nb(d??k.beforeOutsideRef)?.focus())}}),n,de&&(0,U.jsx)(mv,{"data-type":`inside`,ref:re,onFocus:e=>{s?Ay(le()[0]):k?.portalNode&&(c&&(A.current=!0),wy(e,k.portalNode)?Sy(_)?.focus():nb(u??k.afterOutsideRef)?.focus())}})]})}function lb(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,{enabled:i=!0,event:a=`click`,toggle:o=!0,ignoreMouse:s=!1,stickIfOpen:c=!0,touchOpenDelay:l=0,reason:u=U_}=t,d=I.useRef(void 0),f=lv(),p=D_(),m=I.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){let t=d.current,i=e.nativeEvent,m=n.select(`open`);if(e.button!==0||a===`click`||L_(t,!0)&&s)return;let h=r.current.openEvent,g=h?.type,_=n.select(`domReferenceElement`)!==e.currentTarget,v=m&&_||!(m&&o&&(!(h&&c)||g===`click`||g===`mousedown`)),y=yv(i);if(Cv(y)){let e=Q_(u,i,y);v&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(v,e);return}let b=e.currentTarget;f.request(()=>{let e=Q_(u,i,b);v&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(v,e)})},onClick(e){if(a===`mousedown-only`)return;let t=d.current;if(a===`mousedown`&&t){d.current=void 0;return}if(L_(t,!0)&&s)return;let i=n.select(`open`),f=r.current.openEvent,m=n.select(`domReferenceElement`)!==e.currentTarget,h=i&&m||!(i&&o&&(!(f&&c)||R_(f))),g=Q_(u,e.nativeEvent,e.currentTarget);h&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,g)}):n.setOpen(h,g)},onKeyDown(){d.current=void 0}}),[r,a,s,n,c,o,f,p,l,u]);return I.useMemo(()=>i?{reference:m}:uh,[i,m])}function Nte(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 ub(e){return e!=null&&e.clientX!=null}function Pte(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`}=t,l=I.useRef(!1),u=I.useRef(null),[d,f]=I.useState(),[p,m]=I.useState([]),h=Nm((e,t,r)=>{l.current||o.current.openEvent&&!ub(o.current.openEvent)||n.set(`positionReference`,Nte(r??a,{x:e,y:t,axis:c,dataRef:o,pointerType:d}))}),g=Nm(e=>{r?u.current||m([]):h(e.clientX,e.clientY,e.currentTarget)}),_=L_(d)?i:r,v=I.useCallback(()=>{if(!_||!s)return;let e=lm(i);function t(e){vv(i,yv(e))?(u.current?.(),u.current=null):h(e.clientX,e.clientY)}if(!o.current.openEvent||ub(o.current.openEvent))return u.current=nv(e,`mousemove`,t),()=>{u.current?.(),u.current=null};n.set(`positionReference`,a)},[_,s,i,o,a,n,h]);I.useEffect(()=>v(),[v,p]),I.useEffect(()=>{s&&!i&&(l.current=!1)},[s,i]),I.useEffect(()=>{!s&&r&&(l.current=!0)},[s,r]);let y=I.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return I.useMemo(()=>s?{reference:y,trigger:y}:{},[s,y])}var Fte={intentional:`onClick`,sloppy:`onPointerDown`};function Ite(){return!1}function Lte(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function db(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),{dataRef:a}=n.context,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`sloppy`,referencePress:u=Ite,referencePressEvent:d=`sloppy`,bubbles:f,externalTree:p}=t,m=tb(p),h=Nm(typeof c==`function`?c:()=>!1),g=typeof c==`function`?h:c,_=g!==!1,v=Nm(()=>l),y=I.useRef(!1),b=I.useRef(!1),x=I.useRef(!1),{escapeKey:S,outsidePress:C}=Lte(f),w=I.useRef(null),T=D_(),E=D_(),D=Nm(()=>{E.clear(),a.current.insideReactTree=!1}),O=I.useRef(!1),k=I.useRef(``),A=Nm(u),j=Nm(e=>{if(!r||!o||!s||e.key!==`Escape`||O.current)return;let t=a.current.floatingContext?.nodeId,i=m?Ey(m.nodesRef.current,t):[];if(!S&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let c=Q_(Y_,pte(e)?e.nativeEvent:e);n.setOpen(!1,c),!S&&!c.isPropagationAllowed&&e.stopPropagation()}),M=Nm(()=>{a.current.insideReactTree=!0,E.start(0,D)});I.useEffect(()=>{if(!r||!o)return;a.current.__escapeKeyBubbles=S,a.current.__outsidePressBubbles=C;let e=new E_,t=new E_;function c(){e.clear(),O.current=!0}function l(){e.start(xm()?5:0,()=>{O.current=!1})}function u(){x.current=!0,t.start(0,()=>{x.current=!1})}function d(){y.current=!1,b.current=!1}function f(){let e=k.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=a.current.floatingContext?.nodeId,r=m&&Ey(m.nodesRef.current,t).some(t=>xv(e,t.context?.elements.floating));return xv(e,n.select(`floatingElement`))||xv(e,n.select(`domReferenceElement`))||r}function E(e){if(p(e)){D();return}if(a.current.insideReactTree){D();return}let r=yv(e),i=`[${Oy(`inert`)}]`,o=fm(r)?r.getRootNode():null,s=Array.from((mm(o)?o:uv(n.select(`floatingElement`))).querySelectorAll(i)),c=n.context.triggerElements;if(r&&(c.hasElement(r)||c.hasMatchingElement(e=>vv(e,r))))return;let l=fm(r)?r:null;for(;l&&!Sm(l);){let e=Tm(l);if(Sm(e)||!fm(e))break;l=e}if(s.length&&fm(r)&&!Sv(r)&&!vv(r,n.select(`floatingElement`))&&s.every(e=>!vv(l,e)))return;if(pm(r)&&!(`touches`in e)){let t=Sm(r),n=Cm(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}if(h(e))return;if(f()===`intentional`&&x.current){t.clear(),x.current=!1;return}if(typeof g==`function`&&!g(e))return;let u=a.current.floatingContext?.nodeId,d=m?Ey(m.nodesRef.current,u):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,Q_(K_,e)),D()}function A(e){f()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!o||xv(e,n.select(`floatingElement`))||xv(e,n.select(`domReferenceElement`))||E(e)}function M(e){if(f()!==`sloppy`||!n.select(`open`)||!o||xv(e,n.select(`floatingElement`))||xv(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(w.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{w.current&&(w.current.dismissOnTouchEnd=!1,w.current.dismissOnMouseDown=!1)}))}function N(e,t){let n=yv(e);if(!n)return;let r=nv(n,e.type,()=>{t(e),r()})}function P(e){k.current=`touch`,N(e,M)}function ee(e){T.clear(),e.type===`pointerdown`&&(k.current=e.pointerType),!(e.type===`mousedown`&&w.current&&!w.current.dismissOnMouseDown)&&N(e,e=>{e.type===`pointerdown`?A(e):E(e)})}function F(e){if(!y.current)return;let n=b.current;if(d(),f()===`intentional`){if(e.type===`pointercancel`){n&&u();return}if(!h(e)){if(n){u();return}typeof g==`function`&&!g(e)||(t.clear(),x.current=!0,D())}}}function te(e){if(f()!==`sloppy`||!w.current||xv(e,n.select(`floatingElement`))||xv(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-w.current.startX),i=Math.abs(t.clientY-w.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(w.current.dismissOnTouchEnd=!0),a>10&&(E(e),T.clear(),w.current=null)}function ne(e){N(e,te)}function re(e){f()!==`sloppy`||!w.current||xv(e,n.select(`floatingElement`))||xv(e,n.select(`domReferenceElement`))||(w.current.dismissOnTouchEnd&&E(e),T.clear(),w.current=null)}function ie(e){N(e,re)}let ae=uv(i),oe=rv(s&&rv(nv(ae,`keydown`,j),nv(ae,`compositionstart`,c),nv(ae,`compositionend`,l)),_&&rv(nv(ae,`click`,ee,!0),nv(ae,`pointerdown`,ee,!0),nv(ae,`pointerup`,F,!0),nv(ae,`pointercancel`,F,!0),nv(ae,`mousedown`,ee,!0),nv(ae,`mouseup`,F,!0),nv(ae,`touchstart`,P,!0),nv(ae,`touchmove`,ne,!0),nv(ae,`touchend`,ie,!0)));return()=>{oe(),e.clear(),t.clear(),d(),x.current=!1}},[a,i,s,_,g,r,o,S,C,j,D,v,m,n,T]),I.useEffect(D,[g,D]);let N=I.useMemo(()=>({onKeyDown:j,[Fte[d]]:e=>{A()&&n.setOpen(!1,Q_(U_,e.nativeEvent))},...d!==`intentional`&&{onClick(e){A()&&n.setOpen(!1,Q_(`trigger-press`,e.nativeEvent))}}}),[j,n,d,A]),P=Nm(e=>{if(!r||!o||e.button!==0)return;let t=yv(e.nativeEvent);vv(n.select(`floatingElement`),t)&&(y.current||(y.current=!0,b.current=!1))}),ee=Nm(e=>{!r||!o||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&y.current&&(b.current=!0)}),F=I.useMemo(()=>({onKeyDown:j,onPointerDown:ee,onMouseDown:ee,onClickCapture:M,onMouseDownCapture(e){M(),P(e)},onPointerDownCapture(e){M(),P(e)},onMouseUpCapture:M,onTouchEndCapture:M,onTouchMoveCapture:M}),[j,M,P,ee]);return I.useMemo(()=>o?{reference:N,floating:F,trigger:N}:{},[o,N,F])}function fb(e,t,n){let{reference:r,floating:i}=e,a=Vv(t),o=Hv(t),s=Bv(o),c=Lv(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}}switch(Rv(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Rte(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}=Iv(t,e),p=ey(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ty(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=ty(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 zte=50,Bte=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Rte},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=fb(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<zte&&(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}=fb(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Vte=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}=Iv(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Lv(r),_=Vv(o),v=Lv(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Qv(o)]:Wv(o)),x=p!==`none`;!d&&x&&b.push(...Zv(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=Uv(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`&&_!==Vv(t))||T.every(e=>Vv(e.placement)===_?e.overflows[0]>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=Vv(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function pb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function mb(e){return Ov.some(t=>e[t]>=0)}var Hte=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Iv(e,t);switch(i){case`referenceHidden`:{let e=pb(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:mb(e)}}}case`escaped`:{let e=pb(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:mb(e)}}}default:return{}}}}},hb=new Set([`left`,`top`]);async function Ute(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Lv(n),s=Rv(n),c=Vv(n)===`y`,l=hb.has(o)?-1:1,u=a&&c?-1:1,d=Iv(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 Wte=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 Ute(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}}}}},Gte=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}=Iv(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Vv(Lv(i)),p=zv(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Fv(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Fv(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Kte=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}=Iv(e,t),u={x:n,y:r},d=Vv(i),f=zv(d),p=u[f],m=u[d],h=Iv(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=hb.has(Lv(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}}}},qte=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Iv(e,t),u=await o.detectOverflow(t,l),d=Lv(i),f=Rv(i),p=Vv(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=kv(h-u[g],v),x=kv(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Av(u.left,0),t=Av(u.right,0),n=Av(u.top,0),r=Av(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Av(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Av(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function gb(e){let t=Cm(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=pm(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=jv(n)!==a||jv(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function _b(e){return fm(e)?e:e.contextElement}function vb(e){let t=_b(e);if(!pm(t))return Nv(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=gb(t),o=(a?jv(n.width):n.width)/r,s=(a?jv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Jte=Nv(0);function yb(e){let t=lm(e);return!xm()||!t.visualViewport?Jte:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yte(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==lm(e)?!1:t}function bb(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=_b(e),o=Nv(1);t&&(r?fm(r)&&(o=vb(r)):o=vb(e));let s=Yte(a,n,r)?yb(a):Nv(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){let e=lm(a),t=r&&fm(r)?lm(r):r,n=e,i=Om(n);for(;i&&r&&t!==n;){let e=vb(i),t=i.getBoundingClientRect(),r=Cm(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=lm(i),i=Om(n)}}return ty({width:u,height:d,x:c,y:l})}function xb(e,t){let n=wm(e).scrollLeft;return t?t.left+n:bb(um(e)).left+n}function Sb(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-xb(e,n),y:n.top+t.scrollTop}}function Xte(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=um(r),s=t?gm(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Nv(1),u=Nv(0),d=pm(r);if((d||!d&&!a)&&((cm(r)!==`body`||hm(o))&&(c=wm(r)),d)){let e=bb(r);l=vb(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Sb(o,c):Nv(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 Zte(e){return Array.from(e.getClientRects())}function Qte(e){let t=um(e),n=wm(e),r=e.ownerDocument.body,i=Av(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Av(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+xb(e),s=-n.scrollTop;return Cm(r).direction===`rtl`&&(o+=Av(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Cb=25;function $te(e,t){let n=lm(e),r=um(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=xm();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=xb(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Cb&&(a-=o)}else l<=Cb&&(a+=l);return{width:a,height:o,x:s,y:c}}function ene(e,t){let n=bb(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=pm(e)?vb(e):Nv(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function wb(e,t,n){let r;if(t===`viewport`)r=$te(e,n);else if(t===`document`)r=Qte(um(e));else if(fm(t))r=ene(t,n);else{let n=yb(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ty(r)}function Tb(e,t){let n=Tm(e);return n===t||!fm(n)||Sm(n)?!1:Cm(n).position===`fixed`||Tb(n,t)}function tne(e,t){let n=t.get(e);if(n)return n;let r=Dm(e,[],!1).filter(e=>fm(e)&&cm(e)!==`body`),i=null,a=Cm(e).position===`fixed`,o=a?Tm(e):e;for(;fm(o)&&!Sm(o);){let t=Cm(o),n=ym(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||hm(o)&&!n&&Tb(e,o))?r=r.filter(e=>e!==o):i=t,o=Tm(o)}return t.set(e,r),r}function nne(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?gm(t)?[]:tne(t,this._c):[].concat(n),r],o=wb(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=wb(t,a[e],i);s=Av(n.top,s),c=kv(n.right,c),l=kv(n.bottom,l),u=Av(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function rne(e){let{width:t,height:n}=gb(e);return{width:t,height:n}}function ine(e,t,n){let r=pm(t),i=um(t),a=n===`fixed`,o=bb(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Nv(0);function l(){c.x=xb(i)}if(r||!r&&!a)if((cm(t)!==`body`||hm(i))&&(s=wm(t)),r){let e=bb(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Sb(i,s):Nv(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Eb(e){return Cm(e).position===`static`}function Db(e,t){if(!pm(e)||Cm(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return um(e)===n&&(n=n.ownerDocument.body),n}function Ob(e,t){let n=lm(e);if(gm(e))return n;if(!pm(e)){let t=Tm(e);for(;t&&!Sm(t);){if(fm(t)&&!Eb(t))return t;t=Tm(t)}return n}let r=Db(e,t);for(;r&&ree(r)&&Eb(r);)r=Db(r,t);return r&&Sm(r)&&Eb(r)&&!ym(r)?n:r||bm(e)||n}var ane=async function(e){let t=this.getOffsetParent||Ob,n=this.getDimensions,r=await n(e.floating);return{reference:ine(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function one(e){return Cm(e).direction===`rtl`}var sne={convertOffsetParentRelativeRectToViewportRelativeRect:Xte,getDocumentElement:um,getClippingRect:nne,getOffsetParent:Ob,getElementRects:ane,getClientRects:Zte,getDimensions:rne,getScale:vb,isElement:fm,isRTL:one};function kb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cne(e,t){let n=null,r,i=um(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Mv(d),h=Mv(i.clientWidth-(u+f)),g=Mv(i.clientHeight-(d+p)),_=Mv(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Av(0,kv(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!kb(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ab(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=_b(e),u=i||a?[...l?Dm(l):[],...t?Dm(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?cne(l,n):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?bb(e):null;c&&g();function g(){let t=bb(e);h&&!kb(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 lne=Wte,une=Gte,dne=Vte,fne=qte,pne=Hte,mne=Kte,hne=(e,t,n)=>{let r=new Map,i={platform:sne,...n},a={...i.platform,_c:r};return Bte(e,t,{...i,platform:a})},jb=typeof document<`u`?I.useLayoutEffect:function(){};function Mb(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(!Mb(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)&&!Mb(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Nb(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Pb(e,t){let n=Nb(e);return Math.round(t*n)/n}function Fb(e){let t=I.useRef(e);return jb(()=>{t.current=e}),t}function gne(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]=I.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=I.useState(r);Mb(f,r)||p(r);let[m,h]=I.useState(null),[g,_]=I.useState(null),v=I.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=I.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=I.useRef(null),C=I.useRef(null),w=I.useRef(u),T=c!=null,E=Fb(c),D=Fb(i),O=Fb(l),k=I.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),hne(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Mb(w.current,t)&&(w.current=t,Ky.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);jb(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=I.useRef(!1);jb(()=>(A.current=!0,()=>{A.current=!1}),[]),jb(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=I.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=I.useMemo(()=>({reference:b,floating:x}),[b,x]),N=I.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Pb(M.floating,u.x),r=Pb(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Nb(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return I.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var _ne=(e,t)=>{let n=lne(e);return{name:n.name,fn:n.fn,options:[e,t]}},vne=(e,t)=>{let n=une(e);return{name:n.name,fn:n.fn,options:[e,t]}},yne=(e,t)=>({fn:mne(e).fn,options:[e,t]}),bne=(e,t)=>{let n=dne(e);return{name:n.name,fn:n.fn,options:[e,t]}},xne=(e,t)=>{let n=fne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Sne=(e,t)=>{let n=pne(e);return{name:n.name,fn:n.fn,options:[e,t]}},W=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(eh(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},Cne=i((e=>{var t=we(),n=Ap();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}})),wne=i(((e,t)=>{t.exports=Cne()})),Ib=Ap(),Tne=wne(),Ene=sh(19)?One:kne;function Lb(e,t,n,r,i){return Ene(e,t,n,r,i)}function Dne(e,t,n,r,i){let a=I.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Ib.useSyncExternalStore)(e.subscribe,a,a)}ite({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);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}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,Ib.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function One(e,t,n,r,i){let a=rte();if(!a)return Dne(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.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function kne(e,t,n,r,i){return(0,Tne.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Ane=class{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 Lb(this,e,t,n,r)}},Rb=class extends Ane{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){I.useDebugValue(e),Lm(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;Lm(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Lm(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){I.useDebugValue(e);let n=t!==void 0;Lm(()=>{n&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return I.useDebugValue(e),Lb(this,this.selectors[e],t,n,r)}useContextCallback(e,t){I.useDebugValue(e);let n=Nm(t??lh);this.context[e]=n}useStateSetter(e){let t=I.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)}})}},zb={open:W(e=>e.open),transitionStatus:W(e=>e.transitionStatus),domReferenceElement:W(e=>e.domReferenceElement),referenceElement:W(e=>e.positionReference??e.referenceElement),floatingElement:W(e=>e.floatingElement),floatingId:W(e=>e.floatingId)},Bb=class extends Rb{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:Zy(),nested:n,triggerElements:i},zb),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&R_(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 Vb(e,t=!1,n=!1){let[r,i]=I.useState(e&&t?`idle`:void 0),[a,o]=I.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),Lm(()=>{if(!e&&a&&r!==`ending`&&n){let e=cv.request(()=>{i(`ending`)});return()=>{cv.cancel(e)}}},[e,a,r,n]),Lm(()=>{if(!e||t)return;let n=cv.request(()=>{i(void 0)});return()=>{cv.cancel(n)}},[t,e]),Lm(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=cv.request(()=>{i(`idle`)});return()=>{cv.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}var Hb=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),Ub={[Hb.startingStyle]:``},Wb={[Hb.endingStyle]:``},Gb={transitionStatus(e){return e===`starting`?Ub:e===`ending`?Wb:null}};function Kb(e,t=!1,n=!0){let r=lv();return Nm((i,a=null)=>{r.cancel();let o=nb(e);if(o==null)return;let s=o,c=()=>{Ky.flushSync(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()}).catch(()=>{if(n){a?.aborted||c();return}let e=s.getAnimations();!a?.aborted&&e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&l()})}if(t){let e=Hb.startingStyle;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 qb(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=Nm(i),o=Kb(r,n,!1);I.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}function Jb(e,t){let n=I.useRef(null),r=I.useRef(null);return I.useCallback(i=>{if(e!==void 0){if(n.current!==null){let e=n.current,i=r.current,a=t.context.triggerElements.getById(e);i&&a===i&&t.context.triggerElements.delete(e),n.current=null,r.current=null}i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function Yb(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Jb(e,n),o=Nm(t=>{if(a(t),!t||!n.select(`open`))return;let i=n.select(`activeTriggerId`);if(i===e){n.update({activeTriggerElement:t,...r});return}i??n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return Lm(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function Xb(e){let t=e.useState(`open`);Lm(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function Zb(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Vb(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=Nm(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return qb({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var Qb=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function $b(){return new Bb({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Qb,floatingId:``,syncOnly:!1,nested:!1,onOpenChange:void 0})}function ex(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:$b(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:uh,inactiveTriggerProps:uh,popupProps:uh}}var tx=W(e=>e.triggerIdProp??e.activeTriggerId),nx={open:W(e=>e.openProp??e.open),mounted:W(e=>e.mounted),transitionStatus:W(e=>e.transitionStatus),floatingRootContext:W(e=>e.floatingRootContext),preventUnmountingOnClose:W(e=>e.preventUnmountingOnClose),payload:W(e=>e.payload),activeTriggerId:tx,activeTriggerElement:W(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:W((e,t)=>t!==void 0&&tx(e)===t),isOpenedByTrigger:W((e,t)=>t!==void 0&&tx(e)===t&&e.open),isMountedByTrigger:W((e,t)=>t!==void 0&&tx(e)===t&&e.mounted),triggerProps:W((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:W(e=>e.popupProps),popupElement:W(e=>e.popupElement),positionerElement:W(e=>e.positionerElement)};function rx(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Uy(),a=eb()!=null,o=Am(()=>new Bb({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Qb,floatingId:i,syncOnly:!1,nested:a})).current;return Lm(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=fm(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 ix(e={}){let{nodeId:t,externalTree:n}=e,r=rx(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=I.useState(null),c=I.useRef(null),l=tb(n);Lm(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let u=gne({...e,elements:{...a,...o&&{reference:o}}}),d=I.useCallback(e=>{let t=fm(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[f,p]=I.useState(void 0),[m,h]=I.useState(null);i.useSyncedValue(`referenceElement`,f??null);let g=fm(f)?f:null;i.useSyncedValue(`domReferenceElement`,f===void 0?a.domReference:g),i.useSyncedValue(`floatingElement`,m);let _=I.useCallback(e=>{(fm(e)||e===null)&&(c.current=e,p(e)),(fm(u.refs.reference.current)||u.refs.reference.current===null||e!==null&&!fm(e))&&u.refs.setReference(e)},[u.refs,p]),v=I.useCallback(e=>{h(e),u.refs.setFloating(e)},[u.refs]),y=I.useMemo(()=>({...u.refs,setReference:_,setFloating:v,setPositionReference:d,domReference:c}),[u.refs,_,v,d]),b=I.useMemo(()=>({...u.elements,domReference:a.domReference}),[u.elements,a.domReference]),x=i.useState(`open`),S=i.useState(`floatingId`),C=I.useMemo(()=>({...u,dataRef:i.context.dataRef,open:x,onOpenChange:i.setOpen,events:i.context.events,floatingId:S,refs:y,elements:b,nodeId:t,rootStore:i}),[u,y,b,t,i,x,S]);return Lm(()=>{i.context.dataRef.current.floatingContext=C;let e=l?.nodesRef.current.find(e=>e.id===t);e&&(e.context=C)}),I.useMemo(()=>({...u,context:C,refs:y,elements:b,rootStore:i}),[u,y,b,C,i])}function ax(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,onOpenChange:r}=e,i=Uy(),a=eb()!=null,o=t.useState(`open`),s=t.useState(`activeTriggerElement`),c=t.useState(n?`popupElement`:`positionerElement`),l=t.context.triggerElements,u=Am(()=>new Bb({open:o,transitionStatus:void 0,referenceElement:s,floatingElement:c,triggerElements:l,onOpenChange:r,floatingId:i,syncOnly:!0,nested:a})).current;return Lm(()=>{let e={open:o,floatingId:i,referenceElement:s,floatingElement:c};fm(s)&&(e.domReferenceElement=s),u.state.positionReference===u.state.referenceElement&&(e.positionReference=s),u.update(e)},[o,i,s,c,u]),u.context.onOpenChange=r,u.context.nested=a,u}var ox=cte&&P_;function sx(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,delay:o}=t,s=I.useRef(!1),c=I.useRef(null),l=D_(),u=I.useRef(!0);I.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=lm(e);function r(){let e=n.select(`domReferenceElement`);!n.select(`open`)&&pm(e)&&e===_v(uv(e))&&(s.current=!0)}function i(){u.current=!0}function o(){u.current=!1}return rv(nv(t,`blur`,r),ox&&nv(t,`keydown`,i,!0),ox&&nv(t,`pointerdown`,o,!0))},[n,a]),I.useEffect(()=>{if(!a)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=n.select(`domReferenceElement`);fm(e)&&(c.current=e,s.current=!0)}}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a,n]);let d=I.useMemo(()=>({onMouseLeave(){s.current=!1,c.current=null},onFocus(e){let t=e.currentTarget;if(s.current){if(c.current===t)return;s.current=!1,c.current=null}let r=yv(e.nativeEvent);if(fm(r)){if(ox&&!e.relatedTarget){if(!u.current&&!Cv(r))return}else if(!Ev(r))return}let i=bv(e.relatedTarget,n.context.triggerElements),{nativeEvent:a,currentTarget:d}=e,f=typeof o==`function`?o():o;if(n.select(`open`)&&i||f===0||f===void 0){n.setOpen(!0,Q_(G_,a,d));return}l.start(f,()=>{s.current||n.setOpen(!0,Q_(G_,a,d))})},onBlur(e){s.current=!1,c.current=null;let t=e.relatedTarget,r=e.nativeEvent,a=fm(t)&&t.hasAttribute(Oy(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let e=n.select(`domReferenceElement`),o=_v(uv(e));!t&&o===e||vv(i.current.floatingContext?.refs.floating.current,o)||vv(e,o)||a||bv(t??o,n.context.triggerElements)||n.setOpen(!1,Q_(G_,r))})}}),[i,n,l,o]);return I.useMemo(()=>a?{reference:d,trigger:d}:{},[a,d])}var cx=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 E_,this.restTimeout=new E_,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},lx=new WeakMap;function ux(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&lx.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),lx.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function dx(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=lx.get(n);a&&a!==e&&ux(a),ux(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,lx.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function fx(e){let t=Am(cx.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||=t,w_(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function px(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0,nodeId:l}=t,u=fx(n),d=tb(),f=eb(),p=Nm(()=>V_(o.current.openEvent?.type,u.interactedInside)),m=Nm(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),h=Nm(e=>bv(e,n.context.triggerElements)),g=I.useCallback(e=>{let t=z_(c,`close`,u.pointerType),r=()=>{n.setOpen(!1,Q_(W_,e)),d?.events.emit(`floating.closed`,e)};t?u.openChangeTimeout.start(t,r):(u.openChangeTimeout.clear(),r())},[c,n,u,d]),_=Nm(()=>{ux(u)}),v=Nm(e=>{let t=yv(e);if(!wv(t)){u.interactedInside=!1;return}u.interactedInside=t?.closest(`[aria-haspopup]`)!=null});Lm(()=>{r||(u.pointerType=void 0,u.restTimeoutPending=!1,u.interactedInside=!1,_())},[r,u,_]),I.useEffect(()=>_,[_]),Lm(()=>{if(s&&r&&u.handleCloseOptions?.blockPointerEvents&&m()&&fm(a)&&i){let e=a,t=i,n=uv(i),r=d?.nodesRef.current.find(e=>e.id===f)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),dx(u,{scopeElement:u.handleCloseOptions?.getScope?.()??u.pointerEventsScopeElement??r??e.closest(`[data-rootownerid]`)??n.body,referenceElement:e,floatingElement:t}),()=>{_()}}},[s,r,a,i,u,m,d,f,_]);let y=D_();I.useEffect(()=>{if(!s)return;function e(){u.openChangeTimeout.clear(),y.clear(),d?.events.off(`floating.closed`,r),_()}function t(e){if(d&&f&&Ey(d.nodesRef.current,f).length>0){d.events.on(`floating.closed`,r);return}if(h(e.relatedTarget))return;let t=o.current.floatingContext?.nodeId??l,n=e.relatedTarget;if(!(d&&t&&fm(n)&&Ey(d.nodesRef.current,t,!1).some(e=>vv(e.context?.elements.floating,n)))){if(u.handler){u.handler(e);return}_(),p()||g(e)}}function r(e){!d||!f||Ey(d.nodesRef.current,f).length>0||y.start(0,()=>{d.events.off(`floating.closed`,r),n.setOpen(!1,Q_(W_,e)),d.events.emit(`floating.closed`,e)})}let a=i;return rv(a&&nv(a,`mouseenter`,e),a&&nv(a,`mouseleave`,t),a&&nv(a,`pointerdown`,v,!0),()=>{d?.events.off(`floating.closed`,r)})},[s,i,n,o,l,p,h,g,_,v,u,d,f,y])}var mx={current:null};function hx(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=mx,externalTree:f,isActiveTrigger:p=!0,getHandleCloseContext:m,isClosing:h}=t,g=tb(f),_=fx(n),v=I.useRef(!1),y=iv(s),b=iv(o),x=iv(l),S=iv(a),C=iv(h);p&&(_.handleCloseOptions=y.current?.__options);let w=Nm(()=>V_(r.current.openEvent?.type,_.interactedInside)),T=Nm(e=>bv(e,n.context.triggerElements)),E=Nm((e,t,r)=>{let i=n.context.triggerElements;if(i.hasElement(t))return!e||!vv(e,t);if(!fm(r))return!1;let a=r;return i.hasMatchingElement(e=>vv(e,a))&&(!e||!vv(e,a))}),D=Nm((e,t=!0)=>{let r=z_(b.current,`close`,_.pointerType);r?_.openChangeTimeout.start(r,()=>{n.setOpen(!1,Q_(W_,e)),g?.events.emit(`floating.closed`,e)}):t&&(_.openChangeTimeout.clear(),n.setOpen(!1,Q_(W_,e)),g?.events.emit(`floating.closed`,e))}),O=Nm(()=>{_.handler&&=(uv(n.select(`domReferenceElement`)).removeEventListener(`mousemove`,_.handler),void 0)}),k=Nm(()=>{ux(_)});return I.useEffect(()=>O,[O]),I.useEffect(()=>{if(!a)return;function e(e){e.open?v.current=!1:(v.current=e.reason===W_,O(),_.openChangeTimeout.clear(),_.restTimeout.clear(),_.blockMouseMove=!0,_.restTimeoutPending=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,_,O]),I.useEffect(()=>{if(!a)return;let e=d.current??(p?n.select(`domReferenceElement`):null);if(!fm(e))return;function t(e){if(_.openChangeTimeout.clear(),_.blockMouseMove=!1,c&&!L_(_.pointerType))return;let t=B_(x.current),r=z_(b.current,`open`,_.pointerType),i=yv(e),a=e.currentTarget??null,o=n.select(`domReferenceElement`),s=a;if(fm(i)&&!n.context.triggerElements.hasElement(i)){for(let e of n.context.triggerElements.elements())if(vv(e,i)){s=e;break}}fm(a)&&fm(o)&&!n.context.triggerElements.hasElement(a)&&vv(a,o)&&(s=o);let l=s==null?!1:E(o,s,i),u=n.select(`open`),d=C.current?.()??n.select(`transitionStatus`)===`ending`,f=!u&&d&&v.current,p=!l&&fm(s)&&fm(o)&&vv(o,s)&&f,m=t>0&&!r,h=l&&(u||f)||p,g=!u||l;if(h){n.setOpen(!0,Q_(W_,e,s));return}m||(r?_.openChangeTimeout.start(r,()=>{g&&n.setOpen(!0,Q_(W_,e,s))}):g&&n.setOpen(!0,Q_(W_,e,s)))}function i(e){if(w()){k();return}O();let t=uv(n.select(`domReferenceElement`));_.restTimeout.clear(),_.restTimeoutPending=!1;let i=r.current.floatingContext??m?.();if(!T(e.relatedTarget)){if(y.current&&i){n.select(`open`)||_.openChangeTimeout.clear();let r=d.current;_.handler=y.current({...i,tree:g,x:e.clientX,y:e.clientY,onClose(){k(),O(),S.current&&!w()&&r===n.select(`domReferenceElement`)&&D(e,!0)}}),t.addEventListener(`mousemove`,_.handler),_.handler(e);return}(_.pointerType!==`touch`||!vv(n.select(`floatingElement`),e.relatedTarget))&&D(e)}}return u?rv(nv(e,`mousemove`,t,{once:!0}),nv(e,`mouseenter`,t),nv(e,`mouseleave`,i)):rv(nv(e,`mouseenter`,t),nv(e,`mouseleave`,i))},[O,k,r,b,D,n,a,y,_,p,E,w,T,c,u,x,d,g,S,m,C]),I.useMemo(()=>{if(!a)return;function e(e){_.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.select(`open`),o=E(i,r,e.target);if(c&&!L_(_.pointerType))return;if(a&&o&&_.handleCloseOptions?.blockPointerEvents){let e=n.select(`floatingElement`);e&&dx(_,{scopeElement:_.handleCloseOptions?.getScope?.()??r.ownerDocument.body,referenceElement:r,floatingElement:e})}let s=B_(x.current);if(a&&!o||s===0||!o&&_.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;_.restTimeout.clear();function l(){if(_.restTimeoutPending=!1,w())return;let e=n.select(`open`);!_.blockMouseMove&&(!e||o)&&n.setOpen(!0,Q_(W_,t,r))}_.pointerType===`touch`?Ky.flushSync(()=>{l()}):o&&a?l():(_.restTimeoutPending=!0,_.restTimeout.start(s,l))}}},[a,_,w,E,c,n,x])}function gx(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=I.useCallback(t=>_x(t,e,`reference`),t),o=I.useCallback(t=>_x(t,e,`floating`),n),s=I.useCallback(t=>_x(t,e,`item`),r),c=I.useCallback(t=>_x(t,e,`trigger`),i);return I.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function _x(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[hv]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&vx(a,s,i,r)}return vx(a,e,i,r),a}function vx(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var yx=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function bx(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{role:s=`dialog`}=t,c=Uy(),l=a?.id||c,u=I.useMemo(()=>Dv(o)?.id||i,[o,i]),d=yx.get(s)??s,f=eb()!=null,p=I.useMemo(()=>d===`tooltip`||s===`label`?uh:{"aria-haspopup":d===`alertdialog`?`dialog`:d,"aria-expanded":`false`,...d===`listbox`&&{role:`combobox`},...d===`menu`&&f&&{role:`menuitem`},...s===`select`&&{"aria-autocomplete":`none`},...s===`combobox`&&{"aria-autocomplete":`list`}},[d,f,s]),m=I.useMemo(()=>d===`tooltip`||s===`label`?{[`aria-${s===`label`?`labelledby`:`describedby`}`]:r?u:void 0}:{...p,"aria-expanded":r?`true`:`false`,"aria-controls":r?u:void 0,...d===`menu`&&{id:l}},[d,u,r,l,s,p]),h=I.useMemo(()=>{let e={id:u,...d&&{role:d}};return d===`tooltip`||s===`label`?e:{...e,...d===`menu`&&{"aria-labelledby":l}}},[d,u,l,s]),g=I.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${u}-fui-option`}};switch(s){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[u,s]);return I.useMemo(()=>({reference:m,floating:h,item:g,trigger:p}),[m,h,p,g])}var xx=.1,Sx=xx*xx,Cx=.5;function wx(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Tx(e,t,n,r,i,a,o,s,c,l){let u=!1;return wx(e,t,n,r,i,a)&&(u=!u),wx(e,t,i,a,o,s)&&(u=!u),wx(e,t,o,s,c,l)&&(u=!u),wx(e,t,c,l,n,r)&&(u=!u),u}function Ex(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Dx(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 Ox(e={}){let{blockPointerEvents:t=!1}=e,n=new E_,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*Sx;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=yv(r),g=r.type===`mouseleave`,_=vv(u,h),v=vv(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&fm(r.relatedTarget)&&vv(u,r.relatedTarget))return;function y(){return!!(s&&Ey(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=Dx(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Dx(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Dx(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Dx(d,f,x.right-1,A,S.left+1,k);break;default:}if(j)return;if(l&&!Ex(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Cx/2:Cx*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Cx+1,o=C||T?S.bottom-Cx:S.top,s=C?T?S.bottom-Cx:S.top:S.bottom-Cx;M=Tx(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Cx/2:Cx*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Cx,o=C||T?S.top+Cx:S.bottom,s=C?T?S.top+Cx:S.bottom:S.top+Cx;M=Tx(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Cx/2:Cx*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Cx+1,o=w||E?S.right-Cx:S.left,s=w?E?S.right-Cx:S.left:S.right-Cx;M=Tx(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Cx/2:Cx*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Cx,o=w||E?S.left+Cx:S.right,s=w?E?S.left+Cx:S.right:S.left+Cx;M=Tx(d,f,a,r,a,i,o,S.top,s,S.bottom);break}default:}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var kx={...nx,disabled:W(e=>e.disabled),instantType:W(e=>e.instantType),isInstantPhase:W(e=>e.isInstantPhase),trackCursorAxis:W(e=>e.trackCursorAxis),disableHoverablePopup:W(e=>e.disableHoverablePopup),lastOpenChangeReason:W(e=>e.openChangeReason),closeOnClick:W(e=>e.closeOnClick),closeDelay:W(e=>e.closeDelay),hasViewport:W(e=>e.hasViewport)},Ax=class e extends Rb{constructor(e){super({...jx(),...e},{popupRef:I.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Qb},kx)}setOpen=(e,t)=>{let n=t.reason,r=n===W_,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?Ky.flushSync(o):o()};static useStore(t,n){let r=Am(()=>new e(n)).current,i=t??r,a=ax({popupStore:i,onOpenChange:i.setOpen});return i.state.floatingRootContext=a,i}};function jx(){return{...ex(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var Mx=b_(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=Ax.useStore(l?.store,{open:n,openProp:r,activeTriggerId:d,triggerIdProp:u});x_(()=>{r===void 0&&p.state.open===!1&&n===!0&&p.update({open:!0,activeTriggerId:d})}),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(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i}),Lm(()=>{m&&t&&p.setOpen(!1,Q_(X_))},[m,t,p]),p.useSyncedValue(`disabled`,t),Xb(p);let{forceUnmount:v,transitionStatus:y}=Zb(h,p),b=p.select(`floatingRootContext`),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=I.useRef(null);Lm(()=>{y===`ending`&&C===`none`||y!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[y,x,C,S,p]),Lm(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]);let T=I.useCallback(()=>{p.setOpen(!1,Q_(Z_))},[p]);I.useImperativeHandle(o,()=>({unmount:v,close:T}),[v,T]);let{getReferenceProps:E,getFloatingProps:D,getTriggerProps:O}=gx([db(b,{enabled:!t,referencePress:()=>p.select(`closeOnClick`)}),Pte(b,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),k=I.useMemo(()=>E(),[E]),A=I.useMemo(()=>O(),[O]),j=I.useMemo(()=>D(),[D]);return p.useSyncedValues({activeTriggerProps:k,inactiveTriggerProps:A,popupProps:j}),(0,U.jsx)(S_.Provider,{value:p,children:typeof f==`function`?f({payload:_}):f})}),Nx=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Hb.startingStyle]=`startingStyle`,e[e.endingStyle=Hb.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),Px=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),Fx={[Px.popupOpen]:``},Ix={[Px.popupOpen]:``,[Px.pressed]:``},Lx={[Nx.open]:``},Rx={[Nx.closed]:``},zx={[Nx.anchorHidden]:``},Bx={open(e){return e?Fx:null}},Vx={open(e){return e?Ix:null}},Hx={open(e){return e?Lx:Rx},anchorHidden(e){return e?zx:null}};function Ux(e){return Uy(e,`base-ui`)}var Wx=I.createContext(void 0);function Gx(){return I.useContext(Wx)}var Kx=function(e){return e[e.popupOpen=Px.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({}),qx=ate(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeOnClick:c=!0,closeDelay:l,id:u,style:d,...f}=e,p=C_(!0),m=i?.store??p;if(!m)throw Error(eh(82));let h=Ux(u),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=I.useRef(null),b=s??600,x=l??0,{registerTrigger:S,isMountedByThisTrigger:C}=Yb(h,y,m,{payload:a,closeOnClick:c,closeDelay:x}),w=Gx(),{delayRef:T,isInstantPhase:E,hasProvider:D}=tv(v,{open:_});m.useSyncedValue(`isInstantPhase`,E);let O=m.useState(`disabled`),k=o??O,A=m.useState(`trackCursorAxis`),j=m.useState(`disableHoverablePopup`),M=hx(v,{enabled:!k,mouseOnly:!0,move:!1,handleClose:!j&&A!==`both`?Ox():null,restMs(){let e=w?.delay,t=typeof T.current==`object`?T.current.open:void 0,n=b;return D&&(n=t===0?0:s??e??b),n},delay(){let e=typeof T.current==`object`?T.current.close:void 0,t=x;return l==null&&D&&(t=e),{close:t}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`}),N=sx(v,{enabled:!k}).reference,P={open:_},ee=m.useState(`triggerProps`,C);return mh(`button`,e,{state:P,ref:[t,S,y],props:[M,N,ee,{onPointerDown(){m.set(`closeOnClick`,c)},id:h,[Kx.triggerDisabled]:k?``:void 0},f],stateAttributesMapping:Bx})}),Jx=I.createContext(void 0);function Yx(){let e=I.useContext(Jx);if(e===void 0)throw Error(eh(70));return e}var Xx=I.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{portalNode:c,portalSubtree:l}=Yy({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,U.jsxs)(I.Fragment,{children:[l,c&&Ky.createPortal(n,c)]})}),Zx=I.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return C_().useState(`mounted`)||n?(0,U.jsx)(Jx.Provider,{value:n,children:(0,U.jsx)(Xx,{ref:t,...r})}):null}),Qx=I.createContext(void 0);function $x(){let e=I.useContext(Qx);if(e===void 0)throw Error(eh(71));return e}var eS=I.createContext(void 0);function tS(){return I.useContext(eS)?.direction??`ltr`}var nS=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`}=Iv(e,t)||{};if(l==null)return{};let f=ey(u),p={x:n,y:r},m=Hv(i),h=Bv(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=Fv(k,j,A),N=!c.arrow&&Rv(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}}}),rS=(e,t)=>({...nS(e),options:[e,t]}),iS={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;return{data:{referenceHidden:(await Sne().fn(e)).data?.referenceHidden||a}}}},aS={sideX:`left`,sideY:`top`},oS={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=lm(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:aS};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=uv(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Lv(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:aS.sideX,g=f===`top`?`bottom`:aS.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function sS(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 cS(e,t,n){let{rects:r,placement:i}=e;return{side:sS(t,Lv(i),n),align:Rv(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function lS(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:y=!1,externalTree:b}=e,[x,S]=I.useState(null);!m&&x!==null&&S(null);let C=h.side||`flip`,w=h.align||`flip`,T=h.fallbackAxisSide||`end`,E=typeof t==`function`?t:void 0,D=Nm(E),O=E?D:t,k=iv(t),A=iv(m),j=tS()===`rtl`,M=x||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":j?`left`:`right`,"inline-start":j?`right`:`left`}[r],N=a===`center`?M:`${M}-${a}`,P=c,ee=+(r===`bottom`),F=+(r===`top`),te=+(r===`right`),ne=+(r===`left`);typeof P==`number`?P={top:P+ee,right:P+ne,bottom:P+F,left:P+te}:P&&={top:(P.top||0)+ee,right:(P.right||0)+ne,bottom:(P.bottom||0)+F,left:(P.left||0)+te};let re={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:P},ie=I.useRef(null),ae=iv(i),oe=iv(o),se=[_ne(e=>{let t=cS(e,r,j),n=typeof ae.current==`function`?ae.current(t):ae.current,i=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,j,r])],ce=w===`none`&&C!==`shift`,le=!ce&&(l||g||C===`shift`),ue=C===`none`?null:bne({...re,padding:{top:P.top+1,right:P.right+1,bottom:P.bottom+1,left:P.left+1},mainAxis:!g&&C===`flip`,crossAxis:w===`flip`?`alignment`:!1,fallbackAxisSideDirection:T}),de=ce?null:vne(e=>{let t=uv(e.elements.floating).documentElement;return{...re,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:w!==`none`,crossAxis:le,limiter:l||g?void 0:yne(e=>{if(!ie.current)return{};let{width:t,height:n}=ie.current.getBoundingClientRect(),r=Vv(Lv(e.placement)),i=r===`y`?t:n,a=r===`y`?P.left+P.right:P.top+P.bottom;return{offset:i/2+a/2}})}},[re,l,g,P,w]);C===`shift`||w===`shift`||a===`center`?se.push(de,ue):se.push(ue,de),se.push(xne({...re,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!A.current)return;let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=lm(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(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),rS(()=>({element:ie.current||uv(ie.current).createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=Lv(a),l=Vv(c),u=ie.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(cS(e,r,j)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,le&&l===`y`&&b?S:x),{}}},iS,v),Lm(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[m,p]);let fe=I.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:pe,elements:me,x:he,y:ge,middlewareData:_e,update:ve,placement:ye,context:be,isPositioned:xe,floatingStyles:Se}=ix({rootContext:p,open:f?m:void 0,placement:N,middleware:se,strategy:n,whileElementsMounted:f?void 0:(...e)=>Ab(...e,fe),nodeId:_,externalTree:b}),{sideX:Ce,sideY:we}=_e.adaptiveOrigin||aS,Te=xe?n:`fixed`,Ee=I.useMemo(()=>{let e=v?{position:Te,[Ce]:he,[we]:ge}:{position:Te,...Se};return xe||(e.opacity=0),e},[v,Te,Ce,he,we,ge,Se,xe]),De=I.useRef(null);Lm(()=>{if(!m)return;let e=k.current,t=typeof e==`function`?e():e,n=(uS(t)?t.current:t)||null;n!==De.current&&(pe.setPositionReference(n),De.current=n)},[m,pe,O,k]),I.useEffect(()=>{if(!m)return;let e=k.current;typeof e!=`function`&&uS(e)&&e.current!==De.current&&(pe.setPositionReference(e.current),De.current=e.current)},[m,pe,O,k]),I.useEffect(()=>{if(f&&m&&me.domReference&&me.floating)return Ab(me.domReference,me.floating,ve,fe)},[f,m,me,ve,fe]);let Oe=Lv(ye),ke=sS(r,Oe,j),Ae=Rv(ye)||`center`,je=!!_e.hide?.referenceHidden;Lm(()=>{y&&m&&xe&&S(Oe)},[y,m,xe,Oe]);let Me=I.useMemo(()=>({position:`absolute`,top:_e.arrow?.y,left:_e.arrow?.x}),[_e.arrow]),Ne=_e.arrow?.centerOffset!==0;return I.useMemo(()=>({positionerStyles:Ee,arrowStyles:Me,arrowRef:ie,arrowUncentered:Ne,side:ke,align:Ae,physicalSide:Oe,anchorHidden:je,refs:pe,context:be,isPositioned:xe,update:ve}),[Ee,Me,ie,Ne,ke,Ae,Oe,je,pe,be,xe,ve])}function uS(e){return e!=null&&`current`in e}function dS(e){return e===`starting`?Cte:uh}function fS(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),mh(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},dS(r),i],stateAttributesMapping:Hx})}var pS=I.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=Gy,style:g,..._}=e,v=C_(),y=Yx(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=lS({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,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(`hasViewport`)?oS:void 0}),O=fS(e,I.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,U.jsx)(Qx.Provider,{value:D,children:O})}),mS={...Hx,...Gb},hS=I.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,o=C_(),{side:s,align:c}=$x(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`);qb({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}});let m=o.useState(`disabled`),h=o.useState(`closeDelay`);return px(p,{enabled:!m,closeDelay:h}),mh(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,o.useStateSetter(`popupElement`)],props:[f,dS(d),a],stateAttributesMapping:mS})}),gS=I.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,o=C_(),s=o.useState(`open`),c=o.useState(`instantType`),{arrowRef:l,side:u,align:d,arrowUncentered:f,arrowStyles:p}=$x();return mh(`div`,e,{state:{open:s,side:u,align:d,uncentered:f,instant:c},ref:[t,l],props:[{style:p,"aria-hidden":!0},a],stateAttributesMapping:Hx})}),_S=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=I.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=I.useMemo(()=>({open:t,close:n}),[t,n]);return(0,U.jsx)(Wx.Provider,{value:i,children:(0,U.jsx)(ev,{delay:a,timeoutMs:r,children:e.children})})};function vS(e){return sh(19)?e:e?`true`:void 0}function yS({delay:e=0,...t}){return(0,U.jsx)(_S,{"data-slot":`tooltip-provider`,delay:e,...t})}function bS({...e}){return(0,U.jsx)(Mx,{"data-slot":`tooltip`,...e})}function xS({...e}){return(0,U.jsx)(qx,{"data-slot":`tooltip-trigger`,...e})}function SS({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,U.jsx)(Zx,{children:(0,U.jsx)(pS,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,U.jsxs)(hS,{"data-slot":`tooltip-content`,className:Pg(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,U.jsx)(gS,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var CS={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},wS={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},TS={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},ES=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],DS=[12288,12288,65281,65376,65504,65510],OS=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],kS=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],AS=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],jS=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},MS=19968,[NS,PS]=FS(AS);function FS(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(MS>=i&&MS<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var IS=e=>e<161||e>1114109?!1:jS(ES,e),LS=e=>e<12288||e>65510?!1:jS(DS,e),RS=e=>e<8361||e>65518?!1:jS(OS,e),zS=e=>e<32||e>10630?!1:jS(kS,e),BS=e=>e>=NS&&e<=PS?!0:e<4352||e>262141?!1:jS(AS,e);function VS(e){return IS(e)?`ambiguous`:LS(e)?`fullwidth`:RS(e)?`halfwidth`:zS(e)?`narrow`:BS(e)?`wide`:`neutral`}function HS(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function US(e){return HS(e),VS(e)}function WS(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function GS(e){if(!e||e<4352)return!1;switch(US(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!WS(e);case`narrow`:return!1;case`ambiguous`:return 917760<=e&&e<=917999?null:!1;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function KS(e,t){return t!==65025||!e||e<8216?!1:e===8216||e===8217||e===8220||e===8221}function qS(e){return e!==null&&e>=65024&&e<=65038}var JS=XS(/\p{P}|\p{S}/u),YS=XS(/\s/);function XS(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCodePoint(t))}}function ZS(e){return!!(e&wS.characterGroupWhitespace)}function QS(e){return(e&_C.cjkPunctuation)===wS.characterGroupPunctuation}function $S(e){return!!(e&_C.cjk)}function eC(e){return e===_C.ivs}function tC(e){return!!(e&_C.cjkOrIvs)}function nC(e){return e===_C.nonEmojiGeneralUseVS}function rC(e){return!!(e&_C.spaceOrPunctuation)}var iC=gC(/[A-Za-z]/),aC=gC(/[\dA-Za-z]/),oC=gC(/[#-'*+\--9=?A-Z^-~]/);function sC(e){return e!==null&&(e<32||e===127)}var cC=gC(/\d/),lC=gC(/[\dA-Fa-f]/),uC=gC(/[!-/:-@[-`{-~]/);function dC(e){return e!==null&&e<-2}function fC(e){return e!==null&&(e<0||e===32)}function pC(e){return e===-2||e===-1||e===32}var mC=gC(/\p{P}|\p{S}/u),hC=gC(/\s/);function gC(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var _C;(function(e){e.spaceOrPunctuation=3,e.cjk=4096,e.cjkPunctuation=4098,e.ivs=8192,e.cjkOrIvs=12288,e.nonEmojiGeneralUseVS=16384,e.variationSelector=24576,e.ivsToCjkRightShift=1})(_C||={});function vC(e){if(e===CS.eof||fC(e)||YS(e))return wS.characterGroupWhitespace;let t=0;if(e>=4352){if(qS(e))return _C.nonEmojiGeneralUseVS;switch(GS(e)){case null:return _C.ivs;case!0:t|=_C.cjk;break}}return JS(e)&&(t|=wS.characterGroupPunctuation),t}function yC(e,t,n){if(!nC(e))return e;let r=t(),i=vC(r);return!r||ZS(i)?e:KS(r,n)?_C.cjkPunctuation:bC(i)}function bC(e){return e&~_C.ivs}function xC(e){return!!(e&&e>=55296&&e<=56319)}function SC(e){return!!(e&&e>=56320&&e<=57343)}function CC(e,t,n){if(t._bufferIndex<2)return e;let r=n({start:{...t,_bufferIndex:t._bufferIndex-2},end:t}).codePointAt(0);return r&&r>=65536?r:e}function wC(e,t,n){let r=e>=65536?2:1;if(t._bufferIndex<1+r)return null;let i=t._bufferIndex-r-2,a=n({start:{...t,_bufferIndex:i>=0?i:0},end:{...t,_bufferIndex:t._bufferIndex-r}}),o=a.charCodeAt(a.length-1);if(Number.isNaN(o))return null;if(a.length<2||o<56320||57343<o)return o;let s=a.codePointAt(0);return s&&s>=65536?s:o}var TC=class{cachedValue=void 0;constructor(e,t,n){this.previousCode=e,this.nowPoint=t,this.sliceSerialize=n}value(){return this.cachedValue===void 0&&(this.cachedValue=wC(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function EC(e,t,n){let r=n({start:t,end:{...t,_bufferIndex:t._bufferIndex+2}}).codePointAt(0);return r&&r>=65536?r:e}function DC(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function OC(e,t){return e.length>0?(DC(e,e.length,0,t),e):t}function kC(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var AC={name:`attention`,resolveAll:jC,tokenize:MC};function jC(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};NC(d,-c),NC(f,c),o={type:c>1?TS.strongSequence:TS.emphasisSequence,start:d,end:{...e[r][1].end}},s={type:c>1?TS.strongSequence:TS.emphasisSequence,start:{...e[n][1].start},end:f},a={type:c>1?TS.strongText:TS.emphasisText,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?TS.strong:TS.emphasis,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=OC(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=OC(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),t.parser.constructs.insideSpan.null,l=OC(l,kC(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=OC(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=OC(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,DC(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function MC(e,t){let n=this.parser.constructs.attentionMarkers.null,{now:r,sliceSerialize:i,previous:a}=this,o=SC(a)?CC(a,r(),i):a,s=vC(o),c=new TC(o,r(),i),l=yC(s,c.value.bind(c),o),u;return d;function d(t){return t===CS.asterisk||CS.underscore,u=t,e.enter(`attentionSequence`),f(t)}function f(a){if(a===u)return e.consume(a),f;let s=e.exit(`attentionSequence`),c=vC(xC(a)?EC(a,r(),i):a),d=QS(l),p=d||ZS(l),m=QS(c),h=m||ZS(c),g=tC(l),_=!h||m&&(p||g)||n.includes(a),v=!p||d&&(h||$S(c))||n.includes(o);return s._open=!!(u===CS.asterisk?_:_&&(rC(l)||!v)),s._close=!!(u===CS.asterisk?v:v&&(rC(c)||!_)),t(a)}}function NC(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function PC(){return{text:{[CS.asterisk]:AC,[CS.underscore]:AC},insideSpan:{null:[AC]}}}function FC(){let e=this.data();(e.micromarkExtensions||=[]).push(PC())}function IC(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{[CS.tilde]:n},insideSpan:{null:[n]},attentionMarkers:{null:[CS.tilde]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&DC(o,o.length,0,kC(s,e.slice(r+1,n),t)),DC(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),DC(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=TS.data);return e}function i(e,n,r){let{now:i,sliceSerialize:a,previous:o}=this,s=SC(o)?CC(o,i(),a):o,c=vC(s),l=new TC(s,i(),a),u=yC(c,l.value.bind(l),s),d=this.events,f=0;return p;function p(t){return CS.tilde,s===CS.tilde&&d[d.length-1][1].type!==TS.characterEscape?r(t):(e.enter(`strikethroughSequenceTemporary`),m(t))}function m(o){let c=vC(s);if(o===CS.tilde)return f>1?r(o):(e.consume(o),f++,m);if(f<2&&!t)return r(o);let l=e.exit(`strikethroughSequenceTemporary`),d=vC(xC(o)?EC(o,i(),a):o),p=QS(u)||ZS(u),h=QS(d)||ZS(d),g=$S(u)||eC(c);return l._open=!h||d===wS.attentionSideAfter&&(p||g),l._close=!p||c===wS.attentionSideAfter&&(h||$S(d)),n(o)}}}function LC(e){let t=this.data();(t.micromarkExtensions||=[]).push(IC(e))}var RC=(function(e){if(e==null)return Nne;if(typeof e==`function`)return BC(e);if(typeof e==`object`)return Array.isArray(e)?zC(e):jne(e);if(typeof e==`string`)return Mne(e);throw Error(`Expected function, string, or object as test`)});function zC(e){let t=[],n=-1;for(;++n<e.length;)t[n]=RC(e[n]);return BC(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function jne(e){let t=e;return BC(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Mne(e){return BC(t);function t(t){return t&&t.type===e}}function BC(e){return t;function t(t,n,r){return!!(Pne(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Nne(){return!0}function Pne(e){return typeof e==`object`&&!!e&&`type`in e}function Fne(e){return e}var VC=[],HC=`skip`;function UC(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=RC(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+Fne(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=VC,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Ine(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Ine(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?VC:[e]}function WC(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),UC(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Lne=new Set([`。`,`.`,`,`,`、`,`?`,`!`,`:`,`;`,`(`,`)`,`【`,`】`,`「`,`」`,`『`,`』`,`〈`,`〉`,`《`,`》`]),Rne=/^(https?:\/\/|mailto:|www\.)/i,zne=e=>{if(e.children.length!==1)return!1;let t=e.children[0];return t.type===`text`&&t.value===e.url},Bne=e=>{let t=0;for(let n of e){if(Lne.has(n))return t;t+=n.length}return null},Vne=(e,t)=>({...t,url:e,children:[{type:`text`,value:e}]}),Hne=e=>({type:`text`,value:e}),Une=()=>e=>{WC(e,`link`,(e,t,n)=>{if(!n||typeof t!=`number`||!zne(e)||!Rne.test(e.url))return;let r=Bne(e.url);if(r===null||r===0)return;let i=e.url.slice(0,r),a=e.url.slice(r),o=Vne(i,e),s=Hne(a);return n.children.splice(t,1,o,s),t+1})};function Wne(){let e=[FC],t=[Une,LC];return{name:`cjk`,type:`cjk`,remarkPluginsBefore:e,remarkPluginsAfter:t,remarkPlugins:[...e,...t]}}var GC=Wne(),KC=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Gne(e){return qC(e)}function qC(e){return Array.isArray(e)?Kne(e):e instanceof RegExp?e:typeof e==`object`?qne(e):e}function Kne(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=qC(e[n]);return t}function qne(e){let t={};for(let n in e)t[n]=qC(e[n]);return t}function JC(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function YC(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?YC(e.substring(0,e.length-1)):e.substr(~t+1)}var XC=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ZC=class{static hasCaptures(e){return e===null?!1:(XC.lastIndex=0,XC.test(e))}static replaceCaptures(e,t,n){return e.replace(XC,(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 QC(e,t){return e<t?-1:+(e>t)}function $C(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=QC(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function ew(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 tw(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var nw=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}},rw=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Xne(e),t)}static createFromParsedTheme(e,t){return Qne(e,t)}_cachedMatchRoot=new nw(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=>Jne(e.parent,t.parentScopes));return n?new aw(n.fontStyle,n.foreground,n.background):null}},iw=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?!0:this.parent===null?!1: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 Jne(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&&!Yne(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Yne(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var aw=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Xne(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;break}}let s=null;typeof i.settings.foreground==`string`&&ew(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&ew(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 Zne(l,u,e,o,s,c)}}return n}var Zne=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}},ow=(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))(ow||{});function Qne(e,t){e.sort((e,t)=>{let n=QC(e.scope,t.scope);return n!==0||(n=$C(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 $ne(t),o=new aw(n,a.getId(r),a.getId(i)),s=new tre(new sw(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 rw(a,o,s)}var $ne=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)}},ere=Object.freeze([]),sw=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||ere,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)}},tre=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(),sw.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($C(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 sw(e,t,n,r,i))}},cw=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)!=0}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=rre(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 nre(e){return e}function rre(e){return e}function lw(e,t){let n=[],r=ire(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(uw(i)){let e=[];do e.push(i),i=r.next();while(uw(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 uw(e){return!!e&&!!e.match(/[\w\.:]+/)}function ire(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 dw(e){typeof e.dispose==`function`&&e.dispose()}var fw=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},are=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},ore=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))}},sre=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new fw(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new ore;for(let n of e)cre(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof fw){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 cre(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 fw?mw({baseGrammar:a,selfGrammar:i},r):pw(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 fw(e))}function pw(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];hw([r],t,n)}}function mw(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&hw(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&hw(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function hw(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?JC({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&hw(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=gw(i);switch(a.kind){case 0:mw({...t,selfGrammar:t.baseGrammar},n);break;case 1:mw(t,n);break;case 2:pw(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?pw(a.ruleName,i,n):mw(i,n)}else a.kind===4?n.add(new are(a.scopeName,a.ruleName)):n.add(new fw(a.scopeName));break}}}var lre=class{kind=0},ure=class{kind=1},dre=class{constructor(e){this.ruleName=e}kind=2},fre=class{constructor(e){this.scopeName=e}kind=3},pre=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function gw(e){if(e===`$base`)return new lre;if(e===`$self`)return new ure;let t=e.indexOf(`#`);return t===-1?new fre(e):t===0?new dre(e.substring(1)):new pre(e.substring(0,t),e.substring(t+1))}var mre=/\\(\d+)/,_w=/\\(\d+)/g,hre=-1,vw=-2;function yw(e){return e}function bw(e){return e}var xw=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=ZC.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=ZC.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${YC(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:ZC.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:ZC.replaceCaptures(this._contentName,e,t)}},gre=class extends xw{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!`)}},_re=class extends xw{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Ew(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 Dw,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Sw=class extends xw{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 Dw,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Cw=class extends xw{_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 Ew(i,this.id),this.beginCaptures=a,this._end=new Ew(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 Dw;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}},ww=class extends xw{_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 Ew(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Ew(o,vw),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 Dw;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 Dw,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},Tw=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new gre(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new _re(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=JC({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Sw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new ww(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 Cw(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=gw(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);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Sw||e instanceof Cw||e instanceof ww)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Ew=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.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=mre.test(this.source):this.hasBackReferences=!1}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 _w.lastIndex=0,this.source.replace(_w,(e,t)=>tw(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}},Dw=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 Ow(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 Ow(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Ow=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(`
|
|
188
188
|
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},kw=class{constructor(e,t){this.languageId=e,this.tokenType=t}},vre=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new kw(e,8),this._embeddedLanguagesMatcher=new yre(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 kw(0,0);_getBasicScopeAttributes=new nw(e=>new kw(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/},yre=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])=>tw(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 Aw=!1,jw=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Mw(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=bre(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 jw(i,!0);f()}return new jw(i,!1);function f(){let o=xre(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===hre){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Fw(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 Cw){let r=o;Fw(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 ww){let r=o;Fw(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(Fw(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 bre(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 ww&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=wre(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==vw){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Fw(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 xre(e,t,n,r,i,a){let o=Sre(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Cre(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 Sre(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Nw(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 Cre(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}=Nw(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 Nw(e,t,n,r,i){return Aw?{ruleScanner:e.compile(t,n),findOptions:Pw(r,i)}:{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function wre(e,t,n,r,i){return Aw?{ruleScanner:e.compileWhile(t,n),findOptions:Pw(r,i)}:{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Pw(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function Fw(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));Mw(e,p,n&&d.start===0,d.start,f,i,!1,0),dw(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 Tre(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Tre=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Ere(e,t,n,r,i,a,o,s){return new Ore(e,t,n,r,i,a,o,s)}function Iw(e,t,n,r,i){let a=lw(t,Lw),o=Tw.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 Lw(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(Dre(t[r],e))return n=r+1,!0;return!1})}function Dre(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 Ore=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new vre(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Rw(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=lw(e,Lw);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)Iw(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&&Iw(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(yw(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[bw(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]=Rw(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=Tw.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Bw.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=cw.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?zw.createRootAndLookUpScopeName(a,r,this):zw.createRoot(`unknown`,r),t=new Bw(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
189
189
|
`;let a=this.createOnigString(e),o=a.content.length,s=new Are(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Mw(this,a,i,0,t,s,!0,r);return dw(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Rw(e,t){return e=Gne(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 zw=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=iw.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new iw(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new iw(null,t),o=r.themeProvider.themeMatch(a);return new e(null,a,e.mergeAttributes(n,i,o))}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(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),cw.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);return new e(t,a,e.mergeAttributes(t.tokenAttributes,i,o))}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}},Bw=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?!1:e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?zw.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(!0)}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:bw(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=zw.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,yw(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,zw.fromExtension(r,n.contentNameScopesList))}},kre=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):lw(e,Lw).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>lw(e,Lw).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}},Are=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=cw.set(n,0,nre(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=cw.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}},jre=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,Ere(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Vw=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new jre(rw.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(rw.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 kre(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new sre(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)}},Hw=Bw.NULL,Uw=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Ww=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Ww.prototype.normal={},Ww.prototype.property={},Ww.prototype.space=void 0;function Gw(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Ww(n,r,t)}function Kw(e){return e.toLowerCase()}var qw=class{constructor(e,t){this.attribute=t,this.property=e}};qw.prototype.attribute=``,qw.prototype.booleanish=!1,qw.prototype.boolean=!1,qw.prototype.commaOrSpaceSeparated=!1,qw.prototype.commaSeparated=!1,qw.prototype.defined=!1,qw.prototype.mustUseProperty=!1,qw.prototype.number=!1,qw.prototype.overloadedBoolean=!1,qw.prototype.property=``,qw.prototype.spaceSeparated=!1,qw.prototype.space=void 0;var Jw=r({boolean:()=>Yw,booleanish:()=>Xw,commaOrSpaceSeparated:()=>eT,commaSeparated:()=>$w,number:()=>G,overloadedBoolean:()=>Zw,spaceSeparated:()=>Qw}),Mre=0,Yw=tT(),Xw=tT(),Zw=tT(),G=tT(),Qw=tT(),$w=tT(),eT=tT();function tT(){return 2**++Mre}var nT=Object.keys(Jw),rT=class extends qw{constructor(e,t,n,r){let i=-1;if(super(e,t),iT(this,`space`,r),typeof n==`number`)for(;++i<nT.length;){let e=nT[i];iT(this,nT[i],(n&Jw[e])===Jw[e])}}};rT.prototype.defined=!0;function iT(e,t,n){n&&(e[t]=n)}function aT(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new rT(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Kw(r)]=r,n[Kw(a.attribute)]=r}return new Ww(t,n,e.space)}var oT=aT({properties:{ariaActiveDescendant:null,ariaAtomic:Xw,ariaAutoComplete:null,ariaBusy:Xw,ariaChecked:Xw,ariaColCount:G,ariaColIndex:G,ariaColSpan:G,ariaControls:Qw,ariaCurrent:null,ariaDescribedBy:Qw,ariaDetails:null,ariaDisabled:Xw,ariaDropEffect:Qw,ariaErrorMessage:null,ariaExpanded:Xw,ariaFlowTo:Qw,ariaGrabbed:Xw,ariaHasPopup:null,ariaHidden:Xw,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Qw,ariaLevel:G,ariaLive:null,ariaModal:Xw,ariaMultiLine:Xw,ariaMultiSelectable:Xw,ariaOrientation:null,ariaOwns:Qw,ariaPlaceholder:null,ariaPosInSet:G,ariaPressed:Xw,ariaReadOnly:Xw,ariaRelevant:null,ariaRequired:Xw,ariaRoleDescription:Qw,ariaRowCount:G,ariaRowIndex:G,ariaRowSpan:G,ariaSelected:Xw,ariaSetSize:G,ariaSort:null,ariaValueMax:G,ariaValueMin:G,ariaValueNow:G,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function sT(e,t){return t in e?e[t]:t}function cT(e,t){return sT(e,t.toLowerCase())}var Nre=aT({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:$w,acceptCharset:Qw,accessKey:Qw,action:null,allow:null,allowFullScreen:Yw,allowPaymentRequest:Yw,allowUserMedia:Yw,alt:null,as:null,async:Yw,autoCapitalize:null,autoComplete:Qw,autoFocus:Yw,autoPlay:Yw,blocking:Qw,capture:null,charSet:null,checked:Yw,cite:null,className:Qw,cols:G,colSpan:null,content:null,contentEditable:Xw,controls:Yw,controlsList:Qw,coords:G|$w,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Yw,defer:Yw,dir:null,dirName:null,disabled:Yw,download:Zw,draggable:Xw,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Yw,formTarget:null,headers:Qw,height:G,hidden:Zw,high:G,href:null,hrefLang:null,htmlFor:Qw,httpEquiv:Qw,id:null,imageSizes:null,imageSrcSet:null,inert:Yw,inputMode:null,integrity:null,is:null,isMap:Yw,itemId:null,itemProp:Qw,itemRef:Qw,itemScope:Yw,itemType:Qw,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Yw,low:G,manifest:null,max:null,maxLength:G,media:null,method:null,min:null,minLength:G,multiple:Yw,muted:Yw,name:null,nonce:null,noModule:Yw,noValidate:Yw,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:Yw,optimum:G,pattern:null,ping:Qw,placeholder:null,playsInline:Yw,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Yw,referrerPolicy:null,rel:Qw,required:Yw,reversed:Yw,rows:G,rowSpan:G,sandbox:Qw,scope:null,scoped:Yw,seamless:Yw,selected:Yw,shadowRootClonable:Yw,shadowRootDelegatesFocus:Yw,shadowRootMode:null,shape:null,size:G,sizes:null,slot:null,span:G,spellCheck:Xw,src:null,srcDoc:null,srcLang:null,srcSet:null,start:G,step:null,style:null,tabIndex:G,target:null,title:null,translate:null,type:null,typeMustMatch:Yw,useMap:null,value:Xw,width:G,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Qw,axis:null,background:null,bgColor:null,border:G,borderColor:null,bottomMargin:G,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Yw,declare:Yw,event:null,face:null,frame:null,frameBorder:null,hSpace:G,leftMargin:G,link:null,longDesc:null,lowSrc:null,marginHeight:G,marginWidth:G,noResize:Yw,noHref:Yw,noShade:Yw,noWrap:Yw,object:null,profile:null,prompt:null,rev:null,rightMargin:G,rules:null,scheme:null,scrolling:Xw,standby:null,summary:null,text:null,topMargin:G,valueType:null,version:null,vAlign:null,vLink:null,vSpace:G,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Yw,disableRemotePlayback:Yw,prefix:null,property:null,results:G,security:null,unselectable:null},space:`html`,transform:cT}),Pre=aT({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:eT,accentHeight:G,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:G,amplitude:G,arabicForm:null,ascent:G,attributeName:null,attributeType:null,azimuth:G,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:G,by:null,calcMode:null,capHeight:G,className:Qw,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:G,diffuseConstant:G,direction:null,display:null,dur:null,divisor:G,dominantBaseline:null,download:Yw,dx:null,dy:null,edgeMode:null,editable:null,elevation:G,enableBackground:null,end:null,event:null,exponent:G,externalResourcesRequired:null,fill:null,fillOpacity:G,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:$w,g2:$w,glyphName:$w,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:G,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:G,horizOriginX:G,horizOriginY:G,id:null,ideographic:G,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:G,k:G,k1:G,k2:G,k3:G,k4:G,kernelMatrix:eT,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:G,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:G,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:G,overlineThickness:G,paintOrder:null,panose1:null,path:null,pathLength:G,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Qw,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:G,pointsAtY:G,pointsAtZ:G,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:eT,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:eT,rev:eT,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:eT,requiredFeatures:eT,requiredFonts:eT,requiredFormats:eT,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:G,specularExponent:G,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:G,strikethroughThickness:G,string:null,stroke:null,strokeDashArray:eT,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:G,strokeOpacity:G,strokeWidth:null,style:null,surfaceScale:G,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:eT,tabIndex:G,tableValues:null,target:null,targetX:G,targetY:G,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:eT,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:G,underlineThickness:G,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:G,values:null,vAlphabetic:G,vMathematical:G,vectorEffect:null,vHanging:G,vIdeographic:G,version:null,vertAdvY:G,vertOriginX:G,vertOriginY:G,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:G,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:sT}),lT=aT({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()}}),uT=aT({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:cT}),dT=aT({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Fre={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Ire=/[A-Z]/g,fT=/-[a-z]/g,Lre=/^data[-\w.:]+$/i;function pT(e,t){let n=Kw(t),r=t,i=qw;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Lre.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(fT,zre);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!fT.test(e)){let n=e.replace(Ire,Rre);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=rT}return new i(r,t)}function Rre(e){return`-`+e.toLowerCase()}function zre(e){return e.charAt(1).toUpperCase()}var mT=Gw([oT,Nre,lT,uT,dT],`html`),hT=Gw([oT,Pre,lT,uT,dT],`svg`),gT={}.hasOwnProperty;function _T(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&gT.call(t,e)){let n=String(t[e]);i=gT.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 Bre=/["&'<>`]/g,Vre=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Hre=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ure=/[|\\{}()[\]^$+*?.]/g,vT=new WeakMap;function Wre(e,t){if(e=e.replace(t.subset?Gre(t.subset):Bre,r),t.subset||t.escapeOnly)return e;return e.replace(Vre,n).replace(Hre,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 Gre(e){let t=vT.get(e);return t||(t=Kre(e),vT.set(e,t)),t}function Kre(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Ure,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var qre=/[\dA-Fa-f]/;function Jre(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!qre.test(String.fromCharCode(t))?r:r+`;`}var Yre=/\d/;function Xre(e,t,n){let r=`&#`+String(e);return n&&t&&!Yre.test(String.fromCharCode(t))?r:r+`;`}var Zre=`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(`.`),yT={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:`€`},Qre=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],bT={}.hasOwnProperty,xT={},ST;for(ST in yT)bT.call(yT,ST)&&(xT[yT[ST]]=ST);var $re=/[^\dA-Za-z]/;function eie(e,t,n,r){let i=String.fromCharCode(e);if(bT.call(xT,i)){let e=xT[i],a=`&`+e;return n&&Zre.includes(e)&&!Qre.includes(e)&&(!r||t&&t!==61&&$re.test(String.fromCharCode(t)))?a:a+`;`}return``}function tie(e,t,n){let r=Jre(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=eie(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Xre(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function CT(e,t){return Wre(e,Object.assign({format:tie},t))}var nie=/^>|^->|<!--|-->|--!>|<!-$/g,rie=[`>`],iie=[`<`,`>`];function aie(e,t,n,r){return r.settings.bogusComments?`<?`+CT(e.value,Object.assign({},r.settings.characterReferences,{subset:rie}))+`>`:`<!--`+e.value.replace(nie,i)+`-->`;function i(e){return CT(e,Object.assign({},r.settings.characterReferences,{subset:iie}))}}function oie(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function wT(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 TT(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function ET(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function DT(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function OT(e){return e.join(` `).trim()}var sie=/[ \t\n\f\r]/g;function kT(e){return typeof e==`object`?e.type===`text`?AT(e.value):!1:AT(e)}function AT(e){return e.replace(sie,``)===``}var jT=NT(1),MT=NT(-1),cie=[];function NT(e){return t;function t(t,n,r){let i=t?t.children:cie,a=(n||0)+e,o=i[a];if(!r)for(;o&&kT(o);)a+=e,o=i[a];return o}}var lie={}.hasOwnProperty;function PT(e){return t;function t(t,n,r){return lie.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var FT=PT({body:die,caption:IT,colgroup:IT,dd:hie,dt:mie,head:IT,html:uie,li:pie,optgroup:gie,option:_ie,p:fie,rp:LT,rt:LT,tbody:yie,td:RT,tfoot:bie,th:RT,thead:vie,tr:xie});function IT(e,t,n){let r=jT(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&kT(r.value.charAt(0)))}function uie(e,t,n){let r=jT(n,t);return!r||r.type!==`comment`}function die(e,t,n){let r=jT(n,t);return!r||r.type!==`comment`}function fie(e,t,n){let r=jT(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 pie(e,t,n){let r=jT(n,t);return!r||r.type===`element`&&r.tagName===`li`}function mie(e,t,n){let r=jT(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function hie(e,t,n){let r=jT(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function LT(e,t,n){let r=jT(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function gie(e,t,n){let r=jT(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function _ie(e,t,n){let r=jT(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function vie(e,t,n){let r=jT(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function yie(e,t,n){let r=jT(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function bie(e,t,n){return!jT(n,t)}function xie(e,t,n){let r=jT(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function RT(e,t,n){let r=jT(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Sie=PT({body:Tie,colgroup:Eie,head:wie,html:Cie,tbody:Die});function Cie(e){let t=jT(e,-1);return!t||t.type!==`comment`}function wie(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 Tie(e){let t=jT(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&kT(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function Eie(e,t,n){let r=MT(n,t),i=jT(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&FT(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Die(e,t,n){let r=MT(n,t),i=jT(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&FT(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var zT={name:[[`
|
|
190
190
|
\f\r &/=>`.split(``),`
|
|
@@ -372,8 +372,8 @@ XID_Start XIDS`.split(/\s/).map(e=>[qO(e),e])),Vk=new Map([[`s`,Tk(383)],[Tk(383
|
|
|
372
372
|
`+e.slice(i,a),i=a+1),o=s;return c+=`
|
|
373
373
|
`,e.length-i>t&&o>i?c+=e.slice(i,o)+`
|
|
374
374
|
`+e.slice(o+1):c+=e.slice(i),c.slice(1)}l(nF,`foldLine`);function rF(e){for(var t=``,n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=WP(e,i),r=AP[n],!r&&zP(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||MP(n);return t}l(rF,`escapeString`);function iF(e,t,n){var r=``,i=e.tag,a,o,s;for(a=0,o=n.length;a<o;a+=1)s=n[a],e.replacer&&(s=e.replacer.call(n,String(a),s)),(lF(e,t,s,!1,!1)||s===void 0&&lF(e,t,null,!1,!1))&&(r!==``&&(r+=`,`+(e.condenseFlow?``:` `)),r+=e.dump);e.tag=i,e.dump=`[`+r+`]`}l(iF,`writeFlowSequence`);function aF(e,t,n,r){var i=``,a=e.tag,o,s,c;for(o=0,s=n.length;o<s;o+=1)c=n[o],e.replacer&&(c=e.replacer.call(n,String(o),c)),(lF(e,t+1,c,!0,!0,!1,!0)||c===void 0&&lF(e,t+1,null,!0,!0,!1,!0))&&((!r||i!==``)&&(i+=IP(e,t)),e.dump&&SP===e.dump.charCodeAt(0)?i+=`-`:i+=`- `,i+=e.dump);e.tag=a,e.dump=i||`[]`}l(aF,`writeBlockSequence`);function oF(e,t,n){var r=``,i=e.tag,a=Object.keys(n),o,s,c,l,u;for(o=0,s=a.length;o<s;o+=1)u=``,r!==``&&(u+=`, `),e.condenseFlow&&(u+=`"`),c=a[o],l=n[c],e.replacer&&(l=e.replacer.call(n,c,l)),lF(e,t,c,!1,!1)&&(e.dump.length>1024&&(u+=`? `),u+=e.dump+(e.condenseFlow?`"`:``)+`:`+(e.condenseFlow?``:` `),lF(e,t,l,!1,!1)&&(u+=e.dump,r+=u));e.tag=i,e.dump=`{`+r+`}`}l(oF,`writeFlowMapping`);function sF(e,t,n,r){var i=``,a=e.tag,o=Object.keys(n),s,c,l,u,d,f;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys==`function`)o.sort(e.sortKeys);else if(e.sortKeys)throw new AM(`sortKeys must be a boolean or a function`);for(s=0,c=o.length;s<c;s+=1)f=``,(!r||i!==``)&&(f+=IP(e,t)),l=o[s],u=n[l],e.replacer&&(u=e.replacer.call(n,l,u)),lF(e,t+1,l,!0,!0,!0)&&(d=e.tag!==null&&e.tag!==`?`||e.dump&&e.dump.length>1024,d&&(e.dump&&SP===e.dump.charCodeAt(0)?f+=`?`:f+=`? `),f+=e.dump,d&&(f+=IP(e,t)),lF(e,t+1,u,!0,d)&&(e.dump&&SP===e.dump.charCodeAt(0)?f+=`:`:f+=`: `,f+=e.dump,i+=f));e.tag=a,e.dump=i||`{}`}l(sF,`writeBlockMapping`);function cF(e,t,n){var r,i=n?e.explicitTypes:e.implicitTypes,a,o,s,c;for(a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t==`object`&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(n?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag=`?`,s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,yP.call(s.represent)===`[object Function]`)r=s.represent(t,c);else if(bP.call(s.represent,c))r=s.represent[c](t,c);else throw new AM(`!<`+s.tag+`> tag resolver accepts not "`+c+`" style`);e.dump=r}return!0}return!1}l(cF,`detectType`);function lF(e,t,n,r,i,a,o){e.tag=null,e.dump=n,cF(e,n,!1)||cF(e,n,!0);var s=yP.call(e.dump),c=r,l;r&&=e.flowLevel<0||e.flowLevel>t;var u=s===`[object Object]`||s===`[object Array]`,d,f;if(u&&(d=e.duplicates.indexOf(n),f=d!==-1),(e.tag!==null&&e.tag!==`?`||f||e.indent!==2&&t>0)&&(i=!1),f&&e.usedDuplicates[d])e.dump=`*ref_`+d;else{if(u&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),s===`[object Object]`)r&&Object.keys(e.dump).length!==0?(sF(e,t,e.dump,i),f&&(e.dump=`&ref_`+d+e.dump)):(oF(e,t,e.dump),f&&(e.dump=`&ref_`+d+` `+e.dump));else if(s===`[object Array]`)r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?aF(e,t-1,e.dump,i):aF(e,t,e.dump,i),f&&(e.dump=`&ref_`+d+e.dump)):(iF(e,t,e.dump),f&&(e.dump=`&ref_`+d+` `+e.dump));else if(s===`[object String]`)e.tag!==`?`&&QP(e,e.dump,t,a,c);else if(s===`[object Undefined]`)return!1;else{if(e.skipInvalid)return!1;throw new AM(`unacceptable kind of an object to dump `+s)}e.tag!==null&&e.tag!==`?`&&(l=encodeURI(e.tag[0]===`!`?e.tag.slice(1):e.tag).replace(/!/g,`%21`),l=e.tag[0]===`!`?`!`+l:l.slice(0,18)===`tag:yaml.org,2002:`?`!!`+l.slice(18):`!<`+l+`>`,e.dump=l+` `+e.dump)}return!0}l(lF,`writeNode`);function uF(e,t){var n=[],r=[],i,a;for(dF(e,n,r),i=0,a=r.length;i<a;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=Array(a)}l(uF,`getDuplicateReferences`);function dF(e,t,n){var r,i,a;if(typeof e==`object`&&e)if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)dF(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;i<a;i+=1)dF(e[r[i]],t,n)}l(dF,`inspectNode`);function fF(e,t){t||={};var n=new PP(t);n.noRefs||uF(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},``,r)),lF(n,0,r,!0,!0)?n.dump+`
|
|
375
|
-
`:``}l(fF,`dump$1`);var foe={dump:fF};function poe(e,t){return function(){throw Error(`Function yaml.`+e+` is removed in js-yaml 4. Use yaml.`+t+` instead, which is now safe by default.`)}}l(poe,`renamed`);var pF=rN,mF=vP.load;vP.loadAll,foe.dump;function moe(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function hF(e){if(e==null)return!0;if(re(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!ae(e)&&!fe(e)&&!pe(e)?!1:e.length===0;if(typeof e==`object`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return moe(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}var hoe={common:ee,getConfig:E,insertCluster:_e,insertEdge:xe,insertEdgeLabel:Se,insertMarkers:be,insertNode:ge,interpolateToCurve:oe,labelHelper:ve,log:c,positionEdgeLabel:ye},gF={},_F=l(e=>{for(let t of e)gF[t.name]=t},`registerLayoutLoaders`);l(()=>{_F([{name:`dagre`,loader:l(async()=>await a(()=>import(`./dagre-BM42HDAG-BvSi4ped.js`),__vite__mapDeps([102,103,104,1,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119])),`loader`)},{name:`cose-bilkent`,loader:l(async()=>await a(()=>import(`./cose-bilkent-S5V4N54A-CyT47_9y.js`),__vite__mapDeps([120,1,121,104])),`loader`)}])},`registerDefaultLayoutLoaders`)();var goe=l(async(e,t)=>{if(!(e.layoutAlgorithm in gF))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let n=t.domId||t.id;t.domId=`${e.diagramId}-${n}`}let n=gF[e.layoutAlgorithm],r=await n.loader(),{theme:i,themeVariables:a}=e.config,{useGradient:o,gradientStart:s,gradientStop:c}=a,l=t.attr(`id`);if(t.append(`defs`).append(`filter`).attr(`id`,`${l}-drop-shadow`).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),t.append(`defs`).append(`filter`).attr(`id`,`${l}-drop-shadow-small`).attr(`height`,`150%`).attr(`width`,`150%`).append(`feDropShadow`).attr(`dx`,`2`).attr(`dy`,`2`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),o){let e=t.append(`linearGradient`).attr(`id`,t.attr(`id`)+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);e.append(`svg:stop`).attr(`offset`,`0%`).attr(`stop-color`,s).attr(`stop-opacity`,1),e.append(`svg:stop`).attr(`offset`,`100%`).attr(`stop-color`,c).attr(`stop-opacity`,1)}return r.render(e,t,hoe,{algorithm:n.algorithm})},`render`),_oe=l((e=``,{fallback:t=`dagre`}={})=>{if(e in gF)return e;if(t in gF)return c.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw Error(`Both layout algorithms ${e} and ${t} are not registered.`)},`getRegisteredLayoutAlgorithm`),vF=`comm`,yF=`rule`,bF=`decl`,voe=`@import`,yoe=`@namespace`,boe=`@keyframes`,xoe=`@layer`,Soe=Math.abs,xF=String.fromCharCode;function SF(e){return e.trim()}function CF(e,t,n){return e.replace(t,n)}function wF(e,t){return e.charCodeAt(t)|0}function TF(e,t,n){return e.slice(t,n)}function EF(e){return e.length}function DF(e){return e.length}function OF(e,t){return t.push(e),e}var kF=1,AF=1,jF=0,MF=0,NF=0,PF=``;function FF(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:kF,column:AF,length:o,return:``,siblings:s}}function Coe(){return NF}function woe(){return NF=MF>0?wF(PF,--MF):0,AF--,NF===10&&(AF=1,kF--),NF}function IF(){return NF=MF<jF?wF(PF,MF++):0,AF++,NF===10&&(AF=1,kF++),NF}function LF(){return wF(PF,MF)}function RF(){return MF}function zF(e,t){return TF(PF,e,t)}function BF(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Toe(e){return kF=AF=1,jF=EF(PF=e),MF=0,[]}function Eoe(e){return PF=``,e}function VF(e){return SF(zF(MF-1,HF(e===91?e+2:e===40?e+1:e)))}function Doe(e){for(;(NF=LF())&&NF<33;)IF();return BF(e)>2||BF(NF)>3?``:` `}function Ooe(e,t){for(;--t&&IF()&&!(NF<48||NF>102||NF>57&&NF<65||NF>70&&NF<97););return zF(e,RF()+(t<6&&LF()==32&&IF()==32))}function HF(e){for(;IF();)switch(NF){case e:return MF;case 34:case 39:e!==34&&e!==39&&HF(NF);break;case 40:e===41&&HF(e);break;case 92:IF();break}return MF}function koe(e,t){for(;IF()&&e+NF!==57&&!(e+NF===84&&LF()===47););return`/*`+zF(t,MF-1)+`*`+xF(e===47?e:IF())}function Aoe(e){for(;!BF(LF());)IF();return zF(e,MF)}function joe(e){return Eoe(UF(``,null,null,null,[``],e=Toe(e),0,[0],e))}function UF(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=IF()){case 40:m!=108&&wF(w,d-1)==58?(v++,w+=`(`):w+=VF(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=VF(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=xF(y);break}w+=Doe(m);break;case 92:w+=Ooe(RF()-1,7);continue;case 47:switch(LF()){case 42:case 47:OF(Moe(koe(IF(),RF()),t,n,c),c),(BF(m||1)==5||BF(LF()||1)==5)&&EF(w)&&TF(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=EF(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=xF(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=CF(w,/\f/g,``)),p>0&&(EF(w)-d||h===0)&&OF(p>32?GF(w+`;`,r,n,d-1,c):GF(CF(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(OF(C=WF(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123)if(u===0)UF(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(wF(w,3)===110)break;case 108:if(wF(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?UF(e,C,C,r&&OF(WF(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):UF(w,C,C,C,[``],S,0,s,S)}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+EF(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&woe()==125)continue}switch(w+=xF(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(EF(w)-1)*_,_=1;break;case 64:LF()===45&&(w+=VF(IF())),f=LF(),u=d=EF(b=w+=Aoe(RF())),y++;break;case 45:m===45&&EF(w)==2&&(h=0)}}return a}function WF(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=DF(p),h=0,g=0,_=0;h<r;++h)for(var v=0,y=TF(e,f+1,f=Soe(g=o[h])),b=e;v<m;++v)(b=SF(g>0?p[v]+` `+y:CF(y,/&\f/g,p[v])))&&(c[_++]=b);return FF(e,t,n,i===0?yF:s,c,l,u,d)}function Moe(e,t,n,r){return FF(e,t,n,vF,xF(Coe()),TF(e,2,-2),0,r)}function GF(e,t,n,r,i){return FF(e,t,n,bF,TF(e,0,r),TF(e,r+1,-1),r,i)}function KF(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}function Noe(e,t,n,r){switch(e.type){case xoe:if(e.children.length)break;case voe:case yoe:case bF:return e.return=e.return||e.value;case vF:return``;case boe:return e.return=e.value+`{`+KF(e.children,r)+`}`;case yF:if(!EF(e.value=e.props.join(`,`)))return``}return EF(n=KF(e.children,r))?e.return=e.value+`{`+n+`}`:``}function Poe(e){var t=DF(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}var qF=`c4`,Foe={id:qF,detector:l(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./c4Diagram-AAUBKEIU-3llRQO71.js`);return{diagram:e}},__vite__mapDeps([122,106,1,104,105,107,108,123]));return{id:qF,diagram:e}},`loader`)},JF=`flowchart`,Ioe={id:JF,detector:l((e,t)=>t?.flowchart?.defaultRenderer===`dagre-wrapper`||t?.flowchart?.defaultRenderer===`elk`?!1:/^\s*graph/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-B2P0DenG.js`);return{diagram:e}},__vite__mapDeps([124,103,104,1,105,106,107,108,125,126,111,112,113,114,127,115,128,116,117,118,119,123]));return{id:JF,diagram:e}},`loader`)},YF=`flowchart-v2`,Loe={id:YF,detector:l((e,t)=>t?.flowchart?.defaultRenderer===`dagre-d3`?!1:(t?.flowchart?.defaultRenderer===`elk`&&(t.layout=`elk`),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer===`dagre-wrapper`?!0:/^\s*flowchart/.test(e)),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-B2P0DenG.js`);return{diagram:e}},__vite__mapDeps([124,103,104,1,105,106,107,108,125,126,111,112,113,114,127,115,128,116,117,118,119,123]));return{id:YF,diagram:e}},`loader`)},XF=`er`,Roe={id:XF,detector:l(e=>/^\s*erDiagram/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./erDiagram-TEJ5UH35-A_v6dsXs.js`);return{diagram:e}},__vite__mapDeps([129,103,104,1,105,106,107,108,125,126,111,112,113,114,127,115,116,117,118,119]));return{id:XF,diagram:e}},`loader`)},ZF=`gitGraph`,zoe={id:ZF,detector:l(e=>/^\s*gitGraph/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./gitGraphDiagram-PVQCEYII-2JmhRXUT.js`);return{diagram:e}},__vite__mapDeps([130,131,108,132,133,134,135,136,137,138,139,140,141,142,104,1,105,106,107,143,144]));return{id:ZF,diagram:e}},`loader`)},QF=`gantt`,Boe={id:QF,detector:l(e=>/^\s*gantt/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./ganttDiagram-6RSMTGT7-BEzcrIzY.js`);return{diagram:e}},__vite__mapDeps([145,1,106,146,104,147,148,105,107,108]));return{id:QF,diagram:e}},`loader`)},$F=`info`,Voe={id:$F,detector:l(e=>/^\s*info/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./infoDiagram-5YYISTIA-BYFD-rZu.js`);return{diagram:e}},__vite__mapDeps([149,131,108,132,133,134,135,136,137,138,139,140,141,142,104,1,107]));return{id:$F,diagram:e}},`loader`)},eI=`pie`,Hoe={id:eI,detector:l(e=>/^\s*pie/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./pieDiagram-4H26LBE5-BCUWyCeo.js`);return{diagram:e}},__vite__mapDeps([150,106,1,131,108,132,133,134,135,136,137,138,139,140,141,142,104,118,151,148,152,119,105,107,143]));return{id:eI,diagram:e}},`loader`)},tI=`quadrantChart`,Uoe={id:tI,detector:l(e=>/^\s*quadrantChart/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./quadrantDiagram-W4KKPZXB-DKqVquhI.js`);return{diagram:e}},__vite__mapDeps([153,146,104,1,147,148,107,108]));return{id:tI,diagram:e}},`loader`)},nI=`xychart`,Woe={id:nI,detector:l(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./xychartDiagram-2RQKCTM6-3_6RImSx.js`);return{diagram:e}},__vite__mapDeps([154,103,104,1,105,106,107,108,146,147,148,151,117,118,119]));return{id:nI,diagram:e}},`loader`)},rI=`requirement`,Goe={id:rI,detector:l(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./requirementDiagram-4Y6WPE33-BSoEfvT7.js`);return{diagram:e}},__vite__mapDeps([155,103,104,1,105,106,107,108,126,111,112,113,114,127,115,116,117,118,119]));return{id:rI,diagram:e}},`loader`)},iI=`sequence`,Koe={id:iI,detector:l(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./sequenceDiagram-3UESZ5HK-CYbve3k2.js`);return{diagram:e}},__vite__mapDeps([156,106,1,104,105,107,108,123,144]));return{id:iI,diagram:e}},`loader`)},aI=`class`,qoe={id:aI,detector:l((e,t)=>t?.class?.defaultRenderer===`dagre-wrapper`?!1:/^\s*classDiagram/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./classDiagram-4FO5ZUOK-B6P6vqOW.js`);return{diagram:e}},__vite__mapDeps([157,103,104,1,105,106,107,108,126,111,112,113,114,127,158,128,123,115,116,117,118,119]));return{id:aI,diagram:e}},`loader`)},oI=`classDiagram`,Joe={id:oI,detector:l((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer===`dagre-wrapper`?!0:/^\s*classDiagram-v2/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./classDiagram-v2-Q7XG4LA2-ildlFf3k.js`);return{diagram:e}},__vite__mapDeps([159,103,104,1,105,106,107,108,126,111,112,113,114,127,158,128,123,115,116,117,118,119]));return{id:oI,diagram:e}},`loader`)},sI=`state`,Yoe={id:sI,detector:l((e,t)=>t?.state?.defaultRenderer===`dagre-wrapper`?!1:/^\s*stateDiagram/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./stateDiagram-AJRCARHV-7TMO867-.js`);return{diagram:e}},__vite__mapDeps([160,103,104,1,105,106,107,108,117,118,119,109,110,126,111,112,113,114,127,161,115,116]));return{id:sI,diagram:e}},`loader`)},cI=`stateDiagram`,Xoe={id:cI,detector:l((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer===`dagre-wrapper`),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./stateDiagram-v2-BHNVJYJU-DPjv14aL.js`);return{diagram:e}},__vite__mapDeps([162,103,104,1,105,106,107,108,126,111,112,113,114,127,161,115,116,117,118,119]));return{id:cI,diagram:e}},`loader`)},lI=`journey`,Zoe={id:lI,detector:l(e=>/^\s*journey/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./journeyDiagram-JHISSGLW-Dqf9Usx-.js`);return{diagram:e}},__vite__mapDeps([163,104,1,152,106,118,107,108,128,123]));return{id:lI,diagram:e}},`loader`)},uI={draw:l((e,t,n)=>{c.debug(`rendering svg for syntax error
|
|
376
|
-
`);let r=bM(t),i=r.append(`g`);r.attr(`viewBox`,`0 0 2412 512`),D(r,100,512,!0),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1440).attr(`y`,250).attr(`font-size`,`150px`).style(`text-anchor`,`middle`).text(`Syntax error in text`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},Qoe=uI,$oe={db:{},renderer:uI,parser:{parse:l(()=>{},`parse`)}},dI=`flowchart-elk`,ese={id:dI,detector:l((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer===`elk`?(t.layout=`elk`,!0):!1,`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-
|
|
375
|
+
`:``}l(fF,`dump$1`);var foe={dump:fF};function poe(e,t){return function(){throw Error(`Function yaml.`+e+` is removed in js-yaml 4. Use yaml.`+t+` instead, which is now safe by default.`)}}l(poe,`renamed`);var pF=rN,mF=vP.load;vP.loadAll,foe.dump;function moe(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function hF(e){if(e==null)return!0;if(re(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!ae(e)&&!fe(e)&&!pe(e)?!1:e.length===0;if(typeof e==`object`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return moe(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}var hoe={common:ee,getConfig:E,insertCluster:_e,insertEdge:xe,insertEdgeLabel:Se,insertMarkers:be,insertNode:ge,interpolateToCurve:oe,labelHelper:ve,log:c,positionEdgeLabel:ye},gF={},_F=l(e=>{for(let t of e)gF[t.name]=t},`registerLayoutLoaders`);l(()=>{_F([{name:`dagre`,loader:l(async()=>await a(()=>import(`./dagre-BM42HDAG-BvSi4ped.js`),__vite__mapDeps([102,103,104,1,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119])),`loader`)},{name:`cose-bilkent`,loader:l(async()=>await a(()=>import(`./cose-bilkent-S5V4N54A-CyT47_9y.js`),__vite__mapDeps([120,1,121,104])),`loader`)}])},`registerDefaultLayoutLoaders`)();var goe=l(async(e,t)=>{if(!(e.layoutAlgorithm in gF))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let n=t.domId||t.id;t.domId=`${e.diagramId}-${n}`}let n=gF[e.layoutAlgorithm],r=await n.loader(),{theme:i,themeVariables:a}=e.config,{useGradient:o,gradientStart:s,gradientStop:c}=a,l=t.attr(`id`);if(t.append(`defs`).append(`filter`).attr(`id`,`${l}-drop-shadow`).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),t.append(`defs`).append(`filter`).attr(`id`,`${l}-drop-shadow-small`).attr(`height`,`150%`).attr(`width`,`150%`).append(`feDropShadow`).attr(`dx`,`2`).attr(`dy`,`2`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),o){let e=t.append(`linearGradient`).attr(`id`,t.attr(`id`)+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);e.append(`svg:stop`).attr(`offset`,`0%`).attr(`stop-color`,s).attr(`stop-opacity`,1),e.append(`svg:stop`).attr(`offset`,`100%`).attr(`stop-color`,c).attr(`stop-opacity`,1)}return r.render(e,t,hoe,{algorithm:n.algorithm})},`render`),_oe=l((e=``,{fallback:t=`dagre`}={})=>{if(e in gF)return e;if(t in gF)return c.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw Error(`Both layout algorithms ${e} and ${t} are not registered.`)},`getRegisteredLayoutAlgorithm`),vF=`comm`,yF=`rule`,bF=`decl`,voe=`@import`,yoe=`@namespace`,boe=`@keyframes`,xoe=`@layer`,Soe=Math.abs,xF=String.fromCharCode;function SF(e){return e.trim()}function CF(e,t,n){return e.replace(t,n)}function wF(e,t){return e.charCodeAt(t)|0}function TF(e,t,n){return e.slice(t,n)}function EF(e){return e.length}function DF(e){return e.length}function OF(e,t){return t.push(e),e}var kF=1,AF=1,jF=0,MF=0,NF=0,PF=``;function FF(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:kF,column:AF,length:o,return:``,siblings:s}}function Coe(){return NF}function woe(){return NF=MF>0?wF(PF,--MF):0,AF--,NF===10&&(AF=1,kF--),NF}function IF(){return NF=MF<jF?wF(PF,MF++):0,AF++,NF===10&&(AF=1,kF++),NF}function LF(){return wF(PF,MF)}function RF(){return MF}function zF(e,t){return TF(PF,e,t)}function BF(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Toe(e){return kF=AF=1,jF=EF(PF=e),MF=0,[]}function Eoe(e){return PF=``,e}function VF(e){return SF(zF(MF-1,HF(e===91?e+2:e===40?e+1:e)))}function Doe(e){for(;(NF=LF())&&NF<33;)IF();return BF(e)>2||BF(NF)>3?``:` `}function Ooe(e,t){for(;--t&&IF()&&!(NF<48||NF>102||NF>57&&NF<65||NF>70&&NF<97););return zF(e,RF()+(t<6&&LF()==32&&IF()==32))}function HF(e){for(;IF();)switch(NF){case e:return MF;case 34:case 39:e!==34&&e!==39&&HF(NF);break;case 40:e===41&&HF(e);break;case 92:IF();break}return MF}function koe(e,t){for(;IF()&&e+NF!==57&&!(e+NF===84&&LF()===47););return`/*`+zF(t,MF-1)+`*`+xF(e===47?e:IF())}function Aoe(e){for(;!BF(LF());)IF();return zF(e,MF)}function joe(e){return Eoe(UF(``,null,null,null,[``],e=Toe(e),0,[0],e))}function UF(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=IF()){case 40:m!=108&&wF(w,d-1)==58?(v++,w+=`(`):w+=VF(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=VF(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=xF(y);break}w+=Doe(m);break;case 92:w+=Ooe(RF()-1,7);continue;case 47:switch(LF()){case 42:case 47:OF(Moe(koe(IF(),RF()),t,n,c),c),(BF(m||1)==5||BF(LF()||1)==5)&&EF(w)&&TF(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=EF(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=xF(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=CF(w,/\f/g,``)),p>0&&(EF(w)-d||h===0)&&OF(p>32?GF(w+`;`,r,n,d-1,c):GF(CF(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(OF(C=WF(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123)if(u===0)UF(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(wF(w,3)===110)break;case 108:if(wF(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?UF(e,C,C,r&&OF(WF(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):UF(w,C,C,C,[``],S,0,s,S)}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+EF(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&woe()==125)continue}switch(w+=xF(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(EF(w)-1)*_,_=1;break;case 64:LF()===45&&(w+=VF(IF())),f=LF(),u=d=EF(b=w+=Aoe(RF())),y++;break;case 45:m===45&&EF(w)==2&&(h=0)}}return a}function WF(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=DF(p),h=0,g=0,_=0;h<r;++h)for(var v=0,y=TF(e,f+1,f=Soe(g=o[h])),b=e;v<m;++v)(b=SF(g>0?p[v]+` `+y:CF(y,/&\f/g,p[v])))&&(c[_++]=b);return FF(e,t,n,i===0?yF:s,c,l,u,d)}function Moe(e,t,n,r){return FF(e,t,n,vF,xF(Coe()),TF(e,2,-2),0,r)}function GF(e,t,n,r,i){return FF(e,t,n,bF,TF(e,0,r),TF(e,r+1,-1),r,i)}function KF(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}function Noe(e,t,n,r){switch(e.type){case xoe:if(e.children.length)break;case voe:case yoe:case bF:return e.return=e.return||e.value;case vF:return``;case boe:return e.return=e.value+`{`+KF(e.children,r)+`}`;case yF:if(!EF(e.value=e.props.join(`,`)))return``}return EF(n=KF(e.children,r))?e.return=e.value+`{`+n+`}`:``}function Poe(e){var t=DF(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}var qF=`c4`,Foe={id:qF,detector:l(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./c4Diagram-AAUBKEIU-3llRQO71.js`);return{diagram:e}},__vite__mapDeps([122,106,1,104,105,107,108,123]));return{id:qF,diagram:e}},`loader`)},JF=`flowchart`,Ioe={id:JF,detector:l((e,t)=>t?.flowchart?.defaultRenderer===`dagre-wrapper`||t?.flowchart?.defaultRenderer===`elk`?!1:/^\s*graph/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-txN3D2EM.js`);return{diagram:e}},__vite__mapDeps([124,103,104,1,105,106,107,108,125,126,111,112,113,114,127,115,128,116,117,118,119,123]));return{id:JF,diagram:e}},`loader`)},YF=`flowchart-v2`,Loe={id:YF,detector:l((e,t)=>t?.flowchart?.defaultRenderer===`dagre-d3`?!1:(t?.flowchart?.defaultRenderer===`elk`&&(t.layout=`elk`),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer===`dagre-wrapper`?!0:/^\s*flowchart/.test(e)),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-txN3D2EM.js`);return{diagram:e}},__vite__mapDeps([124,103,104,1,105,106,107,108,125,126,111,112,113,114,127,115,128,116,117,118,119,123]));return{id:YF,diagram:e}},`loader`)},XF=`er`,Roe={id:XF,detector:l(e=>/^\s*erDiagram/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./erDiagram-TEJ5UH35-CH2oGPRs.js`);return{diagram:e}},__vite__mapDeps([129,103,104,1,105,106,107,108,125,126,111,112,113,114,127,115,116,117,118,119]));return{id:XF,diagram:e}},`loader`)},ZF=`gitGraph`,zoe={id:ZF,detector:l(e=>/^\s*gitGraph/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./gitGraphDiagram-PVQCEYII-2JmhRXUT.js`);return{diagram:e}},__vite__mapDeps([130,131,108,132,133,134,135,136,137,138,139,140,141,142,104,1,105,106,107,143,144]));return{id:ZF,diagram:e}},`loader`)},QF=`gantt`,Boe={id:QF,detector:l(e=>/^\s*gantt/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./ganttDiagram-6RSMTGT7-BEzcrIzY.js`);return{diagram:e}},__vite__mapDeps([145,1,106,146,104,147,148,105,107,108]));return{id:QF,diagram:e}},`loader`)},$F=`info`,Voe={id:$F,detector:l(e=>/^\s*info/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./infoDiagram-5YYISTIA-DdQ6jOTC.js`);return{diagram:e}},__vite__mapDeps([149,131,108,132,133,134,135,136,137,138,139,140,141,142,104,1,107]));return{id:$F,diagram:e}},`loader`)},eI=`pie`,Hoe={id:eI,detector:l(e=>/^\s*pie/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./pieDiagram-4H26LBE5-BtJvFpVV.js`);return{diagram:e}},__vite__mapDeps([150,106,1,131,108,132,133,134,135,136,137,138,139,140,141,142,104,118,151,148,152,119,105,107,143]));return{id:eI,diagram:e}},`loader`)},tI=`quadrantChart`,Uoe={id:tI,detector:l(e=>/^\s*quadrantChart/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./quadrantDiagram-W4KKPZXB-DKqVquhI.js`);return{diagram:e}},__vite__mapDeps([153,146,104,1,147,148,107,108]));return{id:tI,diagram:e}},`loader`)},nI=`xychart`,Woe={id:nI,detector:l(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./xychartDiagram-2RQKCTM6-BnaYKX3_.js`);return{diagram:e}},__vite__mapDeps([154,103,104,1,105,106,107,108,146,147,148,151,117,118,119]));return{id:nI,diagram:e}},`loader`)},rI=`requirement`,Goe={id:rI,detector:l(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./requirementDiagram-4Y6WPE33-DQFHE1oU.js`);return{diagram:e}},__vite__mapDeps([155,103,104,1,105,106,107,108,126,111,112,113,114,127,115,116,117,118,119]));return{id:rI,diagram:e}},`loader`)},iI=`sequence`,Koe={id:iI,detector:l(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./sequenceDiagram-3UESZ5HK-DY-Krvh1.js`);return{diagram:e}},__vite__mapDeps([156,106,1,104,105,107,108,123,144]));return{id:iI,diagram:e}},`loader`)},aI=`class`,qoe={id:aI,detector:l((e,t)=>t?.class?.defaultRenderer===`dagre-wrapper`?!1:/^\s*classDiagram/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./classDiagram-4FO5ZUOK-EDX_swvj.js`);return{diagram:e}},__vite__mapDeps([157,103,104,1,105,106,107,108,126,111,112,113,114,127,158,128,123,115,116,117,118,119]));return{id:aI,diagram:e}},`loader`)},oI=`classDiagram`,Joe={id:oI,detector:l((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer===`dagre-wrapper`?!0:/^\s*classDiagram-v2/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./classDiagram-v2-Q7XG4LA2-BSUKcOCo.js`);return{diagram:e}},__vite__mapDeps([159,103,104,1,105,106,107,108,126,111,112,113,114,127,158,128,123,115,116,117,118,119]));return{id:oI,diagram:e}},`loader`)},sI=`state`,Yoe={id:sI,detector:l((e,t)=>t?.state?.defaultRenderer===`dagre-wrapper`?!1:/^\s*stateDiagram/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./stateDiagram-AJRCARHV-C-BwTDN9.js`);return{diagram:e}},__vite__mapDeps([160,103,104,1,105,106,107,108,117,118,119,109,110,126,111,112,113,114,127,161,115,116]));return{id:sI,diagram:e}},`loader`)},cI=`stateDiagram`,Xoe={id:cI,detector:l((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer===`dagre-wrapper`),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./stateDiagram-v2-BHNVJYJU-JXy5bBzJ.js`);return{diagram:e}},__vite__mapDeps([162,103,104,1,105,106,107,108,126,111,112,113,114,127,161,115,116,117,118,119]));return{id:cI,diagram:e}},`loader`)},lI=`journey`,Zoe={id:lI,detector:l(e=>/^\s*journey/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./journeyDiagram-JHISSGLW-Dqf9Usx-.js`);return{diagram:e}},__vite__mapDeps([163,104,1,152,106,118,107,108,128,123]));return{id:lI,diagram:e}},`loader`)},uI={draw:l((e,t,n)=>{c.debug(`rendering svg for syntax error
|
|
376
|
+
`);let r=bM(t),i=r.append(`g`);r.attr(`viewBox`,`0 0 2412 512`),D(r,100,512,!0),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1440).attr(`y`,250).attr(`font-size`,`150px`).style(`text-anchor`,`middle`).text(`Syntax error in text`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},Qoe=uI,$oe={db:{},renderer:uI,parser:{parse:l(()=>{},`parse`)}},dI=`flowchart-elk`,ese={id:dI,detector:l((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer===`elk`?(t.layout=`elk`,!0):!1,`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-txN3D2EM.js`);return{diagram:e}},__vite__mapDeps([124,103,104,1,105,106,107,108,125,126,111,112,113,114,127,115,128,116,117,118,119,123]));return{id:dI,diagram:e}},`loader`)},fI=`timeline`,tse={id:fI,detector:l(e=>/^\s*timeline/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./timeline-definition-PNZ67QCA-D9F3XBMb.js`);return{diagram:e}},__vite__mapDeps([164,104,1,152,106,118,105,107,108]));return{id:fI,diagram:e}},`loader`)},pI=`mindmap`,nse={id:pI,detector:l(e=>/^\s*mindmap/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./mindmap-definition-RKZ34NQL-wOCMY6Z8.js`);return{diagram:e}},__vite__mapDeps([165,103,104,1,105,106,107,108,126,111,112,113,114,127,115,116,117,118,119]));return{id:pI,diagram:e}},`loader`)},mI=`kanban`,rse={id:mI,detector:l(e=>/^\s*kanban/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./kanban-definition-UN3LZRKU-CnByYvNc.js`);return{diagram:e}},__vite__mapDeps([166,103,104,1,105,106,107,108,111,112,113,114,128]));return{id:mI,diagram:e}},`loader`)},hI=`sankey`,ise={id:hI,detector:l(e=>/^\s*sankey(-beta)?/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./sankeyDiagram-5OEKKPKP-CPEo_IdT.js`);return{diagram:e}},__vite__mapDeps([167,104,1,151,148,107,108]));return{id:hI,diagram:e}},`loader`)},gI=`packet`,ase={id:gI,detector:l(e=>/^\s*packet(-beta)?/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./diagram-LMA3HP47-D7eMQWl3.js`);return{diagram:e}},__vite__mapDeps([168,131,108,132,133,134,135,136,137,138,139,140,141,142,104,1,105,106,107,143]));return{id:gI,diagram:e}},`loader`)},_I=`radar`,ose={id:_I,detector:l(e=>/^\s*radar-beta/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./diagram-2AECGRRQ-B3A9U7BG.js`);return{diagram:e}},__vite__mapDeps([169,131,108,132,133,134,135,136,137,138,139,140,141,142,104,1,105,106,107,143]));return{id:_I,diagram:e}},`loader`)},vI=`block`,sse={id:vI,detector:l(e=>/^\s*block(-beta)?/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./blockDiagram-GPEHLZMM-WHzKaDoW.js`);return{diagram:e}},__vite__mapDeps([170,103,104,1,105,106,107,108,117,118,119,110,125,115,128,112]));return{id:vI,diagram:e}},`loader`)},yI=`treeView`,cse={id:yI,detector:l(e=>/^\s*treeView-beta/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./diagram-5GNKFQAL-DoLrxuqk.js`);return{diagram:e}},__vite__mapDeps([171,131,108,132,133,134,135,136,137,138,139,140,141,142,104,1,105,106,107,143,144]));return{id:yI,diagram:e}},`loader`)},bI=`architecture`,lse={id:bI,detector:l(e=>/^\s*architecture/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./architectureDiagram-3BPJPVTR-5eev2A3B.js`);return{diagram:e}},__vite__mapDeps([172,1,103,104,105,106,107,108,131,132,133,134,135,136,137,138,139,140,141,142,121,143]));return{id:bI,diagram:e}},`loader`)},xI=`eventmodeling`,use={id:xI,detector:l(e=>/^\s*eventmodeling/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./diagram-KO2AKTUF-DwcLgbwe.js`);return{diagram:e}},__vite__mapDeps([173,133,131,108,132,134,135,136,137,138,139,140,141,142,104,1,105,106,107,143]));return{id:xI,diagram:e}},`loader`)},SI=`ishikawa`,dse={id:SI,detector:l(e=>/^\s*ishikawa(-beta)?\b/i.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./ishikawaDiagram-YF4QCWOH-B87X_YyR.js`);return{diagram:e}},__vite__mapDeps([174,104,1,105,106,107,108,114]));return{id:SI,diagram:e}},`loader`)},CI=`venn`,fse={id:CI,detector:l(e=>/^\s*venn-beta/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./vennDiagram-CIIHVFJN-Z8xCS8bp.js`);return{diagram:e}},__vite__mapDeps([175,104,1,105,106,107,108,114]));return{id:CI,diagram:e}},`loader`)},wI=`treemap`,pse={id:wI,detector:l(e=>/^\s*treemap/.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./diagram-OG6HWLK6-DfQnGeYY.js`);return{diagram:e}},__vite__mapDeps([176,131,108,132,133,134,135,136,137,138,139,140,141,142,104,1,147,151,148,105,106,107,126,143,113]));return{id:wI,diagram:e}},`loader`)},TI=`wardley-beta`,mse={id:TI,detector:l(e=>/^\s*wardley-beta/i.test(e),`detector`),loader:l(async()=>{let{diagram:e}=await a(async()=>{let{diagram:e}=await import(`./wardleyDiagram-YWT4CUSO-D4E49ej3.js`);return{diagram:e}},__vite__mapDeps([177,131,108,132,133,134,135,136,137,138,139,140,141,142,104,1,105,106,107,143]));return{id:TI,diagram:e}},`loader`)},EI=!1,DI=l(()=>{EI||(EI=!0,g(`error`,$oe,e=>e.toLowerCase().trim()===`error`),g(`---`,{db:{clear:l(()=>{},`clear`)},styles:{},renderer:{draw:l(()=>{},`draw`)},parser:{parse:l(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},`parse`)},init:l(()=>null,`init`)},e=>e.toLowerCase().trimStart().startsWith(`---`)),_(ese,nse,lse),_(Foe,rse,Joe,qoe,Roe,Boe,Voe,Hoe,Goe,Koe,Loe,Ioe,tse,zoe,Xoe,Yoe,Zoe,Uoe,ise,ase,Woe,sse,use,cse,ose,dse,pse,fse,mse))},`addDiagrams`),hse=l(async()=>{c.debug(`Loading registered diagrams`);let e=(await Promise.allSettled(Object.entries(A).map(async([e,{detector:t,loader:n}])=>{if(n)try{y(e)}catch{try{let{diagram:e,id:r}=await n();g(r,e,t)}catch(t){throw c.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete A[e],t}}}))).filter(e=>e.status===`rejected`);if(e.length>0){c.error(`Failed to load ${e.length} external diagrams`);for(let t of e)c.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},`loadRegisteredDiagrams`),gse=`graphics-document document`;function OI(e,t){e.attr(`role`,gse),t!==``&&e.attr(`aria-roledescription`,t)}l(OI,`setA11yDiagramInfo`);function kI(e,t,n,r){if(e.insert!==void 0){if(n){let t=`chart-desc-${r}`;e.attr(`aria-describedby`,t),e.insert(`desc`,`:first-child`).attr(`id`,t).text(n)}if(t){let n=`chart-title-${r}`;e.attr(`aria-labelledby`,n),e.insert(`title`,`:first-child`).attr(`id`,n).text(t)}}}l(kI,`addSVGa11yTitleDescription`);var AI=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{l(this,`Diagram`)}static async fromText(t,n={}){let r=E(),i=M(t,r);t=de(t)+`
|
|
377
377
|
`;try{y(i)}catch{let e=f(i);if(!e)throw new F(`Diagram ${i} not found.`);let{id:t,diagram:n}=await e();g(t,n)}let{db:a,parser:o,renderer:s,init:c}=y(i);return o.parser&&(o.parser.yy=a),a.clear?.(),c?.(r),n.title&&a.setDiagramTitle?.(n.title),await o.parse(t),new e(i,t,a,o,s)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},jI=[],_se=l(()=>{jI.forEach(e=>{e()}),jI=[]},`attachFunctions`),vse=l(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,``).trimStart(),`cleanupComments`);function MI(e){let t=e.match(T);if(!t)return{text:e,metadata:{}};let n=mF(t[1],{schema:pF})??{};n=typeof n==`object`&&!Array.isArray(n)?n:{};let r={};return n.displayMode&&(r.displayMode=n.displayMode.toString()),n.title&&(r.title=n.title.toString()),n.config&&(r.config=n.config),{text:e.slice(t[0].length),metadata:r}}l(MI,`extractFrontMatter`);var yse=l(e=>e.replace(/\r\n?/g,`
|
|
378
378
|
`).replace(/<(\w+)([^>]*)>/g,(e,t,n)=>`<`+t+n.replace(/="([^"]*)"/g,`='$1'`)+`>`),`cleanupText`),bse=l(e=>{let{text:t,metadata:n}=MI(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||={},a.gantt.displayMode=r),{title:i,config:a,text:t}},`processFrontmatter`),xse=l(e=>{let t=ce.detectInit(e)??{},n=ce.detectDirective(e,`wrap`);return Array.isArray(n)?t.wrap=n.some(({type:e})=>e===`wrap`):n?.type===`wrap`&&(t.wrap=!0),{text:le(e),directive:t}},`processDirectives`);function NI(e){let t=bse(yse(e)),n=xse(t.text),r=ue(t.config,n.directive);return e=vse(n.text),{code:e,title:t.title,config:r}}l(NI,`preprocessDiagram`);function PI(e){let t=new TextEncoder().encode(e),n=Array.from(t,e=>String.fromCodePoint(e)).join(``);return btoa(n)}l(PI,`toBase64`);var Sse=5e4,Cse=`graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa`,wse=`sandbox`,Tse=`loose`,Ese=`http://www.w3.org/2000/svg`,Dse=`http://www.w3.org/1999/xlink`,Ose=`http://www.w3.org/1999/xhtml`,kse=`100%`,Ase=`100%`,jse=`border:0;margin:0;`,Mse=`margin:0`,Nse=`allow-top-navigation-by-user-activation allow-popups`,Pse=`The "iframe" tag is not supported by your browser.`,Fse=[`foreignobject`],Ise=[`dominant-baseline`];function FI(e){let t=NI(e);return m(),j(t.config??{}),t}l(FI,`processAndSetConfigs`);async function II(e,t){DI();try{let{code:t,config:n}=FI(e);return{diagramType:(await VI(t)).type,config:n}}catch(e){if(t?.suppressErrors)return!1;throw e}}l(II,`parse`);var LI=l((e,t,n=[])=>`.${e} ${t} ${h(`{ ${n.join(` !important; `)} !important; }`)}`,`cssImportantStyles`),Lse=l((e,t=new Map)=>{let n=new CSSStyleSheet;if(e.fontFamily!==void 0&&n.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,n.cssRules.length),e.altFontFamily!==void 0&&n.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,n.cssRules.length),t instanceof Map){let r=b(e)?[`> *`,`span`]:[`rect`,`polygon`,`ellipse`,`circle`,`path`];t.forEach(e=>{hF(e.styles)||r.forEach(t=>{n.insertRule(LI(e.id,t,e.styles),n.cssRules.length)}),hF(e.textStyles)||n.insertRule(LI(e.id,`tspan`,(e?.textStyles||[]).map(e=>e.replace(`color`,`fill`))),n.cssRules.length)})}let r=``;if(e.themeCSS!==void 0)if(typeof n.replaceSync==`function`){let t=new CSSStyleSheet;t.replaceSync(e.themeCSS),r=k(t)+`
|
|
379
379
|
`}else r+=`${e.themeCSS}
|
|
@@ -489,14 +489,14 @@ ${e}</tr>
|
|
|
489
489
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${qQ(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=JQ(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+qQ(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=JQ(e);if(i===null)return qQ(n);e=i;let a=`<img src="${e}" alt="${qQ(n)}"`;return t&&(a+=` title="${qQ(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:qQ(e.text)}},i$=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},a$=class e{options;renderer;textRenderer;constructor(e){this.options=e||PZ,this.options.renderer=this.options.renderer||new r$,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new i$}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},o$=class{options;block;constructor(e){this.options=e||PZ}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?n$.lex:n$.lexInline}provideParser(e=this.block){return e?a$.parse:a$.parseInline}},s$=new class{defaults=NZ();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=a$;Renderer=r$;TextRenderer=i$;Lexer=n$;Tokenizer=t$;Hooks=o$;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new r$(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new t$(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new o$;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];o$.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&o$.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return n$.lex(e,t??this.defaults)}parser(e,t){return a$.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?n$.lex:n$.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?a$.parse:a$.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?n$.lex:n$.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?a$.parse:a$.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
490
490
|
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+qQ(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function c$(e,t){return s$.parse(e,t)}c$.options=c$.setOptions=function(e){return s$.setOptions(e),c$.defaults=s$.defaults,FZ(c$.defaults),c$},c$.getDefaults=NZ,c$.defaults=PZ,c$.use=function(...e){return s$.use(...e),c$.defaults=s$.defaults,FZ(c$.defaults),c$},c$.walkTokens=function(e,t){return s$.walkTokens(e,t)},c$.parseInline=s$.parseInline,c$.Parser=a$,c$.parser=a$.parse,c$.Renderer=r$,c$.TextRenderer=i$,c$.Lexer=n$,c$.lexer=n$.lex,c$.Tokenizer=t$,c$.Hooks=o$,c$.parse=c$,c$.options,c$.setOptions,c$.use,c$.walkTokens,c$.parseInline,a$.parse,n$.lex;var l$=300,u$=`300px`,d$=500;function f$(e={}){let{immediate:t=!1,debounceDelay:n=l$,rootMargin:r=u$,idleTimeout:i=d$}=e,[a,o]=(0,I.useState)(!1),s=(0,I.useRef)(null),c=(0,I.useRef)(null),l=(0,I.useRef)(null),u=(0,I.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),d=(0,I.useMemo)(()=>typeof window<`u`&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),f=(0,I.useMemo)(()=>typeof window<`u`&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,I.useEffect)(()=>{if(t){o(!0);return}let e=s.current;if(!e)return;c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null);let a=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null)},u=e=>{l.current=d(t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):l.current=d(()=>{o(!0),e.disconnect()},{timeout:i/2})},{timeout:i})},p=e=>{a(),c.current=window.setTimeout(()=>{var t;let n=e.takeRecords();(n.length===0||(t=n.at(-1)?.isIntersecting)!=null&&t)&&u(e)},n)},m=(e,t)=>{e.isIntersecting?p(t):a()},h=new IntersectionObserver(e=>{for(let t of e)m(t,h)},{rootMargin:r,threshold:0});return h.observe(e),()=>{c.current&&clearTimeout(c.current),l.current&&f(l.current),h.disconnect()}},[t,n,r,i,f,d]),{shouldRender:a,containerRef:s}}var p$=/\s/,m$=/^\s+$/,h$=new Set([`code`,`pre`,`svg`,`math`,`annotation`]),g$=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,_$=e=>e.some(e=>g$(e)&&h$.has(e.tagName)),v$=e=>{let t=[],n=``,r=!1;for(let i of e){let e=p$.test(i);e!==r&&n&&(t.push(n),n=``),n+=i,r=e}return n&&t.push(n),t},y$=e=>{let t=[],n=``;for(let r of e)p$.test(r)?n+=r:(n&&=(t.push(n),``),t.push(r));return n&&t.push(n),t},b$=(e,t,n,r,i,a)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(o+=`;--sd-delay:${a}ms`),{type:`element`,tagName:`span`,properties:{"data-sd-animate":!0,style:o},children:[{type:`text`,value:e}]}},x$=(e,t,n,r,i)=>{let a=t.at(-1);if(!(a&&`children`in a))return;if(_$(t))return HC;let o=a,s=o.children.indexOf(e);if(s===-1)return;let c=e.value;if(!c.trim()){i.count+=c.length;return}let l=n.sep===`char`?y$(c):v$(c),u=r.prevContentLength,d=l.map(e=>{let t=i.count;if(i.count+=e.length,m$.test(e))return{type:`text`,value:e};let r=u>0&&t<u,a=r?0:i.newIndex++*n.stagger;return b$(e,n.animation,n.duration,n.easing,r,a)});return o.children.splice(s,1,...d),s+d.length},S$=0;function C$(e){let t={animation:e?.animation??`fadeIn`,duration:e?.duration??150,easing:e?.easing??`ease`,sep:e?.sep??`word`,stagger:e?.stagger??40},n={prevContentLength:0,lastRenderCharCount:0},r=S$++,i=()=>e=>{let r={count:0,newIndex:0};UC(e,`text`,(e,i)=>x$(e,i,t,n,r)),n.lastRenderCharCount=r.count,n.prevContentLength=0};return Object.defineProperty(i,`name`,{value:`rehypeAnimate$${r}`}),{name:`animate`,type:`animate`,rehypePlugin:i,setPrevContentLength(e){n.prevContentLength=e},getLastRenderCharCount(){let e=n.lastRenderCharCount;return n.lastRenderCharCount=0,e}}}C$();var w$=(0,I.createContext)(!1),T$=()=>(0,I.useContext)(w$),E$=(...e)=>Ng(Sh(e)),D$=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(t=>t.startsWith(n)?t:`${e}:${t}`).join(` `)},O$=e=>e?(...t)=>D$(e,Ng(Sh(t))):E$,k$=(e,t,n)=>{let r=typeof t==`string`&&n.startsWith(`text/csv`)?``:``,i=typeof t==`string`?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},A$=(0,I.createContext)(E$),j$=()=>(0,I.useContext)(A$),M$=E$(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-6`,`before:mr-4`,`before:text-[13px]`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),N$=e=>{let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r&&i&&(t[r]=i)}}return t},P$=(0,I.memo)(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:a=!0,...o})=>{let s=j$(),c=(0,I.useMemo)(()=>s(M$),[s]),l=(0,I.useMemo)(()=>{let e={};return t.bg&&(e[`--sdm-bg`]=t.bg),t.fg&&(e[`--sdm-fg`]=t.fg),t.rootStyle&&Object.assign(e,N$(t.rootStyle)),e},[t.bg,t.fg,t.rootStyle]);return(0,U.jsx)(`div`,{className:s(r,`overflow-x-auto rounded-md border border-border bg-background p-4 text-sm`),"data-language":n,"data-streamdown":`code-block-body`,...o,children:(0,U.jsx)(`pre`,{className:s(r,`bg-[var(--sdm-bg,inherit]`,`dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]`),style:l,children:(0,U.jsx)(`code`,{className:a?s(`[counter-increment:line_0] [counter-reset:line]`):void 0,style:a&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((e,t)=>(0,U.jsx)(`span`,{className:a?c:void 0,children:e.length===0||e.length===1&&e[0].content===``?`
|
|
491
491
|
`:e.map((e,t)=>{let n={},r=!!e.bgColor;if(e.color&&(n[`--sdm-c`]=e.color),e.bgColor&&(n[`--sdm-tbg`]=e.bgColor),e.htmlStyle)for(let[t,i]of Object.entries(e.htmlStyle))t===`color`?n[`--sdm-c`]=i:t===`background-color`?(n[`--sdm-tbg`]=i,r=!0):n[t]=i;return(0,U.jsx)(`span`,{className:s(`text-[var(--sdm-c,inherit)]`,`dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]`,r&&`bg-[var(--sdm-tbg)]`,r&&`dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]`),style:n,...e.htmlAttrs,children:e.content},t)})},t))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),F$=({className:e,language:t,style:n,isIncomplete:r,...i})=>(0,U.jsx)(`div`,{className:j$()(`my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":`code-block`,style:{contentVisibility:`auto`,containIntrinsicSize:`auto 200px`,...n},...i}),I$=(0,I.createContext)({code:``}),L$=()=>(0,I.useContext)(I$),R$=({language:e})=>{let t=j$();return(0,U.jsx)(`div`,{className:t(`flex h-8 items-center text-muted-foreground text-xs`),"data-language":e,"data-streamdown":`code-block-header`,children:(0,U.jsx)(`span`,{className:t(`ml-1 font-mono lowercase`),children:e})})},z$=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
492
|
-
`;)t--;return e.slice(0,t)},B$=(0,I.lazy)(()=>a(()=>import(`./highlighted-body-OFNGDK62-
|
|
492
|
+
`;)t--;return e.slice(0,t)},B$=(0,I.lazy)(()=>a(()=>import(`./highlighted-body-OFNGDK62-CWOOg70T.js`).then(e=>({default:e.HighlightedCodeBlockBody})),__vite__mapDeps([178,1]))),V$=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=j$(),l=(0,I.useMemo)(()=>z$(e),[e]),u=(0,I.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:l.split(`
|
|
493
493
|
`).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[l]);return(0,U.jsx)(I$.Provider,{value:{code:e},children:(0,U.jsxs)(F$,{isIncomplete:i,language:t,children:[(0,U.jsx)(R$,{language:t}),r?(0,U.jsx)(`div`,{className:c(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,U.jsx)(`div`,{className:c(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`code-block-actions`,children:r})}):null,(0,U.jsx)(I.Suspense,{fallback:(0,U.jsx)(P$,{className:n,language:t,lineNumbers:o,result:u,startLine:a,...s}),children:(0,U.jsx)(B$,{className:n,code:l,language:t,lineNumbers:o,raw:u,startLine:a,...s})})]})})},H$={CheckIcon:e=>(0,U.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z`,fill:`currentColor`,fillRule:`evenodd`})}),CopyIcon:e=>(0,U.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),DownloadIcon:e=>(0,U.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),ExternalLinkIcon:e=>(0,U.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z`,fill:`currentColor`,fillRule:`evenodd`})}),Loader2Icon:e=>(0,U.jsxs)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:[(0,U.jsx)(`path`,{d:`M8 0V4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M8 16V12`,opacity:`0.5`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M3.29773 1.52783L5.64887 4.7639`,opacity:`0.9`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M12.7023 1.52783L10.3511 4.7639`,opacity:`0.1`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M12.7023 14.472L10.3511 11.236`,opacity:`0.4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M3.29773 14.472L5.64887 11.236`,opacity:`0.6`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M15.6085 5.52783L11.8043 6.7639`,opacity:`0.2`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M0.391602 10.472L4.19583 9.23598`,opacity:`0.7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M15.6085 10.4722L11.8043 9.2361`,opacity:`0.3`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M0.391602 5.52783L4.19583 6.7639`,opacity:`0.8`,stroke:`currentColor`,strokeWidth:`1.5`})]}),Maximize2Icon:e=>(0,U.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z`,fill:`currentColor`,fillRule:`evenodd`})}),RotateCcwIcon:e=>(0,U.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z`,fill:`currentColor`,fillRule:`evenodd`})}),XIcon:e=>(0,U.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomInIcon:e=>(0,U.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomOutIcon:e=>(0,U.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})})},U$=(0,I.createContext)(H$),W$=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>e[n]===t[n]):!1},G$=({icons:e,children:t})=>{let n=(0,I.useRef)(e),r=(0,I.useRef)(e?{...H$,...e}:H$);W$(n.current,e)||(n.current=e,r.current=e?{...H$,...e}:H$);let i=r.current;return(0,U.jsx)(U$.Provider,{value:i,children:t})},K$=()=>(0,I.useContext)(U$),q$={copyCode:`Copy Code`,downloadFile:`Download file`,downloadDiagram:`Download diagram`,downloadDiagramAsSvg:`Download diagram as SVG`,downloadDiagramAsPng:`Download diagram as PNG`,downloadDiagramAsMmd:`Download diagram as MMD`,viewFullscreen:`View fullscreen`,exitFullscreen:`Exit fullscreen`,mermaidFormatSvg:`SVG`,mermaidFormatPng:`PNG`,mermaidFormatMmd:`MMD`,copyTable:`Copy table`,copyTableAsMarkdown:`Copy table as Markdown`,copyTableAsCsv:`Copy table as CSV`,copyTableAsTsv:`Copy table as TSV`,downloadTable:`Download table`,downloadTableAsCsv:`Download table as CSV`,downloadTableAsMarkdown:`Download table as Markdown`,tableFormatMarkdown:`Markdown`,tableFormatCsv:`CSV`,tableFormatTsv:`TSV`,imageNotAvailable:`Image not available`,downloadImage:`Download image`,openExternalLink:`Open external link?`,externalLinkWarning:`You're about to visit an external website.`,close:`Close`,copyLink:`Copy link`,copied:`Copied`,openLink:`Open link`},J$=(0,I.createContext)(q$),Y$=()=>(0,I.useContext)(J$),X$=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let s=j$(),[c,l]=(0,I.useState)(!1),u=(0,I.useRef)(0),{code:d}=L$(),{isAnimating:f}=(0,I.useContext)(A0),p=Y$(),m=a??d,h=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{c||(await navigator.clipboard.writeText(m),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),n))}catch(e){t?.(e)}};(0,I.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let g=K$(),_=c?g.CheckIcon:g.CopyIcon;return(0,U.jsx)(`button`,{className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:f,onClick:h,title:p.copyCode,type:`button`,...o,children:r??(0,U.jsx)(_,{size:14})})},Z$={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},Q$=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let s=j$(),{code:c}=L$(),{isAnimating:l}=(0,I.useContext)(A0),u=Y$(),d=K$(),f=a??c,p=`file.${n&&n in Z$?Z$[n]:`txt`}`;return(0,U.jsx)(`button`,{className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:l,onClick:()=>{try{k$(p,f,`text/plain`),e?.()}catch(e){t?.(e)}},title:u.downloadFile,type:`button`,...o,children:r??(0,U.jsx)(d.DownloadIcon,{size:14})})},$$=()=>{let{Loader2Icon:e}=K$(),t=j$();return(0,U.jsxs)(`div`,{className:t(`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`),children:[(0,U.jsx)(`div`,{className:t(`h-[46px] w-full bg-muted/80`)}),(0,U.jsx)(`div`,{className:t(`flex w-full items-center justify-center p-4`),children:(0,U.jsx)(e,{className:t(`size-4 animate-spin`)})})]})},e1=/\.[^/.]+$/,t1=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,...o})=>{let{DownloadIcon:s}=K$(),c=j$(),l=(0,I.useRef)(null),[u,d]=(0,I.useState)(!1),[f,p]=(0,I.useState)(!1),m=Y$(),h=o.width!=null||o.height!=null,g=(u||h)&&!f,_=f&&!h;(0,I.useEffect)(()=>{let e=l.current;if(e!=null&&e.complete){let t=e.naturalWidth>0;d(t),p(!t)}},[]);let v=(0,I.useCallback)(e=>{d(!0),p(!1),i?.(e)},[i]),y=(0,I.useCallback)(e=>{d(!1),p(!0),a?.(e)},[a]),b=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(e1,``)}.${i}`}k$(o,e,e.type)}catch{window.open(n,`_blank`)}};return n?(0,U.jsxs)(`div`,{className:c(`group relative my-4 inline-block`),"data-streamdown":`image-wrapper`,children:[(0,U.jsx)(`img`,{alt:r,className:c(`max-w-full rounded-lg`,_&&`hidden`,t),"data-streamdown":`image`,onError:y,onLoad:v,ref:l,src:n,...o}),_&&(0,U.jsx)(`span`,{className:c(`text-muted-foreground text-xs italic`),"data-streamdown":`image-fallback`,children:m.imageNotAvailable}),(0,U.jsx)(`div`,{className:c(`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`)}),g&&(0,U.jsx)(`button`,{className:c(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:b,title:m.downloadImage,type:`button`,children:(0,U.jsx)(s,{size:14})})]}):null},n1=0,r1=()=>{n1+=1,n1===1&&(document.body.style.overflow=`hidden`)},i1=()=>{n1=Math.max(0,n1-1),n1===0&&(document.body.style.overflow=``)},a1=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:s}=K$(),c=j$(),[l,u]=(0,I.useState)(!1),d=Y$(),f=(0,I.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),2e3)}catch{}},[e]),p=(0,I.useCallback)(()=>{r(),n()},[r,n]);return(0,I.useEffect)(()=>{if(t){r1();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),i1()}}},[t,n]),t?(0,U.jsx)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm`),"data-streamdown":`link-safety-modal`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`button`,tabIndex:0,children:(0,U.jsxs)(`div`,{className:c(`relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,U.jsx)(`button`,{className:c(`absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:n,title:d.close,type:`button`,children:(0,U.jsx)(s,{size:16})}),(0,U.jsxs)(`div`,{className:c(`flex flex-col gap-2`),children:[(0,U.jsxs)(`div`,{className:c(`flex items-center gap-2 font-semibold text-lg`),children:[(0,U.jsx)(o,{size:20}),(0,U.jsx)(`span`,{children:d.openExternalLink})]}),(0,U.jsx)(`p`,{className:c(`text-muted-foreground text-sm`),children:d.externalLinkWarning})]}),(0,U.jsx)(`div`,{className:c(`break-all rounded-md bg-muted p-3 font-mono text-sm`,e.length>100&&`max-h-32 overflow-y-auto`),children:e}),(0,U.jsxs)(`div`,{className:c(`flex gap-2`),children:[(0,U.jsx)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted`),onClick:f,type:`button`,children:l?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(i,{size:14}),(0,U.jsx)(`span`,{children:d.copied})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(a,{size:14}),(0,U.jsx)(`span`,{children:d.copyLink})]})}),(0,U.jsxs)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90`),onClick:p,type:`button`,children:[(0,U.jsx)(o,{size:14}),(0,U.jsx)(`span`,{children:d.openLink})]})]})]})}):null},o1=(0,I.createContext)(null),s1=()=>(0,I.useContext)(o1),c1=()=>s1()?.code??null,l1=()=>s1()?.mermaid??null,u1=e=>{var t;let n=s1();return n!=null&&n.renderers&&e&&(t=n.renderers.find(t=>Array.isArray(t.language)?t.language.includes(e):t.language===e))!=null?t:null},d1=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),f1=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=j$(),[s,c]=(0,I.useState)(!1),l=(0,I.useRef)(null),{isAnimating:u}=(0,I.useContext)(A0),d=K$(),f=l1(),p=Y$(),m=async t=>{try{if(t===`mmd`){k$(`diagram.mmd`,e,`text/plain`),c(!1),r?.(t);return}if(!f){a?.(Error(`Mermaid plugin not available`));return}let n=f.getMermaid(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(s,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}if(t===`svg`){k$(`diagram.svg`,l,`image/svg+xml`),c(!1),r?.(t);return}if(t===`png`){k$(`diagram.png`,await d1(l),`image/png`),r?.(t),c(!1);return}}catch(e){a?.(e)}};return(0,I.useEffect)(()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,U.jsxs)(`div`,{className:o(`relative`),ref:l,children:[(0,U.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:u,onClick:()=>c(!s),title:p.downloadDiagram,type:`button`,children:t??(0,U.jsx)(d.DownloadIcon,{size:14})}),s?(0,U.jsxs)(`div`,{className:o(`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,U.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`svg`),title:p.downloadDiagramAsSvg,type:`button`,children:p.mermaidFormatSvg}),(0,U.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`png`),title:p.downloadDiagramAsPng,type:`button`,children:p.mermaidFormatPng}),(0,U.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`mmd`),title:p.downloadDiagramAsMmd,type:`button`,children:p.mermaidFormatMmd})]}):null]})},p1=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:s}=K$(),c=j$(),[l,u]=(0,I.useState)(!1),{isAnimating:d,controls:f}=(0,I.useContext)(A0),p=Y$(),m=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0?!0:e.panZoom!==!1})(),h=()=>{u(!l)};return(0,I.useEffect)(()=>{if(l){r1();let e=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),i1()}}},[l]),(0,I.useEffect)(()=>{l?n?.():r&&r()},[l,n,r]),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{className:c(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:d,onClick:h,title:p.viewFullscreen,type:`button`,...a,children:(0,U.jsx)(o,{size:14})}),l?(0,Ky.createPortal)((0,U.jsxs)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`),onClick:h,onKeyDown:e=>{e.key===`Escape`&&h()},role:`button`,tabIndex:0,children:[(0,U.jsx)(`button`,{className:c(`absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:h,title:p.exitFullscreen,type:`button`,children:(0,U.jsx)(s,{size:20})}),(0,U.jsx)(`div`,{className:c(`flex size-full items-center justify-center p-4`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,U.jsx)(N0,{chart:e,className:c(`size-full [&_svg]:h-auto [&_svg]:w-auto`),config:t,fullscreen:!0,showControls:m})})]}),document.body):null]})},m1=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(e.textContent?.trim()||``);let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(e.textContent?.trim()||``);n.push(t)}return{headers:t,rows:n}},h1=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1,n=!1;for(let r of e){if(r===`"`){t=!0,n=!0;break}(r===`,`||r===`
|
|
494
494
|
`)&&(t=!0)}return t?n?`"${e.replace(/"/g,`""`)}"`:`"${e}"`:e},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(`,`),o+=1);for(let e of n)a[o]=e.map(r).join(`,`),o+=1;return a.join(`
|
|
495
495
|
`)},g1=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1;for(let n of e)if(n===` `||n===`
|
|
496
496
|
`||n===`\r`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===` `?n.push(`\\t`):t===`
|
|
497
497
|
`?n.push(`\\n`):t===`\r`?n.push(`\\r`):n.push(t);return n.join(``)},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(` `),o+=1);for(let e of n)a[o]=e.map(r).join(` `),o+=1;return a.join(`
|
|
498
498
|
`)},_1=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):n.push(t);return n.join(``)},v1=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0;r[i]=`| ${t.map(e=>_1(e)).join(` | `)} |`,i+=1;let a=Array(t.length);for(let e=0;e<t.length;e+=1)a[e]=`---`;r[i]=`| ${a.join(` | `)} |`,i+=1;for(let e of n)if(e.length<t.length){let n=Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?_1(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else r[i]=`| ${e.map(e=>_1(e)).join(` | `)} |`,i+=1;return r.join(`
|
|
499
|
-
`)},y1=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=j$(),[o,s]=(0,I.useState)(!1),[c,l]=(0,I.useState)(!1),u=(0,I.useRef)(null),d=(0,I.useRef)(0),{isAnimating:f}=(0,I.useContext)(A0),p=Y$(),m=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=m1(t),o=({csv:h1,tsv:g1,md:v1}[e]||v1)(a),c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,I.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let h=K$(),g=c?h.CheckIcon:h.CopyIcon;return(0,U.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,U.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:p.copyTable,type:`button`,children:e??(0,U.jsx)(g,{height:14,width:14})}),o?(0,U.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,U.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`md`),title:p.copyTableAsMarkdown,type:`button`,children:p.tableFormatMarkdown}),(0,U.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`csv`),title:p.copyTableAsCsv,type:`button`,children:p.tableFormatCsv}),(0,U.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`tsv`),title:p.copyTableAsTsv,type:`button`,children:p.tableFormatTsv})]}):null]})},b1=({children:e,className:t,onDownload:n,onError:r})=>{let i=j$(),[a,o]=(0,I.useState)(!1),s=(0,I.useRef)(null),{isAnimating:c}=(0,I.useContext)(A0),l=Y$(),u=K$(),d=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=m1(t),a=e===`csv`?h1(i):v1(i);k$(`table.${e===`csv`?`csv`:`md`}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,I.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,U.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,U.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:l.downloadTable,type:`button`,children:e??(0,U.jsx)(u.DownloadIcon,{size:14})}),a?(0,U.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,U.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`csv`),title:l.downloadTableAsCsv,type:`button`,children:l.tableFormatCsv}),(0,U.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`markdown`),title:l.downloadTableAsMarkdown,type:`button`,children:l.tableFormatMarkdown})]}):null]})},x1=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=K$(),o=j$(),[s,c]=(0,I.useState)(!1),{isAnimating:l}=(0,I.useContext)(A0),u=Y$(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,I.useEffect)(()=>{if(s){r1();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),i1()}}},[s]),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,U.jsx)(i,{size:14})}),s?(0,Ky.createPortal)((0,U.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,U.jsxs)(`div`,{className:o(`flex h-full flex-col`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,U.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,U.jsx)(y1,{}):null,r?(0,U.jsx)(b1,{}):null,(0,U.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,U.jsx)(a,{size:20})})]}),(0,U.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,U.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},S1=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:a=!0,...o})=>{let s=j$(),c=n&&r,l=n&&i,u=n&&a,d=c||l||u;return(0,U.jsxs)(`div`,{className:s(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[d?(0,U.jsxs)(`div`,{className:s(`flex items-center justify-end gap-1`),children:[c?(0,U.jsx)(y1,{}):null,l?(0,U.jsx)(b1,{}):null,u?(0,U.jsx)(x1,{showCopy:c,showDownload:l,children:e}):null]}):null,(0,U.jsx)(`div`,{className:s(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),children:(0,U.jsx)(`table`,{className:s(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...o,children:e})})]})},C1=/startLine=(\d+)/,w1=/\bnoLineNumbers\b/,T1=(0,I.lazy)(()=>a(()=>import(`./mermaid-GHXKKRXX-Bc-xhAE7.js`).then(e=>({default:e.Mermaid})),[])),E1=/language-([^\s]+)/;function D1(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function O1(e,t){return e.className===t.className&&D1(e.node,t.node)}var k1=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,A1=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},j1=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},M1=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},N1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`ol`,{className:j$()(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e}),(e,t)=>O1(e,t));N1.displayName=`MarkdownOl`;var P1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`li`,{className:j$()(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e}),(e,t)=>e.className===t.className&&D1(e.node,t.node));P1.displayName=`MarkdownLi`;var F1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`ul`,{className:j$()(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e}),(e,t)=>O1(e,t));F1.displayName=`MarkdownUl`;var I1=(0,I.memo)(({className:e,node:t,...n})=>(0,U.jsx)(`hr`,{className:j$()(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n}),(e,t)=>O1(e,t));I1.displayName=`MarkdownHr`;var L1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`span`,{className:j$()(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e}),(e,t)=>O1(e,t));L1.displayName=`MarkdownStrong`;var R1=(0,I.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=j$(),{linkSafety:o}=(0,I.useContext)(A0),[s,c]=(0,I.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,I.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,I.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,I.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,U.jsx)(a1,{...p})]}):(0,U.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>O1(e,t)&&e.href===t.href);R1.displayName=`MarkdownA`;var z1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`h1`,{className:j$()(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e}),(e,t)=>O1(e,t));z1.displayName=`MarkdownH1`;var B1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`h2`,{className:j$()(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e}),(e,t)=>O1(e,t));B1.displayName=`MarkdownH2`;var V1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`h3`,{className:j$()(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e}),(e,t)=>O1(e,t));V1.displayName=`MarkdownH3`;var H1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`h4`,{className:j$()(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e}),(e,t)=>O1(e,t));H1.displayName=`MarkdownH4`;var U1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`h5`,{className:j$()(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e}),(e,t)=>O1(e,t));U1.displayName=`MarkdownH5`;var W1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`h6`,{className:j$()(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e}),(e,t)=>O1(e,t));W1.displayName=`MarkdownH6`;var G1=(0,I.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,I.useContext)(A0);return(0,U.jsx)(S1,{className:t,showControls:k1(i,`table`),showCopy:A1(i,`copy`),showDownload:A1(i,`download`),showFullscreen:A1(i,`fullscreen`),...r,children:e})},(e,t)=>O1(e,t));G1.displayName=`MarkdownTable`;var K1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`thead`,{className:j$()(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e}),(e,t)=>O1(e,t));K1.displayName=`MarkdownThead`;var q1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`tbody`,{className:j$()(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e}),(e,t)=>O1(e,t));q1.displayName=`MarkdownTbody`;var J1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`tr`,{className:j$()(`border-border`,t),"data-streamdown":`table-row`,...r,children:e}),(e,t)=>O1(e,t));J1.displayName=`MarkdownTr`;var Y1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`th`,{className:j$()(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e}),(e,t)=>O1(e,t));Y1.displayName=`MarkdownTh`;var X1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`td`,{className:j$()(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e}),(e,t)=>O1(e,t));X1.displayName=`MarkdownTd`;var Z1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`blockquote`,{className:j$()(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e}),(e,t)=>O1(e,t));Z1.displayName=`MarkdownBlockquote`;var Q1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`sup`,{className:j$()(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e}),(e,t)=>O1(e,t));Q1.displayName=`MarkdownSup`;var $1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`sub`,{className:j$()(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e}),(e,t)=>O1(e,t));$1.displayName=`MarkdownSub`;var e0=(0,I.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,I.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,I.isValidElement)(e))if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,I.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,I.isValidElement)(e))return e;if(e.type===N1){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,U.jsx)(`section`,{className:t,...r,children:i}):null}return(0,U.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>O1(e,t));e0.displayName=`MarkdownSection`;var t0=(0,I.memo)(({node:e,className:t,children:n,...r})=>{let i=j$(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,I.useContext)(A0),l=l1(),u=T$(),d=(t?.match(E1))?.at(1)??``,f=u1(d);if(a)return(0,U.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(C1),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&w1.test(p))&&c!==!1,v=``;if((0,I.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?v=n.props.children:typeof n==`string`&&(v=n),f){let e=f.component;return(0,U.jsx)(I.Suspense,{fallback:(0,U.jsx)($$,{}),children:(0,U.jsx)(e,{code:v,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=k1(s,`mermaid`),n=M1(s,`download`),r=M1(s,`copy`),a=M1(s,`fullscreen`),c=M1(s,`panZoom`),l=e&&(n||r||a);return(0,U.jsx)(I.Suspense,{fallback:(0,U.jsx)($$,{}),children:(0,U.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,U.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,U.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,U.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,U.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,U.jsx)(f1,{chart:v,config:o?.config}):null,r?(0,U.jsx)(X$,{code:v}):null,a?(0,U.jsx)(p1,{chart:v,config:o?.config}):null]})}):null,(0,U.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,U.jsx)(T1,{chart:v,config:o?.config,showControls:c})})]})})}let y=k1(s,`code`),b=j1(s,`download`),x=j1(s,`copy`);return(0,U.jsx)(V$,{className:t,code:v,isIncomplete:u,language:d,lineNumbers:_,startLine:g,children:y?(0,U.jsxs)(U.Fragment,{children:[b?(0,U.jsx)(Q$,{code:v,language:d}):null,x?(0,U.jsx)(X$,{}):null]}):null})},(e,t)=>e.className===t.className&&D1(e.node,t.node));t0.displayName=`MarkdownCode`;var n0=(0,I.memo)(t1,(e,t)=>e.className===t.className&&D1(e.node,t.node));n0.displayName=`MarkdownImg`;var r0=(0,I.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,I.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,U.jsx)(U.Fragment,{children:e})}return(0,U.jsx)(`p`,{...n,children:e})},(e,t)=>O1(e,t));r0.displayName=`MarkdownParagraph`;var i0={ol:N1,li:P1,ul:F1,hr:I1,strong:L1,a:R1,h1:z1,h2:B1,h3:V1,h4:H1,h5:U1,h6:W1,table:G1,thead:K1,tbody:q1,tr:J1,th:Y1,td:X1,blockquote:Z1,code:t0,img:n0,pre:({children:e})=>(0,I.isValidElement)(e)?(0,I.cloneElement)(e,{"data-block":`true`}):e,sup:Q1,sub:$1,p:r0,section:e0},a0=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,o0=/\p{L}/u;function s0(e){let t=e.replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``);for(let e of t){if(a0.test(e))return`rtl`;if(o0.test(e))return`ltr`}return`ltr`}var c0=/^[ \t]{0,3}(`{3,}|~{3,})/,l0=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,u0=e=>{let t=e.split(`
|
|
499
|
+
`)},y1=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=j$(),[o,s]=(0,I.useState)(!1),[c,l]=(0,I.useState)(!1),u=(0,I.useRef)(null),d=(0,I.useRef)(0),{isAnimating:f}=(0,I.useContext)(A0),p=Y$(),m=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=m1(t),o=({csv:h1,tsv:g1,md:v1}[e]||v1)(a),c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,I.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let h=K$(),g=c?h.CheckIcon:h.CopyIcon;return(0,U.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,U.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:p.copyTable,type:`button`,children:e??(0,U.jsx)(g,{height:14,width:14})}),o?(0,U.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,U.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`md`),title:p.copyTableAsMarkdown,type:`button`,children:p.tableFormatMarkdown}),(0,U.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`csv`),title:p.copyTableAsCsv,type:`button`,children:p.tableFormatCsv}),(0,U.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`tsv`),title:p.copyTableAsTsv,type:`button`,children:p.tableFormatTsv})]}):null]})},b1=({children:e,className:t,onDownload:n,onError:r})=>{let i=j$(),[a,o]=(0,I.useState)(!1),s=(0,I.useRef)(null),{isAnimating:c}=(0,I.useContext)(A0),l=Y$(),u=K$(),d=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=m1(t),a=e===`csv`?h1(i):v1(i);k$(`table.${e===`csv`?`csv`:`md`}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,I.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,U.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,U.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:l.downloadTable,type:`button`,children:e??(0,U.jsx)(u.DownloadIcon,{size:14})}),a?(0,U.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,U.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`csv`),title:l.downloadTableAsCsv,type:`button`,children:l.tableFormatCsv}),(0,U.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`markdown`),title:l.downloadTableAsMarkdown,type:`button`,children:l.tableFormatMarkdown})]}):null]})},x1=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=K$(),o=j$(),[s,c]=(0,I.useState)(!1),{isAnimating:l}=(0,I.useContext)(A0),u=Y$(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,I.useEffect)(()=>{if(s){r1();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),i1()}}},[s]),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,U.jsx)(i,{size:14})}),s?(0,Ky.createPortal)((0,U.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,U.jsxs)(`div`,{className:o(`flex h-full flex-col`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,U.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,U.jsx)(y1,{}):null,r?(0,U.jsx)(b1,{}):null,(0,U.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,U.jsx)(a,{size:20})})]}),(0,U.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,U.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},S1=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:a=!0,...o})=>{let s=j$(),c=n&&r,l=n&&i,u=n&&a,d=c||l||u;return(0,U.jsxs)(`div`,{className:s(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[d?(0,U.jsxs)(`div`,{className:s(`flex items-center justify-end gap-1`),children:[c?(0,U.jsx)(y1,{}):null,l?(0,U.jsx)(b1,{}):null,u?(0,U.jsx)(x1,{showCopy:c,showDownload:l,children:e}):null]}):null,(0,U.jsx)(`div`,{className:s(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),children:(0,U.jsx)(`table`,{className:s(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...o,children:e})})]})},C1=/startLine=(\d+)/,w1=/\bnoLineNumbers\b/,T1=(0,I.lazy)(()=>a(()=>import(`./mermaid-GHXKKRXX-C5k8G86C.js`).then(e=>({default:e.Mermaid})),[])),E1=/language-([^\s]+)/;function D1(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function O1(e,t){return e.className===t.className&&D1(e.node,t.node)}var k1=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,A1=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},j1=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},M1=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},N1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`ol`,{className:j$()(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e}),(e,t)=>O1(e,t));N1.displayName=`MarkdownOl`;var P1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`li`,{className:j$()(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e}),(e,t)=>e.className===t.className&&D1(e.node,t.node));P1.displayName=`MarkdownLi`;var F1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`ul`,{className:j$()(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e}),(e,t)=>O1(e,t));F1.displayName=`MarkdownUl`;var I1=(0,I.memo)(({className:e,node:t,...n})=>(0,U.jsx)(`hr`,{className:j$()(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n}),(e,t)=>O1(e,t));I1.displayName=`MarkdownHr`;var L1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`span`,{className:j$()(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e}),(e,t)=>O1(e,t));L1.displayName=`MarkdownStrong`;var R1=(0,I.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=j$(),{linkSafety:o}=(0,I.useContext)(A0),[s,c]=(0,I.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,I.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,I.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,I.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,U.jsx)(a1,{...p})]}):(0,U.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>O1(e,t)&&e.href===t.href);R1.displayName=`MarkdownA`;var z1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`h1`,{className:j$()(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e}),(e,t)=>O1(e,t));z1.displayName=`MarkdownH1`;var B1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`h2`,{className:j$()(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e}),(e,t)=>O1(e,t));B1.displayName=`MarkdownH2`;var V1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`h3`,{className:j$()(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e}),(e,t)=>O1(e,t));V1.displayName=`MarkdownH3`;var H1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`h4`,{className:j$()(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e}),(e,t)=>O1(e,t));H1.displayName=`MarkdownH4`;var U1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`h5`,{className:j$()(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e}),(e,t)=>O1(e,t));U1.displayName=`MarkdownH5`;var W1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`h6`,{className:j$()(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e}),(e,t)=>O1(e,t));W1.displayName=`MarkdownH6`;var G1=(0,I.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,I.useContext)(A0);return(0,U.jsx)(S1,{className:t,showControls:k1(i,`table`),showCopy:A1(i,`copy`),showDownload:A1(i,`download`),showFullscreen:A1(i,`fullscreen`),...r,children:e})},(e,t)=>O1(e,t));G1.displayName=`MarkdownTable`;var K1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`thead`,{className:j$()(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e}),(e,t)=>O1(e,t));K1.displayName=`MarkdownThead`;var q1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`tbody`,{className:j$()(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e}),(e,t)=>O1(e,t));q1.displayName=`MarkdownTbody`;var J1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`tr`,{className:j$()(`border-border`,t),"data-streamdown":`table-row`,...r,children:e}),(e,t)=>O1(e,t));J1.displayName=`MarkdownTr`;var Y1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`th`,{className:j$()(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e}),(e,t)=>O1(e,t));Y1.displayName=`MarkdownTh`;var X1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`td`,{className:j$()(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e}),(e,t)=>O1(e,t));X1.displayName=`MarkdownTd`;var Z1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`blockquote`,{className:j$()(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e}),(e,t)=>O1(e,t));Z1.displayName=`MarkdownBlockquote`;var Q1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`sup`,{className:j$()(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e}),(e,t)=>O1(e,t));Q1.displayName=`MarkdownSup`;var $1=(0,I.memo)(({children:e,className:t,node:n,...r})=>(0,U.jsx)(`sub`,{className:j$()(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e}),(e,t)=>O1(e,t));$1.displayName=`MarkdownSub`;var e0=(0,I.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,I.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,I.isValidElement)(e))if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,I.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,I.isValidElement)(e))return e;if(e.type===N1){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,U.jsx)(`section`,{className:t,...r,children:i}):null}return(0,U.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>O1(e,t));e0.displayName=`MarkdownSection`;var t0=(0,I.memo)(({node:e,className:t,children:n,...r})=>{let i=j$(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,I.useContext)(A0),l=l1(),u=T$(),d=(t?.match(E1))?.at(1)??``,f=u1(d);if(a)return(0,U.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(C1),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&w1.test(p))&&c!==!1,v=``;if((0,I.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?v=n.props.children:typeof n==`string`&&(v=n),f){let e=f.component;return(0,U.jsx)(I.Suspense,{fallback:(0,U.jsx)($$,{}),children:(0,U.jsx)(e,{code:v,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=k1(s,`mermaid`),n=M1(s,`download`),r=M1(s,`copy`),a=M1(s,`fullscreen`),c=M1(s,`panZoom`),l=e&&(n||r||a);return(0,U.jsx)(I.Suspense,{fallback:(0,U.jsx)($$,{}),children:(0,U.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,U.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,U.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,U.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,U.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,U.jsx)(f1,{chart:v,config:o?.config}):null,r?(0,U.jsx)(X$,{code:v}):null,a?(0,U.jsx)(p1,{chart:v,config:o?.config}):null]})}):null,(0,U.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,U.jsx)(T1,{chart:v,config:o?.config,showControls:c})})]})})}let y=k1(s,`code`),b=j1(s,`download`),x=j1(s,`copy`);return(0,U.jsx)(V$,{className:t,code:v,isIncomplete:u,language:d,lineNumbers:_,startLine:g,children:y?(0,U.jsxs)(U.Fragment,{children:[b?(0,U.jsx)(Q$,{code:v,language:d}):null,x?(0,U.jsx)(X$,{}):null]}):null})},(e,t)=>e.className===t.className&&D1(e.node,t.node));t0.displayName=`MarkdownCode`;var n0=(0,I.memo)(t1,(e,t)=>e.className===t.className&&D1(e.node,t.node));n0.displayName=`MarkdownImg`;var r0=(0,I.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,I.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,U.jsx)(U.Fragment,{children:e})}return(0,U.jsx)(`p`,{...n,children:e})},(e,t)=>O1(e,t));r0.displayName=`MarkdownParagraph`;var i0={ol:N1,li:P1,ul:F1,hr:I1,strong:L1,a:R1,h1:z1,h2:B1,h3:V1,h4:H1,h5:U1,h6:W1,table:G1,thead:K1,tbody:q1,tr:J1,th:Y1,td:X1,blockquote:Z1,code:t0,img:n0,pre:({children:e})=>(0,I.isValidElement)(e)?(0,I.cloneElement)(e,{"data-block":`true`}):e,sup:Q1,sub:$1,p:r0,section:e0},a0=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,o0=/\p{L}/u;function s0(e){let t=e.replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``);for(let e of t){if(a0.test(e))return`rtl`;if(o0.test(e))return`ltr`}return`ltr`}var c0=/^[ \t]{0,3}(`{3,}|~{3,})/,l0=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,u0=e=>{let t=e.split(`
|
|
500
500
|
`),n=null,r=0;for(let e of t){let t=c0.exec(e);if(n===null){if(t){let e=t[1];n=e[0],r=e.length}}else if(t){let e=t[1],i=e[0],a=e.length;i===n&&a>=r&&(n=null,r=0)}}return n!==null},d0=e=>{let t=e.split(`
|
|
501
501
|
`);for(let e of t){let t=e.trim();if(t.length>0&&t.includes(`|`)&&l0.test(t))return!0}return!1},f0=()=>e=>{WC(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},p0=[],m0={allowDangerousHtml:!0},h0=new WeakMap,g0=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=h0.get(e);n||(n=e.name,h0.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=h0.get(r);e||(e=r.name,h0.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},_0=e=>{let t=v0(e),n=e.children||``;return qce(t.runSync(t.parse(n),n),e)},v0=e=>{let t=g0.get(e);if(t)return t;let n=Hce(e);return g0.set(e,n),n},y0=e=>e.some(e=>Array.isArray(e)?e[0]===PV:e===PV),Hce=e=>{let t=e.rehypePlugins||p0,n=e.remarkPlugins||p0,r=y0(t)?n:[...n,f0],i=e.remarkRehypeOptions?{...m0,...e.remarkRehypeOptions}:m0;return CZ().use(iX).use(r).use(YX,i).use(t)},Uce=e=>e,Wce=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},Gce=(e,t)=>{for(let n in yY)if(Object.hasOwn(yY,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=yY[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},Kce=(e,t,n,r,i,a)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&a&&typeof t==`number`&&(o=!a(e,t,n)),o},qce=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:o,urlTransform:s}=t;if(n||r||i||a||s){let t=s||Uce;WC(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return Wce(c,s,a,e.value),s;if(e.type===`element`&&(Gce(e,t),Kce(e,s,c,r,i,n)&&c&&typeof s==`number`))return o&&e.children?c.children.splice(s,1,...e.children):c.children.splice(s,1),s})}return ZJ(e,{Fragment:U.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:U.jsx,jsxs:U.jsxs,passKeys:!0,passNode:!0})},Jce=/\[\^[\w-]{1,200}\](?!:)/,Yce=/\[\^[\w-]{1,200}\]:/,Xce=/<(\w+)[\s>]/,Zce=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),b0=new Map,x0=new Map,Qce=e=>{let t=e.toLowerCase(),n=b0.get(t);if(n)return n;let r=RegExp(`<${t}(?=[\\s>/])[^>]*>`,`gi`);return b0.set(t,r),r},$ce=e=>{let t=e.toLowerCase(),n=x0.get(t);if(n)return n;let r=RegExp(`</${t}(?=[\\s>])[^>]*>`,`gi`);return x0.set(t,r),r},S0=(e,t)=>{if(Zce.has(t.toLowerCase()))return 0;let n=e.match(Qce(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith(`/>`)||(r+=1);return r},C0=(e,t)=>{let n=e.match($ce(t));return n?n.length:0},ele=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]===`$`&&e[n+1]===`$`&&(t+=1,n+=1);return t},tle=e=>{let t=Jce.test(e),n=Yce.test(e);if(t||n)return[e];let r=n$.lex(e,{gfm:!0}),i=[],a=[],o=!1;for(let e of r){let t=e.raw,n=i.length;if(a.length>0){i[n-1]+=t;let e=a.at(-1),r=S0(t,e),o=C0(t,e);for(let t=0;t<r;t+=1)a.push(e);for(let t=0;t<o;t+=1)a.length>0&&a.at(-1)===e&&a.pop();continue}if(e.type===`html`&&e.block){let e=t.match(Xce);if(e){let n=e[1];S0(t,n)>C0(t,n)&&a.push(n)}}if(n>0&&!o){let e=i[n-1];if(ele(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},nle=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>{if(!n.includes(`
|
|
502
502
|
|
|
@@ -508,14 +508,14 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
508
508
|
`)?``:`
|
|
509
509
|
`)}${r}
|
|
510
510
|
|
|
511
|
-
`})}return n},rle=/([\\`*_~[\]|])/g,ile=e=>e.replace(rle,`\\$1`),ale=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>t+ile(n).replace(/\n\n/g,` `)+r)}return n},w0=e=>e.type===`text`?e.value:`children`in e&&Array.isArray(e.children)?e.children.map(w0).join(``):``,ole=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(e=>e.toLowerCase()));WC(t,`element`,e=>{if(n.has(e.tagName.toLowerCase())){let t=w0(e);e.children=t?[{type:`text`,value:t}]:[]}})},sle=()=>e=>{WC(e,`code`,e=>{e.meta&&(e.data=e.data??{},e.data.hProperties={...e.data.hProperties??{},metastring:e.meta})})},cle=/^[ \t]*<[\w!/?-]/,lle=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,ule=e=>typeof e!=`string`||e.length===0||!cle.test(e)?e:e.replace(lle,`$1`),T0={...IV,protocols:{...IV.protocols,href:[...IV.protocols?.href??[],`tel`]},attributes:{...IV.attributes,code:[...IV.attributes?.code??[],`metastring`]}},E0={raw:PV,sanitize:[$V,T0],harden:[Zse,{allowedImagePrefixes:[`*`],allowedLinkPrefixes:[`*`],allowedProtocols:[`*`],defaultOrigin:void 0,allowDataImages:!0}]},dle={gfm:[ZK,{}],codeMeta:sle},D0=Object.values(E0),fle=Object.values(dle),ple={block:` ▋`,circle:` ●`},O0=[`github-light`,`github-dark`],k0={enabled:!0},A0=(0,I.createContext)({shikiTheme:O0,controls:!0,isAnimating:!1,lineNumbers:!0,mode:`streaming`,mermaid:void 0,linkSafety:k0}),j0=(0,I.memo)(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:a,animatePlugin:o,...s})=>{if(o){let e=o.getLastRenderCharCount();o.setPrevContentLength(e)}let c=typeof e==`string`&&n?ule(e):e,l=(0,U.jsx)(_0,{...s,children:c});return(0,U.jsx)(w$.Provider,{value:i,children:a?(0,U.jsx)(`div`,{dir:a,style:{display:`contents`},children:l}):l})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(n=>e.components?.[n]!==t.components?.[n]))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});j0.displayName=`Block`;var M0=(0,I.memo)(({children:e,mode:t=`streaming`,dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:a,rehypePlugins:o=D0,remarkPlugins:s=fle,className:c,shikiTheme:l=O0,mermaid:u,controls:d=!0,isAnimating:f=!1,animated:p,BlockComponent:m=j0,parseMarkdownIntoBlocksFn:h=tle,caret:g,plugins:_,remend:v,linkSafety:y=k0,lineNumbers:b=!0,allowedTags:x,literalTagContent:S,translations:C,icons:w,prefix:T,onAnimationStart:E,onAnimationEnd:D,...O})=>{let k=(0,I.useId)(),[A,j]=(0,I.useTransition)(),M=(0,I.useMemo)(()=>O$(T),[T]),N=(0,I.useRef)(null),P=(0,I.useRef)(E),ee=(0,I.useRef)(D);P.current=E,ee.current=D,(0,I.useEffect)(()=>{var e,n,r;if(t===`static`)return;let i=N.current;if(N.current=f,i===null){f&&((e=P.current)==null||e.call(P));return}f&&!i?(n=P.current)==null||n.call(P):!f&&i&&((r=ee.current)==null||r.call(ee))},[f,t]);let F=(0,I.useMemo)(()=>x?Object.keys(x):[],[x]),te=(0,I.useMemo)(()=>{if(typeof e!=`string`)return``;let n=t===`streaming`&&r?AJ(e,v):e;return S&&S.length>0&&(n=ale(n,S)),F.length>0&&(n=nle(n,F)),n},[e,t,r,v,F,S]),ne=(0,I.useMemo)(()=>h(te),[te,h]),[re,ie]=(0,I.useState)(ne);(0,I.useEffect)(()=>{t===`streaming`&&!le?j(()=>{ie(ne)}):ie(ne)},[ne,t]);let ae=t===`streaming`?re:ne,oe=(0,I.useMemo)(()=>n===`auto`?ae.map(s0):void 0,[ae,n]),se=(0,I.useMemo)(()=>ae.map((e,t)=>`${k}-${t}`),[ae.length,k]),ce=(0,I.useMemo)(()=>p===!0?`true`:p?JSON.stringify(p):``,[p]),le=(0,I.useMemo)(()=>ce?ce===`true`?C$():C$(p):null,[ce]),ue=(0,I.useMemo)(()=>({shikiTheme:(_?.code)?.getThemes()??l,controls:d,isAnimating:f,lineNumbers:b,mode:t,mermaid:u,linkSafety:y}),[l,d,f,b,t,u,y,_?.code]),de=(0,I.useMemo)(()=>({...q$,...C}),[(0,I.useMemo)(()=>C?JSON.stringify(C):``,[C])]),fe=(0,I.useMemo)(()=>{let{inlineCode:e,...t}=a??{},n={...i0,...t};if(e){let t=n.code;n.code=n=>`data-block`in n?t?(0,I.createElement)(t,n):null:(0,I.createElement)(e,n)}return n},[a]),pe=(0,I.useMemo)(()=>{let e=[];return _!=null&&_.cjk&&(e=[...e,..._.cjk.remarkPluginsBefore]),e=[...e,...s],_!=null&&_.cjk&&(e=[...e,..._.cjk.remarkPluginsAfter]),_!=null&&_.math&&(e=[...e,_.math.remarkPlugin]),e},[s,_?.math,_?.cjk]),me=(0,I.useMemo)(()=>{let e=o;if(x&&Object.keys(x).length>0&&o===D0){let t={...T0,tagNames:[...T0.tagNames??[],...Object.keys(x)],attributes:{...T0.attributes,...x}};e=[E0.raw,[$V,t],E0.harden]}return S&&S.length>0&&(e=[...e,[ole,S]]),_!=null&&_.math&&(e=[...e,_.math.rehypePlugin]),le&&f&&(e=[...e,le.rehypePlugin]),e},[o,_?.math,le,f,x,S]),he=(0,I.useMemo)(()=>{if(!f||ae.length===0)return!1;let e=ae.at(-1);return u0(e)||d0(e)},[f,ae]),ge=(0,I.useMemo)(()=>g&&f&&!he?{"--streamdown-caret":`"${ple[g]}"`}:void 0,[g,f,he]);return t===`static`?(0,U.jsx)(J$.Provider,{value:de,children:(0,U.jsx)(o1.Provider,{value:_??null,children:(0,U.jsx)(A0.Provider,{value:ue,children:(0,U.jsx)(G$,{icons:w,children:(0,U.jsx)(A$.Provider,{value:M,children:(0,U.jsx)(`div`,{className:M(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,c),dir:n===`auto`?s0(te):n,children:(0,U.jsx)(_0,{components:fe,rehypePlugins:me,remarkPlugins:pe,...O,children:te})})})})})})}):(0,U.jsx)(J$.Provider,{value:de,children:(0,U.jsx)(o1.Provider,{value:_??null,children:(0,U.jsx)(A0.Provider,{value:ue,children:(0,U.jsx)(G$,{icons:w,children:(0,U.jsx)(A$.Provider,{value:M,children:(0,U.jsxs)(`div`,{className:M(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,g&&!he?`[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]`:null,c),style:ge,children:[ae.length===0&&g&&f&&(0,U.jsx)(`span`,{}),ae.map((e,t)=>{let a=t===ae.length-1,o=f&&a&&u0(e);return(0,U.jsx)(m,{animatePlugin:le,components:fe,content:e,dir:oe?.[t]??(n===`auto`?void 0:n),index:t,isIncomplete:o,rehypePlugins:me,remarkPlugins:pe,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...O},se[t])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);M0.displayName=`Streamdown`;var mle=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:o=1,fullscreen:s=!1})=>{let{RotateCcwIcon:c,ZoomInIcon:l,ZoomOutIcon:u}=K$(),d=j$(),f=(0,I.useRef)(null),p=(0,I.useRef)(null),[m,h]=(0,I.useState)(o),[g,_]=(0,I.useState)({x:0,y:0}),[v,y]=(0,I.useState)(!1),[b,x]=(0,I.useState)({x:0,y:0}),[S,C]=(0,I.useState)({x:0,y:0}),w=(0,I.useCallback)(e=>{h(t=>Math.max(n,Math.min(r,t+e)))},[n,r]),T=(0,I.useCallback)(()=>{w(i)},[w,i]),E=(0,I.useCallback)(()=>{w(-i)},[w,i]),D=(0,I.useCallback)(()=>{h(o),_({x:0,y:0})},[o]),O=(0,I.useCallback)(e=>{e.preventDefault(),w(e.deltaY>0?-i:i)},[w,i]),k=(0,I.useCallback)(e=>{if(e.button!==0||e.isPrimary===!1)return;y(!0),x({x:e.clientX,y:e.clientY}),C(g);let t=e.currentTarget;t instanceof HTMLElement&&t.setPointerCapture(e.pointerId)},[g]),A=(0,I.useCallback)(e=>{if(!v)return;e.preventDefault();let t=e.clientX-b.x,n=e.clientY-b.y;_({x:S.x+t,y:S.y+n})},[v,b,S]),j=(0,I.useCallback)(e=>{y(!1);let t=e.currentTarget;t instanceof HTMLElement&&t.releasePointerCapture(e.pointerId)},[]);return(0,I.useEffect)(()=>{let e=f.current;if(e)return e.addEventListener(`wheel`,O,{passive:!1}),()=>{e.removeEventListener(`wheel`,O)}},[O]),(0,I.useEffect)(()=>{let e=p.current;if(e&&v)return document.body.style.userSelect=`none`,e.addEventListener(`pointermove`,A,{passive:!1}),e.addEventListener(`pointerup`,j),e.addEventListener(`pointercancel`,j),()=>{document.body.style.userSelect=``,e.removeEventListener(`pointermove`,A),e.removeEventListener(`pointerup`,j),e.removeEventListener(`pointercancel`,j)}},[v,A,j]),(0,U.jsxs)(`div`,{className:d(`relative flex flex-col`,s?`h-full w-full`:`min-h-28 w-full`,t),ref:f,style:{cursor:v?`grabbing`:`grab`},children:[a?(0,U.jsxs)(`div`,{className:d(`absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm`,s?`bottom-4 left-4`:`bottom-2 left-2`),children:[(0,U.jsx)(`button`,{className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`),disabled:m>=r,onClick:T,title:`Zoom in`,type:`button`,children:(0,U.jsx)(l,{size:16})}),(0,U.jsx)(`button`,{className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`),disabled:m<=n,onClick:E,title:`Zoom out`,type:`button`,children:(0,U.jsx)(u,{size:16})}),(0,U.jsx)(`button`,{className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`),onClick:D,title:`Reset zoom and pan`,type:`button`,children:(0,U.jsx)(c,{size:16})})]}):null,(0,U.jsx)(`div`,{className:d(`flex-1 origin-center transition-transform duration-150 ease-out`,s?`flex h-full w-full items-center justify-center`:`flex w-full items-center justify-center`),onPointerDown:k,ref:p,role:`application`,style:{transform:`translate(${g.x}px, ${g.y}px) scale(${m})`,transformOrigin:`center center`,touchAction:`none`,willChange:`transform`},children:e})]})},N0=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let a=j$(),[o,s]=(0,I.useState)(null),[c,l]=(0,I.useState)(!1),[u,d]=(0,I.useState)(``),[f,p]=(0,I.useState)(``),[m,h]=(0,I.useState)(0),{mermaid:g}=(0,I.useContext)(A0),_=l1(),v=g?.errorComponent,{shouldRender:y,containerRef:b}=f$({immediate:r});if((0,I.useEffect)(()=>{if(y){if(!_){s(`Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.`);return}(async()=>{try{s(null),l(!0);let t=_.getMermaid(n),r=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),i=`mermaid-${Math.abs(r)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:a}=await t.render(i,e);d(a),p(a)}catch(e){f||u||s(e instanceof Error?e.message:`Failed to render Mermaid chart`)}finally{l(!1)}})()}},[e,n,m,y,_]),!(y||u||f))return(0,U.jsx)(`div`,{className:a(`my-4 min-h-[200px]`,t),ref:b});if(c&&!u&&!f)return(0,U.jsx)(`div`,{className:a(`my-4 flex justify-center p-4`,t),ref:b,children:(0,U.jsxs)(`div`,{className:a(`flex items-center space-x-2 text-muted-foreground`),children:[(0,U.jsx)(`div`,{className:a(`h-4 w-4 animate-spin rounded-full border-current border-b-2`)}),(0,U.jsx)(`span`,{className:a(`text-sm`),children:`Loading diagram...`})]})});if(o&&!u&&!f)return v?(0,U.jsx)(`div`,{ref:b,children:(0,U.jsx)(v,{chart:e,error:o,retry:()=>h(e=>e+1)})}):(0,U.jsxs)(`div`,{className:a(`rounded-md bg-red-50 p-4`,t),ref:b,children:[(0,U.jsxs)(`p`,{className:a(`font-mono text-red-700 text-sm`),children:[`Mermaid Error: `,o]}),(0,U.jsxs)(`details`,{className:a(`mt-2`),children:[(0,U.jsx)(`summary`,{className:a(`cursor-pointer text-red-600 text-xs`),children:`Show Code`}),(0,U.jsx)(`pre`,{className:a(`mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs`),children:e})]})]});let x=u||f;return(0,U.jsx)(`div`,{className:a(`size-full`,t),"data-streamdown":`mermaid`,ref:b,children:(0,U.jsx)(mle,{className:a(r?`size-full overflow-hidden`:`overflow-hidden`,t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:(0,U.jsx)(`div`,{"aria-label":`Mermaid chart`,className:a(`flex justify-center`,r?`size-full items-center`:null),dangerouslySetInnerHTML:{__html:x},role:`img`})})})},P0=({className:e,from:t,...n})=>(0,U.jsx)(`div`,{className:Pg(`group flex w-full max-w-[95%] flex-col gap-2`,t===`user`?`is-user ml-auto justify-end`:`is-assistant self-start`,e),...n}),F0=({children:e,className:t,...n})=>(0,U.jsx)(`div`,{className:Pg(`is-user:dark flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm`,`group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground`,`group-[.is-assistant]:text-left group-[.is-assistant]:text-foreground`,t),...n,children:e}),hle=({className:e,children:t,...n})=>(0,U.jsx)(`div`,{className:Pg(`flex items-center gap-1`,e),...n,children:t}),I0=({tooltip:e,children:t,label:n,variant:r=`ghost`,size:i=`icon-sm`,...a})=>{let o=(0,U.jsxs)(Rg,{size:i,type:`button`,variant:r,...a,children:[t,(0,U.jsx)(`span`,{className:`sr-only`,children:n||e})]});return e?(0,U.jsx)(yS,{children:(0,U.jsxs)(bS,{children:[(0,U.jsx)(xS,{render:o}),(0,U.jsx)(SS,{children:(0,U.jsx)(`p`,{children:e})})]})}):o},L0=(0,I.createContext)(null),R0=()=>{let e=(0,I.useContext)(L0);if(!e)throw Error(`MessageBranch components must be used within MessageBranch`);return e},gle=({defaultBranch:e=0,onBranchChange:t,className:n,...r})=>{let[i,a]=(0,I.useState)(e),[o,s]=(0,I.useState)([]),c=(0,I.useCallback)(e=>{a(e),t?.(e)},[t]),l=(0,I.useCallback)(()=>{c(i>0?i-1:o.length-1)},[i,o.length,c]),u=(0,I.useCallback)(()=>{c(i<o.length-1?i+1:0)},[i,o.length,c]),d=(0,I.useMemo)(()=>({branches:o,currentBranch:i,goToNext:u,goToPrevious:l,setBranches:s,totalBranches:o.length}),[o,i,u,l]);return(0,U.jsx)(L0.Provider,{value:d,children:(0,U.jsx)(`div`,{className:Pg(`grid w-full gap-2 [&>div]:pb-0`,n),...r})})},_le=({children:e,...t})=>{let{currentBranch:n,setBranches:r,branches:i}=R0(),a=(0,I.useMemo)(()=>Array.isArray(e)?e:[e],[e]);return(0,I.useEffect)(()=>{i.length!==a.length&&r(a)},[a,i,r]),a.map((e,r)=>(0,U.jsx)(`div`,{className:Pg(`grid gap-2 overflow-hidden [&>div]:pb-0`,r===n?`block`:`hidden`),...t,children:e},e.key))},vle=({className:e,...t})=>{let{totalBranches:n}=R0();return n<=1?null:(0,U.jsx)(tte,{className:Pg(`[&>*:not(:first-child)]:rounded-l-md [&>*:not(:last-child)]:rounded-r-md`,e),orientation:`horizontal`,...t})},yle=({children:e,...t})=>{let{goToPrevious:n,totalBranches:r}=R0();return(0,U.jsx)(Rg,{"aria-label":`Previous branch`,disabled:r<=1,onClick:n,size:`icon-sm`,type:`button`,variant:`ghost`,...t,children:e??(0,U.jsx)($g,{size:14})})},ble=({children:e,...t})=>{let{goToNext:n,totalBranches:r}=R0();return(0,U.jsx)(Rg,{"aria-label":`Next branch`,disabled:r<=1,onClick:n,size:`icon-sm`,type:`button`,variant:`ghost`,...t,children:e??(0,U.jsx)(e_,{size:14})})},xle=({className:e,...t})=>{let{currentBranch:n,totalBranches:r}=R0();return(0,U.jsxs)(nte,{className:Pg(`border-none bg-transparent text-muted-foreground shadow-none`,e),...t,children:[n+1,` of `,r]})},Sle={cjk:GC,code:ij,math:yM,mermaid:eL},z0=(0,I.memo)(({className:e,...t})=>(0,U.jsx)(M0,{className:Pg(`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,e),plugins:Sle,...t}),(e,t)=>e.children===t.children&&t.isAnimating===e.isAnimating);z0.displayName=`MessageResponse`;var Cle=({messageId:e,rating:t,onRate:n,disabled:r})=>{let[i,a]=(0,I.useState)(null),[o,s]=(0,I.useState)(``),c=t?.rating,l=(0,I.useCallback)(r=>{let i=c===r?0:r;i===0?(n(e,0),a(null),s(``)):(a(i),s(t?.comment??``))},[c,e,n,t?.comment]),u=(0,I.useCallback)(()=>{i!==null&&(n(e,i,o.trim()||void 0),a(null),s(``))},[o,e,n,i]),d=(0,I.useCallback)(()=>{i!==null&&(n(e,i),a(null),s(``))},[e,n,i]),f=i??c;return(0,U.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2`,children:[(0,U.jsxs)(hle,{children:[(0,U.jsx)(I0,{tooltip:`Thumbs up`,onClick:()=>l(1),variant:f===1?`default`:`ghost`,disabled:r,children:(0,U.jsx)(Hee,{className:`size-4`})}),(0,U.jsx)(I0,{tooltip:`Thumbs down`,onClick:()=>l(-1),variant:f===-1?`default`:`ghost`,disabled:r,children:(0,U.jsx)(Vee,{className:`size-4`})})]}),i!==null&&(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border bg-background p-3 text-sm shadow-sm`,children:[(0,U.jsx)(`textarea`,{autoFocus:!0,className:`w-full resize-none rounded border-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground`,placeholder:`Add a comment (optional)`,rows:2,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&u(),e.key===`Escape`&&d()}}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(`button`,{className:`text-xs text-muted-foreground hover:text-foreground transition-colors`,onClick:d,children:`Skip`}),(0,U.jsx)(`button`,{className:`rounded bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90 transition-colors`,onClick:u,children:`Submit`})]})]})]})},wle=globalThis?.document?I.useLayoutEffect:()=>{},Tle=I.useInsertionEffect||wle;function B0({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Ele({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=I.useRef(e!==void 0);I.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,I.useCallback(t=>{if(s){let n=Dle(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Ele({defaultProp:e,onChange:t}){let[n,r]=I.useState(e),i=I.useRef(n),a=I.useRef(t);return Tle(()=>{a.current=t},[t]),I.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Dle(e){return typeof e==`function`}var V0=I.createContext(void 0);function H0(e){let t=I.useContext(V0);if(e===!1&&t===void 0)throw Error(eh(27));return t}var Ole={...Hx,...Gb},kle=I.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:s}=H0(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return mh(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Ole,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),U0=I.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{store:c}=H0(),l=c.useState(`open`);function u(e){l&&c.setOpen(!1,Q_(q_,e.nativeEvent))}let{getButtonProps:d,buttonRef:f}=nh({disabled:i,native:a});return mh(`button`,e,{state:{disabled:i},ref:[t,f],props:[{onClick:u},s,d]})}),Ale=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),jle=function(e){return e[e.open=Nx.open]=`open`,e[e.closed=Nx.closed]=`closed`,e[e.startingStyle=Nx.startingStyle]=`startingStyle`,e[e.endingStyle=Nx.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),W0=I.createContext(void 0);function Mle(){let e=I.useContext(W0);if(e===void 0)throw Error(eh(26));return e}var G0=`ArrowUp`,K0=`ArrowDown`,q0=`ArrowLeft`,J0=`ArrowRight`,Y0=`Home`,Nle=new Set([q0,J0]),Ple=new Set([G0,K0]),Fle=new Set([...Nle,...Ple]);new Set([...Fle,Y0,`End`]);var X0=new Set([G0,K0,q0,J0,Y0,`End`]),Ile={...Hx,...Gb,nestedDialogOpen(e){return e?{[jle.nestedDialogOpen]:``}:null}},Lle=I.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,style:o,...s}=e,{store:c}=H0(),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`);Mle(),qb({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});function S(e){return e===`touch`?c.context.popupRef.current:!0}let C=i===void 0?S:i,w=mh(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:g>0},props:[f,{"aria-labelledby":y??void 0,"aria-describedby":l??void 0,role:x,tabIndex:-1,hidden:!m,onKeyDown(e){X0.has(e.key)&&e.stopPropagation()},style:{[Ale.nestedDialogs]:g}},s],ref:[t,c.context.popupRef,c.useStateSetter(`popupElement`)],stateAttributesMapping:Ile});return(0,U.jsx)(cb,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:r,modal:p!==!1,restoreFocus:`popup`,children:w})}),Z0=I.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,U.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Rle=I.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=H0(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,U.jsx)(W0.Provider,{value:n,children:(0,U.jsxs)(Xy,{ref:t,...r,children:[a&&o===!0&&(0,U.jsx)(Z0,{ref:i.context.internalBackdropRef,inert:vS(!s)}),e.children]})}):null}),Q0={},$0={},e2=``;function zle(e){if(typeof document>`u`)return!1;let t=uv(e);return lm(t).innerWidth-t.documentElement.clientWidth>0}function Ble(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=uv(e),n=t.documentElement,r=t.body,i=hm(n)?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 Vle(e){let t=uv(e),n=t.documentElement,r=t.body,i=hm(n)?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 Hle(e){let t=uv(e),n=t.documentElement,r=t.body,i=lm(n),a=0,o=0,s=!1,c=cv.create();if(M_&&(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,Q0={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},e2=n.style.scrollBehavior,$0={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=hm(n)?n:r;if(s=Ble(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`,overflow:`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,Q0),Object.assign(r.style,$0),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=e2)}function d(){u(),c.request(l)}l();let f=nv(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Ule=new class{lockCount=0;restore=null;timeoutLock=E_.create();timeoutUnlock=E_.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=uv(e).documentElement,n=lm(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=lh;return}let r=N_||!zle(e);this.restore=r?Vle(e):Hle(e)}};function t2(e=!0,t=null){Lm(()=>{if(e)return Ule.acquire(t)},[e,t])}function Wle(e){let t=I.useRef(``),n=I.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:I.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 n2(e,t){let n=I.useRef(e),r=Nm(t);Lm(()=>{n.current!==e&&r(n.current)},[e,r]),Lm(()=>{n.current=e},[e])}function r2(e){let[t,n]=I.useState(null),r=Nm((t,r)=>{e||n(r||(N_?`touch`:``))});n2(e,t=>{t&&!e&&n(null)});let{onClick:i,onPointerDown:a}=Wle(r);return I.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:a}}),[t,i,a])}function Gle(e){let{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,a=t.useState(`open`),o=t.useState(`disablePointerDismissal`),s=t.useState(`modal`),c=t.useState(`popupElement`),{openMethod:l,triggerProps:u}=r2(a);Xb(t);let{forceUnmount:d}=Zb(a,t),f=I.useCallback(()=>{t.setOpen(!1,Q_(Z_))},[t]);I.useImperativeHandle(r,()=>({unmount:d,close:f}),[d,f]);let p=ax({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[m,h]=I.useState(0),[g,_]=I.useState(0),v=m===0,y=bx(p),b=db(p,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=yv(e);if(v&&!o){let e=n;return s&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||vv(e,c)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:v});t2(a&&s===!0,c);let{getReferenceProps:x,getFloatingProps:S,getTriggerProps:C}=gx([y,b]);t.useContextCallback(`onNestedDialogOpen`,(e,t)=>{h(e),_(t)}),t.useContextCallback(`onNestedDialogClose`,()=>{h(0),_(0)}),I.useEffect(()=>(n?.onNestedDialogOpen&&a&&n.onNestedDialogOpen(m+1,g+ +!!i),n?.onNestedDialogClose&&!a&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&a&&n.onNestedDialogClose()}),[i,a,m,g,n]);let w=I.useMemo(()=>x(u),[x,u]),T=I.useMemo(()=>C(u),[C,u]),E=I.useMemo(()=>S(),[S]);t.useSyncedValues({openMethod:l,activeTriggerProps:w,inactiveTriggerProps:T,popupProps:E,floatingRootContext:p,nestedOpenDialogCount:m,nestedOpenDrawerCount:g})}var Kle={...nx,modal:W(e=>e.modal),nested:W(e=>e.nested),nestedOpenDialogCount:W(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:W(e=>e.nestedOpenDrawerCount),disablePointerDismissal:W(e=>e.disablePointerDismissal),openMethod:W(e=>e.openMethod),descriptionElementId:W(e=>e.descriptionElementId),titleElementId:W(e=>e.titleElementId),viewportElement:W(e=>e.viewportElement),role:W(e=>e.role)},qle=class e extends Rb{constructor(e){super(Jle(e),{popupRef:I.createRef(),backdropRef:I.createRef(),internalBackdropRef:I.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Qb,onOpenChange:void 0,onOpenChangeComplete:void 0},Kle)}setOpen=(e,t)=>{if(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)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};static useStore(t,n){let r=Am(()=>new e(n)).current;return t??r}};function Jle(e={}){return{...ex(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}var i2=I.createContext(!1);function Yle(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=H0(!0),p=I.useContext(i2),m=!!f,h=qle.useStore(l?.store,{open:r,openProp:n,activeTriggerId:d,triggerIdProp:u,modal:s,disablePointerDismissal:o,nested:m});x_(()=>{n===void 0&&h.state.open===!1&&r===!0&&h.update({open:!0,activeTriggerId:d})}),h.useControlledProp(`openProp`,n),h.useControlledProp(`triggerIdProp`,u),h.useSyncedValues({disablePointerDismissal:o,nested:m,modal:s}),h.useContextCallback(`onOpenChange`,i),h.useContextCallback(`onOpenChangeComplete`,a);let g=h.useState(`payload`);Gle({store:h,actionsRef:c,parentContext:f?.store.context,isDrawer:p,onOpenChange:i,triggerIdProp:u});let _=I.useMemo(()=>({store:h}),[h]);return(0,U.jsx)(i2.Provider,{value:!1,children:(0,U.jsx)(V0.Provider,{value:_,children:typeof t==`function`?t({payload:g}):t})})}var Xle=I.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=H0(),c=Ux(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),mh(`h2`,e,{ref:t,props:[{id:c},o]})}),Zle=I.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,payload:s,handle:c,style:l,...u}=e,d=H0(!0),f=c?.store??d?.store;if(!f)throw Error(eh(79));let p=Ux(o),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=I.useRef(null),{registerTrigger:_,isMountedByThisTrigger:v}=Yb(p,g,f,{payload:s}),{getButtonProps:y,buttonRef:b}=nh({disabled:i,native:a}),x=gx([lb(m,{enabled:m!=null})]),S={disabled:i,open:h},C=f.useState(`triggerProps`,v);return mh(`button`,e,{state:S,ref:[b,t,_,g],props:[x.getReferenceProps(),C,{[Wy]:``,id:p},u,y],stateAttributesMapping:Bx})});function a2({...e}){return(0,U.jsx)(Yle,{"data-slot":`dialog`,...e})}function o2({...e}){return(0,U.jsx)(Zle,{"data-slot":`dialog-trigger`,...e})}function Qle({...e}){return(0,U.jsx)(Rle,{"data-slot":`dialog-portal`,...e})}function $le({className:e,...t}){return(0,U.jsx)(kle,{"data-slot":`dialog-overlay`,className:Pg(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function s2({className:e,children:t,showCloseButton:n=!0,...r}){return(0,U.jsxs)(Qle,{children:[(0,U.jsx)($le,{}),(0,U.jsxs)(Lle,{"data-slot":`dialog-content`,className:Pg(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,U.jsxs)(U0,{"data-slot":`dialog-close`,render:(0,U.jsx)(Rg,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,U.jsx)(l_,{}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function c2({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`dialog-header`,className:Pg(`flex flex-col gap-2`,e),...t})}function l2({className:e,showCloseButton:t=!1,children:n,...r}){return(0,U.jsxs)(`div`,{"data-slot":`dialog-footer`,className:Pg(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,U.jsx)(U0,{render:(0,U.jsx)(Rg,{variant:`outline`}),children:`Close`})]})}function u2({className:e,...t}){return(0,U.jsx)(Xle,{"data-slot":`dialog-title`,className:Pg(`text-base leading-none font-medium`,e),...t})}var d2=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),eue={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},f2={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},tue={disabled:!1,...f2},p2={valid(e){return e===null?null:e?{[d2.valid]:``}:{[d2.invalid]:``}}},nue=I.createContext({invalid:void 0,name:void 0,validityData:{state:eue,errors:[],error:``,value:``,initialValue:null},setValidityData:lh,disabled:void 0,touched:f2.touched,setTouched:lh,dirty:f2.dirty,setDirty:lh,filled:f2.filled,setFilled:lh,focused:f2.focused,setFocused:lh,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:tue,markedDirtyRef:{current:!1},registerFieldControl:lh,validation:{getValidationProps:(e=uh)=>e,getInputValidationProps:(e=uh)=>e,inputRef:{current:null},commit:async()=>{}}});function m2(e=!0){let t=I.useContext(nue);if(t.setValidityData===lh&&!e)throw Error(eh(28));return t}var rue=I.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:lh,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function iue(){return I.useContext(rue)}var aue=I.createContext({controlId:void 0,registerControlId:lh,labelId:void 0,setLabelId:lh,messageIds:[],setMessageIds:lh,getDescriptionProps:e=>e});function h2(){return I.useContext(aue)}function oue(e,t,n,r=!0,i){let[a,o]=I.useState(),s=Ux(i?`${i}-label`:void 0),c=e??t??a;return Lm(()=>{let i=e||t||!r?void 0:sue(n.current,s);a!==i&&o(i)}),c}function sue(e,t){let n=cue(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function cue(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function g2(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=h2(),o=Ux(t),s=n?i:void 0,c=Am(()=>Symbol(`labelable-control`)),l=I.useRef(!1),u=I.useRef(t!=null),d=Nm(()=>{!l.current||a===lh||(l.current=!1,a(c.current,void 0))});return Lm(()=>{if(a===lh)return;let e;if(n){let n=r?.current;e=fm(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),I.useEffect(()=>d,[d]),i??o}function _2({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=I.useRef(e!==void 0),[a,o]=I.useState(t);return[i?e:a,I.useCallback(e=>{i||o(e)},[])]}function v2(e,t){let{enabled:n=!0,getValue:r,id:i,value:a}=t,{registerFieldControl:o}=m2(),s=I.useRef(null);s.current||=Symbol(),Lm(()=>{let t=s.current;if(!(!t||!n))return o(t,{controlRef:e,getValue:r,id:i,value:a}),()=>{o(t,void 0)}},[e,n,r,i,o,a])}var lue=I.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFocused:y,setFilled:b,validationMode:x,validation:S}=m2(),C=h||s,w=m??a,T={...p,disabled:C},{labelId:E}=h2(),D=g2({id:i});Lm(()=>{let e=o!=null;S.inputRef.current?.value||e&&o!==``?b(!0):e&&o===``&&b(!1)},[S.inputRef,b,o]);let O=I.useRef(null);Lm(()=>{u&&O.current===_v(uv(O.current))&&y(!0)},[u,y]);let[k]=_2({controlled:o,default:l,name:`FieldControl`,state:`value`}),A=o!==void 0,j=A?k:void 0,M=Nm(()=>S.inputRef.current?.value);return v2(S.inputRef,{id:D,value:j,getValue:M}),mh(`input`,e,{ref:[t,O],state:T,props:[{id:D,disabled:C,name:w,ref:S.inputRef,"aria-labelledby":E,autoFocus:u,...A?{value:j}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,Q_(H_,e.nativeEvent)),_(t!==v.initialValue),b(t!==``)},onFocus(){y(!0)},onBlur(e){g(!0),y(!1),x===`onBlur`&&S.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(g(!0),S.commit(e.currentTarget.value))}},S.getInputValidationProps(),f],stateAttributesMapping:p2})}),uue=I.forwardRef(function(e,t){return(0,U.jsx)(lue,{ref:t,...e})});function y2({className:e,type:t,...n}){return(0,U.jsx)(uue,{type:t,"data-slot":`input`,className:Pg(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function b2({className:e,...t}){return(0,U.jsx)(`textarea`,{"data-slot":`textarea`,className:Pg(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function due({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:Pg(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var fue=Th(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function pue({className:e,align:t=`inline-start`,...n}){return(0,U.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:Pg(fue({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var mue=Th(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function hue({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,U.jsx)(Rg,{type:t,"data-size":r,variant:n,className:Pg(mue({size:r}),e),...i})}function gue({className:e,...t}){return(0,U.jsx)(b2,{"data-slot":`input-group-control`,className:Pg(`flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,e),...t})}var _ue=I.createContext(void 0);function vue(e){let t=I.useContext(_ue);if(t===void 0&&!e)throw Error(eh(69));return t}var yue=20;function bue(e,t,n,r){let[i,a]=I.useState(!1);Lm(()=>{if(!e||!t||n==null){a(!1);return}let r=uv(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-yue)},[e,t,n]),t2(e&&(!t||i),r)}function xue(e,t){let n=I.useRef(null);return{preFocusGuardRef:n,handlePreFocusGuardFocus:Nm(t=>{Ky.flushSync(()=>{e.setOpen(!1,Q_(J_,t.nativeEvent,t.currentTarget))}),vte(n.current)?.focus()}),handleFocusTargetFocus:Nm(n=>{let r=e.select(`positionerElement`);if(r&&wy(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{Ky.flushSync(()=>{e.setOpen(!1,Q_(J_,n.nativeEvent,n.currentTarget))});let i=_te(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&vv(r,i);){let e=i;if(i=xy(i),i===e)break}i?.focus()}})}}function x2(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function S2(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Sue(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function Cue(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Sue(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 wue(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?S2(e.value):S2(e)}W(e=>e.id),W(e=>e.labelId),W(e=>e.modal),W(e=>e.multiple),W(e=>e.items),W(e=>e.itemToStringLabel),W(e=>e.itemToStringValue),W(e=>e.isItemEqualToValue),W(e=>e.value),W(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:wue(t,r)!==``}),W((e,t)=>t?Cue(e.items):!1),W(e=>e.open),W(e=>e.mounted),W(e=>e.forceMount),W(e=>e.transitionStatus),W(e=>e.openMethod),W(e=>e.activeIndex),W(e=>e.selectedIndex),W((e,t)=>e.activeIndex===t),W((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>x2(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:x2(n,i,r)}),W((e,t)=>e.selectedIndex===t),W(e=>e.popupProps),W(e=>e.triggerProps),W(e=>e.triggerElement),W(e=>e.positionerElement),W(e=>e.listElement),W(e=>e.scrollUpArrowVisible),W(e=>e.scrollDownArrowVisible),W(e=>e.hasScrollArrows);function C2({className:e,...t}){return(0,U.jsx)(Iee,{role:`status`,"aria-label":`Loading`,className:Pg(`size-4 animate-spin`,e),...t})}var Tue=async e=>{try{let t=await(await fetch(e)).blob();return new Promise(e=>{let n=new FileReader;n.onloadend=()=>e(n.result),n.onerror=()=>e(null),n.readAsDataURL(t)})}catch{return null}},Eue=(0,I.createContext)(null),Due=(0,I.createContext)(null),w2=()=>(0,I.useContext)(Eue),Oue=()=>(0,I.useContext)(Due),T2=(0,I.createContext)(null),kue=()=>{let e=Oue(),t=(0,I.useContext)(T2)??e;if(!t)throw Error(`usePromptInputAttachments must be used within a PromptInput or PromptInputProvider`);return t},Aue=(0,I.createContext)(null),jue=({className:e,accept:t,multiple:n,globalDrop:r,syncHiddenInput:i,maxFiles:a,maxFileSize:o,onError:s,onSubmit:c,children:l,...u})=>{let d=w2(),f=!!d,p=(0,I.useRef)(null),m=(0,I.useRef)(null),[h,g]=(0,I.useState)([]),_=f?d.attachments.files:h,[v,y]=(0,I.useState)([]),b=(0,I.useRef)(_);(0,I.useEffect)(()=>{b.current=_},[_]);let x=(0,I.useCallback)(()=>{p.current?.click()},[]),S=(0,I.useCallback)(e=>!t||t.trim()===``?!0:t.split(`,`).map(e=>e.trim()).filter(Boolean).some(t=>{if(t.endsWith(`/*`)){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t}),[t]),C=(0,I.useCallback)(e=>{let t=[...e],n=t.filter(e=>S(e));if(t.length&&n.length===0){s?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>o?e.size<=o:!0);if(n.length>0&&r.length===0){s?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}g(e=>{let t=typeof a==`number`?Math.max(0,a-e.length):void 0,n=typeof t==`number`?r.slice(0,t):r;typeof t==`number`&&r.length>t&&s?.({code:`max_files`,message:`Too many files. Some were not added.`});let i=[];for(let e of n)i.push({filename:e.name,id:hp(),mediaType:e.type,type:`file`,url:URL.createObjectURL(e)});return[...e,...i]})},[S,a,o,s]),w=(0,I.useCallback)(e=>g(t=>{let n=t.find(t=>t.id===e);return n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)}),[]),T=(0,I.useCallback)(e=>{let t=[...e],n=t.filter(e=>S(e));if(t.length&&n.length===0){s?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>o?e.size<=o:!0);if(n.length>0&&r.length===0){s?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}let i=_.length,c=typeof a==`number`?Math.max(0,a-i):void 0,l=typeof c==`number`?r.slice(0,c):r;typeof c==`number`&&r.length>c&&s?.({code:`max_files`,message:`Too many files. Some were not added.`}),l.length>0&&d?.attachments.add(l)},[S,o,a,s,_.length,d]),E=(0,I.useCallback)(()=>f?d?.attachments.clear():g(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]}),[f,d]),D=(0,I.useCallback)(()=>y([]),[]),O=f?T:C,k=f?d.attachments.remove:w,A=f?d.attachments.openFileDialog:x,j=(0,I.useCallback)(()=>{E(),D()},[E,D]);(0,I.useEffect)(()=>{f&&d.__registerFileInput(p,()=>p.current?.click())},[f,d]),(0,I.useEffect)(()=>{i&&p.current&&_.length===0&&(p.current.value=``)},[_,i]),(0,I.useEffect)(()=>{let e=m.current;if(!e||r)return;let t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},n=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&O(e.dataTransfer.files)};return e.addEventListener(`dragover`,t),e.addEventListener(`drop`,n),()=>{e.removeEventListener(`dragover`,t),e.removeEventListener(`drop`,n)}},[O,r]),(0,I.useEffect)(()=>{if(!r)return;let e=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&O(e.dataTransfer.files)};return document.addEventListener(`dragover`,e),document.addEventListener(`drop`,t),()=>{document.removeEventListener(`dragover`,e),document.removeEventListener(`drop`,t)}},[O,r]),(0,I.useEffect)(()=>()=>{if(!f)for(let e of b.current)e.url&&URL.revokeObjectURL(e.url)},[f]);let M=(0,I.useCallback)(e=>{e.currentTarget.files&&O(e.currentTarget.files),e.currentTarget.value=``},[O]),N=(0,I.useMemo)(()=>({add:O,clear:E,fileInputRef:p,files:_.map(e=>({...e,id:e.id})),openFileDialog:A,remove:k}),[_,O,k,E,A]),P=(0,I.useMemo)(()=>({add:e=>{let t=Array.isArray(e)?e:[e];y(e=>[...e,...t.map(e=>({...e,id:hp()}))])},clear:D,remove:e=>{y(t=>t.filter(t=>t.id!==e))},sources:v}),[v,D]),ee=(0,I.useCallback)(async e=>{e.preventDefault();let t=e.currentTarget,n=f?d.textInput.value:new FormData(t).get(`message`)||``;f||t.reset();try{let t=c({files:await Promise.all(_.map(async({id:e,...t})=>{if(t.url?.startsWith(`blob:`)){let e=await Tue(t.url);return{...t,url:e??t.url}}return t})),text:n},e);if(t instanceof Promise)try{await t,j(),f&&d.textInput.clear()}catch{}else j(),f&&d.textInput.clear()}catch{}},[f,d,_,c,j]),F=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`input`,{accept:t,"aria-label":`Upload files`,className:`hidden`,multiple:n,onChange:M,ref:p,title:`Upload files`,type:`file`}),(0,U.jsx)(`form`,{className:Pg(`w-full`,e),onSubmit:ee,ref:m,...u,children:(0,U.jsx)(due,{className:`overflow-hidden`,children:l})})]}),te=(0,U.jsx)(Aue.Provider,{value:P,children:F});return(0,U.jsx)(T2.Provider,{value:N,children:te})},Mue=({className:e,...t})=>(0,U.jsx)(`div`,{className:Pg(`contents`,e),...t}),Nue=({onChange:e,onKeyDown:t,className:n,placeholder:r=`What would you like to know?`,...i})=>{let a=w2(),o=kue(),[s,c]=(0,I.useState)(!1),l=(0,I.useCallback)(e=>{if(t?.(e),!e.defaultPrevented){if(e.key===`Enter`){if(s||e.nativeEvent.isComposing||e.shiftKey)return;e.preventDefault();let{form:t}=e.currentTarget;if(t?.querySelector(`button[type="submit"]`)?.disabled)return;t?.requestSubmit()}if(e.key===`Backspace`&&e.currentTarget.value===``&&o.files.length>0){e.preventDefault();let t=o.files.at(-1);t&&o.remove(t.id)}}},[t,s,o]),u=(0,I.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of t)if(e.kind===`file`){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),o.add(n))},[o]),d=(0,I.useCallback)(()=>c(!1),[]),f=(0,I.useCallback)(()=>c(!0),[]),p=a?{onChange:t=>{a.textInput.setInput(t.currentTarget.value),e?.(t)},value:a.textInput.value}:{onChange:e};return(0,U.jsx)(gue,{className:Pg(`field-sizing-content max-h-48 min-h-16`,n),name:`message`,onCompositionEnd:d,onCompositionStart:f,onKeyDown:l,onPaste:u,placeholder:r,...i,...p})},Pue=({className:e,...t})=>(0,U.jsx)(pue,{align:`block-end`,className:Pg(`justify-between gap-1`,e),...t}),Fue=({className:e,...t})=>(0,U.jsx)(`div`,{className:Pg(`flex min-w-0 items-center gap-1`,e),...t}),Iue=({className:e,variant:t=`default`,size:n=`icon-sm`,status:r,onStop:i,onClick:a,children:o,...s})=>{let c=r===`submitted`||r===`streaming`,l=(0,U.jsx)(a_,{className:`size-4`});r===`submitted`?l=(0,U.jsx)(C2,{}):r===`streaming`?l=(0,U.jsx)(c_,{className:`size-4`}):r===`error`&&(l=(0,U.jsx)(l_,{className:`size-4`}));let u=(0,I.useCallback)(e=>{if(c&&i){e.preventDefault(),i();return}a?.(e)},[c,i,a]);return(0,U.jsx)(hue,{"aria-label":c?`Stop`:`Submit`,className:Pg(e),onClick:u,size:n,type:c&&i?`button`:`submit`,variant:t,...s,children:o??l})};function Lue(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,a=t!==void 0,[o,s]=_2({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:c,setMounted:l,transitionStatus:u}=Vb(o,!0,!0),[d,f]=I.useState(o),[{height:p,width:m},h]=I.useState({height:void 0,width:void 0}),g=Ux(),[_,v]=I.useState(),y=_??g,[b,x]=I.useState(!1),[S,C]=I.useState(!1),w=I.useRef(null),T=I.useRef(null),E=I.useRef(null),D=I.useRef(null),O=Kb(D,!1),k=Nm(e=>{let t=!o,n=Q_(U_,e.nativeEvent);if(r(t,n),n.isCanceled)return;let i=D.current;T.current===`css-animation`&&i!=null&&i.style.removeProperty(`animation-name`),!b&&!S&&(T.current!=null&&T.current!==`css-animation`&&!c&&t&&l(!0),T.current===`css-animation`&&(!d&&t&&f(!0),!c&&t&&l(!0))),s(t),T.current===`none`&&c&&!t&&l(!1)});return Lm(()=>{a&&T.current===`none`&&!o&&l(!1)},[a,o,t,l]),I.useMemo(()=>({abortControllerRef:w,animationTypeRef:T,disabled:i,handleTrigger:k,height:p,mounted:c,open:o,panelId:y,panelRef:D,runOnceAnimationsFinish:O,setDimensions:h,setHiddenUntilFound:x,setKeepMounted:C,setMounted:l,setOpen:s,setPanelIdState:v,setVisible:f,transitionDimensionRef:E,transitionStatus:u,visible:d,width:m}),[w,T,i,k,p,c,o,y,D,O,h,x,C,l,s,f,E,u,d,m])}var E2=I.createContext(void 0);function D2(){let e=I.useContext(E2);if(e===void 0)throw Error(eh(15));return e}var O2=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Hb.startingStyle]=`startingStyle`,e[e.endingStyle=Hb.endingStyle]=`endingStyle`,e}({}),Rue=function(e){return e.panelOpen=`data-panel-open`,e}({}),zue={[O2.open]:``},Bue={[O2.closed]:``},Vue={open(e){return e?{[Rue.panelOpen]:``}:null}},k2={open(e){return e?zue:Bue},...Gb},Hue=I.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=Nm(o),d=Lue({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=I.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=I.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=mh(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:k2});return(0,U.jsx)(E2.Provider,{value:p,children:m})}),Uue={...Vue,...Gb},Wue=I.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=D2(),{className:s,disabled:c=o,id:l,render:u,nativeButton:d=!0,style:f,...p}=e,{getButtonProps:m,buttonRef:h}=nh({disabled:c,focusableWhenDisabled:!0,native:d}),g=I.useMemo(()=>({"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i}),[n,r,i]);return mh(`button`,e,{state:a,ref:[t,h],props:[g,p,m],stateAttributesMapping:Uue})}),Gue=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e}({});function Kue(e){let{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:i,hiddenUntilFound:a,keepMounted:o,id:s,mounted:c,onOpenChange:l,open:u,panelRef:d,runOnceAnimationsFinish:f,setDimensions:p,setMounted:m,setOpen:h,setVisible:g,transitionDimensionRef:_,visible:v,width:y}=e,b=I.useRef(!1),x=I.useRef(null),S=I.useRef(u),C=I.useRef(u),w=lv(),T=I.useMemo(()=>n.current===`css-animation`?!v:!u&&!c,[u,c,v,n]),E=ih(r,d,Nm(e=>{if(!e)return;if(n.current==null||_.current==null){let t=getComputedStyle(e),r=t.animationName!==`none`&&t.animationName!==``,i=t.transitionDuration!==`0s`&&t.transitionDuration!==``;r&&i||(t.animationName===`none`&&t.transitionDuration!==`0s`?n.current=`css-transition`:t.animationName!==`none`&&t.transitionDuration===`0s`?n.current=`css-animation`:n.current=`none`),e.getAttribute(Gue.orientation)===`horizontal`||t.transitionProperty.indexOf(`width`)>-1?_.current=`width`:_.current=`height`}if(n.current!==`css-transition`)return;(i===void 0||y===void 0)&&(p({height:e.scrollHeight,width:e.scrollWidth}),C.current&&e.style.setProperty(`transition-duration`,`0s`));let t=-1,r=-1;return t=cv.request(()=>{C.current=!1,r=cv.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})}),()=>{cv.cancel(t),cv.cancel(r)}}));return Lm(()=>{if(n.current!==`css-transition`)return;let e=d.current;if(!e)return;let r=-1;if(t.current!=null&&(t.current.abort(),t.current=null),u){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)}),!C.current&&!o&&e.setAttribute(O2.startingStyle,``),p({height:e.scrollHeight,width:e.scrollWidth}),r=cv.request(()=>{Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})})}else{if(e.scrollHeight===0&&e.scrollWidth===0)return;p({height:e.scrollHeight,width:e.scrollWidth});let n=new AbortController;t.current=n;let r=n.signal,i=null,a=O2.endingStyle;return i=new MutationObserver(o=>{o.some(e=>e.type===`attributes`&&e.attributeName===a)&&(i?.disconnect(),i=null,f(()=>{p({height:0,width:0}),e.style.removeProperty(`content-visibility`),m(!1),t.current===n&&(t.current=null)},r))}),i.observe(e,{attributes:!0,attributeFilter:[a]}),()=>{i?.disconnect(),w.cancel(),t.current===n&&(n.abort(),t.current=null)}}return()=>{cv.cancel(r)}},[t,n,w,a,o,c,u,d,f,p,m]),Lm(()=>{if(n.current!==`css-animation`)return;let e=d.current;e&&(x.current=e.style.animationName||x.current,e.style.setProperty(`animation-name`,`none`),p({height:e.scrollHeight,width:e.scrollWidth}),!S.current&&!b.current&&e.style.removeProperty(`animation-name`),u?(t.current!=null&&(t.current.abort(),t.current=null),m(!0),g(!0)):(t.current=new AbortController,f(()=>{m(!1),g(!1),t.current=null},t.current.signal)))},[t,n,u,d,f,p,m,g,v]),w_(()=>{let e=cv.request(()=>{S.current=!1});return()=>cv.cancel(e)}),Lm(()=>{if(!a)return;let e=d.current;if(!e)return;let t=-1,n=-1;return u&&b.current&&(e.style.transitionDuration=`0s`,p({height:e.scrollHeight,width:e.scrollWidth}),t=cv.request(()=>{b.current=!1,n=cv.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})})),()=>{cv.cancel(t),cv.cancel(n)}},[a,u,d,p]),Lm(()=>{let e=d.current;e&&a&&T&&(e.setAttribute(`hidden`,`until-found`),n.current===`css-transition`&&e.setAttribute(O2.startingStyle,``))},[a,T,n,d]),I.useEffect(function(){let e=d.current;if(!e)return;function t(e){b.current=!0,h(!0),l(!0,Q_(H_,e))}return nv(e,`beforematch`,t)},[l,d,h]),I.useMemo(()=>({props:{hidden:T,id:s,ref:E}}),[T,s,E])}var A2=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),que=I.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{abortControllerRef:l,animationTypeRef:u,height:d,mounted:f,onOpenChange:p,open:m,panelId:h,panelRef:g,runOnceAnimationsFinish:_,setDimensions:v,setHiddenUntilFound:y,setKeepMounted:b,setMounted:x,setPanelIdState:S,setOpen:C,setVisible:w,state:T,transitionDimensionRef:E,visible:D,width:O,transitionStatus:k}=D2(),A=r??!1,j=i??!1;Lm(()=>{if(o)return S(o),()=>{S(void 0)}},[o,S]),Lm(()=>{y(A)},[y,A]),Lm(()=>{b(j)},[b,j]);let{props:M}=Kue({abortControllerRef:l,animationTypeRef:u,externalRef:t,height:d,hiddenUntilFound:A,id:h,keepMounted:j,mounted:f,onOpenChange:p,open:m,panelRef:g,runOnceAnimationsFinish:_,setDimensions:v,setMounted:x,setOpen:C,setVisible:w,transitionDimensionRef:E,visible:D,width:O});qb({open:m&&k===`idle`,ref:g,onComplete(){m&&v({height:void 0,width:void 0})}});let N=mh(`div`,e,{state:I.useMemo(()=>({...T,transitionStatus:k}),[T,k]),ref:[t,g],props:[M,{style:{[A2.collapsiblePanelHeight]:d===void 0?`auto`:`${d}px`,[A2.collapsiblePanelWidth]:O===void 0?`auto`:`${O}px`}},c],stateAttributesMapping:k2});return j||A||f?N:null});function j2({...e}){return(0,U.jsx)(Hue,{"data-slot":`collapsible`,...e})}function M2({...e}){return(0,U.jsx)(Wue,{"data-slot":`collapsible-trigger`,...e})}function N2({...e}){return(0,U.jsx)(que,{"data-slot":`collapsible-content`,...e})}var P2=(0,I.createContext)({});function Jue(e){let t=(0,I.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Yue=typeof window<`u`?I.useLayoutEffect:I.useEffect,F2=(0,I.createContext)(null);function I2(e,t){e.indexOf(t)===-1&&e.push(t)}function L2(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var R2=(e,t,n)=>n>t?t:n<e?e:n,z2={},B2=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function V2(e){return typeof e==`object`&&!!e}var H2=e=>/^0[^.\s]+$/u.test(e);function U2(e){let t;return()=>(t===void 0&&(t=e()),t)}var W2=e=>e,Xue=(e,t)=>n=>t(e(n)),G2=(...e)=>e.reduce(Xue),K2=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},q2=class{constructor(){this.subscriptions=[]}add(e){return I2(this.subscriptions,e),()=>L2(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},J2=e=>e*1e3,Y2=e=>e/1e3;function X2(e,t){return t?1e3/t*e:0}var Z2=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Zue=1e-7,Que=12;function $ue(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Z2(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Zue&&++s<Que);return o}function Q2(e,t,n,r){if(e===t&&n===r)return W2;let i=t=>$ue(t,0,1,e,n);return e=>e===0||e===1?e:Z2(i(e),t,r)}var $2=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,e4=e=>t=>1-e(1-t),t4=Q2(.33,1.53,.69,.99),n4=e4(t4),r4=$2(n4),i4=e=>e>=1?1:(e*=2)<1?.5*n4(e):.5*(2-2**(-10*(e-1))),a4=e=>1-Math.sin(Math.acos(e)),o4=e4(a4),s4=$2(a4),ede=Q2(.42,0,1,1),tde=Q2(0,0,.58,1),c4=Q2(.42,0,.58,1),nde=e=>Array.isArray(e)&&typeof e[0]!=`number`,l4=e=>Array.isArray(e)&&typeof e[0]==`number`,u4={linear:W2,easeIn:ede,easeInOut:c4,easeOut:tde,circIn:a4,circInOut:s4,circOut:o4,backIn:n4,backInOut:r4,backOut:t4,anticipate:i4},rde=e=>typeof e==`string`,d4=e=>{if(l4(e)){e.length;let[t,n,r,i]=e;return Q2(t,n,r,i)}else if(rde(e))return u4[e],`${e}`,u4[e];return e},f4=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],p4={value:null,addProjectionMetrics:null};function ide(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0;let o=n;n=r,r=o,n.forEach(l),t&&p4.value&&p4.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var ade=40;function m4(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=f4.reduce((e,n)=>(e[n]=ide(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=z2.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,ade),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:f4.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<f4.length;t++)o[f4[t]].cancel(e)},state:i,steps:o}}var{schedule:h4,cancel:g4,state:_4,steps:v4}=m4(typeof requestAnimationFrame<`u`?requestAnimationFrame:W2,!0),y4;function ode(){y4=void 0}var b4={now:()=>(y4===void 0&&b4.set(_4.isProcessing||z2.useManualTiming?_4.timestamp:performance.now()),y4),set:e=>{y4=e,queueMicrotask(ode)}},x4={layout:0,mainThread:0,waapi:0},S4=e=>t=>typeof t==`string`&&t.startsWith(e),C4=S4(`--`),sde=S4(`var(--`),w4=e=>sde(e)?cde.test(e.split(`/*`)[0].trim()):!1,cde=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function T4(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var E4={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},D4={...E4,transform:e=>R2(0,1,e)},O4={...E4,default:1},k4=e=>Math.round(e*1e5)/1e5,A4=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function lde(e){return e==null}var ude=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,j4=(e,t)=>n=>!!(typeof n==`string`&&ude.test(n)&&n.startsWith(e)||t&&!lde(n)&&Object.prototype.hasOwnProperty.call(n,t)),M4=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(A4);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},dde=e=>R2(0,255,e),N4={...E4,transform:e=>Math.round(dde(e))},P4={test:j4(`rgb`,`red`),parse:M4(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+N4.transform(e)+`, `+N4.transform(t)+`, `+N4.transform(n)+`, `+k4(D4.transform(r))+`)`};function fde(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var F4={test:j4(`#`),parse:fde,transform:P4.transform},I4=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),L4=I4(`deg`),R4=I4(`%`),z4=I4(`px`),pde=I4(`vh`),mde=I4(`vw`),B4={...R4,parse:e=>R4.parse(e)/100,transform:e=>R4.transform(e*100)},V4={test:j4(`hsl`,`hue`),parse:M4(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+R4.transform(k4(t))+`, `+R4.transform(k4(n))+`, `+k4(D4.transform(r))+`)`},H4={test:e=>P4.test(e)||F4.test(e)||V4.test(e),parse:e=>P4.test(e)?P4.parse(e):V4.test(e)?V4.parse(e):F4.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?P4.transform(e):V4.transform(e),getAnimatableNone:e=>{let t=H4.parse(e);return t.alpha=0,H4.transform(t)}},hde=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function gde(e){return isNaN(e)&&typeof e==`string`&&(e.match(A4)?.length||0)+(e.match(hde)?.length||0)>0}var U4=`number`,W4=`color`,_de=`var`,vde=`var(`,G4="${}",yde=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function K4(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(yde,e=>(H4.test(e)?(r.color.push(a),i.push(W4),n.push(H4.parse(e))):e.startsWith(vde)?(r.var.push(a),i.push(_de),n.push(e)):(r.number.push(a),i.push(U4),n.push(parseFloat(e))),++a,G4)).split(G4),indexes:r,types:i}}function bde(e){return K4(e).values}function q4({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===U4?i+=k4(r[a]):e===W4?i+=H4.transform(r[a]):i+=r[a]}return i}}function xde(e){return q4(K4(e))}var Sde=e=>typeof e==`number`?0:H4.test(e)?H4.getAnimatableNone(e):e,Cde=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Sde(e);function wde(e){let t=K4(e);return q4(t)(t.values.map((e,n)=>Cde(e,t.split[n])))}var J4={test:gde,parse:bde,createTransformer:xde,getAnimatableNone:wde};function Y4(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Tde({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Y4(s,r,e+1/3),a=Y4(s,r,e),o=Y4(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function X4(e,t){return n=>n>0?t:e}var Z4=(e,t,n)=>e+(t-e)*n,Q4=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Ede=[F4,P4,V4],Dde=e=>Ede.find(t=>t.test(e));function $4(e){let t=Dde(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===V4&&(n=Tde(n)),n}var e3=(e,t)=>{let n=$4(e),r=$4(t);if(!n||!r)return X4(e,t);let i={...n};return e=>(i.red=Q4(n.red,r.red,e),i.green=Q4(n.green,r.green,e),i.blue=Q4(n.blue,r.blue,e),i.alpha=Z4(n.alpha,r.alpha,e),P4.transform(i))},t3=new Set([`none`,`hidden`]);function Ode(e,t){return t3.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function kde(e,t){return n=>Z4(e,t,n)}function n3(e){return typeof e==`number`?kde:typeof e==`string`?w4(e)?X4:H4.test(e)?e3:Mde:Array.isArray(e)?r3:typeof e==`object`?H4.test(e)?e3:Ade:X4}function r3(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>n3(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Ade(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=n3(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function jde(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var Mde=(e,t)=>{let n=J4.createTransformer(t),r=K4(e),i=K4(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?t3.has(e)&&!i.values.length||t3.has(t)&&!r.values.length?Ode(e,t):G2(r3(jde(r,i),i.values),n):(`${e}${t}`,X4(e,t))};function i3(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Z4(e,t,n):n3(e)(e,t)}var Nde=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>h4.update(t,e),stop:()=>g4(t),now:()=>_4.isProcessing?_4.timestamp:b4.now()}},a3=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},o3=2e4;function s3(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function Pde(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(s3(r),o3);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Y2(i)}}var c3={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function l3(e,t){return e*Math.sqrt(1-t*t)}var Fde=12;function Ide(e,t,n){let r=n;for(let n=1;n<Fde;n++)r-=e(r)/t(r);return r}var u3=.001;function Lde({duration:e=c3.duration,bounce:t=c3.bounce,velocity:n=c3.velocity,mass:r=c3.mass}){let i,a;c3.maxDuration;let o=1-t;o=R2(c3.minDamping,c3.maxDamping,o),e=R2(c3.minDuration,c3.maxDuration,Y2(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=l3(t,o),c=Math.exp(-i);return u3-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=l3(t**2,o);return(-i(t)+u3>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-u3+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Ide(i,a,s);if(e=J2(e),isNaN(c))return{stiffness:c3.stiffness,damping:c3.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Rde=[`duration`,`bounce`],zde=[`stiffness`,`damping`,`mass`];function d3(e,t){return t.some(t=>e[t]!==void 0)}function Bde(e){let t={velocity:c3.velocity,stiffness:c3.stiffness,damping:c3.damping,mass:c3.mass,isResolvedFromDuration:!1,...e};if(!d3(e,zde)&&d3(e,Rde))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*R2(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:c3.mass,stiffness:i,damping:a}}else{let n=Lde({...e,velocity:0});t={...t,...n,mass:c3.mass},t.isResolvedFromDuration=!0}return t}function f3(e=c3.visualDuration,t=c3.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Bde({...n,velocity:-Y2(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=Y2(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?c3.restSpeed.granular:c3.restSpeed.default,i||=v?c3.restDelta.granular:c3.restDelta.default;let y,b,x,S,C,w;if(h<1)x=l3(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>J2(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=J2(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=J2(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(s3(T),o3),t=a3(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}f3.applyToOptions=e=>{let t=Pde(e,100,f3);return e.ease=t.ease,e.duration=J2(t.duration),e.type=`keyframes`,e};var Vde=5;function p3(e,t,n){let r=Math.max(t-Vde,0);return X2(n-e(r),t-r)}function m3({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=f3({keyframes:[f.value,m(f.value)],velocity:p3(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Hde(e,t,n){let r=[],i=n||z2.mix||i3,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=G2(Array.isArray(t)?t[n]||W2:t,a)),r.push(a)}return r}function Ude(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Hde(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=K2(e[r],e[r+1],n);return s[r](i)};return n?t=>l(R2(e[0],e[a-1],t)):l}function Wde(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=K2(0,t,r);e.push(Z4(n,1,i))}}function Gde(e){let t=[0];return Wde(t,e.length-1),t}function Kde(e,t){return e.map(e=>e*t)}function qde(e,t){return e.map(()=>t||c4).splice(0,e.length-1)}function h3({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=nde(r)?r.map(d4):d4(r),a={done:!1,value:t[0]},o=Ude(Kde(n&&n.length===t.length?n:Gde(t),e),t,{ease:Array.isArray(i)?i:qde(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Jde=e=>e!==null;function g3(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Jde),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Yde={decay:m3,inertia:m3,tween:h3,keyframes:h3,spring:f3};function _3(e){typeof e.type==`string`&&(e.type=Yde[e.type])}var v3=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},Xde=e=>e/100,y3=class extends v3{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==b4.now()&&this.tick(b4.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},x4.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;_3(e);let{type:t=h3,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||h3;s!==h3&&typeof o[0]!=`number`&&(this.mixKeyframes=G2(Xde,i3(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=s3(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=R2(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==m3&&(b.value=g3(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return Y2(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Y2(e)}get time(){return Y2(this.currentTime)}set time(e){e=J2(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return p3(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(b4.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Y2(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Nde,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(b4.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,x4.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Zde(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var b3=e=>e*180/Math.PI,x3=e=>S3(b3(Math.atan2(e[1],e[0]))),Qde={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:x3,rotateZ:x3,skewX:e=>b3(Math.atan(e[1])),skewY:e=>b3(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},S3=e=>(e%=360,e<0&&(e+=360),e),C3=x3,w3=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),T3=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),$de={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:w3,scaleY:T3,scale:e=>(w3(e)+T3(e))/2,rotateX:e=>S3(b3(Math.atan2(e[6],e[5]))),rotateY:e=>S3(b3(Math.atan2(-e[2],e[0]))),rotateZ:C3,rotate:C3,skewX:e=>b3(Math.atan(e[4])),skewY:e=>b3(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function E3(e){return+!!e.includes(`scale`)}function D3(e,t){if(!e||e===`none`)return E3(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=$de,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Qde,i=t}if(!i)return E3(t);let a=r[t],o=i[1].split(`,`).map(tfe);return typeof a==`function`?a(o):o[a]}var efe=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return D3(n,t)};function tfe(e){return parseFloat(e.trim())}var O3=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],k3=new Set(O3),A3=e=>e===E4||e===z4,nfe=new Set([`x`,`y`,`z`]),rfe=O3.filter(e=>!nfe.has(e));function ife(e){let t=[];return rfe.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var j3={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>D3(t,`x`),y:(e,{transform:t})=>D3(t,`y`)};j3.translateX=j3.x,j3.translateY=j3.y;var M3=new Set,N3=!1,P3=!1,F3=!1;function I3(){if(P3){let e=Array.from(M3).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=ife(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}P3=!1,N3=!1,M3.forEach(e=>e.complete(F3)),M3.clear()}function L3(){M3.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(P3=!0)})}function afe(){F3=!0,L3(),I3(),F3=!1}var R3=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(M3.add(this),N3||(N3=!0,h4.read(L3),h4.resolveKeyframes(I3))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Zde(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),M3.delete(this)}cancel(){this.state===`scheduled`&&(M3.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},ofe=e=>e.startsWith(`--`);function z3(e,t,n){ofe(t)?e.style.setProperty(t,n):e.style[t]=n}var sfe={};function B3(e,t){let n=U2(e);return()=>sfe[t]??n()}var cfe=B3(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),V3=B3(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),H3=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,U3={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:H3([0,.65,.55,1]),circOut:H3([.55,0,1,.45]),backIn:H3([.31,.01,.66,-.59]),backOut:H3([.33,1.53,.69,.99])};function W3(e,t){if(e)return typeof e==`function`?V3()?a3(e,t):`ease-out`:l4(e)?H3(e):Array.isArray(e)?e.map(e=>W3(e,t)||U3.easeOut):U3[e]}function lfe(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=W3(s,i);Array.isArray(d)&&(u.easing=d),p4.value&&x4.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return p4.value&&p.finished.finally(()=>{x4.waapi--}),p}function G3(e){return typeof e==`function`&&`applyToOptions`in e}function ufe({type:e,...t}){return G3(e)&&V3()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var K3=class extends v3{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=ufe(e);this.animation=lfe(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=g3(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),z3(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Y2(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Y2(e)}get time(){return Y2(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=J2(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&cfe()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),W2):r(this)}},q3={anticipate:i4,backInOut:r4,circInOut:s4};function dfe(e){return e in q3}function ffe(e){typeof e.ease==`string`&&dfe(e.ease)&&(e.ease=q3[e.ease])}var J3=10,pfe=class extends K3{constructor(e){ffe(e),_3(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new y3({...a,autoplay:!1}),s=Math.max(J3,b4.now()-this.startTime),c=R2(0,J3,s-J3),l=o.sample(s).value,{name:u}=this.options;i&&u&&z3(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},Y3=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(J4.test(e)||e===`0`)&&!e.startsWith(`url(`));function mfe(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function hfe(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Y3(i,t),s=Y3(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:mfe(e)||(n===`spring`||G3(n))&&r}function X3(e){e.duration=0,e.type=`keyframes`}var Z3=new Set([`opacity`,`clipPath`,`filter`,`transform`]),gfe=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function _fe(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&gfe.test(e[t]))return!0;return!1}var vfe=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),yfe=U2(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function bfe(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return yfe()&&n&&(Z3.has(n)||vfe.has(n)&&_fe(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var xfe=40,Sfe=class extends v3{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=b4.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||R3;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=b4.now();let u=!0;hfe(e,i,a,o)||(u=!1,(z2.instantAnimations||!s)&&l?.(g3(e,n,t)),e[0]=e[e.length-1],X3(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>xfe?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&bfe(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new pfe({...d,element:p})}catch{m=new y3(d)}else m=new y3(d);m.finished.then(()=>{this.notifyFinished()}).catch(W2),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),afe()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Q3(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Cfe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function wfe(e){let t=Cfe.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function $3(e,t,n=1){`${e}`;let[r,i]=wfe(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return B2(e)?parseFloat(e):e}return w4(i)?$3(i,t,n+1):i}var Tfe={type:`spring`,stiffness:500,damping:25,restSpeed:10},Efe=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Dfe={type:`keyframes`,duration:.8},Ofe={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},kfe=(e,{keyframes:t})=>t.length>2?Dfe:k3.has(e)?e.startsWith(`scale`)?Efe(t[1]):Tfe:Ofe;function e6(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function t6(e,t){let n=e?.[t]??e?.default??e;return n===e?n:e6(n,e)}var Afe=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function jfe(e){for(let t in e)if(!Afe.has(t))return!0;return!1}var n6=(e,t,n,r={},i,a)=>o=>{let s=t6(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=J2(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};jfe(s)||Object.assign(u,kfe(e,u)),u.duration&&=J2(u.duration),u.repeatDelay&&=J2(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(X3(u),u.delay===0&&(d=!0)),(z2.instantAnimations||z2.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,X3(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=g3(u.keyframes,s);if(e!==void 0){h4.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new y3(u):new Sfe(u)};function r6(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function i6(e,t,n,r){if(typeof t==`function`){let[i,a]=r6(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=r6(r);t=t(n===void 0?e.custom:n,i,a)}return t}function a6(e,t,n){let r=e.getProps();return i6(r,t,n===void 0?r.custom:n,e)}var o6=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...O3]),s6=30,Mfe=e=>!isNaN(parseFloat(e)),c6={current:void 0},Nfe=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=b4.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=b4.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Mfe(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new q2);let n=this.events[e].add(t);return e===`change`?()=>{n(),h4.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return c6.current&&c6.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=b4.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>s6)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,s6);return X2(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function l6(e,t){return new Nfe(e,t)}var u6=e=>Array.isArray(e);function Pfe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,l6(n))}function Ffe(e){return u6(e)?e[e.length-1]||0:e}function Ife(e,t){let{transitionEnd:n={},transition:r={},...i}=a6(e,t)||{};i={...i,...n};for(let t in i)Pfe(e,t,Ffe(i[t]))}var d6=e=>!!(e&&e.getVelocity);function Lfe(e){return!!(d6(e)&&e.add)}function f6(e,t){let n=e.getValue(`willChange`);if(Lfe(n))return n.add(t);if(!n&&z2.WillChange){let n=new z2.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function p6(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var m6=`data-`+p6(`framerAppearId`);function h6(e){return e.props[m6]}function Rfe({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function g6(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?e6(a,c):c;let l=a?.reduceMotion;r&&(a=r);let u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||d&&Rfe(d,t))continue;let o={delay:n,...t6(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){h4.update(()=>r.set(i));continue}let f=!1;if(window.MotionHandoffAnimation){let n=h6(e);if(n){let e=window.MotionHandoffAnimation(n,t,h4);e!==null&&(o.startTime=e,f=!0)}}f6(e,t);let p=l??e.shouldReduceMotion;r.start(n6(t,r,i,p&&o6.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>h4.update(()=>{o&&Ife(e,o)});u.length?Promise.all(u).then(t):t()}return u}function _6(e,t,n={}){let r=a6(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(g6(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return zfe(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function zfe(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(_6(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Q3(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Bfe(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>_6(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=_6(e,t,n);else{let i=typeof t==`function`?a6(e,t,n.custom):t;r=Promise.all(g6(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Vfe={test:e=>e===`auto`,parse:e=>e},v6=e=>t=>t.test(e),y6=[E4,z4,R4,L4,mde,pde,Vfe],b6=e=>y6.find(v6(e));function Hfe(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||H2(e)}var Ufe=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Wfe(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(A4)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Ufe.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Gfe=/\b([a-z-]*)\(.*?\)/gu,x6={...J4,getAnimatableNone:e=>{let t=e.match(Gfe);return t?t.map(Wfe).join(` `):e}},S6={...J4,getAnimatableNone:e=>{let t=J4.parse(e);return J4.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},C6={...E4,transform:Math.round},w6={borderWidth:z4,borderTopWidth:z4,borderRightWidth:z4,borderBottomWidth:z4,borderLeftWidth:z4,borderRadius:z4,borderTopLeftRadius:z4,borderTopRightRadius:z4,borderBottomRightRadius:z4,borderBottomLeftRadius:z4,width:z4,maxWidth:z4,height:z4,maxHeight:z4,top:z4,right:z4,bottom:z4,left:z4,inset:z4,insetBlock:z4,insetBlockStart:z4,insetBlockEnd:z4,insetInline:z4,insetInlineStart:z4,insetInlineEnd:z4,padding:z4,paddingTop:z4,paddingRight:z4,paddingBottom:z4,paddingLeft:z4,paddingBlock:z4,paddingBlockStart:z4,paddingBlockEnd:z4,paddingInline:z4,paddingInlineStart:z4,paddingInlineEnd:z4,margin:z4,marginTop:z4,marginRight:z4,marginBottom:z4,marginLeft:z4,marginBlock:z4,marginBlockStart:z4,marginBlockEnd:z4,marginInline:z4,marginInlineStart:z4,marginInlineEnd:z4,fontSize:z4,backgroundPositionX:z4,backgroundPositionY:z4,rotate:L4,rotateX:L4,rotateY:L4,rotateZ:L4,scale:O4,scaleX:O4,scaleY:O4,scaleZ:O4,skew:L4,skewX:L4,skewY:L4,distance:z4,translateX:z4,translateY:z4,translateZ:z4,x:z4,y:z4,z:z4,perspective:z4,transformPerspective:z4,opacity:D4,originX:B4,originY:B4,originZ:z4,zIndex:C6,fillOpacity:D4,strokeOpacity:D4,numOctaves:C6},Kfe={...w6,color:H4,backgroundColor:H4,outlineColor:H4,fill:H4,stroke:H4,borderColor:H4,borderTopColor:H4,borderRightColor:H4,borderBottomColor:H4,borderLeftColor:H4,filter:x6,WebkitFilter:x6,mask:S6,WebkitMask:S6},T6=e=>Kfe[e],qfe=new Set([x6,S6]);function E6(e,t){let n=T6(e);return qfe.has(n)||(n=J4),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var Jfe=new Set([`auto`,`none`,`0`]);function Yfe(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Jfe.has(t)&&K4(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=E6(n,i)}var Xfe=class extends R3{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),w4(r))){let i=$3(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!o6.has(n)||e.length!==2)return;let[r,i]=e,a=b6(r),o=b6(i);if(T4(r)!==T4(i)&&j3[n]){this.needsMeasurement=!0;return}if(a!==o)if(A3(a)&&A3(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else j3[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Hfe(e[t]))&&n.push(t);n.length&&Yfe(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=j3[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=j3[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function D6(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var O6=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Zfe(e){return V2(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:k6,cancel:Qfe}=m4(queueMicrotask,!1),A6={x:!1,y:!1};function j6(){return A6.x||A6.y}function $fe(e){return e===`x`||e===`y`?A6[e]?null:(A6[e]=!0,()=>{A6[e]=!1}):A6.x||A6.y?null:(A6.x=A6.y=!0,()=>{A6.x=A6.y=!1})}function M6(e,t){let n=D6(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function epe(e){return!(e.pointerType===`touch`||j6())}function tpe(e,t,n={}){let[r,i,a]=M6(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!epe(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var N6=(e,t)=>t?e===t?!0:N6(e,t.parentElement):!1,P6=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,npe=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function rpe(e){return npe.has(e.tagName)||e.isContentEditable===!0}var ipe=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function ape(e){return ipe.has(e.tagName)||e.isContentEditable===!0}var F6=new WeakSet;function I6(e){return t=>{t.key===`Enter`&&e(t)}}function L6(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var ope=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=I6(()=>{if(F6.has(n))return;L6(n,`down`);let e=I6(()=>{L6(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>L6(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function R6(e){return P6(e)&&!j6()}var z6=new WeakSet;function spe(e,t,n={}){let[r,i,a]=M6(e,n),o=e=>{let r=e.currentTarget;if(!R6(e)||z6.has(e))return;F6.add(r),n.stopPropagation&&z6.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),F6.has(r)&&F6.delete(r),R6(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||N6(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Zfe(e)&&(e.addEventListener(`focus`,e=>ope(e,i)),!rpe(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function B6(e){return V2(e)&&`ownerSVGElement`in e}var V6=new WeakMap,H6,U6=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:B6(r)&&`getBBox`in r?r.getBBox()[t]:r[n],cpe=U6(`inline`,`width`,`offsetWidth`),lpe=U6(`block`,`height`,`offsetHeight`);function upe({target:e,borderBoxSize:t}){V6.get(e)?.forEach(n=>{n(e,{get width(){return cpe(e,t)},get height(){return lpe(e,t)}})})}function dpe(e){e.forEach(upe)}function fpe(){typeof ResizeObserver>`u`||(H6=new ResizeObserver(dpe))}function ppe(e,t){H6||fpe();let n=D6(e);return n.forEach(e=>{let n=V6.get(e);n||(n=new Set,V6.set(e,n)),n.add(t),H6?.observe(e)}),()=>{n.forEach(e=>{let n=V6.get(e);n?.delete(t),n?.size||H6?.unobserve(e)})}}var W6=new Set,G6;function mpe(){G6=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};W6.forEach(t=>t(e))},window.addEventListener(`resize`,G6)}function hpe(e){return W6.add(e),G6||mpe(),()=>{W6.delete(e),!W6.size&&typeof G6==`function`&&(window.removeEventListener(`resize`,G6),G6=void 0)}}function K6(e,t){return typeof e==`function`?hpe(e):ppe(e,t)}function gpe(e){return B6(e)&&e.tagName===`svg`}var _pe=[...y6,H4,J4],vpe=e=>_pe.find(v6(e)),q6=()=>({translate:0,scale:1,origin:0,originPoint:0}),J6=()=>({x:q6(),y:q6()}),Y6=()=>({min:0,max:0}),X6=()=>({x:Y6(),y:Y6()}),ype=new WeakMap;function Z6(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Q6(e){return typeof e==`string`||Array.isArray(e)}var $6=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],e8=[`initial`,...$6];function t8(e){return Z6(e.animate)||e8.some(t=>Q6(e[t]))}function n8(e){return!!(t8(e)||e.variants)}function bpe(e,t,n){for(let r in t){let i=t[r],a=n[r];if(d6(i))e.addValue(r,i);else if(d6(a))e.addValue(r,l6(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,l6(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var r8={current:null},i8={current:!1},xpe=typeof window<`u`;function Spe(){if(i8.current=!0,xpe)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>r8.current=e.matches;e.addEventListener(`change`,t),t()}else r8.current=!1}var a8=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],o8={};function s8(e){o8=e}function Cpe(){return o8}var wpe=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=R3,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=b4.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,h4.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=t8(t),this.isVariantNode=n8(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&d6(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,ype.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(i8.current||Spe(),this.shouldReduceMotion=r8.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),g4(this.notifyUpdate),g4(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Z3.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new K3({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:J2(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=k3.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&h4.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in o8){let t=o8[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):X6()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<a8.length;t++){let n=a8[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=bpe(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=l6(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(B2(n)||H2(n))?n=parseFloat(n):!vpe(n)&&J4.test(t)&&(n=E6(e,t)),this.setBaseTarget(e,d6(n)?n.get():n)),d6(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=i6(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!d6(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new q2),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){k6.render(this.render)}},c8=class extends wpe{constructor(){super(...arguments),this.KeyframeResolver=Xfe}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;d6(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},l8=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function u8({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Tpe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Epe(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function d8(e){return e===void 0||e===1}function f8({scale:e,scaleX:t,scaleY:n}){return!d8(e)||!d8(t)||!d8(n)}function p8(e){return f8(e)||m8(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function m8(e){return h8(e.x)||h8(e.y)}function h8(e){return e&&e!==`0%`}function g8(e,t,n){return n+t*(e-n)}function _8(e,t,n,r,i){return i!==void 0&&(e=g8(e,i,r)),g8(e,n,r)+t}function v8(e,t=0,n=1,r,i){e.min=_8(e.min,t,n,r,i),e.max=_8(e.max,t,n,r,i)}function y8(e,{x:t,y:n}){v8(e.x,t.translate,t.scale,t.originPoint),v8(e.y,n.translate,n.scale,n.originPoint)}var b8=.999999999999,x8=1.0000000000001;function Dpe(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(S8(e.x,-a.scroll.offset.x),S8(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,y8(e,o)),r&&p8(a.latestValues)&&T8(e,a.latestValues,a.layout?.layoutBox))}t.x<x8&&t.x>b8&&(t.x=1),t.y<x8&&t.y>b8&&(t.y=1)}function S8(e,t){e.min+=t,e.max+=t}function C8(e,t,n,r,i=.5){v8(e,t,n,Z4(e.min,e.max,i),r)}function w8(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function T8(e,t,n){let r=n??e;C8(e.x,w8(t.x,r.x),t.scaleX,t.scale,t.originX),C8(e.y,w8(t.y,r.y),t.scaleY,t.scale,t.originY)}function E8(e,t){return u8(Epe(e.getBoundingClientRect(),t))}function Ope(e,t,n){let r=E8(e,n),{scroll:i}=t;return i&&(S8(r.x,i.offset.x),S8(r.y,i.offset.y)),r}var kpe={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Ape=O3.length;function jpe(e,t,n){let r=``,i=!0;for(let a=0;a<Ape;a++){let o=O3[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=O6(s,w6[o]);if(!c){i=!1;let t=kpe[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function D8(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(k3.has(e)){o=!0;continue}else if(C4(e)){i[e]=n;continue}else{let t=O6(n,w6[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=jpe(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function O8(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function k8(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var A8={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(z4.test(e))e=parseFloat(e);else return e;return`${k8(e,t.target.x)}% ${k8(e,t.target.y)}%`}},Mpe={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=J4.parse(e);if(i.length>5)return r;let a=J4.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Z4(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},j8={borderRadius:{...A8,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:A8,borderTopRightRadius:A8,borderBottomLeftRadius:A8,borderBottomRightRadius:A8,boxShadow:Mpe};function M8(e,{layout:t,layoutId:n}){return k3.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!j8[e]||e===`opacity`)}function N8(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(d6(r[t])||i&&d6(i[t])||M8(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Npe(e){return window.getComputedStyle(e)}var Ppe=class extends c8{constructor(){super(...arguments),this.type=`html`,this.renderInstance=O8}readValueFromInstance(e,t){if(k3.has(t))return this.projection?.isProjecting?E3(t):efe(e,t);{let n=Npe(e),r=(C4(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return E8(e,t)}build(e,t,n){D8(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return N8(e,t,n)}},Fpe={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Ipe={offset:`strokeDashoffset`,array:`strokeDasharray`};function Lpe(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Fpe:Ipe;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Rpe=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function P8(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(D8(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Rpe)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Lpe(d,i,a,o,!1)}var F8=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),I8=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function zpe(e,t,n,r){O8(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(F8.has(n)?n:p6(n),t.attrs[n])}function L8(e,t,n){let r=N8(e,t,n);for(let n in e)if(d6(e[n])||d6(t[n])){let t=O3.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Bpe=class extends c8{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=X6}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(k3.has(t)){let e=T6(t);return e&&e.default||0}return t=F8.has(t)?t:p6(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return L8(e,t,n)}build(e,t,n){P8(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){zpe(e,t,n,r)}mount(e){this.isSVGTag=I8(e.tagName),super.mount(e)}},Vpe=e8.length;function R8(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&R8(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<Vpe;n++){let r=e8[n],i=e.props[r];(Q6(i)||i===!1)&&(t[r]=i)}return t}function z8(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Hpe=[...$6].reverse(),Upe=$6.length;function Wpe(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Bfe(e,t,n)))}function Gpe(e){let t=Wpe(e),n=V8(),r=!0,i=!1,a=t=>(n,r)=>{let i=a6(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=R8(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Upe;t++){let p=Hpe[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Q6(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Z6(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Kpe(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=u6(t)&&u6(n)?!z8(t,n):t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=a6(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Q3(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=a6(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=V8(),i=!0}}}function Kpe(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!z8(t,e):!1}function B8(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function V8(){return{animate:B8(!0),whileInView:B8(),whileHover:B8(),whileTap:B8(),whileDrag:B8(),whileFocus:B8(),exit:B8()}}function H8(e,t){e.min=t.min,e.max=t.max}function U8(e,t){H8(e.x,t.x),H8(e.y,t.y)}function W8(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var G8=1e-4,qpe=1-G8,Jpe=1+G8,K8=.01,Ype=0-K8,Xpe=0+K8;function q8(e){return e.max-e.min}function Zpe(e,t,n){return Math.abs(e-t)<=n}function J8(e,t,n,r=.5){e.origin=r,e.originPoint=Z4(t.min,t.max,e.origin),e.scale=q8(n)/q8(t),e.translate=Z4(n.min,n.max,e.origin)-e.originPoint,(e.scale>=qpe&&e.scale<=Jpe||isNaN(e.scale))&&(e.scale=1),(e.translate>=Ype&&e.translate<=Xpe||isNaN(e.translate))&&(e.translate=0)}function Y8(e,t,n,r){J8(e.x,t.x,n.x,r?r.originX:void 0),J8(e.y,t.y,n.y,r?r.originY:void 0)}function X8(e,t,n,r=0){e.min=(r?Z4(n.min,n.max,r):n.min)+t.min,e.max=e.min+q8(t)}function Qpe(e,t,n,r){X8(e.x,t.x,n.x,r?.x),X8(e.y,t.y,n.y,r?.y)}function Z8(e,t,n,r=0){let i=r?Z4(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+q8(t)}function Q8(e,t,n,r){Z8(e.x,t.x,n.x,r?.x),Z8(e.y,t.y,n.y,r?.y)}function $8(e,t,n,r,i){return e-=t,e=g8(e,1/n,r),i!==void 0&&(e=g8(e,1/i,r)),e}function $pe(e,t=0,n=1,r=.5,i,a=e,o=e){if(R4.test(t)&&(t=parseFloat(t),t=Z4(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Z4(a.min,a.max,r);e===a&&(s-=t),e.min=$8(e.min,t,n,s,i),e.max=$8(e.max,t,n,s,i)}function e5(e,t,[n,r,i],a,o){$pe(e,t[n],t[r],t[i],t.scale,a,o)}var eme=[`x`,`scaleX`,`originX`],tme=[`y`,`scaleY`,`originY`];function t5(e,t,n,r){e5(e.x,t,eme,n?n.x:void 0,r?r.x:void 0),e5(e.y,t,tme,n?n.y:void 0,r?r.y:void 0)}function n5(e){return e.translate===0&&e.scale===1}function r5(e){return n5(e.x)&&n5(e.y)}function i5(e,t){return e.min===t.min&&e.max===t.max}function nme(e,t){return i5(e.x,t.x)&&i5(e.y,t.y)}function a5(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function o5(e,t){return a5(e.x,t.x)&&a5(e.y,t.y)}function s5(e){return q8(e.x)/q8(e.y)}function c5(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function l5(e){return[e(`x`),e(`y`)]}function rme(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var u5=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],ime=u5.length,d5=e=>typeof e==`string`?parseFloat(e):e,f5=e=>typeof e==`number`||z4.test(e);function ame(e,t,n,r,i,a){i?(e.opacity=Z4(0,n.opacity??1,ome(r)),e.opacityExit=Z4(t.opacity??1,0,sme(r))):a&&(e.opacity=Z4(t.opacity??1,n.opacity??1,r));for(let i=0;i<ime;i++){let a=u5[i],o=p5(t,a),s=p5(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||f5(o)===f5(s)?(e[a]=Math.max(Z4(d5(o),d5(s),r),0),(R4.test(s)||R4.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Z4(t.rotate||0,n.rotate||0,r))}function p5(e,t){return e[t]===void 0?e.borderRadius:e[t]}var ome=m5(0,.5,o4),sme=m5(.5,.95,W2);function m5(e,t,n){return r=>r<e?0:r>t?1:n(K2(e,t,r))}function cme(e,t,n){let r=d6(e)?e:l6(e);return r.start(n6(``,r,t,n)),r.animation}function h5(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var lme=(e,t)=>e.depth-t.depth,ume=class{constructor(){this.children=[],this.isDirty=!1}add(e){I2(this.children,e),this.isDirty=!0}remove(e){L2(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(lme),this.isDirty=!1,this.children.forEach(e)}};function dme(e,t){let n=b4.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(g4(r),e(a-t))};return h4.setup(r,!0),()=>g4(r)}function g5(e){return d6(e)?e.get():e}var fme=class{constructor(){this.members=[]}add(e){I2(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(L2(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(L2(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},_5={hasAnimatedSinceResize:!0,hasEverUpdated:!1},v5={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},y5=[``,`X`,`Y`,`Z`],pme=1e3,mme=0;function b5(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function x5(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=h6(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,h4,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&x5(r)}function S5({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=mme++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,p4.value&&(v5.nodes=v5.calculatedTargetDeltas=v5.calculatedProjections=0),this.nodes.forEach(_me),this.nodes.forEach(Cme),this.nodes.forEach(wme),this.nodes.forEach(vme),p4.addProjectionMetrics&&p4.addProjectionMetrics(v5)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new ume)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new q2),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=B6(t)&&!gpe(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;h4.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=dme(i,250),_5.hasAnimatedSinceResize&&(_5.hasAnimatedSinceResize=!1,this.nodes.forEach(T5)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||kme,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!o5(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...t6(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||T5(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),g4(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Tme),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&x5(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(bme),this.nodes.forEach(C5);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(w5);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(xme),this.nodes.forEach(Sme),this.nodes.forEach(hme),this.nodes.forEach(gme)):this.nodes.forEach(w5),this.clearAllSnapshots();let e=b4.now();_4.delta=R2(0,1e3/60,e-_4.timestamp),_4.timestamp=e,_4.isProcessing=!0,v4.update.process(_4),v4.preRender.process(_4),v4.render.process(_4),_4.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,k6.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(yme),this.sharedNodes.forEach(Eme)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,h4.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){h4.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!q8(this.snapshot.measuredBox.x)&&!q8(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=X6(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!r5(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||p8(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Ame(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return X6();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(jme))){let{scroll:e}=this.root;e&&(S8(t.x,e.offset.x),S8(t.y,e.offset.y))}return t}removeElementScroll(e){let t=X6();if(U8(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&U8(t,e),S8(t.x,i.offset.x),S8(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||X6();U8(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(S8(r.x,-n.scroll.offset.x),S8(r.y,-n.scroll.offset.y)),p8(n.latestValues)&&T8(r,n.latestValues,n.layout?.layoutBox)}return p8(this.latestValues)&&T8(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=X6();U8(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!p8(n.latestValues))continue;let r;n.instance&&(f8(n.latestValues)&&n.updateSnapshot(),r=X6(),U8(r,n.measurePageBox())),t5(t,n.latestValues,n.snapshot?.layoutBox,r)}return p8(this.latestValues)&&t5(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==_4.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=_4.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=X6(),this.targetWithTransforms=X6()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Qpe(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):U8(this.target,this.layout.layoutBox),y8(this.target,this.targetDelta)):U8(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),p4.value&&v5.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||f8(this.parent.latestValues)||m8(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=X6(),this.relativeTargetOrigin=X6(),Q8(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),U8(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===_4.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;U8(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Dpe(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=X6());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(W8(this.prevProjectionDelta.x,this.projectionDelta.x),W8(this.prevProjectionDelta.y,this.projectionDelta.y)),Y8(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!c5(this.projectionDelta.x,this.prevProjectionDelta.x)||!c5(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),p4.value&&v5.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=J6(),this.projectionDelta=J6(),this.projectionDeltaWithTransform=J6()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=J6();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=X6(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(Ome));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;E5(a.x,e.x,n),E5(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Q8(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Dme(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&nme(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=X6(),U8(d,this.relativeTarget)),s&&(this.animationValues=i,ame(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(g4(this.pendingAnimation),void 0),this.pendingAnimation=h4.update(()=>{_5.hasAnimatedSinceResize=!0,x4.layout++,this.motionValue||=l6(0),this.motionValue.jump(0,!1),this.currentAnimation=cme(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{x4.layout--},onComplete:()=>{x4.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(pme),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&j5(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||X6();let t=q8(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=q8(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}U8(t,n),T8(t,i),Y8(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new fme),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&b5(`z`,e,r,this.animationValues);for(let t=0;t<y5.length;t++)b5(`rotate${y5[t]}`,e,r,this.animationValues),b5(`skew${y5[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=g5(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=g5(t?.pointerEvents)||``),this.hasProjected&&!p8(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=rme(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in j8){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=j8[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?g5(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(C5),this.root.sharedNodes.clear()}}}function hme(e){e.updateLayout()}function gme(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)l5(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=q8(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;H8(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else j5(i,t.layoutBox,n)&&l5(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=q8(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=J6();Y8(o,n,t.layoutBox);let s=J6();a?Y8(s,e.applyTransform(r,!0),t.measuredBox):Y8(s,n,t.layoutBox);let c=!r5(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=X6();Q8(s,t.layoutBox,i.layoutBox,o);let c=X6();Q8(c,n,a.layoutBox,o),o5(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function _me(e){p4.value&&v5.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function vme(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function yme(e){e.clearSnapshot()}function C5(e){e.clearMeasurements()}function bme(e){e.isLayoutDirty=!0,e.updateLayout()}function w5(e){e.isLayoutDirty=!1}function xme(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Sme(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function T5(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Cme(e){e.resolveTargetDelta()}function wme(e){e.calcProjection()}function Tme(e){e.resetSkewAndRotation()}function Eme(e){e.removeLeadSnapshot()}function E5(e,t,n){e.translate=Z4(t.translate,0,n),e.scale=Z4(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function D5(e,t,n,r){e.min=Z4(t.min,n.min,r),e.max=Z4(t.max,n.max,r)}function Dme(e,t,n,r){D5(e.x,t.x,n.x,r),D5(e.y,t.y,n.y,r)}function Ome(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var kme={duration:.45,ease:[.4,0,.1,1]},O5=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),k5=O5(`applewebkit/`)&&!O5(`chrome/`)?Math.round:W2;function A5(e){e.min=k5(e.min),e.max=k5(e.max)}function Ame(e){A5(e.x),A5(e.y)}function j5(e,t,n){return e===`position`||e===`preserve-aspect`&&!Zpe(s5(t),s5(n),.2)}function jme(e){return e!==e.root&&e.scroll?.wasRoot}var Mme=S5({attachResizeListener:(e,t)=>h5(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),M5={current:void 0},N5=S5({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!M5.current){let e=new Mme({});e.mount(window),e.setOptions({layoutScroll:!0}),M5.current=e}return M5.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),P5=(0,I.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Nme(e=!0){let t=(0,I.useContext)(F2);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,I.useId)();(0,I.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,I.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var F5=(0,I.createContext)({strict:!1}),I5={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},L5=!1;function Pme(){if(L5)return;let e={};for(let t in I5)e[t]={isEnabled:e=>I5[t].some(t=>!!e[t])};s8(e),L5=!0}function R5(){return Pme(),Cpe()}function Fme(e){let t=R5();for(let n in e)t[n]={...t[n],...e[n]};s8(t)}var Ime=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function z5(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Ime.has(e)}var Lme=r({default:()=>B5}),B5,Rme=n((()=>{throw B5={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),V5=e=>!z5(e);function zme(e){typeof e==`function`&&(V5=t=>t.startsWith(`on`)?!z5(t):e(t))}try{zme((Rme(),t(Lme)).default)}catch{}function Bme(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||d6(e[i])||(V5(i)||n===!0&&z5(i)||!t&&!z5(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var H5=(0,I.createContext)({});function Vme(e,t){if(t8(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Q6(t)?t:void 0,animate:Q6(n)?n:void 0}}return e.inherit===!1?{}:t}function Hme(e){let{initial:t,animate:n}=Vme(e,(0,I.useContext)(H5));return(0,I.useMemo)(()=>({initial:t,animate:n}),[U5(t),U5(n)])}function U5(e){return Array.isArray(e)?e.join(` `):e}var W5=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function G5(e,t,n){for(let r in t)!d6(t[r])&&!M8(r,n)&&(e[r]=t[r])}function Ume({transformTemplate:e},t){return(0,I.useMemo)(()=>{let n=W5();return D8(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Wme(e,t){let n=e.style||{},r={};return G5(r,n,e),Object.assign(r,Ume(e,t)),r}function Gme(e,t){let n={},r=Wme(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var K5=()=>({...W5(),attrs:{}});function Kme(e,t,n,r){let i=(0,I.useMemo)(()=>{let n=K5();return P8(n,t,I8(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};G5(t,e.style,e),i.style={...t,...i.style}}return i}var qme=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function q5(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(qme.indexOf(e)>-1||/[A-Z]/u.test(e))}function Jme(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??q5(e)?Kme:Gme)(t,r,i,e),c=Bme(t,typeof e==`string`,a),l=e===I.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,I.useMemo)(()=>d6(u)?u.get():u,[u]);return(0,I.createElement)(e,{...l,children:d})}function Yme({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Xme(n,r,i,e),renderState:t()}}function Xme(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=g5(a[e]);let{initial:o,animate:s}=e,c=t8(e),l=n8(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Z6(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=i6(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var J5=e=>(t,n)=>{let r=(0,I.useContext)(H5),i=(0,I.useContext)(F2),a=()=>Yme(e,t,r,i);return n?a():Jue(a)},Zme=J5({scrapeMotionValuesFromProps:N8,createRenderState:W5}),Qme=J5({scrapeMotionValuesFromProps:L8,createRenderState:K5}),$me=Symbol.for(`motionComponentSymbol`);function ehe(e,t,n){let r=(0,I.useRef)(n);(0,I.useInsertionEffect)(()=>{r.current=n});let i=(0,I.useRef)(null);return(0,I.useCallback)(n=>{n&&e.onMount?.(n);let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n);t&&(n?t.mount(n):t.unmount())},[t])}var Y5=(0,I.createContext)({});function X5(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function the(e,t,n,r,i,a){let{visualElement:o}=(0,I.useContext)(H5),s=(0,I.useContext)(F5),c=(0,I.useContext)(F2),l=(0,I.useContext)(P5),u=l.reducedMotion,d=l.skipAnimations,f=(0,I.useRef)(null),p=(0,I.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,I.useContext)(Y5);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&nhe(f.current,n,i,h);let g=(0,I.useRef)(!1);(0,I.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[m6],v=(0,I.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return Yue(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,I.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function nhe(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Z5(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&X5(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Z5(e){if(e)return e.options.allowProjection===!1?Z5(e.parent):e.projection}function Q5(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Fme(r);let a=n?n===`svg`:q5(e),o=a?Qme:Zme;function s(n,s){let c,l={...(0,I.useContext)(P5),...n,layoutId:rhe(n)},{isStatic:u}=l,d=Hme(n),f=o(n,u);if(!u&&typeof window<`u`){ihe(l,r);let t=ahe(l);c=t.MeasureLayout,d.visualElement=the(e,f,l,i,t.ProjectionNode,a)}return(0,U.jsxs)(H5.Provider,{value:d,children:[c&&d.visualElement?(0,U.jsx)(c,{visualElement:d.visualElement,...l}):null,Jme(e,n,ehe(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,I.forwardRef)(s);return c[$me]=e,c}function rhe({layoutId:e}){let t=(0,I.useContext)(P2).id;return t&&e!==void 0?t+`-`+e:e}function ihe(e,t){(0,I.useContext)(F5).strict}function ahe(e){let{drag:t,layout:n}=R5();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function ohe(e,t){if(typeof Proxy>`u`)return Q5;let n=new Map,r=(n,r)=>Q5(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Q5(a,void 0,e,t)),n.get(a))})}var she=(e,t)=>t.isSVG??q5(e)?new Bpe(t):new Ppe(t,{allowProjection:e!==I.Fragment}),che=class extends l8{constructor(e){super(e),e.animationState||=Gpe(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Z6(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},lhe=0,uhe={animation:{Feature:che},exit:{Feature:class extends l8{constructor(){super(...arguments),this.id=lhe++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`){let n=a6(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function $5(e){return{point:{x:e.pageX,y:e.pageY}}}var dhe=e=>t=>P6(t)&&e(t,$5(t));function e7(e,t,n,r){return h5(e,t,dhe(n),r)}var t7=({current:e})=>e?e.ownerDocument.defaultView:null,n7=(e,t)=>Math.abs(e-t);function fhe(e,t){let n=n7(e.x,t.x),r=n7(e.y,t.y);return Math.sqrt(n**2+r**2)}var r7=new Set([`auto`,`scroll`]),i7=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=a7(this.lastRawMoveEventInfo,this.transformPagePoint));let e=s7(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=fhe(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=_4;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=a7(t,this.transformPagePoint),h4.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=s7(e.type===`pointercancel`?this.lastMoveEventInfo:a7(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!P6(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=a7($5(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=_4;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,s7(s,this.history)),this.removeListeners=G2(e7(this.contextWindow,`pointermove`,this.handlePointerMove),e7(this.contextWindow,`pointerup`,this.handlePointerUp),e7(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(r7.has(e.overflowX)||r7.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),h4.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),g4(this.updatePoint)}};function a7(e,t){return t?{point:t(e.point)}:e}function o7(e,t){return{x:e.x-t.x,y:e.y-t.y}}function s7({point:e},t){return{point:e,delta:o7(e,c7(t)),offset:o7(e,phe(t)),velocity:mhe(t,.1)}}function phe(e){return e[0]}function c7(e){return e[e.length-1]}function mhe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=c7(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>J2(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>J2(t)*2&&(r=e[1]);let a=Y2(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function hhe(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Z4(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Z4(n,e,r.max):Math.min(e,n)),e}function l7(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function ghe(e,{top:t,left:n,bottom:r,right:i}){return{x:l7(e.x,n,i),y:l7(e.y,t,r)}}function u7(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function _he(e,t){return{x:u7(e.x,t.x),y:u7(e.y,t.y)}}function vhe(e,t){let n=.5,r=q8(e),i=q8(t);return i>r?n=K2(t.min,t.max-r,e.min):r>i&&(n=K2(e.min,e.max-i,t.min)),R2(0,1,n)}function yhe(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var d7=.35;function bhe(e=d7){return e===!1?e=0:e===!0&&(e=d7),{x:f7(e,`left`,`right`),y:f7(e,`top`,`bottom`)}}function f7(e,t,n){return{min:p7(e,t),max:p7(e,n)}}function p7(e,t){return typeof e==`number`?e:e[t]||0}var xhe=new WeakMap,She=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=X6(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor($5(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=$fe(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),l5(e=>{let t=this.getAxisMotionValue(e).get()||0;if(R4.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=q8(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&h4.update(()=>i(e,t),!1,!0),f6(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=whe(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&h4.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new i7(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:t7(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&h4.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!h7(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=hhe(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&X5(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=ghe(n.layoutBox,e):this.constraints=!1,this.elastic=bhe(t),r!==this.constraints&&!X5(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&l5(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=yhe(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!X5(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=Ope(n,r.root,this.visualElement.getTransformPagePoint()),a=_he(r.layout.layoutBox,i);if(t){let e=t(Tpe(a));this.hasMutatedConstraints=!!e,e&&(a=u8(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=l5(o=>{if(!h7(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return f6(this.visualElement,e),n.start(n6(e,n,0,t,this.visualElement,!1))}stopAnimation(){l5(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){l5(t=>{let{drag:n}=this.getProps();if(!h7(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-Z4(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!X5(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};l5(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=vhe({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),l5(t=>{if(!h7(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Z4(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;xhe.set(this.visualElement,this);let e=this.visualElement.current,t=e7(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&ape(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();X5(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Che(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),h4.read(r);let o=h5(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(l5(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=d7,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function m7(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Che(e,t,n){let r=K6(e,m7(n)),i=K6(t,m7(n));return()=>{r(),i()}}function h7(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function whe(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var The=class extends l8{constructor(e){super(e),this.removeGroupControls=W2,this.removeListeners=W2,this.controls=new She(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||W2}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},g7=e=>(t,n)=>{e&&h4.update(()=>e(t,n),!1,!0)},Ehe=class extends l8{constructor(){super(...arguments),this.removePointerDownListener=W2}onPointerDown(e){this.session=new i7(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:t7(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:g7(e),onStart:g7(t),onMove:g7(n),onEnd:(e,t)=>{delete this.session,r&&h4.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=e7(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},_7=!1,Dhe=class extends I.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),_7&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),_5.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),_7=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||h4.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),k6.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;_7=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function v7(e){let[t,n]=Nme(),r=(0,I.useContext)(P2);return(0,U.jsx)(Dhe,{...e,layoutGroup:r,switchLayoutGroup:(0,I.useContext)(Y5),isPresent:t,safeToRemove:n})}var Ohe={pan:{Feature:Ehe},drag:{Feature:The,ProjectionNode:N5,MeasureLayout:v7}};function y7(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&h4.postRender(()=>i(t,$5(t)))}var khe=class extends l8{mount(){let{current:e}=this.node;e&&(this.unmount=tpe(e,(e,t)=>(y7(this.node,t,`Start`),e=>y7(this.node,e,`End`))))}unmount(){}},Ahe=class extends l8{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=G2(h5(this.node.current,`focus`,()=>this.onFocus()),h5(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function b7(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&h4.postRender(()=>i(t,$5(t)))}var jhe=class extends l8{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=spe(e,(e,t)=>(b7(this.node,t,`Start`),(e,{success:t})=>b7(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},x7=new WeakMap,S7=new WeakMap,Mhe=e=>{let t=x7.get(e.target);t&&t(e)},Nhe=e=>{e.forEach(Mhe)};function Phe({root:e,...t}){let n=e||document;S7.has(n)||S7.set(n,{});let r=S7.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Nhe,{root:e,...t})),r[i]}function Fhe(e,t,n){let r=Phe(t);return x7.set(e,n),r.observe(e),()=>{x7.delete(e),r.unobserve(e)}}var Ihe={some:0,all:1},Lhe=class extends l8{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Ihe[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Fhe(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Rhe(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Rhe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var zhe={inView:{Feature:Lhe},tap:{Feature:jhe},focus:{Feature:Ahe},hover:{Feature:khe}},Bhe={layout:{ProjectionNode:N5,MeasureLayout:v7}},Vhe=ohe({...uhe,...zhe,...Ohe,...Bhe},she),C7=new Map,Hhe=e=>{let t=C7.get(e);return t||(t=Vhe.create(e),C7.set(e,t)),t},Uhe=(0,I.memo)(({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2})=>{let a=Hhe(t),o=(0,I.useMemo)(()=>(e?.length??0)*i,[e,i]);return(0,U.jsx)(a,{animate:{backgroundPosition:`0% center`},className:Pg(`relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent`,`[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]`,n),initial:{backgroundPosition:`100% center`},style:{"--spread":`${o}px`,backgroundImage:`var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))`},transition:{duration:r,ease:`linear`,repeat:1/0},children:e})}),w7=(0,I.createContext)(null),Whe=()=>{let e=(0,I.useContext)(w7);if(!e)throw Error(`Reasoning components must be used within Reasoning`);return e},Ghe=1e3,Khe=1e3,T7=(0,I.memo)(({className:e,isStreaming:t=!1,open:n,defaultOpen:r,onOpenChange:i,duration:a,children:o,...s})=>{let c=r??t,l=r===!1,[u,d]=B0({defaultProp:c,onChange:i,prop:n}),[f,p]=B0({defaultProp:void 0,prop:a}),m=(0,I.useRef)(t),[h,g]=(0,I.useState)(!1),_=(0,I.useRef)(null);(0,I.useEffect)(()=>{t?(m.current=!0,_.current===null&&(_.current=Date.now())):_.current!==null&&(p(Math.ceil((Date.now()-_.current)/Khe)),_.current=null)},[t,p]),(0,I.useEffect)(()=>{t&&!u&&!l&&d(!0)},[t,u,d,l]),(0,I.useEffect)(()=>{if(m.current&&!t&&u&&!h){let e=setTimeout(()=>{d(!1),g(!0)},Ghe);return()=>clearTimeout(e)}},[t,u,d,h]);let v=(0,I.useCallback)(e=>{d(e)},[d]),y=(0,I.useMemo)(()=>({duration:f,isOpen:u,isStreaming:t,setIsOpen:d}),[f,u,t,d]);return(0,U.jsx)(w7.Provider,{value:y,children:(0,U.jsx)(j2,{className:Pg(`not-prose mb-4`,e),onOpenChange:v,open:u,...s,children:o})})}),qhe=(e,t)=>e||t===0?(0,U.jsx)(Uhe,{duration:1,children:`Thinking...`}):t===void 0?(0,U.jsx)(`p`,{children:`Thought for a few seconds`}):(0,U.jsxs)(`p`,{children:[`Thought for `,t,` seconds`]}),E7=(0,I.memo)(({className:e,children:t,getThinkingMessage:n=qhe,...r})=>{let{isStreaming:i,isOpen:a,duration:o}=Whe();return(0,U.jsx)(M2,{className:Pg(`flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,e),...r,children:t??(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Zg,{className:`size-4`}),n(i,o),(0,U.jsx)(Qg,{className:Pg(`size-4 transition-transform`,a?`rotate-180`:`rotate-0`)})]})})}),Jhe={cjk:GC,code:ij,math:yM,mermaid:eL},D7=(0,I.memo)(({className:e,children:t,...n})=>(0,U.jsx)(N2,{className:Pg(`mt-4 text-sm`,`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...n,children:(0,U.jsx)(M0,{plugins:Jhe,children:t})}));T7.displayName=`Reasoning`,E7.displayName=`ReasoningTrigger`,D7.displayName=`ReasoningContent`;var Yhe=({className:e,...t})=>(0,U.jsx)(j2,{className:Pg(`not-prose mb-4 text-blue-500 text-xs`,e),...t}),Xhe=({className:e,count:t,children:n,...r})=>(0,U.jsx)(M2,{className:Pg(`flex items-center gap-2`,e),...r,children:n??(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`font-medium`,children:[`Used `,t,` sources`]}),(0,U.jsx)(Qg,{className:`h-4 w-4`})]})}),Zhe=({className:e,...t})=>(0,U.jsx)(N2,{className:Pg(`mt-3 flex w-fit flex-col gap-2`,`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...t}),Qhe=({href:e,title:t,children:n,...r})=>(0,U.jsx)(`a`,{className:`flex items-center gap-2`,href:e,rel:`noreferrer`,target:`_blank`,...r,children:n??(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Xg,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{className:`block font-medium`,children:t})]})}),$he=()=>typeof window>`u`?`none`:`SpeechRecognition`in window||`webkitSpeechRecognition`in window?`speech-recognition`:`MediaRecorder`in window&&`mediaDevices`in navigator?`media-recorder`:`none`,ege=({className:e,onTranscriptionChange:t,onAudioRecorded:n,lang:r=`en-US`,...i})=>{let[a,o]=(0,I.useState)(!1),[s,c]=(0,I.useState)(!1),[l]=(0,I.useState)($he),[u,d]=(0,I.useState)(!1),f=(0,I.useRef)(null),p=(0,I.useRef)(null),m=(0,I.useRef)(null),h=(0,I.useRef)([]),g=(0,I.useRef)(t),_=(0,I.useRef)(n);g.current=t,_.current=n,(0,I.useEffect)(()=>{if(l!==`speech-recognition`)return;let e=new(window.SpeechRecognition||window.webkitSpeechRecognition);e.continuous=!0,e.interimResults=!0,e.lang=r;let t=()=>{o(!0)},n=()=>{o(!1)},i=e=>{let t=e,n=``;for(let e=t.resultIndex;e<t.results.length;e+=1){let r=t.results[e];r.isFinal&&(n+=r[0]?.transcript??``)}n&&g.current?.(n)},a=()=>{o(!1)};return e.addEventListener(`start`,t),e.addEventListener(`end`,n),e.addEventListener(`result`,i),e.addEventListener(`error`,a),f.current=e,d(!0),()=>{e.removeEventListener(`start`,t),e.removeEventListener(`end`,n),e.removeEventListener(`result`,i),e.removeEventListener(`error`,a),e.stop(),f.current=null,d(!1)}},[l,r]),(0,I.useEffect)(()=>()=>{if(p.current?.state===`recording`&&p.current.stop(),m.current)for(let e of m.current.getTracks())e.stop()},[]);let v=(0,I.useCallback)(async()=>{if(_.current)try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});m.current=e;let t=new MediaRecorder(e);h.current=[],t.addEventListener(`dataavailable`,e=>{e.data.size>0&&h.current.push(e.data)}),t.addEventListener(`stop`,async()=>{for(let t of e.getTracks())t.stop();m.current=null;let t=new Blob(h.current,{type:`audio/webm`});if(t.size>0&&_.current){c(!0);try{let e=await _.current(t);e&&g.current?.(e)}catch{}finally{c(!1)}}}),t.addEventListener(`error`,()=>{o(!1);for(let t of e.getTracks())t.stop();m.current=null}),p.current=t,t.start(),o(!0)}catch{o(!1)}},[]),y=(0,I.useCallback)(()=>{p.current?.state===`recording`&&p.current.stop(),o(!1)},[]),b=(0,I.useCallback)(()=>{l===`speech-recognition`&&f.current?a?f.current.stop():f.current.start():l===`media-recorder`&&(a?y():v())},[l,a,v,y]),x=l===`none`||l===`speech-recognition`&&!u||l===`media-recorder`&&!n||s;return(0,U.jsxs)(`div`,{className:`relative inline-flex items-center justify-center`,children:[a&&[0,1,2].map(e=>(0,U.jsx)(`div`,{className:`absolute inset-0 animate-ping rounded-full border-2 border-red-400/30`,style:{animationDelay:`${e*.3}s`,animationDuration:`2s`}},e)),(0,U.jsxs)(Rg,{className:Pg(`relative z-10 rounded-full transition-all duration-300`,a?`bg-destructive text-white hover:bg-destructive/80 hover:text-white`:`bg-primary text-primary-foreground hover:bg-primary/80 hover:text-primary-foreground`,e),disabled:x,onClick:b,...i,children:[s&&(0,U.jsx)(C2,{}),!s&&a&&(0,U.jsx)(c_,{className:`size-4`}),!(s||a)&&(0,U.jsx)(Lee,{className:`size-4`})]})]})},tge=Th(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function nge({className:e,variant:t=`default`,render:n,...r}){return __({defaultTagName:`span`,props:Bm({className:Pg(tge({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var O7=Object.defineProperty,rge=Object.getOwnPropertyDescriptor,ige=Object.getOwnPropertyNames,age=Object.prototype.hasOwnProperty,oge=(e,t)=>{let n={};for(var r in e)O7(n,r,{get:e[r],enumerable:!0});return t||O7(n,Symbol.toStringTag,{value:`Module`}),n},k7=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=ige(t),a=0,o=i.length,s;a<o;a++)s=i[a],!age.call(e,s)&&s!==n&&O7(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=rge(t,s))||r.enumerable});return e},sge=(e,t,n)=>(k7(e,t,`default`),n&&k7(n,t,`default`)),A7=[{id:`abap`,name:`ABAP`,import:(()=>a(()=>import(`./abap-DEw-ytka.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>a(()=>import(`./actionscript-3-NjMaEqxm.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>a(()=>import(`./ada-D1crdu9n.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>a(()=>import(`./angular-html-CN-oUuJC.js`).then(e=>e.n),__vite__mapDeps([179,1,180,181,182])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>a(()=>import(`./angular-ts-CEjZNKjD.js`),__vite__mapDeps([183,179,1,180,181,182,184])))},{id:`apache`,name:`Apache Conf`,import:(()=>a(()=>import(`./apache-BU0c7pjA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>a(()=>import(`./apex-Dz9XKIUc.js`),[]))},{id:`apl`,name:`APL`,import:(()=>a(()=>import(`./apl-DACEo0-x.js`),__vite__mapDeps([185,181,1,180,182,186,187,188])))},{id:`applescript`,name:`AppleScript`,import:(()=>a(()=>import(`./applescript-B5aRViMe.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>a(()=>import(`./ara-C0aUsn4V.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>a(()=>import(`./asciidoc-CQvfQEL9.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>a(()=>import(`./asm-C93Oxq_W.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>a(()=>import(`./astro-HPRMwo6l.js`),__vite__mapDeps([189,181,1,182,186,190,191,192])))},{id:`awk`,name:`AWK`,import:(()=>a(()=>import(`./awk-CNh12CRX.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>a(()=>import(`./ballerina-D8IYaCEW.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>a(()=>import(`./bat-BPVLKtyY.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>a(()=>import(`./beancount-BkCejn-7.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>a(()=>import(`./berry-Ds_94e1p.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>a(()=>import(`./bibtex-DBYHisql.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>a(()=>import(`./bicep-Dda_2XPg.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>a(()=>import(`./bird2-C2d-m_on.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>a(()=>import(`./blade-Bjl4HM5c.js`),__vite__mapDeps([193,181,1,194,180,182,186,195,187,188])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>a(()=>import(`./bsl-B3BrAsEz.js`),__vite__mapDeps([196,197])))},{id:`c`,name:`C`,import:(()=>a(()=>import(`./c-DEubApYE.js`).then(e=>e.n),__vite__mapDeps([198,1])))},{id:`c3`,name:`C3`,import:(()=>a(()=>import(`./c3-BGVpdz6r.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>a(()=>import(`./cadence-868sbukE.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>a(()=>import(`./cairo-L63OfEBR.js`),__vite__mapDeps([199,200])))},{id:`clarity`,name:`Clarity`,import:(()=>a(()=>import(`./clarity-B3UJkPxd.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>a(()=>import(`./clojure-BiUb_Zcv.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>a(()=>import(`./cmake-DN3FQlbu.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>a(()=>import(`./cobol-gniUFOQQ.js`),__vite__mapDeps([201,180,1,181,182,188])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>a(()=>import(`./codeowners-CF76rPWz.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>a(()=>import(`./codeql-OMvyF1Vm.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>a(()=>import(`./coffee-7S08yxyy.js`),__vite__mapDeps([202,182,1])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>a(()=>import(`./common-lisp-BFC6s0Hr.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>a(()=>import(`./coq-nkzDPDXk.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>a(()=>import(`./cpp-BilQwc5N.js`).then(e=>e.n),__vite__mapDeps([203,1,204,198,205,195])))},{id:`crystal`,name:`Crystal`,import:(()=>a(()=>import(`./crystal-DAdHHBqa.js`),__vite__mapDeps([206,198,1,181,180,182,207,195])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>a(()=>import(`./csharp-5rgSmf3e.js`),[]))},{id:`css`,name:`CSS`,import:(()=>a(()=>import(`./css-C3CK0M7i.js`).then(e=>e.n),__vite__mapDeps([181,1])))},{id:`csv`,name:`CSV`,import:(()=>a(()=>import(`./csv-B5Jk7o4Y.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>a(()=>import(`./cue-DB7kMLUQ.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>a(()=>import(`./cypher-1xPoeOFE.js`),[]))},{id:`d`,name:`D`,import:(()=>a(()=>import(`./d-h9rO0PPz.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>a(()=>import(`./dart-w9F20R4Y.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>a(()=>import(`./dax-CeP2uyBs.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>a(()=>import(`./desktop-CaU9spI1.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>a(()=>import(`./diff-B2brsVH-.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>a(()=>import(`./docker-CrOtGssp.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>a(()=>import(`./dotenv-BWO24pQo.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>a(()=>import(`./dream-maker-w9bz-hhe.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>a(()=>import(`./edge-BQAK3QiZ.js`),__vite__mapDeps([208,194,180,1,181,182,192])))},{id:`elixir`,name:`Elixir`,import:(()=>a(()=>import(`./elixir-DKTCBd6g.js`),__vite__mapDeps([209,180,1,181,182])))},{id:`elm`,name:`Elm`,import:(()=>a(()=>import(`./elm-Cjv0Jh-u.js`),__vite__mapDeps([210,204,1,198])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>a(()=>import(`./emacs-lisp-fgKIhTSf.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>a(()=>import(`./erb-K6mwyzz7.js`),__vite__mapDeps([211,180,1,181,182,212,198,203,204,205,195,213,214,191,192,215,216,207,187,188,217])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>a(()=>import(`./erlang-854X-Vkg.js`),__vite__mapDeps([218,219])))},{id:`fennel`,name:`Fennel`,import:(()=>a(()=>import(`./fennel-C9sUWYmM.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>a(()=>import(`./fish-Ckt8YNBH.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>a(()=>import(`./fluent-BvPlpfp_.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>a(()=>import(`./fortran-fixed-form-BlmyIOK8.js`),__vite__mapDeps([220,221])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>a(()=>import(`./fortran-free-form-CI2ch69g.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>a(()=>import(`./fsharp-D3Ezbq1E.js`),__vite__mapDeps([222,219])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>a(()=>import(`./gdresource-BvGFcTeE.js`),__vite__mapDeps([223,224,225])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>a(()=>import(`./gdscript-Cn_fDlI9.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>a(()=>import(`./gdshader-DLLpHgjs.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>a(()=>import(`./genie-C_vhHuW2.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>a(()=>import(`./gherkin-bcEcwbQE.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>a(()=>import(`./git-commit-ByANLFBY.js`),__vite__mapDeps([226,227])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>a(()=>import(`./git-rebase-Gmx06j0y.js`),__vite__mapDeps([228,207,1])))},{id:`gleam`,name:`Gleam`,import:(()=>a(()=>import(`./gleam-Blb-3EAI.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>a(()=>import(`./glimmer-js-CNdBQpaG.js`),__vite__mapDeps([229,181,1,180,182,192])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>a(()=>import(`./glimmer-ts-CVzFNZoD.js`),__vite__mapDeps([230,181,1,180,182,192])))},{id:`glsl`,name:`GLSL`,import:(()=>a(()=>import(`./glsl-CC87e7NK.js`).then(e=>e.n),__vite__mapDeps([204,1,198])))},{id:`gn`,name:`GN`,import:(()=>a(()=>import(`./gn-eXxL0uTU.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>a(()=>import(`./gnuplot-DR6sSoUN.js`),[]))},{id:`go`,name:`Go`,import:(()=>a(()=>import(`./go-8OtLvWbL.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>a(()=>import(`./graphql-DAjFE8Zq.js`).then(e=>e.n),__vite__mapDeps([213,1,182,214,191,192])))},{id:`groovy`,name:`Groovy`,import:(()=>a(()=>import(`./groovy-Cq9dX6D8.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>a(()=>import(`./hack-C8GWHc9h.js`),__vite__mapDeps([231,180,1,181,182,195])))},{id:`haml`,name:`Ruby Haml`,import:(()=>a(()=>import(`./haml-CaM4dYj1.js`).then(e=>e.n),__vite__mapDeps([215,1,181,182])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>a(()=>import(`./handlebars-DjNwk9Sx.js`),__vite__mapDeps([232,181,1,180,182,217])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>a(()=>import(`./haskell-zlo0doPn.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>a(()=>import(`./haxe-DPy34i1e.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>a(()=>import(`./hcl-AXfIfXWb.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>a(()=>import(`./hjson-Dzh0r5YU.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>a(()=>import(`./hlsl-hBgRvA5h.js`),[]))},{id:`html`,name:`HTML`,import:(()=>a(()=>import(`./html-D8iPLU6I.js`).then(e=>e.n),__vite__mapDeps([180,1,181,182])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>a(()=>import(`./html-derivative-DqiucELS.js`),__vite__mapDeps([194,180,1,181,182])))},{id:`http`,name:`HTTP`,import:(()=>a(()=>import(`./http-DpYDdgnl.js`),__vite__mapDeps([233,213,1,182,214,191,192,186,207,187,188])))},{id:`hurl`,name:`Hurl`,import:(()=>a(()=>import(`./hurl-CcMs5xSG.js`),__vite__mapDeps([234,235,213,1,182,214,191,192,187,188])))},{id:`hxml`,name:`HXML`,import:(()=>a(()=>import(`./hxml-os4YOtH3.js`),__vite__mapDeps([236,237])))},{id:`hy`,name:`Hy`,import:(()=>a(()=>import(`./hy-6di7IE4u.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>a(()=>import(`./imba-BuBsAMVd.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>a(()=>import(`./ini-D-53CZkr.js`),[]))},{id:`java`,name:`Java`,import:(()=>a(()=>import(`./java-VNxxuvqq.js`).then(e=>e.n),__vite__mapDeps([188,1])))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>a(()=>import(`./javascript-DAbF-03M.js`).then(e=>e.n),__vite__mapDeps([182,1])))},{id:`jinja`,name:`Jinja`,import:(()=>a(()=>import(`./jinja-KAOzhQ3w.js`),__vite__mapDeps([238,180,1,181,182])))},{id:`jison`,name:`Jison`,import:(()=>a(()=>import(`./jison-DW7mGPaf.js`),__vite__mapDeps([239,182,1])))},{id:`json`,name:`JSON`,import:(()=>a(()=>import(`./json-DAgnK7sT.js`).then(e=>e.n),__vite__mapDeps([186,1])))},{id:`json5`,name:`JSON5`,import:(()=>a(()=>import(`./json5-dkZg0_kE.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>a(()=>import(`./jsonc-CNyHPesk.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>a(()=>import(`./jsonl--hQ-PkQH.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>a(()=>import(`./jsonnet-C2u49LY7.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>a(()=>import(`./jssm-BoaFqeIP.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>a(()=>import(`./jsx-IPXvK94g.js`).then(e=>e.n),__vite__mapDeps([214,1])))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>a(()=>import(`./julia-CZ7LtBOW.js`),__vite__mapDeps([240,203,1,204,198,205,195,182,200,241])))},{id:`just`,name:`Just`,import:(()=>a(()=>import(`./just-C4ZEGXKz.js`),__vite__mapDeps([242,182,1,243,181,180,195,187,188,200,212,198,203,204,205,213,214,191,192,215,216,207,217])))},{id:`kdl`,name:`KDL`,import:(()=>a(()=>import(`./kdl-CLgDL0sU.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>a(()=>import(`./kotlin-CcI5qkQD.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>a(()=>import(`./kusto-8mcDZBBR.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>a(()=>import(`./latex-D5mgYlGy.js`),__vite__mapDeps([244,245,241,1])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>a(()=>import(`./lean-YSuPS8ym.js`),[]))},{id:`less`,name:`Less`,import:(()=>a(()=>import(`./less-B3Az5CZP.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>a(()=>import(`./liquid-dGJBZQSH.js`),__vite__mapDeps([246,181,1,180,182,186])))},{id:`llvm`,name:`LLVM IR`,import:(()=>a(()=>import(`./llvm-BqFhFWyI.js`),[]))},{id:`log`,name:`Log file`,import:(()=>a(()=>import(`./log-Dr_xZn5E.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>a(()=>import(`./logo-BV0NClW5.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>a(()=>import(`./lua-NRA7hr4c.js`).then(e=>e.n),__vite__mapDeps([216,1,198])))},{id:`luau`,name:`Luau`,import:(()=>a(()=>import(`./luau-x-CHBZ0g.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>a(()=>import(`./make-DcWco_Qw.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>a(()=>import(`./markdown-BUyNNbS6.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>a(()=>import(`./marko-BnzvVMtv.js`),__vite__mapDeps([247,181,1,248,184,192])))},{id:`matlab`,name:`MATLAB`,import:(()=>a(()=>import(`./matlab-DW67WroE.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>a(()=>import(`./mdc-C2AkezyX.js`),__vite__mapDeps([249,194,180,1,181,182,219,217])))},{id:`mdx`,name:`MDX`,import:(()=>a(()=>import(`./mdx-Z80sy4I9.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>a(()=>import(`./mermaid-CnxxpbD1.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>a(()=>import(`./mipsasm-IHm8ER3C.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>a(()=>import(`./mojo-B1Vcym8n.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>a(()=>import(`./moonbit-4Y6qx4j9.js`),[]))},{id:`move`,name:`Move`,import:(()=>a(()=>import(`./move-BtPkCJ_n.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>a(()=>import(`./narrat-CwtsVw7-.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>a(()=>import(`./nextflow-COAS20q4.js`),__vite__mapDeps([250,251])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>a(()=>import(`./nextflow-groovy-CaPjvDOT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>a(()=>import(`./nginx-DogIU8Cr.js`),__vite__mapDeps([252,216,1,198])))},{id:`nim`,name:`Nim`,import:(()=>a(()=>import(`./nim-BMEfrxHp.js`),__vite__mapDeps([253,198,1,181,204,180,182,219,187,188])))},{id:`nix`,name:`Nix`,import:(()=>a(()=>import(`./nix-CvR_GVC9.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>a(()=>import(`./nushell-D4b0tHF-.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>a(()=>import(`./objective-c-BhGioKrL.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>a(()=>import(`./objective-cpp-BLKar0pv.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>a(()=>import(`./ocaml-D0dsKWvb.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>a(()=>import(`./odin-D9IfAld1.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>a(()=>import(`./openscad-x13QaAE3.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>a(()=>import(`./pascal-DuK9-mcX.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>a(()=>import(`./perl-CuqDFkdl.js`),__vite__mapDeps([243,181,1,180,182,195,187,188])))},{id:`php`,name:`PHP`,import:(()=>a(()=>import(`./php--PLUnv1_.js`),__vite__mapDeps([254,181,1,180,182,186,195,187,188])))},{id:`pkl`,name:`Pkl`,import:(()=>a(()=>import(`./pkl-CoKgcBV-.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>a(()=>import(`./plsql-XFmIdksZ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>a(()=>import(`./po-CWJgkWXW.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>a(()=>import(`./polar-DlPElveM.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>a(()=>import(`./postcss-9eGaqiLc.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>a(()=>import(`./powerquery-x3mZ5MQU.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>a(()=>import(`./powershell-BCDN19c9.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>a(()=>import(`./prisma-BPW6poE8.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>a(()=>import(`./prolog-CB2XGB07.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>a(()=>import(`./proto-BTArYX0j.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>a(()=>import(`./pug-D0RI5zMQ.js`),__vite__mapDeps([255,181,1,180,182])))},{id:`puppet`,name:`Puppet`,import:(()=>a(()=>import(`./puppet-Dwd-hIPC.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>a(()=>import(`./purescript-DzoEGt8C.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>a(()=>import(`./python-DpfQVtm0.js`),[]))},{id:`qml`,name:`QML`,import:(()=>a(()=>import(`./qml-oj8IuGxt.js`),__vite__mapDeps([256,182,1])))},{id:`qmldir`,name:`QML Directory`,import:(()=>a(()=>import(`./qmldir-DVsXRUzL.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>a(()=>import(`./qss-8ppOmHia.js`),[]))},{id:`r`,name:`R`,import:(()=>a(()=>import(`./r-dds2hvQq.js`).then(e=>e.n),__vite__mapDeps([241,1])))},{id:`racket`,name:`Racket`,import:(()=>a(()=>import(`./racket-CvRAM5cP.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>a(()=>import(`./raku-DSTlUG-i.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>a(()=>import(`./razor-2QM_kJd8.js`),__vite__mapDeps([257,258,180,1,181,182])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>a(()=>import(`./reg-BveEAlQW.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>a(()=>import(`./regexp-Bi9ZWB-y.js`).then(e=>e.n),__vite__mapDeps([205,1])))},{id:`rel`,name:`Rel`,import:(()=>a(()=>import(`./rel-DlPHYNcG.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>a(()=>import(`./riscv-70WeVC60.js`),[]))},{id:`ron`,name:`RON`,import:(()=>a(()=>import(`./ron-Dr6stZ6D.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>a(()=>import(`./rosmsg-BWp7x_Yo.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>a(()=>import(`./rst-D68_Abm0.js`),__vite__mapDeps([259,260,203,1,204,198,205,195,194,180,181,182,200,212,213,214,191,192,215,216,207,187,188,217])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>a(()=>import(`./ruby-CNbgP4lj.js`),__vite__mapDeps([212,198,1,203,204,205,195,181,213,182,214,191,192,215,180,216,207,187,188,217])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>a(()=>import(`./rust-DmXiP9xS.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>a(()=>import(`./sas-DNzvYLSr.js`),__vite__mapDeps([261,195,1])))},{id:`sass`,name:`Sass`,import:(()=>a(()=>import(`./sass-C8B5PQzu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>a(()=>import(`./scala-CZCYk8u9.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>a(()=>import(`./scheme-DBEzYfU2.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>a(()=>import(`./scss-BzL89aQS.js`).then(e=>e.n),__vite__mapDeps([184,1,181])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>a(()=>import(`./sdbl-CDokzS_i.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>a(()=>import(`./shaderlab-DdzrHzhQ.js`),__vite__mapDeps([262,263])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>a(()=>import(`./shellscript--2FuAbxC.js`).then(e=>e.n),__vite__mapDeps([207,1])))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>a(()=>import(`./shellsession-BaLMs3ov.js`),__vite__mapDeps([264,207,1])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>a(()=>import(`./smalltalk-BkSQfDKo.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>a(()=>import(`./solidity-DDsgmJO_.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>a(()=>import(`./soy-BhlV2IGI.js`),__vite__mapDeps([265,180,1,181,182])))},{id:`sparql`,name:`SPARQL`,import:(()=>a(()=>import(`./sparql-Is31kmha.js`),__vite__mapDeps([266,267])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>a(()=>import(`./splunk-sNBddUhj.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>a(()=>import(`./sql-CxglZSwu.js`).then(e=>e.n),__vite__mapDeps([195,1])))},{id:`ssh-config`,name:`SSH Config`,import:(()=>a(()=>import(`./ssh-config-DljnCiku.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>a(()=>import(`./stata-DZdYbt2n.js`),__vite__mapDeps([268,195,1])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>a(()=>import(`./stylus-B1u-SVqg.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>a(()=>import(`./surrealql-_wgtTEYI.js`),__vite__mapDeps([269,182,1])))},{id:`svelte`,name:`Svelte`,import:(()=>a(()=>import(`./svelte-CTPa36az.js`),__vite__mapDeps([270,181,1,182,190,192])))},{id:`swift`,name:`Swift`,import:(()=>a(()=>import(`./swift-CpkbKxtz.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>a(()=>import(`./system-verilog-YtSwQtDx.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>a(()=>import(`./systemd-B3FEWukQ.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>a(()=>import(`./talonscript-DLkEwr9f.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>a(()=>import(`./tasl-CbNn5YSS.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>a(()=>import(`./tcl-Cc88vQv_.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>a(()=>import(`./templ-CT6Esmfg.js`),__vite__mapDeps([271,181,1,272,182])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>a(()=>import(`./terraform-D3suSl1o.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>a(()=>import(`./tex-fm1tDdhM.js`),__vite__mapDeps([245,241,1])))},{id:`toml`,name:`TOML`,import:(()=>a(()=>import(`./toml-CQXSrY1Z.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>a(()=>import(`./ts-tags-Dw0RLmha.js`),__vite__mapDeps([273,181,1,204,198,180,182,195,192,187,188])))},{id:`tsv`,name:`TSV`,import:(()=>a(()=>import(`./tsv-CYOtlnGo.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>a(()=>import(`./tsx-BMhIw2y-.js`).then(e=>e.n),__vite__mapDeps([191,1])))},{id:`turtle`,name:`Turtle`,import:(()=>a(()=>import(`./turtle-DaqgDcgI.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>a(()=>import(`./twig-DtNCkasW.js`),__vite__mapDeps([274,181,1,182,254,180,186,195,187,188,200,212,198,203,204,205,213,214,191,192,215,216,207,217,184])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>a(()=>import(`./typescript-DKzlP5dN.js`).then(e=>e.n),__vite__mapDeps([192,1])))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>a(()=>import(`./typespec-CqtvXhCU.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>a(()=>import(`./typst-CGFEhtpU.js`),[]))},{id:`v`,name:`V`,import:(()=>a(()=>import(`./v-CGfJwJMp.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>a(()=>import(`./vala-IHBtelZF.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>a(()=>import(`./vb-CVD1JgU5.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>a(()=>import(`./verilog-C79KE1ci.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>a(()=>import(`./vhdl-Bn48Xzza.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>a(()=>import(`./viml-CSjTTzvj.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>a(()=>import(`./vue-CRmOVaU2.js`),__vite__mapDeps([275,181,1,194,180,182,186,192])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>a(()=>import(`./vue-html-BdZhxJqn.js`),__vite__mapDeps([276,182,1])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>a(()=>import(`./vue-vine-6M9IMSQp.js`),__vite__mapDeps([277,181,1,182,248,190,184,278])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>a(()=>import(`./vyper-ByfJ9Fje.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>a(()=>import(`./wasm-BCgaravS.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>a(()=>import(`./wenyan-De6g53Ja.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>a(()=>import(`./wgsl-DVJ4AWGL.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>a(()=>import(`./wikitext-BrMlYwxZ.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>a(()=>import(`./wit-jK5SFqgt.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>a(()=>import(`./wolfram-DVVu5yAi.js`),[]))},{id:`xml`,name:`XML`,import:(()=>a(()=>import(`./xml-BdbcNzO9.js`).then(e=>e.n),__vite__mapDeps([187,1,188])))},{id:`xsl`,name:`XSL`,import:(()=>a(()=>import(`./xsl-B8fg-QX6.js`),__vite__mapDeps([279,187,1,188])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>a(()=>import(`./yaml-jjteOoGO.js`).then(e=>e.n),__vite__mapDeps([217,1])))},{id:`zenscript`,name:`ZenScript`,import:(()=>a(()=>import(`./zenscript-B8t7M3X2.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>a(()=>import(`./zig-GK7ZbXfj.js`),[]))}],cge=Object.fromEntries(A7.map(e=>[e.id,e.import])),lge=Object.fromEntries(A7.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),uge={...cge,...lge},dge=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>a(()=>import(`./andromeeda-wUNV-8VH.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>a(()=>import(`./aurora-x-CClALSli.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>a(()=>import(`./ayu-dark-BSs4jHdS.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>a(()=>import(`./ayu-light-BDzoPUuB.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>a(()=>import(`./ayu-mirage-BjsUJrUc.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>a(()=>import(`./catppuccin-frappe-DLHLTCnF.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>a(()=>import(`./catppuccin-latte-DfCS_kJi.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>a(()=>import(`./catppuccin-macchiato-CR9A3_vc.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>a(()=>import(`./catppuccin-mocha-BSuJX63a.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>a(()=>import(`./dark-plus-C9X5Ve1L.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>a(()=>import(`./dracula-9O0NCT_h.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>a(()=>import(`./dracula-soft-C4h6XVJR.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>a(()=>import(`./everforest-dark-DC3iWRDz.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>a(()=>import(`./everforest-light-CIhs5wLb.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>a(()=>import(`./github-dark-DbXvKwaC.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>a(()=>import(`./github-dark-default-CobA03O1.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>a(()=>import(`./github-dark-dimmed-cxsH--DX.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>a(()=>import(`./github-dark-high-contrast-BjBB0JIk.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>a(()=>import(`./github-light-BE6sxIlE.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>a(()=>import(`./github-light-default-BNWs7XBL.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>a(()=>import(`./github-light-high-contrast-_RqafDwE.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>a(()=>import(`./gruvbox-dark-hard-DIiVjZ5v.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>a(()=>import(`./gruvbox-dark-medium-DDpVVAoZ.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>a(()=>import(`./gruvbox-dark-soft-o4E3Pbzg.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>a(()=>import(`./gruvbox-light-hard-D56454Fb.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>a(()=>import(`./gruvbox-light-medium-DiAMHDHG.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>a(()=>import(`./gruvbox-light-soft-DWYGGtE_.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>a(()=>import(`./horizon-40XnmAci.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>a(()=>import(`./horizon-bright-BbxOSClf.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>a(()=>import(`./houston-eZ8K4Kfk.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>a(()=>import(`./kanagawa-dragon-ZyI_KSxZ.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>a(()=>import(`./kanagawa-lotus-DPGGEFqt.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>a(()=>import(`./kanagawa-wave-BqT6GPCS.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>a(()=>import(`./laserwave-yHjXA698.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>a(()=>import(`./light-plus-CH089YvG.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>a(()=>import(`./material-theme-Bn5FQdaE.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>a(()=>import(`./material-theme-darker-B9rNV8V7.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>a(()=>import(`./material-theme-lighter-DiWQEMXo.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>a(()=>import(`./material-theme-ocean-DPoMg1Fu.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>a(()=>import(`./material-theme-palenight-CBBN6ELt.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>a(()=>import(`./min-dark-B_mocbvq.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>a(()=>import(`./min-light-BBSRoOCs.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>a(()=>import(`./monokai-O7aGo9VP.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>a(()=>import(`./night-owl-DPwAj-n1.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>a(()=>import(`./night-owl-light-CtFoG9Ch.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>a(()=>import(`./nord-4tR4EUY1.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>a(()=>import(`./one-dark-pro-oX5X9zOn.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>a(()=>import(`./one-light-DwurTX9w.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>a(()=>import(`./plastic-DIfRaaE3.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>a(()=>import(`./poimandres-CB89Guv8.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>a(()=>import(`./red-Re2PfUSD.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>a(()=>import(`./rose-pine-D8VgsokP.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>a(()=>import(`./rose-pine-dawn-D7EM3AW3.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>a(()=>import(`./rose-pine-moon-CjVxzuAw.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>a(()=>import(`./slack-dark-2MJp1HDM.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>a(()=>import(`./slack-ochin-CsJ-XTso.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>a(()=>import(`./snazzy-light-Camp4WtP.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>a(()=>import(`./solarized-dark-DDu7grB1.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>a(()=>import(`./solarized-light-BYMct7jG.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>a(()=>import(`./synthwave-84-DPp_gDgI.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>a(()=>import(`./tokyo-night-CjFWOaYp.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>a(()=>import(`./vesper-7jKoPtxy.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>a(()=>import(`./vitesse-black-DaToSKPE.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>a(()=>import(`./vitesse-dark-DSPFdD5i.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>a(()=>import(`./vitesse-light-CRe2ZnfQ.js`),[]))}].map(e=>[e.id,e.import])),fge=r({createOnigurumaEngine:()=>Age,getDefaultWasmLoader:()=>kge,loadWasm:()=>R7,setDefaultWasmLoader:()=>Oge}),j7=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function pge(){return 2147483648}function mge(){return typeof performance<`u`?performance.now():Date.now()}var hge=(e,t)=>e+(t-e%t)%t;async function gge(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=pge();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,hge(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:mge,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 _ge=Object.defineProperty,vge=(e,t,n)=>t in e?_ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M7=(e,t,n)=>vge(e,typeof t==`symbol`?t:t+``,n),N7=null;function yge(e){throw new j7(e.UTF8ToString(e.getLastOnigError()))}var P7=class e{constructor(t){M7(this,`utf16Length`),M7(this,`utf8Length`),M7(this,`utf16Value`),M7(this,`utf8Value`),M7(this,`utf16OffsetToUtf8`),M7(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)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},F7=class e{constructor(t){if(M7(this,`id`,++e.LAST_ID),M7(this,`_onigBinding`),M7(this,`content`),M7(this,`utf16Length`),M7(this,`utf8Length`),M7(this,`utf16OffsetToUtf8`),M7(this,`utf8OffsetToUtf16`),M7(this,`ptr`),!N7)throw new j7(`Must invoke loadWasm first.`);this._onigBinding=N7,this.content=t;let n=new P7(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=N7.omalloc(1e4),e._sharedPtrInUse=!0,N7.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(N7)}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)}};M7(F7,`LAST_ID`,0),M7(F7,`_sharedPtr`,0),M7(F7,`_sharedPtrInUse`,!1);var I7=F7,bge=class{constructor(e){if(M7(this,`_onigBinding`),M7(this,`_ptr`),!N7)throw new j7(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new P7(e[r]);t[r]=i.createString(N7),n[r]=i.utf8Length}let r=N7.omalloc(4*e.length);N7.HEAPU32.set(t,r/4);let i=N7.omalloc(4*e.length);N7.HEAPU32.set(n,i/4);let a=N7.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)N7.ofree(t[n]);N7.ofree(i),N7.ofree(r),a===0&&yge(N7),this._onigBinding=N7,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 I7(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 xge(e){return typeof e.instantiator==`function`}function Sge(e){return typeof e.default==`function`}function Cge(e){return e.data!==void 0}function wge(e){return typeof Response<`u`&&e instanceof Response}function Tge(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 L7;function R7(e){if(L7)return L7;async function t(){N7=await gge(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),xge(n)?n=await n.instantiator(t):Sge(n)?n=await n.default(t):(Cge(n)&&(n=n.data),wge(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await Ege(n)(t):await Dge(n)(t):Tge(n)||n instanceof WebAssembly.Module?n=await z7(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await z7(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return L7=t(),L7}function z7(e){return t=>WebAssembly.instantiate(e,t)}function Ege(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Dge(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var B7;function Oge(e){B7=e}function kge(){return B7}async function Age(e){return e&&await R7(e),{createScanner(e){return new bge(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new I7(e)}}}var V7=oge({});sge(V7,fge);var H7=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function U7(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 W7(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function jge(e){return Array.isArray(e)?e:[e]}async function G7(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function K7(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function q7(e){return e===`ansi`||K7(e)}function J7(e){return e===`none`}function Y7(e){return J7(e)}function X7(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(/(\r?\n)/g),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 Z7={light:`#333333`,dark:`#bbbbbb`},Q7={light:`#fffffe`,dark:`#1e1e1e`},$7=`__shiki_resolved`;function e9(e){if(e?.[$7])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`?Z7.light:Z7.dark,n||=t.type===`light`?Q7.light:Q7.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,$7,{enumerable:!1,writable:!1,value:!0}),t}async function t9(e){return Array.from(new Set((await Promise.all(e.filter(e=>!q7(e)).map(async e=>await G7(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function n9(e){return(await Promise.all(e.map(async e=>Y7(e)?null:e9(await G7(e))))).filter(e=>!!e)}function r9(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 H7(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Mge=class extends Vw{_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=e9(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=rw.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=r9(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=Array.from(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 H7(`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))}},Nge=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}},i9=0;function Pge(e){i9+=1,e.warnings!==!1&&i9>=10&&i9%10==0&&console.warn(`[Shiki] ${i9} 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 H7("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(e9),i=new Mge(new Nge(e.engine,n),r,n,e.langAlias),a;function o(t){return r9(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new H7(`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 H7(`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 t9(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await n9(e))}function g(){if(t)throw new H7(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--i9)}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 Fge(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([n9(e.themes||[]),t9(e.langs||[]),e.engine]);return Pge({...e,themes:t,langs:n,engine:r})}var a9=new WeakMap;function o9(e,t){a9.set(e,t)}function s9(e){return a9.get(e)}var c9=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(jge(n).map(e=>[e,Hw])),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 Ige(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Ige(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 Lge(e,t){if(!(e instanceof c9))throw new H7(`Invalid grammar state`);return e.getInternalStack(t)}function l9(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(K7(e.resolveLangAlias(n.lang||`text`))||J7(r))return X7(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 H7(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new H7(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return zge(t,o,i,a,n)}function Rge(...e){if(e.length===2)return s9(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(K7(i)||J7(a))throw new H7(`Plain language does not have grammar state`);if(i===`ansi`)throw new H7(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new c9(u9(n,c,o,s,r).stateStack,c.name,o.name)}function zge(e,t,n,r,i){let a=u9(e,t,n,r,i),o=new c9(a.stateStack,t.name,n.name);return o9(a.tokens,o),a.tokens}function u9(e,t,n,r,i){let a=U7(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=X7(e),l=i.grammarState?Lge(i.grammarState,n.name)??Hw:i.grammarContextCode==null?Hw:u9(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,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]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=W7(r[cw.getForeground(s)],a),l=cw.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(/,/).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?Bge(t.scopes):Vge(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function Bge(e){return e.map(e=>({scopeName:e}))}function Vge(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Uge(e,i,t.slice(0,r))}}return n}function d9(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Hge(e,t,n){if(!d9(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)d9(e[r],n[i])&&--r,--i;return r===-1}function Uge(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Hge(e,t,n)){r.push(a);break}return r}function f9(e,t,n,r=l9){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:s9(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Wge(...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 c9(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&o9(s,c),s}function Wge(...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}function p9(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function Gge(e){let t=X7(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function Kge(e,t,n){let r=new Set;for(let t of e.matchAll(/:?lang=["']([^"']+)["']/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/(?:```|~~~)([\w-]+)/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/\\begin\{([\w-]+)\}/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return Array.from(r);let i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}var m9=`light-dark()`,qge=[`color`,`background-color`];function Jge(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Yge(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?Jge(e,t):e})):e}function Xge(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>h9(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&qge.includes(a))if(r===m9&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new H7('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[a]=`light-dark(${o[e][a]||`inherit`}, ${o[r][a]||`inherit`})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s;else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function h9(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&ow.Italic&&(t[`font-style`]=`italic`),e.fontStyle&ow.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&ow.Underline&&n.push(`underline`),e.fontStyle&ow.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function g9(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function Zge(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=Gge(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new H7(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}else{let t=n.lines[e.line];if(t===void 0)throw new H7(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new H7(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));Qge(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return Yge(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new H7(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=_9(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new H7(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new H7(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&p9(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function Qge(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new H7(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new H7(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function _9(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(_9).join(``):``}var $ge=[Zge()];function v9(e){let t=e_e(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...$ge]}function e_e(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var y9=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],b9={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function t_e(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function x9(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function n_e(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:`resetAll`});else if(r<=9)b9[r]&&t.push({type:`setDecoration`,value:b9[r]});else if(r<=29){let e=b9[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:y9[r-30]}});else if(r===38){let n=x9(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:y9[r-40]}});else if(r===48){let n=x9(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:y9[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:y9[r-100+8]}})}return t}function r_e(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=t_e(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=n_e(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var i_e={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function a_e(e=i_e){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<y9.length;e++)r.push(t(y9[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var o_e={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function s_e(e,t,n){let r=U7(e,n),i=X7(t),a=a_e(Object.fromEntries(y9.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||o_e[t]]}))),o=r_e();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=W7(i,r),o=W7(o,r),n.decorations.has(`dim`)&&(i=c_e(i));let s=ow.None;return n.decorations.has(`bold`)&&(s|=ow.Bold),n.decorations.has(`italic`)&&(s|=ow.Italic),n.decorations.has(`underline`)&&(s|=ow.Underline),n.decorations.has(`strikethrough`)&&(s|=ow.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function c_e(e){let t=e.match(/#([0-9a-f]{3,8})/i);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}else if(e.length===6)return`#${e}80`;else if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}else if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function S9(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!K7(r)&&!J7(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return s_e(r,t,n)}return l9(e,t,n)}function C9(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new H7("`themes` option must not be empty");let p=f9(e,t,n,S9);if(c=s9(p),l&&m9!==l&&!f.find(e=>e.color===l))throw new H7(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>Xge(e,h,u,l,d))),c&&o9(a,c);let g=f.map(e=>U7(e.theme,n));i=w9(f,m,g,u,l,`fg`,d),r=w9(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=U7(n.theme,n);a=S9(e,t,n);let l=e.getTheme(n.theme);r=W7(l.bg,s),i=W7(l.fg,s),o=l.name,c=s9(a)}else throw new H7("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function w9(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=W7(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===m9&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new H7('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${W7(t[r][a],n[r])||`inherit`}, ${W7(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}function T9(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>T9(e,t,n),codeToTokens:(t,n)=>C9(e,t,n)}){let i=t;for(let e of v9(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=C9(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=u_e(a):d===`never`&&(a=d_e(a)),f&&(a=f_e(a));let p={...r,get source(){return i}};for(let e of v9(n))a=e.tokens?.call(p,a)||a;return l_e(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function l_e(e,t,n,r=s9(e)){let i=v9(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:p9,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
511
|
+
`})}return n},rle=/([\\`*_~[\]|])/g,ile=e=>e.replace(rle,`\\$1`),ale=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>t+ile(n).replace(/\n\n/g,` `)+r)}return n},w0=e=>e.type===`text`?e.value:`children`in e&&Array.isArray(e.children)?e.children.map(w0).join(``):``,ole=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(e=>e.toLowerCase()));WC(t,`element`,e=>{if(n.has(e.tagName.toLowerCase())){let t=w0(e);e.children=t?[{type:`text`,value:t}]:[]}})},sle=()=>e=>{WC(e,`code`,e=>{e.meta&&(e.data=e.data??{},e.data.hProperties={...e.data.hProperties??{},metastring:e.meta})})},cle=/^[ \t]*<[\w!/?-]/,lle=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,ule=e=>typeof e!=`string`||e.length===0||!cle.test(e)?e:e.replace(lle,`$1`),T0={...IV,protocols:{...IV.protocols,href:[...IV.protocols?.href??[],`tel`]},attributes:{...IV.attributes,code:[...IV.attributes?.code??[],`metastring`]}},E0={raw:PV,sanitize:[$V,T0],harden:[Zse,{allowedImagePrefixes:[`*`],allowedLinkPrefixes:[`*`],allowedProtocols:[`*`],defaultOrigin:void 0,allowDataImages:!0}]},dle={gfm:[ZK,{}],codeMeta:sle},D0=Object.values(E0),fle=Object.values(dle),ple={block:` ▋`,circle:` ●`},O0=[`github-light`,`github-dark`],k0={enabled:!0},A0=(0,I.createContext)({shikiTheme:O0,controls:!0,isAnimating:!1,lineNumbers:!0,mode:`streaming`,mermaid:void 0,linkSafety:k0}),j0=(0,I.memo)(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:a,animatePlugin:o,...s})=>{if(o){let e=o.getLastRenderCharCount();o.setPrevContentLength(e)}let c=typeof e==`string`&&n?ule(e):e,l=(0,U.jsx)(_0,{...s,children:c});return(0,U.jsx)(w$.Provider,{value:i,children:a?(0,U.jsx)(`div`,{dir:a,style:{display:`contents`},children:l}):l})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(n=>e.components?.[n]!==t.components?.[n]))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});j0.displayName=`Block`;var M0=(0,I.memo)(({children:e,mode:t=`streaming`,dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:a,rehypePlugins:o=D0,remarkPlugins:s=fle,className:c,shikiTheme:l=O0,mermaid:u,controls:d=!0,isAnimating:f=!1,animated:p,BlockComponent:m=j0,parseMarkdownIntoBlocksFn:h=tle,caret:g,plugins:_,remend:v,linkSafety:y=k0,lineNumbers:b=!0,allowedTags:x,literalTagContent:S,translations:C,icons:w,prefix:T,onAnimationStart:E,onAnimationEnd:D,...O})=>{let k=(0,I.useId)(),[A,j]=(0,I.useTransition)(),M=(0,I.useMemo)(()=>O$(T),[T]),N=(0,I.useRef)(null),P=(0,I.useRef)(E),ee=(0,I.useRef)(D);P.current=E,ee.current=D,(0,I.useEffect)(()=>{var e,n,r;if(t===`static`)return;let i=N.current;if(N.current=f,i===null){f&&((e=P.current)==null||e.call(P));return}f&&!i?(n=P.current)==null||n.call(P):!f&&i&&((r=ee.current)==null||r.call(ee))},[f,t]);let F=(0,I.useMemo)(()=>x?Object.keys(x):[],[x]),te=(0,I.useMemo)(()=>{if(typeof e!=`string`)return``;let n=t===`streaming`&&r?AJ(e,v):e;return S&&S.length>0&&(n=ale(n,S)),F.length>0&&(n=nle(n,F)),n},[e,t,r,v,F,S]),ne=(0,I.useMemo)(()=>h(te),[te,h]),[re,ie]=(0,I.useState)(ne);(0,I.useEffect)(()=>{t===`streaming`&&!le?j(()=>{ie(ne)}):ie(ne)},[ne,t]);let ae=t===`streaming`?re:ne,oe=(0,I.useMemo)(()=>n===`auto`?ae.map(s0):void 0,[ae,n]),se=(0,I.useMemo)(()=>ae.map((e,t)=>`${k}-${t}`),[ae.length,k]),ce=(0,I.useMemo)(()=>p===!0?`true`:p?JSON.stringify(p):``,[p]),le=(0,I.useMemo)(()=>ce?ce===`true`?C$():C$(p):null,[ce]),ue=(0,I.useMemo)(()=>({shikiTheme:(_?.code)?.getThemes()??l,controls:d,isAnimating:f,lineNumbers:b,mode:t,mermaid:u,linkSafety:y}),[l,d,f,b,t,u,y,_?.code]),de=(0,I.useMemo)(()=>({...q$,...C}),[(0,I.useMemo)(()=>C?JSON.stringify(C):``,[C])]),fe=(0,I.useMemo)(()=>{let{inlineCode:e,...t}=a??{},n={...i0,...t};if(e){let t=n.code;n.code=n=>`data-block`in n?t?(0,I.createElement)(t,n):null:(0,I.createElement)(e,n)}return n},[a]),pe=(0,I.useMemo)(()=>{let e=[];return _!=null&&_.cjk&&(e=[...e,..._.cjk.remarkPluginsBefore]),e=[...e,...s],_!=null&&_.cjk&&(e=[...e,..._.cjk.remarkPluginsAfter]),_!=null&&_.math&&(e=[...e,_.math.remarkPlugin]),e},[s,_?.math,_?.cjk]),me=(0,I.useMemo)(()=>{let e=o;if(x&&Object.keys(x).length>0&&o===D0){let t={...T0,tagNames:[...T0.tagNames??[],...Object.keys(x)],attributes:{...T0.attributes,...x}};e=[E0.raw,[$V,t],E0.harden]}return S&&S.length>0&&(e=[...e,[ole,S]]),_!=null&&_.math&&(e=[...e,_.math.rehypePlugin]),le&&f&&(e=[...e,le.rehypePlugin]),e},[o,_?.math,le,f,x,S]),he=(0,I.useMemo)(()=>{if(!f||ae.length===0)return!1;let e=ae.at(-1);return u0(e)||d0(e)},[f,ae]),ge=(0,I.useMemo)(()=>g&&f&&!he?{"--streamdown-caret":`"${ple[g]}"`}:void 0,[g,f,he]);return t===`static`?(0,U.jsx)(J$.Provider,{value:de,children:(0,U.jsx)(o1.Provider,{value:_??null,children:(0,U.jsx)(A0.Provider,{value:ue,children:(0,U.jsx)(G$,{icons:w,children:(0,U.jsx)(A$.Provider,{value:M,children:(0,U.jsx)(`div`,{className:M(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,c),dir:n===`auto`?s0(te):n,children:(0,U.jsx)(_0,{components:fe,rehypePlugins:me,remarkPlugins:pe,...O,children:te})})})})})})}):(0,U.jsx)(J$.Provider,{value:de,children:(0,U.jsx)(o1.Provider,{value:_??null,children:(0,U.jsx)(A0.Provider,{value:ue,children:(0,U.jsx)(G$,{icons:w,children:(0,U.jsx)(A$.Provider,{value:M,children:(0,U.jsxs)(`div`,{className:M(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,g&&!he?`[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]`:null,c),style:ge,children:[ae.length===0&&g&&f&&(0,U.jsx)(`span`,{}),ae.map((e,t)=>{let a=t===ae.length-1,o=f&&a&&u0(e);return(0,U.jsx)(m,{animatePlugin:le,components:fe,content:e,dir:oe?.[t]??(n===`auto`?void 0:n),index:t,isIncomplete:o,rehypePlugins:me,remarkPlugins:pe,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...O},se[t])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);M0.displayName=`Streamdown`;var mle=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:o=1,fullscreen:s=!1})=>{let{RotateCcwIcon:c,ZoomInIcon:l,ZoomOutIcon:u}=K$(),d=j$(),f=(0,I.useRef)(null),p=(0,I.useRef)(null),[m,h]=(0,I.useState)(o),[g,_]=(0,I.useState)({x:0,y:0}),[v,y]=(0,I.useState)(!1),[b,x]=(0,I.useState)({x:0,y:0}),[S,C]=(0,I.useState)({x:0,y:0}),w=(0,I.useCallback)(e=>{h(t=>Math.max(n,Math.min(r,t+e)))},[n,r]),T=(0,I.useCallback)(()=>{w(i)},[w,i]),E=(0,I.useCallback)(()=>{w(-i)},[w,i]),D=(0,I.useCallback)(()=>{h(o),_({x:0,y:0})},[o]),O=(0,I.useCallback)(e=>{e.preventDefault(),w(e.deltaY>0?-i:i)},[w,i]),k=(0,I.useCallback)(e=>{if(e.button!==0||e.isPrimary===!1)return;y(!0),x({x:e.clientX,y:e.clientY}),C(g);let t=e.currentTarget;t instanceof HTMLElement&&t.setPointerCapture(e.pointerId)},[g]),A=(0,I.useCallback)(e=>{if(!v)return;e.preventDefault();let t=e.clientX-b.x,n=e.clientY-b.y;_({x:S.x+t,y:S.y+n})},[v,b,S]),j=(0,I.useCallback)(e=>{y(!1);let t=e.currentTarget;t instanceof HTMLElement&&t.releasePointerCapture(e.pointerId)},[]);return(0,I.useEffect)(()=>{let e=f.current;if(e)return e.addEventListener(`wheel`,O,{passive:!1}),()=>{e.removeEventListener(`wheel`,O)}},[O]),(0,I.useEffect)(()=>{let e=p.current;if(e&&v)return document.body.style.userSelect=`none`,e.addEventListener(`pointermove`,A,{passive:!1}),e.addEventListener(`pointerup`,j),e.addEventListener(`pointercancel`,j),()=>{document.body.style.userSelect=``,e.removeEventListener(`pointermove`,A),e.removeEventListener(`pointerup`,j),e.removeEventListener(`pointercancel`,j)}},[v,A,j]),(0,U.jsxs)(`div`,{className:d(`relative flex flex-col`,s?`h-full w-full`:`min-h-28 w-full`,t),ref:f,style:{cursor:v?`grabbing`:`grab`},children:[a?(0,U.jsxs)(`div`,{className:d(`absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm`,s?`bottom-4 left-4`:`bottom-2 left-2`),children:[(0,U.jsx)(`button`,{className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`),disabled:m>=r,onClick:T,title:`Zoom in`,type:`button`,children:(0,U.jsx)(l,{size:16})}),(0,U.jsx)(`button`,{className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`),disabled:m<=n,onClick:E,title:`Zoom out`,type:`button`,children:(0,U.jsx)(u,{size:16})}),(0,U.jsx)(`button`,{className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`),onClick:D,title:`Reset zoom and pan`,type:`button`,children:(0,U.jsx)(c,{size:16})})]}):null,(0,U.jsx)(`div`,{className:d(`flex-1 origin-center transition-transform duration-150 ease-out`,s?`flex h-full w-full items-center justify-center`:`flex w-full items-center justify-center`),onPointerDown:k,ref:p,role:`application`,style:{transform:`translate(${g.x}px, ${g.y}px) scale(${m})`,transformOrigin:`center center`,touchAction:`none`,willChange:`transform`},children:e})]})},N0=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let a=j$(),[o,s]=(0,I.useState)(null),[c,l]=(0,I.useState)(!1),[u,d]=(0,I.useState)(``),[f,p]=(0,I.useState)(``),[m,h]=(0,I.useState)(0),{mermaid:g}=(0,I.useContext)(A0),_=l1(),v=g?.errorComponent,{shouldRender:y,containerRef:b}=f$({immediate:r});if((0,I.useEffect)(()=>{if(y){if(!_){s(`Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.`);return}(async()=>{try{s(null),l(!0);let t=_.getMermaid(n),r=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),i=`mermaid-${Math.abs(r)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:a}=await t.render(i,e);d(a),p(a)}catch(e){f||u||s(e instanceof Error?e.message:`Failed to render Mermaid chart`)}finally{l(!1)}})()}},[e,n,m,y,_]),!(y||u||f))return(0,U.jsx)(`div`,{className:a(`my-4 min-h-[200px]`,t),ref:b});if(c&&!u&&!f)return(0,U.jsx)(`div`,{className:a(`my-4 flex justify-center p-4`,t),ref:b,children:(0,U.jsxs)(`div`,{className:a(`flex items-center space-x-2 text-muted-foreground`),children:[(0,U.jsx)(`div`,{className:a(`h-4 w-4 animate-spin rounded-full border-current border-b-2`)}),(0,U.jsx)(`span`,{className:a(`text-sm`),children:`Loading diagram...`})]})});if(o&&!u&&!f)return v?(0,U.jsx)(`div`,{ref:b,children:(0,U.jsx)(v,{chart:e,error:o,retry:()=>h(e=>e+1)})}):(0,U.jsxs)(`div`,{className:a(`rounded-md bg-red-50 p-4`,t),ref:b,children:[(0,U.jsxs)(`p`,{className:a(`font-mono text-red-700 text-sm`),children:[`Mermaid Error: `,o]}),(0,U.jsxs)(`details`,{className:a(`mt-2`),children:[(0,U.jsx)(`summary`,{className:a(`cursor-pointer text-red-600 text-xs`),children:`Show Code`}),(0,U.jsx)(`pre`,{className:a(`mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs`),children:e})]})]});let x=u||f;return(0,U.jsx)(`div`,{className:a(`size-full`,t),"data-streamdown":`mermaid`,ref:b,children:(0,U.jsx)(mle,{className:a(r?`size-full overflow-hidden`:`overflow-hidden`,t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:(0,U.jsx)(`div`,{"aria-label":`Mermaid chart`,className:a(`flex justify-center`,r?`size-full items-center`:null),dangerouslySetInnerHTML:{__html:x},role:`img`})})})},P0=({className:e,from:t,...n})=>(0,U.jsx)(`div`,{className:Pg(`group flex w-full max-w-[95%] flex-col gap-2`,t===`user`?`is-user ml-auto justify-end`:`is-assistant self-start`,e),...n}),F0=({children:e,className:t,...n})=>(0,U.jsx)(`div`,{className:Pg(`is-user:dark flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm`,`group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground`,`group-[.is-assistant]:text-left group-[.is-assistant]:text-foreground`,t),...n,children:e}),hle=({className:e,children:t,...n})=>(0,U.jsx)(`div`,{className:Pg(`flex items-center gap-1`,e),...n,children:t}),I0=({tooltip:e,children:t,label:n,variant:r=`ghost`,size:i=`icon-sm`,...a})=>{let o=(0,U.jsxs)(Rg,{size:i,type:`button`,variant:r,...a,children:[t,(0,U.jsx)(`span`,{className:`sr-only`,children:n||e})]});return e?(0,U.jsx)(yS,{children:(0,U.jsxs)(bS,{children:[(0,U.jsx)(xS,{render:o}),(0,U.jsx)(SS,{children:(0,U.jsx)(`p`,{children:e})})]})}):o},L0=(0,I.createContext)(null),R0=()=>{let e=(0,I.useContext)(L0);if(!e)throw Error(`MessageBranch components must be used within MessageBranch`);return e},gle=({defaultBranch:e=0,onBranchChange:t,className:n,...r})=>{let[i,a]=(0,I.useState)(e),[o,s]=(0,I.useState)([]),c=(0,I.useCallback)(e=>{a(e),t?.(e)},[t]),l=(0,I.useCallback)(()=>{c(i>0?i-1:o.length-1)},[i,o.length,c]),u=(0,I.useCallback)(()=>{c(i<o.length-1?i+1:0)},[i,o.length,c]),d=(0,I.useMemo)(()=>({branches:o,currentBranch:i,goToNext:u,goToPrevious:l,setBranches:s,totalBranches:o.length}),[o,i,u,l]);return(0,U.jsx)(L0.Provider,{value:d,children:(0,U.jsx)(`div`,{className:Pg(`grid w-full gap-2 [&>div]:pb-0`,n),...r})})},_le=({children:e,...t})=>{let{currentBranch:n,setBranches:r,branches:i}=R0(),a=(0,I.useMemo)(()=>Array.isArray(e)?e:[e],[e]);return(0,I.useEffect)(()=>{i.length!==a.length&&r(a)},[a,i,r]),a.map((e,r)=>(0,U.jsx)(`div`,{className:Pg(`grid gap-2 overflow-hidden [&>div]:pb-0`,r===n?`block`:`hidden`),...t,children:e},e.key))},vle=({className:e,...t})=>{let{totalBranches:n}=R0();return n<=1?null:(0,U.jsx)(tte,{className:Pg(`[&>*:not(:first-child)]:rounded-l-md [&>*:not(:last-child)]:rounded-r-md`,e),orientation:`horizontal`,...t})},yle=({children:e,...t})=>{let{goToPrevious:n,totalBranches:r}=R0();return(0,U.jsx)(Rg,{"aria-label":`Previous branch`,disabled:r<=1,onClick:n,size:`icon-sm`,type:`button`,variant:`ghost`,...t,children:e??(0,U.jsx)($g,{size:14})})},ble=({children:e,...t})=>{let{goToNext:n,totalBranches:r}=R0();return(0,U.jsx)(Rg,{"aria-label":`Next branch`,disabled:r<=1,onClick:n,size:`icon-sm`,type:`button`,variant:`ghost`,...t,children:e??(0,U.jsx)(e_,{size:14})})},xle=({className:e,...t})=>{let{currentBranch:n,totalBranches:r}=R0();return(0,U.jsxs)(nte,{className:Pg(`border-none bg-transparent text-muted-foreground shadow-none`,e),...t,children:[n+1,` of `,r]})},Sle={cjk:GC,code:ij,math:yM,mermaid:eL},z0=(0,I.memo)(({className:e,...t})=>(0,U.jsx)(M0,{className:Pg(`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,e),plugins:Sle,...t}),(e,t)=>e.children===t.children&&t.isAnimating===e.isAnimating);z0.displayName=`MessageResponse`;var Cle=({messageId:e,feedback:t,onFeedback:n,disabled:r})=>{let[i,a]=(0,I.useState)(null),[o,s]=(0,I.useState)(``),c=t?.rating,l=(0,I.useCallback)(r=>{let i=c===r?0:r;i===0?(n(e,0),a(null),s(``)):(a(i),s(t?.comment??``))},[c,e,n,t?.comment]),u=(0,I.useCallback)(()=>{i!==null&&(n(e,i,o.trim()||void 0),a(null),s(``))},[o,e,n,i]),d=(0,I.useCallback)(()=>{i!==null&&(n(e,i),a(null),s(``))},[e,n,i]),f=i??c;return(0,U.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2`,children:[(0,U.jsxs)(hle,{children:[(0,U.jsx)(I0,{tooltip:`Thumbs up`,onClick:()=>l(1),variant:f===1?`default`:`ghost`,disabled:r,children:(0,U.jsx)(Hee,{className:`size-4`})}),(0,U.jsx)(I0,{tooltip:`Thumbs down`,onClick:()=>l(-1),variant:f===-1?`default`:`ghost`,disabled:r,children:(0,U.jsx)(Vee,{className:`size-4`})})]}),i!==null&&(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border bg-background p-3 text-sm shadow-sm`,children:[(0,U.jsx)(`textarea`,{autoFocus:!0,className:`w-full resize-none rounded border-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground`,placeholder:`Add a comment (optional)`,rows:2,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&u(),e.key===`Escape`&&d()}}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(`button`,{className:`text-xs text-muted-foreground hover:text-foreground transition-colors`,onClick:d,children:`Skip`}),(0,U.jsx)(`button`,{className:`rounded bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90 transition-colors`,onClick:u,children:`Submit`})]})]})]})},wle=globalThis?.document?I.useLayoutEffect:()=>{},Tle=I.useInsertionEffect||wle;function B0({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Ele({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=I.useRef(e!==void 0);I.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,I.useCallback(t=>{if(s){let n=Dle(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Ele({defaultProp:e,onChange:t}){let[n,r]=I.useState(e),i=I.useRef(n),a=I.useRef(t);return Tle(()=>{a.current=t},[t]),I.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Dle(e){return typeof e==`function`}var V0=I.createContext(void 0);function H0(e){let t=I.useContext(V0);if(e===!1&&t===void 0)throw Error(eh(27));return t}var Ole={...Hx,...Gb},kle=I.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:s}=H0(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return mh(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Ole,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),U0=I.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{store:c}=H0(),l=c.useState(`open`);function u(e){l&&c.setOpen(!1,Q_(q_,e.nativeEvent))}let{getButtonProps:d,buttonRef:f}=nh({disabled:i,native:a});return mh(`button`,e,{state:{disabled:i},ref:[t,f],props:[{onClick:u},s,d]})}),Ale=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),jle=function(e){return e[e.open=Nx.open]=`open`,e[e.closed=Nx.closed]=`closed`,e[e.startingStyle=Nx.startingStyle]=`startingStyle`,e[e.endingStyle=Nx.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),W0=I.createContext(void 0);function Mle(){let e=I.useContext(W0);if(e===void 0)throw Error(eh(26));return e}var G0=`ArrowUp`,K0=`ArrowDown`,q0=`ArrowLeft`,J0=`ArrowRight`,Y0=`Home`,Nle=new Set([q0,J0]),Ple=new Set([G0,K0]),Fle=new Set([...Nle,...Ple]);new Set([...Fle,Y0,`End`]);var X0=new Set([G0,K0,q0,J0,Y0,`End`]),Ile={...Hx,...Gb,nestedDialogOpen(e){return e?{[jle.nestedDialogOpen]:``}:null}},Lle=I.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,style:o,...s}=e,{store:c}=H0(),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`);Mle(),qb({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});function S(e){return e===`touch`?c.context.popupRef.current:!0}let C=i===void 0?S:i,w=mh(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:g>0},props:[f,{"aria-labelledby":y??void 0,"aria-describedby":l??void 0,role:x,tabIndex:-1,hidden:!m,onKeyDown(e){X0.has(e.key)&&e.stopPropagation()},style:{[Ale.nestedDialogs]:g}},s],ref:[t,c.context.popupRef,c.useStateSetter(`popupElement`)],stateAttributesMapping:Ile});return(0,U.jsx)(cb,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:r,modal:p!==!1,restoreFocus:`popup`,children:w})}),Z0=I.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,U.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Rle=I.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=H0(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,U.jsx)(W0.Provider,{value:n,children:(0,U.jsxs)(Xy,{ref:t,...r,children:[a&&o===!0&&(0,U.jsx)(Z0,{ref:i.context.internalBackdropRef,inert:vS(!s)}),e.children]})}):null}),Q0={},$0={},e2=``;function zle(e){if(typeof document>`u`)return!1;let t=uv(e);return lm(t).innerWidth-t.documentElement.clientWidth>0}function Ble(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=uv(e),n=t.documentElement,r=t.body,i=hm(n)?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 Vle(e){let t=uv(e),n=t.documentElement,r=t.body,i=hm(n)?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 Hle(e){let t=uv(e),n=t.documentElement,r=t.body,i=lm(n),a=0,o=0,s=!1,c=cv.create();if(M_&&(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,Q0={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},e2=n.style.scrollBehavior,$0={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=hm(n)?n:r;if(s=Ble(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`,overflow:`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,Q0),Object.assign(r.style,$0),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=e2)}function d(){u(),c.request(l)}l();let f=nv(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Ule=new class{lockCount=0;restore=null;timeoutLock=E_.create();timeoutUnlock=E_.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=uv(e).documentElement,n=lm(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=lh;return}let r=N_||!zle(e);this.restore=r?Vle(e):Hle(e)}};function t2(e=!0,t=null){Lm(()=>{if(e)return Ule.acquire(t)},[e,t])}function Wle(e){let t=I.useRef(``),n=I.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:I.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 n2(e,t){let n=I.useRef(e),r=Nm(t);Lm(()=>{n.current!==e&&r(n.current)},[e,r]),Lm(()=>{n.current=e},[e])}function r2(e){let[t,n]=I.useState(null),r=Nm((t,r)=>{e||n(r||(N_?`touch`:``))});n2(e,t=>{t&&!e&&n(null)});let{onClick:i,onPointerDown:a}=Wle(r);return I.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:a}}),[t,i,a])}function Gle(e){let{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,a=t.useState(`open`),o=t.useState(`disablePointerDismissal`),s=t.useState(`modal`),c=t.useState(`popupElement`),{openMethod:l,triggerProps:u}=r2(a);Xb(t);let{forceUnmount:d}=Zb(a,t),f=I.useCallback(()=>{t.setOpen(!1,Q_(Z_))},[t]);I.useImperativeHandle(r,()=>({unmount:d,close:f}),[d,f]);let p=ax({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[m,h]=I.useState(0),[g,_]=I.useState(0),v=m===0,y=bx(p),b=db(p,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=yv(e);if(v&&!o){let e=n;return s&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||vv(e,c)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:v});t2(a&&s===!0,c);let{getReferenceProps:x,getFloatingProps:S,getTriggerProps:C}=gx([y,b]);t.useContextCallback(`onNestedDialogOpen`,(e,t)=>{h(e),_(t)}),t.useContextCallback(`onNestedDialogClose`,()=>{h(0),_(0)}),I.useEffect(()=>(n?.onNestedDialogOpen&&a&&n.onNestedDialogOpen(m+1,g+ +!!i),n?.onNestedDialogClose&&!a&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&a&&n.onNestedDialogClose()}),[i,a,m,g,n]);let w=I.useMemo(()=>x(u),[x,u]),T=I.useMemo(()=>C(u),[C,u]),E=I.useMemo(()=>S(),[S]);t.useSyncedValues({openMethod:l,activeTriggerProps:w,inactiveTriggerProps:T,popupProps:E,floatingRootContext:p,nestedOpenDialogCount:m,nestedOpenDrawerCount:g})}var Kle={...nx,modal:W(e=>e.modal),nested:W(e=>e.nested),nestedOpenDialogCount:W(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:W(e=>e.nestedOpenDrawerCount),disablePointerDismissal:W(e=>e.disablePointerDismissal),openMethod:W(e=>e.openMethod),descriptionElementId:W(e=>e.descriptionElementId),titleElementId:W(e=>e.titleElementId),viewportElement:W(e=>e.viewportElement),role:W(e=>e.role)},qle=class e extends Rb{constructor(e){super(Jle(e),{popupRef:I.createRef(),backdropRef:I.createRef(),internalBackdropRef:I.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Qb,onOpenChange:void 0,onOpenChangeComplete:void 0},Kle)}setOpen=(e,t)=>{if(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)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};static useStore(t,n){let r=Am(()=>new e(n)).current;return t??r}};function Jle(e={}){return{...ex(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}var i2=I.createContext(!1);function Yle(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=H0(!0),p=I.useContext(i2),m=!!f,h=qle.useStore(l?.store,{open:r,openProp:n,activeTriggerId:d,triggerIdProp:u,modal:s,disablePointerDismissal:o,nested:m});x_(()=>{n===void 0&&h.state.open===!1&&r===!0&&h.update({open:!0,activeTriggerId:d})}),h.useControlledProp(`openProp`,n),h.useControlledProp(`triggerIdProp`,u),h.useSyncedValues({disablePointerDismissal:o,nested:m,modal:s}),h.useContextCallback(`onOpenChange`,i),h.useContextCallback(`onOpenChangeComplete`,a);let g=h.useState(`payload`);Gle({store:h,actionsRef:c,parentContext:f?.store.context,isDrawer:p,onOpenChange:i,triggerIdProp:u});let _=I.useMemo(()=>({store:h}),[h]);return(0,U.jsx)(i2.Provider,{value:!1,children:(0,U.jsx)(V0.Provider,{value:_,children:typeof t==`function`?t({payload:g}):t})})}var Xle=I.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=H0(),c=Ux(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),mh(`h2`,e,{ref:t,props:[{id:c},o]})}),Zle=I.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,payload:s,handle:c,style:l,...u}=e,d=H0(!0),f=c?.store??d?.store;if(!f)throw Error(eh(79));let p=Ux(o),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=I.useRef(null),{registerTrigger:_,isMountedByThisTrigger:v}=Yb(p,g,f,{payload:s}),{getButtonProps:y,buttonRef:b}=nh({disabled:i,native:a}),x=gx([lb(m,{enabled:m!=null})]),S={disabled:i,open:h},C=f.useState(`triggerProps`,v);return mh(`button`,e,{state:S,ref:[b,t,_,g],props:[x.getReferenceProps(),C,{[Wy]:``,id:p},u,y],stateAttributesMapping:Bx})});function a2({...e}){return(0,U.jsx)(Yle,{"data-slot":`dialog`,...e})}function o2({...e}){return(0,U.jsx)(Zle,{"data-slot":`dialog-trigger`,...e})}function Qle({...e}){return(0,U.jsx)(Rle,{"data-slot":`dialog-portal`,...e})}function $le({className:e,...t}){return(0,U.jsx)(kle,{"data-slot":`dialog-overlay`,className:Pg(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function s2({className:e,children:t,showCloseButton:n=!0,...r}){return(0,U.jsxs)(Qle,{children:[(0,U.jsx)($le,{}),(0,U.jsxs)(Lle,{"data-slot":`dialog-content`,className:Pg(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,U.jsxs)(U0,{"data-slot":`dialog-close`,render:(0,U.jsx)(Rg,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,U.jsx)(l_,{}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function c2({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`dialog-header`,className:Pg(`flex flex-col gap-2`,e),...t})}function l2({className:e,showCloseButton:t=!1,children:n,...r}){return(0,U.jsxs)(`div`,{"data-slot":`dialog-footer`,className:Pg(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,U.jsx)(U0,{render:(0,U.jsx)(Rg,{variant:`outline`}),children:`Close`})]})}function u2({className:e,...t}){return(0,U.jsx)(Xle,{"data-slot":`dialog-title`,className:Pg(`text-base leading-none font-medium`,e),...t})}var d2=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),eue={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},f2={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},tue={disabled:!1,...f2},p2={valid(e){return e===null?null:e?{[d2.valid]:``}:{[d2.invalid]:``}}},nue=I.createContext({invalid:void 0,name:void 0,validityData:{state:eue,errors:[],error:``,value:``,initialValue:null},setValidityData:lh,disabled:void 0,touched:f2.touched,setTouched:lh,dirty:f2.dirty,setDirty:lh,filled:f2.filled,setFilled:lh,focused:f2.focused,setFocused:lh,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:tue,markedDirtyRef:{current:!1},registerFieldControl:lh,validation:{getValidationProps:(e=uh)=>e,getInputValidationProps:(e=uh)=>e,inputRef:{current:null},commit:async()=>{}}});function m2(e=!0){let t=I.useContext(nue);if(t.setValidityData===lh&&!e)throw Error(eh(28));return t}var rue=I.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:lh,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function iue(){return I.useContext(rue)}var aue=I.createContext({controlId:void 0,registerControlId:lh,labelId:void 0,setLabelId:lh,messageIds:[],setMessageIds:lh,getDescriptionProps:e=>e});function h2(){return I.useContext(aue)}function oue(e,t,n,r=!0,i){let[a,o]=I.useState(),s=Ux(i?`${i}-label`:void 0),c=e??t??a;return Lm(()=>{let i=e||t||!r?void 0:sue(n.current,s);a!==i&&o(i)}),c}function sue(e,t){let n=cue(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function cue(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function g2(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=h2(),o=Ux(t),s=n?i:void 0,c=Am(()=>Symbol(`labelable-control`)),l=I.useRef(!1),u=I.useRef(t!=null),d=Nm(()=>{!l.current||a===lh||(l.current=!1,a(c.current,void 0))});return Lm(()=>{if(a===lh)return;let e;if(n){let n=r?.current;e=fm(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),I.useEffect(()=>d,[d]),i??o}function _2({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=I.useRef(e!==void 0),[a,o]=I.useState(t);return[i?e:a,I.useCallback(e=>{i||o(e)},[])]}function v2(e,t){let{enabled:n=!0,getValue:r,id:i,value:a}=t,{registerFieldControl:o}=m2(),s=I.useRef(null);s.current||=Symbol(),Lm(()=>{let t=s.current;if(!(!t||!n))return o(t,{controlRef:e,getValue:r,id:i,value:a}),()=>{o(t,void 0)}},[e,n,r,i,o,a])}var lue=I.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFocused:y,setFilled:b,validationMode:x,validation:S}=m2(),C=h||s,w=m??a,T={...p,disabled:C},{labelId:E}=h2(),D=g2({id:i});Lm(()=>{let e=o!=null;S.inputRef.current?.value||e&&o!==``?b(!0):e&&o===``&&b(!1)},[S.inputRef,b,o]);let O=I.useRef(null);Lm(()=>{u&&O.current===_v(uv(O.current))&&y(!0)},[u,y]);let[k]=_2({controlled:o,default:l,name:`FieldControl`,state:`value`}),A=o!==void 0,j=A?k:void 0,M=Nm(()=>S.inputRef.current?.value);return v2(S.inputRef,{id:D,value:j,getValue:M}),mh(`input`,e,{ref:[t,O],state:T,props:[{id:D,disabled:C,name:w,ref:S.inputRef,"aria-labelledby":E,autoFocus:u,...A?{value:j}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,Q_(H_,e.nativeEvent)),_(t!==v.initialValue),b(t!==``)},onFocus(){y(!0)},onBlur(e){g(!0),y(!1),x===`onBlur`&&S.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(g(!0),S.commit(e.currentTarget.value))}},S.getInputValidationProps(),f],stateAttributesMapping:p2})}),uue=I.forwardRef(function(e,t){return(0,U.jsx)(lue,{ref:t,...e})});function y2({className:e,type:t,...n}){return(0,U.jsx)(uue,{type:t,"data-slot":`input`,className:Pg(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function b2({className:e,...t}){return(0,U.jsx)(`textarea`,{"data-slot":`textarea`,className:Pg(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function due({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:Pg(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var fue=Th(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function pue({className:e,align:t=`inline-start`,...n}){return(0,U.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:Pg(fue({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var mue=Th(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function hue({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,U.jsx)(Rg,{type:t,"data-size":r,variant:n,className:Pg(mue({size:r}),e),...i})}function gue({className:e,...t}){return(0,U.jsx)(b2,{"data-slot":`input-group-control`,className:Pg(`flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,e),...t})}var _ue=I.createContext(void 0);function vue(e){let t=I.useContext(_ue);if(t===void 0&&!e)throw Error(eh(69));return t}var yue=20;function bue(e,t,n,r){let[i,a]=I.useState(!1);Lm(()=>{if(!e||!t||n==null){a(!1);return}let r=uv(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-yue)},[e,t,n]),t2(e&&(!t||i),r)}function xue(e,t){let n=I.useRef(null);return{preFocusGuardRef:n,handlePreFocusGuardFocus:Nm(t=>{Ky.flushSync(()=>{e.setOpen(!1,Q_(J_,t.nativeEvent,t.currentTarget))}),vte(n.current)?.focus()}),handleFocusTargetFocus:Nm(n=>{let r=e.select(`positionerElement`);if(r&&wy(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{Ky.flushSync(()=>{e.setOpen(!1,Q_(J_,n.nativeEvent,n.currentTarget))});let i=_te(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&vv(r,i);){let e=i;if(i=xy(i),i===e)break}i?.focus()}})}}function x2(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function S2(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Sue(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function Cue(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Sue(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 wue(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?S2(e.value):S2(e)}W(e=>e.id),W(e=>e.labelId),W(e=>e.modal),W(e=>e.multiple),W(e=>e.items),W(e=>e.itemToStringLabel),W(e=>e.itemToStringValue),W(e=>e.isItemEqualToValue),W(e=>e.value),W(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:wue(t,r)!==``}),W((e,t)=>t?Cue(e.items):!1),W(e=>e.open),W(e=>e.mounted),W(e=>e.forceMount),W(e=>e.transitionStatus),W(e=>e.openMethod),W(e=>e.activeIndex),W(e=>e.selectedIndex),W((e,t)=>e.activeIndex===t),W((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>x2(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:x2(n,i,r)}),W((e,t)=>e.selectedIndex===t),W(e=>e.popupProps),W(e=>e.triggerProps),W(e=>e.triggerElement),W(e=>e.positionerElement),W(e=>e.listElement),W(e=>e.scrollUpArrowVisible),W(e=>e.scrollDownArrowVisible),W(e=>e.hasScrollArrows);function C2({className:e,...t}){return(0,U.jsx)(Iee,{role:`status`,"aria-label":`Loading`,className:Pg(`size-4 animate-spin`,e),...t})}var Tue=async e=>{try{let t=await(await fetch(e)).blob();return new Promise(e=>{let n=new FileReader;n.onloadend=()=>e(n.result),n.onerror=()=>e(null),n.readAsDataURL(t)})}catch{return null}},Eue=(0,I.createContext)(null),Due=(0,I.createContext)(null),w2=()=>(0,I.useContext)(Eue),Oue=()=>(0,I.useContext)(Due),T2=(0,I.createContext)(null),kue=()=>{let e=Oue(),t=(0,I.useContext)(T2)??e;if(!t)throw Error(`usePromptInputAttachments must be used within a PromptInput or PromptInputProvider`);return t},Aue=(0,I.createContext)(null),jue=({className:e,accept:t,multiple:n,globalDrop:r,syncHiddenInput:i,maxFiles:a,maxFileSize:o,onError:s,onSubmit:c,children:l,...u})=>{let d=w2(),f=!!d,p=(0,I.useRef)(null),m=(0,I.useRef)(null),[h,g]=(0,I.useState)([]),_=f?d.attachments.files:h,[v,y]=(0,I.useState)([]),b=(0,I.useRef)(_);(0,I.useEffect)(()=>{b.current=_},[_]);let x=(0,I.useCallback)(()=>{p.current?.click()},[]),S=(0,I.useCallback)(e=>!t||t.trim()===``?!0:t.split(`,`).map(e=>e.trim()).filter(Boolean).some(t=>{if(t.endsWith(`/*`)){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t}),[t]),C=(0,I.useCallback)(e=>{let t=[...e],n=t.filter(e=>S(e));if(t.length&&n.length===0){s?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>o?e.size<=o:!0);if(n.length>0&&r.length===0){s?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}g(e=>{let t=typeof a==`number`?Math.max(0,a-e.length):void 0,n=typeof t==`number`?r.slice(0,t):r;typeof t==`number`&&r.length>t&&s?.({code:`max_files`,message:`Too many files. Some were not added.`});let i=[];for(let e of n)i.push({filename:e.name,id:hp(),mediaType:e.type,type:`file`,url:URL.createObjectURL(e)});return[...e,...i]})},[S,a,o,s]),w=(0,I.useCallback)(e=>g(t=>{let n=t.find(t=>t.id===e);return n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)}),[]),T=(0,I.useCallback)(e=>{let t=[...e],n=t.filter(e=>S(e));if(t.length&&n.length===0){s?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>o?e.size<=o:!0);if(n.length>0&&r.length===0){s?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}let i=_.length,c=typeof a==`number`?Math.max(0,a-i):void 0,l=typeof c==`number`?r.slice(0,c):r;typeof c==`number`&&r.length>c&&s?.({code:`max_files`,message:`Too many files. Some were not added.`}),l.length>0&&d?.attachments.add(l)},[S,o,a,s,_.length,d]),E=(0,I.useCallback)(()=>f?d?.attachments.clear():g(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]}),[f,d]),D=(0,I.useCallback)(()=>y([]),[]),O=f?T:C,k=f?d.attachments.remove:w,A=f?d.attachments.openFileDialog:x,j=(0,I.useCallback)(()=>{E(),D()},[E,D]);(0,I.useEffect)(()=>{f&&d.__registerFileInput(p,()=>p.current?.click())},[f,d]),(0,I.useEffect)(()=>{i&&p.current&&_.length===0&&(p.current.value=``)},[_,i]),(0,I.useEffect)(()=>{let e=m.current;if(!e||r)return;let t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},n=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&O(e.dataTransfer.files)};return e.addEventListener(`dragover`,t),e.addEventListener(`drop`,n),()=>{e.removeEventListener(`dragover`,t),e.removeEventListener(`drop`,n)}},[O,r]),(0,I.useEffect)(()=>{if(!r)return;let e=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&O(e.dataTransfer.files)};return document.addEventListener(`dragover`,e),document.addEventListener(`drop`,t),()=>{document.removeEventListener(`dragover`,e),document.removeEventListener(`drop`,t)}},[O,r]),(0,I.useEffect)(()=>()=>{if(!f)for(let e of b.current)e.url&&URL.revokeObjectURL(e.url)},[f]);let M=(0,I.useCallback)(e=>{e.currentTarget.files&&O(e.currentTarget.files),e.currentTarget.value=``},[O]),N=(0,I.useMemo)(()=>({add:O,clear:E,fileInputRef:p,files:_.map(e=>({...e,id:e.id})),openFileDialog:A,remove:k}),[_,O,k,E,A]),P=(0,I.useMemo)(()=>({add:e=>{let t=Array.isArray(e)?e:[e];y(e=>[...e,...t.map(e=>({...e,id:hp()}))])},clear:D,remove:e=>{y(t=>t.filter(t=>t.id!==e))},sources:v}),[v,D]),ee=(0,I.useCallback)(async e=>{e.preventDefault();let t=e.currentTarget,n=f?d.textInput.value:new FormData(t).get(`message`)||``;f||t.reset();try{let t=c({files:await Promise.all(_.map(async({id:e,...t})=>{if(t.url?.startsWith(`blob:`)){let e=await Tue(t.url);return{...t,url:e??t.url}}return t})),text:n},e);if(t instanceof Promise)try{await t,j(),f&&d.textInput.clear()}catch{}else j(),f&&d.textInput.clear()}catch{}},[f,d,_,c,j]),F=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`input`,{accept:t,"aria-label":`Upload files`,className:`hidden`,multiple:n,onChange:M,ref:p,title:`Upload files`,type:`file`}),(0,U.jsx)(`form`,{className:Pg(`w-full`,e),onSubmit:ee,ref:m,...u,children:(0,U.jsx)(due,{className:`overflow-hidden`,children:l})})]}),te=(0,U.jsx)(Aue.Provider,{value:P,children:F});return(0,U.jsx)(T2.Provider,{value:N,children:te})},Mue=({className:e,...t})=>(0,U.jsx)(`div`,{className:Pg(`contents`,e),...t}),Nue=({onChange:e,onKeyDown:t,className:n,placeholder:r=`What would you like to know?`,...i})=>{let a=w2(),o=kue(),[s,c]=(0,I.useState)(!1),l=(0,I.useCallback)(e=>{if(t?.(e),!e.defaultPrevented){if(e.key===`Enter`){if(s||e.nativeEvent.isComposing||e.shiftKey)return;e.preventDefault();let{form:t}=e.currentTarget;if(t?.querySelector(`button[type="submit"]`)?.disabled)return;t?.requestSubmit()}if(e.key===`Backspace`&&e.currentTarget.value===``&&o.files.length>0){e.preventDefault();let t=o.files.at(-1);t&&o.remove(t.id)}}},[t,s,o]),u=(0,I.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of t)if(e.kind===`file`){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),o.add(n))},[o]),d=(0,I.useCallback)(()=>c(!1),[]),f=(0,I.useCallback)(()=>c(!0),[]),p=a?{onChange:t=>{a.textInput.setInput(t.currentTarget.value),e?.(t)},value:a.textInput.value}:{onChange:e};return(0,U.jsx)(gue,{className:Pg(`field-sizing-content max-h-48 min-h-16`,n),name:`message`,onCompositionEnd:d,onCompositionStart:f,onKeyDown:l,onPaste:u,placeholder:r,...i,...p})},Pue=({className:e,...t})=>(0,U.jsx)(pue,{align:`block-end`,className:Pg(`justify-between gap-1`,e),...t}),Fue=({className:e,...t})=>(0,U.jsx)(`div`,{className:Pg(`flex min-w-0 items-center gap-1`,e),...t}),Iue=({className:e,variant:t=`default`,size:n=`icon-sm`,status:r,onStop:i,onClick:a,children:o,...s})=>{let c=r===`submitted`||r===`streaming`,l=(0,U.jsx)(a_,{className:`size-4`});r===`submitted`?l=(0,U.jsx)(C2,{}):r===`streaming`?l=(0,U.jsx)(c_,{className:`size-4`}):r===`error`&&(l=(0,U.jsx)(l_,{className:`size-4`}));let u=(0,I.useCallback)(e=>{if(c&&i){e.preventDefault(),i();return}a?.(e)},[c,i,a]);return(0,U.jsx)(hue,{"aria-label":c?`Stop`:`Submit`,className:Pg(e),onClick:u,size:n,type:c&&i?`button`:`submit`,variant:t,...s,children:o??l})};function Lue(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,a=t!==void 0,[o,s]=_2({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:c,setMounted:l,transitionStatus:u}=Vb(o,!0,!0),[d,f]=I.useState(o),[{height:p,width:m},h]=I.useState({height:void 0,width:void 0}),g=Ux(),[_,v]=I.useState(),y=_??g,[b,x]=I.useState(!1),[S,C]=I.useState(!1),w=I.useRef(null),T=I.useRef(null),E=I.useRef(null),D=I.useRef(null),O=Kb(D,!1),k=Nm(e=>{let t=!o,n=Q_(U_,e.nativeEvent);if(r(t,n),n.isCanceled)return;let i=D.current;T.current===`css-animation`&&i!=null&&i.style.removeProperty(`animation-name`),!b&&!S&&(T.current!=null&&T.current!==`css-animation`&&!c&&t&&l(!0),T.current===`css-animation`&&(!d&&t&&f(!0),!c&&t&&l(!0))),s(t),T.current===`none`&&c&&!t&&l(!1)});return Lm(()=>{a&&T.current===`none`&&!o&&l(!1)},[a,o,t,l]),I.useMemo(()=>({abortControllerRef:w,animationTypeRef:T,disabled:i,handleTrigger:k,height:p,mounted:c,open:o,panelId:y,panelRef:D,runOnceAnimationsFinish:O,setDimensions:h,setHiddenUntilFound:x,setKeepMounted:C,setMounted:l,setOpen:s,setPanelIdState:v,setVisible:f,transitionDimensionRef:E,transitionStatus:u,visible:d,width:m}),[w,T,i,k,p,c,o,y,D,O,h,x,C,l,s,f,E,u,d,m])}var E2=I.createContext(void 0);function D2(){let e=I.useContext(E2);if(e===void 0)throw Error(eh(15));return e}var O2=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Hb.startingStyle]=`startingStyle`,e[e.endingStyle=Hb.endingStyle]=`endingStyle`,e}({}),Rue=function(e){return e.panelOpen=`data-panel-open`,e}({}),zue={[O2.open]:``},Bue={[O2.closed]:``},Vue={open(e){return e?{[Rue.panelOpen]:``}:null}},k2={open(e){return e?zue:Bue},...Gb},Hue=I.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=Nm(o),d=Lue({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=I.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=I.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=mh(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:k2});return(0,U.jsx)(E2.Provider,{value:p,children:m})}),Uue={...Vue,...Gb},Wue=I.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=D2(),{className:s,disabled:c=o,id:l,render:u,nativeButton:d=!0,style:f,...p}=e,{getButtonProps:m,buttonRef:h}=nh({disabled:c,focusableWhenDisabled:!0,native:d}),g=I.useMemo(()=>({"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i}),[n,r,i]);return mh(`button`,e,{state:a,ref:[t,h],props:[g,p,m],stateAttributesMapping:Uue})}),Gue=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e}({});function Kue(e){let{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:i,hiddenUntilFound:a,keepMounted:o,id:s,mounted:c,onOpenChange:l,open:u,panelRef:d,runOnceAnimationsFinish:f,setDimensions:p,setMounted:m,setOpen:h,setVisible:g,transitionDimensionRef:_,visible:v,width:y}=e,b=I.useRef(!1),x=I.useRef(null),S=I.useRef(u),C=I.useRef(u),w=lv(),T=I.useMemo(()=>n.current===`css-animation`?!v:!u&&!c,[u,c,v,n]),E=ih(r,d,Nm(e=>{if(!e)return;if(n.current==null||_.current==null){let t=getComputedStyle(e),r=t.animationName!==`none`&&t.animationName!==``,i=t.transitionDuration!==`0s`&&t.transitionDuration!==``;r&&i||(t.animationName===`none`&&t.transitionDuration!==`0s`?n.current=`css-transition`:t.animationName!==`none`&&t.transitionDuration===`0s`?n.current=`css-animation`:n.current=`none`),e.getAttribute(Gue.orientation)===`horizontal`||t.transitionProperty.indexOf(`width`)>-1?_.current=`width`:_.current=`height`}if(n.current!==`css-transition`)return;(i===void 0||y===void 0)&&(p({height:e.scrollHeight,width:e.scrollWidth}),C.current&&e.style.setProperty(`transition-duration`,`0s`));let t=-1,r=-1;return t=cv.request(()=>{C.current=!1,r=cv.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})}),()=>{cv.cancel(t),cv.cancel(r)}}));return Lm(()=>{if(n.current!==`css-transition`)return;let e=d.current;if(!e)return;let r=-1;if(t.current!=null&&(t.current.abort(),t.current=null),u){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)}),!C.current&&!o&&e.setAttribute(O2.startingStyle,``),p({height:e.scrollHeight,width:e.scrollWidth}),r=cv.request(()=>{Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})})}else{if(e.scrollHeight===0&&e.scrollWidth===0)return;p({height:e.scrollHeight,width:e.scrollWidth});let n=new AbortController;t.current=n;let r=n.signal,i=null,a=O2.endingStyle;return i=new MutationObserver(o=>{o.some(e=>e.type===`attributes`&&e.attributeName===a)&&(i?.disconnect(),i=null,f(()=>{p({height:0,width:0}),e.style.removeProperty(`content-visibility`),m(!1),t.current===n&&(t.current=null)},r))}),i.observe(e,{attributes:!0,attributeFilter:[a]}),()=>{i?.disconnect(),w.cancel(),t.current===n&&(n.abort(),t.current=null)}}return()=>{cv.cancel(r)}},[t,n,w,a,o,c,u,d,f,p,m]),Lm(()=>{if(n.current!==`css-animation`)return;let e=d.current;e&&(x.current=e.style.animationName||x.current,e.style.setProperty(`animation-name`,`none`),p({height:e.scrollHeight,width:e.scrollWidth}),!S.current&&!b.current&&e.style.removeProperty(`animation-name`),u?(t.current!=null&&(t.current.abort(),t.current=null),m(!0),g(!0)):(t.current=new AbortController,f(()=>{m(!1),g(!1),t.current=null},t.current.signal)))},[t,n,u,d,f,p,m,g,v]),w_(()=>{let e=cv.request(()=>{S.current=!1});return()=>cv.cancel(e)}),Lm(()=>{if(!a)return;let e=d.current;if(!e)return;let t=-1,n=-1;return u&&b.current&&(e.style.transitionDuration=`0s`,p({height:e.scrollHeight,width:e.scrollWidth}),t=cv.request(()=>{b.current=!1,n=cv.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})})),()=>{cv.cancel(t),cv.cancel(n)}},[a,u,d,p]),Lm(()=>{let e=d.current;e&&a&&T&&(e.setAttribute(`hidden`,`until-found`),n.current===`css-transition`&&e.setAttribute(O2.startingStyle,``))},[a,T,n,d]),I.useEffect(function(){let e=d.current;if(!e)return;function t(e){b.current=!0,h(!0),l(!0,Q_(H_,e))}return nv(e,`beforematch`,t)},[l,d,h]),I.useMemo(()=>({props:{hidden:T,id:s,ref:E}}),[T,s,E])}var A2=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),que=I.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{abortControllerRef:l,animationTypeRef:u,height:d,mounted:f,onOpenChange:p,open:m,panelId:h,panelRef:g,runOnceAnimationsFinish:_,setDimensions:v,setHiddenUntilFound:y,setKeepMounted:b,setMounted:x,setPanelIdState:S,setOpen:C,setVisible:w,state:T,transitionDimensionRef:E,visible:D,width:O,transitionStatus:k}=D2(),A=r??!1,j=i??!1;Lm(()=>{if(o)return S(o),()=>{S(void 0)}},[o,S]),Lm(()=>{y(A)},[y,A]),Lm(()=>{b(j)},[b,j]);let{props:M}=Kue({abortControllerRef:l,animationTypeRef:u,externalRef:t,height:d,hiddenUntilFound:A,id:h,keepMounted:j,mounted:f,onOpenChange:p,open:m,panelRef:g,runOnceAnimationsFinish:_,setDimensions:v,setMounted:x,setOpen:C,setVisible:w,transitionDimensionRef:E,visible:D,width:O});qb({open:m&&k===`idle`,ref:g,onComplete(){m&&v({height:void 0,width:void 0})}});let N=mh(`div`,e,{state:I.useMemo(()=>({...T,transitionStatus:k}),[T,k]),ref:[t,g],props:[M,{style:{[A2.collapsiblePanelHeight]:d===void 0?`auto`:`${d}px`,[A2.collapsiblePanelWidth]:O===void 0?`auto`:`${O}px`}},c],stateAttributesMapping:k2});return j||A||f?N:null});function j2({...e}){return(0,U.jsx)(Hue,{"data-slot":`collapsible`,...e})}function M2({...e}){return(0,U.jsx)(Wue,{"data-slot":`collapsible-trigger`,...e})}function N2({...e}){return(0,U.jsx)(que,{"data-slot":`collapsible-content`,...e})}var P2=(0,I.createContext)({});function Jue(e){let t=(0,I.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Yue=typeof window<`u`?I.useLayoutEffect:I.useEffect,F2=(0,I.createContext)(null);function I2(e,t){e.indexOf(t)===-1&&e.push(t)}function L2(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var R2=(e,t,n)=>n>t?t:n<e?e:n,z2={},B2=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function V2(e){return typeof e==`object`&&!!e}var H2=e=>/^0[^.\s]+$/u.test(e);function U2(e){let t;return()=>(t===void 0&&(t=e()),t)}var W2=e=>e,Xue=(e,t)=>n=>t(e(n)),G2=(...e)=>e.reduce(Xue),K2=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},q2=class{constructor(){this.subscriptions=[]}add(e){return I2(this.subscriptions,e),()=>L2(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},J2=e=>e*1e3,Y2=e=>e/1e3;function X2(e,t){return t?1e3/t*e:0}var Z2=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Zue=1e-7,Que=12;function $ue(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Z2(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Zue&&++s<Que);return o}function Q2(e,t,n,r){if(e===t&&n===r)return W2;let i=t=>$ue(t,0,1,e,n);return e=>e===0||e===1?e:Z2(i(e),t,r)}var $2=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,e4=e=>t=>1-e(1-t),t4=Q2(.33,1.53,.69,.99),n4=e4(t4),r4=$2(n4),i4=e=>e>=1?1:(e*=2)<1?.5*n4(e):.5*(2-2**(-10*(e-1))),a4=e=>1-Math.sin(Math.acos(e)),o4=e4(a4),s4=$2(a4),ede=Q2(.42,0,1,1),tde=Q2(0,0,.58,1),c4=Q2(.42,0,.58,1),nde=e=>Array.isArray(e)&&typeof e[0]!=`number`,l4=e=>Array.isArray(e)&&typeof e[0]==`number`,u4={linear:W2,easeIn:ede,easeInOut:c4,easeOut:tde,circIn:a4,circInOut:s4,circOut:o4,backIn:n4,backInOut:r4,backOut:t4,anticipate:i4},rde=e=>typeof e==`string`,d4=e=>{if(l4(e)){e.length;let[t,n,r,i]=e;return Q2(t,n,r,i)}else if(rde(e))return u4[e],`${e}`,u4[e];return e},f4=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],p4={value:null,addProjectionMetrics:null};function ide(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0;let o=n;n=r,r=o,n.forEach(l),t&&p4.value&&p4.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var ade=40;function m4(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=f4.reduce((e,n)=>(e[n]=ide(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=z2.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,ade),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:f4.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<f4.length;t++)o[f4[t]].cancel(e)},state:i,steps:o}}var{schedule:h4,cancel:g4,state:_4,steps:v4}=m4(typeof requestAnimationFrame<`u`?requestAnimationFrame:W2,!0),y4;function ode(){y4=void 0}var b4={now:()=>(y4===void 0&&b4.set(_4.isProcessing||z2.useManualTiming?_4.timestamp:performance.now()),y4),set:e=>{y4=e,queueMicrotask(ode)}},x4={layout:0,mainThread:0,waapi:0},S4=e=>t=>typeof t==`string`&&t.startsWith(e),C4=S4(`--`),sde=S4(`var(--`),w4=e=>sde(e)?cde.test(e.split(`/*`)[0].trim()):!1,cde=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function T4(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var E4={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},D4={...E4,transform:e=>R2(0,1,e)},O4={...E4,default:1},k4=e=>Math.round(e*1e5)/1e5,A4=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function lde(e){return e==null}var ude=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,j4=(e,t)=>n=>!!(typeof n==`string`&&ude.test(n)&&n.startsWith(e)||t&&!lde(n)&&Object.prototype.hasOwnProperty.call(n,t)),M4=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(A4);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},dde=e=>R2(0,255,e),N4={...E4,transform:e=>Math.round(dde(e))},P4={test:j4(`rgb`,`red`),parse:M4(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+N4.transform(e)+`, `+N4.transform(t)+`, `+N4.transform(n)+`, `+k4(D4.transform(r))+`)`};function fde(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var F4={test:j4(`#`),parse:fde,transform:P4.transform},I4=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),L4=I4(`deg`),R4=I4(`%`),z4=I4(`px`),pde=I4(`vh`),mde=I4(`vw`),B4={...R4,parse:e=>R4.parse(e)/100,transform:e=>R4.transform(e*100)},V4={test:j4(`hsl`,`hue`),parse:M4(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+R4.transform(k4(t))+`, `+R4.transform(k4(n))+`, `+k4(D4.transform(r))+`)`},H4={test:e=>P4.test(e)||F4.test(e)||V4.test(e),parse:e=>P4.test(e)?P4.parse(e):V4.test(e)?V4.parse(e):F4.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?P4.transform(e):V4.transform(e),getAnimatableNone:e=>{let t=H4.parse(e);return t.alpha=0,H4.transform(t)}},hde=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function gde(e){return isNaN(e)&&typeof e==`string`&&(e.match(A4)?.length||0)+(e.match(hde)?.length||0)>0}var U4=`number`,W4=`color`,_de=`var`,vde=`var(`,G4="${}",yde=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function K4(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(yde,e=>(H4.test(e)?(r.color.push(a),i.push(W4),n.push(H4.parse(e))):e.startsWith(vde)?(r.var.push(a),i.push(_de),n.push(e)):(r.number.push(a),i.push(U4),n.push(parseFloat(e))),++a,G4)).split(G4),indexes:r,types:i}}function bde(e){return K4(e).values}function q4({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===U4?i+=k4(r[a]):e===W4?i+=H4.transform(r[a]):i+=r[a]}return i}}function xde(e){return q4(K4(e))}var Sde=e=>typeof e==`number`?0:H4.test(e)?H4.getAnimatableNone(e):e,Cde=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Sde(e);function wde(e){let t=K4(e);return q4(t)(t.values.map((e,n)=>Cde(e,t.split[n])))}var J4={test:gde,parse:bde,createTransformer:xde,getAnimatableNone:wde};function Y4(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Tde({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Y4(s,r,e+1/3),a=Y4(s,r,e),o=Y4(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function X4(e,t){return n=>n>0?t:e}var Z4=(e,t,n)=>e+(t-e)*n,Q4=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Ede=[F4,P4,V4],Dde=e=>Ede.find(t=>t.test(e));function $4(e){let t=Dde(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===V4&&(n=Tde(n)),n}var e3=(e,t)=>{let n=$4(e),r=$4(t);if(!n||!r)return X4(e,t);let i={...n};return e=>(i.red=Q4(n.red,r.red,e),i.green=Q4(n.green,r.green,e),i.blue=Q4(n.blue,r.blue,e),i.alpha=Z4(n.alpha,r.alpha,e),P4.transform(i))},t3=new Set([`none`,`hidden`]);function Ode(e,t){return t3.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function kde(e,t){return n=>Z4(e,t,n)}function n3(e){return typeof e==`number`?kde:typeof e==`string`?w4(e)?X4:H4.test(e)?e3:Mde:Array.isArray(e)?r3:typeof e==`object`?H4.test(e)?e3:Ade:X4}function r3(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>n3(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Ade(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=n3(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function jde(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var Mde=(e,t)=>{let n=J4.createTransformer(t),r=K4(e),i=K4(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?t3.has(e)&&!i.values.length||t3.has(t)&&!r.values.length?Ode(e,t):G2(r3(jde(r,i),i.values),n):(`${e}${t}`,X4(e,t))};function i3(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Z4(e,t,n):n3(e)(e,t)}var Nde=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>h4.update(t,e),stop:()=>g4(t),now:()=>_4.isProcessing?_4.timestamp:b4.now()}},a3=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},o3=2e4;function s3(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function Pde(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(s3(r),o3);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Y2(i)}}var c3={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function l3(e,t){return e*Math.sqrt(1-t*t)}var Fde=12;function Ide(e,t,n){let r=n;for(let n=1;n<Fde;n++)r-=e(r)/t(r);return r}var u3=.001;function Lde({duration:e=c3.duration,bounce:t=c3.bounce,velocity:n=c3.velocity,mass:r=c3.mass}){let i,a;c3.maxDuration;let o=1-t;o=R2(c3.minDamping,c3.maxDamping,o),e=R2(c3.minDuration,c3.maxDuration,Y2(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=l3(t,o),c=Math.exp(-i);return u3-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=l3(t**2,o);return(-i(t)+u3>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-u3+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Ide(i,a,s);if(e=J2(e),isNaN(c))return{stiffness:c3.stiffness,damping:c3.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Rde=[`duration`,`bounce`],zde=[`stiffness`,`damping`,`mass`];function d3(e,t){return t.some(t=>e[t]!==void 0)}function Bde(e){let t={velocity:c3.velocity,stiffness:c3.stiffness,damping:c3.damping,mass:c3.mass,isResolvedFromDuration:!1,...e};if(!d3(e,zde)&&d3(e,Rde))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*R2(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:c3.mass,stiffness:i,damping:a}}else{let n=Lde({...e,velocity:0});t={...t,...n,mass:c3.mass},t.isResolvedFromDuration=!0}return t}function f3(e=c3.visualDuration,t=c3.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Bde({...n,velocity:-Y2(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=Y2(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?c3.restSpeed.granular:c3.restSpeed.default,i||=v?c3.restDelta.granular:c3.restDelta.default;let y,b,x,S,C,w;if(h<1)x=l3(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>J2(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=J2(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=J2(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(s3(T),o3),t=a3(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}f3.applyToOptions=e=>{let t=Pde(e,100,f3);return e.ease=t.ease,e.duration=J2(t.duration),e.type=`keyframes`,e};var Vde=5;function p3(e,t,n){let r=Math.max(t-Vde,0);return X2(n-e(r),t-r)}function m3({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=f3({keyframes:[f.value,m(f.value)],velocity:p3(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Hde(e,t,n){let r=[],i=n||z2.mix||i3,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=G2(Array.isArray(t)?t[n]||W2:t,a)),r.push(a)}return r}function Ude(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Hde(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=K2(e[r],e[r+1],n);return s[r](i)};return n?t=>l(R2(e[0],e[a-1],t)):l}function Wde(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=K2(0,t,r);e.push(Z4(n,1,i))}}function Gde(e){let t=[0];return Wde(t,e.length-1),t}function Kde(e,t){return e.map(e=>e*t)}function qde(e,t){return e.map(()=>t||c4).splice(0,e.length-1)}function h3({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=nde(r)?r.map(d4):d4(r),a={done:!1,value:t[0]},o=Ude(Kde(n&&n.length===t.length?n:Gde(t),e),t,{ease:Array.isArray(i)?i:qde(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Jde=e=>e!==null;function g3(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Jde),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Yde={decay:m3,inertia:m3,tween:h3,keyframes:h3,spring:f3};function _3(e){typeof e.type==`string`&&(e.type=Yde[e.type])}var v3=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},Xde=e=>e/100,y3=class extends v3{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==b4.now()&&this.tick(b4.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},x4.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;_3(e);let{type:t=h3,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||h3;s!==h3&&typeof o[0]!=`number`&&(this.mixKeyframes=G2(Xde,i3(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=s3(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=R2(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==m3&&(b.value=g3(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return Y2(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Y2(e)}get time(){return Y2(this.currentTime)}set time(e){e=J2(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return p3(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(b4.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Y2(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Nde,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(b4.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,x4.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Zde(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var b3=e=>e*180/Math.PI,x3=e=>S3(b3(Math.atan2(e[1],e[0]))),Qde={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:x3,rotateZ:x3,skewX:e=>b3(Math.atan(e[1])),skewY:e=>b3(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},S3=e=>(e%=360,e<0&&(e+=360),e),C3=x3,w3=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),T3=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),$de={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:w3,scaleY:T3,scale:e=>(w3(e)+T3(e))/2,rotateX:e=>S3(b3(Math.atan2(e[6],e[5]))),rotateY:e=>S3(b3(Math.atan2(-e[2],e[0]))),rotateZ:C3,rotate:C3,skewX:e=>b3(Math.atan(e[4])),skewY:e=>b3(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function E3(e){return+!!e.includes(`scale`)}function D3(e,t){if(!e||e===`none`)return E3(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=$de,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Qde,i=t}if(!i)return E3(t);let a=r[t],o=i[1].split(`,`).map(tfe);return typeof a==`function`?a(o):o[a]}var efe=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return D3(n,t)};function tfe(e){return parseFloat(e.trim())}var O3=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],k3=new Set(O3),A3=e=>e===E4||e===z4,nfe=new Set([`x`,`y`,`z`]),rfe=O3.filter(e=>!nfe.has(e));function ife(e){let t=[];return rfe.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var j3={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>D3(t,`x`),y:(e,{transform:t})=>D3(t,`y`)};j3.translateX=j3.x,j3.translateY=j3.y;var M3=new Set,N3=!1,P3=!1,F3=!1;function I3(){if(P3){let e=Array.from(M3).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=ife(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}P3=!1,N3=!1,M3.forEach(e=>e.complete(F3)),M3.clear()}function L3(){M3.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(P3=!0)})}function afe(){F3=!0,L3(),I3(),F3=!1}var R3=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(M3.add(this),N3||(N3=!0,h4.read(L3),h4.resolveKeyframes(I3))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Zde(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),M3.delete(this)}cancel(){this.state===`scheduled`&&(M3.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},ofe=e=>e.startsWith(`--`);function z3(e,t,n){ofe(t)?e.style.setProperty(t,n):e.style[t]=n}var sfe={};function B3(e,t){let n=U2(e);return()=>sfe[t]??n()}var cfe=B3(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),V3=B3(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),H3=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,U3={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:H3([0,.65,.55,1]),circOut:H3([.55,0,1,.45]),backIn:H3([.31,.01,.66,-.59]),backOut:H3([.33,1.53,.69,.99])};function W3(e,t){if(e)return typeof e==`function`?V3()?a3(e,t):`ease-out`:l4(e)?H3(e):Array.isArray(e)?e.map(e=>W3(e,t)||U3.easeOut):U3[e]}function lfe(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=W3(s,i);Array.isArray(d)&&(u.easing=d),p4.value&&x4.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return p4.value&&p.finished.finally(()=>{x4.waapi--}),p}function G3(e){return typeof e==`function`&&`applyToOptions`in e}function ufe({type:e,...t}){return G3(e)&&V3()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var K3=class extends v3{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=ufe(e);this.animation=lfe(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=g3(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),z3(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Y2(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Y2(e)}get time(){return Y2(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=J2(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&cfe()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),W2):r(this)}},q3={anticipate:i4,backInOut:r4,circInOut:s4};function dfe(e){return e in q3}function ffe(e){typeof e.ease==`string`&&dfe(e.ease)&&(e.ease=q3[e.ease])}var J3=10,pfe=class extends K3{constructor(e){ffe(e),_3(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new y3({...a,autoplay:!1}),s=Math.max(J3,b4.now()-this.startTime),c=R2(0,J3,s-J3),l=o.sample(s).value,{name:u}=this.options;i&&u&&z3(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},Y3=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(J4.test(e)||e===`0`)&&!e.startsWith(`url(`));function mfe(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function hfe(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Y3(i,t),s=Y3(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:mfe(e)||(n===`spring`||G3(n))&&r}function X3(e){e.duration=0,e.type=`keyframes`}var Z3=new Set([`opacity`,`clipPath`,`filter`,`transform`]),gfe=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function _fe(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&gfe.test(e[t]))return!0;return!1}var vfe=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),yfe=U2(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function bfe(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return yfe()&&n&&(Z3.has(n)||vfe.has(n)&&_fe(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var xfe=40,Sfe=class extends v3{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=b4.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||R3;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=b4.now();let u=!0;hfe(e,i,a,o)||(u=!1,(z2.instantAnimations||!s)&&l?.(g3(e,n,t)),e[0]=e[e.length-1],X3(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>xfe?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&bfe(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new pfe({...d,element:p})}catch{m=new y3(d)}else m=new y3(d);m.finished.then(()=>{this.notifyFinished()}).catch(W2),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),afe()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Q3(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Cfe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function wfe(e){let t=Cfe.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function $3(e,t,n=1){`${e}`;let[r,i]=wfe(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return B2(e)?parseFloat(e):e}return w4(i)?$3(i,t,n+1):i}var Tfe={type:`spring`,stiffness:500,damping:25,restSpeed:10},Efe=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Dfe={type:`keyframes`,duration:.8},Ofe={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},kfe=(e,{keyframes:t})=>t.length>2?Dfe:k3.has(e)?e.startsWith(`scale`)?Efe(t[1]):Tfe:Ofe;function e6(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function t6(e,t){let n=e?.[t]??e?.default??e;return n===e?n:e6(n,e)}var Afe=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function jfe(e){for(let t in e)if(!Afe.has(t))return!0;return!1}var n6=(e,t,n,r={},i,a)=>o=>{let s=t6(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=J2(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};jfe(s)||Object.assign(u,kfe(e,u)),u.duration&&=J2(u.duration),u.repeatDelay&&=J2(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(X3(u),u.delay===0&&(d=!0)),(z2.instantAnimations||z2.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,X3(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=g3(u.keyframes,s);if(e!==void 0){h4.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new y3(u):new Sfe(u)};function r6(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function i6(e,t,n,r){if(typeof t==`function`){let[i,a]=r6(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=r6(r);t=t(n===void 0?e.custom:n,i,a)}return t}function a6(e,t,n){let r=e.getProps();return i6(r,t,n===void 0?r.custom:n,e)}var o6=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...O3]),s6=30,Mfe=e=>!isNaN(parseFloat(e)),c6={current:void 0},Nfe=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=b4.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=b4.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Mfe(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new q2);let n=this.events[e].add(t);return e===`change`?()=>{n(),h4.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return c6.current&&c6.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=b4.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>s6)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,s6);return X2(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function l6(e,t){return new Nfe(e,t)}var u6=e=>Array.isArray(e);function Pfe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,l6(n))}function Ffe(e){return u6(e)?e[e.length-1]||0:e}function Ife(e,t){let{transitionEnd:n={},transition:r={},...i}=a6(e,t)||{};i={...i,...n};for(let t in i)Pfe(e,t,Ffe(i[t]))}var d6=e=>!!(e&&e.getVelocity);function Lfe(e){return!!(d6(e)&&e.add)}function f6(e,t){let n=e.getValue(`willChange`);if(Lfe(n))return n.add(t);if(!n&&z2.WillChange){let n=new z2.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function p6(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var m6=`data-`+p6(`framerAppearId`);function h6(e){return e.props[m6]}function Rfe({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function g6(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?e6(a,c):c;let l=a?.reduceMotion;r&&(a=r);let u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||d&&Rfe(d,t))continue;let o={delay:n,...t6(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){h4.update(()=>r.set(i));continue}let f=!1;if(window.MotionHandoffAnimation){let n=h6(e);if(n){let e=window.MotionHandoffAnimation(n,t,h4);e!==null&&(o.startTime=e,f=!0)}}f6(e,t);let p=l??e.shouldReduceMotion;r.start(n6(t,r,i,p&&o6.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>h4.update(()=>{o&&Ife(e,o)});u.length?Promise.all(u).then(t):t()}return u}function _6(e,t,n={}){let r=a6(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(g6(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return zfe(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function zfe(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(_6(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Q3(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Bfe(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>_6(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=_6(e,t,n);else{let i=typeof t==`function`?a6(e,t,n.custom):t;r=Promise.all(g6(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Vfe={test:e=>e===`auto`,parse:e=>e},v6=e=>t=>t.test(e),y6=[E4,z4,R4,L4,mde,pde,Vfe],b6=e=>y6.find(v6(e));function Hfe(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||H2(e)}var Ufe=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Wfe(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(A4)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Ufe.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Gfe=/\b([a-z-]*)\(.*?\)/gu,x6={...J4,getAnimatableNone:e=>{let t=e.match(Gfe);return t?t.map(Wfe).join(` `):e}},S6={...J4,getAnimatableNone:e=>{let t=J4.parse(e);return J4.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},C6={...E4,transform:Math.round},w6={borderWidth:z4,borderTopWidth:z4,borderRightWidth:z4,borderBottomWidth:z4,borderLeftWidth:z4,borderRadius:z4,borderTopLeftRadius:z4,borderTopRightRadius:z4,borderBottomRightRadius:z4,borderBottomLeftRadius:z4,width:z4,maxWidth:z4,height:z4,maxHeight:z4,top:z4,right:z4,bottom:z4,left:z4,inset:z4,insetBlock:z4,insetBlockStart:z4,insetBlockEnd:z4,insetInline:z4,insetInlineStart:z4,insetInlineEnd:z4,padding:z4,paddingTop:z4,paddingRight:z4,paddingBottom:z4,paddingLeft:z4,paddingBlock:z4,paddingBlockStart:z4,paddingBlockEnd:z4,paddingInline:z4,paddingInlineStart:z4,paddingInlineEnd:z4,margin:z4,marginTop:z4,marginRight:z4,marginBottom:z4,marginLeft:z4,marginBlock:z4,marginBlockStart:z4,marginBlockEnd:z4,marginInline:z4,marginInlineStart:z4,marginInlineEnd:z4,fontSize:z4,backgroundPositionX:z4,backgroundPositionY:z4,rotate:L4,rotateX:L4,rotateY:L4,rotateZ:L4,scale:O4,scaleX:O4,scaleY:O4,scaleZ:O4,skew:L4,skewX:L4,skewY:L4,distance:z4,translateX:z4,translateY:z4,translateZ:z4,x:z4,y:z4,z:z4,perspective:z4,transformPerspective:z4,opacity:D4,originX:B4,originY:B4,originZ:z4,zIndex:C6,fillOpacity:D4,strokeOpacity:D4,numOctaves:C6},Kfe={...w6,color:H4,backgroundColor:H4,outlineColor:H4,fill:H4,stroke:H4,borderColor:H4,borderTopColor:H4,borderRightColor:H4,borderBottomColor:H4,borderLeftColor:H4,filter:x6,WebkitFilter:x6,mask:S6,WebkitMask:S6},T6=e=>Kfe[e],qfe=new Set([x6,S6]);function E6(e,t){let n=T6(e);return qfe.has(n)||(n=J4),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var Jfe=new Set([`auto`,`none`,`0`]);function Yfe(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Jfe.has(t)&&K4(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=E6(n,i)}var Xfe=class extends R3{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),w4(r))){let i=$3(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!o6.has(n)||e.length!==2)return;let[r,i]=e,a=b6(r),o=b6(i);if(T4(r)!==T4(i)&&j3[n]){this.needsMeasurement=!0;return}if(a!==o)if(A3(a)&&A3(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else j3[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Hfe(e[t]))&&n.push(t);n.length&&Yfe(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=j3[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=j3[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function D6(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var O6=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Zfe(e){return V2(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:k6,cancel:Qfe}=m4(queueMicrotask,!1),A6={x:!1,y:!1};function j6(){return A6.x||A6.y}function $fe(e){return e===`x`||e===`y`?A6[e]?null:(A6[e]=!0,()=>{A6[e]=!1}):A6.x||A6.y?null:(A6.x=A6.y=!0,()=>{A6.x=A6.y=!1})}function M6(e,t){let n=D6(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function epe(e){return!(e.pointerType===`touch`||j6())}function tpe(e,t,n={}){let[r,i,a]=M6(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!epe(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var N6=(e,t)=>t?e===t?!0:N6(e,t.parentElement):!1,P6=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,npe=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function rpe(e){return npe.has(e.tagName)||e.isContentEditable===!0}var ipe=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function ape(e){return ipe.has(e.tagName)||e.isContentEditable===!0}var F6=new WeakSet;function I6(e){return t=>{t.key===`Enter`&&e(t)}}function L6(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var ope=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=I6(()=>{if(F6.has(n))return;L6(n,`down`);let e=I6(()=>{L6(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>L6(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function R6(e){return P6(e)&&!j6()}var z6=new WeakSet;function spe(e,t,n={}){let[r,i,a]=M6(e,n),o=e=>{let r=e.currentTarget;if(!R6(e)||z6.has(e))return;F6.add(r),n.stopPropagation&&z6.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),F6.has(r)&&F6.delete(r),R6(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||N6(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Zfe(e)&&(e.addEventListener(`focus`,e=>ope(e,i)),!rpe(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function B6(e){return V2(e)&&`ownerSVGElement`in e}var V6=new WeakMap,H6,U6=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:B6(r)&&`getBBox`in r?r.getBBox()[t]:r[n],cpe=U6(`inline`,`width`,`offsetWidth`),lpe=U6(`block`,`height`,`offsetHeight`);function upe({target:e,borderBoxSize:t}){V6.get(e)?.forEach(n=>{n(e,{get width(){return cpe(e,t)},get height(){return lpe(e,t)}})})}function dpe(e){e.forEach(upe)}function fpe(){typeof ResizeObserver>`u`||(H6=new ResizeObserver(dpe))}function ppe(e,t){H6||fpe();let n=D6(e);return n.forEach(e=>{let n=V6.get(e);n||(n=new Set,V6.set(e,n)),n.add(t),H6?.observe(e)}),()=>{n.forEach(e=>{let n=V6.get(e);n?.delete(t),n?.size||H6?.unobserve(e)})}}var W6=new Set,G6;function mpe(){G6=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};W6.forEach(t=>t(e))},window.addEventListener(`resize`,G6)}function hpe(e){return W6.add(e),G6||mpe(),()=>{W6.delete(e),!W6.size&&typeof G6==`function`&&(window.removeEventListener(`resize`,G6),G6=void 0)}}function K6(e,t){return typeof e==`function`?hpe(e):ppe(e,t)}function gpe(e){return B6(e)&&e.tagName===`svg`}var _pe=[...y6,H4,J4],vpe=e=>_pe.find(v6(e)),q6=()=>({translate:0,scale:1,origin:0,originPoint:0}),J6=()=>({x:q6(),y:q6()}),Y6=()=>({min:0,max:0}),X6=()=>({x:Y6(),y:Y6()}),ype=new WeakMap;function Z6(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Q6(e){return typeof e==`string`||Array.isArray(e)}var $6=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],e8=[`initial`,...$6];function t8(e){return Z6(e.animate)||e8.some(t=>Q6(e[t]))}function n8(e){return!!(t8(e)||e.variants)}function bpe(e,t,n){for(let r in t){let i=t[r],a=n[r];if(d6(i))e.addValue(r,i);else if(d6(a))e.addValue(r,l6(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,l6(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var r8={current:null},i8={current:!1},xpe=typeof window<`u`;function Spe(){if(i8.current=!0,xpe)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>r8.current=e.matches;e.addEventListener(`change`,t),t()}else r8.current=!1}var a8=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],o8={};function s8(e){o8=e}function Cpe(){return o8}var wpe=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=R3,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=b4.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,h4.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=t8(t),this.isVariantNode=n8(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&d6(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,ype.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(i8.current||Spe(),this.shouldReduceMotion=r8.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),g4(this.notifyUpdate),g4(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Z3.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new K3({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:J2(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=k3.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&h4.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in o8){let t=o8[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):X6()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<a8.length;t++){let n=a8[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=bpe(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=l6(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(B2(n)||H2(n))?n=parseFloat(n):!vpe(n)&&J4.test(t)&&(n=E6(e,t)),this.setBaseTarget(e,d6(n)?n.get():n)),d6(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=i6(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!d6(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new q2),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){k6.render(this.render)}},c8=class extends wpe{constructor(){super(...arguments),this.KeyframeResolver=Xfe}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;d6(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},l8=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function u8({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Tpe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Epe(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function d8(e){return e===void 0||e===1}function f8({scale:e,scaleX:t,scaleY:n}){return!d8(e)||!d8(t)||!d8(n)}function p8(e){return f8(e)||m8(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function m8(e){return h8(e.x)||h8(e.y)}function h8(e){return e&&e!==`0%`}function g8(e,t,n){return n+t*(e-n)}function _8(e,t,n,r,i){return i!==void 0&&(e=g8(e,i,r)),g8(e,n,r)+t}function v8(e,t=0,n=1,r,i){e.min=_8(e.min,t,n,r,i),e.max=_8(e.max,t,n,r,i)}function y8(e,{x:t,y:n}){v8(e.x,t.translate,t.scale,t.originPoint),v8(e.y,n.translate,n.scale,n.originPoint)}var b8=.999999999999,x8=1.0000000000001;function Dpe(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(S8(e.x,-a.scroll.offset.x),S8(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,y8(e,o)),r&&p8(a.latestValues)&&T8(e,a.latestValues,a.layout?.layoutBox))}t.x<x8&&t.x>b8&&(t.x=1),t.y<x8&&t.y>b8&&(t.y=1)}function S8(e,t){e.min+=t,e.max+=t}function C8(e,t,n,r,i=.5){v8(e,t,n,Z4(e.min,e.max,i),r)}function w8(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function T8(e,t,n){let r=n??e;C8(e.x,w8(t.x,r.x),t.scaleX,t.scale,t.originX),C8(e.y,w8(t.y,r.y),t.scaleY,t.scale,t.originY)}function E8(e,t){return u8(Epe(e.getBoundingClientRect(),t))}function Ope(e,t,n){let r=E8(e,n),{scroll:i}=t;return i&&(S8(r.x,i.offset.x),S8(r.y,i.offset.y)),r}var kpe={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Ape=O3.length;function jpe(e,t,n){let r=``,i=!0;for(let a=0;a<Ape;a++){let o=O3[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=O6(s,w6[o]);if(!c){i=!1;let t=kpe[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function D8(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(k3.has(e)){o=!0;continue}else if(C4(e)){i[e]=n;continue}else{let t=O6(n,w6[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=jpe(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function O8(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function k8(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var A8={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(z4.test(e))e=parseFloat(e);else return e;return`${k8(e,t.target.x)}% ${k8(e,t.target.y)}%`}},Mpe={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=J4.parse(e);if(i.length>5)return r;let a=J4.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Z4(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},j8={borderRadius:{...A8,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:A8,borderTopRightRadius:A8,borderBottomLeftRadius:A8,borderBottomRightRadius:A8,boxShadow:Mpe};function M8(e,{layout:t,layoutId:n}){return k3.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!j8[e]||e===`opacity`)}function N8(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(d6(r[t])||i&&d6(i[t])||M8(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Npe(e){return window.getComputedStyle(e)}var Ppe=class extends c8{constructor(){super(...arguments),this.type=`html`,this.renderInstance=O8}readValueFromInstance(e,t){if(k3.has(t))return this.projection?.isProjecting?E3(t):efe(e,t);{let n=Npe(e),r=(C4(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return E8(e,t)}build(e,t,n){D8(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return N8(e,t,n)}},Fpe={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Ipe={offset:`strokeDashoffset`,array:`strokeDasharray`};function Lpe(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Fpe:Ipe;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Rpe=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function P8(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(D8(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Rpe)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Lpe(d,i,a,o,!1)}var F8=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),I8=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function zpe(e,t,n,r){O8(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(F8.has(n)?n:p6(n),t.attrs[n])}function L8(e,t,n){let r=N8(e,t,n);for(let n in e)if(d6(e[n])||d6(t[n])){let t=O3.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Bpe=class extends c8{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=X6}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(k3.has(t)){let e=T6(t);return e&&e.default||0}return t=F8.has(t)?t:p6(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return L8(e,t,n)}build(e,t,n){P8(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){zpe(e,t,n,r)}mount(e){this.isSVGTag=I8(e.tagName),super.mount(e)}},Vpe=e8.length;function R8(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&R8(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<Vpe;n++){let r=e8[n],i=e.props[r];(Q6(i)||i===!1)&&(t[r]=i)}return t}function z8(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Hpe=[...$6].reverse(),Upe=$6.length;function Wpe(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Bfe(e,t,n)))}function Gpe(e){let t=Wpe(e),n=V8(),r=!0,i=!1,a=t=>(n,r)=>{let i=a6(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=R8(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Upe;t++){let p=Hpe[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Q6(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Z6(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Kpe(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=u6(t)&&u6(n)?!z8(t,n):t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=a6(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Q3(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=a6(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=V8(),i=!0}}}function Kpe(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!z8(t,e):!1}function B8(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function V8(){return{animate:B8(!0),whileInView:B8(),whileHover:B8(),whileTap:B8(),whileDrag:B8(),whileFocus:B8(),exit:B8()}}function H8(e,t){e.min=t.min,e.max=t.max}function U8(e,t){H8(e.x,t.x),H8(e.y,t.y)}function W8(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var G8=1e-4,qpe=1-G8,Jpe=1+G8,K8=.01,Ype=0-K8,Xpe=0+K8;function q8(e){return e.max-e.min}function Zpe(e,t,n){return Math.abs(e-t)<=n}function J8(e,t,n,r=.5){e.origin=r,e.originPoint=Z4(t.min,t.max,e.origin),e.scale=q8(n)/q8(t),e.translate=Z4(n.min,n.max,e.origin)-e.originPoint,(e.scale>=qpe&&e.scale<=Jpe||isNaN(e.scale))&&(e.scale=1),(e.translate>=Ype&&e.translate<=Xpe||isNaN(e.translate))&&(e.translate=0)}function Y8(e,t,n,r){J8(e.x,t.x,n.x,r?r.originX:void 0),J8(e.y,t.y,n.y,r?r.originY:void 0)}function X8(e,t,n,r=0){e.min=(r?Z4(n.min,n.max,r):n.min)+t.min,e.max=e.min+q8(t)}function Qpe(e,t,n,r){X8(e.x,t.x,n.x,r?.x),X8(e.y,t.y,n.y,r?.y)}function Z8(e,t,n,r=0){let i=r?Z4(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+q8(t)}function Q8(e,t,n,r){Z8(e.x,t.x,n.x,r?.x),Z8(e.y,t.y,n.y,r?.y)}function $8(e,t,n,r,i){return e-=t,e=g8(e,1/n,r),i!==void 0&&(e=g8(e,1/i,r)),e}function $pe(e,t=0,n=1,r=.5,i,a=e,o=e){if(R4.test(t)&&(t=parseFloat(t),t=Z4(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Z4(a.min,a.max,r);e===a&&(s-=t),e.min=$8(e.min,t,n,s,i),e.max=$8(e.max,t,n,s,i)}function e5(e,t,[n,r,i],a,o){$pe(e,t[n],t[r],t[i],t.scale,a,o)}var eme=[`x`,`scaleX`,`originX`],tme=[`y`,`scaleY`,`originY`];function t5(e,t,n,r){e5(e.x,t,eme,n?n.x:void 0,r?r.x:void 0),e5(e.y,t,tme,n?n.y:void 0,r?r.y:void 0)}function n5(e){return e.translate===0&&e.scale===1}function r5(e){return n5(e.x)&&n5(e.y)}function i5(e,t){return e.min===t.min&&e.max===t.max}function nme(e,t){return i5(e.x,t.x)&&i5(e.y,t.y)}function a5(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function o5(e,t){return a5(e.x,t.x)&&a5(e.y,t.y)}function s5(e){return q8(e.x)/q8(e.y)}function c5(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function l5(e){return[e(`x`),e(`y`)]}function rme(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var u5=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],ime=u5.length,d5=e=>typeof e==`string`?parseFloat(e):e,f5=e=>typeof e==`number`||z4.test(e);function ame(e,t,n,r,i,a){i?(e.opacity=Z4(0,n.opacity??1,ome(r)),e.opacityExit=Z4(t.opacity??1,0,sme(r))):a&&(e.opacity=Z4(t.opacity??1,n.opacity??1,r));for(let i=0;i<ime;i++){let a=u5[i],o=p5(t,a),s=p5(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||f5(o)===f5(s)?(e[a]=Math.max(Z4(d5(o),d5(s),r),0),(R4.test(s)||R4.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Z4(t.rotate||0,n.rotate||0,r))}function p5(e,t){return e[t]===void 0?e.borderRadius:e[t]}var ome=m5(0,.5,o4),sme=m5(.5,.95,W2);function m5(e,t,n){return r=>r<e?0:r>t?1:n(K2(e,t,r))}function cme(e,t,n){let r=d6(e)?e:l6(e);return r.start(n6(``,r,t,n)),r.animation}function h5(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var lme=(e,t)=>e.depth-t.depth,ume=class{constructor(){this.children=[],this.isDirty=!1}add(e){I2(this.children,e),this.isDirty=!0}remove(e){L2(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(lme),this.isDirty=!1,this.children.forEach(e)}};function dme(e,t){let n=b4.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(g4(r),e(a-t))};return h4.setup(r,!0),()=>g4(r)}function g5(e){return d6(e)?e.get():e}var fme=class{constructor(){this.members=[]}add(e){I2(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(L2(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(L2(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},_5={hasAnimatedSinceResize:!0,hasEverUpdated:!1},v5={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},y5=[``,`X`,`Y`,`Z`],pme=1e3,mme=0;function b5(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function x5(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=h6(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,h4,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&x5(r)}function S5({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=mme++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,p4.value&&(v5.nodes=v5.calculatedTargetDeltas=v5.calculatedProjections=0),this.nodes.forEach(_me),this.nodes.forEach(Cme),this.nodes.forEach(wme),this.nodes.forEach(vme),p4.addProjectionMetrics&&p4.addProjectionMetrics(v5)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new ume)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new q2),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=B6(t)&&!gpe(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;h4.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=dme(i,250),_5.hasAnimatedSinceResize&&(_5.hasAnimatedSinceResize=!1,this.nodes.forEach(T5)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||kme,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!o5(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...t6(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||T5(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),g4(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Tme),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&x5(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(bme),this.nodes.forEach(C5);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(w5);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(xme),this.nodes.forEach(Sme),this.nodes.forEach(hme),this.nodes.forEach(gme)):this.nodes.forEach(w5),this.clearAllSnapshots();let e=b4.now();_4.delta=R2(0,1e3/60,e-_4.timestamp),_4.timestamp=e,_4.isProcessing=!0,v4.update.process(_4),v4.preRender.process(_4),v4.render.process(_4),_4.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,k6.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(yme),this.sharedNodes.forEach(Eme)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,h4.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){h4.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!q8(this.snapshot.measuredBox.x)&&!q8(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=X6(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!r5(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||p8(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Ame(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return X6();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(jme))){let{scroll:e}=this.root;e&&(S8(t.x,e.offset.x),S8(t.y,e.offset.y))}return t}removeElementScroll(e){let t=X6();if(U8(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&U8(t,e),S8(t.x,i.offset.x),S8(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||X6();U8(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(S8(r.x,-n.scroll.offset.x),S8(r.y,-n.scroll.offset.y)),p8(n.latestValues)&&T8(r,n.latestValues,n.layout?.layoutBox)}return p8(this.latestValues)&&T8(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=X6();U8(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!p8(n.latestValues))continue;let r;n.instance&&(f8(n.latestValues)&&n.updateSnapshot(),r=X6(),U8(r,n.measurePageBox())),t5(t,n.latestValues,n.snapshot?.layoutBox,r)}return p8(this.latestValues)&&t5(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==_4.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=_4.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=X6(),this.targetWithTransforms=X6()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Qpe(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):U8(this.target,this.layout.layoutBox),y8(this.target,this.targetDelta)):U8(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),p4.value&&v5.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||f8(this.parent.latestValues)||m8(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=X6(),this.relativeTargetOrigin=X6(),Q8(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),U8(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===_4.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;U8(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Dpe(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=X6());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(W8(this.prevProjectionDelta.x,this.projectionDelta.x),W8(this.prevProjectionDelta.y,this.projectionDelta.y)),Y8(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!c5(this.projectionDelta.x,this.prevProjectionDelta.x)||!c5(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),p4.value&&v5.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=J6(),this.projectionDelta=J6(),this.projectionDeltaWithTransform=J6()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=J6();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=X6(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(Ome));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;E5(a.x,e.x,n),E5(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Q8(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Dme(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&nme(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=X6(),U8(d,this.relativeTarget)),s&&(this.animationValues=i,ame(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(g4(this.pendingAnimation),void 0),this.pendingAnimation=h4.update(()=>{_5.hasAnimatedSinceResize=!0,x4.layout++,this.motionValue||=l6(0),this.motionValue.jump(0,!1),this.currentAnimation=cme(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{x4.layout--},onComplete:()=>{x4.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(pme),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&j5(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||X6();let t=q8(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=q8(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}U8(t,n),T8(t,i),Y8(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new fme),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&b5(`z`,e,r,this.animationValues);for(let t=0;t<y5.length;t++)b5(`rotate${y5[t]}`,e,r,this.animationValues),b5(`skew${y5[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=g5(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=g5(t?.pointerEvents)||``),this.hasProjected&&!p8(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=rme(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in j8){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=j8[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?g5(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(C5),this.root.sharedNodes.clear()}}}function hme(e){e.updateLayout()}function gme(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)l5(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=q8(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;H8(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else j5(i,t.layoutBox,n)&&l5(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=q8(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=J6();Y8(o,n,t.layoutBox);let s=J6();a?Y8(s,e.applyTransform(r,!0),t.measuredBox):Y8(s,n,t.layoutBox);let c=!r5(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=X6();Q8(s,t.layoutBox,i.layoutBox,o);let c=X6();Q8(c,n,a.layoutBox,o),o5(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function _me(e){p4.value&&v5.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function vme(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function yme(e){e.clearSnapshot()}function C5(e){e.clearMeasurements()}function bme(e){e.isLayoutDirty=!0,e.updateLayout()}function w5(e){e.isLayoutDirty=!1}function xme(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Sme(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function T5(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Cme(e){e.resolveTargetDelta()}function wme(e){e.calcProjection()}function Tme(e){e.resetSkewAndRotation()}function Eme(e){e.removeLeadSnapshot()}function E5(e,t,n){e.translate=Z4(t.translate,0,n),e.scale=Z4(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function D5(e,t,n,r){e.min=Z4(t.min,n.min,r),e.max=Z4(t.max,n.max,r)}function Dme(e,t,n,r){D5(e.x,t.x,n.x,r),D5(e.y,t.y,n.y,r)}function Ome(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var kme={duration:.45,ease:[.4,0,.1,1]},O5=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),k5=O5(`applewebkit/`)&&!O5(`chrome/`)?Math.round:W2;function A5(e){e.min=k5(e.min),e.max=k5(e.max)}function Ame(e){A5(e.x),A5(e.y)}function j5(e,t,n){return e===`position`||e===`preserve-aspect`&&!Zpe(s5(t),s5(n),.2)}function jme(e){return e!==e.root&&e.scroll?.wasRoot}var Mme=S5({attachResizeListener:(e,t)=>h5(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),M5={current:void 0},N5=S5({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!M5.current){let e=new Mme({});e.mount(window),e.setOptions({layoutScroll:!0}),M5.current=e}return M5.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),P5=(0,I.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Nme(e=!0){let t=(0,I.useContext)(F2);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,I.useId)();(0,I.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,I.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var F5=(0,I.createContext)({strict:!1}),I5={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},L5=!1;function Pme(){if(L5)return;let e={};for(let t in I5)e[t]={isEnabled:e=>I5[t].some(t=>!!e[t])};s8(e),L5=!0}function R5(){return Pme(),Cpe()}function Fme(e){let t=R5();for(let n in e)t[n]={...t[n],...e[n]};s8(t)}var Ime=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function z5(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Ime.has(e)}var Lme=r({default:()=>B5}),B5,Rme=n((()=>{throw B5={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),V5=e=>!z5(e);function zme(e){typeof e==`function`&&(V5=t=>t.startsWith(`on`)?!z5(t):e(t))}try{zme((Rme(),t(Lme)).default)}catch{}function Bme(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||d6(e[i])||(V5(i)||n===!0&&z5(i)||!t&&!z5(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var H5=(0,I.createContext)({});function Vme(e,t){if(t8(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Q6(t)?t:void 0,animate:Q6(n)?n:void 0}}return e.inherit===!1?{}:t}function Hme(e){let{initial:t,animate:n}=Vme(e,(0,I.useContext)(H5));return(0,I.useMemo)(()=>({initial:t,animate:n}),[U5(t),U5(n)])}function U5(e){return Array.isArray(e)?e.join(` `):e}var W5=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function G5(e,t,n){for(let r in t)!d6(t[r])&&!M8(r,n)&&(e[r]=t[r])}function Ume({transformTemplate:e},t){return(0,I.useMemo)(()=>{let n=W5();return D8(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Wme(e,t){let n=e.style||{},r={};return G5(r,n,e),Object.assign(r,Ume(e,t)),r}function Gme(e,t){let n={},r=Wme(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var K5=()=>({...W5(),attrs:{}});function Kme(e,t,n,r){let i=(0,I.useMemo)(()=>{let n=K5();return P8(n,t,I8(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};G5(t,e.style,e),i.style={...t,...i.style}}return i}var qme=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function q5(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(qme.indexOf(e)>-1||/[A-Z]/u.test(e))}function Jme(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??q5(e)?Kme:Gme)(t,r,i,e),c=Bme(t,typeof e==`string`,a),l=e===I.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,I.useMemo)(()=>d6(u)?u.get():u,[u]);return(0,I.createElement)(e,{...l,children:d})}function Yme({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Xme(n,r,i,e),renderState:t()}}function Xme(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=g5(a[e]);let{initial:o,animate:s}=e,c=t8(e),l=n8(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Z6(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=i6(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var J5=e=>(t,n)=>{let r=(0,I.useContext)(H5),i=(0,I.useContext)(F2),a=()=>Yme(e,t,r,i);return n?a():Jue(a)},Zme=J5({scrapeMotionValuesFromProps:N8,createRenderState:W5}),Qme=J5({scrapeMotionValuesFromProps:L8,createRenderState:K5}),$me=Symbol.for(`motionComponentSymbol`);function ehe(e,t,n){let r=(0,I.useRef)(n);(0,I.useInsertionEffect)(()=>{r.current=n});let i=(0,I.useRef)(null);return(0,I.useCallback)(n=>{n&&e.onMount?.(n);let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n);t&&(n?t.mount(n):t.unmount())},[t])}var Y5=(0,I.createContext)({});function X5(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function the(e,t,n,r,i,a){let{visualElement:o}=(0,I.useContext)(H5),s=(0,I.useContext)(F5),c=(0,I.useContext)(F2),l=(0,I.useContext)(P5),u=l.reducedMotion,d=l.skipAnimations,f=(0,I.useRef)(null),p=(0,I.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,I.useContext)(Y5);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&nhe(f.current,n,i,h);let g=(0,I.useRef)(!1);(0,I.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[m6],v=(0,I.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return Yue(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,I.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function nhe(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Z5(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&X5(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Z5(e){if(e)return e.options.allowProjection===!1?Z5(e.parent):e.projection}function Q5(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Fme(r);let a=n?n===`svg`:q5(e),o=a?Qme:Zme;function s(n,s){let c,l={...(0,I.useContext)(P5),...n,layoutId:rhe(n)},{isStatic:u}=l,d=Hme(n),f=o(n,u);if(!u&&typeof window<`u`){ihe(l,r);let t=ahe(l);c=t.MeasureLayout,d.visualElement=the(e,f,l,i,t.ProjectionNode,a)}return(0,U.jsxs)(H5.Provider,{value:d,children:[c&&d.visualElement?(0,U.jsx)(c,{visualElement:d.visualElement,...l}):null,Jme(e,n,ehe(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,I.forwardRef)(s);return c[$me]=e,c}function rhe({layoutId:e}){let t=(0,I.useContext)(P2).id;return t&&e!==void 0?t+`-`+e:e}function ihe(e,t){(0,I.useContext)(F5).strict}function ahe(e){let{drag:t,layout:n}=R5();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function ohe(e,t){if(typeof Proxy>`u`)return Q5;let n=new Map,r=(n,r)=>Q5(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Q5(a,void 0,e,t)),n.get(a))})}var she=(e,t)=>t.isSVG??q5(e)?new Bpe(t):new Ppe(t,{allowProjection:e!==I.Fragment}),che=class extends l8{constructor(e){super(e),e.animationState||=Gpe(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Z6(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},lhe=0,uhe={animation:{Feature:che},exit:{Feature:class extends l8{constructor(){super(...arguments),this.id=lhe++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`){let n=a6(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function $5(e){return{point:{x:e.pageX,y:e.pageY}}}var dhe=e=>t=>P6(t)&&e(t,$5(t));function e7(e,t,n,r){return h5(e,t,dhe(n),r)}var t7=({current:e})=>e?e.ownerDocument.defaultView:null,n7=(e,t)=>Math.abs(e-t);function fhe(e,t){let n=n7(e.x,t.x),r=n7(e.y,t.y);return Math.sqrt(n**2+r**2)}var r7=new Set([`auto`,`scroll`]),i7=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=a7(this.lastRawMoveEventInfo,this.transformPagePoint));let e=s7(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=fhe(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=_4;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=a7(t,this.transformPagePoint),h4.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=s7(e.type===`pointercancel`?this.lastMoveEventInfo:a7(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!P6(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=a7($5(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=_4;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,s7(s,this.history)),this.removeListeners=G2(e7(this.contextWindow,`pointermove`,this.handlePointerMove),e7(this.contextWindow,`pointerup`,this.handlePointerUp),e7(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(r7.has(e.overflowX)||r7.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),h4.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),g4(this.updatePoint)}};function a7(e,t){return t?{point:t(e.point)}:e}function o7(e,t){return{x:e.x-t.x,y:e.y-t.y}}function s7({point:e},t){return{point:e,delta:o7(e,c7(t)),offset:o7(e,phe(t)),velocity:mhe(t,.1)}}function phe(e){return e[0]}function c7(e){return e[e.length-1]}function mhe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=c7(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>J2(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>J2(t)*2&&(r=e[1]);let a=Y2(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function hhe(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Z4(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Z4(n,e,r.max):Math.min(e,n)),e}function l7(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function ghe(e,{top:t,left:n,bottom:r,right:i}){return{x:l7(e.x,n,i),y:l7(e.y,t,r)}}function u7(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function _he(e,t){return{x:u7(e.x,t.x),y:u7(e.y,t.y)}}function vhe(e,t){let n=.5,r=q8(e),i=q8(t);return i>r?n=K2(t.min,t.max-r,e.min):r>i&&(n=K2(e.min,e.max-i,t.min)),R2(0,1,n)}function yhe(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var d7=.35;function bhe(e=d7){return e===!1?e=0:e===!0&&(e=d7),{x:f7(e,`left`,`right`),y:f7(e,`top`,`bottom`)}}function f7(e,t,n){return{min:p7(e,t),max:p7(e,n)}}function p7(e,t){return typeof e==`number`?e:e[t]||0}var xhe=new WeakMap,She=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=X6(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor($5(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=$fe(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),l5(e=>{let t=this.getAxisMotionValue(e).get()||0;if(R4.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=q8(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&h4.update(()=>i(e,t),!1,!0),f6(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=whe(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&h4.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new i7(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:t7(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&h4.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!h7(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=hhe(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&X5(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=ghe(n.layoutBox,e):this.constraints=!1,this.elastic=bhe(t),r!==this.constraints&&!X5(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&l5(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=yhe(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!X5(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=Ope(n,r.root,this.visualElement.getTransformPagePoint()),a=_he(r.layout.layoutBox,i);if(t){let e=t(Tpe(a));this.hasMutatedConstraints=!!e,e&&(a=u8(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=l5(o=>{if(!h7(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return f6(this.visualElement,e),n.start(n6(e,n,0,t,this.visualElement,!1))}stopAnimation(){l5(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){l5(t=>{let{drag:n}=this.getProps();if(!h7(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-Z4(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!X5(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};l5(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=vhe({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),l5(t=>{if(!h7(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Z4(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;xhe.set(this.visualElement,this);let e=this.visualElement.current,t=e7(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&ape(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();X5(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Che(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),h4.read(r);let o=h5(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(l5(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=d7,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function m7(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Che(e,t,n){let r=K6(e,m7(n)),i=K6(t,m7(n));return()=>{r(),i()}}function h7(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function whe(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var The=class extends l8{constructor(e){super(e),this.removeGroupControls=W2,this.removeListeners=W2,this.controls=new She(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||W2}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},g7=e=>(t,n)=>{e&&h4.update(()=>e(t,n),!1,!0)},Ehe=class extends l8{constructor(){super(...arguments),this.removePointerDownListener=W2}onPointerDown(e){this.session=new i7(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:t7(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:g7(e),onStart:g7(t),onMove:g7(n),onEnd:(e,t)=>{delete this.session,r&&h4.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=e7(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},_7=!1,Dhe=class extends I.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),_7&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),_5.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),_7=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||h4.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),k6.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;_7=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function v7(e){let[t,n]=Nme(),r=(0,I.useContext)(P2);return(0,U.jsx)(Dhe,{...e,layoutGroup:r,switchLayoutGroup:(0,I.useContext)(Y5),isPresent:t,safeToRemove:n})}var Ohe={pan:{Feature:Ehe},drag:{Feature:The,ProjectionNode:N5,MeasureLayout:v7}};function y7(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&h4.postRender(()=>i(t,$5(t)))}var khe=class extends l8{mount(){let{current:e}=this.node;e&&(this.unmount=tpe(e,(e,t)=>(y7(this.node,t,`Start`),e=>y7(this.node,e,`End`))))}unmount(){}},Ahe=class extends l8{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=G2(h5(this.node.current,`focus`,()=>this.onFocus()),h5(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function b7(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&h4.postRender(()=>i(t,$5(t)))}var jhe=class extends l8{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=spe(e,(e,t)=>(b7(this.node,t,`Start`),(e,{success:t})=>b7(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},x7=new WeakMap,S7=new WeakMap,Mhe=e=>{let t=x7.get(e.target);t&&t(e)},Nhe=e=>{e.forEach(Mhe)};function Phe({root:e,...t}){let n=e||document;S7.has(n)||S7.set(n,{});let r=S7.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Nhe,{root:e,...t})),r[i]}function Fhe(e,t,n){let r=Phe(t);return x7.set(e,n),r.observe(e),()=>{x7.delete(e),r.unobserve(e)}}var Ihe={some:0,all:1},Lhe=class extends l8{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Ihe[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Fhe(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Rhe(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Rhe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var zhe={inView:{Feature:Lhe},tap:{Feature:jhe},focus:{Feature:Ahe},hover:{Feature:khe}},Bhe={layout:{ProjectionNode:N5,MeasureLayout:v7}},Vhe=ohe({...uhe,...zhe,...Ohe,...Bhe},she),C7=new Map,Hhe=e=>{let t=C7.get(e);return t||(t=Vhe.create(e),C7.set(e,t)),t},Uhe=(0,I.memo)(({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2})=>{let a=Hhe(t),o=(0,I.useMemo)(()=>(e?.length??0)*i,[e,i]);return(0,U.jsx)(a,{animate:{backgroundPosition:`0% center`},className:Pg(`relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent`,`[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]`,n),initial:{backgroundPosition:`100% center`},style:{"--spread":`${o}px`,backgroundImage:`var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))`},transition:{duration:r,ease:`linear`,repeat:1/0},children:e})}),w7=(0,I.createContext)(null),Whe=()=>{let e=(0,I.useContext)(w7);if(!e)throw Error(`Reasoning components must be used within Reasoning`);return e},Ghe=1e3,Khe=1e3,T7=(0,I.memo)(({className:e,isStreaming:t=!1,open:n,defaultOpen:r,onOpenChange:i,duration:a,children:o,...s})=>{let c=r??t,l=r===!1,[u,d]=B0({defaultProp:c,onChange:i,prop:n}),[f,p]=B0({defaultProp:void 0,prop:a}),m=(0,I.useRef)(t),[h,g]=(0,I.useState)(!1),_=(0,I.useRef)(null);(0,I.useEffect)(()=>{t?(m.current=!0,_.current===null&&(_.current=Date.now())):_.current!==null&&(p(Math.ceil((Date.now()-_.current)/Khe)),_.current=null)},[t,p]),(0,I.useEffect)(()=>{t&&!u&&!l&&d(!0)},[t,u,d,l]),(0,I.useEffect)(()=>{if(m.current&&!t&&u&&!h){let e=setTimeout(()=>{d(!1),g(!0)},Ghe);return()=>clearTimeout(e)}},[t,u,d,h]);let v=(0,I.useCallback)(e=>{d(e)},[d]),y=(0,I.useMemo)(()=>({duration:f,isOpen:u,isStreaming:t,setIsOpen:d}),[f,u,t,d]);return(0,U.jsx)(w7.Provider,{value:y,children:(0,U.jsx)(j2,{className:Pg(`not-prose mb-4`,e),onOpenChange:v,open:u,...s,children:o})})}),qhe=(e,t)=>e||t===0?(0,U.jsx)(Uhe,{duration:1,children:`Thinking...`}):t===void 0?(0,U.jsx)(`p`,{children:`Thought for a few seconds`}):(0,U.jsxs)(`p`,{children:[`Thought for `,t,` seconds`]}),E7=(0,I.memo)(({className:e,children:t,getThinkingMessage:n=qhe,...r})=>{let{isStreaming:i,isOpen:a,duration:o}=Whe();return(0,U.jsx)(M2,{className:Pg(`flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,e),...r,children:t??(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Zg,{className:`size-4`}),n(i,o),(0,U.jsx)(Qg,{className:Pg(`size-4 transition-transform`,a?`rotate-180`:`rotate-0`)})]})})}),Jhe={cjk:GC,code:ij,math:yM,mermaid:eL},D7=(0,I.memo)(({className:e,children:t,...n})=>(0,U.jsx)(N2,{className:Pg(`mt-4 text-sm`,`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...n,children:(0,U.jsx)(M0,{plugins:Jhe,children:t})}));T7.displayName=`Reasoning`,E7.displayName=`ReasoningTrigger`,D7.displayName=`ReasoningContent`;var Yhe=({className:e,...t})=>(0,U.jsx)(j2,{className:Pg(`not-prose mb-4 text-blue-500 text-xs`,e),...t}),Xhe=({className:e,count:t,children:n,...r})=>(0,U.jsx)(M2,{className:Pg(`flex items-center gap-2`,e),...r,children:n??(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`font-medium`,children:[`Used `,t,` sources`]}),(0,U.jsx)(Qg,{className:`h-4 w-4`})]})}),Zhe=({className:e,...t})=>(0,U.jsx)(N2,{className:Pg(`mt-3 flex w-fit flex-col gap-2`,`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...t}),Qhe=({href:e,title:t,children:n,...r})=>(0,U.jsx)(`a`,{className:`flex items-center gap-2`,href:e,rel:`noreferrer`,target:`_blank`,...r,children:n??(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Xg,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{className:`block font-medium`,children:t})]})}),$he=()=>typeof window>`u`?`none`:`SpeechRecognition`in window||`webkitSpeechRecognition`in window?`speech-recognition`:`MediaRecorder`in window&&`mediaDevices`in navigator?`media-recorder`:`none`,ege=({className:e,onTranscriptionChange:t,onAudioRecorded:n,lang:r=`en-US`,...i})=>{let[a,o]=(0,I.useState)(!1),[s,c]=(0,I.useState)(!1),[l]=(0,I.useState)($he),[u,d]=(0,I.useState)(!1),f=(0,I.useRef)(null),p=(0,I.useRef)(null),m=(0,I.useRef)(null),h=(0,I.useRef)([]),g=(0,I.useRef)(t),_=(0,I.useRef)(n);g.current=t,_.current=n,(0,I.useEffect)(()=>{if(l!==`speech-recognition`)return;let e=new(window.SpeechRecognition||window.webkitSpeechRecognition);e.continuous=!0,e.interimResults=!0,e.lang=r;let t=()=>{o(!0)},n=()=>{o(!1)},i=e=>{let t=e,n=``;for(let e=t.resultIndex;e<t.results.length;e+=1){let r=t.results[e];r.isFinal&&(n+=r[0]?.transcript??``)}n&&g.current?.(n)},a=()=>{o(!1)};return e.addEventListener(`start`,t),e.addEventListener(`end`,n),e.addEventListener(`result`,i),e.addEventListener(`error`,a),f.current=e,d(!0),()=>{e.removeEventListener(`start`,t),e.removeEventListener(`end`,n),e.removeEventListener(`result`,i),e.removeEventListener(`error`,a),e.stop(),f.current=null,d(!1)}},[l,r]),(0,I.useEffect)(()=>()=>{if(p.current?.state===`recording`&&p.current.stop(),m.current)for(let e of m.current.getTracks())e.stop()},[]);let v=(0,I.useCallback)(async()=>{if(_.current)try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});m.current=e;let t=new MediaRecorder(e);h.current=[],t.addEventListener(`dataavailable`,e=>{e.data.size>0&&h.current.push(e.data)}),t.addEventListener(`stop`,async()=>{for(let t of e.getTracks())t.stop();m.current=null;let t=new Blob(h.current,{type:`audio/webm`});if(t.size>0&&_.current){c(!0);try{let e=await _.current(t);e&&g.current?.(e)}catch{}finally{c(!1)}}}),t.addEventListener(`error`,()=>{o(!1);for(let t of e.getTracks())t.stop();m.current=null}),p.current=t,t.start(),o(!0)}catch{o(!1)}},[]),y=(0,I.useCallback)(()=>{p.current?.state===`recording`&&p.current.stop(),o(!1)},[]),b=(0,I.useCallback)(()=>{l===`speech-recognition`&&f.current?a?f.current.stop():f.current.start():l===`media-recorder`&&(a?y():v())},[l,a,v,y]),x=l===`none`||l===`speech-recognition`&&!u||l===`media-recorder`&&!n||s;return(0,U.jsxs)(`div`,{className:`relative inline-flex items-center justify-center`,children:[a&&[0,1,2].map(e=>(0,U.jsx)(`div`,{className:`absolute inset-0 animate-ping rounded-full border-2 border-red-400/30`,style:{animationDelay:`${e*.3}s`,animationDuration:`2s`}},e)),(0,U.jsxs)(Rg,{className:Pg(`relative z-10 rounded-full transition-all duration-300`,a?`bg-destructive text-white hover:bg-destructive/80 hover:text-white`:`bg-primary text-primary-foreground hover:bg-primary/80 hover:text-primary-foreground`,e),disabled:x,onClick:b,...i,children:[s&&(0,U.jsx)(C2,{}),!s&&a&&(0,U.jsx)(c_,{className:`size-4`}),!(s||a)&&(0,U.jsx)(Lee,{className:`size-4`})]})]})},tge=Th(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function nge({className:e,variant:t=`default`,render:n,...r}){return __({defaultTagName:`span`,props:Bm({className:Pg(tge({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var O7=Object.defineProperty,rge=Object.getOwnPropertyDescriptor,ige=Object.getOwnPropertyNames,age=Object.prototype.hasOwnProperty,oge=(e,t)=>{let n={};for(var r in e)O7(n,r,{get:e[r],enumerable:!0});return t||O7(n,Symbol.toStringTag,{value:`Module`}),n},k7=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=ige(t),a=0,o=i.length,s;a<o;a++)s=i[a],!age.call(e,s)&&s!==n&&O7(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=rge(t,s))||r.enumerable});return e},sge=(e,t,n)=>(k7(e,t,`default`),n&&k7(n,t,`default`)),A7=[{id:`abap`,name:`ABAP`,import:(()=>a(()=>import(`./abap-DEw-ytka.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>a(()=>import(`./actionscript-3-NjMaEqxm.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>a(()=>import(`./ada-D1crdu9n.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>a(()=>import(`./angular-html-CN-oUuJC.js`).then(e=>e.n),__vite__mapDeps([179,1,180,181,182])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>a(()=>import(`./angular-ts-CEjZNKjD.js`),__vite__mapDeps([183,179,1,180,181,182,184])))},{id:`apache`,name:`Apache Conf`,import:(()=>a(()=>import(`./apache-BU0c7pjA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>a(()=>import(`./apex-Dz9XKIUc.js`),[]))},{id:`apl`,name:`APL`,import:(()=>a(()=>import(`./apl-DACEo0-x.js`),__vite__mapDeps([185,181,1,180,182,186,187,188])))},{id:`applescript`,name:`AppleScript`,import:(()=>a(()=>import(`./applescript-B5aRViMe.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>a(()=>import(`./ara-C0aUsn4V.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>a(()=>import(`./asciidoc-CQvfQEL9.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>a(()=>import(`./asm-C93Oxq_W.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>a(()=>import(`./astro-HPRMwo6l.js`),__vite__mapDeps([189,181,1,182,186,190,191,192])))},{id:`awk`,name:`AWK`,import:(()=>a(()=>import(`./awk-CNh12CRX.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>a(()=>import(`./ballerina-D8IYaCEW.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>a(()=>import(`./bat-BPVLKtyY.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>a(()=>import(`./beancount-BkCejn-7.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>a(()=>import(`./berry-Ds_94e1p.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>a(()=>import(`./bibtex-DBYHisql.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>a(()=>import(`./bicep-Dda_2XPg.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>a(()=>import(`./bird2-C2d-m_on.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>a(()=>import(`./blade-Bjl4HM5c.js`),__vite__mapDeps([193,181,1,194,180,182,186,195,187,188])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>a(()=>import(`./bsl-B3BrAsEz.js`),__vite__mapDeps([196,197])))},{id:`c`,name:`C`,import:(()=>a(()=>import(`./c-DEubApYE.js`).then(e=>e.n),__vite__mapDeps([198,1])))},{id:`c3`,name:`C3`,import:(()=>a(()=>import(`./c3-BGVpdz6r.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>a(()=>import(`./cadence-868sbukE.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>a(()=>import(`./cairo-L63OfEBR.js`),__vite__mapDeps([199,200])))},{id:`clarity`,name:`Clarity`,import:(()=>a(()=>import(`./clarity-B3UJkPxd.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>a(()=>import(`./clojure-BiUb_Zcv.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>a(()=>import(`./cmake-DN3FQlbu.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>a(()=>import(`./cobol-gniUFOQQ.js`),__vite__mapDeps([201,180,1,181,182,188])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>a(()=>import(`./codeowners-CF76rPWz.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>a(()=>import(`./codeql-OMvyF1Vm.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>a(()=>import(`./coffee-7S08yxyy.js`),__vite__mapDeps([202,182,1])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>a(()=>import(`./common-lisp-BFC6s0Hr.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>a(()=>import(`./coq-nkzDPDXk.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>a(()=>import(`./cpp-BilQwc5N.js`).then(e=>e.n),__vite__mapDeps([203,1,204,198,205,195])))},{id:`crystal`,name:`Crystal`,import:(()=>a(()=>import(`./crystal-DAdHHBqa.js`),__vite__mapDeps([206,198,1,181,180,182,207,195])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>a(()=>import(`./csharp-5rgSmf3e.js`),[]))},{id:`css`,name:`CSS`,import:(()=>a(()=>import(`./css-C3CK0M7i.js`).then(e=>e.n),__vite__mapDeps([181,1])))},{id:`csv`,name:`CSV`,import:(()=>a(()=>import(`./csv-B5Jk7o4Y.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>a(()=>import(`./cue-DB7kMLUQ.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>a(()=>import(`./cypher-1xPoeOFE.js`),[]))},{id:`d`,name:`D`,import:(()=>a(()=>import(`./d-h9rO0PPz.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>a(()=>import(`./dart-w9F20R4Y.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>a(()=>import(`./dax-CeP2uyBs.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>a(()=>import(`./desktop-CaU9spI1.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>a(()=>import(`./diff-B2brsVH-.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>a(()=>import(`./docker-CrOtGssp.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>a(()=>import(`./dotenv-BWO24pQo.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>a(()=>import(`./dream-maker-w9bz-hhe.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>a(()=>import(`./edge-BQAK3QiZ.js`),__vite__mapDeps([208,194,180,1,181,182,192])))},{id:`elixir`,name:`Elixir`,import:(()=>a(()=>import(`./elixir-DKTCBd6g.js`),__vite__mapDeps([209,180,1,181,182])))},{id:`elm`,name:`Elm`,import:(()=>a(()=>import(`./elm-Cjv0Jh-u.js`),__vite__mapDeps([210,204,1,198])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>a(()=>import(`./emacs-lisp-fgKIhTSf.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>a(()=>import(`./erb-K6mwyzz7.js`),__vite__mapDeps([211,180,1,181,182,212,198,203,204,205,195,213,214,191,192,215,216,207,187,188,217])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>a(()=>import(`./erlang-854X-Vkg.js`),__vite__mapDeps([218,219])))},{id:`fennel`,name:`Fennel`,import:(()=>a(()=>import(`./fennel-C9sUWYmM.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>a(()=>import(`./fish-Ckt8YNBH.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>a(()=>import(`./fluent-BvPlpfp_.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>a(()=>import(`./fortran-fixed-form-BlmyIOK8.js`),__vite__mapDeps([220,221])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>a(()=>import(`./fortran-free-form-CI2ch69g.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>a(()=>import(`./fsharp-D3Ezbq1E.js`),__vite__mapDeps([222,219])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>a(()=>import(`./gdresource-BvGFcTeE.js`),__vite__mapDeps([223,224,225])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>a(()=>import(`./gdscript-Cn_fDlI9.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>a(()=>import(`./gdshader-DLLpHgjs.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>a(()=>import(`./genie-C_vhHuW2.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>a(()=>import(`./gherkin-bcEcwbQE.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>a(()=>import(`./git-commit-ByANLFBY.js`),__vite__mapDeps([226,227])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>a(()=>import(`./git-rebase-Gmx06j0y.js`),__vite__mapDeps([228,207,1])))},{id:`gleam`,name:`Gleam`,import:(()=>a(()=>import(`./gleam-Blb-3EAI.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>a(()=>import(`./glimmer-js-CNdBQpaG.js`),__vite__mapDeps([229,181,1,180,182,192])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>a(()=>import(`./glimmer-ts-CVzFNZoD.js`),__vite__mapDeps([230,181,1,180,182,192])))},{id:`glsl`,name:`GLSL`,import:(()=>a(()=>import(`./glsl-CC87e7NK.js`).then(e=>e.n),__vite__mapDeps([204,1,198])))},{id:`gn`,name:`GN`,import:(()=>a(()=>import(`./gn-eXxL0uTU.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>a(()=>import(`./gnuplot-DR6sSoUN.js`),[]))},{id:`go`,name:`Go`,import:(()=>a(()=>import(`./go-8OtLvWbL.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>a(()=>import(`./graphql-DAjFE8Zq.js`).then(e=>e.n),__vite__mapDeps([213,1,182,214,191,192])))},{id:`groovy`,name:`Groovy`,import:(()=>a(()=>import(`./groovy-Cq9dX6D8.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>a(()=>import(`./hack-C8GWHc9h.js`),__vite__mapDeps([231,180,1,181,182,195])))},{id:`haml`,name:`Ruby Haml`,import:(()=>a(()=>import(`./haml-CaM4dYj1.js`).then(e=>e.n),__vite__mapDeps([215,1,181,182])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>a(()=>import(`./handlebars-DjNwk9Sx.js`),__vite__mapDeps([232,181,1,180,182,217])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>a(()=>import(`./haskell-zlo0doPn.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>a(()=>import(`./haxe-DPy34i1e.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>a(()=>import(`./hcl-AXfIfXWb.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>a(()=>import(`./hjson-Dzh0r5YU.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>a(()=>import(`./hlsl-hBgRvA5h.js`),[]))},{id:`html`,name:`HTML`,import:(()=>a(()=>import(`./html-D8iPLU6I.js`).then(e=>e.n),__vite__mapDeps([180,1,181,182])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>a(()=>import(`./html-derivative-DqiucELS.js`),__vite__mapDeps([194,180,1,181,182])))},{id:`http`,name:`HTTP`,import:(()=>a(()=>import(`./http-DpYDdgnl.js`),__vite__mapDeps([233,213,1,182,214,191,192,186,207,187,188])))},{id:`hurl`,name:`Hurl`,import:(()=>a(()=>import(`./hurl-CcMs5xSG.js`),__vite__mapDeps([234,235,213,1,182,214,191,192,187,188])))},{id:`hxml`,name:`HXML`,import:(()=>a(()=>import(`./hxml-os4YOtH3.js`),__vite__mapDeps([236,237])))},{id:`hy`,name:`Hy`,import:(()=>a(()=>import(`./hy-6di7IE4u.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>a(()=>import(`./imba-BuBsAMVd.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>a(()=>import(`./ini-D-53CZkr.js`),[]))},{id:`java`,name:`Java`,import:(()=>a(()=>import(`./java-VNxxuvqq.js`).then(e=>e.n),__vite__mapDeps([188,1])))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>a(()=>import(`./javascript-DAbF-03M.js`).then(e=>e.n),__vite__mapDeps([182,1])))},{id:`jinja`,name:`Jinja`,import:(()=>a(()=>import(`./jinja-KAOzhQ3w.js`),__vite__mapDeps([238,180,1,181,182])))},{id:`jison`,name:`Jison`,import:(()=>a(()=>import(`./jison-DW7mGPaf.js`),__vite__mapDeps([239,182,1])))},{id:`json`,name:`JSON`,import:(()=>a(()=>import(`./json-DAgnK7sT.js`).then(e=>e.n),__vite__mapDeps([186,1])))},{id:`json5`,name:`JSON5`,import:(()=>a(()=>import(`./json5-dkZg0_kE.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>a(()=>import(`./jsonc-CNyHPesk.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>a(()=>import(`./jsonl--hQ-PkQH.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>a(()=>import(`./jsonnet-C2u49LY7.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>a(()=>import(`./jssm-BoaFqeIP.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>a(()=>import(`./jsx-IPXvK94g.js`).then(e=>e.n),__vite__mapDeps([214,1])))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>a(()=>import(`./julia-CZ7LtBOW.js`),__vite__mapDeps([240,203,1,204,198,205,195,182,200,241])))},{id:`just`,name:`Just`,import:(()=>a(()=>import(`./just-C4ZEGXKz.js`),__vite__mapDeps([242,182,1,243,181,180,195,187,188,200,212,198,203,204,205,213,214,191,192,215,216,207,217])))},{id:`kdl`,name:`KDL`,import:(()=>a(()=>import(`./kdl-CLgDL0sU.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>a(()=>import(`./kotlin-CcI5qkQD.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>a(()=>import(`./kusto-8mcDZBBR.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>a(()=>import(`./latex-D5mgYlGy.js`),__vite__mapDeps([244,245,241,1])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>a(()=>import(`./lean-YSuPS8ym.js`),[]))},{id:`less`,name:`Less`,import:(()=>a(()=>import(`./less-B3Az5CZP.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>a(()=>import(`./liquid-dGJBZQSH.js`),__vite__mapDeps([246,181,1,180,182,186])))},{id:`llvm`,name:`LLVM IR`,import:(()=>a(()=>import(`./llvm-BqFhFWyI.js`),[]))},{id:`log`,name:`Log file`,import:(()=>a(()=>import(`./log-Dr_xZn5E.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>a(()=>import(`./logo-BV0NClW5.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>a(()=>import(`./lua-NRA7hr4c.js`).then(e=>e.n),__vite__mapDeps([216,1,198])))},{id:`luau`,name:`Luau`,import:(()=>a(()=>import(`./luau-x-CHBZ0g.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>a(()=>import(`./make-DcWco_Qw.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>a(()=>import(`./markdown-BUyNNbS6.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>a(()=>import(`./marko-BnzvVMtv.js`),__vite__mapDeps([247,181,1,248,184,192])))},{id:`matlab`,name:`MATLAB`,import:(()=>a(()=>import(`./matlab-DW67WroE.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>a(()=>import(`./mdc-C2AkezyX.js`),__vite__mapDeps([249,194,180,1,181,182,219,217])))},{id:`mdx`,name:`MDX`,import:(()=>a(()=>import(`./mdx-Z80sy4I9.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>a(()=>import(`./mermaid-CnxxpbD1.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>a(()=>import(`./mipsasm-IHm8ER3C.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>a(()=>import(`./mojo-B1Vcym8n.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>a(()=>import(`./moonbit-4Y6qx4j9.js`),[]))},{id:`move`,name:`Move`,import:(()=>a(()=>import(`./move-BtPkCJ_n.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>a(()=>import(`./narrat-CwtsVw7-.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>a(()=>import(`./nextflow-COAS20q4.js`),__vite__mapDeps([250,251])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>a(()=>import(`./nextflow-groovy-CaPjvDOT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>a(()=>import(`./nginx-DogIU8Cr.js`),__vite__mapDeps([252,216,1,198])))},{id:`nim`,name:`Nim`,import:(()=>a(()=>import(`./nim-BMEfrxHp.js`),__vite__mapDeps([253,198,1,181,204,180,182,219,187,188])))},{id:`nix`,name:`Nix`,import:(()=>a(()=>import(`./nix-CvR_GVC9.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>a(()=>import(`./nushell-D4b0tHF-.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>a(()=>import(`./objective-c-BhGioKrL.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>a(()=>import(`./objective-cpp-BLKar0pv.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>a(()=>import(`./ocaml-D0dsKWvb.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>a(()=>import(`./odin-D9IfAld1.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>a(()=>import(`./openscad-x13QaAE3.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>a(()=>import(`./pascal-DuK9-mcX.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>a(()=>import(`./perl-CuqDFkdl.js`),__vite__mapDeps([243,181,1,180,182,195,187,188])))},{id:`php`,name:`PHP`,import:(()=>a(()=>import(`./php--PLUnv1_.js`),__vite__mapDeps([254,181,1,180,182,186,195,187,188])))},{id:`pkl`,name:`Pkl`,import:(()=>a(()=>import(`./pkl-CoKgcBV-.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>a(()=>import(`./plsql-XFmIdksZ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>a(()=>import(`./po-CWJgkWXW.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>a(()=>import(`./polar-DlPElveM.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>a(()=>import(`./postcss-9eGaqiLc.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>a(()=>import(`./powerquery-x3mZ5MQU.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>a(()=>import(`./powershell-BCDN19c9.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>a(()=>import(`./prisma-BPW6poE8.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>a(()=>import(`./prolog-CB2XGB07.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>a(()=>import(`./proto-BTArYX0j.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>a(()=>import(`./pug-D0RI5zMQ.js`),__vite__mapDeps([255,181,1,180,182])))},{id:`puppet`,name:`Puppet`,import:(()=>a(()=>import(`./puppet-Dwd-hIPC.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>a(()=>import(`./purescript-DzoEGt8C.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>a(()=>import(`./python-DpfQVtm0.js`),[]))},{id:`qml`,name:`QML`,import:(()=>a(()=>import(`./qml-oj8IuGxt.js`),__vite__mapDeps([256,182,1])))},{id:`qmldir`,name:`QML Directory`,import:(()=>a(()=>import(`./qmldir-DVsXRUzL.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>a(()=>import(`./qss-8ppOmHia.js`),[]))},{id:`r`,name:`R`,import:(()=>a(()=>import(`./r-dds2hvQq.js`).then(e=>e.n),__vite__mapDeps([241,1])))},{id:`racket`,name:`Racket`,import:(()=>a(()=>import(`./racket-CvRAM5cP.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>a(()=>import(`./raku-DSTlUG-i.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>a(()=>import(`./razor-2QM_kJd8.js`),__vite__mapDeps([257,258,180,1,181,182])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>a(()=>import(`./reg-BveEAlQW.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>a(()=>import(`./regexp-Bi9ZWB-y.js`).then(e=>e.n),__vite__mapDeps([205,1])))},{id:`rel`,name:`Rel`,import:(()=>a(()=>import(`./rel-DlPHYNcG.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>a(()=>import(`./riscv-70WeVC60.js`),[]))},{id:`ron`,name:`RON`,import:(()=>a(()=>import(`./ron-Dr6stZ6D.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>a(()=>import(`./rosmsg-BWp7x_Yo.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>a(()=>import(`./rst-D68_Abm0.js`),__vite__mapDeps([259,260,203,1,204,198,205,195,194,180,181,182,200,212,213,214,191,192,215,216,207,187,188,217])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>a(()=>import(`./ruby-CNbgP4lj.js`),__vite__mapDeps([212,198,1,203,204,205,195,181,213,182,214,191,192,215,180,216,207,187,188,217])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>a(()=>import(`./rust-DmXiP9xS.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>a(()=>import(`./sas-DNzvYLSr.js`),__vite__mapDeps([261,195,1])))},{id:`sass`,name:`Sass`,import:(()=>a(()=>import(`./sass-C8B5PQzu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>a(()=>import(`./scala-CZCYk8u9.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>a(()=>import(`./scheme-DBEzYfU2.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>a(()=>import(`./scss-BzL89aQS.js`).then(e=>e.n),__vite__mapDeps([184,1,181])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>a(()=>import(`./sdbl-CDokzS_i.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>a(()=>import(`./shaderlab-DdzrHzhQ.js`),__vite__mapDeps([262,263])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>a(()=>import(`./shellscript--2FuAbxC.js`).then(e=>e.n),__vite__mapDeps([207,1])))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>a(()=>import(`./shellsession-BaLMs3ov.js`),__vite__mapDeps([264,207,1])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>a(()=>import(`./smalltalk-BkSQfDKo.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>a(()=>import(`./solidity-DDsgmJO_.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>a(()=>import(`./soy-BhlV2IGI.js`),__vite__mapDeps([265,180,1,181,182])))},{id:`sparql`,name:`SPARQL`,import:(()=>a(()=>import(`./sparql-Is31kmha.js`),__vite__mapDeps([266,267])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>a(()=>import(`./splunk-sNBddUhj.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>a(()=>import(`./sql-CxglZSwu.js`).then(e=>e.n),__vite__mapDeps([195,1])))},{id:`ssh-config`,name:`SSH Config`,import:(()=>a(()=>import(`./ssh-config-DljnCiku.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>a(()=>import(`./stata-DZdYbt2n.js`),__vite__mapDeps([268,195,1])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>a(()=>import(`./stylus-B1u-SVqg.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>a(()=>import(`./surrealql-_wgtTEYI.js`),__vite__mapDeps([269,182,1])))},{id:`svelte`,name:`Svelte`,import:(()=>a(()=>import(`./svelte-CTPa36az.js`),__vite__mapDeps([270,181,1,182,190,192])))},{id:`swift`,name:`Swift`,import:(()=>a(()=>import(`./swift-CpkbKxtz.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>a(()=>import(`./system-verilog-YtSwQtDx.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>a(()=>import(`./systemd-B3FEWukQ.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>a(()=>import(`./talonscript-DLkEwr9f.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>a(()=>import(`./tasl-CbNn5YSS.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>a(()=>import(`./tcl-Cc88vQv_.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>a(()=>import(`./templ-CT6Esmfg.js`),__vite__mapDeps([271,181,1,272,182])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>a(()=>import(`./terraform-D3suSl1o.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>a(()=>import(`./tex-fm1tDdhM.js`),__vite__mapDeps([245,241,1])))},{id:`toml`,name:`TOML`,import:(()=>a(()=>import(`./toml-CQXSrY1Z.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>a(()=>import(`./ts-tags-Dw0RLmha.js`),__vite__mapDeps([273,181,1,204,198,180,182,195,192,187,188])))},{id:`tsv`,name:`TSV`,import:(()=>a(()=>import(`./tsv-CYOtlnGo.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>a(()=>import(`./tsx-BMhIw2y-.js`).then(e=>e.n),__vite__mapDeps([191,1])))},{id:`turtle`,name:`Turtle`,import:(()=>a(()=>import(`./turtle-DaqgDcgI.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>a(()=>import(`./twig-DtNCkasW.js`),__vite__mapDeps([274,181,1,182,254,180,186,195,187,188,200,212,198,203,204,205,213,214,191,192,215,216,207,217,184])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>a(()=>import(`./typescript-DKzlP5dN.js`).then(e=>e.n),__vite__mapDeps([192,1])))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>a(()=>import(`./typespec-CqtvXhCU.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>a(()=>import(`./typst-CGFEhtpU.js`),[]))},{id:`v`,name:`V`,import:(()=>a(()=>import(`./v-CGfJwJMp.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>a(()=>import(`./vala-IHBtelZF.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>a(()=>import(`./vb-CVD1JgU5.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>a(()=>import(`./verilog-C79KE1ci.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>a(()=>import(`./vhdl-Bn48Xzza.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>a(()=>import(`./viml-CSjTTzvj.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>a(()=>import(`./vue-CRmOVaU2.js`),__vite__mapDeps([275,181,1,194,180,182,186,192])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>a(()=>import(`./vue-html-BdZhxJqn.js`),__vite__mapDeps([276,182,1])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>a(()=>import(`./vue-vine-6M9IMSQp.js`),__vite__mapDeps([277,181,1,182,248,190,184,278])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>a(()=>import(`./vyper-ByfJ9Fje.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>a(()=>import(`./wasm-BCgaravS.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>a(()=>import(`./wenyan-De6g53Ja.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>a(()=>import(`./wgsl-DVJ4AWGL.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>a(()=>import(`./wikitext-BrMlYwxZ.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>a(()=>import(`./wit-jK5SFqgt.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>a(()=>import(`./wolfram-DVVu5yAi.js`),[]))},{id:`xml`,name:`XML`,import:(()=>a(()=>import(`./xml-BdbcNzO9.js`).then(e=>e.n),__vite__mapDeps([187,1,188])))},{id:`xsl`,name:`XSL`,import:(()=>a(()=>import(`./xsl-B8fg-QX6.js`),__vite__mapDeps([279,187,1,188])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>a(()=>import(`./yaml-jjteOoGO.js`).then(e=>e.n),__vite__mapDeps([217,1])))},{id:`zenscript`,name:`ZenScript`,import:(()=>a(()=>import(`./zenscript-B8t7M3X2.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>a(()=>import(`./zig-GK7ZbXfj.js`),[]))}],cge=Object.fromEntries(A7.map(e=>[e.id,e.import])),lge=Object.fromEntries(A7.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),uge={...cge,...lge},dge=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>a(()=>import(`./andromeeda-wUNV-8VH.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>a(()=>import(`./aurora-x-CClALSli.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>a(()=>import(`./ayu-dark-BSs4jHdS.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>a(()=>import(`./ayu-light-BDzoPUuB.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>a(()=>import(`./ayu-mirage-BjsUJrUc.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>a(()=>import(`./catppuccin-frappe-DLHLTCnF.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>a(()=>import(`./catppuccin-latte-DfCS_kJi.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>a(()=>import(`./catppuccin-macchiato-CR9A3_vc.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>a(()=>import(`./catppuccin-mocha-BSuJX63a.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>a(()=>import(`./dark-plus-C9X5Ve1L.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>a(()=>import(`./dracula-9O0NCT_h.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>a(()=>import(`./dracula-soft-C4h6XVJR.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>a(()=>import(`./everforest-dark-DC3iWRDz.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>a(()=>import(`./everforest-light-CIhs5wLb.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>a(()=>import(`./github-dark-DbXvKwaC.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>a(()=>import(`./github-dark-default-CobA03O1.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>a(()=>import(`./github-dark-dimmed-cxsH--DX.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>a(()=>import(`./github-dark-high-contrast-BjBB0JIk.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>a(()=>import(`./github-light-BE6sxIlE.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>a(()=>import(`./github-light-default-BNWs7XBL.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>a(()=>import(`./github-light-high-contrast-_RqafDwE.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>a(()=>import(`./gruvbox-dark-hard-DIiVjZ5v.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>a(()=>import(`./gruvbox-dark-medium-DDpVVAoZ.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>a(()=>import(`./gruvbox-dark-soft-o4E3Pbzg.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>a(()=>import(`./gruvbox-light-hard-D56454Fb.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>a(()=>import(`./gruvbox-light-medium-DiAMHDHG.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>a(()=>import(`./gruvbox-light-soft-DWYGGtE_.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>a(()=>import(`./horizon-40XnmAci.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>a(()=>import(`./horizon-bright-BbxOSClf.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>a(()=>import(`./houston-eZ8K4Kfk.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>a(()=>import(`./kanagawa-dragon-ZyI_KSxZ.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>a(()=>import(`./kanagawa-lotus-DPGGEFqt.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>a(()=>import(`./kanagawa-wave-BqT6GPCS.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>a(()=>import(`./laserwave-yHjXA698.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>a(()=>import(`./light-plus-CH089YvG.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>a(()=>import(`./material-theme-Bn5FQdaE.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>a(()=>import(`./material-theme-darker-B9rNV8V7.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>a(()=>import(`./material-theme-lighter-DiWQEMXo.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>a(()=>import(`./material-theme-ocean-DPoMg1Fu.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>a(()=>import(`./material-theme-palenight-CBBN6ELt.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>a(()=>import(`./min-dark-B_mocbvq.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>a(()=>import(`./min-light-BBSRoOCs.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>a(()=>import(`./monokai-O7aGo9VP.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>a(()=>import(`./night-owl-DPwAj-n1.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>a(()=>import(`./night-owl-light-CtFoG9Ch.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>a(()=>import(`./nord-4tR4EUY1.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>a(()=>import(`./one-dark-pro-oX5X9zOn.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>a(()=>import(`./one-light-DwurTX9w.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>a(()=>import(`./plastic-DIfRaaE3.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>a(()=>import(`./poimandres-CB89Guv8.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>a(()=>import(`./red-Re2PfUSD.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>a(()=>import(`./rose-pine-D8VgsokP.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>a(()=>import(`./rose-pine-dawn-D7EM3AW3.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>a(()=>import(`./rose-pine-moon-CjVxzuAw.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>a(()=>import(`./slack-dark-2MJp1HDM.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>a(()=>import(`./slack-ochin-CsJ-XTso.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>a(()=>import(`./snazzy-light-Camp4WtP.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>a(()=>import(`./solarized-dark-DDu7grB1.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>a(()=>import(`./solarized-light-BYMct7jG.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>a(()=>import(`./synthwave-84-DPp_gDgI.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>a(()=>import(`./tokyo-night-CjFWOaYp.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>a(()=>import(`./vesper-7jKoPtxy.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>a(()=>import(`./vitesse-black-DaToSKPE.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>a(()=>import(`./vitesse-dark-DSPFdD5i.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>a(()=>import(`./vitesse-light-CRe2ZnfQ.js`),[]))}].map(e=>[e.id,e.import])),fge=r({createOnigurumaEngine:()=>Age,getDefaultWasmLoader:()=>kge,loadWasm:()=>R7,setDefaultWasmLoader:()=>Oge}),j7=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function pge(){return 2147483648}function mge(){return typeof performance<`u`?performance.now():Date.now()}var hge=(e,t)=>e+(t-e%t)%t;async function gge(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=pge();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,hge(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:mge,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 _ge=Object.defineProperty,vge=(e,t,n)=>t in e?_ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M7=(e,t,n)=>vge(e,typeof t==`symbol`?t:t+``,n),N7=null;function yge(e){throw new j7(e.UTF8ToString(e.getLastOnigError()))}var P7=class e{constructor(t){M7(this,`utf16Length`),M7(this,`utf8Length`),M7(this,`utf16Value`),M7(this,`utf8Value`),M7(this,`utf16OffsetToUtf8`),M7(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)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},F7=class e{constructor(t){if(M7(this,`id`,++e.LAST_ID),M7(this,`_onigBinding`),M7(this,`content`),M7(this,`utf16Length`),M7(this,`utf8Length`),M7(this,`utf16OffsetToUtf8`),M7(this,`utf8OffsetToUtf16`),M7(this,`ptr`),!N7)throw new j7(`Must invoke loadWasm first.`);this._onigBinding=N7,this.content=t;let n=new P7(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=N7.omalloc(1e4),e._sharedPtrInUse=!0,N7.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(N7)}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)}};M7(F7,`LAST_ID`,0),M7(F7,`_sharedPtr`,0),M7(F7,`_sharedPtrInUse`,!1);var I7=F7,bge=class{constructor(e){if(M7(this,`_onigBinding`),M7(this,`_ptr`),!N7)throw new j7(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new P7(e[r]);t[r]=i.createString(N7),n[r]=i.utf8Length}let r=N7.omalloc(4*e.length);N7.HEAPU32.set(t,r/4);let i=N7.omalloc(4*e.length);N7.HEAPU32.set(n,i/4);let a=N7.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)N7.ofree(t[n]);N7.ofree(i),N7.ofree(r),a===0&&yge(N7),this._onigBinding=N7,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 I7(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 xge(e){return typeof e.instantiator==`function`}function Sge(e){return typeof e.default==`function`}function Cge(e){return e.data!==void 0}function wge(e){return typeof Response<`u`&&e instanceof Response}function Tge(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 L7;function R7(e){if(L7)return L7;async function t(){N7=await gge(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),xge(n)?n=await n.instantiator(t):Sge(n)?n=await n.default(t):(Cge(n)&&(n=n.data),wge(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await Ege(n)(t):await Dge(n)(t):Tge(n)||n instanceof WebAssembly.Module?n=await z7(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await z7(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return L7=t(),L7}function z7(e){return t=>WebAssembly.instantiate(e,t)}function Ege(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Dge(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var B7;function Oge(e){B7=e}function kge(){return B7}async function Age(e){return e&&await R7(e),{createScanner(e){return new bge(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new I7(e)}}}var V7=oge({});sge(V7,fge);var H7=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function U7(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 W7(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function jge(e){return Array.isArray(e)?e:[e]}async function G7(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function K7(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function q7(e){return e===`ansi`||K7(e)}function J7(e){return e===`none`}function Y7(e){return J7(e)}function X7(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(/(\r?\n)/g),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 Z7={light:`#333333`,dark:`#bbbbbb`},Q7={light:`#fffffe`,dark:`#1e1e1e`},$7=`__shiki_resolved`;function e9(e){if(e?.[$7])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`?Z7.light:Z7.dark,n||=t.type===`light`?Q7.light:Q7.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,$7,{enumerable:!1,writable:!1,value:!0}),t}async function t9(e){return Array.from(new Set((await Promise.all(e.filter(e=>!q7(e)).map(async e=>await G7(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function n9(e){return(await Promise.all(e.map(async e=>Y7(e)?null:e9(await G7(e))))).filter(e=>!!e)}function r9(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 H7(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Mge=class extends Vw{_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=e9(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=rw.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=r9(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=Array.from(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 H7(`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))}},Nge=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}},i9=0;function Pge(e){i9+=1,e.warnings!==!1&&i9>=10&&i9%10==0&&console.warn(`[Shiki] ${i9} 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 H7("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(e9),i=new Mge(new Nge(e.engine,n),r,n,e.langAlias),a;function o(t){return r9(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new H7(`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 H7(`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 t9(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await n9(e))}function g(){if(t)throw new H7(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--i9)}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 Fge(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([n9(e.themes||[]),t9(e.langs||[]),e.engine]);return Pge({...e,themes:t,langs:n,engine:r})}var a9=new WeakMap;function o9(e,t){a9.set(e,t)}function s9(e){return a9.get(e)}var c9=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(jge(n).map(e=>[e,Hw])),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 Ige(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Ige(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 Lge(e,t){if(!(e instanceof c9))throw new H7(`Invalid grammar state`);return e.getInternalStack(t)}function l9(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(K7(e.resolveLangAlias(n.lang||`text`))||J7(r))return X7(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 H7(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new H7(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return zge(t,o,i,a,n)}function Rge(...e){if(e.length===2)return s9(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(K7(i)||J7(a))throw new H7(`Plain language does not have grammar state`);if(i===`ansi`)throw new H7(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new c9(u9(n,c,o,s,r).stateStack,c.name,o.name)}function zge(e,t,n,r,i){let a=u9(e,t,n,r,i),o=new c9(a.stateStack,t.name,n.name);return o9(a.tokens,o),a.tokens}function u9(e,t,n,r,i){let a=U7(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=X7(e),l=i.grammarState?Lge(i.grammarState,n.name)??Hw:i.grammarContextCode==null?Hw:u9(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,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]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=W7(r[cw.getForeground(s)],a),l=cw.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(/,/).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?Bge(t.scopes):Vge(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function Bge(e){return e.map(e=>({scopeName:e}))}function Vge(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Uge(e,i,t.slice(0,r))}}return n}function d9(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Hge(e,t,n){if(!d9(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)d9(e[r],n[i])&&--r,--i;return r===-1}function Uge(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Hge(e,t,n)){r.push(a);break}return r}function f9(e,t,n,r=l9){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:s9(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Wge(...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 c9(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&o9(s,c),s}function Wge(...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}function p9(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function Gge(e){let t=X7(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function Kge(e,t,n){let r=new Set;for(let t of e.matchAll(/:?lang=["']([^"']+)["']/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/(?:```|~~~)([\w-]+)/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/\\begin\{([\w-]+)\}/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return Array.from(r);let i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}var m9=`light-dark()`,qge=[`color`,`background-color`];function Jge(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Yge(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?Jge(e,t):e})):e}function Xge(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>h9(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&qge.includes(a))if(r===m9&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new H7('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[a]=`light-dark(${o[e][a]||`inherit`}, ${o[r][a]||`inherit`})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s;else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function h9(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&ow.Italic&&(t[`font-style`]=`italic`),e.fontStyle&ow.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&ow.Underline&&n.push(`underline`),e.fontStyle&ow.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function g9(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function Zge(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=Gge(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new H7(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}else{let t=n.lines[e.line];if(t===void 0)throw new H7(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new H7(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));Qge(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return Yge(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new H7(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=_9(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new H7(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new H7(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&p9(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function Qge(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new H7(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new H7(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function _9(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(_9).join(``):``}var $ge=[Zge()];function v9(e){let t=e_e(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...$ge]}function e_e(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var y9=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],b9={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function t_e(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function x9(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function n_e(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:`resetAll`});else if(r<=9)b9[r]&&t.push({type:`setDecoration`,value:b9[r]});else if(r<=29){let e=b9[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:y9[r-30]}});else if(r===38){let n=x9(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:y9[r-40]}});else if(r===48){let n=x9(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:y9[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:y9[r-100+8]}})}return t}function r_e(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=t_e(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=n_e(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var i_e={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function a_e(e=i_e){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<y9.length;e++)r.push(t(y9[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var o_e={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function s_e(e,t,n){let r=U7(e,n),i=X7(t),a=a_e(Object.fromEntries(y9.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||o_e[t]]}))),o=r_e();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=W7(i,r),o=W7(o,r),n.decorations.has(`dim`)&&(i=c_e(i));let s=ow.None;return n.decorations.has(`bold`)&&(s|=ow.Bold),n.decorations.has(`italic`)&&(s|=ow.Italic),n.decorations.has(`underline`)&&(s|=ow.Underline),n.decorations.has(`strikethrough`)&&(s|=ow.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function c_e(e){let t=e.match(/#([0-9a-f]{3,8})/i);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}else if(e.length===6)return`#${e}80`;else if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}else if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function S9(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!K7(r)&&!J7(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return s_e(r,t,n)}return l9(e,t,n)}function C9(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new H7("`themes` option must not be empty");let p=f9(e,t,n,S9);if(c=s9(p),l&&m9!==l&&!f.find(e=>e.color===l))throw new H7(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>Xge(e,h,u,l,d))),c&&o9(a,c);let g=f.map(e=>U7(e.theme,n));i=w9(f,m,g,u,l,`fg`,d),r=w9(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=U7(n.theme,n);a=S9(e,t,n);let l=e.getTheme(n.theme);r=W7(l.bg,s),i=W7(l.fg,s),o=l.name,c=s9(a)}else throw new H7("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function w9(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=W7(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===m9&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new H7('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${W7(t[r][a],n[r])||`inherit`}, ${W7(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}function T9(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>T9(e,t,n),codeToTokens:(t,n)=>C9(e,t,n)}){let i=t;for(let e of v9(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=C9(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=u_e(a):d===`never`&&(a=d_e(a)),f&&(a=f_e(a));let p={...r,get source(){return i}};for(let e of v9(n))a=e.tokens?.call(p,a)||a;return l_e(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function l_e(e,t,n,r=s9(e)){let i=v9(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:p9,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
512
512
|
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=g9(a.htmlStyle||h9(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&o9(m,r),m}function u_e(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&ow.Underline||i.fontStyle&ow.Strikethrough));o&&i.content.match(/^\s+$/)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function d_e(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function f_e(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=g9(e.htmlStyle||h9(e)),i=g9(n.htmlStyle||h9(n)),a=e.fontStyle&&(e.fontStyle&ow.Underline||e.fontStyle&ow.Strikethrough),o=n.fontStyle&&(n.fontStyle&ow.Underline||n.fontStyle&ow.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var p_e=VT;function m_e(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>T9(e,t,n),codeToTokens:(t,n)=>C9(e,t,n)},i=p_e(T9(e,t,n,r));for(let e of v9(n))i=e.postprocess?.call(r,i,n)||i;return i}async function h_e(e){let t=await Fge(e);return{getLastGrammarState:(...e)=>Rge(t,...e),codeToTokensBase:(e,n)=>S9(t,e,n),codeToTokensWithThemes:(e,n)=>f9(t,e,n),codeToTokens:(e,n)=>C9(t,e,n),codeToHast:(e,n)=>T9(t,e,n),codeToHtml:(e,n)=>m_e(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function g_e(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,q7(n))return[];let r=t[n];if(!r)throw new H7(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(Y7(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new H7(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await h_e({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function __e(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}else{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function v_e(e,t){let n=__e(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var E9=g_e({langs:uge,themes:dge,engine:()=>(0,V7.createOnigurumaEngine)(a(()=>import(`./wasm-BgqMsG8L.js`),[]))}),{codeToHtml:y_e,codeToHast:b_e,codeToTokens:x_e,codeToTokensBase:S_e,codeToTokensWithThemes:C_e,getSingletonHighlighter:w_e,getLastGrammarState:T_e}=v_e(E9,{guessEmbeddedLanguages:Kge}),E_e=e=>e&&e&1,D_e=e=>e&&e&2,O_e=e=>e&&e&4,k_e=e=>e.map((e,t)=>({key:`line-${t}`,tokens:e.map((e,n)=>({key:`line-${t}-${n}`,token:e}))})),A_e=({token:e})=>(0,U.jsx)(`span`,{className:`dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)]`,style:{backgroundColor:e.bgColor,color:e.color,fontStyle:E_e(e.fontStyle)?`italic`:void 0,fontWeight:D_e(e.fontStyle)?`bold`:void 0,textDecoration:O_e(e.fontStyle)?`underline`:void 0,...e.htmlStyle},children:e.content}),j_e=Pg(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-8`,`before:mr-4`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),M_e=({keyedLine:e,showLineNumbers:t})=>(0,U.jsx)(`span`,{className:t?j_e:`block`,children:e.tokens.length===0?`
|
|
513
513
|
`:e.tokens.map(({token:e,key:t})=>(0,U.jsx)(A_e,{token:e},t))}),N_e=(0,I.createContext)({code:``}),D9=new Map,O9=new Map,k9=new Map,P_e=(e,t)=>{let n=e.slice(0,100),r=e.length>100?e.slice(-100):``;return`${t}:${e.length}:${n}:${r}`},F_e=e=>{let t=D9.get(e);if(t)return t;let n=E9({langs:[e],themes:[`github-light`,`github-dark`]});return D9.set(e,n),n},I_e=e=>({bg:`transparent`,fg:`inherit`,tokens:e.split(`
|
|
514
514
|
`).map(e=>e===``?[]:[{color:`inherit`,content:e}])}),A9=(e,t,n)=>{let r=P_e(e,t);return O9.get(r)||(n&&(k9.has(r)||k9.set(r,new Set),k9.get(r)?.add(n)),F_e(t).then(n=>{let i=n.getLoadedLanguages().includes(t)?t:`text`,a=n.codeToTokens(e,{lang:i,themes:{dark:`github-dark`,light:`github-light`}}),o={bg:a.bg??`transparent`,fg:a.fg??`inherit`,tokens:a.tokens};O9.set(r,o);let s=k9.get(r);if(s){for(let e of s)e(o);k9.delete(r)}}).catch(e=>{console.error(`Failed to highlight code:`,e),k9.delete(r)}),null)},j9=(0,I.memo)(({tokenized:e,showLineNumbers:t,className:n})=>{let r=(0,I.useMemo)(()=>({backgroundColor:e.bg,color:e.fg}),[e.bg,e.fg]),i=(0,I.useMemo)(()=>k_e(e.tokens),[e.tokens]);return(0,U.jsx)(`pre`,{className:Pg(`dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)] m-0 p-4 text-sm`,n),style:r,children:(0,U.jsx)(`code`,{className:Pg(`font-mono text-sm`,t&&`[counter-increment:line_0] [counter-reset:line]`),children:i.map(e=>(0,U.jsx)(M_e,{keyedLine:e,showLineNumbers:t},e.key))})})},(e,t)=>e.tokenized===t.tokenized&&e.showLineNumbers===t.showLineNumbers&&e.className===t.className);j9.displayName=`CodeBlockBody`;var L_e=({className:e,language:t,style:n,...r})=>(0,U.jsx)(`div`,{className:Pg(`group relative w-full overflow-hidden rounded-md border bg-background text-foreground`,e),"data-language":t,style:{containIntrinsicSize:`auto 200px`,contentVisibility:`auto`,...n},...r}),R_e=({code:e,language:t,showLineNumbers:n=!1})=>{let r=(0,I.useMemo)(()=>I_e(e),[e]),i=(0,I.useMemo)(()=>A9(e,t)??r,[e,t,r]),[a,o]=(0,I.useState)(null),s=(0,I.useRef)({code:e,language:t});return(s.current.code!==e||s.current.language!==t)&&(s.current={code:e,language:t},o(null)),(0,I.useEffect)(()=>{let n=!1;return A9(e,t,e=>{n||o(e)}),()=>{n=!0}},[e,t]),(0,U.jsx)(`div`,{className:`relative overflow-auto`,children:(0,U.jsx)(j9,{showLineNumbers:n,tokenized:a??i})})},M9=({code:e,language:t,showLineNumbers:n=!1,className:r,children:i,...a})=>{let o=(0,I.useMemo)(()=>({code:e}),[e]);return(0,U.jsx)(N_e.Provider,{value:o,children:(0,U.jsxs)(L_e,{className:r,language:t,...a,children:[i,(0,U.jsx)(R_e,{code:e,language:t,showLineNumbers:n})]})})},z_e=({className:e,...t})=>(0,U.jsx)(j2,{className:Pg(`group not-prose mb-4 w-full rounded-md border`,e),...t}),B_e={"approval-requested":`Awaiting Approval`,"approval-responded":`Responded`,"input-available":`Running`,"input-streaming":`Pending`,"output-available":`Completed`,"output-denied":`Denied`,"output-error":`Error`},V_e={"approval-requested":(0,U.jsx)(i_,{className:`size-4 text-yellow-600`}),"approval-responded":(0,U.jsx)(t_,{className:`size-4 text-blue-600`}),"input-available":(0,U.jsx)(i_,{className:`size-4 animate-pulse`}),"input-streaming":(0,U.jsx)(r_,{className:`size-4`}),"output-available":(0,U.jsx)(t_,{className:`size-4 text-green-600`}),"output-denied":(0,U.jsx)(n_,{className:`size-4 text-orange-600`}),"output-error":(0,U.jsx)(n_,{className:`size-4 text-red-600`})},H_e=e=>(0,U.jsxs)(nge,{className:`gap-1.5 rounded-full text-xs`,variant:`secondary`,children:[V_e[e],B_e[e]]}),N9=({className:e,title:t,type:n,state:r,toolName:i,...a})=>{let o=n===`dynamic-tool`?i:n.split(`-`).slice(1).join(`-`);return(0,U.jsxs)(M2,{className:Pg(`flex w-full items-center justify-between gap-4 p-3`,e),...a,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(Wee,{className:`size-4 text-muted-foreground`}),(0,U.jsx)(`span`,{className:`font-medium text-sm`,children:t??o}),H_e(r)]}),(0,U.jsx)(Qg,{className:`size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180`})]})},U_e=({className:e,...t})=>(0,U.jsx)(N2,{className:Pg(`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 space-y-4 p-4 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...t}),W_e=({className:e,input:t,...n})=>(0,U.jsxs)(`div`,{className:Pg(`space-y-2 overflow-hidden`,e),...n,children:[(0,U.jsx)(`h4`,{className:`font-medium text-muted-foreground text-xs uppercase tracking-wide`,children:`Parameters`}),(0,U.jsx)(`div`,{className:`rounded-md bg-muted/50`,children:(0,U.jsx)(M9,{code:JSON.stringify(t,null,2),language:`json`})})]}),G_e=({className:e,output:t,errorText:n,...r})=>{if(!(t||n))return null;let i=(0,U.jsx)(`div`,{children:t});return typeof t==`object`&&!(0,I.isValidElement)(t)?i=(0,U.jsx)(M9,{code:JSON.stringify(t,null,2),language:`json`}):typeof t==`string`&&(i=(0,U.jsx)(M9,{code:t,language:`json`})),(0,U.jsxs)(`div`,{className:Pg(`space-y-2`,e),...r,children:[(0,U.jsx)(`h4`,{className:`font-medium text-muted-foreground text-xs uppercase tracking-wide`,children:n?`Error`:`Result`}),(0,U.jsxs)(`div`,{className:Pg(`overflow-x-auto rounded-md text-xs [&_table]:w-full`,n?`bg-destructive/10 text-destructive`:`bg-muted/50 text-foreground`),children:[n&&(0,U.jsx)(`div`,{children:n}),i]})]})},P9=I.createContext(void 0);function F9(e){let t=I.useContext(P9);if(t===void 0&&!e)throw Error(eh(47));return t}function K_e(){return{...ex(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var q_e={...nx,disabled:W(e=>e.disabled),instantType:W(e=>e.instantType),openMethod:W(e=>e.openMethod),openChangeReason:W(e=>e.openChangeReason),modal:W(e=>e.modal),focusManagerModal:W(e=>e.focusManagerModal),stickIfOpen:W(e=>e.stickIfOpen),titleElementId:W(e=>e.titleElementId),descriptionElementId:W(e=>e.descriptionElementId),openOnHover:W(e=>e.openOnHover),closeDelay:W(e=>e.closeDelay),hasViewport:W(e=>e.hasViewport)},J_e=class e extends Rb{constructor(e){let t={...K_e(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:I.createRef(),backdropRef:I.createRef(),internalBackdropRef:I.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:I.createRef(),beforeContentFocusGuardRef:I.createRef(),stickIfOpenTimeout:new E_,triggerElements:new Qb},q_e)}setOpen=(e,t)=>{let n=t.reason===W_,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let a=()=>{let n={open:e,openChangeReason:t.reason},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),Ky.flushSync(a)):a(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let r=Am(()=>new e(n)).current,i=t??r;return w_(r.disposeEffect),i}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function I9({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=J_e.useStore(s?.store,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});x_(()=>{n===void 0&&u.state.open===!1&&r===!0&&u.update({open:!0,activeTriggerId:l})}),u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a);let{openMethod:p,triggerProps:m}=r2(d);Xb(u);let{forceUnmount:h}=Zb(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});I.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let g=I.useCallback(()=>{u.setOpen(!1,Q_(Z_))},[u]);I.useImperativeHandle(e.actionsRef,()=>({unmount:h,close:g}),[h,g]);let _=ax({popupStore:u,onOpenChange:u.setOpen}),{getReferenceProps:v,getFloatingProps:y,getTriggerProps:b}=gx([db(_,{outsidePressEvent:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),bx(_)]),x=I.useMemo(()=>v(m),[v,m]),S=I.useMemo(()=>b(m),[b,m]),C=I.useMemo(()=>y(),[y]);u.useSyncedValues({modal:o,openMethod:p,activeTriggerProps:x,inactiveTriggerProps:S,popupProps:C,floatingRootContext:_,nested:eb()!=null});let w=I.useMemo(()=>({store:u}),[u]);return(0,U.jsx)(P9.Provider,{value:w,children:typeof t==`function`?t({payload:f}):t})}function Y_e(e){return F9(!0)?(0,U.jsx)(I9,{props:e}):(0,U.jsx)(kte,{children:(0,U.jsx)(I9,{props:e})})}var X_e=I.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,handle:o,payload:s,openOnHover:c=!1,delay:l=300,closeDelay:u=0,id:d,style:f,...p}=e,m=F9(!0),h=o?.store??m?.store;if(!h)throw Error(eh(74));let g=Ux(d),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=I.useRef(null),{registerTrigger:x,isMountedByThisTrigger:S}=Yb(g,b,h,{payload:s,disabled:i,openOnHover:c,closeDelay:u}),C=h.useState(`openChangeReason`),w=h.useState(`stickIfOpen`),T=h.useState(`openMethod`),E=h.useState(`focusManagerModal`),D=hx(v,{enabled:v!=null&&c&&(T!==`touch`||C!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:Ox(),restMs:l,delay:{close:u},triggerElementRef:b,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),O=gx([lb(v,{enabled:v!=null,stickIfOpen:w})]),k=h.useState(`triggerProps`,S),A={disabled:i,open:y},{getButtonProps:j,buttonRef:M}=nh({disabled:i,native:a}),N=I.useMemo(()=>({open(e){return e&&C===`trigger-press`?Vx.open(e):Bx.open(e)}}),[C]),P=mh(`button`,e,{state:A,ref:[M,t,x,b],props:[O.getReferenceProps(),D,k,{[Wy]:``,id:g},p,j],stateAttributesMapping:N}),{preFocusGuardRef:ee,handlePreFocusGuardFocus:F,handleFocusTargetFocus:te}=xue(h,b);return _&&!E?(0,U.jsxs)(I.Fragment,{children:[(0,U.jsx)(mv,{ref:ee,onFocus:F}),(0,U.jsx)(I.Fragment,{children:P},g),(0,U.jsx)(mv,{ref:h.context.triggerFocusTargetRef,onFocus:te})]}):(0,U.jsx)(I.Fragment,{children:P},g)}),L9=I.createContext(void 0);function Z_e(){let e=I.useContext(L9);if(e===void 0)throw Error(eh(45));return e}var Q_e=I.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=F9();return i.useState(`mounted`)||n?(0,U.jsx)(L9.Provider,{value:n,children:(0,U.jsx)(Xy,{ref:t,...r})}):null}),R9=I.createContext(void 0);function $_e(){let e=I.useContext(R9);if(!e)throw Error(eh(46));return e}var eve=I.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,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=Gy,style:g,..._}=e,{store:v}=F9(),y=Z_e(),b=Dte(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=v.useState(`hasViewport`),M=I.useRef(null),N=Kb(O,!1,!1),P=lS({anchor:i,floatingRootContext:x,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:y,nodeId:b,collisionAvoidance:h,adaptiveOrigin:j?oS:void 0}),ee=x.useState(`domReferenceElement`);Lm(()=>{let e=ee,t=M.current;if(e&&(M.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return N(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[ee,N,v]);let F={open:C,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:k};bue(C&&E===!0&&w!==`trigger-hover`,D===`touch`,O,T);let te=I.useCallback(e=>{v.set(`positionerElement`,e)},[v]),ne=fS(e,F,{styles:P.positionerStyles,transitionStatus:A,props:_,refs:[t,te],hidden:!S,inert:!C});return(0,U.jsxs)(R9.Provider,{value:P,children:[S&&E===!0&&w!==`trigger-hover`&&(0,U.jsx)(Z0,{ref:v.context.internalBackdropRef,inert:vS(!C),cutout:T}),(0,U.jsx)(Ote,{id:b,children:ne})]})}),tve=I.createContext(void 0);function nve(){let[e,t]=I.useState(0),n=Nm(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:I.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function rve(e){let{value:t,children:n}=e;return(0,U.jsx)(tve.Provider,{value:t,children:n})}var ive={...Hx,...Gb},ave=I.forwardRef(function(e,t){let{className:n,render:r,initialFocus:i,finalFocus:a,style:o,...s}=e,{store:c}=F9(),l=$_e(),u=vue(!0)!=null,{context:d,hasClosePart:f}=nve(),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`);qb({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}});let T=c.useState(`disabled`),E=c.useState(`openOnHover`),D=c.useState(`closeDelay`);px(w,{enabled:E&&!T,closeDelay:D});function O(e){return e===`touch`?c.context.popupRef.current:!0}let k=i===void 0?O:i,A={open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},j=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,j);let M=I.useCallback(e=>{c.set(`popupElement`,e)},[c]),N=mh(`div`,e,{state:A,ref:[t,c.context.popupRef,M],props:[_,{"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&X0.has(e.key)&&e.stopPropagation()}},dS(g),s],stateAttributesMapping:ive});return(0,U.jsx)(cb,{context:w,openInteractionType:m,modal:j,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:a,restoreFocus:`popup`,previousFocusableElement:pm(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,U.jsx)(rve,{value:d,children:N})})});function ove({...e}){return(0,U.jsx)(Y_e,{"data-slot":`popover`,...e})}function sve({...e}){return(0,U.jsx)(X_e,{"data-slot":`popover-trigger`,...e})}function cve({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,U.jsx)(Q_e,{children:(0,U.jsx)(eve,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,U.jsx)(ave,{"data-slot":`popover-content`,className:Pg(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}var z9=I.createContext(void 0);function lve(){let e=I.useContext(z9);if(e===void 0)throw Error(eh(63));return e}var B9=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),V9={...p2,checked(e){return e?{[B9.checked]:``}:{[B9.unchecked]:``}}},uve=I.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:b}=iue(),{state:x,setTouched:S,setDirty:C,validityData:w,setFilled:T,setFocused:E,shouldValidateOnChange:D,validationMode:O,disabled:k,name:A,validation:j}=m2(),{labelId:M}=h2(),N=k||m,P=A??l,ee=Nm(d),F=I.useRef(null),te=ih(F,c,j.inputRef),ne=I.useRef(null),re=Ux(),ie=g2({id:s,implicit:!1,controlRef:ne}),ae=u?void 0:ie,[oe,se]=_2({controlled:n,default:!!i,name:`Switch`,state:`checked`});v2(ne,{id:re,value:oe}),Lm(()=>{F.current&&T(F.current.checked)},[F,T]),n2(oe,()=>{b(P),C(oe!==w.initialValue),T(oe),D()?j.commit(oe):j.commit(oe,!0)});let{getButtonProps:ce,buttonRef:le}=nh({disabled:N,native:u}),ue=oue(a,M,F,!u,ae),de={id:u?ie:re,role:`switch`,"aria-checked":oe,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":ue,onFocus(){N||E(!0)},onBlur(){let e=F.current;!e||N||(S(!0),E(!1),O===`onBlur`&&j.commit(e.checked))},onClick(e){f||N||(e.preventDefault(),F.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},fe=I.useMemo(()=>Bm({checked:oe,disabled:N,form:o,id:ae,name:P,required:p,style:P?pv:fv,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:te,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=Q_(H_,e.nativeEvent);ee?.(t,n),!n.isCanceled&&se(t)},onFocus(){ne.current?.focus()}},j.getInputValidationProps,_===void 0?uh:{value:_}),[oe,N,o,te,ae,P,ee,f,p,se,j,_]),pe=I.useMemo(()=>({...x,checked:oe,disabled:N,readOnly:f,required:p}),[x,oe,N,f,p]),me=mh(`span`,e,{state:pe,ref:[t,ne,le],props:[de,j.getValidationProps,y,ce],stateAttributesMapping:V9});return(0,U.jsxs)(z9.Provider,{value:pe,children:[me,!oe&&P&&g!==void 0&&(0,U.jsx)(`input`,{type:`hidden`,form:o,name:P,value:g}),(0,U.jsx)(`input`,{...fe,suppressHydrationWarning:!0})]})}),dve=I.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=m2(),s=lve();return mh(`span`,e,{state:{...o,...s},ref:t,stateAttributesMapping:V9,props:a})});function H9({className:e,size:t=`default`,...n}){return(0,U.jsx)(uve,{"data-slot":`switch`,"data-size":t,className:Pg(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,U.jsx)(dve,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`})})}function fve(e){return e.filter(e=>e.role===`user`||e.role===`assistant`).map(e=>{let t=e.parts.filter($f).map(e=>e.text).join(``),n=e.parts.filter(ep).map(e=>e.text).join(`
|
|
515
515
|
|
|
516
516
|
---
|
|
517
517
|
|
|
518
|
-
`),r=e.parts.filter(e=>e.type===`source-url`||e.type===`source-document`).map(e=>e.type===`source-url`?{href:e.url,title:e.title??e.url}:{href:`#${e.sourceId}`,title:e.title}),i=e.parts.filter(rp),a={key:e.id,from:e.role,versions:[{id:e.id,content:t}]};return r.length>0&&(a.sources=r),n&&(a.reasoning={content:n,duration:0}),i.length>0&&(a.tools=i),a})}function pve({onAuthTokenSubmit:e}){let[t,n]=(0,I.useState)(``);return(0,U.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,U.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-full bg-red-50`,children:(0,U.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-red-400`})}),(0,U.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Unauthorized`}),(0,U.jsx)(`p`,{className:`max-w-xs text-xs text-muted-foreground`,children:`You are not authorized to connect to this agent.`})]}),e&&(0,U.jsxs)(`form`,{className:`flex w-full max-w-sm items-center gap-2`,onSubmit:n=>{n.preventDefault();let r=t.trim();r&&e(r)},children:[(0,U.jsx)(y2,{autoComplete:`off`,className:`font-mono text-xs placeholder:text-muted-foreground placeholder:text-xs`,placeholder:`Add a token to reconnect...`,spellCheck:!1,type:`password`,value:t,onChange:e=>n(e.target.value)}),(0,U.jsx)(Rg,{disabled:!t.trim(),size:`sm`,type:`submit`,children:`Reconnect`})]})]})}function U9({messages:e,chatStatus:t,sendMessage:n,connectionStatus:r,hasChat:i=!0,onNewChat:a,onAuthTokenSubmit:o,ratings:s,onRate:c}){let[l,u]=(0,I.useState)(``),[d,f]=(0,I.useState)(!0),[p,m]=(0,I.useState)(!0),[h,g]=(0,I.useState)(!0),_=(0,I.useMemo)(()=>fve(e),[e]),v=t===`streaming`||t===`submitted`,y=_.at(-1)?.key,b=!l.trim()||t===`streaming`||t===`submitted`,x=(0,I.useCallback)(e=>{let t=e.text?.trim();t&&(n?.({role:`user`,parts:[{type:`text`,text:t}]}),u(``))},[n]),S=(0,I.useCallback)(e=>u(e.target.value),[]),C=(0,I.useCallback)(e=>u(t=>t?`${t} ${e}`:e),[]),w=(0,I.useMemo)(()=>{if(t!==`submitted`&&t!==`streaming`)return!1;let e=_.at(-1);return!e||e.from===`user`?!0:!(e.versions.some(e=>e.content.trim().length>0)||e.reasoning?.content.trim())},[t,_]);return r===`unauthorized`?(0,U.jsx)(pve,{onAuthTokenSubmit:o}):r===`disconnected`?(0,U.jsx)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4`,children:(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,U.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-full bg-red-50`,children:(0,U.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-red-400`})}),(0,U.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Unable to connect`}),(0,U.jsx)(`p`,{className:`max-w-xs text-xs text-muted-foreground`,children:`Could not reach the agent. Check the URL and make sure it's running.`})]})}):i?(0,U.jsxs)(`div`,{className:`relative flex size-full flex-col divide-y overflow-hidden`,children:[(0,U.jsxs)(Zee,{children:[(0,U.jsxs)(Qee,{children:[_.map(({versions:e,...t})=>(0,U.jsxs)(gle,{defaultBranch:0,children:[(0,U.jsx)(_le,{children:e.map(e=>(0,U.jsx)(P0,{from:t.from,children:(0,U.jsxs)(`div`,{children:[d&&t.tools?.map(e=>(0,U.jsxs)(z_e,{children:[e.type===`dynamic-tool`?(0,U.jsx)(N9,{type:e.type,state:e.state,toolName:e.toolName}):(0,U.jsx)(N9,{type:e.type,state:e.state}),(0,U.jsxs)(U_e,{children:[(0,U.jsx)(W_e,{input:e.input}),(0,U.jsx)(G_e,{output:e.output,errorText:e.errorText})]})]},e.toolCallId)),t.sources?.length&&(0,U.jsxs)(Yhe,{children:[(0,U.jsx)(Xhe,{count:t.sources.length}),(0,U.jsx)(Zhe,{children:t.sources.map(e=>(0,U.jsx)(Qhe,{href:e.href,title:e.title},e.href))})]}),p&&t.reasoning&&(0,U.jsxs)(T7,{duration:t.reasoning.duration,children:[(0,U.jsx)(E7,{}),(0,U.jsx)(D7,{children:t.reasoning.content})]}),(0,U.jsx)(F0,{children:(0,U.jsx)(z0,{children:e.content})}),t.from===`assistant`&&c&&h&&!(t.key===y&&v)&&(0,U.jsx)(Cle,{messageId:t.key,rating:s?.[t.key],onRate:c})]})},`${t.key}-${e.id}`))}),e.length>1&&(0,U.jsxs)(vle,{children:[(0,U.jsx)(yle,{}),(0,U.jsx)(xle,{}),(0,U.jsx)(ble,{})]})]},t.key)),w&&(0,U.jsx)(P0,{from:`assistant`,children:(0,U.jsx)(F0,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground`,children:[(0,U.jsx)(C2,{className:`size-3.5 shrink-0`}),(0,U.jsx)(`span`,{children:`Thinking...`})]})})})]}),(0,U.jsx)($ee,{})]}),(0,U.jsx)(`div`,{className:`grid shrink-0 gap-4 pt-4`,children:(0,U.jsx)(`div`,{className:`w-full px-4 pb-4`,children:(0,U.jsxs)(jue,{globalDrop:!0,multiple:!0,onSubmit:x,children:[(0,U.jsx)(Mue,{children:(0,U.jsx)(Nue,{onChange:S,value:l})}),(0,U.jsxs)(Pue,{children:[(0,U.jsxs)(Fue,{children:[(0,U.jsx)(ege,{className:`shrink-0`,onTranscriptionChange:C,size:`icon-sm`,variant:`ghost`}),(0,U.jsxs)(ove,{children:[(0,U.jsx)(sve,{render:(0,U.jsx)(Rg,{size:`icon-sm`,variant:`ghost`,"aria-label":`Display settings`}),children:(0,U.jsx)(zee,{className:`size-4`})}),(0,U.jsx)(cve,{className:`w-52`,align:`start`,side:`top`,children:(0,U.jsxs)(`div`,{className:`grid gap-4`,children:[(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsx)(`h4`,{className:`text-sm font-medium`,children:`Display options`}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Toggle what you see in the chat.`})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`label`,{className:`text-sm`,htmlFor:`show-tools`,children:`Show tool outputs`}),(0,U.jsx)(H9,{id:`show-tools`,checked:d,onCheckedChange:f})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`label`,{className:`text-sm`,htmlFor:`show-reasoning`,children:`Show reasoning`}),(0,U.jsx)(H9,{id:`show-reasoning`,checked:p,onCheckedChange:m})]}),c&&(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`label`,{className:`text-sm`,htmlFor:`show-ratings`,children:`Show ratings`}),(0,U.jsx)(H9,{id:`show-ratings`,checked:h,onCheckedChange:g})]})]})})]})]}),(0,U.jsx)(Iue,{disabled:b,status:t})]})]})})})]}):(0,U.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4 px-4 text-muted-foreground`,children:[(0,U.jsx)(`p`,{className:`text-sm`,children:`Start a new chat to begin.`}),a&&(0,U.jsxs)(Rg,{onClick:a,children:[(0,U.jsx)(s_,{className:`size-4`}),`New chat`]})]})}function mve(){return new URLSearchParams(window.location.search).get(`chat`)??void 0}function W9(e){let t=new URLSearchParams(window.location.search);t.set(`chat`,e),history.pushState(null,``,`?${t.toString()}`)}function hve({host:e,agentName:t,userId:n,authToken:r,onAgentStatusChange:i,onAuthTokenChange:a}){let[o,s]=(0,I.useState)([]),{currentChatName:c,status:l,assistant:u,chat:d}=nee({host:e,agentName:t,name:n,authToken:r}),{ratings:f,onRate:p}=om({status:l,chatKey:c,rateMessage:d.rateMessage,getMessageRatings:d.getMessageRatings});(0,I.useEffect)(()=>{let e=mve();e&&u.openChat(e)},[]),(0,I.useEffect)(()=>{i(l)},[l]),(0,I.useEffect)(()=>{l===`connected`&&u.getChats().then(e=>{s(e)})},[l]);async function m(){W9(await u.createChat()),s(await u.getChats())}function h(e){u.openChat(e),W9(e)}async function g(e){u.deleteChat(e),s(await u.getChats())}let _=(0,I.useCallback)(e=>{let t=(d?.chat.messages?.length??0)===0;d?.chat.sendMessage?.(e),t&&setTimeout(()=>{u.getChats().then(s)},3e3)},[d,u]);return(0,U.jsxs)(`div`,{className:`w-full h-full flex`,children:[(0,U.jsxs)(`aside`,{className:`flex w-72 shrink-0 flex-col border-r border-border bg-muted/30`,children:[(0,U.jsxs)(`div`,{className:`border-b border-border p-2 flex justify-between`,children:[(0,U.jsxs)(Rg,{className:`cursor-pointer`,onClick:()=>m(),children:[(0,U.jsx)(s_,{className:`size-4`}),`New chat`]}),(0,U.jsx)(Rg,{size:`icon-sm`,variant:`ghost`,onClick:()=>u.getChats(),children:(0,U.jsx)(Ree,{className:`size-4`})})]}),(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-2`,children:o.length===0?(0,U.jsx)(`p`,{className:`px-2 py-6 text-center text-xs text-muted-foreground`,children:`No conversations yet.`}):(0,U.jsx)(`ul`,{className:`flex flex-col gap-2`,children:o.map(e=>{let t=e.chatId===d.chat.id;return(0,U.jsxs)(`li`,{className:Pg(`relative group border border-border rounded-md`,{"border-gray-300":t}),children:[(0,U.jsxs)(`button`,{className:Pg(`w-full cursor-pointer rounded-md px-2 py-1.5 text-left transition-colors`,t?`bg-accent text-accent-foreground`:`hover:bg-accent`),onClick:()=>h(e.chatId),children:[(0,U.jsx)(`span`,{className:`truncate text-xs font-medium flex items-center mt-1`,children:e.title??(0,U.jsxs)(U.Fragment,{children:[`Untitled`,(0,U.jsx)(`span`,{className:`text-muted-foreground ml-auto`,children:new Date(e.updated_at).toLocaleString()})]})}),(0,U.jsx)(`span`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:e.summary})]}),(0,U.jsx)(Rg,{className:`absolute right-0 top-0 mt-0.5 mr-0.5 items-center justify-center invisible group-hover:visible bg-gray-50 text-gray-500 cursor-pointer flex`,size:`icon-sm`,variant:`ghost`,onClick:async()=>await g(e.chatId),children:(0,U.jsx)(Uee,{className:`size-4`})})]},e.chatId)})})})]}),(0,U.jsx)(`div`,{className:`grow flex flex-col gap-4`,children:(0,U.jsx)(U9,{messages:d?.chat.messages??[],chatStatus:d.chat.status??`ready`,sendMessage:_,connectionStatus:l,hasChat:!!c,onNewChat:()=>void m(),onAuthTokenSubmit:a,ratings:f,onRate:p})})]})}function gve(e){return(0,U.jsx)(`p`,{children:`Not implemented yet.`})}function _ve(){return new URLSearchParams(window.location.search).get(`chat`)??void 0}function vve(e){let t=new URLSearchParams(window.location.search);t.set(`chat`,e),history.pushState(null,``,`?${t.toString()}`)}function yve({host:e,agentName:t,authToken:n,userId:r,onAgentStatusChange:i,onAuthTokenChange:a}){let o=(0,I.useMemo)(()=>{let e=_ve()??hp();return vve(e),e},[]),{status:s,chat:c,rateMessage:l,getMessageRatings:u}=am({host:e,agentName:t,name:`${r}:${o}`,authToken:n}),{ratings:d,onRate:f}=om({status:s,chatKey:o,rateMessage:l,getMessageRatings:u});return(0,I.useEffect)(()=>{i(s)},[s]),(0,U.jsx)(`div`,{className:`w-full h-full flex`,children:(0,U.jsx)(`div`,{className:`grow flex flex-col gap-4`,children:(0,U.jsx)(U9,{messages:c?.messages??[],chatStatus:c?.status??`ready`,sendMessage:c?.sendMessage,connectionStatus:s,onAuthTokenSubmit:a,ratings:d,onRate:f})})})}function bve(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var xve=e=>{switch(e){case`success`:return wve;case`info`:return Eve;case`warning`:return Tve;case`error`:return Dve;default:return null}},Sve=Array(12).fill(0),Cve=({visible:e,className:t})=>I.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},I.createElement(`div`,{className:`sonner-spinner`},Sve.map((e,t)=>I.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),wve=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},I.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Tve=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},I.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Eve=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},I.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Dve=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},I.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Ove=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},I.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),I.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),kve=()=>{let[e,t]=I.useState(document.hidden);return I.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},G9=1,K9=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:G9++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],I.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(jve(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||G9++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ave=(e,t)=>{let n=t?.id||G9++;return K9.addToast({title:e,...t,id:n}),n},jve=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,q9=Object.assign(Ave,{success:K9.success,info:K9.info,warning:K9.warning,error:K9.error,custom:K9.custom,message:K9.message,promise:K9.promise,dismiss:K9.dismiss,loading:K9.loading},{getHistory:()=>K9.toasts,getToasts:()=>K9.getActiveToasts()});bve(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function J9(e){return e.label!==void 0}var Mve=3,Nve=`24px`,Pve=`16px`,Y9=4e3,Fve=356,Ive=14,Lve=45,Rve=200;function X9(...e){return e.filter(Boolean).join(` `)}function zve(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Bve=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=I.useState(null),[O,k]=I.useState(null),[A,j]=I.useState(!1),[M,N]=I.useState(!1),[P,ee]=I.useState(!1),[F,te]=I.useState(!1),[ne,re]=I.useState(!1),[ie,ae]=I.useState(0),[oe,se]=I.useState(0),ce=I.useRef(n.duration||y||Y9),le=I.useRef(null),ue=I.useRef(null),de=c===0,fe=c+1<=o,pe=n.type,me=n.dismissible!==!1,he=n.className||``,ge=n.descriptionClassName||``,_e=I.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ve=I.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ye=I.useMemo(()=>n.duration||y||Y9,[n.duration,y]),be=I.useRef(0),xe=I.useRef(0),Se=I.useRef(0),Ce=I.useRef(null),[we,Te]=b.split(`-`),Ee=I.useMemo(()=>s.reduce((e,t,n)=>n>=_e?e:e+t.height,0),[s,_e]),De=kve(),Oe=n.invert||t,ke=pe===`loading`;xe.current=I.useMemo(()=>_e*x+Ee,[_e,Ee]),I.useEffect(()=>{ce.current=ye},[ye]),I.useEffect(()=>{j(!0)},[]),I.useEffect(()=>{let e=ue.current;if(e){let t=e.getBoundingClientRect().height;return se(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),I.useLayoutEffect(()=>{if(!A)return;let e=ue.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,se(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ae=I.useCallback(()=>{N(!0),ae(xe.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Rve)},[n,d,a,xe]);I.useEffect(()=>{if(n.promise&&pe===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||De?(()=>{if(Se.current<be.current){let e=new Date().getTime()-be.current;ce.current-=e}Se.current=new Date().getTime()})():ce.current!==1/0&&(be.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ae()},ce.current)),()=>clearTimeout(e)},[u,i,n,pe,De,Ae]),I.useEffect(()=>{n.delete&&(Ae(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ae,n.delete]);function je(){return w?.loading?I.createElement(`div`,{className:X9(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":pe===`loading`},w.loading):I.createElement(Cve,{className:X9(C?.loader,n?.classNames?.loader),visible:pe===`loading`})}let Me=n.icon||w?.[pe]||xve(pe);return I.createElement(`li`,{tabIndex:0,ref:ue,className:X9(_,he,C?.toast,n?.classNames?.toast,C?.default,C?.[pe],n?.classNames?.[pe]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":ne,"data-removed":M,"data-visible":fe,"data-y-position":we,"data-x-position":Te,"data-index":c,"data-front":de,"data-swiping":P,"data-dismissible":me,"data-type":pe,"data-invert":Oe,"data-swipe-out":F,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?ie:xe.current}px`,"--initial-height":S?`auto`:`${oe}px`,...m,...n.style},onDragEnd:()=>{ee(!1),D(null),Ce.current=null},onPointerDown:e=>{e.button!==2&&(ke||!me||(le.current=new Date,ae(xe.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(ee(!0),Ce.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(F||!me)return;Ce.current=null;let e=Number(ue.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ue.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-le.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=Lve||a>.11){ae(xe.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ae(),te(!0);return}else{var o,s;(o=ue.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ue.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}re(!1),ee(!1),D(null)},onPointerMove:t=>{var n,r;if(!Ce.current||!me||window.getSelection()?.toString().length>0)return;let i=t.clientY-Ce.current.y,a=t.clientX-Ce.current.x,o=e.swipeDirections??zve(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&D(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(E===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&re(!0),(n=ue.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=ue.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},ve&&!n.jsx&&pe!==`loading`?I.createElement(`button`,{"aria-label":T,"data-disabled":ke,"data-close-button":!0,onClick:ke||!me?()=>{}:()=>{Ae(),n.onDismiss==null||n.onDismiss.call(n,n)},className:X9(C?.closeButton,n?.classNames?.closeButton)},w?.close??Ove):null,(pe||n.icon||n.promise)&&n.icon!==null&&(w?.[pe]!==null||n.icon)?I.createElement(`div`,{"data-icon":``,className:X9(C?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||je():null,n.type===`loading`?null:Me):null,I.createElement(`div`,{"data-content":``,className:X9(C?.content,n?.classNames?.content)},I.createElement(`div`,{"data-title":``,className:X9(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?I.createElement(`div`,{"data-description":``,className:X9(v,ge,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),I.isValidElement(n.cancel)?n.cancel:n.cancel&&J9(n.cancel)?I.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{J9(n.cancel)&&me&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ae())},className:X9(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,I.isValidElement(n.action)?n.action:n.action&&J9(n.action)?I.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{J9(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ae())},className:X9(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Z9(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Vve(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Pve:Nve;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Hve=I.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Mve,toastOptions:g,dir:_=Z9(),gap:v=Ive,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=I.useState([]),C=I.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),w=I.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[T,E]=I.useState([]),[D,O]=I.useState(!1),[k,A]=I.useState(!1),[j,M]=I.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),N=I.useRef(null),P=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),ee=I.useRef(null),F=I.useRef(!1),te=I.useCallback(e=>{S(t=>(t.find(t=>t.id===e.id)?.delete||K9.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return I.useEffect(()=>K9.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{Ky.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),I.useEffect(()=>{if(d!==`system`){M(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?M(`dark`):M(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{M(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{M(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),I.useEffect(()=>{x.length<=1&&O(!1)},[x]),I.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;O(!0),(t=N.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===N.current||N.current?.contains(document.activeElement))&&O(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),I.useEffect(()=>{if(N.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,F.current=!1)}},[N.current]),I.createElement(`section`,{ref:t,"aria-label":`${b} ${P}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,n)=>{let[i,a]=t.split(`-`);return C.length?I.createElement(`ol`,{key:t,dir:_===`auto`?Z9():_,tabIndex:-1,ref:N,className:c,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${Fve}px`,"--gap":`${v}px`,...m,...Vve(l,u)},onBlur:e=>{F.current&&!e.currentTarget.contains(e.relatedTarget)&&(F.current=!1,ee.current&&=(ee.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||F.current||(F.current=!0,ee.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{k||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||A(!0)},onPointerUp:()=>A(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>I.createElement(Bve,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:k,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:te,toasts:C.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:D,swipeDirections:e.swipeDirections}))):null}))}),Uve=`playground:url`,Wve=`playground:body`,Gve=`playground:query`,Kve=`playground:userId`,qve=`playground:token`,Jve=`playground:welcomeMessage`;function Yve(e){try{let t=JSON.parse(e);return typeof t==`object`&&!!t&&Object.keys(t).length>0}catch{return!1}}function Xve(e){if(!e||e===`{}`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t||Array.isArray(t))return null;let n=t;for(let e of Object.values(n))if(typeof e!=`string`)return null;return n}function Q9(e){try{let t=new URL(e.includes(`://`)?e:`http://${e}`),n=t.pathname.split(`/`).filter(Boolean);return n[0]===`agents`&&n[1]?{host:t.host,agent:n[1]}:null}catch{return null}}function Zve(e){return e.split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function Qve(e){return e?Q9(e)||(q9.error(`Invalid agent URL — expected http://<host>/agents/<name>`),null):null}function $ve(){let e=new URLSearchParams(window.location.search);if(!e.has(`chat`))return;e.delete(`chat`);let t=e.toString();history.replaceState(null,``,t?`?${t}`:window.location.pathname)}function eye(){return localStorage.getItem(`playground:url`)??``}function $9(){return localStorage.getItem(`playground:userId`)??``}function tye(){return localStorage.getItem(`playground:token`)??``}function nye(){return localStorage.getItem(`playground:welcomeMessage`)??``}function rye(){return localStorage.getItem(`playground:body`)??``}function iye(){return localStorage.getItem(`playground:query`)??``}function aye(){let[e,t]=(0,I.useState)(eye),[n,r]=(0,I.useState)(e),[i,a]=(0,I.useState)($9),[o,s]=(0,I.useState)(tye),[c,l]=(0,I.useState)(nye),[u,d]=(0,I.useState)(rye),[f,p]=(0,I.useState)(iye),m=(0,I.useCallback)(e=>{localStorage.setItem(Kve,e),a(e)},[]),h=(0,I.useCallback)(e=>{localStorage.setItem(qve,e),s(e)},[]),g=(0,I.useCallback)(e=>{localStorage.setItem(Jve,e),l(e)},[]),_=(0,I.useCallback)(e=>{localStorage.setItem(Wve,e),d(e)},[]),v=(0,I.useCallback)(e=>{localStorage.setItem(Gve,e),p(e)},[]);return{agentUrl:e,urlDraft:n,setUrlDraft:r,commitUrl:(0,I.useCallback)(()=>{let i=n.trim();return Qve(i)?(i!==e&&$ve(),localStorage.setItem(Uve,i),t(i),r(i),!0):!1},[n,e]),connection:(0,I.useMemo)(()=>e?Q9(e):null,[e]),userId:i,setUserId:m,token:o,setToken:h,welcomeMessage:c,setWelcomeMessage:g,body:u,setBody:_,query:f,setQuery:v,toolContext:(0,I.useMemo)(()=>{let e=u.trim();if(e)try{return JSON.parse(e)}catch{return}},[u]),connectionParams:(0,I.useMemo)(()=>f?Xve(f.trim())??void 0:void 0,[f])}}var oye=`{
|
|
518
|
+
`),r=e.parts.filter(e=>e.type===`source-url`||e.type===`source-document`).map(e=>e.type===`source-url`?{href:e.url,title:e.title??e.url}:{href:`#${e.sourceId}`,title:e.title}),i=e.parts.filter(rp),a={key:e.id,from:e.role,versions:[{id:e.id,content:t}]};return r.length>0&&(a.sources=r),n&&(a.reasoning={content:n,duration:0}),i.length>0&&(a.tools=i),a})}function pve({onAuthTokenSubmit:e}){let[t,n]=(0,I.useState)(``);return(0,U.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,U.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-full bg-red-50`,children:(0,U.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-red-400`})}),(0,U.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Unauthorized`}),(0,U.jsx)(`p`,{className:`max-w-xs text-xs text-muted-foreground`,children:`You are not authorized to connect to this agent.`})]}),e&&(0,U.jsxs)(`form`,{className:`flex w-full max-w-sm items-center gap-2`,onSubmit:n=>{n.preventDefault();let r=t.trim();r&&e(r)},children:[(0,U.jsx)(y2,{autoComplete:`off`,className:`font-mono text-xs placeholder:text-muted-foreground placeholder:text-xs`,placeholder:`Add a token to reconnect...`,spellCheck:!1,type:`password`,value:t,onChange:e=>n(e.target.value)}),(0,U.jsx)(Rg,{disabled:!t.trim(),size:`sm`,type:`submit`,children:`Reconnect`})]})]})}function U9({messages:e,chatStatus:t,sendMessage:n,connectionStatus:r,hasChat:i=!0,onNewChat:a,onAuthTokenSubmit:o,feedback:s,onFeedback:c}){let[l,u]=(0,I.useState)(``),[d,f]=(0,I.useState)(!0),[p,m]=(0,I.useState)(!0),[h,g]=(0,I.useState)(!0),_=(0,I.useMemo)(()=>fve(e),[e]),v=t===`streaming`||t===`submitted`,y=_.at(-1)?.key,b=!l.trim()||t===`streaming`||t===`submitted`,x=(0,I.useCallback)(e=>{let t=e.text?.trim();t&&(n?.({role:`user`,parts:[{type:`text`,text:t}]}),u(``))},[n]),S=(0,I.useCallback)(e=>u(e.target.value),[]),C=(0,I.useCallback)(e=>u(t=>t?`${t} ${e}`:e),[]),w=(0,I.useMemo)(()=>{if(t!==`submitted`&&t!==`streaming`)return!1;let e=_.at(-1);return!e||e.from===`user`?!0:!(e.versions.some(e=>e.content.trim().length>0)||e.reasoning?.content.trim())},[t,_]);return r===`unauthorized`?(0,U.jsx)(pve,{onAuthTokenSubmit:o}):r===`disconnected`?(0,U.jsx)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4`,children:(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,U.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-full bg-red-50`,children:(0,U.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-red-400`})}),(0,U.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Unable to connect`}),(0,U.jsx)(`p`,{className:`max-w-xs text-xs text-muted-foreground`,children:`Could not reach the agent. Check the URL and make sure it's running.`})]})}):i?(0,U.jsxs)(`div`,{className:`relative flex size-full flex-col divide-y overflow-hidden`,children:[(0,U.jsxs)(Zee,{children:[(0,U.jsxs)(Qee,{children:[_.map(({versions:e,...t})=>(0,U.jsxs)(gle,{defaultBranch:0,children:[(0,U.jsx)(_le,{children:e.map(e=>(0,U.jsx)(P0,{from:t.from,children:(0,U.jsxs)(`div`,{children:[d&&t.tools?.map(e=>(0,U.jsxs)(z_e,{children:[e.type===`dynamic-tool`?(0,U.jsx)(N9,{type:e.type,state:e.state,toolName:e.toolName}):(0,U.jsx)(N9,{type:e.type,state:e.state}),(0,U.jsxs)(U_e,{children:[(0,U.jsx)(W_e,{input:e.input}),(0,U.jsx)(G_e,{output:e.output,errorText:e.errorText})]})]},e.toolCallId)),t.sources?.length&&(0,U.jsxs)(Yhe,{children:[(0,U.jsx)(Xhe,{count:t.sources.length}),(0,U.jsx)(Zhe,{children:t.sources.map(e=>(0,U.jsx)(Qhe,{href:e.href,title:e.title},e.href))})]}),p&&t.reasoning&&(0,U.jsxs)(T7,{duration:t.reasoning.duration,children:[(0,U.jsx)(E7,{}),(0,U.jsx)(D7,{children:t.reasoning.content})]}),(0,U.jsx)(F0,{children:(0,U.jsx)(z0,{children:e.content})}),t.from===`assistant`&&c&&h&&!(t.key===y&&v)&&(0,U.jsx)(Cle,{messageId:t.key,feedback:s?.[t.key],onFeedback:c})]})},`${t.key}-${e.id}`))}),e.length>1&&(0,U.jsxs)(vle,{children:[(0,U.jsx)(yle,{}),(0,U.jsx)(xle,{}),(0,U.jsx)(ble,{})]})]},t.key)),w&&(0,U.jsx)(P0,{from:`assistant`,children:(0,U.jsx)(F0,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground`,children:[(0,U.jsx)(C2,{className:`size-3.5 shrink-0`}),(0,U.jsx)(`span`,{children:`Thinking...`})]})})})]}),(0,U.jsx)($ee,{})]}),(0,U.jsx)(`div`,{className:`grid shrink-0 gap-4 pt-4`,children:(0,U.jsx)(`div`,{className:`w-full px-4 pb-4`,children:(0,U.jsxs)(jue,{globalDrop:!0,multiple:!0,onSubmit:x,children:[(0,U.jsx)(Mue,{children:(0,U.jsx)(Nue,{onChange:S,value:l})}),(0,U.jsxs)(Pue,{children:[(0,U.jsxs)(Fue,{children:[(0,U.jsx)(ege,{className:`shrink-0`,onTranscriptionChange:C,size:`icon-sm`,variant:`ghost`}),(0,U.jsxs)(ove,{children:[(0,U.jsx)(sve,{render:(0,U.jsx)(Rg,{size:`icon-sm`,variant:`ghost`,"aria-label":`Display settings`}),children:(0,U.jsx)(zee,{className:`size-4`})}),(0,U.jsx)(cve,{className:`w-52`,align:`start`,side:`top`,children:(0,U.jsxs)(`div`,{className:`grid gap-4`,children:[(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsx)(`h4`,{className:`text-sm font-medium`,children:`Display options`}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Toggle what you see in the chat.`})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`label`,{className:`text-sm`,htmlFor:`show-tools`,children:`Show tool outputs`}),(0,U.jsx)(H9,{id:`show-tools`,checked:d,onCheckedChange:f})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`label`,{className:`text-sm`,htmlFor:`show-reasoning`,children:`Show reasoning`}),(0,U.jsx)(H9,{id:`show-reasoning`,checked:p,onCheckedChange:m})]}),c&&(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`label`,{className:`text-sm`,htmlFor:`show-feedback`,children:`Show feedback`}),(0,U.jsx)(H9,{id:`show-feedback`,checked:h,onCheckedChange:g})]})]})})]})]}),(0,U.jsx)(Iue,{disabled:b,status:t})]})]})})})]}):(0,U.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4 px-4 text-muted-foreground`,children:[(0,U.jsx)(`p`,{className:`text-sm`,children:`Start a new chat to begin.`}),a&&(0,U.jsxs)(Rg,{onClick:a,children:[(0,U.jsx)(s_,{className:`size-4`}),`New chat`]})]})}function mve(){return new URLSearchParams(window.location.search).get(`chat`)??void 0}function W9(e){let t=new URLSearchParams(window.location.search);t.set(`chat`,e),history.pushState(null,``,`?${t.toString()}`)}function hve({host:e,agentName:t,userId:n,authToken:r,onAgentStatusChange:i,onAuthTokenChange:a}){let[o,s]=(0,I.useState)([]),{currentChatName:c,status:l,assistant:u,chat:d}=nee({host:e,agentName:t,name:n,authToken:r}),{feedback:f,onFeedback:p}=om({status:l,chatKey:c,submitMessageFeedback:d.submitMessageFeedback,getMessageFeedback:d.getMessageFeedback});(0,I.useEffect)(()=>{let e=mve();e&&u.openChat(e)},[]),(0,I.useEffect)(()=>{i(l)},[l]),(0,I.useEffect)(()=>{l===`connected`&&u.getChats().then(e=>{s(e)})},[l]);async function m(){W9(await u.createChat()),s(await u.getChats())}function h(e){u.openChat(e),W9(e)}async function g(e){u.deleteChat(e),s(await u.getChats())}let _=(0,I.useCallback)(e=>{let t=(d?.chat.messages?.length??0)===0;d?.chat.sendMessage?.(e),t&&setTimeout(()=>{u.getChats().then(s)},3e3)},[d,u]);return(0,U.jsxs)(`div`,{className:`w-full h-full flex`,children:[(0,U.jsxs)(`aside`,{className:`flex w-72 shrink-0 flex-col border-r border-border bg-muted/30`,children:[(0,U.jsxs)(`div`,{className:`border-b border-border p-2 flex justify-between`,children:[(0,U.jsxs)(Rg,{className:`cursor-pointer`,onClick:()=>m(),children:[(0,U.jsx)(s_,{className:`size-4`}),`New chat`]}),(0,U.jsx)(Rg,{size:`icon-sm`,variant:`ghost`,onClick:()=>u.getChats(),children:(0,U.jsx)(Ree,{className:`size-4`})})]}),(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-2`,children:o.length===0?(0,U.jsx)(`p`,{className:`px-2 py-6 text-center text-xs text-muted-foreground`,children:`No conversations yet.`}):(0,U.jsx)(`ul`,{className:`flex flex-col gap-2`,children:o.map(e=>{let t=e.name===c;return(0,U.jsxs)(`li`,{className:Pg(`relative group border border-border rounded-md`,{"border-gray-300":t}),children:[(0,U.jsxs)(`button`,{className:Pg(`w-full cursor-pointer rounded-md px-2 py-1.5 text-left transition-colors`,t?`bg-accent text-accent-foreground`:`hover:bg-accent`),onClick:()=>h(e.name),children:[(0,U.jsx)(`span`,{className:`truncate text-xs font-medium flex items-center mt-1`,children:e.title??(0,U.jsxs)(U.Fragment,{children:[`Untitled`,(0,U.jsx)(`span`,{className:`text-muted-foreground ml-auto`,children:new Date(e.updated_at).toLocaleString()})]})}),(0,U.jsx)(`span`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:e.summary})]}),(0,U.jsx)(Rg,{className:`absolute right-0 top-0 mt-0.5 mr-0.5 items-center justify-center invisible group-hover:visible bg-gray-50 text-gray-500 cursor-pointer flex`,size:`icon-sm`,variant:`ghost`,onClick:async()=>await g(e.name),children:(0,U.jsx)(Uee,{className:`size-4`})})]},e.name)})})})]}),(0,U.jsx)(`div`,{className:`grow flex flex-col gap-4`,children:(0,U.jsx)(U9,{messages:d?.chat.messages??[],chatStatus:d.chat.status??`ready`,sendMessage:_,connectionStatus:l,hasChat:!!c,onNewChat:()=>void m(),onAuthTokenSubmit:a,feedback:f,onFeedback:p})})]})}function gve(e){return(0,U.jsx)(`p`,{children:`Not implemented yet.`})}function _ve(){return new URLSearchParams(window.location.search).get(`chat`)??void 0}function vve(e){let t=new URLSearchParams(window.location.search);t.set(`chat`,e),history.pushState(null,``,`?${t.toString()}`)}function yve({host:e,agentName:t,authToken:n,userId:r,onAgentStatusChange:i,onAuthTokenChange:a}){let o=(0,I.useMemo)(()=>{let e=_ve()??hp();return vve(e),e},[]),{status:s,chat:c,submitMessageFeedback:l,getMessageFeedback:u}=am({host:e,agentName:t,name:`${r}:${o}`,authToken:n}),{feedback:d,onFeedback:f}=om({status:s,chatKey:o,submitMessageFeedback:l,getMessageFeedback:u});return(0,I.useEffect)(()=>{i(s)},[s]),(0,U.jsx)(`div`,{className:`w-full h-full flex`,children:(0,U.jsx)(`div`,{className:`grow flex flex-col gap-4`,children:(0,U.jsx)(U9,{messages:c?.messages??[],chatStatus:c?.status??`ready`,sendMessage:c?.sendMessage,connectionStatus:s,onAuthTokenSubmit:a,feedback:d,onFeedback:f})})})}function bve(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var xve=e=>{switch(e){case`success`:return wve;case`info`:return Eve;case`warning`:return Tve;case`error`:return Dve;default:return null}},Sve=Array(12).fill(0),Cve=({visible:e,className:t})=>I.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},I.createElement(`div`,{className:`sonner-spinner`},Sve.map((e,t)=>I.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),wve=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},I.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Tve=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},I.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Eve=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},I.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Dve=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},I.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Ove=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},I.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),I.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),kve=()=>{let[e,t]=I.useState(document.hidden);return I.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},G9=1,K9=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:G9++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],I.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(jve(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||G9++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ave=(e,t)=>{let n=t?.id||G9++;return K9.addToast({title:e,...t,id:n}),n},jve=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,q9=Object.assign(Ave,{success:K9.success,info:K9.info,warning:K9.warning,error:K9.error,custom:K9.custom,message:K9.message,promise:K9.promise,dismiss:K9.dismiss,loading:K9.loading},{getHistory:()=>K9.toasts,getToasts:()=>K9.getActiveToasts()});bve(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function J9(e){return e.label!==void 0}var Mve=3,Nve=`24px`,Pve=`16px`,Y9=4e3,Fve=356,Ive=14,Lve=45,Rve=200;function X9(...e){return e.filter(Boolean).join(` `)}function zve(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Bve=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=I.useState(null),[O,k]=I.useState(null),[A,j]=I.useState(!1),[M,N]=I.useState(!1),[P,ee]=I.useState(!1),[F,te]=I.useState(!1),[ne,re]=I.useState(!1),[ie,ae]=I.useState(0),[oe,se]=I.useState(0),ce=I.useRef(n.duration||y||Y9),le=I.useRef(null),ue=I.useRef(null),de=c===0,fe=c+1<=o,pe=n.type,me=n.dismissible!==!1,he=n.className||``,ge=n.descriptionClassName||``,_e=I.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ve=I.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ye=I.useMemo(()=>n.duration||y||Y9,[n.duration,y]),be=I.useRef(0),xe=I.useRef(0),Se=I.useRef(0),Ce=I.useRef(null),[we,Te]=b.split(`-`),Ee=I.useMemo(()=>s.reduce((e,t,n)=>n>=_e?e:e+t.height,0),[s,_e]),De=kve(),Oe=n.invert||t,ke=pe===`loading`;xe.current=I.useMemo(()=>_e*x+Ee,[_e,Ee]),I.useEffect(()=>{ce.current=ye},[ye]),I.useEffect(()=>{j(!0)},[]),I.useEffect(()=>{let e=ue.current;if(e){let t=e.getBoundingClientRect().height;return se(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),I.useLayoutEffect(()=>{if(!A)return;let e=ue.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,se(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ae=I.useCallback(()=>{N(!0),ae(xe.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Rve)},[n,d,a,xe]);I.useEffect(()=>{if(n.promise&&pe===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||De?(()=>{if(Se.current<be.current){let e=new Date().getTime()-be.current;ce.current-=e}Se.current=new Date().getTime()})():ce.current!==1/0&&(be.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ae()},ce.current)),()=>clearTimeout(e)},[u,i,n,pe,De,Ae]),I.useEffect(()=>{n.delete&&(Ae(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ae,n.delete]);function je(){return w?.loading?I.createElement(`div`,{className:X9(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":pe===`loading`},w.loading):I.createElement(Cve,{className:X9(C?.loader,n?.classNames?.loader),visible:pe===`loading`})}let Me=n.icon||w?.[pe]||xve(pe);return I.createElement(`li`,{tabIndex:0,ref:ue,className:X9(_,he,C?.toast,n?.classNames?.toast,C?.default,C?.[pe],n?.classNames?.[pe]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":ne,"data-removed":M,"data-visible":fe,"data-y-position":we,"data-x-position":Te,"data-index":c,"data-front":de,"data-swiping":P,"data-dismissible":me,"data-type":pe,"data-invert":Oe,"data-swipe-out":F,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?ie:xe.current}px`,"--initial-height":S?`auto`:`${oe}px`,...m,...n.style},onDragEnd:()=>{ee(!1),D(null),Ce.current=null},onPointerDown:e=>{e.button!==2&&(ke||!me||(le.current=new Date,ae(xe.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(ee(!0),Ce.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(F||!me)return;Ce.current=null;let e=Number(ue.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ue.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-le.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=Lve||a>.11){ae(xe.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ae(),te(!0);return}else{var o,s;(o=ue.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ue.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}re(!1),ee(!1),D(null)},onPointerMove:t=>{var n,r;if(!Ce.current||!me||window.getSelection()?.toString().length>0)return;let i=t.clientY-Ce.current.y,a=t.clientX-Ce.current.x,o=e.swipeDirections??zve(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&D(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(E===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&re(!0),(n=ue.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=ue.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},ve&&!n.jsx&&pe!==`loading`?I.createElement(`button`,{"aria-label":T,"data-disabled":ke,"data-close-button":!0,onClick:ke||!me?()=>{}:()=>{Ae(),n.onDismiss==null||n.onDismiss.call(n,n)},className:X9(C?.closeButton,n?.classNames?.closeButton)},w?.close??Ove):null,(pe||n.icon||n.promise)&&n.icon!==null&&(w?.[pe]!==null||n.icon)?I.createElement(`div`,{"data-icon":``,className:X9(C?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||je():null,n.type===`loading`?null:Me):null,I.createElement(`div`,{"data-content":``,className:X9(C?.content,n?.classNames?.content)},I.createElement(`div`,{"data-title":``,className:X9(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?I.createElement(`div`,{"data-description":``,className:X9(v,ge,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),I.isValidElement(n.cancel)?n.cancel:n.cancel&&J9(n.cancel)?I.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{J9(n.cancel)&&me&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ae())},className:X9(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,I.isValidElement(n.action)?n.action:n.action&&J9(n.action)?I.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{J9(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ae())},className:X9(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Z9(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Vve(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Pve:Nve;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Hve=I.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Mve,toastOptions:g,dir:_=Z9(),gap:v=Ive,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=I.useState([]),C=I.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),w=I.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[T,E]=I.useState([]),[D,O]=I.useState(!1),[k,A]=I.useState(!1),[j,M]=I.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),N=I.useRef(null),P=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),ee=I.useRef(null),F=I.useRef(!1),te=I.useCallback(e=>{S(t=>(t.find(t=>t.id===e.id)?.delete||K9.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return I.useEffect(()=>K9.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{Ky.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),I.useEffect(()=>{if(d!==`system`){M(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?M(`dark`):M(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{M(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{M(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),I.useEffect(()=>{x.length<=1&&O(!1)},[x]),I.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;O(!0),(t=N.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===N.current||N.current?.contains(document.activeElement))&&O(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),I.useEffect(()=>{if(N.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,F.current=!1)}},[N.current]),I.createElement(`section`,{ref:t,"aria-label":`${b} ${P}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,n)=>{let[i,a]=t.split(`-`);return C.length?I.createElement(`ol`,{key:t,dir:_===`auto`?Z9():_,tabIndex:-1,ref:N,className:c,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${Fve}px`,"--gap":`${v}px`,...m,...Vve(l,u)},onBlur:e=>{F.current&&!e.currentTarget.contains(e.relatedTarget)&&(F.current=!1,ee.current&&=(ee.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||F.current||(F.current=!0,ee.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{k||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||A(!0)},onPointerUp:()=>A(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>I.createElement(Bve,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:k,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:te,toasts:C.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:D,swipeDirections:e.swipeDirections}))):null}))}),Uve=`playground:url`,Wve=`playground:body`,Gve=`playground:query`,Kve=`playground:userId`,qve=`playground:token`,Jve=`playground:welcomeMessage`;function Yve(e){try{let t=JSON.parse(e);return typeof t==`object`&&!!t&&Object.keys(t).length>0}catch{return!1}}function Xve(e){if(!e||e===`{}`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t||Array.isArray(t))return null;let n=t;for(let e of Object.values(n))if(typeof e!=`string`)return null;return n}function Q9(e){try{let t=new URL(e.includes(`://`)?e:`http://${e}`),n=t.pathname.split(`/`).filter(Boolean);return n[0]===`agents`&&n[1]?{host:t.host,agent:n[1]}:null}catch{return null}}function Zve(e){return e.split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function Qve(e){return e?Q9(e)||(q9.error(`Invalid agent URL — expected http://<host>/agents/<name>`),null):null}function $ve(){let e=new URLSearchParams(window.location.search);if(!e.has(`chat`))return;e.delete(`chat`);let t=e.toString();history.replaceState(null,``,t?`?${t}`:window.location.pathname)}function eye(){return localStorage.getItem(`playground:url`)??``}function $9(){return localStorage.getItem(`playground:userId`)??``}function tye(){return localStorage.getItem(`playground:token`)??``}function nye(){return localStorage.getItem(`playground:welcomeMessage`)??``}function rye(){return localStorage.getItem(`playground:body`)??``}function iye(){return localStorage.getItem(`playground:query`)??``}function aye(){let[e,t]=(0,I.useState)(eye),[n,r]=(0,I.useState)(e),[i,a]=(0,I.useState)($9),[o,s]=(0,I.useState)(tye),[c,l]=(0,I.useState)(nye),[u,d]=(0,I.useState)(rye),[f,p]=(0,I.useState)(iye),m=(0,I.useCallback)(e=>{localStorage.setItem(Kve,e),a(e)},[]),h=(0,I.useCallback)(e=>{localStorage.setItem(qve,e),s(e)},[]),g=(0,I.useCallback)(e=>{localStorage.setItem(Jve,e),l(e)},[]),_=(0,I.useCallback)(e=>{localStorage.setItem(Wve,e),d(e)},[]),v=(0,I.useCallback)(e=>{localStorage.setItem(Gve,e),p(e)},[]);return{agentUrl:e,urlDraft:n,setUrlDraft:r,commitUrl:(0,I.useCallback)(()=>{let i=n.trim();return Qve(i)?(i!==e&&$ve(),localStorage.setItem(Uve,i),t(i),r(i),!0):!1},[n,e]),connection:(0,I.useMemo)(()=>e?Q9(e):null,[e]),userId:i,setUserId:m,token:o,setToken:h,welcomeMessage:c,setWelcomeMessage:g,body:u,setBody:_,query:f,setQuery:v,toolContext:(0,I.useMemo)(()=>{let e=u.trim();if(e)try{return JSON.parse(e)}catch{return}},[u]),connectionParams:(0,I.useMemo)(()=>f?Xve(f.trim())??void 0:void 0,[f])}}var oye=`{
|
|
519
519
|
"timezone": "Europe/Copenhagen",
|
|
520
520
|
"tokens": {
|
|
521
521
|
"X-EconomicToken": "token_123"
|