@ours.network/messenger-server 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/chunks/{chunk-AXRJUIIU.js → chunk-LYV2Y5XE.js} +1 -1
  2. package/dist/chunks/{server-LACRIC6M.js → server-A2X3ONIW.js} +113 -16
  3. package/dist/cli.js +2 -2
  4. package/dist/web/assets/{abnfDiagram-N423BO3Z-pM7Mbmij.js → abnfDiagram-N423BO3Z-CSp6NRwP.js} +2 -2
  5. package/dist/web/assets/{abnfDiagram-N423BO3Z-pM7Mbmij.js.map → abnfDiagram-N423BO3Z-CSp6NRwP.js.map} +1 -1
  6. package/dist/web/assets/{arc-ClKVG6mD.js → arc-4IykQt9D.js} +2 -2
  7. package/dist/web/assets/{arc-ClKVG6mD.js.map → arc-4IykQt9D.js.map} +1 -1
  8. package/dist/web/assets/{architectureDiagram-T3A2C74G-C4SRzoCE.js → architectureDiagram-T3A2C74G-CL9LPWsH.js} +2 -2
  9. package/dist/web/assets/{architectureDiagram-T3A2C74G-C4SRzoCE.js.map → architectureDiagram-T3A2C74G-CL9LPWsH.js.map} +1 -1
  10. package/dist/web/assets/{blockDiagram-VBNYF7ZC-GAEDsTwc.js → blockDiagram-VBNYF7ZC-yC0791PW.js} +2 -2
  11. package/dist/web/assets/{blockDiagram-VBNYF7ZC-GAEDsTwc.js.map → blockDiagram-VBNYF7ZC-yC0791PW.js.map} +1 -1
  12. package/dist/web/assets/{browser-DvYJInDg.js → browser-aSjxdi-G.js} +2 -2
  13. package/dist/web/assets/{browser-DvYJInDg.js.map → browser-aSjxdi-G.js.map} +1 -1
  14. package/dist/web/assets/{c4Diagram-5PPSVZJV-CGMy6OgD.js → c4Diagram-5PPSVZJV-DqgWj3tY.js} +2 -2
  15. package/dist/web/assets/{c4Diagram-5PPSVZJV-CGMy6OgD.js.map → c4Diagram-5PPSVZJV-DqgWj3tY.js.map} +1 -1
  16. package/dist/web/assets/channel-jfpEU_2y.js +2 -0
  17. package/dist/web/assets/{channel-BE1VFGzt.js.map → channel-jfpEU_2y.js.map} +1 -1
  18. package/dist/web/assets/{chunk-2GRJ4B5K-CXtrZU7_.js → chunk-2GRJ4B5K-BWs5rfuK.js} +2 -2
  19. package/dist/web/assets/{chunk-2GRJ4B5K-CXtrZU7_.js.map → chunk-2GRJ4B5K-BWs5rfuK.js.map} +1 -1
  20. package/dist/web/assets/{chunk-2Q5K7J3B-DpzUrrLf.js → chunk-2Q5K7J3B-DKBbJc9E.js} +2 -2
  21. package/dist/web/assets/{chunk-2Q5K7J3B-DpzUrrLf.js.map → chunk-2Q5K7J3B-DKBbJc9E.js.map} +1 -1
  22. package/dist/web/assets/{chunk-5RXB4S5H-DXomNS62.js → chunk-5RXB4S5H-IaRBqmdn.js} +2 -2
  23. package/dist/web/assets/{chunk-5RXB4S5H-DXomNS62.js.map → chunk-5RXB4S5H-IaRBqmdn.js.map} +1 -1
  24. package/dist/web/assets/{chunk-5VM5RSS4-DO1pE55v.js → chunk-5VM5RSS4-DdMb5ZAE.js} +2 -2
  25. package/dist/web/assets/{chunk-5VM5RSS4-DO1pE55v.js.map → chunk-5VM5RSS4-DdMb5ZAE.js.map} +1 -1
  26. package/dist/web/assets/{chunk-6Q2QTUOP-VwCXFYQB.js → chunk-6Q2QTUOP-CYMlpG2Z.js} +2 -2
  27. package/dist/web/assets/{chunk-6Q2QTUOP-VwCXFYQB.js.map → chunk-6Q2QTUOP-CYMlpG2Z.js.map} +1 -1
  28. package/dist/web/assets/{chunk-GF5L2VYU-DXKpdibg.js → chunk-GF5L2VYU-BuKSmGxd.js} +2 -2
  29. package/dist/web/assets/{chunk-GF5L2VYU-DXKpdibg.js.map → chunk-GF5L2VYU-BuKSmGxd.js.map} +1 -1
  30. package/dist/web/assets/{chunk-JWPE2WC7-eLDeLJYU.js → chunk-JWPE2WC7-Cj_r5SZM.js} +2 -2
  31. package/dist/web/assets/{chunk-JWPE2WC7-eLDeLJYU.js.map → chunk-JWPE2WC7-Cj_r5SZM.js.map} +1 -1
  32. package/dist/web/assets/{chunk-KBJHAD2P-DbaKvO9I.js → chunk-KBJHAD2P-DCCYhI_8.js} +2 -2
  33. package/dist/web/assets/{chunk-KBJHAD2P-DbaKvO9I.js.map → chunk-KBJHAD2P-DCCYhI_8.js.map} +1 -1
  34. package/dist/web/assets/{chunk-RYQCIY6F-Di3XYSyf.js → chunk-RYQCIY6F-D3VqOBN6.js} +2 -2
  35. package/dist/web/assets/{chunk-RYQCIY6F-Di3XYSyf.js.map → chunk-RYQCIY6F-D3VqOBN6.js.map} +1 -1
  36. package/dist/web/assets/{chunk-XXDRQBXY-BKU_fO74.js → chunk-XXDRQBXY-BxQt3H1p.js} +2 -2
  37. package/dist/web/assets/{chunk-XXDRQBXY-BKU_fO74.js.map → chunk-XXDRQBXY-BxQt3H1p.js.map} +1 -1
  38. package/dist/web/assets/classDiagram-JCYQIIEL-Cvo-b8Qq.js +2 -0
  39. package/dist/web/assets/{classDiagram-JCYQIIEL-DstM1bxq.js.map → classDiagram-JCYQIIEL-Cvo-b8Qq.js.map} +1 -1
  40. package/dist/web/assets/classDiagram-v2-OCEON4UE-Cvo-b8Qq.js +2 -0
  41. package/dist/web/assets/{classDiagram-v2-OCEON4UE-DstM1bxq.js.map → classDiagram-v2-OCEON4UE-Cvo-b8Qq.js.map} +1 -1
  42. package/dist/web/assets/{cose-bilkent-JH36ORCC-CxJ8bzCn.js → cose-bilkent-JH36ORCC-D2wUnCFw.js} +2 -2
  43. package/dist/web/assets/{cose-bilkent-JH36ORCC-CxJ8bzCn.js.map → cose-bilkent-JH36ORCC-D2wUnCFw.js.map} +1 -1
  44. package/dist/web/assets/{cynefin-VYW2F7L2-X1MbqUu-.js → cynefin-VYW2F7L2-BhGyk9U8.js} +2 -2
  45. package/dist/web/assets/{cynefin-VYW2F7L2-X1MbqUu-.js.map → cynefin-VYW2F7L2-BhGyk9U8.js.map} +1 -1
  46. package/dist/web/assets/{cynefinDiagram-MW4NZA55-C8eEwynB.js → cynefinDiagram-MW4NZA55-8xsqHZI1.js} +2 -2
  47. package/dist/web/assets/{cynefinDiagram-MW4NZA55-C8eEwynB.js.map → cynefinDiagram-MW4NZA55-8xsqHZI1.js.map} +1 -1
  48. package/dist/web/assets/{dagre-VZM6K2ZE-DM3k1ZuP.js → dagre-VZM6K2ZE-CRZ4XP8D.js} +2 -2
  49. package/dist/web/assets/{dagre-VZM6K2ZE-DM3k1ZuP.js.map → dagre-VZM6K2ZE-CRZ4XP8D.js.map} +1 -1
  50. package/dist/web/assets/{diagram-7IWD3JNH-BCzpI5_-.js → diagram-7IWD3JNH-CH1OHs8U.js} +2 -2
  51. package/dist/web/assets/{diagram-7IWD3JNH-BCzpI5_-.js.map → diagram-7IWD3JNH-CH1OHs8U.js.map} +1 -1
  52. package/dist/web/assets/{diagram-B4RE2ZJO-6OAoYjPb.js → diagram-B4RE2ZJO-Cgrp934H.js} +2 -2
  53. package/dist/web/assets/{diagram-B4RE2ZJO-6OAoYjPb.js.map → diagram-B4RE2ZJO-Cgrp934H.js.map} +1 -1
  54. package/dist/web/assets/{diagram-LBJQPF4R-Ghwi6FSb.js → diagram-LBJQPF4R-De8kC6ko.js} +2 -2
  55. package/dist/web/assets/{diagram-LBJQPF4R-Ghwi6FSb.js.map → diagram-LBJQPF4R-De8kC6ko.js.map} +1 -1
  56. package/dist/web/assets/{diagram-Q27KOJAE-Bu6sUiqr.js → diagram-Q27KOJAE-CZuiMy7h.js} +2 -2
  57. package/dist/web/assets/{diagram-Q27KOJAE-Bu6sUiqr.js.map → diagram-Q27KOJAE-CZuiMy7h.js.map} +1 -1
  58. package/dist/web/assets/{diagram-UB23O5K3-Cmm_vyfK.js → diagram-UB23O5K3-B9yVlHWE.js} +2 -2
  59. package/dist/web/assets/{diagram-UB23O5K3-Cmm_vyfK.js.map → diagram-UB23O5K3-B9yVlHWE.js.map} +1 -1
  60. package/dist/web/assets/{ebnfDiagram-BXEA7PRR-BC4WgF-c.js → ebnfDiagram-BXEA7PRR-Bpz82JkA.js} +2 -2
  61. package/dist/web/assets/{ebnfDiagram-BXEA7PRR-BC4WgF-c.js.map → ebnfDiagram-BXEA7PRR-Bpz82JkA.js.map} +1 -1
  62. package/dist/web/assets/{erDiagram-JOGREHBK-DqdBEze-.js → erDiagram-JOGREHBK-C5a_pyMQ.js} +2 -2
  63. package/dist/web/assets/{erDiagram-JOGREHBK-DqdBEze-.js.map → erDiagram-JOGREHBK-C5a_pyMQ.js.map} +1 -1
  64. package/dist/web/assets/{flowDiagram-UKHOOZJN-BWwrYsT-.js → flowDiagram-UKHOOZJN-DbZd2-Tp.js} +2 -2
  65. package/dist/web/assets/{flowDiagram-UKHOOZJN-BWwrYsT-.js.map → flowDiagram-UKHOOZJN-DbZd2-Tp.js.map} +1 -1
  66. package/dist/web/assets/{ganttDiagram-PKOTCBZU-DA1yES44.js → ganttDiagram-PKOTCBZU-DWI87QsT.js} +2 -2
  67. package/dist/web/assets/{ganttDiagram-PKOTCBZU-DA1yES44.js.map → ganttDiagram-PKOTCBZU-DWI87QsT.js.map} +1 -1
  68. package/dist/web/assets/{gitGraphDiagram-DS77QQ5N-CDNEFLgS.js → gitGraphDiagram-DS77QQ5N-CECQyFvT.js} +2 -2
  69. package/dist/web/assets/{gitGraphDiagram-DS77QQ5N-CDNEFLgS.js.map → gitGraphDiagram-DS77QQ5N-CECQyFvT.js.map} +1 -1
  70. package/dist/web/assets/index-0ny2lCl9.js +322 -0
  71. package/dist/web/assets/index-0ny2lCl9.js.map +1 -0
  72. package/dist/web/assets/{index-BmQXAad8.css → index-B1juqaE-.css} +1 -1
  73. package/dist/web/assets/{infoDiagram-6WML65LV-9RussiqY.js → infoDiagram-6WML65LV-DjP_yFP1.js} +2 -2
  74. package/dist/web/assets/{infoDiagram-6WML65LV-9RussiqY.js.map → infoDiagram-6WML65LV-DjP_yFP1.js.map} +1 -1
  75. package/dist/web/assets/{ishikawaDiagram-WSZJBQD7-B3gRQq9e.js → ishikawaDiagram-WSZJBQD7-B2surd2T.js} +2 -2
  76. package/dist/web/assets/{ishikawaDiagram-WSZJBQD7-B3gRQq9e.js.map → ishikawaDiagram-WSZJBQD7-B2surd2T.js.map} +1 -1
  77. package/dist/web/assets/{journeyDiagram-NVQOT4AX-DqAYGlaG.js → journeyDiagram-NVQOT4AX-GvN2Rb4g.js} +2 -2
  78. package/dist/web/assets/{journeyDiagram-NVQOT4AX-DqAYGlaG.js.map → journeyDiagram-NVQOT4AX-GvN2Rb4g.js.map} +1 -1
  79. package/dist/web/assets/{jsQR-Bn11mi_e.js → jsQR-2VAxy2ky.js} +2 -2
  80. package/dist/web/assets/{jsQR-Bn11mi_e.js.map → jsQR-2VAxy2ky.js.map} +1 -1
  81. package/dist/web/assets/{kanban-definition-27J2QSJJ-jdYm_LCl.js → kanban-definition-27J2QSJJ-CrW-YmkU.js} +2 -2
  82. package/dist/web/assets/{kanban-definition-27J2QSJJ-jdYm_LCl.js.map → kanban-definition-27J2QSJJ-CrW-YmkU.js.map} +1 -1
  83. package/dist/web/assets/{linear-BIB58tKJ.js → linear-CQDslaR_.js} +2 -2
  84. package/dist/web/assets/{linear-BIB58tKJ.js.map → linear-CQDslaR_.js.map} +1 -1
  85. package/dist/web/assets/{mermaid.core-D_k6Q_o7.js → mermaid.core-CgO1XnMl.js} +5 -5
  86. package/dist/web/assets/{mermaid.core-D_k6Q_o7.js.map → mermaid.core-CgO1XnMl.js.map} +1 -1
  87. package/dist/web/assets/{mindmap-definition-FAOFIHXS-DOSiw2OA.js → mindmap-definition-FAOFIHXS-CGUWfBSf.js} +2 -2
  88. package/dist/web/assets/{mindmap-definition-FAOFIHXS-DOSiw2OA.js.map → mindmap-definition-FAOFIHXS-CGUWfBSf.js.map} +1 -1
  89. package/dist/web/assets/{pegDiagram-VL7TDLO6-B_uxCfTq.js → pegDiagram-VL7TDLO6-Co20Kd21.js} +2 -2
  90. package/dist/web/assets/{pegDiagram-VL7TDLO6-B_uxCfTq.js.map → pegDiagram-VL7TDLO6-Co20Kd21.js.map} +1 -1
  91. package/dist/web/assets/{pieDiagram-7S7Q4E2Y-k7womKc2.js → pieDiagram-7S7Q4E2Y-DeuESLr1.js} +2 -2
  92. package/dist/web/assets/{pieDiagram-7S7Q4E2Y-k7womKc2.js.map → pieDiagram-7S7Q4E2Y-DeuESLr1.js.map} +1 -1
  93. package/dist/web/assets/{quadrantDiagram-CIZ2JOQS-DDeP9GSy.js → quadrantDiagram-CIZ2JOQS-DyG_Rlre.js} +2 -2
  94. package/dist/web/assets/{quadrantDiagram-CIZ2JOQS-DDeP9GSy.js.map → quadrantDiagram-CIZ2JOQS-DyG_Rlre.js.map} +1 -1
  95. package/dist/web/assets/{railroadDiagram-AXF67PYL-3w9OC7bK.js → railroadDiagram-AXF67PYL-u8mUY3Rb.js} +2 -2
  96. package/dist/web/assets/{railroadDiagram-AXF67PYL-3w9OC7bK.js.map → railroadDiagram-AXF67PYL-u8mUY3Rb.js.map} +1 -1
  97. package/dist/web/assets/{requirementDiagram-LRYGKXZP-Dd-jdyLp.js → requirementDiagram-LRYGKXZP-PQf6qnA1.js} +2 -2
  98. package/dist/web/assets/{requirementDiagram-LRYGKXZP-Dd-jdyLp.js.map → requirementDiagram-LRYGKXZP-PQf6qnA1.js.map} +1 -1
  99. package/dist/web/assets/{sankeyDiagram-W5VNT64P-nP6fnjRm.js → sankeyDiagram-W5VNT64P-Dbcg6vhd.js} +2 -2
  100. package/dist/web/assets/{sankeyDiagram-W5VNT64P-nP6fnjRm.js.map → sankeyDiagram-W5VNT64P-Dbcg6vhd.js.map} +1 -1
  101. package/dist/web/assets/{sequenceDiagram-SI44F4Z6-Db7yXsx7.js → sequenceDiagram-SI44F4Z6-RDUrI-vZ.js} +2 -2
  102. package/dist/web/assets/{sequenceDiagram-SI44F4Z6-Db7yXsx7.js.map → sequenceDiagram-SI44F4Z6-RDUrI-vZ.js.map} +1 -1
  103. package/dist/web/assets/{sizeCapture-X5ZJPWSS-7HSt6rUG.js → sizeCapture-X5ZJPWSS-JXUi75QS.js} +2 -2
  104. package/dist/web/assets/{sizeCapture-X5ZJPWSS-7HSt6rUG.js.map → sizeCapture-X5ZJPWSS-JXUi75QS.js.map} +1 -1
  105. package/dist/web/assets/{stateDiagram-OKZ733FA-DCDBYc8x.js → stateDiagram-OKZ733FA-CWejbS_n.js} +2 -2
  106. package/dist/web/assets/{stateDiagram-OKZ733FA-DCDBYc8x.js.map → stateDiagram-OKZ733FA-CWejbS_n.js.map} +1 -1
  107. package/dist/web/assets/stateDiagram-v2-UEYNNEHI-zZFXI91O.js +2 -0
  108. package/dist/web/assets/{stateDiagram-v2-UEYNNEHI-kDvyGBqZ.js.map → stateDiagram-v2-UEYNNEHI-zZFXI91O.js.map} +1 -1
  109. package/dist/web/assets/{swimlanes-SLNWSIFB-yi3n69TK.js → swimlanes-SLNWSIFB-Bq-l7_tt.js} +3 -3
  110. package/dist/web/assets/{swimlanes-SLNWSIFB-yi3n69TK.js.map → swimlanes-SLNWSIFB-Bq-l7_tt.js.map} +1 -1
  111. package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-D4RKaS7N.js +9 -0
  112. package/dist/web/assets/{swimlanesDiagram-ULZ7WXOC-W_7yrf_B.js.map → swimlanesDiagram-ULZ7WXOC-D4RKaS7N.js.map} +1 -1
  113. package/dist/web/assets/{timeline-definition-Z64GVDOM-BYpFsSUO.js → timeline-definition-Z64GVDOM-BM1qRR9l.js} +2 -2
  114. package/dist/web/assets/{timeline-definition-Z64GVDOM-BYpFsSUO.js.map → timeline-definition-Z64GVDOM-BM1qRR9l.js.map} +1 -1
  115. package/dist/web/assets/{vennDiagram-T6HMQDX7-NtAYbYGj.js → vennDiagram-T6HMQDX7-nJF5zPxG.js} +2 -2
  116. package/dist/web/assets/{vennDiagram-T6HMQDX7-NtAYbYGj.js.map → vennDiagram-T6HMQDX7-nJF5zPxG.js.map} +1 -1
  117. package/dist/web/assets/{wardleyDiagram-T6FBY63Y-DHyOX2kW.js → wardleyDiagram-T6FBY63Y-DTFZj_j_.js} +2 -2
  118. package/dist/web/assets/{wardleyDiagram-T6FBY63Y-DHyOX2kW.js.map → wardleyDiagram-T6FBY63Y-DTFZj_j_.js.map} +1 -1
  119. package/dist/web/assets/{xychartDiagram-ELKLHX3M-B2SyZu-1.js → xychartDiagram-ELKLHX3M-D0sYk6hI.js} +2 -2
  120. package/dist/web/assets/{xychartDiagram-ELKLHX3M-B2SyZu-1.js.map → xychartDiagram-ELKLHX3M-D0sYk6hI.js.map} +1 -1
  121. package/dist/web/index.html +2 -2
  122. package/dist/web/sw.js +1 -1
  123. package/dist/web/version.json +1 -1
  124. package/package.json +3 -3
  125. package/dist/web/assets/channel-BE1VFGzt.js +0 -2
  126. package/dist/web/assets/classDiagram-JCYQIIEL-DstM1bxq.js +0 -2
  127. package/dist/web/assets/classDiagram-v2-OCEON4UE-DstM1bxq.js +0 -2
  128. package/dist/web/assets/index-DQ7ZNp6t.js +0 -322
  129. package/dist/web/assets/index-DQ7ZNp6t.js.map +0 -1
  130. package/dist/web/assets/stateDiagram-v2-UEYNNEHI-kDvyGBqZ.js +0 -2
  131. package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-W_7yrf_B.js +0 -9
@@ -1,322 +0,0 @@
1
- function Ib(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const l=Object.getOwnPropertyDescriptor(i,s);l&&Object.defineProperty(e,s,l.get?l:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function Td(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rc={exports:{}},$o={},Mc={exports:{}},_e={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var kg;function Lb(){if(kg)return _e;kg=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.iterator;function y(L){return L===null||typeof L!="object"?null:(L=p&&L[p]||L["@@iterator"],typeof L=="function"?L:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,C={};function T(L,Q,R){this.props=L,this.context=Q,this.refs=C,this.updater=R||w}T.prototype.isReactComponent={},T.prototype.setState=function(L,Q){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,Q,"setState")},T.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function E(){}E.prototype=T.prototype;function A(L,Q,R){this.props=L,this.context=Q,this.refs=C,this.updater=R||w}var M=A.prototype=new E;M.constructor=A,k(M,T.prototype),M.isPureReactComponent=!0;var _=Array.isArray,W=Object.prototype.hasOwnProperty,D={current:null},Y={key:!0,ref:!0,__self:!0,__source:!0};function H(L,Q,R){var Z,de={},ie=null,Ce=null;if(Q!=null)for(Z in Q.ref!==void 0&&(Ce=Q.ref),Q.key!==void 0&&(ie=""+Q.key),Q)W.call(Q,Z)&&!Y.hasOwnProperty(Z)&&(de[Z]=Q[Z]);var ge=arguments.length-2;if(ge===1)de.children=R;else if(1<ge){for(var Te=Array(ge),je=0;je<ge;je++)Te[je]=arguments[je+2];de.children=Te}if(L&&L.defaultProps)for(Z in ge=L.defaultProps,ge)de[Z]===void 0&&(de[Z]=ge[Z]);return{$$typeof:e,type:L,key:ie,ref:Ce,props:de,_owner:D.current}}function X(L,Q){return{$$typeof:e,type:L.type,key:Q,ref:L.ref,props:L.props,_owner:L._owner}}function j(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function G(L){var Q={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(R){return Q[R]})}var U=/\/+/g;function fe(L,Q){return typeof L=="object"&&L!==null&&L.key!=null?G(""+L.key):Q.toString(36)}function se(L,Q,R,Z,de){var ie=typeof L;(ie==="undefined"||ie==="boolean")&&(L=null);var Ce=!1;if(L===null)Ce=!0;else switch(ie){case"string":case"number":Ce=!0;break;case"object":switch(L.$$typeof){case e:case t:Ce=!0}}if(Ce)return Ce=L,de=de(Ce),L=Z===""?"."+fe(Ce,0):Z,_(de)?(R="",L!=null&&(R=L.replace(U,"$&/")+"/"),se(de,Q,R,"",function(je){return je})):de!=null&&(j(de)&&(de=X(de,R+(!de.key||Ce&&Ce.key===de.key?"":(""+de.key).replace(U,"$&/")+"/")+L)),Q.push(de)),1;if(Ce=0,Z=Z===""?".":Z+":",_(L))for(var ge=0;ge<L.length;ge++){ie=L[ge];var Te=Z+fe(ie,ge);Ce+=se(ie,Q,R,Te,de)}else if(Te=y(L),typeof Te=="function")for(L=Te.call(L),ge=0;!(ie=L.next()).done;)ie=ie.value,Te=Z+fe(ie,ge++),Ce+=se(ie,Q,R,Te,de);else if(ie==="object")throw Q=String(L),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.");return Ce}function ee(L,Q,R){if(L==null)return L;var Z=[],de=0;return se(L,Z,"","",function(ie){return Q.call(R,ie,de++)}),Z}function xe(L){if(L._status===-1){var Q=L._result;Q=Q(),Q.then(function(R){(L._status===0||L._status===-1)&&(L._status=1,L._result=R)},function(R){(L._status===0||L._status===-1)&&(L._status=2,L._result=R)}),L._status===-1&&(L._status=0,L._result=Q)}if(L._status===1)return L._result.default;throw L._result}var Ee={current:null},q={transition:null},le={ReactCurrentDispatcher:Ee,ReactCurrentBatchConfig:q,ReactCurrentOwner:D};function P(){throw Error("act(...) is not supported in production builds of React.")}return _e.Children={map:ee,forEach:function(L,Q,R){ee(L,function(){Q.apply(this,arguments)},R)},count:function(L){var Q=0;return ee(L,function(){Q++}),Q},toArray:function(L){return ee(L,function(Q){return Q})||[]},only:function(L){if(!j(L))throw Error("React.Children.only expected to receive a single React element child.");return L}},_e.Component=T,_e.Fragment=n,_e.Profiler=s,_e.PureComponent=A,_e.StrictMode=i,_e.Suspense=d,_e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=le,_e.act=P,_e.cloneElement=function(L,Q,R){if(L==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+L+".");var Z=k({},L.props),de=L.key,ie=L.ref,Ce=L._owner;if(Q!=null){if(Q.ref!==void 0&&(ie=Q.ref,Ce=D.current),Q.key!==void 0&&(de=""+Q.key),L.type&&L.type.defaultProps)var ge=L.type.defaultProps;for(Te in Q)W.call(Q,Te)&&!Y.hasOwnProperty(Te)&&(Z[Te]=Q[Te]===void 0&&ge!==void 0?ge[Te]:Q[Te])}var Te=arguments.length-2;if(Te===1)Z.children=R;else if(1<Te){ge=Array(Te);for(var je=0;je<Te;je++)ge[je]=arguments[je+2];Z.children=ge}return{$$typeof:e,type:L.type,key:de,ref:ie,props:Z,_owner:Ce}},_e.createContext=function(L){return L={$$typeof:a,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},L.Provider={$$typeof:l,_context:L},L.Consumer=L},_e.createElement=H,_e.createFactory=function(L){var Q=H.bind(null,L);return Q.type=L,Q},_e.createRef=function(){return{current:null}},_e.forwardRef=function(L){return{$$typeof:c,render:L}},_e.isValidElement=j,_e.lazy=function(L){return{$$typeof:m,_payload:{_status:-1,_result:L},_init:xe}},_e.memo=function(L,Q){return{$$typeof:h,type:L,compare:Q===void 0?null:Q}},_e.startTransition=function(L){var Q=q.transition;q.transition={};try{L()}finally{q.transition=Q}},_e.unstable_act=P,_e.useCallback=function(L,Q){return Ee.current.useCallback(L,Q)},_e.useContext=function(L){return Ee.current.useContext(L)},_e.useDebugValue=function(){},_e.useDeferredValue=function(L){return Ee.current.useDeferredValue(L)},_e.useEffect=function(L,Q){return Ee.current.useEffect(L,Q)},_e.useId=function(){return Ee.current.useId()},_e.useImperativeHandle=function(L,Q,R){return Ee.current.useImperativeHandle(L,Q,R)},_e.useInsertionEffect=function(L,Q){return Ee.current.useInsertionEffect(L,Q)},_e.useLayoutEffect=function(L,Q){return Ee.current.useLayoutEffect(L,Q)},_e.useMemo=function(L,Q){return Ee.current.useMemo(L,Q)},_e.useReducer=function(L,Q,R){return Ee.current.useReducer(L,Q,R)},_e.useRef=function(L){return Ee.current.useRef(L)},_e.useState=function(L){return Ee.current.useState(L)},_e.useSyncExternalStore=function(L,Q,R){return Ee.current.useSyncExternalStore(L,Q,R)},_e.useTransition=function(){return Ee.current.useTransition()},_e.version="18.3.1",_e}var Sg;function Pd(){return Sg||(Sg=1,Mc.exports=Lb()),Mc.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var bg;function _b(){if(bg)return $o;bg=1;var e=Pd(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function a(c,d,h){var m,p={},y=null,w=null;h!==void 0&&(y=""+h),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(w=d.ref);for(m in d)i.call(d,m)&&!l.hasOwnProperty(m)&&(p[m]=d[m]);if(c&&c.defaultProps)for(m in d=c.defaultProps,d)p[m]===void 0&&(p[m]=d[m]);return{$$typeof:t,type:c,key:y,ref:w,props:p,_owner:s.current}}return $o.Fragment=n,$o.jsx=a,$o.jsxs=a,$o}var Cg;function Ob(){return Cg||(Cg=1,Rc.exports=_b()),Rc.exports}var v=Ob(),Fa={},Ac={exports:{}},Xt={},Nc={exports:{}},jc={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var Eg;function Fb(){return Eg||(Eg=1,function(e){function t(q,le){var P=q.length;q.push(le);e:for(;0<P;){var L=P-1>>>1,Q=q[L];if(0<s(Q,le))q[L]=le,q[P]=Q,P=L;else break e}}function n(q){return q.length===0?null:q[0]}function i(q){if(q.length===0)return null;var le=q[0],P=q.pop();if(P!==le){q[0]=P;e:for(var L=0,Q=q.length,R=Q>>>1;L<R;){var Z=2*(L+1)-1,de=q[Z],ie=Z+1,Ce=q[ie];if(0>s(de,P))ie<Q&&0>s(Ce,de)?(q[L]=Ce,q[ie]=P,L=ie):(q[L]=de,q[Z]=P,L=Z);else if(ie<Q&&0>s(Ce,P))q[L]=Ce,q[ie]=P,L=ie;else break e}}return le}function s(q,le){var P=q.sortIndex-le.sortIndex;return P!==0?P:q.id-le.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var d=[],h=[],m=1,p=null,y=3,w=!1,k=!1,C=!1,T=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(q){for(var le=n(h);le!==null;){if(le.callback===null)i(h);else if(le.startTime<=q)i(h),le.sortIndex=le.expirationTime,t(d,le);else break;le=n(h)}}function _(q){if(C=!1,M(q),!k)if(n(d)!==null)k=!0,xe(W);else{var le=n(h);le!==null&&Ee(_,le.startTime-q)}}function W(q,le){k=!1,C&&(C=!1,E(H),H=-1),w=!0;var P=y;try{for(M(le),p=n(d);p!==null&&(!(p.expirationTime>le)||q&&!G());){var L=p.callback;if(typeof L=="function"){p.callback=null,y=p.priorityLevel;var Q=L(p.expirationTime<=le);le=e.unstable_now(),typeof Q=="function"?p.callback=Q:p===n(d)&&i(d),M(le)}else i(d);p=n(d)}if(p!==null)var R=!0;else{var Z=n(h);Z!==null&&Ee(_,Z.startTime-le),R=!1}return R}finally{p=null,y=P,w=!1}}var D=!1,Y=null,H=-1,X=5,j=-1;function G(){return!(e.unstable_now()-j<X)}function U(){if(Y!==null){var q=e.unstable_now();j=q;var le=!0;try{le=Y(!0,q)}finally{le?fe():(D=!1,Y=null)}}else D=!1}var fe;if(typeof A=="function")fe=function(){A(U)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,ee=se.port2;se.port1.onmessage=U,fe=function(){ee.postMessage(null)}}else fe=function(){T(U,0)};function xe(q){Y=q,D||(D=!0,fe())}function Ee(q,le){H=T(function(){q(e.unstable_now())},le)}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(q){q.callback=null},e.unstable_continueExecution=function(){k||w||(k=!0,xe(W))},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(q){switch(y){case 1:case 2:case 3:var le=3;break;default:le=y}var P=y;y=le;try{return q()}finally{y=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(q,le){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var P=y;y=q;try{return le()}finally{y=P}},e.unstable_scheduleCallback=function(q,le,P){var L=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?L+P:L):P=L,q){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=P+Q,q={id:m++,callback:le,priorityLevel:q,startTime:P,expirationTime:Q,sortIndex:-1},P>L?(q.sortIndex=P,t(h,q),n(d)===null&&q===n(h)&&(C?(E(H),H=-1):C=!0,Ee(_,P-L))):(q.sortIndex=Q,t(d,q),k||w||(k=!0,xe(W))),q},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(q){var le=y;return function(){var P=y;y=le;try{return q.apply(this,arguments)}finally{y=P}}}}(jc)),jc}var Tg;function zb(){return Tg||(Tg=1,Nc.exports=Fb()),Nc.exports}/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var Pg;function Vb(){if(Pg)return Xt;Pg=1;var e=Pd(),t=zb();function n(r){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+r,u=1;u<arguments.length;u++)o+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,s={};function l(r,o){a(r,o),a(r+"Capture",o)}function a(r,o){for(s[r]=o,r=0;r<o.length;r++)i.add(o[r])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},p={};function y(r){return d.call(p,r)?!0:d.call(m,r)?!1:h.test(r)?p[r]=!0:(m[r]=!0,!1)}function w(r,o,u,f){if(u!==null&&u.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return f?!1:u!==null?!u.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function k(r,o,u,f){if(o===null||typeof o>"u"||w(r,o,u,f))return!0;if(f)return!1;if(u!==null)switch(u.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function C(r,o,u,f,g,x,b){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=f,this.attributeNamespace=g,this.mustUseProperty=u,this.propertyName=r,this.type=o,this.sanitizeURL=x,this.removeEmptyString=b}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){T[r]=new C(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var o=r[0];T[o]=new C(o,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){T[r]=new C(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){T[r]=new C(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){T[r]=new C(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){T[r]=new C(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){T[r]=new C(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){T[r]=new C(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){T[r]=new C(r,5,!1,r.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function A(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var o=r.replace(E,A);T[o]=new C(o,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var o=r.replace(E,A);T[o]=new C(o,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var o=r.replace(E,A);T[o]=new C(o,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){T[r]=new C(r,1,!1,r.toLowerCase(),null,!1,!1)}),T.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){T[r]=new C(r,1,!1,r.toLowerCase(),null,!0,!0)});function M(r,o,u,f){var g=T.hasOwnProperty(o)?T[o]:null;(g!==null?g.type!==0:f||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(k(o,u,g,f)&&(u=null),f||g===null?y(o)&&(u===null?r.removeAttribute(o):r.setAttribute(o,""+u)):g.mustUseProperty?r[g.propertyName]=u===null?g.type===3?!1:"":u:(o=g.attributeName,f=g.attributeNamespace,u===null?r.removeAttribute(o):(g=g.type,u=g===3||g===4&&u===!0?"":""+u,f?r.setAttributeNS(f,o,u):r.setAttribute(o,u))))}var _=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,W=Symbol.for("react.element"),D=Symbol.for("react.portal"),Y=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),G=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),fe=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),xe=Symbol.for("react.lazy"),Ee=Symbol.for("react.offscreen"),q=Symbol.iterator;function le(r){return r===null||typeof r!="object"?null:(r=q&&r[q]||r["@@iterator"],typeof r=="function"?r:null)}var P=Object.assign,L;function Q(r){if(L===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);L=o&&o[1]||""}return`
34
- `+L+r}var R=!1;function Z(r,o){if(!r||R)return"";R=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(K){var f=K}Reflect.construct(r,[],o)}else{try{o.call()}catch(K){f=K}r.call(o.prototype)}else{try{throw Error()}catch(K){f=K}r()}}catch(K){if(K&&f&&typeof K.stack=="string"){for(var g=K.stack.split(`
35
- `),x=f.stack.split(`
36
- `),b=g.length-1,N=x.length-1;1<=b&&0<=N&&g[b]!==x[N];)N--;for(;1<=b&&0<=N;b--,N--)if(g[b]!==x[N]){if(b!==1||N!==1)do if(b--,N--,0>N||g[b]!==x[N]){var I=`
37
- `+g[b].replace(" at new "," at ");return r.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",r.displayName)),I}while(1<=b&&0<=N);break}}}finally{R=!1,Error.prepareStackTrace=u}return(r=r?r.displayName||r.name:"")?Q(r):""}function de(r){switch(r.tag){case 5:return Q(r.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return r=Z(r.type,!1),r;case 11:return r=Z(r.type.render,!1),r;case 1:return r=Z(r.type,!0),r;default:return""}}function ie(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case Y:return"Fragment";case D:return"Portal";case X:return"Profiler";case H:return"StrictMode";case fe:return"Suspense";case se:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case G:return(r.displayName||"Context")+".Consumer";case j:return(r._context.displayName||"Context")+".Provider";case U:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case ee:return o=r.displayName||null,o!==null?o:ie(r.type)||"Memo";case xe:o=r._payload,r=r._init;try{return ie(r(o))}catch{}}return null}function Ce(r){var o=r.type;switch(r.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=o.render,r=r.displayName||r.name||"",o.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ie(o);case 8:return o===H?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function ge(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Te(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function je(r){var o=Te(r)?"checked":"value",u=Object.getOwnPropertyDescriptor(r.constructor.prototype,o),f=""+r[o];if(!r.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var g=u.get,x=u.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return g.call(this)},set:function(b){f=""+b,x.call(this,b)}}),Object.defineProperty(r,o,{enumerable:u.enumerable}),{getValue:function(){return f},setValue:function(b){f=""+b},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function $e(r){r._valueTracker||(r._valueTracker=je(r))}function kt(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var u=o.getValue(),f="";return r&&(f=Te(r)?r.checked?"true":"false":r.value),r=f,r!==u?(o.setValue(r),!0):!1}function gt(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Dt(r,o){var u=o.checked;return P({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??r._wrapperState.initialChecked})}function Qt(r,o){var u=o.defaultValue==null?"":o.defaultValue,f=o.checked!=null?o.checked:o.defaultChecked;u=ge(o.value!=null?o.value:u),r._wrapperState={initialChecked:f,initialValue:u,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function Ut(r,o){o=o.checked,o!=null&&M(r,"checked",o,!1)}function it(r,o){Ut(r,o);var u=ge(o.value),f=o.type;if(u!=null)f==="number"?(u===0&&r.value===""||r.value!=u)&&(r.value=""+u):r.value!==""+u&&(r.value=""+u);else if(f==="submit"||f==="reset"){r.removeAttribute("value");return}o.hasOwnProperty("value")?Le(r,o.type,u):o.hasOwnProperty("defaultValue")&&Le(r,o.type,ge(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(r.defaultChecked=!!o.defaultChecked)}function It(r,o,u){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var f=o.type;if(!(f!=="submit"&&f!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+r._wrapperState.initialValue,u||o===r.value||(r.value=o),r.defaultValue=o}u=r.name,u!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,u!==""&&(r.name=u)}function Le(r,o,u){(o!=="number"||gt(r.ownerDocument)!==r)&&(u==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+u&&(r.defaultValue=""+u))}var an=Array.isArray;function Lt(r,o,u,f){if(r=r.options,o){o={};for(var g=0;g<u.length;g++)o["$"+u[g]]=!0;for(u=0;u<r.length;u++)g=o.hasOwnProperty("$"+r[u].value),r[u].selected!==g&&(r[u].selected=g),g&&f&&(r[u].defaultSelected=!0)}else{for(u=""+ge(u),o=null,g=0;g<r.length;g++){if(r[g].value===u){r[g].selected=!0,f&&(r[g].defaultSelected=!0);return}o!==null||r[g].disabled||(o=r[g])}o!==null&&(o.selected=!0)}}function jn(r,o){if(o.dangerouslySetInnerHTML!=null)throw Error(n(91));return P({},o,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function ln(r,o){var u=o.value;if(u==null){if(u=o.children,o=o.defaultValue,u!=null){if(o!=null)throw Error(n(92));if(an(u)){if(1<u.length)throw Error(n(93));u=u[0]}o=u}o==null&&(o=""),u=o}r._wrapperState={initialValue:ge(u)}}function z(r,o){var u=ge(o.value),f=ge(o.defaultValue);u!=null&&(u=""+u,u!==r.value&&(r.value=u),o.defaultValue==null&&r.defaultValue!==u&&(r.defaultValue=u)),f!=null&&(r.defaultValue=""+f)}function he(r){var o=r.textContent;o===r._wrapperState.initialValue&&o!==""&&o!==null&&(r.value=o)}function V(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function J(r,o){return r==null||r==="http://www.w3.org/1999/xhtml"?V(o):r==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var F,oe=function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,u,f,g){MSApp.execUnsafeLocalFunction(function(){return r(o,u,f,g)})}:r}(function(r,o){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=o;else{for(F=F||document.createElement("div"),F.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=F.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;o.firstChild;)r.appendChild(o.firstChild)}});function te(r,o){if(o){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=o;return}}r.textContent=o}var Ae={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Fe=["Webkit","ms","Moz","O"];Object.keys(Ae).forEach(function(r){Fe.forEach(function(o){o=o+r.charAt(0).toUpperCase()+r.substring(1),Ae[o]=Ae[r]})});function pe(r,o,u){return o==null||typeof o=="boolean"||o===""?"":u||typeof o!="number"||o===0||Ae.hasOwnProperty(r)&&Ae[r]?(""+o).trim():o+"px"}function Ie(r,o){r=r.style;for(var u in o)if(o.hasOwnProperty(u)){var f=u.indexOf("--")===0,g=pe(u,o[u],f);u==="float"&&(u="cssFloat"),f?r.setProperty(u,g):r[u]=g}}var Tt=P({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ot(r,o){if(o){if(Tt[r]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(n(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(n(61))}if(o.style!=null&&typeof o.style!="object")throw Error(n(62))}}function Ze(r,o){if(r.indexOf("-")===-1)return typeof o.is=="string";switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var We=null;function Zt(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var oo=null,ui=null,ci=null;function Fh(r){if(r=Ro(r)){if(typeof oo!="function")throw Error(n(280));var o=r.stateNode;o&&(o=Js(o),oo(r.stateNode,r.type,o))}}function zh(r){ui?ci?ci.push(r):ci=[r]:ui=r}function Vh(){if(ui){var r=ui,o=ci;if(ci=ui=null,Fh(r),o)for(r=0;r<o.length;r++)Fh(o[r])}}function Bh(r,o){return r(o)}function Uh(){}var Hl=!1;function $h(r,o,u){if(Hl)return r(o,u);Hl=!0;try{return Bh(r,o,u)}finally{Hl=!1,(ui!==null||ci!==null)&&(Uh(),Vh())}}function so(r,o){var u=r.stateNode;if(u===null)return null;var f=Js(u);if(f===null)return null;u=f[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(r=r.type,f=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!f;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(n(231,o,typeof u));return u}var Kl=!1;if(c)try{var ao={};Object.defineProperty(ao,"passive",{get:function(){Kl=!0}}),window.addEventListener("test",ao,ao),window.removeEventListener("test",ao,ao)}catch{Kl=!1}function Vk(r,o,u,f,g,x,b,N,I){var K=Array.prototype.slice.call(arguments,3);try{o.apply(u,K)}catch(re){this.onError(re)}}var lo=!1,Ns=null,js=!1,ql=null,Bk={onError:function(r){lo=!0,Ns=r}};function Uk(r,o,u,f,g,x,b,N,I){lo=!1,Ns=null,Vk.apply(Bk,arguments)}function $k(r,o,u,f,g,x,b,N,I){if(Uk.apply(this,arguments),lo){if(lo){var K=Ns;lo=!1,Ns=null}else throw Error(n(198));js||(js=!0,ql=K)}}function Ir(r){var o=r,u=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(u=o.return),r=o.return;while(r)}return o.tag===3?u:null}function Wh(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function Hh(r){if(Ir(r)!==r)throw Error(n(188))}function Wk(r){var o=r.alternate;if(!o){if(o=Ir(r),o===null)throw Error(n(188));return o!==r?null:r}for(var u=r,f=o;;){var g=u.return;if(g===null)break;var x=g.alternate;if(x===null){if(f=g.return,f!==null){u=f;continue}break}if(g.child===x.child){for(x=g.child;x;){if(x===u)return Hh(g),r;if(x===f)return Hh(g),o;x=x.sibling}throw Error(n(188))}if(u.return!==f.return)u=g,f=x;else{for(var b=!1,N=g.child;N;){if(N===u){b=!0,u=g,f=x;break}if(N===f){b=!0,f=g,u=x;break}N=N.sibling}if(!b){for(N=x.child;N;){if(N===u){b=!0,u=x,f=g;break}if(N===f){b=!0,f=x,u=g;break}N=N.sibling}if(!b)throw Error(n(189))}}if(u.alternate!==f)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?r:o}function Kh(r){return r=Wk(r),r!==null?qh(r):null}function qh(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var o=qh(r);if(o!==null)return o;r=r.sibling}return null}var Xh=t.unstable_scheduleCallback,Yh=t.unstable_cancelCallback,Hk=t.unstable_shouldYield,Kk=t.unstable_requestPaint,lt=t.unstable_now,qk=t.unstable_getCurrentPriorityLevel,Xl=t.unstable_ImmediatePriority,Gh=t.unstable_UserBlockingPriority,Ds=t.unstable_NormalPriority,Xk=t.unstable_LowPriority,Qh=t.unstable_IdlePriority,Is=null,Dn=null;function Yk(r){if(Dn&&typeof Dn.onCommitFiberRoot=="function")try{Dn.onCommitFiberRoot(Is,r,void 0,(r.current.flags&128)===128)}catch{}}var wn=Math.clz32?Math.clz32:Zk,Gk=Math.log,Qk=Math.LN2;function Zk(r){return r>>>=0,r===0?32:31-(Gk(r)/Qk|0)|0}var Ls=64,_s=4194304;function uo(r){switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function Os(r,o){var u=r.pendingLanes;if(u===0)return 0;var f=0,g=r.suspendedLanes,x=r.pingedLanes,b=u&268435455;if(b!==0){var N=b&~g;N!==0?f=uo(N):(x&=b,x!==0&&(f=uo(x)))}else b=u&~g,b!==0?f=uo(b):x!==0&&(f=uo(x));if(f===0)return 0;if(o!==0&&o!==f&&(o&g)===0&&(g=f&-f,x=o&-o,g>=x||g===16&&(x&4194240)!==0))return o;if((f&4)!==0&&(f|=u&16),o=r.entangledLanes,o!==0)for(r=r.entanglements,o&=f;0<o;)u=31-wn(o),g=1<<u,f|=r[u],o&=~g;return f}function Jk(r,o){switch(r){case 1:case 2:case 4:return o+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function eS(r,o){for(var u=r.suspendedLanes,f=r.pingedLanes,g=r.expirationTimes,x=r.pendingLanes;0<x;){var b=31-wn(x),N=1<<b,I=g[b];I===-1?((N&u)===0||(N&f)!==0)&&(g[b]=Jk(N,o)):I<=o&&(r.expiredLanes|=N),x&=~N}}function Yl(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function Zh(){var r=Ls;return Ls<<=1,(Ls&4194240)===0&&(Ls=64),r}function Gl(r){for(var o=[],u=0;31>u;u++)o.push(r);return o}function co(r,o,u){r.pendingLanes|=o,o!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,o=31-wn(o),r[o]=u}function tS(r,o){var u=r.pendingLanes&~o;r.pendingLanes=o,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=o,r.mutableReadLanes&=o,r.entangledLanes&=o,o=r.entanglements;var f=r.eventTimes;for(r=r.expirationTimes;0<u;){var g=31-wn(u),x=1<<g;o[g]=0,f[g]=-1,r[g]=-1,u&=~x}}function Ql(r,o){var u=r.entangledLanes|=o;for(r=r.entanglements;u;){var f=31-wn(u),g=1<<f;g&o|r[f]&o&&(r[f]|=o),u&=~g}}var He=0;function Jh(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var ep,Zl,tp,np,rp,Jl=!1,Fs=[],ir=null,or=null,sr=null,fo=new Map,ho=new Map,ar=[],nS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ip(r,o){switch(r){case"focusin":case"focusout":ir=null;break;case"dragenter":case"dragleave":or=null;break;case"mouseover":case"mouseout":sr=null;break;case"pointerover":case"pointerout":fo.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":ho.delete(o.pointerId)}}function po(r,o,u,f,g,x){return r===null||r.nativeEvent!==x?(r={blockedOn:o,domEventName:u,eventSystemFlags:f,nativeEvent:x,targetContainers:[g]},o!==null&&(o=Ro(o),o!==null&&Zl(o)),r):(r.eventSystemFlags|=f,o=r.targetContainers,g!==null&&o.indexOf(g)===-1&&o.push(g),r)}function rS(r,o,u,f,g){switch(o){case"focusin":return ir=po(ir,r,o,u,f,g),!0;case"dragenter":return or=po(or,r,o,u,f,g),!0;case"mouseover":return sr=po(sr,r,o,u,f,g),!0;case"pointerover":var x=g.pointerId;return fo.set(x,po(fo.get(x)||null,r,o,u,f,g)),!0;case"gotpointercapture":return x=g.pointerId,ho.set(x,po(ho.get(x)||null,r,o,u,f,g)),!0}return!1}function op(r){var o=Lr(r.target);if(o!==null){var u=Ir(o);if(u!==null){if(o=u.tag,o===13){if(o=Wh(u),o!==null){r.blockedOn=o,rp(r.priority,function(){tp(u)});return}}else if(o===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function zs(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var u=tu(r.domEventName,r.eventSystemFlags,o[0],r.nativeEvent);if(u===null){u=r.nativeEvent;var f=new u.constructor(u.type,u);We=f,u.target.dispatchEvent(f),We=null}else return o=Ro(u),o!==null&&Zl(o),r.blockedOn=u,!1;o.shift()}return!0}function sp(r,o,u){zs(r)&&u.delete(o)}function iS(){Jl=!1,ir!==null&&zs(ir)&&(ir=null),or!==null&&zs(or)&&(or=null),sr!==null&&zs(sr)&&(sr=null),fo.forEach(sp),ho.forEach(sp)}function mo(r,o){r.blockedOn===o&&(r.blockedOn=null,Jl||(Jl=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,iS)))}function go(r){function o(g){return mo(g,r)}if(0<Fs.length){mo(Fs[0],r);for(var u=1;u<Fs.length;u++){var f=Fs[u];f.blockedOn===r&&(f.blockedOn=null)}}for(ir!==null&&mo(ir,r),or!==null&&mo(or,r),sr!==null&&mo(sr,r),fo.forEach(o),ho.forEach(o),u=0;u<ar.length;u++)f=ar[u],f.blockedOn===r&&(f.blockedOn=null);for(;0<ar.length&&(u=ar[0],u.blockedOn===null);)op(u),u.blockedOn===null&&ar.shift()}var fi=_.ReactCurrentBatchConfig,Vs=!0;function oS(r,o,u,f){var g=He,x=fi.transition;fi.transition=null;try{He=1,eu(r,o,u,f)}finally{He=g,fi.transition=x}}function sS(r,o,u,f){var g=He,x=fi.transition;fi.transition=null;try{He=4,eu(r,o,u,f)}finally{He=g,fi.transition=x}}function eu(r,o,u,f){if(Vs){var g=tu(r,o,u,f);if(g===null)vu(r,o,f,Bs,u),ip(r,f);else if(rS(g,r,o,u,f))f.stopPropagation();else if(ip(r,f),o&4&&-1<nS.indexOf(r)){for(;g!==null;){var x=Ro(g);if(x!==null&&ep(x),x=tu(r,o,u,f),x===null&&vu(r,o,f,Bs,u),x===g)break;g=x}g!==null&&f.stopPropagation()}else vu(r,o,f,null,u)}}var Bs=null;function tu(r,o,u,f){if(Bs=null,r=Zt(f),r=Lr(r),r!==null)if(o=Ir(r),o===null)r=null;else if(u=o.tag,u===13){if(r=Wh(o),r!==null)return r;r=null}else if(u===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null);return Bs=r,null}function ap(r){switch(r){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(qk()){case Xl:return 1;case Gh:return 4;case Ds:case Xk:return 16;case Qh:return 536870912;default:return 16}default:return 16}}var lr=null,nu=null,Us=null;function lp(){if(Us)return Us;var r,o=nu,u=o.length,f,g="value"in lr?lr.value:lr.textContent,x=g.length;for(r=0;r<u&&o[r]===g[r];r++);var b=u-r;for(f=1;f<=b&&o[u-f]===g[x-f];f++);return Us=g.slice(r,1<f?1-f:void 0)}function $s(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function Ws(){return!0}function up(){return!1}function Jt(r){function o(u,f,g,x,b){this._reactName=u,this._targetInst=g,this.type=f,this.nativeEvent=x,this.target=b,this.currentTarget=null;for(var N in r)r.hasOwnProperty(N)&&(u=r[N],this[N]=u?u(x):x[N]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Ws:up,this.isPropagationStopped=up,this}return P(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Ws)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Ws)},persist:function(){},isPersistent:Ws}),o}var di={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ru=Jt(di),yo=P({},di,{view:0,detail:0}),aS=Jt(yo),iu,ou,vo,Hs=P({},yo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:au,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==vo&&(vo&&r.type==="mousemove"?(iu=r.screenX-vo.screenX,ou=r.screenY-vo.screenY):ou=iu=0,vo=r),iu)},movementY:function(r){return"movementY"in r?r.movementY:ou}}),cp=Jt(Hs),lS=P({},Hs,{dataTransfer:0}),uS=Jt(lS),cS=P({},yo,{relatedTarget:0}),su=Jt(cS),fS=P({},di,{animationName:0,elapsedTime:0,pseudoElement:0}),dS=Jt(fS),hS=P({},di,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),pS=Jt(hS),mS=P({},di,{data:0}),fp=Jt(mS),gS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},vS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xS(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=vS[r])?!!o[r]:!1}function au(){return xS}var wS=P({},yo,{key:function(r){if(r.key){var o=gS[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=$s(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?yS[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:au,charCode:function(r){return r.type==="keypress"?$s(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?$s(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),kS=Jt(wS),SS=P({},Hs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dp=Jt(SS),bS=P({},yo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:au}),CS=Jt(bS),ES=P({},di,{propertyName:0,elapsedTime:0,pseudoElement:0}),TS=Jt(ES),PS=P({},Hs,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),RS=Jt(PS),MS=[9,13,27,32],lu=c&&"CompositionEvent"in window,xo=null;c&&"documentMode"in document&&(xo=document.documentMode);var AS=c&&"TextEvent"in window&&!xo,hp=c&&(!lu||xo&&8<xo&&11>=xo),pp=" ",mp=!1;function gp(r,o){switch(r){case"keyup":return MS.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yp(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var hi=!1;function NS(r,o){switch(r){case"compositionend":return yp(o);case"keypress":return o.which!==32?null:(mp=!0,pp);case"textInput":return r=o.data,r===pp&&mp?null:r;default:return null}}function jS(r,o){if(hi)return r==="compositionend"||!lu&&gp(r,o)?(r=lp(),Us=nu=lr=null,hi=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return hp&&o.locale!=="ko"?null:o.data;default:return null}}var DS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function vp(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!DS[r.type]:o==="textarea"}function xp(r,o,u,f){zh(f),o=Gs(o,"onChange"),0<o.length&&(u=new ru("onChange","change",null,u,f),r.push({event:u,listeners:o}))}var wo=null,ko=null;function IS(r){Op(r,0)}function Ks(r){var o=vi(r);if(kt(o))return r}function LS(r,o){if(r==="change")return o}var wp=!1;if(c){var uu;if(c){var cu="oninput"in document;if(!cu){var kp=document.createElement("div");kp.setAttribute("oninput","return;"),cu=typeof kp.oninput=="function"}uu=cu}else uu=!1;wp=uu&&(!document.documentMode||9<document.documentMode)}function Sp(){wo&&(wo.detachEvent("onpropertychange",bp),ko=wo=null)}function bp(r){if(r.propertyName==="value"&&Ks(ko)){var o=[];xp(o,ko,r,Zt(r)),$h(IS,o)}}function _S(r,o,u){r==="focusin"?(Sp(),wo=o,ko=u,wo.attachEvent("onpropertychange",bp)):r==="focusout"&&Sp()}function OS(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Ks(ko)}function FS(r,o){if(r==="click")return Ks(o)}function zS(r,o){if(r==="input"||r==="change")return Ks(o)}function VS(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var kn=typeof Object.is=="function"?Object.is:VS;function So(r,o){if(kn(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var u=Object.keys(r),f=Object.keys(o);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var g=u[f];if(!d.call(o,g)||!kn(r[g],o[g]))return!1}return!0}function Cp(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Ep(r,o){var u=Cp(r);r=0;for(var f;u;){if(u.nodeType===3){if(f=r+u.textContent.length,r<=o&&f>=o)return{node:u,offset:o-r};r=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Cp(u)}}function Tp(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?Tp(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function Pp(){for(var r=window,o=gt();o instanceof r.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)r=o.contentWindow;else break;o=gt(r.document)}return o}function fu(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}function BS(r){var o=Pp(),u=r.focusedElem,f=r.selectionRange;if(o!==u&&u&&u.ownerDocument&&Tp(u.ownerDocument.documentElement,u)){if(f!==null&&fu(u)){if(o=f.start,r=f.end,r===void 0&&(r=o),"selectionStart"in u)u.selectionStart=o,u.selectionEnd=Math.min(r,u.value.length);else if(r=(o=u.ownerDocument||document)&&o.defaultView||window,r.getSelection){r=r.getSelection();var g=u.textContent.length,x=Math.min(f.start,g);f=f.end===void 0?x:Math.min(f.end,g),!r.extend&&x>f&&(g=f,f=x,x=g),g=Ep(u,x);var b=Ep(u,f);g&&b&&(r.rangeCount!==1||r.anchorNode!==g.node||r.anchorOffset!==g.offset||r.focusNode!==b.node||r.focusOffset!==b.offset)&&(o=o.createRange(),o.setStart(g.node,g.offset),r.removeAllRanges(),x>f?(r.addRange(o),r.extend(b.node,b.offset)):(o.setEnd(b.node,b.offset),r.addRange(o)))}}for(o=[],r=u;r=r.parentNode;)r.nodeType===1&&o.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<o.length;u++)r=o[u],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var US=c&&"documentMode"in document&&11>=document.documentMode,pi=null,du=null,bo=null,hu=!1;function Rp(r,o,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;hu||pi==null||pi!==gt(f)||(f=pi,"selectionStart"in f&&fu(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),bo&&So(bo,f)||(bo=f,f=Gs(du,"onSelect"),0<f.length&&(o=new ru("onSelect","select",null,o,u),r.push({event:o,listeners:f}),o.target=pi)))}function qs(r,o){var u={};return u[r.toLowerCase()]=o.toLowerCase(),u["Webkit"+r]="webkit"+o,u["Moz"+r]="moz"+o,u}var mi={animationend:qs("Animation","AnimationEnd"),animationiteration:qs("Animation","AnimationIteration"),animationstart:qs("Animation","AnimationStart"),transitionend:qs("Transition","TransitionEnd")},pu={},Mp={};c&&(Mp=document.createElement("div").style,"AnimationEvent"in window||(delete mi.animationend.animation,delete mi.animationiteration.animation,delete mi.animationstart.animation),"TransitionEvent"in window||delete mi.transitionend.transition);function Xs(r){if(pu[r])return pu[r];if(!mi[r])return r;var o=mi[r],u;for(u in o)if(o.hasOwnProperty(u)&&u in Mp)return pu[r]=o[u];return r}var Ap=Xs("animationend"),Np=Xs("animationiteration"),jp=Xs("animationstart"),Dp=Xs("transitionend"),Ip=new Map,Lp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ur(r,o){Ip.set(r,o),l(o,[r])}for(var mu=0;mu<Lp.length;mu++){var gu=Lp[mu],$S=gu.toLowerCase(),WS=gu[0].toUpperCase()+gu.slice(1);ur($S,"on"+WS)}ur(Ap,"onAnimationEnd"),ur(Np,"onAnimationIteration"),ur(jp,"onAnimationStart"),ur("dblclick","onDoubleClick"),ur("focusin","onFocus"),ur("focusout","onBlur"),ur(Dp,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Co="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),HS=new Set("cancel close invalid load scroll toggle".split(" ").concat(Co));function _p(r,o,u){var f=r.type||"unknown-event";r.currentTarget=u,$k(f,o,void 0,r),r.currentTarget=null}function Op(r,o){o=(o&4)!==0;for(var u=0;u<r.length;u++){var f=r[u],g=f.event;f=f.listeners;e:{var x=void 0;if(o)for(var b=f.length-1;0<=b;b--){var N=f[b],I=N.instance,K=N.currentTarget;if(N=N.listener,I!==x&&g.isPropagationStopped())break e;_p(g,N,K),x=I}else for(b=0;b<f.length;b++){if(N=f[b],I=N.instance,K=N.currentTarget,N=N.listener,I!==x&&g.isPropagationStopped())break e;_p(g,N,K),x=I}}}if(js)throw r=ql,js=!1,ql=null,r}function Je(r,o){var u=o[Cu];u===void 0&&(u=o[Cu]=new Set);var f=r+"__bubble";u.has(f)||(Fp(o,r,2,!1),u.add(f))}function yu(r,o,u){var f=0;o&&(f|=4),Fp(u,r,f,o)}var Ys="_reactListening"+Math.random().toString(36).slice(2);function Eo(r){if(!r[Ys]){r[Ys]=!0,i.forEach(function(u){u!=="selectionchange"&&(HS.has(u)||yu(u,!1,r),yu(u,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[Ys]||(o[Ys]=!0,yu("selectionchange",!1,o))}}function Fp(r,o,u,f){switch(ap(o)){case 1:var g=oS;break;case 4:g=sS;break;default:g=eu}u=g.bind(null,o,u,r),g=void 0,!Kl||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(g=!0),f?g!==void 0?r.addEventListener(o,u,{capture:!0,passive:g}):r.addEventListener(o,u,!0):g!==void 0?r.addEventListener(o,u,{passive:g}):r.addEventListener(o,u,!1)}function vu(r,o,u,f,g){var x=f;if((o&1)===0&&(o&2)===0&&f!==null)e:for(;;){if(f===null)return;var b=f.tag;if(b===3||b===4){var N=f.stateNode.containerInfo;if(N===g||N.nodeType===8&&N.parentNode===g)break;if(b===4)for(b=f.return;b!==null;){var I=b.tag;if((I===3||I===4)&&(I=b.stateNode.containerInfo,I===g||I.nodeType===8&&I.parentNode===g))return;b=b.return}for(;N!==null;){if(b=Lr(N),b===null)return;if(I=b.tag,I===5||I===6){f=x=b;continue e}N=N.parentNode}}f=f.return}$h(function(){var K=x,re=Zt(u),ae=[];e:{var ne=Ip.get(r);if(ne!==void 0){var me=ru,we=r;switch(r){case"keypress":if($s(u)===0)break e;case"keydown":case"keyup":me=kS;break;case"focusin":we="focus",me=su;break;case"focusout":we="blur",me=su;break;case"beforeblur":case"afterblur":me=su;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=cp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=uS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=CS;break;case Ap:case Np:case jp:me=dS;break;case Dp:me=TS;break;case"scroll":me=aS;break;case"wheel":me=RS;break;case"copy":case"cut":case"paste":me=pS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=dp}var Se=(o&4)!==0,ut=!Se&&r==="scroll",B=Se?ne!==null?ne+"Capture":null:ne;Se=[];for(var O=K,$;O!==null;){$=O;var ce=$.stateNode;if($.tag===5&&ce!==null&&($=ce,B!==null&&(ce=so(O,B),ce!=null&&Se.push(To(O,ce,$)))),ut)break;O=O.return}0<Se.length&&(ne=new me(ne,we,null,u,re),ae.push({event:ne,listeners:Se}))}}if((o&7)===0){e:{if(ne=r==="mouseover"||r==="pointerover",me=r==="mouseout"||r==="pointerout",ne&&u!==We&&(we=u.relatedTarget||u.fromElement)&&(Lr(we)||we[Kn]))break e;if((me||ne)&&(ne=re.window===re?re:(ne=re.ownerDocument)?ne.defaultView||ne.parentWindow:window,me?(we=u.relatedTarget||u.toElement,me=K,we=we?Lr(we):null,we!==null&&(ut=Ir(we),we!==ut||we.tag!==5&&we.tag!==6)&&(we=null)):(me=null,we=K),me!==we)){if(Se=cp,ce="onMouseLeave",B="onMouseEnter",O="mouse",(r==="pointerout"||r==="pointerover")&&(Se=dp,ce="onPointerLeave",B="onPointerEnter",O="pointer"),ut=me==null?ne:vi(me),$=we==null?ne:vi(we),ne=new Se(ce,O+"leave",me,u,re),ne.target=ut,ne.relatedTarget=$,ce=null,Lr(re)===K&&(Se=new Se(B,O+"enter",we,u,re),Se.target=$,Se.relatedTarget=ut,ce=Se),ut=ce,me&&we)t:{for(Se=me,B=we,O=0,$=Se;$;$=gi($))O++;for($=0,ce=B;ce;ce=gi(ce))$++;for(;0<O-$;)Se=gi(Se),O--;for(;0<$-O;)B=gi(B),$--;for(;O--;){if(Se===B||B!==null&&Se===B.alternate)break t;Se=gi(Se),B=gi(B)}Se=null}else Se=null;me!==null&&zp(ae,ne,me,Se,!1),we!==null&&ut!==null&&zp(ae,ut,we,Se,!0)}}e:{if(ne=K?vi(K):window,me=ne.nodeName&&ne.nodeName.toLowerCase(),me==="select"||me==="input"&&ne.type==="file")var be=LS;else if(vp(ne))if(wp)be=zS;else{be=OS;var Pe=_S}else(me=ne.nodeName)&&me.toLowerCase()==="input"&&(ne.type==="checkbox"||ne.type==="radio")&&(be=FS);if(be&&(be=be(r,K))){xp(ae,be,u,re);break e}Pe&&Pe(r,ne,K),r==="focusout"&&(Pe=ne._wrapperState)&&Pe.controlled&&ne.type==="number"&&Le(ne,"number",ne.value)}switch(Pe=K?vi(K):window,r){case"focusin":(vp(Pe)||Pe.contentEditable==="true")&&(pi=Pe,du=K,bo=null);break;case"focusout":bo=du=pi=null;break;case"mousedown":hu=!0;break;case"contextmenu":case"mouseup":case"dragend":hu=!1,Rp(ae,u,re);break;case"selectionchange":if(US)break;case"keydown":case"keyup":Rp(ae,u,re)}var Re;if(lu)e:{switch(r){case"compositionstart":var Ne="onCompositionStart";break e;case"compositionend":Ne="onCompositionEnd";break e;case"compositionupdate":Ne="onCompositionUpdate";break e}Ne=void 0}else hi?gp(r,u)&&(Ne="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(Ne="onCompositionStart");Ne&&(hp&&u.locale!=="ko"&&(hi||Ne!=="onCompositionStart"?Ne==="onCompositionEnd"&&hi&&(Re=lp()):(lr=re,nu="value"in lr?lr.value:lr.textContent,hi=!0)),Pe=Gs(K,Ne),0<Pe.length&&(Ne=new fp(Ne,r,null,u,re),ae.push({event:Ne,listeners:Pe}),Re?Ne.data=Re:(Re=yp(u),Re!==null&&(Ne.data=Re)))),(Re=AS?NS(r,u):jS(r,u))&&(K=Gs(K,"onBeforeInput"),0<K.length&&(re=new fp("onBeforeInput","beforeinput",null,u,re),ae.push({event:re,listeners:K}),re.data=Re))}Op(ae,o)})}function To(r,o,u){return{instance:r,listener:o,currentTarget:u}}function Gs(r,o){for(var u=o+"Capture",f=[];r!==null;){var g=r,x=g.stateNode;g.tag===5&&x!==null&&(g=x,x=so(r,u),x!=null&&f.unshift(To(r,x,g)),x=so(r,o),x!=null&&f.push(To(r,x,g))),r=r.return}return f}function gi(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function zp(r,o,u,f,g){for(var x=o._reactName,b=[];u!==null&&u!==f;){var N=u,I=N.alternate,K=N.stateNode;if(I!==null&&I===f)break;N.tag===5&&K!==null&&(N=K,g?(I=so(u,x),I!=null&&b.unshift(To(u,I,N))):g||(I=so(u,x),I!=null&&b.push(To(u,I,N)))),u=u.return}b.length!==0&&r.push({event:o,listeners:b})}var KS=/\r\n?/g,qS=/\u0000|\uFFFD/g;function Vp(r){return(typeof r=="string"?r:""+r).replace(KS,`
38
- `).replace(qS,"")}function Qs(r,o,u){if(o=Vp(o),Vp(r)!==o&&u)throw Error(n(425))}function Zs(){}var xu=null,wu=null;function ku(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Su=typeof setTimeout=="function"?setTimeout:void 0,XS=typeof clearTimeout=="function"?clearTimeout:void 0,Bp=typeof Promise=="function"?Promise:void 0,YS=typeof queueMicrotask=="function"?queueMicrotask:typeof Bp<"u"?function(r){return Bp.resolve(null).then(r).catch(GS)}:Su;function GS(r){setTimeout(function(){throw r})}function bu(r,o){var u=o,f=0;do{var g=u.nextSibling;if(r.removeChild(u),g&&g.nodeType===8)if(u=g.data,u==="/$"){if(f===0){r.removeChild(g),go(o);return}f--}else u!=="$"&&u!=="$?"&&u!=="$!"||f++;u=g}while(u);go(o)}function cr(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return r}function Up(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"){if(o===0)return r;o--}else u==="/$"&&o++}r=r.previousSibling}return null}var yi=Math.random().toString(36).slice(2),In="__reactFiber$"+yi,Po="__reactProps$"+yi,Kn="__reactContainer$"+yi,Cu="__reactEvents$"+yi,QS="__reactListeners$"+yi,ZS="__reactHandles$"+yi;function Lr(r){var o=r[In];if(o)return o;for(var u=r.parentNode;u;){if(o=u[Kn]||u[In]){if(u=o.alternate,o.child!==null||u!==null&&u.child!==null)for(r=Up(r);r!==null;){if(u=r[In])return u;r=Up(r)}return o}r=u,u=r.parentNode}return null}function Ro(r){return r=r[In]||r[Kn],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function vi(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function Js(r){return r[Po]||null}var Eu=[],xi=-1;function fr(r){return{current:r}}function et(r){0>xi||(r.current=Eu[xi],Eu[xi]=null,xi--)}function Ge(r,o){xi++,Eu[xi]=r.current,r.current=o}var dr={},Pt=fr(dr),$t=fr(!1),_r=dr;function wi(r,o){var u=r.type.contextTypes;if(!u)return dr;var f=r.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===o)return f.__reactInternalMemoizedMaskedChildContext;var g={},x;for(x in u)g[x]=o[x];return f&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=o,r.__reactInternalMemoizedMaskedChildContext=g),g}function Wt(r){return r=r.childContextTypes,r!=null}function ea(){et($t),et(Pt)}function $p(r,o,u){if(Pt.current!==dr)throw Error(n(168));Ge(Pt,o),Ge($t,u)}function Wp(r,o,u){var f=r.stateNode;if(o=o.childContextTypes,typeof f.getChildContext!="function")return u;f=f.getChildContext();for(var g in f)if(!(g in o))throw Error(n(108,Ce(r)||"Unknown",g));return P({},u,f)}function ta(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||dr,_r=Pt.current,Ge(Pt,r),Ge($t,$t.current),!0}function Hp(r,o,u){var f=r.stateNode;if(!f)throw Error(n(169));u?(r=Wp(r,o,_r),f.__reactInternalMemoizedMergedChildContext=r,et($t),et(Pt),Ge(Pt,r)):et($t),Ge($t,u)}var qn=null,na=!1,Tu=!1;function Kp(r){qn===null?qn=[r]:qn.push(r)}function JS(r){na=!0,Kp(r)}function hr(){if(!Tu&&qn!==null){Tu=!0;var r=0,o=He;try{var u=qn;for(He=1;r<u.length;r++){var f=u[r];do f=f(!0);while(f!==null)}qn=null,na=!1}catch(g){throw qn!==null&&(qn=qn.slice(r+1)),Xh(Xl,hr),g}finally{He=o,Tu=!1}}return null}var ki=[],Si=0,ra=null,ia=0,un=[],cn=0,Or=null,Xn=1,Yn="";function Fr(r,o){ki[Si++]=ia,ki[Si++]=ra,ra=r,ia=o}function qp(r,o,u){un[cn++]=Xn,un[cn++]=Yn,un[cn++]=Or,Or=r;var f=Xn;r=Yn;var g=32-wn(f)-1;f&=~(1<<g),u+=1;var x=32-wn(o)+g;if(30<x){var b=g-g%5;x=(f&(1<<b)-1).toString(32),f>>=b,g-=b,Xn=1<<32-wn(o)+g|u<<g|f,Yn=x+r}else Xn=1<<x|u<<g|f,Yn=r}function Pu(r){r.return!==null&&(Fr(r,1),qp(r,1,0))}function Ru(r){for(;r===ra;)ra=ki[--Si],ki[Si]=null,ia=ki[--Si],ki[Si]=null;for(;r===Or;)Or=un[--cn],un[cn]=null,Yn=un[--cn],un[cn]=null,Xn=un[--cn],un[cn]=null}var en=null,tn=null,tt=!1,Sn=null;function Xp(r,o){var u=pn(5,null,null,0);u.elementType="DELETED",u.stateNode=o,u.return=r,o=r.deletions,o===null?(r.deletions=[u],r.flags|=16):o.push(u)}function Yp(r,o){switch(r.tag){case 5:var u=r.type;return o=o.nodeType!==1||u.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(r.stateNode=o,en=r,tn=cr(o.firstChild),!0):!1;case 6:return o=r.pendingProps===""||o.nodeType!==3?null:o,o!==null?(r.stateNode=o,en=r,tn=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(u=Or!==null?{id:Xn,overflow:Yn}:null,r.memoizedState={dehydrated:o,treeContext:u,retryLane:1073741824},u=pn(18,null,null,0),u.stateNode=o,u.return=r,r.child=u,en=r,tn=null,!0):!1;default:return!1}}function Mu(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Au(r){if(tt){var o=tn;if(o){var u=o;if(!Yp(r,o)){if(Mu(r))throw Error(n(418));o=cr(u.nextSibling);var f=en;o&&Yp(r,o)?Xp(f,u):(r.flags=r.flags&-4097|2,tt=!1,en=r)}}else{if(Mu(r))throw Error(n(418));r.flags=r.flags&-4097|2,tt=!1,en=r}}}function Gp(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;en=r}function oa(r){if(r!==en)return!1;if(!tt)return Gp(r),tt=!0,!1;var o;if((o=r.tag!==3)&&!(o=r.tag!==5)&&(o=r.type,o=o!=="head"&&o!=="body"&&!ku(r.type,r.memoizedProps)),o&&(o=tn)){if(Mu(r))throw Qp(),Error(n(418));for(;o;)Xp(r,o),o=cr(o.nextSibling)}if(Gp(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,o=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"){if(o===0){tn=cr(r.nextSibling);break e}o--}else u!=="$"&&u!=="$!"&&u!=="$?"||o++}r=r.nextSibling}tn=null}}else tn=en?cr(r.stateNode.nextSibling):null;return!0}function Qp(){for(var r=tn;r;)r=cr(r.nextSibling)}function bi(){tn=en=null,tt=!1}function Nu(r){Sn===null?Sn=[r]:Sn.push(r)}var eb=_.ReactCurrentBatchConfig;function Mo(r,o,u){if(r=u.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var f=u.stateNode}if(!f)throw Error(n(147,r));var g=f,x=""+r;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===x?o.ref:(o=function(b){var N=g.refs;b===null?delete N[x]:N[x]=b},o._stringRef=x,o)}if(typeof r!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,r))}return r}function sa(r,o){throw r=Object.prototype.toString.call(o),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r))}function Zp(r){var o=r._init;return o(r._payload)}function Jp(r){function o(B,O){if(r){var $=B.deletions;$===null?(B.deletions=[O],B.flags|=16):$.push(O)}}function u(B,O){if(!r)return null;for(;O!==null;)o(B,O),O=O.sibling;return null}function f(B,O){for(B=new Map;O!==null;)O.key!==null?B.set(O.key,O):B.set(O.index,O),O=O.sibling;return B}function g(B,O){return B=kr(B,O),B.index=0,B.sibling=null,B}function x(B,O,$){return B.index=$,r?($=B.alternate,$!==null?($=$.index,$<O?(B.flags|=2,O):$):(B.flags|=2,O)):(B.flags|=1048576,O)}function b(B){return r&&B.alternate===null&&(B.flags|=2),B}function N(B,O,$,ce){return O===null||O.tag!==6?(O=Sc($,B.mode,ce),O.return=B,O):(O=g(O,$),O.return=B,O)}function I(B,O,$,ce){var be=$.type;return be===Y?re(B,O,$.props.children,ce,$.key):O!==null&&(O.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===xe&&Zp(be)===O.type)?(ce=g(O,$.props),ce.ref=Mo(B,O,$),ce.return=B,ce):(ce=Aa($.type,$.key,$.props,null,B.mode,ce),ce.ref=Mo(B,O,$),ce.return=B,ce)}function K(B,O,$,ce){return O===null||O.tag!==4||O.stateNode.containerInfo!==$.containerInfo||O.stateNode.implementation!==$.implementation?(O=bc($,B.mode,ce),O.return=B,O):(O=g(O,$.children||[]),O.return=B,O)}function re(B,O,$,ce,be){return O===null||O.tag!==7?(O=Kr($,B.mode,ce,be),O.return=B,O):(O=g(O,$),O.return=B,O)}function ae(B,O,$){if(typeof O=="string"&&O!==""||typeof O=="number")return O=Sc(""+O,B.mode,$),O.return=B,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case W:return $=Aa(O.type,O.key,O.props,null,B.mode,$),$.ref=Mo(B,null,O),$.return=B,$;case D:return O=bc(O,B.mode,$),O.return=B,O;case xe:var ce=O._init;return ae(B,ce(O._payload),$)}if(an(O)||le(O))return O=Kr(O,B.mode,$,null),O.return=B,O;sa(B,O)}return null}function ne(B,O,$,ce){var be=O!==null?O.key:null;if(typeof $=="string"&&$!==""||typeof $=="number")return be!==null?null:N(B,O,""+$,ce);if(typeof $=="object"&&$!==null){switch($.$$typeof){case W:return $.key===be?I(B,O,$,ce):null;case D:return $.key===be?K(B,O,$,ce):null;case xe:return be=$._init,ne(B,O,be($._payload),ce)}if(an($)||le($))return be!==null?null:re(B,O,$,ce,null);sa(B,$)}return null}function me(B,O,$,ce,be){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return B=B.get($)||null,N(O,B,""+ce,be);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case W:return B=B.get(ce.key===null?$:ce.key)||null,I(O,B,ce,be);case D:return B=B.get(ce.key===null?$:ce.key)||null,K(O,B,ce,be);case xe:var Pe=ce._init;return me(B,O,$,Pe(ce._payload),be)}if(an(ce)||le(ce))return B=B.get($)||null,re(O,B,ce,be,null);sa(O,ce)}return null}function we(B,O,$,ce){for(var be=null,Pe=null,Re=O,Ne=O=0,xt=null;Re!==null&&Ne<$.length;Ne++){Re.index>Ne?(xt=Re,Re=null):xt=Re.sibling;var Ue=ne(B,Re,$[Ne],ce);if(Ue===null){Re===null&&(Re=xt);break}r&&Re&&Ue.alternate===null&&o(B,Re),O=x(Ue,O,Ne),Pe===null?be=Ue:Pe.sibling=Ue,Pe=Ue,Re=xt}if(Ne===$.length)return u(B,Re),tt&&Fr(B,Ne),be;if(Re===null){for(;Ne<$.length;Ne++)Re=ae(B,$[Ne],ce),Re!==null&&(O=x(Re,O,Ne),Pe===null?be=Re:Pe.sibling=Re,Pe=Re);return tt&&Fr(B,Ne),be}for(Re=f(B,Re);Ne<$.length;Ne++)xt=me(Re,B,Ne,$[Ne],ce),xt!==null&&(r&&xt.alternate!==null&&Re.delete(xt.key===null?Ne:xt.key),O=x(xt,O,Ne),Pe===null?be=xt:Pe.sibling=xt,Pe=xt);return r&&Re.forEach(function(Sr){return o(B,Sr)}),tt&&Fr(B,Ne),be}function Se(B,O,$,ce){var be=le($);if(typeof be!="function")throw Error(n(150));if($=be.call($),$==null)throw Error(n(151));for(var Pe=be=null,Re=O,Ne=O=0,xt=null,Ue=$.next();Re!==null&&!Ue.done;Ne++,Ue=$.next()){Re.index>Ne?(xt=Re,Re=null):xt=Re.sibling;var Sr=ne(B,Re,Ue.value,ce);if(Sr===null){Re===null&&(Re=xt);break}r&&Re&&Sr.alternate===null&&o(B,Re),O=x(Sr,O,Ne),Pe===null?be=Sr:Pe.sibling=Sr,Pe=Sr,Re=xt}if(Ue.done)return u(B,Re),tt&&Fr(B,Ne),be;if(Re===null){for(;!Ue.done;Ne++,Ue=$.next())Ue=ae(B,Ue.value,ce),Ue!==null&&(O=x(Ue,O,Ne),Pe===null?be=Ue:Pe.sibling=Ue,Pe=Ue);return tt&&Fr(B,Ne),be}for(Re=f(B,Re);!Ue.done;Ne++,Ue=$.next())Ue=me(Re,B,Ne,Ue.value,ce),Ue!==null&&(r&&Ue.alternate!==null&&Re.delete(Ue.key===null?Ne:Ue.key),O=x(Ue,O,Ne),Pe===null?be=Ue:Pe.sibling=Ue,Pe=Ue);return r&&Re.forEach(function(Db){return o(B,Db)}),tt&&Fr(B,Ne),be}function ut(B,O,$,ce){if(typeof $=="object"&&$!==null&&$.type===Y&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case W:e:{for(var be=$.key,Pe=O;Pe!==null;){if(Pe.key===be){if(be=$.type,be===Y){if(Pe.tag===7){u(B,Pe.sibling),O=g(Pe,$.props.children),O.return=B,B=O;break e}}else if(Pe.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===xe&&Zp(be)===Pe.type){u(B,Pe.sibling),O=g(Pe,$.props),O.ref=Mo(B,Pe,$),O.return=B,B=O;break e}u(B,Pe);break}else o(B,Pe);Pe=Pe.sibling}$.type===Y?(O=Kr($.props.children,B.mode,ce,$.key),O.return=B,B=O):(ce=Aa($.type,$.key,$.props,null,B.mode,ce),ce.ref=Mo(B,O,$),ce.return=B,B=ce)}return b(B);case D:e:{for(Pe=$.key;O!==null;){if(O.key===Pe)if(O.tag===4&&O.stateNode.containerInfo===$.containerInfo&&O.stateNode.implementation===$.implementation){u(B,O.sibling),O=g(O,$.children||[]),O.return=B,B=O;break e}else{u(B,O);break}else o(B,O);O=O.sibling}O=bc($,B.mode,ce),O.return=B,B=O}return b(B);case xe:return Pe=$._init,ut(B,O,Pe($._payload),ce)}if(an($))return we(B,O,$,ce);if(le($))return Se(B,O,$,ce);sa(B,$)}return typeof $=="string"&&$!==""||typeof $=="number"?($=""+$,O!==null&&O.tag===6?(u(B,O.sibling),O=g(O,$),O.return=B,B=O):(u(B,O),O=Sc($,B.mode,ce),O.return=B,B=O),b(B)):u(B,O)}return ut}var Ci=Jp(!0),em=Jp(!1),aa=fr(null),la=null,Ei=null,ju=null;function Du(){ju=Ei=la=null}function Iu(r){var o=aa.current;et(aa),r._currentValue=o}function Lu(r,o,u){for(;r!==null;){var f=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,f!==null&&(f.childLanes|=o)):f!==null&&(f.childLanes&o)!==o&&(f.childLanes|=o),r===u)break;r=r.return}}function Ti(r,o){la=r,ju=Ei=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&o)!==0&&(Ht=!0),r.firstContext=null)}function fn(r){var o=r._currentValue;if(ju!==r)if(r={context:r,memoizedValue:o,next:null},Ei===null){if(la===null)throw Error(n(308));Ei=r,la.dependencies={lanes:0,firstContext:r}}else Ei=Ei.next=r;return o}var zr=null;function _u(r){zr===null?zr=[r]:zr.push(r)}function tm(r,o,u,f){var g=o.interleaved;return g===null?(u.next=u,_u(o)):(u.next=g.next,g.next=u),o.interleaved=u,Gn(r,f)}function Gn(r,o){r.lanes|=o;var u=r.alternate;for(u!==null&&(u.lanes|=o),u=r,r=r.return;r!==null;)r.childLanes|=o,u=r.alternate,u!==null&&(u.childLanes|=o),u=r,r=r.return;return u.tag===3?u.stateNode:null}var pr=!1;function Ou(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function nm(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Qn(r,o){return{eventTime:r,lane:o,tag:0,payload:null,callback:null,next:null}}function mr(r,o,u){var f=r.updateQueue;if(f===null)return null;if(f=f.shared,(Be&2)!==0){var g=f.pending;return g===null?o.next=o:(o.next=g.next,g.next=o),f.pending=o,Gn(r,u)}return g=f.interleaved,g===null?(o.next=o,_u(f)):(o.next=g.next,g.next=o),f.interleaved=o,Gn(r,u)}function ua(r,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194240)!==0)){var f=o.lanes;f&=r.pendingLanes,u|=f,o.lanes=u,Ql(r,u)}}function rm(r,o){var u=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var g=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var b={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};x===null?g=x=b:x=x.next=b,u=u.next}while(u!==null);x===null?g=x=o:x=x.next=o}else g=x=o;u={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:x,shared:f.shared,effects:f.effects},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=o:r.next=o,u.lastBaseUpdate=o}function ca(r,o,u,f){var g=r.updateQueue;pr=!1;var x=g.firstBaseUpdate,b=g.lastBaseUpdate,N=g.shared.pending;if(N!==null){g.shared.pending=null;var I=N,K=I.next;I.next=null,b===null?x=K:b.next=K,b=I;var re=r.alternate;re!==null&&(re=re.updateQueue,N=re.lastBaseUpdate,N!==b&&(N===null?re.firstBaseUpdate=K:N.next=K,re.lastBaseUpdate=I))}if(x!==null){var ae=g.baseState;b=0,re=K=I=null,N=x;do{var ne=N.lane,me=N.eventTime;if((f&ne)===ne){re!==null&&(re=re.next={eventTime:me,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var we=r,Se=N;switch(ne=o,me=u,Se.tag){case 1:if(we=Se.payload,typeof we=="function"){ae=we.call(me,ae,ne);break e}ae=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Se.payload,ne=typeof we=="function"?we.call(me,ae,ne):we,ne==null)break e;ae=P({},ae,ne);break e;case 2:pr=!0}}N.callback!==null&&N.lane!==0&&(r.flags|=64,ne=g.effects,ne===null?g.effects=[N]:ne.push(N))}else me={eventTime:me,lane:ne,tag:N.tag,payload:N.payload,callback:N.callback,next:null},re===null?(K=re=me,I=ae):re=re.next=me,b|=ne;if(N=N.next,N===null){if(N=g.shared.pending,N===null)break;ne=N,N=ne.next,ne.next=null,g.lastBaseUpdate=ne,g.shared.pending=null}}while(!0);if(re===null&&(I=ae),g.baseState=I,g.firstBaseUpdate=K,g.lastBaseUpdate=re,o=g.shared.interleaved,o!==null){g=o;do b|=g.lane,g=g.next;while(g!==o)}else x===null&&(g.shared.lanes=0);Ur|=b,r.lanes=b,r.memoizedState=ae}}function im(r,o,u){if(r=o.effects,o.effects=null,r!==null)for(o=0;o<r.length;o++){var f=r[o],g=f.callback;if(g!==null){if(f.callback=null,f=u,typeof g!="function")throw Error(n(191,g));g.call(f)}}}var Ao={},Ln=fr(Ao),No=fr(Ao),jo=fr(Ao);function Vr(r){if(r===Ao)throw Error(n(174));return r}function Fu(r,o){switch(Ge(jo,o),Ge(No,r),Ge(Ln,Ao),r=o.nodeType,r){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:J(null,"");break;default:r=r===8?o.parentNode:o,o=r.namespaceURI||null,r=r.tagName,o=J(o,r)}et(Ln),Ge(Ln,o)}function Pi(){et(Ln),et(No),et(jo)}function om(r){Vr(jo.current);var o=Vr(Ln.current),u=J(o,r.type);o!==u&&(Ge(No,r),Ge(Ln,u))}function zu(r){No.current===r&&(et(Ln),et(No))}var nt=fr(0);function fa(r){for(var o=r;o!==null;){if(o.tag===13){var u=o.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Vu=[];function Bu(){for(var r=0;r<Vu.length;r++)Vu[r]._workInProgressVersionPrimary=null;Vu.length=0}var da=_.ReactCurrentDispatcher,Uu=_.ReactCurrentBatchConfig,Br=0,rt=null,ht=null,yt=null,ha=!1,Do=!1,Io=0,tb=0;function Rt(){throw Error(n(321))}function $u(r,o){if(o===null)return!1;for(var u=0;u<o.length&&u<r.length;u++)if(!kn(r[u],o[u]))return!1;return!0}function Wu(r,o,u,f,g,x){if(Br=x,rt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,da.current=r===null||r.memoizedState===null?ob:sb,r=u(f,g),Do){x=0;do{if(Do=!1,Io=0,25<=x)throw Error(n(301));x+=1,yt=ht=null,o.updateQueue=null,da.current=ab,r=u(f,g)}while(Do)}if(da.current=ga,o=ht!==null&&ht.next!==null,Br=0,yt=ht=rt=null,ha=!1,o)throw Error(n(300));return r}function Hu(){var r=Io!==0;return Io=0,r}function _n(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yt===null?rt.memoizedState=yt=r:yt=yt.next=r,yt}function dn(){if(ht===null){var r=rt.alternate;r=r!==null?r.memoizedState:null}else r=ht.next;var o=yt===null?rt.memoizedState:yt.next;if(o!==null)yt=o,ht=r;else{if(r===null)throw Error(n(310));ht=r,r={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},yt===null?rt.memoizedState=yt=r:yt=yt.next=r}return yt}function Lo(r,o){return typeof o=="function"?o(r):o}function Ku(r){var o=dn(),u=o.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var f=ht,g=f.baseQueue,x=u.pending;if(x!==null){if(g!==null){var b=g.next;g.next=x.next,x.next=b}f.baseQueue=g=x,u.pending=null}if(g!==null){x=g.next,f=f.baseState;var N=b=null,I=null,K=x;do{var re=K.lane;if((Br&re)===re)I!==null&&(I=I.next={lane:0,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),f=K.hasEagerState?K.eagerState:r(f,K.action);else{var ae={lane:re,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null};I===null?(N=I=ae,b=f):I=I.next=ae,rt.lanes|=re,Ur|=re}K=K.next}while(K!==null&&K!==x);I===null?b=f:I.next=N,kn(f,o.memoizedState)||(Ht=!0),o.memoizedState=f,o.baseState=b,o.baseQueue=I,u.lastRenderedState=f}if(r=u.interleaved,r!==null){g=r;do x=g.lane,rt.lanes|=x,Ur|=x,g=g.next;while(g!==r)}else g===null&&(u.lanes=0);return[o.memoizedState,u.dispatch]}function qu(r){var o=dn(),u=o.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var f=u.dispatch,g=u.pending,x=o.memoizedState;if(g!==null){u.pending=null;var b=g=g.next;do x=r(x,b.action),b=b.next;while(b!==g);kn(x,o.memoizedState)||(Ht=!0),o.memoizedState=x,o.baseQueue===null&&(o.baseState=x),u.lastRenderedState=x}return[x,f]}function sm(){}function am(r,o){var u=rt,f=dn(),g=o(),x=!kn(f.memoizedState,g);if(x&&(f.memoizedState=g,Ht=!0),f=f.queue,Xu(cm.bind(null,u,f,r),[r]),f.getSnapshot!==o||x||yt!==null&&yt.memoizedState.tag&1){if(u.flags|=2048,_o(9,um.bind(null,u,f,g,o),void 0,null),vt===null)throw Error(n(349));(Br&30)!==0||lm(u,o,g)}return g}function lm(r,o,u){r.flags|=16384,r={getSnapshot:o,value:u},o=rt.updateQueue,o===null?(o={lastEffect:null,stores:null},rt.updateQueue=o,o.stores=[r]):(u=o.stores,u===null?o.stores=[r]:u.push(r))}function um(r,o,u,f){o.value=u,o.getSnapshot=f,fm(o)&&dm(r)}function cm(r,o,u){return u(function(){fm(o)&&dm(r)})}function fm(r){var o=r.getSnapshot;r=r.value;try{var u=o();return!kn(r,u)}catch{return!0}}function dm(r){var o=Gn(r,1);o!==null&&Tn(o,r,1,-1)}function hm(r){var o=_n();return typeof r=="function"&&(r=r()),o.memoizedState=o.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:r},o.queue=r,r=r.dispatch=ib.bind(null,rt,r),[o.memoizedState,r]}function _o(r,o,u,f){return r={tag:r,create:o,destroy:u,deps:f,next:null},o=rt.updateQueue,o===null?(o={lastEffect:null,stores:null},rt.updateQueue=o,o.lastEffect=r.next=r):(u=o.lastEffect,u===null?o.lastEffect=r.next=r:(f=u.next,u.next=r,r.next=f,o.lastEffect=r)),r}function pm(){return dn().memoizedState}function pa(r,o,u,f){var g=_n();rt.flags|=r,g.memoizedState=_o(1|o,u,void 0,f===void 0?null:f)}function ma(r,o,u,f){var g=dn();f=f===void 0?null:f;var x=void 0;if(ht!==null){var b=ht.memoizedState;if(x=b.destroy,f!==null&&$u(f,b.deps)){g.memoizedState=_o(o,u,x,f);return}}rt.flags|=r,g.memoizedState=_o(1|o,u,x,f)}function mm(r,o){return pa(8390656,8,r,o)}function Xu(r,o){return ma(2048,8,r,o)}function gm(r,o){return ma(4,2,r,o)}function ym(r,o){return ma(4,4,r,o)}function vm(r,o){if(typeof o=="function")return r=r(),o(r),function(){o(null)};if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function xm(r,o,u){return u=u!=null?u.concat([r]):null,ma(4,4,vm.bind(null,o,r),u)}function Yu(){}function wm(r,o){var u=dn();o=o===void 0?null:o;var f=u.memoizedState;return f!==null&&o!==null&&$u(o,f[1])?f[0]:(u.memoizedState=[r,o],r)}function km(r,o){var u=dn();o=o===void 0?null:o;var f=u.memoizedState;return f!==null&&o!==null&&$u(o,f[1])?f[0]:(r=r(),u.memoizedState=[r,o],r)}function Sm(r,o,u){return(Br&21)===0?(r.baseState&&(r.baseState=!1,Ht=!0),r.memoizedState=u):(kn(u,o)||(u=Zh(),rt.lanes|=u,Ur|=u,r.baseState=!0),o)}function nb(r,o){var u=He;He=u!==0&&4>u?u:4,r(!0);var f=Uu.transition;Uu.transition={};try{r(!1),o()}finally{He=u,Uu.transition=f}}function bm(){return dn().memoizedState}function rb(r,o,u){var f=xr(r);if(u={lane:f,action:u,hasEagerState:!1,eagerState:null,next:null},Cm(r))Em(o,u);else if(u=tm(r,o,u,f),u!==null){var g=Ot();Tn(u,r,f,g),Tm(u,o,f)}}function ib(r,o,u){var f=xr(r),g={lane:f,action:u,hasEagerState:!1,eagerState:null,next:null};if(Cm(r))Em(o,g);else{var x=r.alternate;if(r.lanes===0&&(x===null||x.lanes===0)&&(x=o.lastRenderedReducer,x!==null))try{var b=o.lastRenderedState,N=x(b,u);if(g.hasEagerState=!0,g.eagerState=N,kn(N,b)){var I=o.interleaved;I===null?(g.next=g,_u(o)):(g.next=I.next,I.next=g),o.interleaved=g;return}}catch{}finally{}u=tm(r,o,g,f),u!==null&&(g=Ot(),Tn(u,r,f,g),Tm(u,o,f))}}function Cm(r){var o=r.alternate;return r===rt||o!==null&&o===rt}function Em(r,o){Do=ha=!0;var u=r.pending;u===null?o.next=o:(o.next=u.next,u.next=o),r.pending=o}function Tm(r,o,u){if((u&4194240)!==0){var f=o.lanes;f&=r.pendingLanes,u|=f,o.lanes=u,Ql(r,u)}}var ga={readContext:fn,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useInsertionEffect:Rt,useLayoutEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useMutableSource:Rt,useSyncExternalStore:Rt,useId:Rt,unstable_isNewReconciler:!1},ob={readContext:fn,useCallback:function(r,o){return _n().memoizedState=[r,o===void 0?null:o],r},useContext:fn,useEffect:mm,useImperativeHandle:function(r,o,u){return u=u!=null?u.concat([r]):null,pa(4194308,4,vm.bind(null,o,r),u)},useLayoutEffect:function(r,o){return pa(4194308,4,r,o)},useInsertionEffect:function(r,o){return pa(4,2,r,o)},useMemo:function(r,o){var u=_n();return o=o===void 0?null:o,r=r(),u.memoizedState=[r,o],r},useReducer:function(r,o,u){var f=_n();return o=u!==void 0?u(o):o,f.memoizedState=f.baseState=o,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:o},f.queue=r,r=r.dispatch=rb.bind(null,rt,r),[f.memoizedState,r]},useRef:function(r){var o=_n();return r={current:r},o.memoizedState=r},useState:hm,useDebugValue:Yu,useDeferredValue:function(r){return _n().memoizedState=r},useTransition:function(){var r=hm(!1),o=r[0];return r=nb.bind(null,r[1]),_n().memoizedState=r,[o,r]},useMutableSource:function(){},useSyncExternalStore:function(r,o,u){var f=rt,g=_n();if(tt){if(u===void 0)throw Error(n(407));u=u()}else{if(u=o(),vt===null)throw Error(n(349));(Br&30)!==0||lm(f,o,u)}g.memoizedState=u;var x={value:u,getSnapshot:o};return g.queue=x,mm(cm.bind(null,f,x,r),[r]),f.flags|=2048,_o(9,um.bind(null,f,x,u,o),void 0,null),u},useId:function(){var r=_n(),o=vt.identifierPrefix;if(tt){var u=Yn,f=Xn;u=(f&~(1<<32-wn(f)-1)).toString(32)+u,o=":"+o+"R"+u,u=Io++,0<u&&(o+="H"+u.toString(32)),o+=":"}else u=tb++,o=":"+o+"r"+u.toString(32)+":";return r.memoizedState=o},unstable_isNewReconciler:!1},sb={readContext:fn,useCallback:wm,useContext:fn,useEffect:Xu,useImperativeHandle:xm,useInsertionEffect:gm,useLayoutEffect:ym,useMemo:km,useReducer:Ku,useRef:pm,useState:function(){return Ku(Lo)},useDebugValue:Yu,useDeferredValue:function(r){var o=dn();return Sm(o,ht.memoizedState,r)},useTransition:function(){var r=Ku(Lo)[0],o=dn().memoizedState;return[r,o]},useMutableSource:sm,useSyncExternalStore:am,useId:bm,unstable_isNewReconciler:!1},ab={readContext:fn,useCallback:wm,useContext:fn,useEffect:Xu,useImperativeHandle:xm,useInsertionEffect:gm,useLayoutEffect:ym,useMemo:km,useReducer:qu,useRef:pm,useState:function(){return qu(Lo)},useDebugValue:Yu,useDeferredValue:function(r){var o=dn();return ht===null?o.memoizedState=r:Sm(o,ht.memoizedState,r)},useTransition:function(){var r=qu(Lo)[0],o=dn().memoizedState;return[r,o]},useMutableSource:sm,useSyncExternalStore:am,useId:bm,unstable_isNewReconciler:!1};function bn(r,o){if(r&&r.defaultProps){o=P({},o),r=r.defaultProps;for(var u in r)o[u]===void 0&&(o[u]=r[u]);return o}return o}function Gu(r,o,u,f){o=r.memoizedState,u=u(f,o),u=u==null?o:P({},o,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var ya={isMounted:function(r){return(r=r._reactInternals)?Ir(r)===r:!1},enqueueSetState:function(r,o,u){r=r._reactInternals;var f=Ot(),g=xr(r),x=Qn(f,g);x.payload=o,u!=null&&(x.callback=u),o=mr(r,x,g),o!==null&&(Tn(o,r,g,f),ua(o,r,g))},enqueueReplaceState:function(r,o,u){r=r._reactInternals;var f=Ot(),g=xr(r),x=Qn(f,g);x.tag=1,x.payload=o,u!=null&&(x.callback=u),o=mr(r,x,g),o!==null&&(Tn(o,r,g,f),ua(o,r,g))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var u=Ot(),f=xr(r),g=Qn(u,f);g.tag=2,o!=null&&(g.callback=o),o=mr(r,g,f),o!==null&&(Tn(o,r,f,u),ua(o,r,f))}};function Pm(r,o,u,f,g,x,b){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(f,x,b):o.prototype&&o.prototype.isPureReactComponent?!So(u,f)||!So(g,x):!0}function Rm(r,o,u){var f=!1,g=dr,x=o.contextType;return typeof x=="object"&&x!==null?x=fn(x):(g=Wt(o)?_r:Pt.current,f=o.contextTypes,x=(f=f!=null)?wi(r,g):dr),o=new o(u,x),r.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=ya,r.stateNode=o,o._reactInternals=r,f&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=g,r.__reactInternalMemoizedMaskedChildContext=x),o}function Mm(r,o,u,f){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(u,f),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(u,f),o.state!==r&&ya.enqueueReplaceState(o,o.state,null)}function Qu(r,o,u,f){var g=r.stateNode;g.props=u,g.state=r.memoizedState,g.refs={},Ou(r);var x=o.contextType;typeof x=="object"&&x!==null?g.context=fn(x):(x=Wt(o)?_r:Pt.current,g.context=wi(r,x)),g.state=r.memoizedState,x=o.getDerivedStateFromProps,typeof x=="function"&&(Gu(r,o,x,u),g.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(o=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),o!==g.state&&ya.enqueueReplaceState(g,g.state,null),ca(r,u,g,f),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308)}function Ri(r,o){try{var u="",f=o;do u+=de(f),f=f.return;while(f);var g=u}catch(x){g=`
39
- Error generating stack: `+x.message+`
40
- `+x.stack}return{value:r,source:o,stack:g,digest:null}}function Zu(r,o,u){return{value:r,source:null,stack:u??null,digest:o??null}}function Ju(r,o){try{console.error(o.value)}catch(u){setTimeout(function(){throw u})}}var lb=typeof WeakMap=="function"?WeakMap:Map;function Am(r,o,u){u=Qn(-1,u),u.tag=3,u.payload={element:null};var f=o.value;return u.callback=function(){Ca||(Ca=!0,pc=f),Ju(r,o)},u}function Nm(r,o,u){u=Qn(-1,u),u.tag=3;var f=r.type.getDerivedStateFromError;if(typeof f=="function"){var g=o.value;u.payload=function(){return f(g)},u.callback=function(){Ju(r,o)}}var x=r.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(u.callback=function(){Ju(r,o),typeof f!="function"&&(yr===null?yr=new Set([this]):yr.add(this));var b=o.stack;this.componentDidCatch(o.value,{componentStack:b!==null?b:""})}),u}function jm(r,o,u){var f=r.pingCache;if(f===null){f=r.pingCache=new lb;var g=new Set;f.set(o,g)}else g=f.get(o),g===void 0&&(g=new Set,f.set(o,g));g.has(u)||(g.add(u),r=Sb.bind(null,r,o,u),o.then(r,r))}function Dm(r){do{var o;if((o=r.tag===13)&&(o=r.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return r;r=r.return}while(r!==null);return null}function Im(r,o,u,f,g){return(r.mode&1)===0?(r===o?r.flags|=65536:(r.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(o=Qn(-1,1),o.tag=2,mr(u,o,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=g,r)}var ub=_.ReactCurrentOwner,Ht=!1;function _t(r,o,u,f){o.child=r===null?em(o,null,u,f):Ci(o,r.child,u,f)}function Lm(r,o,u,f,g){u=u.render;var x=o.ref;return Ti(o,g),f=Wu(r,o,u,f,x,g),u=Hu(),r!==null&&!Ht?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~g,Zn(r,o,g)):(tt&&u&&Pu(o),o.flags|=1,_t(r,o,f,g),o.child)}function _m(r,o,u,f,g){if(r===null){var x=u.type;return typeof x=="function"&&!kc(x)&&x.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(o.tag=15,o.type=x,Om(r,o,x,f,g)):(r=Aa(u.type,null,f,o,o.mode,g),r.ref=o.ref,r.return=o,o.child=r)}if(x=r.child,(r.lanes&g)===0){var b=x.memoizedProps;if(u=u.compare,u=u!==null?u:So,u(b,f)&&r.ref===o.ref)return Zn(r,o,g)}return o.flags|=1,r=kr(x,f),r.ref=o.ref,r.return=o,o.child=r}function Om(r,o,u,f,g){if(r!==null){var x=r.memoizedProps;if(So(x,f)&&r.ref===o.ref)if(Ht=!1,o.pendingProps=f=x,(r.lanes&g)!==0)(r.flags&131072)!==0&&(Ht=!0);else return o.lanes=r.lanes,Zn(r,o,g)}return ec(r,o,u,f,g)}function Fm(r,o,u){var f=o.pendingProps,g=f.children,x=r!==null?r.memoizedState:null;if(f.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ge(Ai,nn),nn|=u;else{if((u&1073741824)===0)return r=x!==null?x.baseLanes|u:u,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:r,cachePool:null,transitions:null},o.updateQueue=null,Ge(Ai,nn),nn|=r,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=x!==null?x.baseLanes:u,Ge(Ai,nn),nn|=f}else x!==null?(f=x.baseLanes|u,o.memoizedState=null):f=u,Ge(Ai,nn),nn|=f;return _t(r,o,g,u),o.child}function zm(r,o){var u=o.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(o.flags|=512,o.flags|=2097152)}function ec(r,o,u,f,g){var x=Wt(u)?_r:Pt.current;return x=wi(o,x),Ti(o,g),u=Wu(r,o,u,f,x,g),f=Hu(),r!==null&&!Ht?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~g,Zn(r,o,g)):(tt&&f&&Pu(o),o.flags|=1,_t(r,o,u,g),o.child)}function Vm(r,o,u,f,g){if(Wt(u)){var x=!0;ta(o)}else x=!1;if(Ti(o,g),o.stateNode===null)xa(r,o),Rm(o,u,f),Qu(o,u,f,g),f=!0;else if(r===null){var b=o.stateNode,N=o.memoizedProps;b.props=N;var I=b.context,K=u.contextType;typeof K=="object"&&K!==null?K=fn(K):(K=Wt(u)?_r:Pt.current,K=wi(o,K));var re=u.getDerivedStateFromProps,ae=typeof re=="function"||typeof b.getSnapshotBeforeUpdate=="function";ae||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(N!==f||I!==K)&&Mm(o,b,f,K),pr=!1;var ne=o.memoizedState;b.state=ne,ca(o,f,b,g),I=o.memoizedState,N!==f||ne!==I||$t.current||pr?(typeof re=="function"&&(Gu(o,u,re,f),I=o.memoizedState),(N=pr||Pm(o,u,N,f,ne,I,K))?(ae||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(o.flags|=4194308)):(typeof b.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=f,o.memoizedState=I),b.props=f,b.state=I,b.context=K,f=N):(typeof b.componentDidMount=="function"&&(o.flags|=4194308),f=!1)}else{b=o.stateNode,nm(r,o),N=o.memoizedProps,K=o.type===o.elementType?N:bn(o.type,N),b.props=K,ae=o.pendingProps,ne=b.context,I=u.contextType,typeof I=="object"&&I!==null?I=fn(I):(I=Wt(u)?_r:Pt.current,I=wi(o,I));var me=u.getDerivedStateFromProps;(re=typeof me=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(N!==ae||ne!==I)&&Mm(o,b,f,I),pr=!1,ne=o.memoizedState,b.state=ne,ca(o,f,b,g);var we=o.memoizedState;N!==ae||ne!==we||$t.current||pr?(typeof me=="function"&&(Gu(o,u,me,f),we=o.memoizedState),(K=pr||Pm(o,u,K,f,ne,we,I)||!1)?(re||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(f,we,I),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(f,we,I)),typeof b.componentDidUpdate=="function"&&(o.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof b.componentDidUpdate!="function"||N===r.memoizedProps&&ne===r.memoizedState||(o.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||N===r.memoizedProps&&ne===r.memoizedState||(o.flags|=1024),o.memoizedProps=f,o.memoizedState=we),b.props=f,b.state=we,b.context=I,f=K):(typeof b.componentDidUpdate!="function"||N===r.memoizedProps&&ne===r.memoizedState||(o.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||N===r.memoizedProps&&ne===r.memoizedState||(o.flags|=1024),f=!1)}return tc(r,o,u,f,x,g)}function tc(r,o,u,f,g,x){zm(r,o);var b=(o.flags&128)!==0;if(!f&&!b)return g&&Hp(o,u,!1),Zn(r,o,x);f=o.stateNode,ub.current=o;var N=b&&typeof u.getDerivedStateFromError!="function"?null:f.render();return o.flags|=1,r!==null&&b?(o.child=Ci(o,r.child,null,x),o.child=Ci(o,null,N,x)):_t(r,o,N,x),o.memoizedState=f.state,g&&Hp(o,u,!0),o.child}function Bm(r){var o=r.stateNode;o.pendingContext?$p(r,o.pendingContext,o.pendingContext!==o.context):o.context&&$p(r,o.context,!1),Fu(r,o.containerInfo)}function Um(r,o,u,f,g){return bi(),Nu(g),o.flags|=256,_t(r,o,u,f),o.child}var nc={dehydrated:null,treeContext:null,retryLane:0};function rc(r){return{baseLanes:r,cachePool:null,transitions:null}}function $m(r,o,u){var f=o.pendingProps,g=nt.current,x=!1,b=(o.flags&128)!==0,N;if((N=b)||(N=r!==null&&r.memoizedState===null?!1:(g&2)!==0),N?(x=!0,o.flags&=-129):(r===null||r.memoizedState!==null)&&(g|=1),Ge(nt,g&1),r===null)return Au(o),r=o.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((o.mode&1)===0?o.lanes=1:r.data==="$!"?o.lanes=8:o.lanes=1073741824,null):(b=f.children,r=f.fallback,x?(f=o.mode,x=o.child,b={mode:"hidden",children:b},(f&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=b):x=Na(b,f,0,null),r=Kr(r,f,u,null),x.return=o,r.return=o,x.sibling=r,o.child=x,o.child.memoizedState=rc(u),o.memoizedState=nc,r):ic(o,b));if(g=r.memoizedState,g!==null&&(N=g.dehydrated,N!==null))return cb(r,o,b,f,N,g,u);if(x){x=f.fallback,b=o.mode,g=r.child,N=g.sibling;var I={mode:"hidden",children:f.children};return(b&1)===0&&o.child!==g?(f=o.child,f.childLanes=0,f.pendingProps=I,o.deletions=null):(f=kr(g,I),f.subtreeFlags=g.subtreeFlags&14680064),N!==null?x=kr(N,x):(x=Kr(x,b,u,null),x.flags|=2),x.return=o,f.return=o,f.sibling=x,o.child=f,f=x,x=o.child,b=r.child.memoizedState,b=b===null?rc(u):{baseLanes:b.baseLanes|u,cachePool:null,transitions:b.transitions},x.memoizedState=b,x.childLanes=r.childLanes&~u,o.memoizedState=nc,f}return x=r.child,r=x.sibling,f=kr(x,{mode:"visible",children:f.children}),(o.mode&1)===0&&(f.lanes=u),f.return=o,f.sibling=null,r!==null&&(u=o.deletions,u===null?(o.deletions=[r],o.flags|=16):u.push(r)),o.child=f,o.memoizedState=null,f}function ic(r,o){return o=Na({mode:"visible",children:o},r.mode,0,null),o.return=r,r.child=o}function va(r,o,u,f){return f!==null&&Nu(f),Ci(o,r.child,null,u),r=ic(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function cb(r,o,u,f,g,x,b){if(u)return o.flags&256?(o.flags&=-257,f=Zu(Error(n(422))),va(r,o,b,f)):o.memoizedState!==null?(o.child=r.child,o.flags|=128,null):(x=f.fallback,g=o.mode,f=Na({mode:"visible",children:f.children},g,0,null),x=Kr(x,g,b,null),x.flags|=2,f.return=o,x.return=o,f.sibling=x,o.child=f,(o.mode&1)!==0&&Ci(o,r.child,null,b),o.child.memoizedState=rc(b),o.memoizedState=nc,x);if((o.mode&1)===0)return va(r,o,b,null);if(g.data==="$!"){if(f=g.nextSibling&&g.nextSibling.dataset,f)var N=f.dgst;return f=N,x=Error(n(419)),f=Zu(x,f,void 0),va(r,o,b,f)}if(N=(b&r.childLanes)!==0,Ht||N){if(f=vt,f!==null){switch(b&-b){case 4:g=2;break;case 16:g=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(f.suspendedLanes|b))!==0?0:g,g!==0&&g!==x.retryLane&&(x.retryLane=g,Gn(r,g),Tn(f,r,g,-1))}return wc(),f=Zu(Error(n(421))),va(r,o,b,f)}return g.data==="$?"?(o.flags|=128,o.child=r.child,o=bb.bind(null,r),g._reactRetry=o,null):(r=x.treeContext,tn=cr(g.nextSibling),en=o,tt=!0,Sn=null,r!==null&&(un[cn++]=Xn,un[cn++]=Yn,un[cn++]=Or,Xn=r.id,Yn=r.overflow,Or=o),o=ic(o,f.children),o.flags|=4096,o)}function Wm(r,o,u){r.lanes|=o;var f=r.alternate;f!==null&&(f.lanes|=o),Lu(r.return,o,u)}function oc(r,o,u,f,g){var x=r.memoizedState;x===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:g}:(x.isBackwards=o,x.rendering=null,x.renderingStartTime=0,x.last=f,x.tail=u,x.tailMode=g)}function Hm(r,o,u){var f=o.pendingProps,g=f.revealOrder,x=f.tail;if(_t(r,o,f.children,u),f=nt.current,(f&2)!==0)f=f&1|2,o.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Wm(r,u,o);else if(r.tag===19)Wm(r,u,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}f&=1}if(Ge(nt,f),(o.mode&1)===0)o.memoizedState=null;else switch(g){case"forwards":for(u=o.child,g=null;u!==null;)r=u.alternate,r!==null&&fa(r)===null&&(g=u),u=u.sibling;u=g,u===null?(g=o.child,o.child=null):(g=u.sibling,u.sibling=null),oc(o,!1,g,u,x);break;case"backwards":for(u=null,g=o.child,o.child=null;g!==null;){if(r=g.alternate,r!==null&&fa(r)===null){o.child=g;break}r=g.sibling,g.sibling=u,u=g,g=r}oc(o,!0,u,null,x);break;case"together":oc(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function xa(r,o){(o.mode&1)===0&&r!==null&&(r.alternate=null,o.alternate=null,o.flags|=2)}function Zn(r,o,u){if(r!==null&&(o.dependencies=r.dependencies),Ur|=o.lanes,(u&o.childLanes)===0)return null;if(r!==null&&o.child!==r.child)throw Error(n(153));if(o.child!==null){for(r=o.child,u=kr(r,r.pendingProps),o.child=u,u.return=o;r.sibling!==null;)r=r.sibling,u=u.sibling=kr(r,r.pendingProps),u.return=o;u.sibling=null}return o.child}function fb(r,o,u){switch(o.tag){case 3:Bm(o),bi();break;case 5:om(o);break;case 1:Wt(o.type)&&ta(o);break;case 4:Fu(o,o.stateNode.containerInfo);break;case 10:var f=o.type._context,g=o.memoizedProps.value;Ge(aa,f._currentValue),f._currentValue=g;break;case 13:if(f=o.memoizedState,f!==null)return f.dehydrated!==null?(Ge(nt,nt.current&1),o.flags|=128,null):(u&o.child.childLanes)!==0?$m(r,o,u):(Ge(nt,nt.current&1),r=Zn(r,o,u),r!==null?r.sibling:null);Ge(nt,nt.current&1);break;case 19:if(f=(u&o.childLanes)!==0,(r.flags&128)!==0){if(f)return Hm(r,o,u);o.flags|=128}if(g=o.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),Ge(nt,nt.current),f)break;return null;case 22:case 23:return o.lanes=0,Fm(r,o,u)}return Zn(r,o,u)}var Km,sc,qm,Xm;Km=function(r,o){for(var u=o.child;u!==null;){if(u.tag===5||u.tag===6)r.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},sc=function(){},qm=function(r,o,u,f){var g=r.memoizedProps;if(g!==f){r=o.stateNode,Vr(Ln.current);var x=null;switch(u){case"input":g=Dt(r,g),f=Dt(r,f),x=[];break;case"select":g=P({},g,{value:void 0}),f=P({},f,{value:void 0}),x=[];break;case"textarea":g=jn(r,g),f=jn(r,f),x=[];break;default:typeof g.onClick!="function"&&typeof f.onClick=="function"&&(r.onclick=Zs)}ot(u,f);var b;u=null;for(K in g)if(!f.hasOwnProperty(K)&&g.hasOwnProperty(K)&&g[K]!=null)if(K==="style"){var N=g[K];for(b in N)N.hasOwnProperty(b)&&(u||(u={}),u[b]="")}else K!=="dangerouslySetInnerHTML"&&K!=="children"&&K!=="suppressContentEditableWarning"&&K!=="suppressHydrationWarning"&&K!=="autoFocus"&&(s.hasOwnProperty(K)?x||(x=[]):(x=x||[]).push(K,null));for(K in f){var I=f[K];if(N=g?.[K],f.hasOwnProperty(K)&&I!==N&&(I!=null||N!=null))if(K==="style")if(N){for(b in N)!N.hasOwnProperty(b)||I&&I.hasOwnProperty(b)||(u||(u={}),u[b]="");for(b in I)I.hasOwnProperty(b)&&N[b]!==I[b]&&(u||(u={}),u[b]=I[b])}else u||(x||(x=[]),x.push(K,u)),u=I;else K==="dangerouslySetInnerHTML"?(I=I?I.__html:void 0,N=N?N.__html:void 0,I!=null&&N!==I&&(x=x||[]).push(K,I)):K==="children"?typeof I!="string"&&typeof I!="number"||(x=x||[]).push(K,""+I):K!=="suppressContentEditableWarning"&&K!=="suppressHydrationWarning"&&(s.hasOwnProperty(K)?(I!=null&&K==="onScroll"&&Je("scroll",r),x||N===I||(x=[])):(x=x||[]).push(K,I))}u&&(x=x||[]).push("style",u);var K=x;(o.updateQueue=K)&&(o.flags|=4)}},Xm=function(r,o,u,f){u!==f&&(o.flags|=4)};function Oo(r,o){if(!tt)switch(r.tailMode){case"hidden":o=r.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:f.sibling=null}}function Mt(r){var o=r.alternate!==null&&r.alternate.child===r.child,u=0,f=0;if(o)for(var g=r.child;g!==null;)u|=g.lanes|g.childLanes,f|=g.subtreeFlags&14680064,f|=g.flags&14680064,g.return=r,g=g.sibling;else for(g=r.child;g!==null;)u|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=r,g=g.sibling;return r.subtreeFlags|=f,r.childLanes=u,o}function db(r,o,u){var f=o.pendingProps;switch(Ru(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(o),null;case 1:return Wt(o.type)&&ea(),Mt(o),null;case 3:return f=o.stateNode,Pi(),et($t),et(Pt),Bu(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(r===null||r.child===null)&&(oa(o)?o.flags|=4:r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Sn!==null&&(yc(Sn),Sn=null))),sc(r,o),Mt(o),null;case 5:zu(o);var g=Vr(jo.current);if(u=o.type,r!==null&&o.stateNode!=null)qm(r,o,u,f,g),r.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!f){if(o.stateNode===null)throw Error(n(166));return Mt(o),null}if(r=Vr(Ln.current),oa(o)){f=o.stateNode,u=o.type;var x=o.memoizedProps;switch(f[In]=o,f[Po]=x,r=(o.mode&1)!==0,u){case"dialog":Je("cancel",f),Je("close",f);break;case"iframe":case"object":case"embed":Je("load",f);break;case"video":case"audio":for(g=0;g<Co.length;g++)Je(Co[g],f);break;case"source":Je("error",f);break;case"img":case"image":case"link":Je("error",f),Je("load",f);break;case"details":Je("toggle",f);break;case"input":Qt(f,x),Je("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!x.multiple},Je("invalid",f);break;case"textarea":ln(f,x),Je("invalid",f)}ot(u,x),g=null;for(var b in x)if(x.hasOwnProperty(b)){var N=x[b];b==="children"?typeof N=="string"?f.textContent!==N&&(x.suppressHydrationWarning!==!0&&Qs(f.textContent,N,r),g=["children",N]):typeof N=="number"&&f.textContent!==""+N&&(x.suppressHydrationWarning!==!0&&Qs(f.textContent,N,r),g=["children",""+N]):s.hasOwnProperty(b)&&N!=null&&b==="onScroll"&&Je("scroll",f)}switch(u){case"input":$e(f),It(f,x,!0);break;case"textarea":$e(f),he(f);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(f.onclick=Zs)}f=g,o.updateQueue=f,f!==null&&(o.flags|=4)}else{b=g.nodeType===9?g:g.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=V(u)),r==="http://www.w3.org/1999/xhtml"?u==="script"?(r=b.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof f.is=="string"?r=b.createElement(u,{is:f.is}):(r=b.createElement(u),u==="select"&&(b=r,f.multiple?b.multiple=!0:f.size&&(b.size=f.size))):r=b.createElementNS(r,u),r[In]=o,r[Po]=f,Km(r,o,!1,!1),o.stateNode=r;e:{switch(b=Ze(u,f),u){case"dialog":Je("cancel",r),Je("close",r),g=f;break;case"iframe":case"object":case"embed":Je("load",r),g=f;break;case"video":case"audio":for(g=0;g<Co.length;g++)Je(Co[g],r);g=f;break;case"source":Je("error",r),g=f;break;case"img":case"image":case"link":Je("error",r),Je("load",r),g=f;break;case"details":Je("toggle",r),g=f;break;case"input":Qt(r,f),g=Dt(r,f),Je("invalid",r);break;case"option":g=f;break;case"select":r._wrapperState={wasMultiple:!!f.multiple},g=P({},f,{value:void 0}),Je("invalid",r);break;case"textarea":ln(r,f),g=jn(r,f),Je("invalid",r);break;default:g=f}ot(u,g),N=g;for(x in N)if(N.hasOwnProperty(x)){var I=N[x];x==="style"?Ie(r,I):x==="dangerouslySetInnerHTML"?(I=I?I.__html:void 0,I!=null&&oe(r,I)):x==="children"?typeof I=="string"?(u!=="textarea"||I!=="")&&te(r,I):typeof I=="number"&&te(r,""+I):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(s.hasOwnProperty(x)?I!=null&&x==="onScroll"&&Je("scroll",r):I!=null&&M(r,x,I,b))}switch(u){case"input":$e(r),It(r,f,!1);break;case"textarea":$e(r),he(r);break;case"option":f.value!=null&&r.setAttribute("value",""+ge(f.value));break;case"select":r.multiple=!!f.multiple,x=f.value,x!=null?Lt(r,!!f.multiple,x,!1):f.defaultValue!=null&&Lt(r,!!f.multiple,f.defaultValue,!0);break;default:typeof g.onClick=="function"&&(r.onclick=Zs)}switch(u){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}}f&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return Mt(o),null;case 6:if(r&&o.stateNode!=null)Xm(r,o,r.memoizedProps,f);else{if(typeof f!="string"&&o.stateNode===null)throw Error(n(166));if(u=Vr(jo.current),Vr(Ln.current),oa(o)){if(f=o.stateNode,u=o.memoizedProps,f[In]=o,(x=f.nodeValue!==u)&&(r=en,r!==null))switch(r.tag){case 3:Qs(f.nodeValue,u,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&Qs(f.nodeValue,u,(r.mode&1)!==0)}x&&(o.flags|=4)}else f=(u.nodeType===9?u:u.ownerDocument).createTextNode(f),f[In]=o,o.stateNode=f}return Mt(o),null;case 13:if(et(nt),f=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(tt&&tn!==null&&(o.mode&1)!==0&&(o.flags&128)===0)Qp(),bi(),o.flags|=98560,x=!1;else if(x=oa(o),f!==null&&f.dehydrated!==null){if(r===null){if(!x)throw Error(n(318));if(x=o.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(n(317));x[In]=o}else bi(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Mt(o),x=!1}else Sn!==null&&(yc(Sn),Sn=null),x=!0;if(!x)return o.flags&65536?o:null}return(o.flags&128)!==0?(o.lanes=u,o):(f=f!==null,f!==(r!==null&&r.memoizedState!==null)&&f&&(o.child.flags|=8192,(o.mode&1)!==0&&(r===null||(nt.current&1)!==0?pt===0&&(pt=3):wc())),o.updateQueue!==null&&(o.flags|=4),Mt(o),null);case 4:return Pi(),sc(r,o),r===null&&Eo(o.stateNode.containerInfo),Mt(o),null;case 10:return Iu(o.type._context),Mt(o),null;case 17:return Wt(o.type)&&ea(),Mt(o),null;case 19:if(et(nt),x=o.memoizedState,x===null)return Mt(o),null;if(f=(o.flags&128)!==0,b=x.rendering,b===null)if(f)Oo(x,!1);else{if(pt!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(b=fa(r),b!==null){for(o.flags|=128,Oo(x,!1),f=b.updateQueue,f!==null&&(o.updateQueue=f,o.flags|=4),o.subtreeFlags=0,f=u,u=o.child;u!==null;)x=u,r=f,x.flags&=14680066,b=x.alternate,b===null?(x.childLanes=0,x.lanes=r,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=b.childLanes,x.lanes=b.lanes,x.child=b.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=b.memoizedProps,x.memoizedState=b.memoizedState,x.updateQueue=b.updateQueue,x.type=b.type,r=b.dependencies,x.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),u=u.sibling;return Ge(nt,nt.current&1|2),o.child}r=r.sibling}x.tail!==null&&lt()>Ni&&(o.flags|=128,f=!0,Oo(x,!1),o.lanes=4194304)}else{if(!f)if(r=fa(b),r!==null){if(o.flags|=128,f=!0,u=r.updateQueue,u!==null&&(o.updateQueue=u,o.flags|=4),Oo(x,!0),x.tail===null&&x.tailMode==="hidden"&&!b.alternate&&!tt)return Mt(o),null}else 2*lt()-x.renderingStartTime>Ni&&u!==1073741824&&(o.flags|=128,f=!0,Oo(x,!1),o.lanes=4194304);x.isBackwards?(b.sibling=o.child,o.child=b):(u=x.last,u!==null?u.sibling=b:o.child=b,x.last=b)}return x.tail!==null?(o=x.tail,x.rendering=o,x.tail=o.sibling,x.renderingStartTime=lt(),o.sibling=null,u=nt.current,Ge(nt,f?u&1|2:u&1),o):(Mt(o),null);case 22:case 23:return xc(),f=o.memoizedState!==null,r!==null&&r.memoizedState!==null!==f&&(o.flags|=8192),f&&(o.mode&1)!==0?(nn&1073741824)!==0&&(Mt(o),o.subtreeFlags&6&&(o.flags|=8192)):Mt(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function hb(r,o){switch(Ru(o),o.tag){case 1:return Wt(o.type)&&ea(),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return Pi(),et($t),et(Pt),Bu(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 5:return zu(o),null;case 13:if(et(nt),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(n(340));bi()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return et(nt),null;case 4:return Pi(),null;case 10:return Iu(o.type._context),null;case 22:case 23:return xc(),null;case 24:return null;default:return null}}var wa=!1,At=!1,pb=typeof WeakSet=="function"?WeakSet:Set,ye=null;function Mi(r,o){var u=r.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(f){st(r,o,f)}else u.current=null}function ac(r,o,u){try{u()}catch(f){st(r,o,f)}}var Ym=!1;function mb(r,o){if(xu=Vs,r=Pp(),fu(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var g=f.anchorOffset,x=f.focusNode;f=f.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var b=0,N=-1,I=-1,K=0,re=0,ae=r,ne=null;t:for(;;){for(var me;ae!==u||g!==0&&ae.nodeType!==3||(N=b+g),ae!==x||f!==0&&ae.nodeType!==3||(I=b+f),ae.nodeType===3&&(b+=ae.nodeValue.length),(me=ae.firstChild)!==null;)ne=ae,ae=me;for(;;){if(ae===r)break t;if(ne===u&&++K===g&&(N=b),ne===x&&++re===f&&(I=b),(me=ae.nextSibling)!==null)break;ae=ne,ne=ae.parentNode}ae=me}u=N===-1||I===-1?null:{start:N,end:I}}else u=null}u=u||{start:0,end:0}}else u=null;for(wu={focusedElem:r,selectionRange:u},Vs=!1,ye=o;ye!==null;)if(o=ye,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,ye=r;else for(;ye!==null;){o=ye;try{var we=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(we!==null){var Se=we.memoizedProps,ut=we.memoizedState,B=o.stateNode,O=B.getSnapshotBeforeUpdate(o.elementType===o.type?Se:bn(o.type,Se),ut);B.__reactInternalSnapshotBeforeUpdate=O}break;case 3:var $=o.stateNode.containerInfo;$.nodeType===1?$.textContent="":$.nodeType===9&&$.documentElement&&$.removeChild($.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ce){st(o,o.return,ce)}if(r=o.sibling,r!==null){r.return=o.return,ye=r;break}ye=o.return}return we=Ym,Ym=!1,we}function Fo(r,o,u){var f=o.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var g=f=f.next;do{if((g.tag&r)===r){var x=g.destroy;g.destroy=void 0,x!==void 0&&ac(o,u,x)}g=g.next}while(g!==f)}}function ka(r,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var u=o=o.next;do{if((u.tag&r)===r){var f=u.create;u.destroy=f()}u=u.next}while(u!==o)}}function lc(r){var o=r.ref;if(o!==null){var u=r.stateNode;switch(r.tag){case 5:r=u;break;default:r=u}typeof o=="function"?o(r):o.current=r}}function Gm(r){var o=r.alternate;o!==null&&(r.alternate=null,Gm(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&(delete o[In],delete o[Po],delete o[Cu],delete o[QS],delete o[ZS])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function Qm(r){return r.tag===5||r.tag===3||r.tag===4}function Zm(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Qm(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function uc(r,o,u){var f=r.tag;if(f===5||f===6)r=r.stateNode,o?u.nodeType===8?u.parentNode.insertBefore(r,o):u.insertBefore(r,o):(u.nodeType===8?(o=u.parentNode,o.insertBefore(r,u)):(o=u,o.appendChild(r)),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=Zs));else if(f!==4&&(r=r.child,r!==null))for(uc(r,o,u),r=r.sibling;r!==null;)uc(r,o,u),r=r.sibling}function cc(r,o,u){var f=r.tag;if(f===5||f===6)r=r.stateNode,o?u.insertBefore(r,o):u.appendChild(r);else if(f!==4&&(r=r.child,r!==null))for(cc(r,o,u),r=r.sibling;r!==null;)cc(r,o,u),r=r.sibling}var St=null,Cn=!1;function gr(r,o,u){for(u=u.child;u!==null;)Jm(r,o,u),u=u.sibling}function Jm(r,o,u){if(Dn&&typeof Dn.onCommitFiberUnmount=="function")try{Dn.onCommitFiberUnmount(Is,u)}catch{}switch(u.tag){case 5:At||Mi(u,o);case 6:var f=St,g=Cn;St=null,gr(r,o,u),St=f,Cn=g,St!==null&&(Cn?(r=St,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):St.removeChild(u.stateNode));break;case 18:St!==null&&(Cn?(r=St,u=u.stateNode,r.nodeType===8?bu(r.parentNode,u):r.nodeType===1&&bu(r,u),go(r)):bu(St,u.stateNode));break;case 4:f=St,g=Cn,St=u.stateNode.containerInfo,Cn=!0,gr(r,o,u),St=f,Cn=g;break;case 0:case 11:case 14:case 15:if(!At&&(f=u.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){g=f=f.next;do{var x=g,b=x.destroy;x=x.tag,b!==void 0&&((x&2)!==0||(x&4)!==0)&&ac(u,o,b),g=g.next}while(g!==f)}gr(r,o,u);break;case 1:if(!At&&(Mi(u,o),f=u.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=u.memoizedProps,f.state=u.memoizedState,f.componentWillUnmount()}catch(N){st(u,o,N)}gr(r,o,u);break;case 21:gr(r,o,u);break;case 22:u.mode&1?(At=(f=At)||u.memoizedState!==null,gr(r,o,u),At=f):gr(r,o,u);break;default:gr(r,o,u)}}function eg(r){var o=r.updateQueue;if(o!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new pb),o.forEach(function(f){var g=Cb.bind(null,r,f);u.has(f)||(u.add(f),f.then(g,g))})}}function En(r,o){var u=o.deletions;if(u!==null)for(var f=0;f<u.length;f++){var g=u[f];try{var x=r,b=o,N=b;e:for(;N!==null;){switch(N.tag){case 5:St=N.stateNode,Cn=!1;break e;case 3:St=N.stateNode.containerInfo,Cn=!0;break e;case 4:St=N.stateNode.containerInfo,Cn=!0;break e}N=N.return}if(St===null)throw Error(n(160));Jm(x,b,g),St=null,Cn=!1;var I=g.alternate;I!==null&&(I.return=null),g.return=null}catch(K){st(g,o,K)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)tg(o,r),o=o.sibling}function tg(r,o){var u=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(En(o,r),On(r),f&4){try{Fo(3,r,r.return),ka(3,r)}catch(Se){st(r,r.return,Se)}try{Fo(5,r,r.return)}catch(Se){st(r,r.return,Se)}}break;case 1:En(o,r),On(r),f&512&&u!==null&&Mi(u,u.return);break;case 5:if(En(o,r),On(r),f&512&&u!==null&&Mi(u,u.return),r.flags&32){var g=r.stateNode;try{te(g,"")}catch(Se){st(r,r.return,Se)}}if(f&4&&(g=r.stateNode,g!=null)){var x=r.memoizedProps,b=u!==null?u.memoizedProps:x,N=r.type,I=r.updateQueue;if(r.updateQueue=null,I!==null)try{N==="input"&&x.type==="radio"&&x.name!=null&&Ut(g,x),Ze(N,b);var K=Ze(N,x);for(b=0;b<I.length;b+=2){var re=I[b],ae=I[b+1];re==="style"?Ie(g,ae):re==="dangerouslySetInnerHTML"?oe(g,ae):re==="children"?te(g,ae):M(g,re,ae,K)}switch(N){case"input":it(g,x);break;case"textarea":z(g,x);break;case"select":var ne=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!x.multiple;var me=x.value;me!=null?Lt(g,!!x.multiple,me,!1):ne!==!!x.multiple&&(x.defaultValue!=null?Lt(g,!!x.multiple,x.defaultValue,!0):Lt(g,!!x.multiple,x.multiple?[]:"",!1))}g[Po]=x}catch(Se){st(r,r.return,Se)}}break;case 6:if(En(o,r),On(r),f&4){if(r.stateNode===null)throw Error(n(162));g=r.stateNode,x=r.memoizedProps;try{g.nodeValue=x}catch(Se){st(r,r.return,Se)}}break;case 3:if(En(o,r),On(r),f&4&&u!==null&&u.memoizedState.isDehydrated)try{go(o.containerInfo)}catch(Se){st(r,r.return,Se)}break;case 4:En(o,r),On(r);break;case 13:En(o,r),On(r),g=r.child,g.flags&8192&&(x=g.memoizedState!==null,g.stateNode.isHidden=x,!x||g.alternate!==null&&g.alternate.memoizedState!==null||(hc=lt())),f&4&&eg(r);break;case 22:if(re=u!==null&&u.memoizedState!==null,r.mode&1?(At=(K=At)||re,En(o,r),At=K):En(o,r),On(r),f&8192){if(K=r.memoizedState!==null,(r.stateNode.isHidden=K)&&!re&&(r.mode&1)!==0)for(ye=r,re=r.child;re!==null;){for(ae=ye=re;ye!==null;){switch(ne=ye,me=ne.child,ne.tag){case 0:case 11:case 14:case 15:Fo(4,ne,ne.return);break;case 1:Mi(ne,ne.return);var we=ne.stateNode;if(typeof we.componentWillUnmount=="function"){f=ne,u=ne.return;try{o=f,we.props=o.memoizedProps,we.state=o.memoizedState,we.componentWillUnmount()}catch(Se){st(f,u,Se)}}break;case 5:Mi(ne,ne.return);break;case 22:if(ne.memoizedState!==null){ig(ae);continue}}me!==null?(me.return=ne,ye=me):ig(ae)}re=re.sibling}e:for(re=null,ae=r;;){if(ae.tag===5){if(re===null){re=ae;try{g=ae.stateNode,K?(x=g.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(N=ae.stateNode,I=ae.memoizedProps.style,b=I!=null&&I.hasOwnProperty("display")?I.display:null,N.style.display=pe("display",b))}catch(Se){st(r,r.return,Se)}}}else if(ae.tag===6){if(re===null)try{ae.stateNode.nodeValue=K?"":ae.memoizedProps}catch(Se){st(r,r.return,Se)}}else if((ae.tag!==22&&ae.tag!==23||ae.memoizedState===null||ae===r)&&ae.child!==null){ae.child.return=ae,ae=ae.child;continue}if(ae===r)break e;for(;ae.sibling===null;){if(ae.return===null||ae.return===r)break e;re===ae&&(re=null),ae=ae.return}re===ae&&(re=null),ae.sibling.return=ae.return,ae=ae.sibling}}break;case 19:En(o,r),On(r),f&4&&eg(r);break;case 21:break;default:En(o,r),On(r)}}function On(r){var o=r.flags;if(o&2){try{e:{for(var u=r.return;u!==null;){if(Qm(u)){var f=u;break e}u=u.return}throw Error(n(160))}switch(f.tag){case 5:var g=f.stateNode;f.flags&32&&(te(g,""),f.flags&=-33);var x=Zm(r);cc(r,x,g);break;case 3:case 4:var b=f.stateNode.containerInfo,N=Zm(r);uc(r,N,b);break;default:throw Error(n(161))}}catch(I){st(r,r.return,I)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function gb(r,o,u){ye=r,ng(r)}function ng(r,o,u){for(var f=(r.mode&1)!==0;ye!==null;){var g=ye,x=g.child;if(g.tag===22&&f){var b=g.memoizedState!==null||wa;if(!b){var N=g.alternate,I=N!==null&&N.memoizedState!==null||At;N=wa;var K=At;if(wa=b,(At=I)&&!K)for(ye=g;ye!==null;)b=ye,I=b.child,b.tag===22&&b.memoizedState!==null?og(g):I!==null?(I.return=b,ye=I):og(g);for(;x!==null;)ye=x,ng(x),x=x.sibling;ye=g,wa=N,At=K}rg(r)}else(g.subtreeFlags&8772)!==0&&x!==null?(x.return=g,ye=x):rg(r)}}function rg(r){for(;ye!==null;){var o=ye;if((o.flags&8772)!==0){var u=o.alternate;try{if((o.flags&8772)!==0)switch(o.tag){case 0:case 11:case 15:At||ka(5,o);break;case 1:var f=o.stateNode;if(o.flags&4&&!At)if(u===null)f.componentDidMount();else{var g=o.elementType===o.type?u.memoizedProps:bn(o.type,u.memoizedProps);f.componentDidUpdate(g,u.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var x=o.updateQueue;x!==null&&im(o,x,f);break;case 3:var b=o.updateQueue;if(b!==null){if(u=null,o.child!==null)switch(o.child.tag){case 5:u=o.child.stateNode;break;case 1:u=o.child.stateNode}im(o,b,u)}break;case 5:var N=o.stateNode;if(u===null&&o.flags&4){u=N;var I=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":I.autoFocus&&u.focus();break;case"img":I.src&&(u.src=I.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var K=o.alternate;if(K!==null){var re=K.memoizedState;if(re!==null){var ae=re.dehydrated;ae!==null&&go(ae)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}At||o.flags&512&&lc(o)}catch(ne){st(o,o.return,ne)}}if(o===r){ye=null;break}if(u=o.sibling,u!==null){u.return=o.return,ye=u;break}ye=o.return}}function ig(r){for(;ye!==null;){var o=ye;if(o===r){ye=null;break}var u=o.sibling;if(u!==null){u.return=o.return,ye=u;break}ye=o.return}}function og(r){for(;ye!==null;){var o=ye;try{switch(o.tag){case 0:case 11:case 15:var u=o.return;try{ka(4,o)}catch(I){st(o,u,I)}break;case 1:var f=o.stateNode;if(typeof f.componentDidMount=="function"){var g=o.return;try{f.componentDidMount()}catch(I){st(o,g,I)}}var x=o.return;try{lc(o)}catch(I){st(o,x,I)}break;case 5:var b=o.return;try{lc(o)}catch(I){st(o,b,I)}}}catch(I){st(o,o.return,I)}if(o===r){ye=null;break}var N=o.sibling;if(N!==null){N.return=o.return,ye=N;break}ye=o.return}}var yb=Math.ceil,Sa=_.ReactCurrentDispatcher,fc=_.ReactCurrentOwner,hn=_.ReactCurrentBatchConfig,Be=0,vt=null,ct=null,bt=0,nn=0,Ai=fr(0),pt=0,zo=null,Ur=0,ba=0,dc=0,Vo=null,Kt=null,hc=0,Ni=1/0,Jn=null,Ca=!1,pc=null,yr=null,Ea=!1,vr=null,Ta=0,Bo=0,mc=null,Pa=-1,Ra=0;function Ot(){return(Be&6)!==0?lt():Pa!==-1?Pa:Pa=lt()}function xr(r){return(r.mode&1)===0?1:(Be&2)!==0&&bt!==0?bt&-bt:eb.transition!==null?(Ra===0&&(Ra=Zh()),Ra):(r=He,r!==0||(r=window.event,r=r===void 0?16:ap(r.type)),r)}function Tn(r,o,u,f){if(50<Bo)throw Bo=0,mc=null,Error(n(185));co(r,u,f),((Be&2)===0||r!==vt)&&(r===vt&&((Be&2)===0&&(ba|=u),pt===4&&wr(r,bt)),qt(r,f),u===1&&Be===0&&(o.mode&1)===0&&(Ni=lt()+500,na&&hr()))}function qt(r,o){var u=r.callbackNode;eS(r,o);var f=Os(r,r===vt?bt:0);if(f===0)u!==null&&Yh(u),r.callbackNode=null,r.callbackPriority=0;else if(o=f&-f,r.callbackPriority!==o){if(u!=null&&Yh(u),o===1)r.tag===0?JS(ag.bind(null,r)):Kp(ag.bind(null,r)),YS(function(){(Be&6)===0&&hr()}),u=null;else{switch(Jh(f)){case 1:u=Xl;break;case 4:u=Gh;break;case 16:u=Ds;break;case 536870912:u=Qh;break;default:u=Ds}u=mg(u,sg.bind(null,r))}r.callbackPriority=o,r.callbackNode=u}}function sg(r,o){if(Pa=-1,Ra=0,(Be&6)!==0)throw Error(n(327));var u=r.callbackNode;if(ji()&&r.callbackNode!==u)return null;var f=Os(r,r===vt?bt:0);if(f===0)return null;if((f&30)!==0||(f&r.expiredLanes)!==0||o)o=Ma(r,f);else{o=f;var g=Be;Be|=2;var x=ug();(vt!==r||bt!==o)&&(Jn=null,Ni=lt()+500,Wr(r,o));do try{wb();break}catch(N){lg(r,N)}while(!0);Du(),Sa.current=x,Be=g,ct!==null?o=0:(vt=null,bt=0,o=pt)}if(o!==0){if(o===2&&(g=Yl(r),g!==0&&(f=g,o=gc(r,g))),o===1)throw u=zo,Wr(r,0),wr(r,f),qt(r,lt()),u;if(o===6)wr(r,f);else{if(g=r.current.alternate,(f&30)===0&&!vb(g)&&(o=Ma(r,f),o===2&&(x=Yl(r),x!==0&&(f=x,o=gc(r,x))),o===1))throw u=zo,Wr(r,0),wr(r,f),qt(r,lt()),u;switch(r.finishedWork=g,r.finishedLanes=f,o){case 0:case 1:throw Error(n(345));case 2:Hr(r,Kt,Jn);break;case 3:if(wr(r,f),(f&130023424)===f&&(o=hc+500-lt(),10<o)){if(Os(r,0)!==0)break;if(g=r.suspendedLanes,(g&f)!==f){Ot(),r.pingedLanes|=r.suspendedLanes&g;break}r.timeoutHandle=Su(Hr.bind(null,r,Kt,Jn),o);break}Hr(r,Kt,Jn);break;case 4:if(wr(r,f),(f&4194240)===f)break;for(o=r.eventTimes,g=-1;0<f;){var b=31-wn(f);x=1<<b,b=o[b],b>g&&(g=b),f&=~x}if(f=g,f=lt()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*yb(f/1960))-f,10<f){r.timeoutHandle=Su(Hr.bind(null,r,Kt,Jn),f);break}Hr(r,Kt,Jn);break;case 5:Hr(r,Kt,Jn);break;default:throw Error(n(329))}}}return qt(r,lt()),r.callbackNode===u?sg.bind(null,r):null}function gc(r,o){var u=Vo;return r.current.memoizedState.isDehydrated&&(Wr(r,o).flags|=256),r=Ma(r,o),r!==2&&(o=Kt,Kt=u,o!==null&&yc(o)),r}function yc(r){Kt===null?Kt=r:Kt.push.apply(Kt,r)}function vb(r){for(var o=r;;){if(o.flags&16384){var u=o.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var f=0;f<u.length;f++){var g=u[f],x=g.getSnapshot;g=g.value;try{if(!kn(x(),g))return!1}catch{return!1}}}if(u=o.child,o.subtreeFlags&16384&&u!==null)u.return=o,o=u;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function wr(r,o){for(o&=~dc,o&=~ba,r.suspendedLanes|=o,r.pingedLanes&=~o,r=r.expirationTimes;0<o;){var u=31-wn(o),f=1<<u;r[u]=-1,o&=~f}}function ag(r){if((Be&6)!==0)throw Error(n(327));ji();var o=Os(r,0);if((o&1)===0)return qt(r,lt()),null;var u=Ma(r,o);if(r.tag!==0&&u===2){var f=Yl(r);f!==0&&(o=f,u=gc(r,f))}if(u===1)throw u=zo,Wr(r,0),wr(r,o),qt(r,lt()),u;if(u===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=o,Hr(r,Kt,Jn),qt(r,lt()),null}function vc(r,o){var u=Be;Be|=1;try{return r(o)}finally{Be=u,Be===0&&(Ni=lt()+500,na&&hr())}}function $r(r){vr!==null&&vr.tag===0&&(Be&6)===0&&ji();var o=Be;Be|=1;var u=hn.transition,f=He;try{if(hn.transition=null,He=1,r)return r()}finally{He=f,hn.transition=u,Be=o,(Be&6)===0&&hr()}}function xc(){nn=Ai.current,et(Ai)}function Wr(r,o){r.finishedWork=null,r.finishedLanes=0;var u=r.timeoutHandle;if(u!==-1&&(r.timeoutHandle=-1,XS(u)),ct!==null)for(u=ct.return;u!==null;){var f=u;switch(Ru(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&ea();break;case 3:Pi(),et($t),et(Pt),Bu();break;case 5:zu(f);break;case 4:Pi();break;case 13:et(nt);break;case 19:et(nt);break;case 10:Iu(f.type._context);break;case 22:case 23:xc()}u=u.return}if(vt=r,ct=r=kr(r.current,null),bt=nn=o,pt=0,zo=null,dc=ba=Ur=0,Kt=Vo=null,zr!==null){for(o=0;o<zr.length;o++)if(u=zr[o],f=u.interleaved,f!==null){u.interleaved=null;var g=f.next,x=u.pending;if(x!==null){var b=x.next;x.next=g,f.next=b}u.pending=f}zr=null}return r}function lg(r,o){do{var u=ct;try{if(Du(),da.current=ga,ha){for(var f=rt.memoizedState;f!==null;){var g=f.queue;g!==null&&(g.pending=null),f=f.next}ha=!1}if(Br=0,yt=ht=rt=null,Do=!1,Io=0,fc.current=null,u===null||u.return===null){pt=1,zo=o,ct=null;break}e:{var x=r,b=u.return,N=u,I=o;if(o=bt,N.flags|=32768,I!==null&&typeof I=="object"&&typeof I.then=="function"){var K=I,re=N,ae=re.tag;if((re.mode&1)===0&&(ae===0||ae===11||ae===15)){var ne=re.alternate;ne?(re.updateQueue=ne.updateQueue,re.memoizedState=ne.memoizedState,re.lanes=ne.lanes):(re.updateQueue=null,re.memoizedState=null)}var me=Dm(b);if(me!==null){me.flags&=-257,Im(me,b,N,x,o),me.mode&1&&jm(x,K,o),o=me,I=K;var we=o.updateQueue;if(we===null){var Se=new Set;Se.add(I),o.updateQueue=Se}else we.add(I);break e}else{if((o&1)===0){jm(x,K,o),wc();break e}I=Error(n(426))}}else if(tt&&N.mode&1){var ut=Dm(b);if(ut!==null){(ut.flags&65536)===0&&(ut.flags|=256),Im(ut,b,N,x,o),Nu(Ri(I,N));break e}}x=I=Ri(I,N),pt!==4&&(pt=2),Vo===null?Vo=[x]:Vo.push(x),x=b;do{switch(x.tag){case 3:x.flags|=65536,o&=-o,x.lanes|=o;var B=Am(x,I,o);rm(x,B);break e;case 1:N=I;var O=x.type,$=x.stateNode;if((x.flags&128)===0&&(typeof O.getDerivedStateFromError=="function"||$!==null&&typeof $.componentDidCatch=="function"&&(yr===null||!yr.has($)))){x.flags|=65536,o&=-o,x.lanes|=o;var ce=Nm(x,N,o);rm(x,ce);break e}}x=x.return}while(x!==null)}fg(u)}catch(be){o=be,ct===u&&u!==null&&(ct=u=u.return);continue}break}while(!0)}function ug(){var r=Sa.current;return Sa.current=ga,r===null?ga:r}function wc(){(pt===0||pt===3||pt===2)&&(pt=4),vt===null||(Ur&268435455)===0&&(ba&268435455)===0||wr(vt,bt)}function Ma(r,o){var u=Be;Be|=2;var f=ug();(vt!==r||bt!==o)&&(Jn=null,Wr(r,o));do try{xb();break}catch(g){lg(r,g)}while(!0);if(Du(),Be=u,Sa.current=f,ct!==null)throw Error(n(261));return vt=null,bt=0,pt}function xb(){for(;ct!==null;)cg(ct)}function wb(){for(;ct!==null&&!Hk();)cg(ct)}function cg(r){var o=pg(r.alternate,r,nn);r.memoizedProps=r.pendingProps,o===null?fg(r):ct=o,fc.current=null}function fg(r){var o=r;do{var u=o.alternate;if(r=o.return,(o.flags&32768)===0){if(u=db(u,o,nn),u!==null){ct=u;return}}else{if(u=hb(u,o),u!==null){u.flags&=32767,ct=u;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{pt=6,ct=null;return}}if(o=o.sibling,o!==null){ct=o;return}ct=o=r}while(o!==null);pt===0&&(pt=5)}function Hr(r,o,u){var f=He,g=hn.transition;try{hn.transition=null,He=1,kb(r,o,u,f)}finally{hn.transition=g,He=f}return null}function kb(r,o,u,f){do ji();while(vr!==null);if((Be&6)!==0)throw Error(n(327));u=r.finishedWork;var g=r.finishedLanes;if(u===null)return null;if(r.finishedWork=null,r.finishedLanes=0,u===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var x=u.lanes|u.childLanes;if(tS(r,x),r===vt&&(ct=vt=null,bt=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||Ea||(Ea=!0,mg(Ds,function(){return ji(),null})),x=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||x){x=hn.transition,hn.transition=null;var b=He;He=1;var N=Be;Be|=4,fc.current=null,mb(r,u),tg(u,r),BS(wu),Vs=!!xu,wu=xu=null,r.current=u,gb(u),Kk(),Be=N,He=b,hn.transition=x}else r.current=u;if(Ea&&(Ea=!1,vr=r,Ta=g),x=r.pendingLanes,x===0&&(yr=null),Yk(u.stateNode),qt(r,lt()),o!==null)for(f=r.onRecoverableError,u=0;u<o.length;u++)g=o[u],f(g.value,{componentStack:g.stack,digest:g.digest});if(Ca)throw Ca=!1,r=pc,pc=null,r;return(Ta&1)!==0&&r.tag!==0&&ji(),x=r.pendingLanes,(x&1)!==0?r===mc?Bo++:(Bo=0,mc=r):Bo=0,hr(),null}function ji(){if(vr!==null){var r=Jh(Ta),o=hn.transition,u=He;try{if(hn.transition=null,He=16>r?16:r,vr===null)var f=!1;else{if(r=vr,vr=null,Ta=0,(Be&6)!==0)throw Error(n(331));var g=Be;for(Be|=4,ye=r.current;ye!==null;){var x=ye,b=x.child;if((ye.flags&16)!==0){var N=x.deletions;if(N!==null){for(var I=0;I<N.length;I++){var K=N[I];for(ye=K;ye!==null;){var re=ye;switch(re.tag){case 0:case 11:case 15:Fo(8,re,x)}var ae=re.child;if(ae!==null)ae.return=re,ye=ae;else for(;ye!==null;){re=ye;var ne=re.sibling,me=re.return;if(Gm(re),re===K){ye=null;break}if(ne!==null){ne.return=me,ye=ne;break}ye=me}}}var we=x.alternate;if(we!==null){var Se=we.child;if(Se!==null){we.child=null;do{var ut=Se.sibling;Se.sibling=null,Se=ut}while(Se!==null)}}ye=x}}if((x.subtreeFlags&2064)!==0&&b!==null)b.return=x,ye=b;else e:for(;ye!==null;){if(x=ye,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:Fo(9,x,x.return)}var B=x.sibling;if(B!==null){B.return=x.return,ye=B;break e}ye=x.return}}var O=r.current;for(ye=O;ye!==null;){b=ye;var $=b.child;if((b.subtreeFlags&2064)!==0&&$!==null)$.return=b,ye=$;else e:for(b=O;ye!==null;){if(N=ye,(N.flags&2048)!==0)try{switch(N.tag){case 0:case 11:case 15:ka(9,N)}}catch(be){st(N,N.return,be)}if(N===b){ye=null;break e}var ce=N.sibling;if(ce!==null){ce.return=N.return,ye=ce;break e}ye=N.return}}if(Be=g,hr(),Dn&&typeof Dn.onPostCommitFiberRoot=="function")try{Dn.onPostCommitFiberRoot(Is,r)}catch{}f=!0}return f}finally{He=u,hn.transition=o}}return!1}function dg(r,o,u){o=Ri(u,o),o=Am(r,o,1),r=mr(r,o,1),o=Ot(),r!==null&&(co(r,1,o),qt(r,o))}function st(r,o,u){if(r.tag===3)dg(r,r,u);else for(;o!==null;){if(o.tag===3){dg(o,r,u);break}else if(o.tag===1){var f=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(yr===null||!yr.has(f))){r=Ri(u,r),r=Nm(o,r,1),o=mr(o,r,1),r=Ot(),o!==null&&(co(o,1,r),qt(o,r));break}}o=o.return}}function Sb(r,o,u){var f=r.pingCache;f!==null&&f.delete(o),o=Ot(),r.pingedLanes|=r.suspendedLanes&u,vt===r&&(bt&u)===u&&(pt===4||pt===3&&(bt&130023424)===bt&&500>lt()-hc?Wr(r,0):dc|=u),qt(r,o)}function hg(r,o){o===0&&((r.mode&1)===0?o=1:(o=_s,_s<<=1,(_s&130023424)===0&&(_s=4194304)));var u=Ot();r=Gn(r,o),r!==null&&(co(r,o,u),qt(r,u))}function bb(r){var o=r.memoizedState,u=0;o!==null&&(u=o.retryLane),hg(r,u)}function Cb(r,o){var u=0;switch(r.tag){case 13:var f=r.stateNode,g=r.memoizedState;g!==null&&(u=g.retryLane);break;case 19:f=r.stateNode;break;default:throw Error(n(314))}f!==null&&f.delete(o),hg(r,u)}var pg;pg=function(r,o,u){if(r!==null)if(r.memoizedProps!==o.pendingProps||$t.current)Ht=!0;else{if((r.lanes&u)===0&&(o.flags&128)===0)return Ht=!1,fb(r,o,u);Ht=(r.flags&131072)!==0}else Ht=!1,tt&&(o.flags&1048576)!==0&&qp(o,ia,o.index);switch(o.lanes=0,o.tag){case 2:var f=o.type;xa(r,o),r=o.pendingProps;var g=wi(o,Pt.current);Ti(o,u),g=Wu(null,o,f,r,g,u);var x=Hu();return o.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,Wt(f)?(x=!0,ta(o)):x=!1,o.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Ou(o),g.updater=ya,o.stateNode=g,g._reactInternals=o,Qu(o,f,r,u),o=tc(null,o,f,!0,x,u)):(o.tag=0,tt&&x&&Pu(o),_t(null,o,g,u),o=o.child),o;case 16:f=o.elementType;e:{switch(xa(r,o),r=o.pendingProps,g=f._init,f=g(f._payload),o.type=f,g=o.tag=Tb(f),r=bn(f,r),g){case 0:o=ec(null,o,f,r,u);break e;case 1:o=Vm(null,o,f,r,u);break e;case 11:o=Lm(null,o,f,r,u);break e;case 14:o=_m(null,o,f,bn(f.type,r),u);break e}throw Error(n(306,f,""))}return o;case 0:return f=o.type,g=o.pendingProps,g=o.elementType===f?g:bn(f,g),ec(r,o,f,g,u);case 1:return f=o.type,g=o.pendingProps,g=o.elementType===f?g:bn(f,g),Vm(r,o,f,g,u);case 3:e:{if(Bm(o),r===null)throw Error(n(387));f=o.pendingProps,x=o.memoizedState,g=x.element,nm(r,o),ca(o,f,null,u);var b=o.memoizedState;if(f=b.element,x.isDehydrated)if(x={element:f,isDehydrated:!1,cache:b.cache,pendingSuspenseBoundaries:b.pendingSuspenseBoundaries,transitions:b.transitions},o.updateQueue.baseState=x,o.memoizedState=x,o.flags&256){g=Ri(Error(n(423)),o),o=Um(r,o,f,u,g);break e}else if(f!==g){g=Ri(Error(n(424)),o),o=Um(r,o,f,u,g);break e}else for(tn=cr(o.stateNode.containerInfo.firstChild),en=o,tt=!0,Sn=null,u=em(o,null,f,u),o.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(bi(),f===g){o=Zn(r,o,u);break e}_t(r,o,f,u)}o=o.child}return o;case 5:return om(o),r===null&&Au(o),f=o.type,g=o.pendingProps,x=r!==null?r.memoizedProps:null,b=g.children,ku(f,g)?b=null:x!==null&&ku(f,x)&&(o.flags|=32),zm(r,o),_t(r,o,b,u),o.child;case 6:return r===null&&Au(o),null;case 13:return $m(r,o,u);case 4:return Fu(o,o.stateNode.containerInfo),f=o.pendingProps,r===null?o.child=Ci(o,null,f,u):_t(r,o,f,u),o.child;case 11:return f=o.type,g=o.pendingProps,g=o.elementType===f?g:bn(f,g),Lm(r,o,f,g,u);case 7:return _t(r,o,o.pendingProps,u),o.child;case 8:return _t(r,o,o.pendingProps.children,u),o.child;case 12:return _t(r,o,o.pendingProps.children,u),o.child;case 10:e:{if(f=o.type._context,g=o.pendingProps,x=o.memoizedProps,b=g.value,Ge(aa,f._currentValue),f._currentValue=b,x!==null)if(kn(x.value,b)){if(x.children===g.children&&!$t.current){o=Zn(r,o,u);break e}}else for(x=o.child,x!==null&&(x.return=o);x!==null;){var N=x.dependencies;if(N!==null){b=x.child;for(var I=N.firstContext;I!==null;){if(I.context===f){if(x.tag===1){I=Qn(-1,u&-u),I.tag=2;var K=x.updateQueue;if(K!==null){K=K.shared;var re=K.pending;re===null?I.next=I:(I.next=re.next,re.next=I),K.pending=I}}x.lanes|=u,I=x.alternate,I!==null&&(I.lanes|=u),Lu(x.return,u,o),N.lanes|=u;break}I=I.next}}else if(x.tag===10)b=x.type===o.type?null:x.child;else if(x.tag===18){if(b=x.return,b===null)throw Error(n(341));b.lanes|=u,N=b.alternate,N!==null&&(N.lanes|=u),Lu(b,u,o),b=x.sibling}else b=x.child;if(b!==null)b.return=x;else for(b=x;b!==null;){if(b===o){b=null;break}if(x=b.sibling,x!==null){x.return=b.return,b=x;break}b=b.return}x=b}_t(r,o,g.children,u),o=o.child}return o;case 9:return g=o.type,f=o.pendingProps.children,Ti(o,u),g=fn(g),f=f(g),o.flags|=1,_t(r,o,f,u),o.child;case 14:return f=o.type,g=bn(f,o.pendingProps),g=bn(f.type,g),_m(r,o,f,g,u);case 15:return Om(r,o,o.type,o.pendingProps,u);case 17:return f=o.type,g=o.pendingProps,g=o.elementType===f?g:bn(f,g),xa(r,o),o.tag=1,Wt(f)?(r=!0,ta(o)):r=!1,Ti(o,u),Rm(o,f,g),Qu(o,f,g,u),tc(null,o,f,!0,r,u);case 19:return Hm(r,o,u);case 22:return Fm(r,o,u)}throw Error(n(156,o.tag))};function mg(r,o){return Xh(r,o)}function Eb(r,o,u,f){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pn(r,o,u,f){return new Eb(r,o,u,f)}function kc(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Tb(r){if(typeof r=="function")return kc(r)?1:0;if(r!=null){if(r=r.$$typeof,r===U)return 11;if(r===ee)return 14}return 2}function kr(r,o){var u=r.alternate;return u===null?(u=pn(r.tag,o,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=o,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&14680064,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,o=r.dependencies,u.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u}function Aa(r,o,u,f,g,x){var b=2;if(f=r,typeof r=="function")kc(r)&&(b=1);else if(typeof r=="string")b=5;else e:switch(r){case Y:return Kr(u.children,g,x,o);case H:b=8,g|=8;break;case X:return r=pn(12,u,o,g|2),r.elementType=X,r.lanes=x,r;case fe:return r=pn(13,u,o,g),r.elementType=fe,r.lanes=x,r;case se:return r=pn(19,u,o,g),r.elementType=se,r.lanes=x,r;case Ee:return Na(u,g,x,o);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case j:b=10;break e;case G:b=9;break e;case U:b=11;break e;case ee:b=14;break e;case xe:b=16,f=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return o=pn(b,u,o,g),o.elementType=r,o.type=f,o.lanes=x,o}function Kr(r,o,u,f){return r=pn(7,r,f,o),r.lanes=u,r}function Na(r,o,u,f){return r=pn(22,r,f,o),r.elementType=Ee,r.lanes=u,r.stateNode={isHidden:!1},r}function Sc(r,o,u){return r=pn(6,r,null,o),r.lanes=u,r}function bc(r,o,u){return o=pn(4,r.children!==null?r.children:[],r.key,o),o.lanes=u,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}function Pb(r,o,u,f,g){this.tag=o,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gl(0),this.expirationTimes=Gl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gl(0),this.identifierPrefix=f,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Cc(r,o,u,f,g,x,b,N,I){return r=new Pb(r,o,u,N,I),o===1?(o=1,x===!0&&(o|=8)):o=0,x=pn(3,null,null,o),r.current=x,x.stateNode=r,x.memoizedState={element:f,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ou(x),r}function Rb(r,o,u){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:f==null?null:""+f,children:r,containerInfo:o,implementation:u}}function gg(r){if(!r)return dr;r=r._reactInternals;e:{if(Ir(r)!==r||r.tag!==1)throw Error(n(170));var o=r;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(Wt(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(n(171))}if(r.tag===1){var u=r.type;if(Wt(u))return Wp(r,u,o)}return o}function yg(r,o,u,f,g,x,b,N,I){return r=Cc(u,f,!0,r,g,x,b,N,I),r.context=gg(null),u=r.current,f=Ot(),g=xr(u),x=Qn(f,g),x.callback=o??null,mr(u,x,g),r.current.lanes=g,co(r,g,f),qt(r,f),r}function ja(r,o,u,f){var g=o.current,x=Ot(),b=xr(g);return u=gg(u),o.context===null?o.context=u:o.pendingContext=u,o=Qn(x,b),o.payload={element:r},f=f===void 0?null:f,f!==null&&(o.callback=f),r=mr(g,o,b),r!==null&&(Tn(r,g,b,x),ua(r,g,b)),b}function Da(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function vg(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<o?u:o}}function Ec(r,o){vg(r,o),(r=r.alternate)&&vg(r,o)}function Mb(){return null}var xg=typeof reportError=="function"?reportError:function(r){console.error(r)};function Tc(r){this._internalRoot=r}Ia.prototype.render=Tc.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(n(409));ja(r,o,null,null)},Ia.prototype.unmount=Tc.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;$r(function(){ja(null,r,null,null)}),o[Kn]=null}};function Ia(r){this._internalRoot=r}Ia.prototype.unstable_scheduleHydration=function(r){if(r){var o=np();r={blockedOn:null,target:r,priority:o};for(var u=0;u<ar.length&&o!==0&&o<ar[u].priority;u++);ar.splice(u,0,r),u===0&&op(r)}};function Pc(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function La(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function wg(){}function Ab(r,o,u,f,g){if(g){if(typeof f=="function"){var x=f;f=function(){var K=Da(b);x.call(K)}}var b=yg(o,f,r,0,null,!1,!1,"",wg);return r._reactRootContainer=b,r[Kn]=b.current,Eo(r.nodeType===8?r.parentNode:r),$r(),b}for(;g=r.lastChild;)r.removeChild(g);if(typeof f=="function"){var N=f;f=function(){var K=Da(I);N.call(K)}}var I=Cc(r,0,!1,null,null,!1,!1,"",wg);return r._reactRootContainer=I,r[Kn]=I.current,Eo(r.nodeType===8?r.parentNode:r),$r(function(){ja(o,I,u,f)}),I}function _a(r,o,u,f,g){var x=u._reactRootContainer;if(x){var b=x;if(typeof g=="function"){var N=g;g=function(){var I=Da(b);N.call(I)}}ja(o,b,r,g)}else b=Ab(u,o,r,g,f);return Da(b)}ep=function(r){switch(r.tag){case 3:var o=r.stateNode;if(o.current.memoizedState.isDehydrated){var u=uo(o.pendingLanes);u!==0&&(Ql(o,u|1),qt(o,lt()),(Be&6)===0&&(Ni=lt()+500,hr()))}break;case 13:$r(function(){var f=Gn(r,1);if(f!==null){var g=Ot();Tn(f,r,1,g)}}),Ec(r,1)}},Zl=function(r){if(r.tag===13){var o=Gn(r,134217728);if(o!==null){var u=Ot();Tn(o,r,134217728,u)}Ec(r,134217728)}},tp=function(r){if(r.tag===13){var o=xr(r),u=Gn(r,o);if(u!==null){var f=Ot();Tn(u,r,o,f)}Ec(r,o)}},np=function(){return He},rp=function(r,o){var u=He;try{return He=r,o()}finally{He=u}},oo=function(r,o,u){switch(o){case"input":if(it(r,u),o=u.name,u.type==="radio"&&o!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<u.length;o++){var f=u[o];if(f!==r&&f.form===r.form){var g=Js(f);if(!g)throw Error(n(90));kt(f),it(f,g)}}}break;case"textarea":z(r,u);break;case"select":o=u.value,o!=null&&Lt(r,!!u.multiple,o,!1)}},Bh=vc,Uh=$r;var Nb={usingClientEntryPoint:!1,Events:[Ro,vi,Js,zh,Vh,vc]},Uo={findFiberByHostInstance:Lr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},jb={bundleType:Uo.bundleType,version:Uo.version,rendererPackageName:Uo.rendererPackageName,rendererConfig:Uo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=Kh(r),r===null?null:r.stateNode},findFiberByHostInstance:Uo.findFiberByHostInstance||Mb,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Oa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Oa.isDisabled&&Oa.supportsFiber)try{Is=Oa.inject(jb),Dn=Oa}catch{}}return Xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Nb,Xt.createPortal=function(r,o){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Pc(o))throw Error(n(200));return Rb(r,o,null,u)},Xt.createRoot=function(r,o){if(!Pc(r))throw Error(n(299));var u=!1,f="",g=xg;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(f=o.identifierPrefix),o.onRecoverableError!==void 0&&(g=o.onRecoverableError)),o=Cc(r,1,!1,null,null,u,!1,f,g),r[Kn]=o.current,Eo(r.nodeType===8?r.parentNode:r),new Tc(o)},Xt.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=Kh(o),r=r===null?null:r.stateNode,r},Xt.flushSync=function(r){return $r(r)},Xt.hydrate=function(r,o,u){if(!La(o))throw Error(n(200));return _a(null,r,o,!0,u)},Xt.hydrateRoot=function(r,o,u){if(!Pc(r))throw Error(n(405));var f=u!=null&&u.hydratedSources||null,g=!1,x="",b=xg;if(u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onRecoverableError!==void 0&&(b=u.onRecoverableError)),o=yg(o,null,r,1,u??null,g,!1,x,b),r[Kn]=o.current,Eo(r),f)for(r=0;r<f.length;r++)u=f[r],g=u._getVersion,g=g(u._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[u,g]:o.mutableSourceEagerHydrationData.push(u,g);return new Ia(o)},Xt.render=function(r,o,u){if(!La(o))throw Error(n(200));return _a(null,r,o,!1,u)},Xt.unmountComponentAtNode=function(r){if(!La(r))throw Error(n(40));return r._reactRootContainer?($r(function(){_a(null,null,r,!1,function(){r._reactRootContainer=null,r[Kn]=null})}),!0):!1},Xt.unstable_batchedUpdates=vc,Xt.unstable_renderSubtreeIntoContainer=function(r,o,u,f){if(!La(u))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return _a(r,o,u,!1,f)},Xt.version="18.3.1-next-f1338f8080-20240426",Xt}var Rg;function wx(){if(Rg)return Ac.exports;Rg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ac.exports=Vb(),Ac.exports}var Mg;function Bb(){if(Mg)return Fa;Mg=1;var e=wx();return Fa.createRoot=e.createRoot,Fa.hydrateRoot=e.hydrateRoot,Fa}var Ub=Bb(),S=Pd();const $b=Td(S),ws=Ib({__proto__:null,default:$b},[S]);class kf extends Error{constructor(t,n){super(n),this.status=t}}function Wb(e){let t="";for(let i=0;i<e.length;i+=32768)t+=String.fromCharCode(...e.subarray(i,i+32768));return btoa(t)}function Hb(e=globalThis.fetch.bind(globalThis)){async function t(n,i){const s=(i?.method??"GET").toUpperCase(),a=await e(n,{...i,cache:"no-store",credentials:"same-origin",headers:s!=="GET"&&s!=="HEAD"?{"content-type":"application/json","X-Ours-Messenger-CSRF":"1",...i?.headers}:i?.headers}),c=await a.text();let d=null;if(c)try{d=JSON.parse(c)}catch{throw new kf(a.status,a.ok?"Server returned an invalid response":`HTTP ${a.status}`)}if(!a.ok){const h=d&&typeof d=="object"&&"error"in d&&d.error&&typeof d.error=="object"&&"message"in d.error&&typeof d.error.message=="string"?d.error.message:`HTTP ${a.status}`;throw new kf(a.status,h)}return d}return{identity:()=>t("/api/identity"),setBio:n=>t("/api/identity/bio",{method:"POST",body:JSON.stringify({bio:n})}),buildInfo:()=>t("/api/build-info"),identities:()=>t("/api/identities"),contacts:()=>t("/api/contacts"),invites:()=>t("/api/invites"),conversation:(n,i)=>t(`/api/conversations/${encodeURIComponent(n)}/page?limit=50${i?`&before=${encodeURIComponent(i)}`:""}`),markRead:n=>t(`/api/conversations/${encodeURIComponent(n)}/read`,{method:"POST"}),send:(n,i,s,l)=>t("/api/messages/send",{method:"POST",signal:l,body:JSON.stringify({contact:n,text:i,...s?{reply_to_wire_id:s}:{}})}),sendFile:async(n,i,s,l,a)=>t("/api/messages/send-file",{method:"POST",body:JSON.stringify({contact:n,data_base64:Wb(new Uint8Array(await i.arrayBuffer())),filename:s,mime:l,...a?{reply_to_wire_id:a}:{}})}),files:n=>t(`/api/conversations/${encodeURIComponent(n)}/files`),fetchFiles:n=>t("/api/files/fetch",{method:"POST",body:JSON.stringify({wire_ids:n})}),mediaUrl:n=>`/api/media/${encodeURIComponent(n)}`,createInvite:(n="one_time",i)=>t("/api/invites",{method:"POST",body:JSON.stringify({mode:n,...i?{name:i}:{}})}),addContact:(n,i)=>t("/api/contacts/add",{method:"POST",body:JSON.stringify({invite:n,...i?{name:i}:{}})}),renameContact:(n,i)=>t("/api/contacts/rename",{method:"POST",body:JSON.stringify({contact:n,name:i})}),removeContact:n=>t("/api/contacts/remove",{method:"POST",body:JSON.stringify({contact:n})}),revokeInvite:n=>t("/api/invites/revoke",{method:"POST",body:JSON.stringify({invite_id:n})}),respondToIntroduction:(n,i)=>t("/api/contacts/introductions",{method:"POST",body:JSON.stringify({contact:n,action:i})}),vapidPublicKey:()=>t("/api/push/vapid-public-key"),ensurePush:n=>t("/api/push/subscriptions/ensure",{method:"POST",body:JSON.stringify(n)}),deletePush:n=>t("/api/push/subscriptions/delete",{method:"POST",body:JSON.stringify({binding_id:n})})}}const Qe=Hb(),Sf="ours-messenger-live-event";function kx(e){window.dispatchEvent(new CustomEvent(Sf,{detail:e}))}function Kb(e){const t=n=>{const i=n.detail;i?.v===1&&e(i)};return window.addEventListener(Sf,t),()=>window.removeEventListener(Sf,t)}function qb(e,t){const n=new EventSource("/api/events");let i=!1;t("connecting"),n.onopen=()=>{i=!0,t("live")},n.onerror=()=>t(i?"retrying":"connecting");const s=l=>{n.addEventListener(l,a=>{try{const c=JSON.parse(a.data);c&&c.v===1&&e({...c,type:l})}catch{}})};return s("sync_required"),s("message_received"),s("receipt_received"),s("file_received"),()=>n.close()}function Xb(e=window.location){return`${e.protocol==="https:"?"wss:":"ws:"}//${e.host}/api/presence`}function Yb(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;if(t.type!=="event"||!t.event||typeof t.event!="object")return null;const n=t.event;return n.v===1?n:null}function Gb(e){let t=!1,n=null,i,s=1e3,l=0;const a=()=>{i!==void 0&&clearTimeout(i),i=void 0;const m=n;n=null,m&&m.readyState<WebSocket.CLOSING&&m.close(1e3,"hidden")},c=()=>{if(t||document.visibilityState!=="visible")return;e.onState?.("retrying");const m=s;s=Math.min(3e4,s*2),i=setTimeout(()=>{i=void 0,d()},m)},d=async()=>{if(a(),t||document.visibilityState!=="visible")return;const m=++l;e.onState?.("connecting");try{const[p,y]=await Promise.all([e.identity(),e.registration.pushManager.getSubscription()]);if(t||m!==l||document.visibilityState!=="visible")return;const w=y?.toJSON(),k=y?.endpoint,C=w?.keys?.auth;if(!k||!C)return;const T=new WebSocket(Xb());n=T,T.onopen=()=>T.send(JSON.stringify({identity:p.cid,endpoint:k,auth:C})),T.onmessage=E=>{let A;try{A=JSON.parse(String(E.data))}catch{return}if(A?.ok===!0){s=1e3,e.onState?.("live");return}const M=Yb(A);M&&e.onEvent(M)},T.onclose=()=>{n===T&&(n=null),m===l&&c()},T.onerror=()=>T.close()}catch{m===l&&c()}},h=()=>{l++,document.visibilityState==="visible"?(s=1e3,d()):a()};return document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",a),d(),()=>{t=!0,l++,document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",a),a()}}function Qb(e,t){return t.visibility==="visible"&&t.appRoute==="chats"&&t.selectedContactCid===e&&(t.desktopLayout||t.mobileDetailOpen)&&!t.conversationCoveringDialogOpen}class Zb{#e=new Map;request(t,n){let i=this.#e.get(t);return i?.running?(i.rerun=!0,i.running):(i??={running:null,rerun:!1},this.#e.set(t,i),i.running=(async()=>{do i.rerun=!1,await n();while(i.rerun)})().finally(()=>{i.running=null,i.rerun||this.#e.delete(t)}),i.running)}}function Ag(e){if(e==="/"||e==="/chats"||e==="/chats/")return{name:"chats",contactCid:null};const t=/^\/chats\/([^/]+)\/?$/.exec(e);if(t)try{const n=decodeURIComponent(t[1]);if(n)return{name:"chats",contactCid:n}}catch{}return{name:"not_found",pathname:e}}function Wo(e){return e?`/chats/${encodeURIComponent(e)}`:"/chats"}const Ng={read:2,delivered:1};function jg(e){return e&&Object.hasOwn(Ng,e)?Ng[e]:0}function bf(e,t){return jg(t)>jg(e)?t:e}const Jb=()=>({contacts:[],pending:[]});function eC(e){return{identity:null,contacts:Jb(),route:e,pages:{},pendingSends:{},drafts:{},replies:{},connection:"connecting",search:"",mobileDetailOpen:e.name==="chats"&&e.contactCid!==null,coveringDialog:!1,dialogBusy:!1,generatedInvite:null,sendingDialog:null,error:null,loaded:!1}}function Gr(e,t){return`${e}:${t}`}function qr(e){return e.route.name==="chats"?e.route.contactCid:null}function Qr(e,t){return e.identity?e.pages[Gr(e.identity.cid,t)]??null:null}function tC(e,t){const n=bf(e.receipt,t.receipt);return n===t.receipt?t:{...t,receipt:n}}function Di(e,t){const n=[...e],i=new Map;n.forEach((s,l)=>{s.wire_id&&i.set(s.wire_id,l)});for(const s of t){const l=s.wire_id?i.get(s.wire_id):void 0;l===void 0?(s.wire_id&&i.set(s.wire_id,n.length),n.push(s)):n[l]=tC(n[l],s)}return n}function Dg(e,t){switch(t.type){case"snapshot":{const n=e.identity!==null&&e.identity.cid!==t.identity.cid;return{...e,identity:t.identity,contacts:t.contacts,loaded:!0,error:null,...n?{pages:{},pendingSends:{},drafts:{},replies:{},sendingDialog:null,generatedInvite:null,coveringDialog:!1,dialogBusy:!1}:{}}}case"contacts":return{...e,contacts:t.contacts};case"page":{if(!e.identity)return e;const n=Gr(e.identity.cid,t.contactCid),i=e.pages[n],s=e.pendingSends[n]??[],l=new Set(t.page.messages.map(y=>y.wire_id)),a=s.filter(y=>!l.has(y.wire_id)),c=new Map(i?.messages.map(y=>[y.wire_id,y.receipt])??[]),d=i?t.page.messages.map(y=>{const w=bf(c.get(y.wire_id)??null,y.receipt);return w===y.receipt?y:{...y,receipt:w}}):t.page.messages,h=i&&i.messages.length>50?{...t.page,messages:Di(i.messages,d),hasMore:i.hasMore,nextBefore:i.nextBefore}:{...t.page,messages:d},m=Di(h.messages,a),p={...h,messages:m,total:Math.max(h.total+a.length,m.length)};return{...e,pages:{...e.pages,[n]:p},pendingSends:{...e.pendingSends,[n]:a.length?a:void 0}}}case"sent_message":{if(!e.identity)return e;const n=Gr(e.identity.cid,t.contactCid),i=e.pages[n];if(i?.messages.some(a=>a.wire_id===t.message.wire_id))return e;const s=Di(e.pendingSends[n]??[],[t.message]);if(!i)return{...e,pendingSends:{...e.pendingSends,[n]:s}};const l=Di(i.messages,[t.message]);return{...e,pages:{...e.pages,[n]:{...i,messages:l,total:Math.max(i.total+1,l.length)}},pendingSends:{...e.pendingSends,[n]:s}}}case"receipt":{if(!e.identity)return e;const n=Gr(e.identity.cid,t.contactCid),i=e.pages[n],s=e.pendingSends[n],l=new Set(t.wireIds),a=h=>{let m=!1;const p=h.map(y=>{if(!y.wire_id||!l.has(y.wire_id))return y;const w=bf(y.receipt,t.kind);return w===y.receipt?y:(m=!0,{...y,receipt:w})});return m?p:h},c=i?a(i.messages):void 0,d=s?a(s):void 0;return c===i?.messages&&d===s?e:{...e,pages:i&&c?{...e.pages,[n]:{...i,messages:c}}:e.pages,pendingSends:s&&d?{...e.pendingSends,[n]:d}:e.pendingSends}}case"older_page":{if(!e.identity)return e;const n=Gr(e.identity.cid,t.contactCid),i=e.pages[n];if(!i)return e;const s=Di(Di(t.page.messages,t.newer),i.messages),l={...t.page,preview:i.preview,total:Math.max(t.page.total,i.total,s.length),messages:s};return{...e,pages:{...e.pages,[n]:l}}}case"route":return{...e,route:t.route,mobileDetailOpen:t.mobileDetailOpen??(t.route.name==="chats"&&t.route.contactCid!==null)};case"connection":return{...e,connection:t.connection};case"search":return{...e,search:t.search};case"draft":return e.identity?{...e,drafts:{...e.drafts,[Gr(e.identity.cid,t.contactCid)]:t.value}}:e;case"reply":return e.identity?{...e,replies:{...e.replies,[Gr(e.identity.cid,t.contactCid)]:t.wireId??void 0}}:e;case"sending":return{...e,sendingDialog:t.dialog};case"dialog":return{...e,coveringDialog:t.open,dialogBusy:t.open?e.dialogBusy:!1,generatedInvite:t.open?e.generatedInvite:null,error:null};case"dialog_busy":return{...e,dialogBusy:t.busy};case"generated_invite":return{...e,generatedInvite:t.blob};case"error":return{...e,error:t.message}}}function nC(e,t,n){return!e||t?"ignore":n?"defer":"reload"}function ks(){return{api:Qe,notification:globalThis.Notification,navigator}}function Cr(e,t,n){return new Promise((i,s)=>{const l=setTimeout(()=>s(new Error(`${n} did not complete within ${t/1e3}s — try again`)),t);e.then(a=>{clearTimeout(l),i(a)},a=>{clearTimeout(l),s(a)})})}async function rC(e,t={}){let n=null,i=!1,s=!1;const l="serviceWorker"in navigator&&window.isSecureContext,a=()=>e({supported:l,offline:!navigator.onLine,updateAvailable:i,registration:n}),c=()=>a(),d=()=>a(),h=()=>{document.visibilityState==="visible"&&n?.update().catch(()=>{})},m=w=>{if(w.data?.type==="ours-push-repair-required"){window.dispatchEvent(new Event("ours-push-repair-required"));return}if(w.data?.type==="ours-push-foreground"){const k=w.data.contact_id,C=w.data.wire_id,T=w.data.kind;typeof k=="string"&&typeof C=="string"&&kx({v:1,type:T==="file"?"file_received":"message_received",contact_id:k,wire_id:C,date:new Date().toISOString()})}},p=l&&!!navigator.serviceWorker.controller,y=()=>{const w=nC(p,s,t.shouldDeferReload?.()??!1);if(w!=="ignore"){if(w==="defer"){i=!0,a();return}s=!0,(t.reload??(()=>location.reload()))()}};if(window.addEventListener("online",c),window.addEventListener("offline",d),document.addEventListener("visibilitychange",h),navigator.serviceWorker?.addEventListener("message",m),navigator.serviceWorker?.addEventListener("controllerchange",y),l){n=await navigator.serviceWorker.register("/sw.js",{scope:"/",updateViaCache:"none"}),await navigator.serviceWorker.ready;const w=k=>k?.addEventListener("statechange",()=>{k.state==="installed"&&navigator.serviceWorker.controller&&(i=!0,a())});w(n.installing),n.addEventListener("updatefound",()=>w(n?.installing??null)),n.update().catch(()=>{})}return a(),()=>{window.removeEventListener("online",c),window.removeEventListener("offline",d),document.removeEventListener("visibilitychange",h),navigator.serviceWorker?.removeEventListener("message",m),navigator.serviceWorker?.removeEventListener("controllerchange",y)}}async function Ig(e,t=()=>location.reload(),n=navigator.serviceWorker){const i=e.waiting;if(!i){t();return}await Cr(new Promise(s=>{let l=!1;const a=()=>{l||(l=!0,n.removeEventListener("controllerchange",a),t(),s())};n.addEventListener("controllerchange",a),i.postMessage({type:"SKIP_WAITING"})}),1e4,"service-worker update")}function iC(e){const t="=".repeat((4-e.length%4)%4),n=atob((e+t).replaceAll("-","+").replaceAll("_","/")),i=new Uint8Array(n.length);for(let s=0;s<n.length;s++)i[s]=n.charCodeAt(s);return i}function oC(e){return e?e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength):null}function Lg(e,t){const n=oC(e);return!!n&&n.length===t.length&&n.every((i,s)=>i===t[s])}function Cf(e=navigator.userAgent){return/iP(?:hone|ad|od)/.test(e)}function Ef(e=navigator,t=window){return Cf(e.userAgent)&&(e.standalone===!0||t.matchMedia("(display-mode: standalone)").matches)}function sC(){return Cf()&&!Ef()?"On iPhone or iPad, tap Share → Add to Home Screen, then open messenger from its Home Screen icon (iOS 16.4 or later).":!("Notification"in window)||!window.PushManager||!("serviceWorker"in navigator)?"Notifications require a current secure browser with service-worker and Web Push support.":Notification.permission==="denied"?Cf()?"Allow messenger in iOS Settings → Notifications, then return and choose Repair.":"Allow notifications in this site’s browser settings, then return and choose Repair.":null}function aC(e={}){const t=e.notification??ks().notification;if(!t)return Promise.reject(new Error("notification permission is unavailable"));const n=new Promise((i,s)=>{let l=!1;const a=c=>{if(l)return;const d=c??t.permission;d!=="granted"&&d!=="denied"&&d!=="default"||(l=!0,i(d))};try{const c=t.requestPermission(a);c&&typeof c.then=="function"&&c.then(a,s)}catch(c){s(c)}});return Cr(n,e.timeoutMs??15e3,"notification permission")}function Sx(e,t){return!!e&&!!e.pushManager&&!!t.notification&&!!t.navigator.serviceWorker}function ni(e,t={}){return{status:e,preview:"full",...t}}async function lC(e,t,n){let i=await Cr(e.pushManager.getSubscription(),5e3,"push subscription lookup");if((n||i?.options.applicationServerKey&&!Lg(i.options.applicationServerKey,t))&&(i&&await Cr(i.unsubscribe(),5e3,"stale push unsubscribe"),i=null),i&&Lg(i.options.applicationServerKey,t))return i;try{return await Cr(e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t}),15e3,"push subscribe")}catch(s){const l=await e.pushManager.getSubscription();if(!l)throw s;return await Cr(l.unsubscribe(),5e3,"stale push unsubscribe"),Cr(e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t}),15e3,"push repair")}}async function bx(e,t,n,i){const s=await i.api.vapidPublicKey(),a=await Cr(Promise.resolve(i.navigator.serviceWorker.ready),1e4,"service-worker readiness")??e,c=iC(s.publicKey),h=(await lC(a,c,n)).toJSON();if(!h.endpoint||!h.keys?.p256dh||!h.keys.auth)throw new Error("browser returned an incomplete push subscription");const m=await i.api.ensurePush({...h,label:i.navigator.userAgent.slice(0,160),...t===void 0?{}:{preview:t}});if(m.status!=="on"||m.fingerprint!==s.fingerprint||m.configEpoch!==s.configEpoch)throw new Error("server did not acknowledge the current Web Push configuration");return ni("on",{bindingId:m.binding_id,fingerprint:m.fingerprint,configEpoch:m.configEpoch,preview:m.preview})}async function _g(e,t=ks()){return Sx(e,t)?t.notification.permission!=="granted"?ni("needs-permission",{blocked:t.notification.permission==="denied"}):await e.pushManager.getSubscription()?bx(e,void 0,!1,t):ni("off"):ni("unsupported")}async function Cx(e,t={},n=ks()){if(!Sx(e,n))return ni("unsupported");const i=await aC({notification:n.notification});return i!=="granted"?ni("needs-permission",{blocked:i==="denied"}):bx(e,t.preview??"full",t.forceFresh??!1,n)}const uC=(e,t,n=ks())=>Cx(e,{preview:t,forceFresh:!0},n);async function cC(e,t,n=ks()){const i=await e.pushManager.getSubscription(),s=[];if(t.bindingId)try{await n.api.deletePush(t.bindingId)}catch(l){s.push(l)}if(i)try{await i.unsubscribe()}catch(l){s.push(l)}if(s.length)throw new Error("notification disable did not fully converge — choose Repair and try again");return ni("off",{preview:t.preview})}function fC(e=15e3){if(!("serviceWorker"in navigator))return()=>{};let t;const n=()=>{const l={type:"ours-visibility",state:document.visibilityState,ts:Date.now(),iosStandalone:Ef()};navigator.serviceWorker.ready.then(a=>{(navigator.serviceWorker.controller??a.active)?.postMessage(l)}).catch(()=>{})},i=()=>{n(),t!==void 0&&clearInterval(t),t=document.visibilityState==="visible"?setInterval(n,e):void 0,document.visibilityState==="visible"&&Ex()},s=l=>{l.data?.type!=="ours-visibility-query"||!l.ports?.[0]||l.ports[0].postMessage({type:"ours-visibility-reply",state:document.visibilityState,iosStandalone:Ef()})};return document.addEventListener("visibilitychange",i),navigator.serviceWorker.addEventListener("message",s),i(),()=>{document.removeEventListener("visibilitychange",i),navigator.serviceWorker.removeEventListener("message",s),t!==void 0&&clearInterval(t)}}async function Ex(){try{if(!("serviceWorker"in navigator))return;const t=await(await navigator.serviceWorker.getRegistration())?.getNotifications()??[];for(const n of t)n.close();"clearAppBadge"in navigator&&await navigator.clearAppBadge()}catch{}}/**
41
- * @license lucide-react v0.468.0 - ISC
42
- *
43
- * This source code is licensed under the ISC license.
44
- * See the LICENSE file in the root directory of this source tree.
45
- */const dC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Tx=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/**
46
- * @license lucide-react v0.468.0 - ISC
47
- *
48
- * This source code is licensed under the ISC license.
49
- * See the LICENSE file in the root directory of this source tree.
50
- */var hC={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"};/**
51
- * @license lucide-react v0.468.0 - ISC
52
- *
53
- * This source code is licensed under the ISC license.
54
- * See the LICENSE file in the root directory of this source tree.
55
- */const pC=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:s="",children:l,iconNode:a,...c},d)=>S.createElement("svg",{ref:d,...hC,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:Tx("lucide",s),...c},[...a.map(([h,m])=>S.createElement(h,m)),...Array.isArray(l)?l:[l]]));/**
56
- * @license lucide-react v0.468.0 - ISC
57
- *
58
- * This source code is licensed under the ISC license.
59
- * See the LICENSE file in the root directory of this source tree.
60
- */const ze=(e,t)=>{const n=S.forwardRef(({className:i,...s},l)=>S.createElement(pC,{ref:l,iconNode:t,className:Tx(`lucide-${dC(e)}`,i),...s}));return n.displayName=`${e}`,n};/**
61
- * @license lucide-react v0.468.0 - ISC
62
- *
63
- * This source code is licensed under the ISC license.
64
- * See the LICENSE file in the root directory of this source tree.
65
- */const mC=ze("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
66
- * @license lucide-react v0.468.0 - ISC
67
- *
68
- * This source code is licensed under the ISC license.
69
- * See the LICENSE file in the root directory of this source tree.
70
- */const gC=ze("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
71
- * @license lucide-react v0.468.0 - ISC
72
- *
73
- * This source code is licensed under the ISC license.
74
- * See the LICENSE file in the root directory of this source tree.
75
- */const yC=ze("Bolt",[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/**
76
- * @license lucide-react v0.468.0 - ISC
77
- *
78
- * This source code is licensed under the ISC license.
79
- * See the LICENSE file in the root directory of this source tree.
80
- */const vC=ze("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
81
- * @license lucide-react v0.468.0 - ISC
82
- *
83
- * This source code is licensed under the ISC license.
84
- * See the LICENSE file in the root directory of this source tree.
85
- */const Og=ze("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
86
- * @license lucide-react v0.468.0 - ISC
87
- *
88
- * This source code is licensed under the ISC license.
89
- * See the LICENSE file in the root directory of this source tree.
90
- */const xC=ze("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
91
- * @license lucide-react v0.468.0 - ISC
92
- *
93
- * This source code is licensed under the ISC license.
94
- * See the LICENSE file in the root directory of this source tree.
95
- */const wC=ze("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
96
- * @license lucide-react v0.468.0 - ISC
97
- *
98
- * This source code is licensed under the ISC license.
99
- * See the LICENSE file in the root directory of this source tree.
100
- */const kC=ze("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
101
- * @license lucide-react v0.468.0 - ISC
102
- *
103
- * This source code is licensed under the ISC license.
104
- * See the LICENSE file in the root directory of this source tree.
105
- */const SC=ze("CirclePause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);/**
106
- * @license lucide-react v0.468.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */const bC=ze("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
111
- * @license lucide-react v0.468.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */const CC=ze("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
116
- * @license lucide-react v0.468.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */const EC=ze("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
121
- * @license lucide-react v0.468.0 - ISC
122
- *
123
- * This source code is licensed under the ISC license.
124
- * See the LICENSE file in the root directory of this source tree.
125
- */const TC=ze("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
126
- * @license lucide-react v0.468.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */const Fg=ze("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"}]]);/**
131
- * @license lucide-react v0.468.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */const PC=ze("Grid2x2",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]);/**
136
- * @license lucide-react v0.468.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */const RC=ze("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
141
- * @license lucide-react v0.468.0 - ISC
142
- *
143
- * This source code is licensed under the ISC license.
144
- * See the LICENSE file in the root directory of this source tree.
145
- */const MC=ze("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
146
- * @license lucide-react v0.468.0 - ISC
147
- *
148
- * This source code is licensed under the ISC license.
149
- * See the LICENSE file in the root directory of this source tree.
150
- */const AC=ze("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]);/**
151
- * @license lucide-react v0.468.0 - ISC
152
- *
153
- * This source code is licensed under the ISC license.
154
- * See the LICENSE file in the root directory of this source tree.
155
- */const NC=ze("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
156
- * @license lucide-react v0.468.0 - ISC
157
- *
158
- * This source code is licensed under the ISC license.
159
- * See the LICENSE file in the root directory of this source tree.
160
- */const jC=ze("MessageCircleReply",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}],["path",{d:"M7 12h7a2 2 0 0 1 2 2v1",key:"1gheu4"}]]);/**
161
- * @license lucide-react v0.468.0 - ISC
162
- *
163
- * This source code is licensed under the ISC license.
164
- * See the LICENSE file in the root directory of this source tree.
165
- */const DC=ze("MessageSquareText",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);/**
166
- * @license lucide-react v0.468.0 - ISC
167
- *
168
- * This source code is licensed under the ISC license.
169
- * See the LICENSE file in the root directory of this source tree.
170
- */const IC=ze("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
171
- * @license lucide-react v0.468.0 - ISC
172
- *
173
- * This source code is licensed under the ISC license.
174
- * See the LICENSE file in the root directory of this source tree.
175
- */const LC=ze("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
176
- * @license lucide-react v0.468.0 - ISC
177
- *
178
- * This source code is licensed under the ISC license.
179
- * See the LICENSE file in the root directory of this source tree.
180
- */const _C=ze("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
181
- * @license lucide-react v0.468.0 - ISC
182
- *
183
- * This source code is licensed under the ISC license.
184
- * See the LICENSE file in the root directory of this source tree.
185
- */const OC=ze("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
186
- * @license lucide-react v0.468.0 - ISC
187
- *
188
- * This source code is licensed under the ISC license.
189
- * See the LICENSE file in the root directory of this source tree.
190
- */const FC=ze("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
191
- * @license lucide-react v0.468.0 - ISC
192
- *
193
- * This source code is licensed under the ISC license.
194
- * See the LICENSE file in the root directory of this source tree.
195
- */const zC=ze("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
196
- * @license lucide-react v0.468.0 - ISC
197
- *
198
- * This source code is licensed under the ISC license.
199
- * See the LICENSE file in the root directory of this source tree.
200
- */const VC=ze("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
201
- * @license lucide-react v0.468.0 - ISC
202
- *
203
- * This source code is licensed under the ISC license.
204
- * See the LICENSE file in the root directory of this source tree.
205
- */const BC=ze("SendHorizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
206
- * @license lucide-react v0.468.0 - ISC
207
- *
208
- * This source code is licensed under the ISC license.
209
- * See the LICENSE file in the root directory of this source tree.
210
- */const UC=ze("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
211
- * @license lucide-react v0.468.0 - ISC
212
- *
213
- * This source code is licensed under the ISC license.
214
- * See the LICENSE file in the root directory of this source tree.
215
- */const $C=ze("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
216
- * @license lucide-react v0.468.0 - ISC
217
- *
218
- * This source code is licensed under the ISC license.
219
- * See the LICENSE file in the root directory of this source tree.
220
- */const WC=ze("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
221
- * @license lucide-react v0.468.0 - ISC
222
- *
223
- * This source code is licensed under the ISC license.
224
- * See the LICENSE file in the root directory of this source tree.
225
- */const HC=ze("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
226
- * @license lucide-react v0.468.0 - ISC
227
- *
228
- * This source code is licensed under the ISC license.
229
- * See the LICENSE file in the root directory of this source tree.
230
- */const KC=ze("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
231
- * @license lucide-react v0.468.0 - ISC
232
- *
233
- * This source code is licensed under the ISC license.
234
- * See the LICENSE file in the root directory of this source tree.
235
- */const qC=ze("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),XC={app:PC,back:mC,bell:gC,bolt:yC,chat:DC,check:xC,chevron:kC,chevronDown:wC,close:qC,clusters:Og,copy:CC,download:EC,edit:OC,inbox:RC,link:MC,lock:AC,mic:IC,maximize:NC,minus:LC,monitor:Fg,monitorEye:Fg,more:TC,paperclip:_C,pause:SC,play:bC,plus:FC,refresh:zC,reply:jC,search:VC,send:BC,settings:UC,shield:$C,sliders:WC,trash:HC,user:KC,agent:vC,network:Og};function ve(e){const{name:t,size:n=18,stroke:i=1.8,fill:s=!1,style:l,className:a}=e,c=XC[t];return c?v.jsx(c,{className:"ic "+(a||""),width:n,height:n,strokeWidth:i,fill:s?"currentColor":"none",style:l,"aria-hidden":"true"}):null}function Px(e){if(typeof e!="string")return null;const t=/^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?/.exec(e.trim());if(!t)return null;const n=t[7]?t[7].slice(0,3).padEnd(3,"0"):"000";return`${t[1]}-${t[2]}-${t[3]}T${t[4]}:${t[5]}:${t[6]}.${n}Z`}function hl(e){const t=Px(e);if(t){const i=Date.parse(t);if(!Number.isNaN(i))return i}const n=new Date(e).getTime();return Number.isNaN(n)?0:n}function YC(e){const t=Px(e);if(t){const i=new Date(t);if(!Number.isNaN(i.getTime()))return i}const n=new Date(e);return Number.isNaN(n.getTime())?null:n}const Ho="room",GC="room_",pl="ours-cowork-room:",zg="ours-cowork-",Vg="cowork-room-",Tf=/^[0-7][0-9a-hjkmnp-tv-z]{25}$/,QC=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,ZC=25,Al=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Tr=e=>typeof e=="string"&&e.length>0;function JC(e){if(typeof e!="string")return null;const t=e.trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;let n;try{n=JSON.parse(t)}catch{return null}return!Al(n)||n.version!==1||!Tr(n.kind)||!n.kind.startsWith(GC)||!Tr(n.room_id)||!Tr(n.signature)?null:n}function eE(e){const t=Al(e.author)?e.author:{};return{name:Tr(t.display_name)?t.display_name:"",role:Tr(t.role)?t.role:""}}function Dc(e){const t=String(e).replace(/^room_/,"").split("_").filter(Boolean);return t.length===0?"Room notice":t.join(" ").replace(/^./,n=>n.toUpperCase())}function tE(e){if(!Al(e))return null;const t=Tr(e.kind)?e.kind:"",n=eE(e),i=typeof e.text=="string"?e.text:"",s=Number.isSafeInteger(e.briefing_version)&&e.briefing_version>0?e.briefing_version:null;switch(t){case"room_msg":return n.role===Ho?Ii(t,"Room",i||"Room notice"):{variant:"chat",kind:t,author:n.name||"Unknown member",role:n.role,label:"",text:i};case"room_briefing":return Ii(t,s===null?"Room briefing":`Room briefing · v${s}`,i||"The room briefing was updated.");case"room_role_briefing":{const a=["Role briefing",Tr(e.briefing_role)?e.briefing_role:"",s===null?"":`v${s}`].filter(Boolean).join(" · ");return Ii(t,a,i||"Your role briefing was updated.")}case"room_membership":return Ii(t,"Membership",i||iE(e.membership));case"room_not_member":return Ii(t,"Room","You are no longer a member of this room.");default:return i?{variant:n.role&&n.role!==Ho?"chat":"system",kind:t,author:n.role&&n.role!==Ho?n.name||"Unknown member":"",role:n.role&&n.role!==Ho?n.role:"",label:n.role&&n.role!==Ho?"":Dc(t),text:i}:Ii(t,Dc(t),`${Dc(t)} from the room.`)}}function nE(e,t){return rE(e)?tE(JC(t)):null}function Rx(e){if(typeof e!="string"||!e.startsWith(Vg))return null;const t=e.slice(Vg.length);return Tf.test(t)?t:null}function Mx(e){if(typeof e!="string"||!e.startsWith(zg))return null;const t=e.slice(zg.length);if(Tf.test(t))return{roomId:t,slug:null};const n=t.slice(-26),i=t.at(-27),s=t.slice(0,-27);return i!=="-"||!Tf.test(n)||s.length<1||s.length>ZC?null:QC.test(s)?{roomId:n,slug:s}:null}function rE(e){const t=String(e??"").trim();return t.startsWith(pl)&&t.slice(pl.length).trim().length>0||Mx(e)!==null||Rx(e)!==null}function Ii(e,t,n){return{variant:"system",kind:e,author:"",role:"",label:t,text:n}}function iE(e){if(!Al(e))return"The room membership changed.";const t=Tr(e.alias)?e.alias:"A member";return e.action==="remove"?`${t} left the room.`:"The room membership changed."}function oE(e){if(!e)return"";const t=e.variant==="chat"?e.author:e.label,n=sE(e.text);return t?n?`${t} · ${n}`:t:n}function sE(e){return String(e??"").replace(/\s+/g," ").trim()}function aE(e){const t=String(e??"").trim();if(t.startsWith(pl))return t.slice(pl.length).trim()||null;const n=Mx(e);if(n?.slug)return n.slug.replace(/-/g," ").replace(/[a-z]/,l=>l.toUpperCase());if(n)return`Room ${n.roomId.slice(0,8)}`;const i=Rx(e);return i===null?null:`Room ${i.slice(0,8)}`}const Rd=YC;function us(e){const t=e.trim().split(/\s+/).filter(Boolean);if(!t.length)return"?";const n=i=>Array.from(i).find(s=>/[\p{L}\p{N}]/u.test(s))??Array.from(i)[0]??"";if(t.length===1){const i=Array.from(t[0]),s=i.filter(l=>/[\p{L}\p{N}]/u.test(l));return(s.length?s.slice(0,2).join(""):i[0]??"?").toUpperCase()}return(n(t[0])+n(t.at(-1)??"")).toUpperCase()}function lE(e){const t=Rd(e);if(!t)return"";const n=new Date;return t.toDateString()===n.toDateString()?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString([],{month:"short",day:"numeric"})}function cs(e){const t=Rd(e);return t?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function uE(e){const t=Rd(e);return t?t.toLocaleString():e}function Md(e){return e.length<=14?e:`${e.slice(0,8)}…${e.slice(-4)}`}function cE(e){return/^[0-9A-Fa-f]{40,}$/.test(e.trim())}function fE(e,t,n){const i=(e??"").trim(),s=aE(i);return s||(i&&!cE(i)?i:i?Md(i):"Unnamed")}function Jo(e){return e.display_name?.trim()||fE(e.name)}const dE="x-ours-kind=voice-message",Ax="voice-message-",Qo=20*1024*1024;let fs=null,Pf=[];const Ad=new Map;function hE(e){fs=e;for(const t of Pf)t(e);Pf=[]}function Bg(e){for(const t of e)Ad.set(t.wire_id,{id:t.wire_id,dir:t.dir,filename:t.filename,mime:t.mime,size:t.size,date:t.date,available:t.available,logicalName:t.logical_name,version:t.version,transcription:t.transcription})}function pE(){Ad.clear()}function Nx(e){return Ad.get(e)??null}function mE(e){return fs?.url(e)??null}function gE(e){return`${e}; ${dE}`}function qi(e,t){return/x-ours-kind\s*=\s*voice-message/i.test(e)||t.toLowerCase().startsWith(Ax)&&e.toLowerCase().startsWith("audio/")}function yE(e,t){const n=e??"file",i=t??"";return qi(i,n)?"🎤 Voice message":i.toLowerCase().startsWith("image/")?"🖼 Photo":`📎 ${n}`}async function Nl(e){return(fs??await new Promise(n=>Pf.push(n))).bytes(e)}async function vE(e){if(!fs)throw new Error("Media provider is not ready");await fs.fetch(e)}function Rr(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function xE(e,t=!1){return e==="read"?{state:"read",label:"read",glyph:"✓✓"}:e==="delivered"?{state:"delivered",label:"delivered",glyph:"✓✓"}:t?{state:"untracked",label:"sent, and cannot report delivery",glyph:"✓"}:{state:"sent",label:"sent",glyph:"✓"}}function jx({receipt:e,content:t="Message",receiptless:n=!1}){const i=xE(e,n);return v.jsx("span",{className:"ticks"+(i.state==="read"?" read":""),"data-receipt-status":i.state,role:"img","aria-label":`${t} ${i.label}`,title:i.label,children:i.glyph})}function Ug(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,s=n.indexOf(t);for(;s!==-1;)i++,s=n.indexOf(t,s+t.length);return i}const Ft=jr(/[A-Za-z]/),Nt=jr(/[\dA-Za-z]/),wE=jr(/[#-'*+\--9=?A-Z^-~]/);function ml(e){return e!==null&&(e<32||e===127)}const Rf=jr(/\d/),kE=jr(/[\dA-Fa-f]/),SE=jr(/[!-/:-@[-`{-~]/);function Me(e){return e!==null&&e<-2}function Ye(e){return e!==null&&(e<0||e===32)}function Oe(e){return e===-2||e===-1||e===32}const jl=jr(/\p{P}|\p{S}/u),si=jr(/\s/);function jr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function bE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const Dl=function(e){if(e==null)return PE;if(typeof e=="function")return Il(e);if(typeof e=="object")return Array.isArray(e)?CE(e):EE(e);if(typeof e=="string")return TE(e);throw new Error("Expected function, string, or object as test")};function CE(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Dl(e[n]);return Il(i);function i(...s){let l=-1;for(;++l<t.length;)if(t[l].apply(this,s))return!0;return!1}}function EE(e){const t=e;return Il(n);function n(i){const s=i;let l;for(l in e)if(s[l]!==t[l])return!1;return!0}}function TE(e){return Il(t);function t(n){return n&&n.type===e}}function Il(e){return t;function t(n,i,s){return!!(RE(n)&&e.call(this,n,typeof i=="number"?i:void 0,s||void 0))}}function PE(){return!0}function RE(e){return e!==null&&typeof e=="object"&&"type"in e}const Dx=[],ME=!0,Mf=!1,AE="skip";function Ix(e,t,n,i){let s;typeof t=="function"&&typeof n!="function"?(i=n,n=t):s=t;const l=Dl(s),a=i?-1:1;c(e,void 0,[])();function c(d,h,m){const p=d&&typeof d=="object"?d:{};if(typeof p.type=="string"){const w=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(w?"<"+w+">":""))+")"})}return y;function y(){let w=Dx,k,C,T;if((!t||l(d,h,m[m.length-1]||void 0))&&(w=NE(n(d,m)),w[0]===Mf))return w;if("children"in d&&d.children){const E=d;if(E.children&&w[0]!==AE)for(C=(i?E.children.length:-1)+a,T=m.concat(E);C>-1&&C<E.children.length;){const A=E.children[C];if(k=c(A,C,T)(),k[0]===Mf)return k;C=typeof k[1]=="number"?k[1]:C+a}}return w}}}function NE(e){return Array.isArray(e)?e:typeof e=="number"?[ME,e]:e==null?Dx:[e]}function jE(e,t,n){const s=Dl((n||{}).ignore||[]),l=DE(t);let a=-1;for(;++a<l.length;)Ix(e,"text",c);function c(h,m){let p=-1,y;for(;++p<m.length;){const w=m[p],k=y?y.children:void 0;if(s(w,k?k.indexOf(w):void 0,y))return;y=w}if(y)return d(h,m)}function d(h,m){const p=m[m.length-1],y=l[a][0],w=l[a][1];let k=0;const T=p.children.indexOf(h);let E=!1,A=[];y.lastIndex=0;let M=y.exec(h.value);for(;M;){const _=M.index,W={index:M.index,input:M.input,stack:[...m,h]};let D=w(...M,W);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?y.lastIndex=_+1:(k!==_&&A.push({type:"text",value:h.value.slice(k,_)}),Array.isArray(D)?A.push(...D):D&&A.push(D),k=_+M[0].length,E=!0),!y.global)break;M=y.exec(h.value)}return E?(k<h.value.length&&A.push({type:"text",value:h.value.slice(k)}),p.children.splice(T,1,...A)):A=[h],T+A.length}}function DE(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const s=n[i];t.push([IE(s[0]),LE(s[1])])}return t}function IE(e){return typeof e=="string"?new RegExp(bE(e),"g"):e}function LE(e){return typeof e=="function"?e:function(){return e}}const Ic="phrasing",Lc=["autolink","link","image","label"];function _E(){return{transforms:[$E],enter:{literalAutolink:FE,literalAutolinkEmail:_c,literalAutolinkHttp:_c,literalAutolinkWww:_c},exit:{literalAutolink:UE,literalAutolinkEmail:BE,literalAutolinkHttp:zE,literalAutolinkWww:VE}}}function OE(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ic,notInConstruct:Lc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ic,notInConstruct:Lc},{character:":",before:"[ps]",after:"\\/",inConstruct:Ic,notInConstruct:Lc}]}}function FE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function _c(e){this.config.enter.autolinkProtocol.call(this,e)}function zE(e){this.config.exit.autolinkProtocol.call(this,e)}function VE(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function BE(e){this.config.exit.autolinkEmail.call(this,e)}function UE(e){this.exit(e)}function $E(e){jE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,WE],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,HE]],{ignore:["link","linkReference"]})}function WE(e,t,n,i,s){let l="";if(!Lx(s)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!KE(n)))return!1;const a=qE(n+i);if(!a[0])return!1;const c={type:"link",title:null,url:l+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[c,{type:"text",value:a[1]}]:c}function HE(e,t,n,i){return!Lx(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function KE(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function qE(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const s=Ug(e,"(");let l=Ug(e,")");for(;i!==-1&&s>l;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),l++;return[e,n]}function Lx(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||si(n)||jl(n))&&(!t||n!==47)}function Mn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}_x.peek=nT;function XE(){this.buffer()}function YE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function GE(){this.buffer()}function QE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ZE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function JE(e){this.exit(e)}function eT(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function tT(e){this.exit(e)}function nT(){return"["}function _x(e,t,n,i){const s=n.createTracker(i);let l=s.move("[^");const a=n.enter("footnoteReference"),c=n.enter("reference");return l+=s.move(n.safe(n.associationId(e),{after:"]",before:l})),c(),a(),l+=s.move("]"),l}function rT(){return{enter:{gfmFootnoteCallString:XE,gfmFootnoteCall:YE,gfmFootnoteDefinitionLabelString:GE,gfmFootnoteDefinition:QE},exit:{gfmFootnoteCallString:ZE,gfmFootnoteCall:JE,gfmFootnoteDefinitionLabelString:eT,gfmFootnoteDefinition:tT}}}function iT(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:_x},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,s,l,a){const c=l.createTracker(a);let d=c.move("[^");const h=l.enter("footnoteDefinition"),m=l.enter("label");return d+=c.move(l.safe(l.associationId(i),{before:d,after:"]"})),m(),d+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),d+=c.move((t?`
236
- `:" ")+l.indentLines(l.containerFlow(i,c.current()),t?Ox:oT))),h(),d}}function oT(e,t,n){return t===0?e:Ox(e,t,n)}function Ox(e,t,n){return(n?"":" ")+e}const sT=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Fx.peek=fT;function aT(){return{canContainEols:["delete"],enter:{strikethrough:uT},exit:{strikethrough:cT}}}function lT(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:sT}],handlers:{delete:Fx}}}function uT(e){this.enter({type:"delete",children:[]},e)}function cT(e){this.exit(e)}function Fx(e,t,n,i){const s=n.createTracker(i),l=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),l(),a}function fT(){return"~"}function dT(e){return e.length}function hT(e,t){const n=t||{},i=(n.align||[]).concat(),s=n.stringLength||dT,l=[],a=[],c=[],d=[];let h=0,m=-1;for(;++m<e.length;){const C=[],T=[];let E=-1;for(e[m].length>h&&(h=e[m].length);++E<e[m].length;){const A=pT(e[m][E]);if(n.alignDelimiters!==!1){const M=s(A);T[E]=M,(d[E]===void 0||M>d[E])&&(d[E]=M)}C.push(A)}a[m]=C,c[m]=T}let p=-1;if(typeof i=="object"&&"length"in i)for(;++p<h;)l[p]=$g(i[p]);else{const C=$g(i);for(;++p<h;)l[p]=C}p=-1;const y=[],w=[];for(;++p<h;){const C=l[p];let T="",E="";C===99?(T=":",E=":"):C===108?T=":":C===114&&(E=":");let A=n.alignDelimiters===!1?1:Math.max(1,d[p]-T.length-E.length);const M=T+"-".repeat(A)+E;n.alignDelimiters!==!1&&(A=T.length+A+E.length,A>d[p]&&(d[p]=A),w[p]=A),y[p]=M}a.splice(1,0,y),c.splice(1,0,w),m=-1;const k=[];for(;++m<a.length;){const C=a[m],T=c[m];p=-1;const E=[];for(;++p<h;){const A=C[p]||"";let M="",_="";if(n.alignDelimiters!==!1){const W=d[p]-(T[p]||0),D=l[p];D===114?M=" ".repeat(W):D===99?W%2?(M=" ".repeat(W/2+.5),_=" ".repeat(W/2-.5)):(M=" ".repeat(W/2),_=M):_=" ".repeat(W)}n.delimiterStart!==!1&&!p&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||p)&&E.push(" "),n.alignDelimiters!==!1&&E.push(M),E.push(A),n.alignDelimiters!==!1&&E.push(_),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||p!==h-1)&&E.push("|")}k.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return k.join(`
237
- `)}function pT(e){return e==null?"":String(e)}function $g(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function mT(e,t,n,i){const s=n.enter("blockquote"),l=n.createTracker(i);l.move("> "),l.shift(2);const a=n.indentLines(n.containerFlow(e,l.current()),gT);return s(),a}function gT(e,t,n){return">"+(n?"":" ")+e}function yT(e,t){return Wg(e,t.inConstruct,!0)&&!Wg(e,t.notInConstruct,!1)}function Wg(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function Hg(e,t,n,i){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
238
- `&&yT(n.stack,n.unsafe[s]))return/[ \t]/.test(i.before)?"":" ";return`\\
239
- `}function vT(e,t){const n=String(e);let i=n.indexOf(t),s=i,l=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===s?++l>a&&(a=l):l=1,s=i+t.length,i=n.indexOf(t,s);return a}function xT(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function wT(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function kT(e,t,n,i){const s=wT(n),l=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(xT(e,n)){const p=n.enter("codeIndented"),y=n.indentLines(l,ST);return p(),y}const c=n.createTracker(i),d=s.repeat(Math.max(vT(l,s)+1,3)),h=n.enter("codeFenced");let m=c.move(d);if(e.lang){const p=n.enter(`codeFencedLang${a}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${a}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
240
- `,encode:["`"],...c.current()})),p()}return m+=c.move(`
241
- `),l&&(m+=c.move(l+`
242
- `)),m+=c.move(d),h(),m}function ST(e,t,n){return(n?"":" ")+e}function Nd(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function bT(e,t,n,i){const s=Nd(n),l=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let c=n.enter("label");const d=n.createTracker(i);let h=d.move("[");return h+=d.move(n.safe(n.associationId(e),{before:h,after:"]",...d.current()})),h+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(c=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":`
243
- `,...d.current()}))),c(),e.title&&(c=n.enter(`title${l}`),h+=d.move(" "+s),h+=d.move(n.safe(e.title,{before:h,after:s,...d.current()})),h+=d.move(s),c()),a(),h}function CT(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ds(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Xi(e){if(e===null||Ye(e)||si(e))return 1;if(jl(e))return 2}function gl(e,t,n){const i=Xi(e),s=Xi(t);return i===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}zx.peek=ET;function zx(e,t,n,i){const s=CT(n),l=n.enter("emphasis"),a=n.createTracker(i),c=a.move(s);let d=a.move(n.containerPhrasing(e,{after:s,before:c,...a.current()}));const h=d.charCodeAt(0),m=gl(i.before.charCodeAt(i.before.length-1),h,s);m.inside&&(d=ds(h)+d.slice(1));const p=d.charCodeAt(d.length-1),y=gl(i.after.charCodeAt(0),p,s);y.inside&&(d=d.slice(0,-1)+ds(p));const w=a.move(s);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+d+w}function ET(e,t,n){return n.options.emphasis||"*"}function jd(e,t,n,i){let s,l,a;typeof t=="function"&&typeof n!="function"?(l=void 0,a=t,s=n):(l=t,a=n,s=i),Ix(e,l,c,s);function c(d,h){const m=h[h.length-1],p=m?m.children.indexOf(d):void 0;return a(d,p,m)}}const TT={};function Dd(e,t){const n=TT,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Vx(e,i,s)}function Vx(e,t,n){if(PT(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Kg(e.children,t,n)}return Array.isArray(e)?Kg(e,t,n):""}function Kg(e,t,n){const i=[];let s=-1;for(;++s<e.length;)i[s]=Vx(e[s],t,n);return i.join("")}function PT(e){return!!(e&&typeof e=="object")}function RT(e,t){let n=!1;return jd(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,Mf}),!!((!e.depth||e.depth<3)&&Dd(e)&&(t.options.setext||n))}function MT(e,t,n,i){const s=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(i);if(RT(e,n)){const m=n.enter("headingSetext"),p=n.enter("phrasing"),y=n.containerPhrasing(e,{...l.current(),before:`
244
- `,after:`
245
- `});return p(),m(),y+`
246
- `+(s===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
247
- `))+1))}const a="#".repeat(s),c=n.enter("headingAtx"),d=n.enter("phrasing");l.move(a+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
248
- `,...l.current()});return/^[\t ]/.test(h)&&(h=ds(h.charCodeAt(0))+h.slice(1)),h=h?a+" "+h:a,n.options.closeAtx&&(h+=" "+a),d(),c(),h}Bx.peek=AT;function Bx(e){return e.value||""}function AT(){return"<"}Ux.peek=NT;function Ux(e,t,n,i){const s=Nd(n),l=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let c=n.enter("label");const d=n.createTracker(i);let h=d.move("![");return h+=d.move(n.safe(e.alt,{before:h,after:"]",...d.current()})),h+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(c=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${l}`),h+=d.move(" "+s),h+=d.move(n.safe(e.title,{before:h,after:s,...d.current()})),h+=d.move(s),c()),h+=d.move(")"),a(),h}function NT(){return"!"}$x.peek=jT;function $x(e,t,n,i){const s=e.referenceType,l=n.enter("imageReference");let a=n.enter("label");const c=n.createTracker(i);let d=c.move("![");const h=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(h+"]["),a();const m=n.stack;n.stack=[],a=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return a(),n.stack=m,l(),s==="full"||!h||h!==p?d+=c.move(p+"]"):s==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function jT(){return"!"}Wx.peek=DT;function Wx(e,t,n){let i=e.value||"",s="`",l=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(i);)s+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++l<n.unsafe.length;){const a=n.unsafe[l],c=n.compilePattern(a);let d;if(a.atBreak)for(;d=c.exec(i);){let h=d.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(d.index+1)}}return s+i+s}function DT(){return"`"}function Hx(e,t){const n=Dd(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Kx.peek=IT;function Kx(e,t,n,i){const s=Nd(n),l=s==='"'?"Quote":"Apostrophe",a=n.createTracker(i);let c,d;if(Hx(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let p=a.move("<");return p+=a.move(n.containerPhrasing(e,{before:p,after:">",...a.current()})),p+=a.move(">"),c(),n.stack=m,p}c=n.enter("link"),d=n.enter("label");let h=a.move("[");return h+=a.move(n.containerPhrasing(e,{before:h,after:"](",...a.current()})),h+=a.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=a.move("<"),h+=a.move(n.safe(e.url,{before:h,after:">",...a.current()})),h+=a.move(">")):(d=n.enter("destinationRaw"),h+=a.move(n.safe(e.url,{before:h,after:e.title?" ":")",...a.current()}))),d(),e.title&&(d=n.enter(`title${l}`),h+=a.move(" "+s),h+=a.move(n.safe(e.title,{before:h,after:s,...a.current()})),h+=a.move(s),d()),h+=a.move(")"),c(),h}function IT(e,t,n){return Hx(e,n)?"<":"["}qx.peek=LT;function qx(e,t,n,i){const s=e.referenceType,l=n.enter("linkReference");let a=n.enter("label");const c=n.createTracker(i);let d=c.move("[");const h=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(h+"]["),a();const m=n.stack;n.stack=[],a=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return a(),n.stack=m,l(),s==="full"||!h||h!==p?d+=c.move(p+"]"):s==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function LT(){return"["}function Id(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function _T(e){const t=Id(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function OT(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Xx(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function FT(e,t,n,i){const s=n.enter("list"),l=n.bulletCurrent;let a=e.ordered?OT(n):Id(n);const c=e.ordered?a==="."?")":".":_T(n);let d=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),Xx(n)===a&&m){let p=-1;for(;++p<e.children.length;){const y=e.children[p];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(a=c),n.bulletCurrent=a;const h=n.containerFlow(e,i);return n.bulletLastUsed=a,n.bulletCurrent=l,s(),h}function zT(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function VT(e,t,n,i){const s=zT(n);let l=n.bulletCurrent||Id(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let a=l.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const c=n.createTracker(i);c.move(l+" ".repeat(a-l.length)),c.shift(a);const d=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,c.current()),m);return d(),h;function m(p,y,w){return y?(w?"":" ".repeat(a))+p:(w?l:l+" ".repeat(a-l.length))+p}}function BT(e,t,n,i){const s=n.enter("paragraph"),l=n.enter("phrasing"),a=n.containerPhrasing(e,i);return l(),s(),a}const UT=Dl(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function $T(e,t,n,i){return(e.children.some(function(a){return UT(a)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function WT(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Yx.peek=HT;function Yx(e,t,n,i){const s=WT(n),l=n.enter("strong"),a=n.createTracker(i),c=a.move(s+s);let d=a.move(n.containerPhrasing(e,{after:s,before:c,...a.current()}));const h=d.charCodeAt(0),m=gl(i.before.charCodeAt(i.before.length-1),h,s);m.inside&&(d=ds(h)+d.slice(1));const p=d.charCodeAt(d.length-1),y=gl(i.after.charCodeAt(0),p,s);y.inside&&(d=d.slice(0,-1)+ds(p));const w=a.move(s+s);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+d+w}function HT(e,t,n){return n.options.strong||"*"}function KT(e,t,n,i){return n.safe(e.value,i)}function qT(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function XT(e,t,n){const i=(Xx(n)+(n.options.ruleSpaces?" ":"")).repeat(qT(n));return n.options.ruleSpaces?i.slice(0,-1):i}const Gx={blockquote:mT,break:Hg,code:kT,definition:bT,emphasis:zx,hardBreak:Hg,heading:MT,html:Bx,image:Ux,imageReference:$x,inlineCode:Wx,link:Kx,linkReference:qx,list:FT,listItem:VT,paragraph:BT,root:$T,strong:Yx,text:KT,thematicBreak:XT},qg=document.createElement("i");function Ld(e){const t="&"+e+";";qg.innerHTML=t;const n=qg.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Qx(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}const YT=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function GT(e){return e.replace(YT,QT)}function QT(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),l=s===120||s===88;return Qx(n.slice(l?2:1),l?16:10)}return Ld(n)||e}function ZT(){return{enter:{table:JT,tableData:Xg,tableHeader:Xg,tableRow:tP},exit:{codeText:nP,table:eP,tableData:Oc,tableHeader:Oc,tableRow:Oc}}}function JT(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function eP(e){this.exit(e),this.data.inTable=void 0}function tP(e){this.enter({type:"tableRow",children:[]},e)}function Oc(e){this.exit(e)}function Xg(e){this.enter({type:"tableCell",children:[]},e)}function nP(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,rP));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function rP(e,t){return t==="|"?t:e}function iP(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,s=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
249
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:a,tableCell:d,tableRow:c}};function a(w,k,C,T){return h(m(w,C,T),w.align)}function c(w,k,C,T){const E=p(w,C,T),A=h([E]);return A.slice(0,A.indexOf(`
250
- `))}function d(w,k,C,T){const E=C.enter("tableCell"),A=C.enter("phrasing"),M=C.containerPhrasing(w,{...T,before:l,after:l});return A(),E(),M}function h(w,k){return hT(w,{align:k,alignDelimiters:i,padding:n,stringLength:s})}function m(w,k,C){const T=w.children;let E=-1;const A=[],M=k.enter("table");for(;++E<T.length;)A[E]=p(T[E],k,C);return M(),A}function p(w,k,C){const T=w.children;let E=-1;const A=[],M=k.enter("tableRow");for(;++E<T.length;)A[E]=d(T[E],w,k,C);return M(),A}function y(w,k,C){let T=Gx.inlineCode(w,k,C);return C.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function oP(){return{exit:{taskListCheckValueChecked:Yg,taskListCheckValueUnchecked:Yg,paragraph:aP}}}function sP(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:lP}}}function Yg(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function aP(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const s=t.children;let l=-1,a;for(;++l<s.length;){const c=s[l];if(c.type==="paragraph"){a=c;break}}a===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function lP(e,t,n,i){const s=e.children[0],l=typeof e.checked=="boolean"&&s&&s.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",c=n.createTracker(i);l&&c.move(a);let d=Gx.listItem(e,t,n,{...i,...c.current()});return l&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(m){return m+a}}function Zx(){return[_E(),rT(),aT(),ZT(),oP()]}function uP(e){return{extensions:[OE(),iT(e),lT(),iP(e),sP()]}}function on(e,t,n,i){const s=e.length;let l=0,a;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,i.length<1e4)a=Array.from(i),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);l<i.length;)a=i.slice(l,l+1e4),a.unshift(t,0),e.splice(...a),l+=1e4,t+=1e4}function mn(e,t){return e.length>0?(on(e,e.length,0,t),e):t}const Gg={}.hasOwnProperty;function Jx(e){const t={};let n=-1;for(;++n<e.length;)cP(t,e[n]);return t}function cP(e,t){let n;for(n in t){const s=(Gg.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let a;if(l)for(a in l){Gg.call(s,a)||(s[a]=[]);const c=l[a];fP(s[a],Array.isArray(c)?c:c?[c]:[])}}}function fP(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);on(e,0,0,i)}function Zi(e){const t=[];let n=-1,i=0,s=0;for(;++n<e.length;){const l=e.charCodeAt(n);let a="";if(l===37&&Nt(e.charCodeAt(n+1))&&Nt(e.charCodeAt(n+2)))s=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(a=String.fromCharCode(l));else if(l>55295&&l<57344){const c=e.charCodeAt(n+1);l<56320&&c>56319&&c<57344?(a=String.fromCharCode(l,c),s=1):a="�"}else a=String.fromCharCode(l);a&&(t.push(e.slice(i,n),encodeURIComponent(a)),i=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(i)}function Ve(e,t,n,i){const s=i?i-1:Number.POSITIVE_INFINITY;let l=0;return a;function a(d){return Oe(d)?(e.enter(n),c(d)):t(d)}function c(d){return Oe(d)&&l++<s?(e.consume(d),c):(e.exit(n),t(d))}}const dP={tokenize:hP};function hP(e){const t=e.attempt(this.parser.constructs.contentInitial,i,s);let n;return t;function i(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Ve(e,t,"linePrefix")}function s(c){return e.enter("paragraph"),l(c)}function l(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,a(c)}function a(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Me(c)?(e.consume(c),e.exit("chunkText"),l):(e.consume(c),a)}}const pP={tokenize:mP},Qg={tokenize:gP};function mP(e){const t=this,n=[];let i=0,s,l,a;return c;function c(M){if(i<n.length){const _=n[i];return t.containerState=_[1],e.attempt(_[0].continuation,d,h)(M)}return h(M)}function d(M){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&A();const _=t.events.length;let W=_,D;for(;W--;)if(t.events[W][0]==="exit"&&t.events[W][1].type==="chunkFlow"){D=t.events[W][1].end;break}E(i);let Y=_;for(;Y<t.events.length;)t.events[Y][1].end={...D},Y++;return on(t.events,W+1,0,t.events.slice(_)),t.events.length=Y,h(M)}return c(M)}function h(M){if(i===n.length){if(!s)return y(M);if(s.currentConstruct&&s.currentConstruct.concrete)return k(M);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Qg,m,p)(M)}function m(M){return s&&A(),E(i),y(M)}function p(M){return t.parser.lazy[t.now().line]=i!==n.length,a=t.now().offset,k(M)}function y(M){return t.containerState={},e.attempt(Qg,w,k)(M)}function w(M){return i++,n.push([t.currentConstruct,t.containerState]),y(M)}function k(M){if(M===null){s&&A(),E(0),e.consume(M);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:l}),C(M)}function C(M){if(M===null){T(e.exit("chunkFlow"),!0),E(0),e.consume(M);return}return Me(M)?(e.consume(M),T(e.exit("chunkFlow")),i=0,t.interrupt=void 0,c):(e.consume(M),C)}function T(M,_){const W=t.sliceStream(M);if(_&&W.push(null),M.previous=l,l&&(l.next=M),l=M,s.defineSkip(M.start),s.write(W),t.parser.lazy[M.start.line]){let D=s.events.length;for(;D--;)if(s.events[D][1].start.offset<a&&(!s.events[D][1].end||s.events[D][1].end.offset>a))return;const Y=t.events.length;let H=Y,X,j;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(X){j=t.events[H][1].end;break}X=!0}for(E(i),D=Y;D<t.events.length;)t.events[D][1].end={...j},D++;on(t.events,H+1,0,t.events.slice(Y)),t.events.length=D}}function E(M){let _=n.length;for(;_-- >M;){const W=n[_];t.containerState=W[1],W[0].exit.call(t,e)}n.length=M}function A(){s.write([null]),l=void 0,s=void 0,t.containerState._closeFlow=void 0}}function gP(e,t,n){return Ve(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ll(e,t,n){const i=[];let s=-1;for(;++s<e.length;){const l=e[s].resolveAll;l&&!i.includes(l)&&(t=l(t,n),i.push(l))}return t}const Af={name:"attention",resolveAll:yP,tokenize:vP};function yP(e,t){let n=-1,i,s,l,a,c,d,h,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[i][1].end},y={...e[n][1].start};Zg(p,-d),Zg(y,d),a={type:d>1?"strongSequence":"emphasisSequence",start:p,end:{...e[i][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},l={type:d>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},s={type:d>1?"strong":"emphasis",start:{...a.start},end:{...c.end}},e[i][1].end={...a.start},e[n][1].start={...c.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=mn(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=mn(h,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",l,t]]),h=mn(h,Ll(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),h=mn(h,[["exit",l,t],["enter",c,t],["exit",c,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,h=mn(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,on(e,i-1,n-i+3,h),n=i+h.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function vP(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,s=Xi(i);let l;return a;function a(d){return l=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===l)return e.consume(d),c;const h=e.exit("attentionSequence"),m=Xi(d),p=!m||m===2&&s||n.includes(d),y=!s||s===2&&m||n.includes(i);return h._open=!!(l===42?p:p&&(s||!y)),h._close=!!(l===42?y:y&&(m||!p)),t(d)}}function Zg(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const xP={name:"autolink",tokenize:wP};function wP(e,t,n){let i=0;return s;function s(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(w){return Ft(w)?(e.consume(w),a):w===64?n(w):h(w)}function a(w){return w===43||w===45||w===46||Nt(w)?(i=1,c(w)):h(w)}function c(w){return w===58?(e.consume(w),i=0,d):(w===43||w===45||w===46||Nt(w))&&i++<32?(e.consume(w),c):(i=0,h(w))}function d(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):w===null||w===32||w===60||ml(w)?n(w):(e.consume(w),d)}function h(w){return w===64?(e.consume(w),m):wE(w)?(e.consume(w),h):n(w)}function m(w){return Nt(w)?p(w):n(w)}function p(w){return w===46?(e.consume(w),i=0,m):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):y(w)}function y(w){if((w===45||Nt(w))&&i++<63){const k=w===45?y:p;return e.consume(w),k}return n(w)}}const Ss={partial:!0,tokenize:kP};function kP(e,t,n){return i;function i(l){return Oe(l)?Ve(e,s,"linePrefix")(l):s(l)}function s(l){return l===null||Me(l)?t(l):n(l)}}const ew={continuation:{tokenize:bP},exit:CP,name:"blockQuote",tokenize:SP};function SP(e,t,n){const i=this;return s;function s(a){if(a===62){const c=i.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),l}return n(a)}function l(a){return Oe(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function bP(e,t,n){const i=this;return s;function s(a){return Oe(a)?Ve(e,l,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):l(a)}function l(a){return e.attempt(ew,t,n)(a)}}function CP(e){e.exit("blockQuote")}const tw={name:"characterEscape",tokenize:EP};function EP(e,t,n){return i;function i(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),s}function s(l){return SE(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const nw={name:"characterReference",tokenize:TP};function TP(e,t,n){const i=this;let s=0,l,a;return c;function c(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),d}function d(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),l=31,a=Nt,m(p))}function h(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,a=kE,m):(e.enter("characterReferenceValue"),l=7,a=Rf,m(p))}function m(p){if(p===59&&s){const y=e.exit("characterReferenceValue");return a===Nt&&!Ld(i.sliceSerialize(y))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(p)&&s++<l?(e.consume(p),m):n(p)}}const Jg={partial:!0,tokenize:RP},ey={concrete:!0,name:"codeFenced",tokenize:PP};function PP(e,t,n){const i=this,s={partial:!0,tokenize:W};let l=0,a=0,c;return d;function d(D){return h(D)}function h(D){const Y=i.events[i.events.length-1];return l=Y&&Y[1].type==="linePrefix"?Y[2].sliceSerialize(Y[1],!0).length:0,c=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(D)}function m(D){return D===c?(a++,e.consume(D),m):a<3?n(D):(e.exit("codeFencedFenceSequence"),Oe(D)?Ve(e,p,"whitespace")(D):p(D))}function p(D){return D===null||Me(D)?(e.exit("codeFencedFence"),i.interrupt?t(D):e.check(Jg,C,_)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(D))}function y(D){return D===null||Me(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(D)):Oe(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ve(e,w,"whitespace")(D)):D===96&&D===c?n(D):(e.consume(D),y)}function w(D){return D===null||Me(D)?p(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(D))}function k(D){return D===null||Me(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(D)):D===96&&D===c?n(D):(e.consume(D),k)}function C(D){return e.attempt(s,_,T)(D)}function T(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),E}function E(D){return l>0&&Oe(D)?Ve(e,A,"linePrefix",l+1)(D):A(D)}function A(D){return D===null||Me(D)?e.check(Jg,C,_)(D):(e.enter("codeFlowValue"),M(D))}function M(D){return D===null||Me(D)?(e.exit("codeFlowValue"),A(D)):(e.consume(D),M)}function _(D){return e.exit("codeFenced"),t(D)}function W(D,Y,H){let X=0;return j;function j(ee){return D.enter("lineEnding"),D.consume(ee),D.exit("lineEnding"),G}function G(ee){return D.enter("codeFencedFence"),Oe(ee)?Ve(D,U,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ee):U(ee)}function U(ee){return ee===c?(D.enter("codeFencedFenceSequence"),fe(ee)):H(ee)}function fe(ee){return ee===c?(X++,D.consume(ee),fe):X>=a?(D.exit("codeFencedFenceSequence"),Oe(ee)?Ve(D,se,"whitespace")(ee):se(ee)):H(ee)}function se(ee){return ee===null||Me(ee)?(D.exit("codeFencedFence"),Y(ee)):H(ee)}}}function RP(e,t,n){const i=this;return s;function s(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l)}function l(a){return i.parser.lazy[i.now().line]?n(a):t(a)}}const Fc={name:"codeIndented",tokenize:AP},MP={partial:!0,tokenize:NP};function AP(e,t,n){const i=this;return s;function s(h){return e.enter("codeIndented"),Ve(e,l,"linePrefix",5)(h)}function l(h){const m=i.events[i.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?a(h):n(h)}function a(h){return h===null?d(h):Me(h)?e.attempt(MP,a,d)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||Me(h)?(e.exit("codeFlowValue"),a(h)):(e.consume(h),c)}function d(h){return e.exit("codeIndented"),t(h)}}function NP(e,t,n){const i=this;return s;function s(a){return i.parser.lazy[i.now().line]?n(a):Me(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):Ve(e,l,"linePrefix",5)(a)}function l(a){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):Me(a)?s(a):n(a)}}const jP={name:"codeText",previous:IP,resolve:DP,tokenize:LP};function DP(e){let t=e.length-4,n=3,i,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)s===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(s=i):(i===t||e[i][1].type==="lineEnding")&&(e[s][1].type="codeTextData",i!==s+2&&(e[s][1].end=e[i-1][1].end,e.splice(s+2,i-s-2),t-=i-s-2,i=s+2),s=void 0);return e}function IP(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function LP(e,t,n){let i=0,s,l;return a;function a(p){return e.enter("codeText"),e.enter("codeTextSequence"),c(p)}function c(p){return p===96?(e.consume(p),i++,c):(e.exit("codeTextSequence"),d(p))}function d(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),d):p===96?(l=e.enter("codeTextSequence"),s=0,m(p)):Me(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(p))}function h(p){return p===null||p===32||p===96||Me(p)?(e.exit("codeTextData"),d(p)):(e.consume(p),h)}function m(p){return p===96?(e.consume(p),s++,m):s===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(l.type="codeTextData",h(p))}}class _P{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const s=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return i&&Ko(this.left,i),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ko(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ko(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ko(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ko(this.left,n.reverse())}}}function Ko(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function rw(e){const t={};let n=-1,i,s,l,a,c,d,h;const m=new _P(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(i=m.get(n),n&&i[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(d=i[1]._tokenizer.events,l=0,l<d.length&&d[l][1].type==="lineEndingBlank"&&(l+=2),l<d.length&&d[l][1].type==="content"))for(;++l<d.length&&d[l][1].type!=="content";)d[l][1].type==="chunkText"&&(d[l][1]._isInFirstContentOfListItem=!0,l++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,OP(m,n)),n=t[n],h=!0);else if(i[1]._container){for(l=n,s=void 0;l--;)if(a=m.get(l),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(s&&(m.get(s)[1].type="lineEndingBlank"),a[1].type="lineEnding",s=l);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;s&&(i[1].end={...m.get(s)[1].start},c=m.slice(s,n),c.unshift(i),m.splice(s,n-s+1,c))}}return on(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function OP(e,t){const n=e.get(t)[1],i=e.get(t)[2];let s=t-1;const l=[];let a=n._tokenizer;a||(a=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const c=a.events,d=[],h={};let m,p,y=-1,w=n,k=0,C=0;const T=[C];for(;w;){for(;e.get(++s)[1]!==w;);l.push(s),w._tokenizer||(m=i.sliceStream(w),w.next||m.push(null),p&&a.defineSkip(w.start),w._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(m),w._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),p=w,w=w.next}for(w=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(C=y+1,T.push(C),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(a.events=[],w?(w._tokenizer=void 0,w.previous=void 0):T.pop(),y=T.length;y--;){const E=c.slice(T[y],T[y+1]),A=l.pop();d.push([A,A+E.length-1]),e.splice(A,2,E)}for(d.reverse(),y=-1;++y<d.length;)h[k+d[y][0]]=k+d[y][1],k+=d[y][1]-d[y][0]-1;return h}const FP={resolve:VP,tokenize:BP},zP={partial:!0,tokenize:UP};function VP(e){return rw(e),e}function BP(e,t){let n;return i;function i(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(c)}function s(c){return c===null?l(c):Me(c)?e.check(zP,a,l)(c):(e.consume(c),s)}function l(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function a(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function UP(e,t,n){const i=this;return s;function s(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ve(e,l,"linePrefix")}function l(a){if(a===null||Me(a))return n(a);const c=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):e.interrupt(i.parser.constructs.flow,n,t)(a)}}function iw(e,t,n,i,s,l,a,c,d){const h=d||Number.POSITIVE_INFINITY;let m=0;return p;function p(E){return E===60?(e.enter(i),e.enter(s),e.enter(l),e.consume(E),e.exit(l),y):E===null||E===32||E===41||ml(E)?n(E):(e.enter(i),e.enter(a),e.enter(c),e.enter("chunkString",{contentType:"string"}),C(E))}function y(E){return E===62?(e.enter(l),e.consume(E),e.exit(l),e.exit(s),e.exit(i),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),w(E))}function w(E){return E===62?(e.exit("chunkString"),e.exit(c),y(E)):E===null||E===60||Me(E)?n(E):(e.consume(E),E===92?k:w)}function k(E){return E===60||E===62||E===92?(e.consume(E),w):w(E)}function C(E){return!m&&(E===null||E===41||Ye(E))?(e.exit("chunkString"),e.exit(c),e.exit(a),e.exit(i),t(E)):m<h&&E===40?(e.consume(E),m++,C):E===41?(e.consume(E),m--,C):E===null||E===32||E===40||ml(E)?n(E):(e.consume(E),E===92?T:C)}function T(E){return E===40||E===41||E===92?(e.consume(E),C):C(E)}}function ow(e,t,n,i,s,l){const a=this;let c=0,d;return h;function h(w){return e.enter(i),e.enter(s),e.consume(w),e.exit(s),e.enter(l),m}function m(w){return c>999||w===null||w===91||w===93&&!d||w===94&&!c&&"_hiddenFootnoteSupport"in a.parser.constructs?n(w):w===93?(e.exit(l),e.enter(s),e.consume(w),e.exit(s),e.exit(i),t):Me(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||w===91||w===93||Me(w)||c++>999?(e.exit("chunkString"),m(w)):(e.consume(w),d||(d=!Oe(w)),w===92?y:p)}function y(w){return w===91||w===92||w===93?(e.consume(w),c++,p):p(w)}}function sw(e,t,n,i,s,l){let a;return c;function c(y){return y===34||y===39||y===40?(e.enter(i),e.enter(s),e.consume(y),e.exit(s),a=y===40?41:y,d):n(y)}function d(y){return y===a?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),t):(e.enter(l),h(y))}function h(y){return y===a?(e.exit(l),d(a)):y===null?n(y):Me(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Ve(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===a||y===null||Me(y)?(e.exit("chunkString"),h(y)):(e.consume(y),y===92?p:m)}function p(y){return y===a||y===92?(e.consume(y),m):m(y)}}function es(e,t){let n;return i;function i(s){return Me(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,i):Oe(s)?Ve(e,i,n?"linePrefix":"lineSuffix")(s):t(s)}}const $P={name:"definition",tokenize:HP},WP={partial:!0,tokenize:KP};function HP(e,t,n){const i=this;let s;return l;function l(w){return e.enter("definition"),a(w)}function a(w){return ow.call(i,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function c(w){return s=Mn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),d):n(w)}function d(w){return Ye(w)?es(e,h)(w):h(w)}function h(w){return iw(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return e.attempt(WP,p,p)(w)}function p(w){return Oe(w)?Ve(e,y,"whitespace")(w):y(w)}function y(w){return w===null||Me(w)?(e.exit("definition"),i.parser.defined.push(s),t(w)):n(w)}}function KP(e,t,n){return i;function i(c){return Ye(c)?es(e,s)(c):n(c)}function s(c){return sw(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function l(c){return Oe(c)?Ve(e,a,"whitespace")(c):a(c)}function a(c){return c===null||Me(c)?t(c):n(c)}}const qP={name:"hardBreakEscape",tokenize:XP};function XP(e,t,n){return i;function i(l){return e.enter("hardBreakEscape"),e.consume(l),s}function s(l){return Me(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const YP={name:"headingAtx",resolve:GP,tokenize:QP};function GP(e,t){let n=e.length-2,i=3,s,l;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(s={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},l={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},on(e,i,n-i+1,[["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t]])),e}function QP(e,t,n){let i=0;return s;function s(m){return e.enter("atxHeading"),l(m)}function l(m){return e.enter("atxHeadingSequence"),a(m)}function a(m){return m===35&&i++<6?(e.consume(m),a):m===null||Ye(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||Me(m)?(e.exit("atxHeading"),t(m)):Oe(m)?Ve(e,c,"whitespace")(m):(e.enter("atxHeadingText"),h(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),c(m))}function h(m){return m===null||m===35||Ye(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),h)}}const ZP=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ty=["pre","script","style","textarea"],JP={concrete:!0,name:"htmlFlow",resolveTo:nR,tokenize:rR},eR={partial:!0,tokenize:oR},tR={partial:!0,tokenize:iR};function nR(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function rR(e,t,n){const i=this;let s,l,a,c,d;return h;function h(R){return m(R)}function m(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),p}function p(R){return R===33?(e.consume(R),y):R===47?(e.consume(R),l=!0,C):R===63?(e.consume(R),s=3,i.interrupt?t:P):Ft(R)?(e.consume(R),a=String.fromCharCode(R),T):n(R)}function y(R){return R===45?(e.consume(R),s=2,w):R===91?(e.consume(R),s=5,c=0,k):Ft(R)?(e.consume(R),s=4,i.interrupt?t:P):n(R)}function w(R){return R===45?(e.consume(R),i.interrupt?t:P):n(R)}function k(R){const Z="CDATA[";return R===Z.charCodeAt(c++)?(e.consume(R),c===Z.length?i.interrupt?t:U:k):n(R)}function C(R){return Ft(R)?(e.consume(R),a=String.fromCharCode(R),T):n(R)}function T(R){if(R===null||R===47||R===62||Ye(R)){const Z=R===47,de=a.toLowerCase();return!Z&&!l&&ty.includes(de)?(s=1,i.interrupt?t(R):U(R)):ZP.includes(a.toLowerCase())?(s=6,Z?(e.consume(R),E):i.interrupt?t(R):U(R)):(s=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(R):l?A(R):M(R))}return R===45||Nt(R)?(e.consume(R),a+=String.fromCharCode(R),T):n(R)}function E(R){return R===62?(e.consume(R),i.interrupt?t:U):n(R)}function A(R){return Oe(R)?(e.consume(R),A):j(R)}function M(R){return R===47?(e.consume(R),j):R===58||R===95||Ft(R)?(e.consume(R),_):Oe(R)?(e.consume(R),M):j(R)}function _(R){return R===45||R===46||R===58||R===95||Nt(R)?(e.consume(R),_):W(R)}function W(R){return R===61?(e.consume(R),D):Oe(R)?(e.consume(R),W):M(R)}function D(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),d=R,Y):Oe(R)?(e.consume(R),D):H(R)}function Y(R){return R===d?(e.consume(R),d=null,X):R===null||Me(R)?n(R):(e.consume(R),Y)}function H(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||Ye(R)?W(R):(e.consume(R),H)}function X(R){return R===47||R===62||Oe(R)?M(R):n(R)}function j(R){return R===62?(e.consume(R),G):n(R)}function G(R){return R===null||Me(R)?U(R):Oe(R)?(e.consume(R),G):n(R)}function U(R){return R===45&&s===2?(e.consume(R),xe):R===60&&s===1?(e.consume(R),Ee):R===62&&s===4?(e.consume(R),L):R===63&&s===3?(e.consume(R),P):R===93&&s===5?(e.consume(R),le):Me(R)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(eR,Q,fe)(R)):R===null||Me(R)?(e.exit("htmlFlowData"),fe(R)):(e.consume(R),U)}function fe(R){return e.check(tR,se,Q)(R)}function se(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),ee}function ee(R){return R===null||Me(R)?fe(R):(e.enter("htmlFlowData"),U(R))}function xe(R){return R===45?(e.consume(R),P):U(R)}function Ee(R){return R===47?(e.consume(R),a="",q):U(R)}function q(R){if(R===62){const Z=a.toLowerCase();return ty.includes(Z)?(e.consume(R),L):U(R)}return Ft(R)&&a.length<8?(e.consume(R),a+=String.fromCharCode(R),q):U(R)}function le(R){return R===93?(e.consume(R),P):U(R)}function P(R){return R===62?(e.consume(R),L):R===45&&s===2?(e.consume(R),P):U(R)}function L(R){return R===null||Me(R)?(e.exit("htmlFlowData"),Q(R)):(e.consume(R),L)}function Q(R){return e.exit("htmlFlow"),t(R)}}function iR(e,t,n){const i=this;return s;function s(a){return Me(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l):n(a)}function l(a){return i.parser.lazy[i.now().line]?n(a):t(a)}}function oR(e,t,n){return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Ss,t,n)}}const sR={name:"htmlText",tokenize:aR};function aR(e,t,n){const i=this;let s,l,a;return c;function c(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),d}function d(P){return P===33?(e.consume(P),h):P===47?(e.consume(P),W):P===63?(e.consume(P),M):Ft(P)?(e.consume(P),H):n(P)}function h(P){return P===45?(e.consume(P),m):P===91?(e.consume(P),l=0,k):Ft(P)?(e.consume(P),A):n(P)}function m(P){return P===45?(e.consume(P),w):n(P)}function p(P){return P===null?n(P):P===45?(e.consume(P),y):Me(P)?(a=p,Ee(P)):(e.consume(P),p)}function y(P){return P===45?(e.consume(P),w):p(P)}function w(P){return P===62?xe(P):P===45?y(P):p(P)}function k(P){const L="CDATA[";return P===L.charCodeAt(l++)?(e.consume(P),l===L.length?C:k):n(P)}function C(P){return P===null?n(P):P===93?(e.consume(P),T):Me(P)?(a=C,Ee(P)):(e.consume(P),C)}function T(P){return P===93?(e.consume(P),E):C(P)}function E(P){return P===62?xe(P):P===93?(e.consume(P),E):C(P)}function A(P){return P===null||P===62?xe(P):Me(P)?(a=A,Ee(P)):(e.consume(P),A)}function M(P){return P===null?n(P):P===63?(e.consume(P),_):Me(P)?(a=M,Ee(P)):(e.consume(P),M)}function _(P){return P===62?xe(P):M(P)}function W(P){return Ft(P)?(e.consume(P),D):n(P)}function D(P){return P===45||Nt(P)?(e.consume(P),D):Y(P)}function Y(P){return Me(P)?(a=Y,Ee(P)):Oe(P)?(e.consume(P),Y):xe(P)}function H(P){return P===45||Nt(P)?(e.consume(P),H):P===47||P===62||Ye(P)?X(P):n(P)}function X(P){return P===47?(e.consume(P),xe):P===58||P===95||Ft(P)?(e.consume(P),j):Me(P)?(a=X,Ee(P)):Oe(P)?(e.consume(P),X):xe(P)}function j(P){return P===45||P===46||P===58||P===95||Nt(P)?(e.consume(P),j):G(P)}function G(P){return P===61?(e.consume(P),U):Me(P)?(a=G,Ee(P)):Oe(P)?(e.consume(P),G):X(P)}function U(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),s=P,fe):Me(P)?(a=U,Ee(P)):Oe(P)?(e.consume(P),U):(e.consume(P),se)}function fe(P){return P===s?(e.consume(P),s=void 0,ee):P===null?n(P):Me(P)?(a=fe,Ee(P)):(e.consume(P),fe)}function se(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||Ye(P)?X(P):(e.consume(P),se)}function ee(P){return P===47||P===62||Ye(P)?X(P):n(P)}function xe(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function Ee(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),q}function q(P){return Oe(P)?Ve(e,le,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):le(P)}function le(P){return e.enter("htmlTextData"),a(P)}}const _d={name:"labelEnd",resolveAll:fR,resolveTo:dR,tokenize:hR},lR={tokenize:pR},uR={tokenize:mR},cR={tokenize:gR};function fR(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const s=i.type==="labelImage"?4:2;i.type="data",t+=s}}return e.length!==n.length&&on(e,0,e.length,n),e}function dR(e,t){let n=e.length,i=0,s,l,a,c;for(;n--;)if(s=e[n][1],l){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(l=n,s.type!=="labelLink")){i=2;break}}else s.type==="labelEnd"&&(a=n);const d={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[l][1].start},end:{...e[a][1].end}},m={type:"labelText",start:{...e[l+i+2][1].end},end:{...e[a-2][1].start}};return c=[["enter",d,t],["enter",h,t]],c=mn(c,e.slice(l+1,l+i+3)),c=mn(c,[["enter",m,t]]),c=mn(c,Ll(t.parser.constructs.insideSpan.null,e.slice(l+i+4,a-3),t)),c=mn(c,[["exit",m,t],e[a-2],e[a-1],["exit",h,t]]),c=mn(c,e.slice(a+1)),c=mn(c,[["exit",d,t]]),on(e,l,e.length,c),e}function hR(e,t,n){const i=this;let s=i.events.length,l,a;for(;s--;)if((i.events[s][1].type==="labelImage"||i.events[s][1].type==="labelLink")&&!i.events[s][1]._balanced){l=i.events[s][1];break}return c;function c(y){return l?l._inactive?p(y):(a=i.parser.defined.includes(Mn(i.sliceSerialize({start:l.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(lR,m,a?m:p)(y):y===91?e.attempt(uR,m,a?h:p)(y):a?m(y):p(y)}function h(y){return e.attempt(cR,m,p)(y)}function m(y){return t(y)}function p(y){return l._balanced=!0,n(y)}}function pR(e,t,n){return i;function i(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),s}function s(p){return Ye(p)?es(e,l)(p):l(p)}function l(p){return p===41?m(p):iw(e,a,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function a(p){return Ye(p)?es(e,d)(p):m(p)}function c(p){return n(p)}function d(p){return p===34||p===39||p===40?sw(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function h(p){return Ye(p)?es(e,m)(p):m(p)}function m(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function mR(e,t,n){const i=this;return s;function s(c){return ow.call(i,e,l,a,"reference","referenceMarker","referenceString")(c)}function l(c){return i.parser.defined.includes(Mn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function a(c){return n(c)}}function gR(e,t,n){return i;function i(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),s}function s(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const yR={name:"labelStartImage",resolveAll:_d.resolveAll,tokenize:vR};function vR(e,t,n){const i=this;return s;function s(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),l}function l(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),a):n(c)}function a(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(c):t(c)}}const xR={name:"labelStartLink",resolveAll:_d.resolveAll,tokenize:wR};function wR(e,t,n){const i=this;return s;function s(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),l}function l(a){return a===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(a):t(a)}}const zc={name:"lineEnding",tokenize:kR};function kR(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Ve(e,t,"linePrefix")}}const el={name:"thematicBreak",tokenize:SR};function SR(e,t,n){let i=0,s;return l;function l(h){return e.enter("thematicBreak"),a(h)}function a(h){return s=h,c(h)}function c(h){return h===s?(e.enter("thematicBreakSequence"),d(h)):i>=3&&(h===null||Me(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===s?(e.consume(h),i++,d):(e.exit("thematicBreakSequence"),Oe(h)?Ve(e,c,"whitespace")(h):c(h))}}const Yt={continuation:{tokenize:TR},exit:RR,name:"list",tokenize:ER},bR={partial:!0,tokenize:MR},CR={partial:!0,tokenize:PR};function ER(e,t,n){const i=this,s=i.events[i.events.length-1];let l=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return c;function c(w){const k=i.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!i.containerState.marker||w===i.containerState.marker:Rf(w)){if(i.containerState.type||(i.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(el,n,h)(w):h(w);if(!i.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(w)}return n(w)}function d(w){return Rf(w)&&++a<10?(e.consume(w),d):(!i.interrupt||a<2)&&(i.containerState.marker?w===i.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),h(w)):n(w)}function h(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||w,e.check(Ss,i.interrupt?n:m,e.attempt(bR,y,p))}function m(w){return i.containerState.initialBlankLine=!0,l++,y(w)}function p(w){return Oe(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),y):n(w)}function y(w){return i.containerState.size=l+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function TR(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Ss,s,l);function s(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Ve(e,t,"listItemIndent",i.containerState.size+1)(c)}function l(c){return i.containerState.furtherBlankLines||!Oe(c)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,a(c)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(CR,t,a)(c))}function a(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,Ve(e,e.attempt(Yt,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function PR(e,t,n){const i=this;return Ve(e,s,"listItemIndent",i.containerState.size+1);function s(l){const a=i.events[i.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===i.containerState.size?t(l):n(l)}}function RR(e){e.exit(this.containerState.type)}function MR(e,t,n){const i=this;return Ve(e,s,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(l){const a=i.events[i.events.length-1];return!Oe(l)&&a&&a[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const ny={name:"setextUnderline",resolveTo:AR,tokenize:NR};function AR(e,t){let n=e.length,i,s,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const a={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",l?(e.splice(s,0,["enter",a,t]),e.splice(l+1,0,["exit",e[i][1],t]),e[i][1].end={...e[l][1].end}):e[i][1]=a,e.push(["exit",a,t]),e}function NR(e,t,n){const i=this;let s;return l;function l(h){let m=i.events.length,p;for(;m--;)if(i.events[m][1].type!=="lineEnding"&&i.events[m][1].type!=="linePrefix"&&i.events[m][1].type!=="content"){p=i.events[m][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||p)?(e.enter("setextHeadingLine"),s=h,a(h)):n(h)}function a(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===s?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),Oe(h)?Ve(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Me(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const jR={tokenize:DR};function DR(e){const t=this,n=e.attempt(Ss,i,e.attempt(this.parser.constructs.flowInitial,s,Ve(e,e.attempt(this.parser.constructs.flow,s,e.attempt(FP,s)),"linePrefix")));return n;function i(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const IR={resolveAll:lw()},LR=aw("string"),_R=aw("text");function aw(e){return{resolveAll:lw(e==="text"?OR:void 0),tokenize:t};function t(n){const i=this,s=this.parser.constructs[e],l=n.attempt(s,a,c);return a;function a(m){return h(m)?l(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return h(m)?(n.exit("data"),l(m)):(n.consume(m),d)}function h(m){if(m===null)return!0;const p=s[m];let y=-1;if(p)for(;++y<p.length;){const w=p[y];if(!w.previous||w.previous.call(i,i.previous))return!0}return!1}}}function lw(e){return t;function t(n,i){let s=-1,l;for(;++s<=n.length;)l===void 0?n[s]&&n[s][1].type==="data"&&(l=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==l+2&&(n[l][1].end=n[s-1][1].end,n.splice(l+2,s-l-2),s=l+2),l=void 0);return e?e(n,i):n}}function OR(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],s=t.sliceStream(i);let l=s.length,a=-1,c=0,d;for(;l--;){const h=s[l];if(typeof h=="string"){for(a=h.length;h.charCodeAt(a-1)===32;)c++,a--;if(a)break;a=-1}else if(h===-2)d=!0,c++;else if(h!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const h={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?a:i.start._bufferIndex+a,_index:i.start._index+l,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const FR={42:Yt,43:Yt,45:Yt,48:Yt,49:Yt,50:Yt,51:Yt,52:Yt,53:Yt,54:Yt,55:Yt,56:Yt,57:Yt,62:ew},zR={91:$P},VR={[-2]:Fc,[-1]:Fc,32:Fc},BR={35:YP,42:el,45:[ny,el],60:JP,61:ny,95:el,96:ey,126:ey},UR={38:nw,92:tw},$R={[-5]:zc,[-4]:zc,[-3]:zc,33:yR,38:nw,42:Af,60:[xP,sR],91:xR,92:[qP,tw],93:_d,95:Af,96:jP},WR={null:[Af,IR]},HR={null:[42,95]},KR={null:[]},qR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:HR,contentInitial:zR,disable:KR,document:FR,flow:BR,flowInitial:VR,insideSpan:WR,string:UR,text:$R},Symbol.toStringTag,{value:"Module"}));function XR(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},l=[];let a=[],c=[];const d={attempt:Y(W),check:Y(D),consume:A,enter:M,exit:_,interrupt:Y(D,{interrupt:!0})},h={code:null,containerState:{},defineSkip:C,events:[],now:k,parser:e,previous:null,sliceSerialize:y,sliceStream:w,write:p};let m=t.tokenize.call(h,d);return t.resolveAll&&l.push(t),h;function p(G){return a=mn(a,G),T(),a[a.length-1]!==null?[]:(H(t,0),h.events=Ll(l,h.events,h),h.events)}function y(G,U){return GR(w(G),U)}function w(G){return YR(a,G)}function k(){const{_bufferIndex:G,_index:U,line:fe,column:se,offset:ee}=i;return{_bufferIndex:G,_index:U,line:fe,column:se,offset:ee}}function C(G){s[G.line]=G.column,j()}function T(){let G;for(;i._index<a.length;){const U=a[i._index];if(typeof U=="string")for(G=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===G&&i._bufferIndex<U.length;)E(U.charCodeAt(i._bufferIndex));else E(U)}}function E(G){m=m(G)}function A(G){Me(G)?(i.line++,i.column=1,i.offset+=G===-3?2:1,j()):G!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===a[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=G}function M(G,U){const fe=U||{};return fe.type=G,fe.start=k(),h.events.push(["enter",fe,h]),c.push(fe),fe}function _(G){const U=c.pop();return U.end=k(),h.events.push(["exit",U,h]),U}function W(G,U){H(G,U.from)}function D(G,U){U.restore()}function Y(G,U){return fe;function fe(se,ee,xe){let Ee,q,le,P;return Array.isArray(se)?Q(se):"tokenize"in se?Q([se]):L(se);function L(ie){return Ce;function Ce(ge){const Te=ge!==null&&ie[ge],je=ge!==null&&ie.null,$e=[...Array.isArray(Te)?Te:Te?[Te]:[],...Array.isArray(je)?je:je?[je]:[]];return Q($e)(ge)}}function Q(ie){return Ee=ie,q=0,ie.length===0?xe:R(ie[q])}function R(ie){return Ce;function Ce(ge){return P=X(),le=ie,ie.partial||(h.currentConstruct=ie),ie.name&&h.parser.constructs.disable.null.includes(ie.name)?de():ie.tokenize.call(U?Object.assign(Object.create(h),U):h,d,Z,de)(ge)}}function Z(ie){return G(le,P),ee}function de(ie){return P.restore(),++q<Ee.length?R(Ee[q]):xe}}}function H(G,U){G.resolveAll&&!l.includes(G)&&l.push(G),G.resolve&&on(h.events,U,h.events.length-U,G.resolve(h.events.slice(U),h)),G.resolveTo&&(h.events=G.resolveTo(h.events,h))}function X(){const G=k(),U=h.previous,fe=h.currentConstruct,se=h.events.length,ee=Array.from(c);return{from:se,restore:xe};function xe(){i=G,h.previous=U,h.currentConstruct=fe,h.events.length=se,c=ee,j()}}function j(){i.line in s&&i.column<2&&(i.column=s[i.line],i.offset+=s[i.line]-1)}}function YR(e,t){const n=t.start._index,i=t.start._bufferIndex,s=t.end._index,l=t.end._bufferIndex;let a;if(n===s)a=[e[n].slice(i,l)];else{if(a=e.slice(n,s),i>-1){const c=a[0];typeof c=="string"?a[0]=c.slice(i):a.shift()}l>0&&a.push(e[s].slice(0,l))}return a}function GR(e,t){let n=-1;const i=[];let s;for(;++n<e.length;){const l=e[n];let a;if(typeof l=="string")a=l;else switch(l){case-5:{a="\r";break}case-4:{a=`
251
- `;break}case-3:{a=`\r
252
- `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&s)continue;a=" ";break}default:a=String.fromCharCode(l)}s=l===-2,i.push(a)}return i.join("")}function QR(e){const i={constructs:Jx([qR,...(e||{}).extensions||[]]),content:s(dP),defined:[],document:s(pP),flow:s(jR),lazy:{},string:s(LR),text:s(_R)};return i;function s(l){return a;function a(c){return XR(i,l,c)}}}function ZR(e){for(;!rw(e););return e}const ry=/[\0\t\n\r]/g;function JR(){let e=1,t="",n=!0,i;return s;function s(l,a,c){const d=[];let h,m,p,y,w;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(a||void 0).decode(l)),p=0,t="",n&&(l.charCodeAt(0)===65279&&p++,n=void 0);p<l.length;){if(ry.lastIndex=p,h=ry.exec(l),y=h&&h.index!==void 0?h.index:l.length,w=l.charCodeAt(y),!h){t=l.slice(p);break}if(w===10&&p===y&&i)d.push(-3),i=void 0;else switch(i&&(d.push(-5),i=void 0),p<y&&(d.push(l.slice(p,y)),e+=y-p),w){case 0:{d.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,d.push(-2);e++<m;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:i=!0,e=1}p=y+1}return c&&(i&&d.push(-5),t&&d.push(t),d.push(null)),d}}function ts(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?iy(e.position):"start"in e||"end"in e?iy(e):"line"in e||"column"in e?Nf(e):""}function Nf(e){return oy(e&&e.line)+":"+oy(e&&e.column)}function iy(e){return Nf(e&&e.start)+"-"+Nf(e&&e.end)}function oy(e){return e&&typeof e=="number"?e:1}const uw={}.hasOwnProperty;function cw(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),e2(n)(ZR(QR(n).document().write(JR()(e,t,!0))))}function e2(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Le),autolinkProtocol:X,autolinkEmail:X,atxHeading:l(Qt),blockQuote:l(je),characterEscape:X,characterReference:X,codeFenced:l($e),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:l($e,a),codeText:l(kt,a),codeTextData:X,data:X,codeFlowValue:X,definition:l(gt),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:l(Dt),hardBreakEscape:l(Ut),hardBreakTrailing:l(Ut),htmlFlow:l(it,a),htmlFlowData:X,htmlText:l(it,a),htmlTextData:X,image:l(It),label:a,link:l(Le),listItem:l(Lt),listItemValue:y,listOrdered:l(an,p),listUnordered:l(an),paragraph:l(jn),reference:R,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:l(Qt),strong:l(ln),thematicBreak:l(he)},exit:{atxHeading:d(),atxHeadingSequence:W,autolink:d(),autolinkEmail:Te,autolinkProtocol:ge,blockQuote:d(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:ie,characterReference:Ce,codeFenced:d(T),codeFencedFence:C,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:j,codeIndented:d(E),codeText:d(ee),codeTextData:j,data:j,definition:d(),definitionDestinationString:_,definitionLabelString:A,definitionTitleString:M,emphasis:d(),hardBreakEscape:d(U),hardBreakTrailing:d(U),htmlFlow:d(fe),htmlFlowData:j,htmlText:d(se),htmlTextData:j,image:d(Ee),label:le,labelText:q,lineEnding:G,link:d(xe),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:Z,resourceDestinationString:P,resourceTitleString:L,resource:Q,setextHeading:d(H),setextHeadingLineSequence:Y,setextHeadingText:D,strong:d(),thematicBreak:d()}};fw(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(V){let J={type:"root",children:[]};const F={stack:[J],tokenStack:[],config:t,enter:c,exit:h,buffer:a,resume:m,data:n},oe=[];let te=-1;for(;++te<V.length;)if(V[te][1].type==="listOrdered"||V[te][1].type==="listUnordered")if(V[te][0]==="enter")oe.push(te);else{const Ae=oe.pop();te=s(V,Ae,te)}for(te=-1;++te<V.length;){const Ae=t[V[te][0]];uw.call(Ae,V[te][1].type)&&Ae[V[te][1].type].call(Object.assign({sliceSerialize:V[te][2].sliceSerialize},F),V[te][1])}if(F.tokenStack.length>0){const Ae=F.tokenStack[F.tokenStack.length-1];(Ae[1]||sy).call(F,void 0,Ae[0])}for(J.position={start:br(V.length>0?V[0][1].start:{line:1,column:1,offset:0}),end:br(V.length>0?V[V.length-2][1].end:{line:1,column:1,offset:0})},te=-1;++te<t.transforms.length;)J=t.transforms[te](J)||J;return J}function s(V,J,F){let oe=J-1,te=-1,Ae=!1,Fe,pe,Ie,Tt;for(;++oe<=F;){const ot=V[oe];switch(ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ot[0]==="enter"?te++:te--,Tt=void 0;break}case"lineEndingBlank":{ot[0]==="enter"&&(Fe&&!Tt&&!te&&!Ie&&(Ie=oe),Tt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Tt=void 0}if(!te&&ot[0]==="enter"&&ot[1].type==="listItemPrefix"||te===-1&&ot[0]==="exit"&&(ot[1].type==="listUnordered"||ot[1].type==="listOrdered")){if(Fe){let Ze=oe;for(pe=void 0;Ze--;){const We=V[Ze];if(We[1].type==="lineEnding"||We[1].type==="lineEndingBlank"){if(We[0]==="exit")continue;pe&&(V[pe][1].type="lineEndingBlank",Ae=!0),We[1].type="lineEnding",pe=Ze}else if(!(We[1].type==="linePrefix"||We[1].type==="blockQuotePrefix"||We[1].type==="blockQuotePrefixWhitespace"||We[1].type==="blockQuoteMarker"||We[1].type==="listItemIndent"))break}Ie&&(!pe||Ie<pe)&&(Fe._spread=!0),Fe.end=Object.assign({},pe?V[pe][1].start:ot[1].end),V.splice(pe||oe,0,["exit",Fe,ot[2]]),oe++,F++}if(ot[1].type==="listItemPrefix"){const Ze={type:"listItem",_spread:!1,start:Object.assign({},ot[1].start),end:void 0};Fe=Ze,V.splice(oe,0,["enter",Ze,ot[2]]),oe++,F++,Ie=void 0,Tt=!0}}}return V[J][1]._spread=Ae,F}function l(V,J){return F;function F(oe){c.call(this,V(oe),oe),J&&J.call(this,oe)}}function a(){this.stack.push({type:"fragment",children:[]})}function c(V,J,F){this.stack[this.stack.length-1].children.push(V),this.stack.push(V),this.tokenStack.push([J,F||void 0]),V.position={start:br(J.start),end:void 0}}function d(V){return J;function J(F){V&&V.call(this,F),h.call(this,F)}}function h(V,J){const F=this.stack.pop(),oe=this.tokenStack.pop();if(oe)oe[0].type!==V.type&&(J?J.call(this,V,oe[0]):(oe[1]||sy).call(this,V,oe[0]));else throw new Error("Cannot close `"+V.type+"` ("+ts({start:V.start,end:V.end})+"): it’s not open");F.position.end=br(V.end)}function m(){return Dd(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function y(V){if(this.data.expectingFirstListItemValue){const J=this.stack[this.stack.length-2];J.start=Number.parseInt(this.sliceSerialize(V),10),this.data.expectingFirstListItemValue=void 0}}function w(){const V=this.resume(),J=this.stack[this.stack.length-1];J.lang=V}function k(){const V=this.resume(),J=this.stack[this.stack.length-1];J.meta=V}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const V=this.resume(),J=this.stack[this.stack.length-1];J.value=V.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const V=this.resume(),J=this.stack[this.stack.length-1];J.value=V.replace(/(\r?\n|\r)$/g,"")}function A(V){const J=this.resume(),F=this.stack[this.stack.length-1];F.label=J,F.identifier=Mn(this.sliceSerialize(V)).toLowerCase()}function M(){const V=this.resume(),J=this.stack[this.stack.length-1];J.title=V}function _(){const V=this.resume(),J=this.stack[this.stack.length-1];J.url=V}function W(V){const J=this.stack[this.stack.length-1];if(!J.depth){const F=this.sliceSerialize(V).length;J.depth=F}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function Y(V){const J=this.stack[this.stack.length-1];J.depth=this.sliceSerialize(V).codePointAt(0)===61?1:2}function H(){this.data.setextHeadingSlurpLineEnding=void 0}function X(V){const F=this.stack[this.stack.length-1].children;let oe=F[F.length-1];(!oe||oe.type!=="text")&&(oe=z(),oe.position={start:br(V.start),end:void 0},F.push(oe)),this.stack.push(oe)}function j(V){const J=this.stack.pop();J.value+=this.sliceSerialize(V),J.position.end=br(V.end)}function G(V){const J=this.stack[this.stack.length-1];if(this.data.atHardBreak){const F=J.children[J.children.length-1];F.position.end=br(V.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(J.type)&&(X.call(this,V),j.call(this,V))}function U(){this.data.atHardBreak=!0}function fe(){const V=this.resume(),J=this.stack[this.stack.length-1];J.value=V}function se(){const V=this.resume(),J=this.stack[this.stack.length-1];J.value=V}function ee(){const V=this.resume(),J=this.stack[this.stack.length-1];J.value=V}function xe(){const V=this.stack[this.stack.length-1];if(this.data.inReference){const J=this.data.referenceType||"shortcut";V.type+="Reference",V.referenceType=J,delete V.url,delete V.title}else delete V.identifier,delete V.label;this.data.referenceType=void 0}function Ee(){const V=this.stack[this.stack.length-1];if(this.data.inReference){const J=this.data.referenceType||"shortcut";V.type+="Reference",V.referenceType=J,delete V.url,delete V.title}else delete V.identifier,delete V.label;this.data.referenceType=void 0}function q(V){const J=this.sliceSerialize(V),F=this.stack[this.stack.length-2];F.label=GT(J),F.identifier=Mn(J).toLowerCase()}function le(){const V=this.stack[this.stack.length-1],J=this.resume(),F=this.stack[this.stack.length-1];if(this.data.inReference=!0,F.type==="link"){const oe=V.children;F.children=oe}else F.alt=J}function P(){const V=this.resume(),J=this.stack[this.stack.length-1];J.url=V}function L(){const V=this.resume(),J=this.stack[this.stack.length-1];J.title=V}function Q(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function Z(V){const J=this.resume(),F=this.stack[this.stack.length-1];F.label=J,F.identifier=Mn(this.sliceSerialize(V)).toLowerCase(),this.data.referenceType="full"}function de(V){this.data.characterReferenceType=V.type}function ie(V){const J=this.sliceSerialize(V),F=this.data.characterReferenceType;let oe;F?(oe=Qx(J,F==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):oe=Ld(J);const te=this.stack[this.stack.length-1];te.value+=oe}function Ce(V){const J=this.stack.pop();J.position.end=br(V.end)}function ge(V){j.call(this,V);const J=this.stack[this.stack.length-1];J.url=this.sliceSerialize(V)}function Te(V){j.call(this,V);const J=this.stack[this.stack.length-1];J.url="mailto:"+this.sliceSerialize(V)}function je(){return{type:"blockquote",children:[]}}function $e(){return{type:"code",lang:null,meta:null,value:""}}function kt(){return{type:"inlineCode",value:""}}function gt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Dt(){return{type:"emphasis",children:[]}}function Qt(){return{type:"heading",depth:0,children:[]}}function Ut(){return{type:"break"}}function it(){return{type:"html",value:""}}function It(){return{type:"image",title:null,url:"",alt:null}}function Le(){return{type:"link",title:null,url:"",children:[]}}function an(V){return{type:"list",ordered:V.type==="listOrdered",start:null,spread:V._spread,children:[]}}function Lt(V){return{type:"listItem",spread:V._spread,checked:null,children:[]}}function jn(){return{type:"paragraph",children:[]}}function ln(){return{type:"strong",children:[]}}function z(){return{type:"text",value:""}}function he(){return{type:"thematicBreak"}}}function br(e){return{line:e.line,column:e.column,offset:e.offset}}function fw(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?fw(e,i):t2(e,i)}}function t2(e,t){let n;for(n in t)if(uw.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function sy(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ts({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ts({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ts({start:t.start,end:t.end})+") is still open")}const n2={tokenize:l2,partial:!0},dw={tokenize:u2,partial:!0},hw={tokenize:c2,partial:!0},pw={tokenize:f2,partial:!0},r2={tokenize:d2,partial:!0},mw={name:"wwwAutolink",tokenize:s2,previous:yw},gw={name:"protocolAutolink",tokenize:a2,previous:vw},rr={name:"emailAutolink",tokenize:o2,previous:xw},Wn={};function i2(){return{text:Wn}}let Xr=48;for(;Xr<123;)Wn[Xr]=rr,Xr++,Xr===58?Xr=65:Xr===91&&(Xr=97);Wn[43]=rr;Wn[45]=rr;Wn[46]=rr;Wn[95]=rr;Wn[72]=[rr,gw];Wn[104]=[rr,gw];Wn[87]=[rr,mw];Wn[119]=[rr,mw];function o2(e,t,n){const i=this;let s,l;return a;function a(p){return!jf(p)||!xw.call(i,i.previous)||Od(i.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(p))}function c(p){return jf(p)?(e.consume(p),c):p===64?(e.consume(p),d):n(p)}function d(p){return p===46?e.check(r2,m,h)(p):p===45||p===95||Nt(p)?(l=!0,e.consume(p),d):m(p)}function h(p){return e.consume(p),s=!0,d}function m(p){return l&&s&&Ft(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function s2(e,t,n){const i=this;return s;function s(a){return a!==87&&a!==119||!yw.call(i,i.previous)||Od(i.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(n2,e.attempt(dw,e.attempt(hw,l),n),n)(a))}function l(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function a2(e,t,n){const i=this;let s="",l=!1;return a;function a(p){return(p===72||p===104)&&vw.call(i,i.previous)&&!Od(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),c):n(p)}function c(p){if(Ft(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),c;if(p===58){const y=s.toLowerCase();if(y==="http"||y==="https")return e.consume(p),d}return n(p)}function d(p){return p===47?(e.consume(p),l?h:(l=!0,d)):n(p)}function h(p){return p===null||ml(p)||Ye(p)||si(p)||jl(p)?n(p):e.attempt(dw,e.attempt(hw,m),n)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function l2(e,t,n){let i=0;return s;function s(a){return(a===87||a===119)&&i<3?(i++,e.consume(a),s):a===46&&i===3?(e.consume(a),l):n(a)}function l(a){return a===null?n(a):t(a)}}function u2(e,t,n){let i,s,l;return a;function a(h){return h===46||h===95?e.check(pw,d,c)(h):h===null||Ye(h)||si(h)||h!==45&&jl(h)?d(h):(l=!0,e.consume(h),a)}function c(h){return h===95?i=!0:(s=i,i=void 0),e.consume(h),a}function d(h){return s||i||!l?n(h):t(h)}}function c2(e,t){let n=0,i=0;return s;function s(a){return a===40?(n++,e.consume(a),s):a===41&&i<n?l(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(pw,t,l)(a):a===null||Ye(a)||si(a)?t(a):(e.consume(a),s)}function l(a){return a===41&&i++,e.consume(a),s}}function f2(e,t,n){return i;function i(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),i):c===38?(e.consume(c),l):c===93?(e.consume(c),s):c===60||c===null||Ye(c)||si(c)?t(c):n(c)}function s(c){return c===null||c===40||c===91||Ye(c)||si(c)?t(c):i(c)}function l(c){return Ft(c)?a(c):n(c)}function a(c){return c===59?(e.consume(c),i):Ft(c)?(e.consume(c),a):n(c)}}function d2(e,t,n){return i;function i(l){return e.consume(l),s}function s(l){return Nt(l)?n(l):t(l)}}function yw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ye(e)}function vw(e){return!Ft(e)}function xw(e){return!(e===47||jf(e))}function jf(e){return e===43||e===45||e===46||e===95||Nt(e)}function Od(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const h2={tokenize:k2,partial:!0};function p2(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:v2,continuation:{tokenize:x2},exit:w2}},text:{91:{name:"gfmFootnoteCall",tokenize:y2},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:m2,resolveTo:g2}}}}function m2(e,t,n){const i=this;let s=i.events.length;const l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a;for(;s--;){const d=i.events[s][1];if(d.type==="labelImage"){a=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!a||!a._balanced)return n(d);const h=Mn(i.sliceSerialize({start:a.end,end:i.now()}));return h.codePointAt(0)!==94||!l.includes(h.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function g2(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},c=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",l,t],["enter",a,t],["exit",a,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...c),e}function y2(e,t,n){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l=0,a;return c;function c(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),d}function d(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(p){if(l>999||p===93&&!a||p===null||p===91||Ye(p))return n(p);if(p===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return s.includes(Mn(i.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return Ye(p)||(a=!0),l++,e.consume(p),p===92?m:h}function m(p){return p===91||p===92||p===93?(e.consume(p),l++,h):h(p)}}function v2(e,t,n){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l,a=0,c;return d;function d(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(k)}function m(k){if(a>999||k===93&&!c||k===null||k===91||Ye(k))return n(k);if(k===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return l=Mn(i.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Ye(k)||(c=!0),a++,e.consume(k),k===92?p:m}function p(k){return k===91||k===92||k===93?(e.consume(k),a++,m):m(k)}function y(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),s.includes(l)||s.push(l),Ve(e,w,"gfmFootnoteDefinitionWhitespace")):n(k)}function w(k){return t(k)}}function x2(e,t,n){return e.check(Ss,t,e.attempt(h2,t,n))}function w2(e){e.exit("gfmFootnoteDefinition")}function k2(e,t,n){const i=this;return Ve(e,s,"gfmFootnoteDefinitionIndent",5);function s(l){const a=i.events[i.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(l):n(l)}}function S2(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:l,resolveAll:s};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function s(a,c){let d=-1;for(;++d<a.length;)if(a[d][0]==="enter"&&a[d][1].type==="strikethroughSequenceTemporary"&&a[d][1]._close){let h=d;for(;h--;)if(a[h][0]==="exit"&&a[h][1].type==="strikethroughSequenceTemporary"&&a[h][1]._open&&a[d][1].end.offset-a[d][1].start.offset===a[h][1].end.offset-a[h][1].start.offset){a[d][1].type="strikethroughSequence",a[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},a[h][1].start),end:Object.assign({},a[d][1].end)},p={type:"strikethroughText",start:Object.assign({},a[h][1].end),end:Object.assign({},a[d][1].start)},y=[["enter",m,c],["enter",a[h][1],c],["exit",a[h][1],c],["enter",p,c]],w=c.parser.constructs.insideSpan.null;w&&on(y,y.length,0,Ll(w,a.slice(h+1,d),c)),on(y,y.length,0,[["exit",p,c],["enter",a[d][1],c],["exit",a[d][1],c],["exit",m,c]]),on(a,h-1,d-h+3,y),d=h+y.length-2;break}}for(d=-1;++d<a.length;)a[d][1].type==="strikethroughSequenceTemporary"&&(a[d][1].type="data");return a}function l(a,c,d){const h=this.previous,m=this.events;let p=0;return y;function y(k){return h===126&&m[m.length-1][1].type!=="characterEscape"?d(k):(a.enter("strikethroughSequenceTemporary"),w(k))}function w(k){const C=Xi(h);if(k===126)return p>1?d(k):(a.consume(k),p++,w);if(p<2&&!n)return d(k);const T=a.exit("strikethroughSequenceTemporary"),E=Xi(k);return T._open=!E||E===2&&!!C,T._close=!C||C===2&&!!E,c(k)}}}class b2{constructor(){this.map=[]}add(t,n,i){C2(this,t,n,i)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let s=i.pop();for(;s;){for(const l of s)t.push(l);s=i.pop()}this.map.length=0}}function C2(e,t,n,i){let s=0;if(!(n===0&&i.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...i);return}s+=1}e.map.push([t,n,i])}}function E2(e,t){let n=!1;const i=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=i.length-1;i[l]=i[l]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function T2(){return{flow:{null:{name:"table",tokenize:P2,resolveAll:R2}}}}function P2(e,t,n){const i=this;let s=0,l=0,a;return c;function c(j){let G=i.events.length-1;for(;G>-1;){const se=i.events[G][1].type;if(se==="lineEnding"||se==="linePrefix")G--;else break}const U=G>-1?i.events[G][1].type:null,fe=U==="tableHead"||U==="tableRow"?D:d;return fe===D&&i.parser.lazy[i.now().line]?n(j):fe(j)}function d(j){return e.enter("tableHead"),e.enter("tableRow"),h(j)}function h(j){return j===124||(a=!0,l+=1),m(j)}function m(j){return j===null?n(j):Me(j)?l>1?(l=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),w):n(j):Oe(j)?Ve(e,m,"whitespace")(j):(l+=1,a&&(a=!1,s+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),a=!0,m):(e.enter("data"),p(j)))}function p(j){return j===null||j===124||Ye(j)?(e.exit("data"),m(j)):(e.consume(j),j===92?y:p)}function y(j){return j===92||j===124?(e.consume(j),p):p(j)}function w(j){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(j):(e.enter("tableDelimiterRow"),a=!1,Oe(j)?Ve(e,k,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):k(j))}function k(j){return j===45||j===58?T(j):j===124?(a=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),C):W(j)}function C(j){return Oe(j)?Ve(e,T,"whitespace")(j):T(j)}function T(j){return j===58?(l+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),E):j===45?(l+=1,E(j)):j===null||Me(j)?_(j):W(j)}function E(j){return j===45?(e.enter("tableDelimiterFiller"),A(j)):W(j)}function A(j){return j===45?(e.consume(j),A):j===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),M):(e.exit("tableDelimiterFiller"),M(j))}function M(j){return Oe(j)?Ve(e,_,"whitespace")(j):_(j)}function _(j){return j===124?k(j):j===null||Me(j)?!a||s!==l?W(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):W(j)}function W(j){return n(j)}function D(j){return e.enter("tableRow"),Y(j)}function Y(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),Y):j===null||Me(j)?(e.exit("tableRow"),t(j)):Oe(j)?Ve(e,Y,"whitespace")(j):(e.enter("data"),H(j))}function H(j){return j===null||j===124||Ye(j)?(e.exit("data"),Y(j)):(e.consume(j),j===92?X:H)}function X(j){return j===92||j===124?(e.consume(j),H):H(j)}}function R2(e,t){let n=-1,i=!0,s=0,l=[0,0,0,0],a=[0,0,0,0],c=!1,d=0,h,m,p;const y=new b2;for(;++n<e.length;){const w=e[n],k=w[1];w[0]==="enter"?k.type==="tableHead"?(c=!1,d!==0&&(ay(y,t,d,h,m),m=void 0,d=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(i=!0,p=void 0,l=[0,0,0,0],a=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",m,t]])),s=k.type==="tableDelimiterRow"?2:m?3:1):s&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(i=!1,a[2]===0&&(l[1]!==0&&(a[0]=a[1],p=za(y,t,l,s,void 0,p),l=[0,0,0,0]),a[2]=n)):k.type==="tableCellDivider"&&(i?i=!1:(l[1]!==0&&(a[0]=a[1],p=za(y,t,l,s,void 0,p)),l=a,a=[l[1],n,0,0])):k.type==="tableHead"?(c=!0,d=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(d=n,l[1]!==0?(a[0]=a[1],p=za(y,t,l,s,n,p)):a[1]!==0&&(p=za(y,t,a,s,n,p)),s=0):s&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(a[3]=n)}for(d!==0&&ay(y,t,d,h,m),y.consume(t.events),n=-1;++n<t.events.length;){const w=t.events[n];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=E2(t.events,n))}return e}function za(e,t,n,i,s,l){const a=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(l.end=Object.assign({},Vi(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const d=Vi(t.events,n[1]);if(l={type:a,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const h=Vi(t.events,n[2]),m=Vi(t.events,n[3]),p={type:c,start:Object.assign({},h),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",p,t]]),i!==2){const y=t.events[n[2]],w=t.events[n[3]];if(y[1].end=Object.assign({},w[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,C=n[3]-n[2]-1;e.add(k,C,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return s!==void 0&&(l.end=Object.assign({},Vi(t.events,s)),e.add(s,0,[["exit",l,t]]),l=void 0),l}function ay(e,t,n,i,s){const l=[],a=Vi(t.events,n);s&&(s.end=Object.assign({},a),l.push(["exit",s,t])),i.end=Object.assign({},a),l.push(["exit",i,t]),e.add(n+1,0,l)}function Vi(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const M2={name:"tasklistCheck",tokenize:N2};function A2(){return{text:{91:M2}}}function N2(e,t,n){const i=this;return s;function s(d){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),l)}function l(d){return Ye(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),a):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),a):n(d)}function a(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return Me(d)?t(d):Oe(d)?e.check({tokenize:j2},t,n)(d):n(d)}}function j2(e,t,n){return Ve(e,i,"whitespace");function i(s){return s===null?n(s):t(s)}}function ww(e){return Jx([i2(),p2(),S2(e),T2(),A2()])}function kw(e){return typeof e=="string"&&/\.md$/i.test(e.trim())}function D2(e,t){const n=String(e??"").trim().split(/\r?\n/).map(s=>`> ${s}`).join(`
253
- `),i=String(t??"").trim();return n&&i?`${n}
254
-
255
- ${i}`:n||i}function I2(e){const t=String(e??""),n=t.lastIndexOf(".");return`${n>0?t.slice(0,n):t}_review.md`}function L2(e,t,n){const i=String(e??""),s=String(t??""),l=Math.max(0,Number(n)||0);if(!s)return 0;let a=0,c=0;for(;c<=i.length;){const d=i.indexOf(s,c);if(d<0||d>=l)return a;a+=1,c=d+Math.max(s.length,1)}return a}function _2(e){return(String(e??"").match(/https?:\/\/[^\s<>()\[\]{}"']+/gi)??[]).map(n=>n.replace(/[.,!?;:]+$/,""))}function Df(e){return e?.kind!=="file"?null:String(e.mime??"").toLowerCase().startsWith("image/")?"photo":"file"}function O2(e){const t=i=>{const s=Date.parse(String(i??""));return Number.isFinite(s)?s:0},n=new Map;for(const i of e??[]){const s=String(i?.message?.filename||"file"),l=n.get(s)??[];l.push(i),n.set(s,l)}return[...n.entries()].map(([i,s])=>({filename:i,versions:s.sort((l,a)=>t(a.message?.date)-t(l.message?.date))})).sort((i,s)=>t(s.versions[0]?.message?.date)-t(i.versions[0]?.message?.date))}const F2=new Set(["delete","emphasis","inlineCode","link","linkReference","strong"]);function z2(e){const t=cw(e,{extensions:[ww()],mdastExtensions:[Zx()]}),n=[],i=[],s=[],l=(c,d)=>{const h=String(c??""),m=d.position?.start?.offset,p=d.position?.end?.offset;if(!h||!Number.isInteger(m)||!Number.isInteger(p))return;const y=e.slice(m,p),w=y.indexOf(h);if(w>=0){for(let C=0;C<h.length;C+=1)n.push(h[C]),i.push(m+w+C+1);return}let k=0;for(const C of h){const T=y.indexOf(C,k),E=T>=0?T:Math.min(k,Math.max(y.length-1,0));n.push(C),i.push(m+E+1),k=E+1}},a=c=>{const d=n.length;if(c.type==="text"||c.type==="inlineCode"||c.type==="code")l(c.value,c);else for(const p of c.children??[])a(p);const h=n.length,m=c.position?.end?.offset;h>d&&F2.has(c.type)&&Number.isInteger(m)&&s.push({visibleEnd:h,rawEnd:m})};return a(t),{text:n.join(""),rawEnds:i,trailingRanges:s}}function V2(e,t,n){let i=-1,s=0;for(let l=0;l<=n;l+=1){if(i=e.indexOf(t,s),i<0)return-1;s=i+Math.max(t.length,1)}return i}function B2(e,t){const n=String(e??""),i=z2(n),s=new Map,l=[];for(const[d,h]of(t??[]).entries()){const m=String(h?.selection??"").trim(),p=String(h?.comment??"").trim().replace(/\s+/g," ").replace(/\]\]/g,"] ]");if(!p)continue;const y=`[[REVIEW COMMENT ${d+1}: ${p}]]`,w=Number.isInteger(h?.occurrence)&&h.occurrence>=0?h.occurrence:0,k=m?V2(i.text,m,w):-1,C=k+m.length;let T=k>=0?i.rawEnds[C-1]:void 0;if(!Number.isInteger(T)){l.push(`[[REVIEW COMMENT ${d+1} — ANCHOR NOT FOUND: ${p}]]`);continue}for(const A of i.trailingRanges)A.visibleEnd===C&&(T=Math.max(T,A.rawEnd));const E=s.get(T)??[];E.push(y),s.set(T,E)}let a=n;const c=[...s.keys()].sort((d,h)=>h-d);for(const d of c)a=`${a.slice(0,d)} ${s.get(d).join(" ")}${a.slice(d)}`;return l.length>0&&(a=`${a.trimEnd()}
256
-
257
- ${l.join(`
258
- `)}
259
- `),a}const U2=["default-src 'none'","script-src 'none'","connect-src 'none'","frame-src 'none'","child-src 'none'","object-src 'none'","worker-src 'none'","manifest-src 'none'","form-action 'none'","base-uri 'none'","img-src data: blob:","media-src data: blob:","font-src data:","style-src 'unsafe-inline'"].join("; "),$2="",W2="application/octet-stream",H2=/\.([A-Za-z0-9]{1,12})$/;function Sw(e){return String(e??"").split(";")[0].trim().toLowerCase()}function bw(e){const t=H2.exec(String(e??"").trim());return t?t[1].toLowerCase():""}function K2(e){const t=bw(e);return t==="html"||t==="htm"}function _l(e,t){return K2(e)?!0:bw(e)?!1:Sw(t)==="text/html"}function Fd(e,t){const n=Sw(e);return n==="text/html"||_l(t,e)?W2:n}const q2=[":root{color-scheme:light}","html{background:#fff}","body{margin:0;padding:24px;color:#0f172a;font:15px/1.65 ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;overflow-wrap:break-word}","img,video,svg,canvas,iframe{max-width:100%;height:auto}","pre{overflow:auto}","table{max-width:100%}"].join("");function X2(e){return["<!doctype html>","<html>","<head>",`<meta http-equiv="Content-Security-Policy" content="${U2}">`,'<meta charset="utf-8">','<meta name="referrer" content="no-referrer">','<meta name="viewport" content="width=device-width, initial-scale=1">',`<style>${q2}</style>`,"</head>","<body>",String(e??""),"</body>","</html>"].join(`
260
- `)}const If=48e3,Y2=Object.freeze([{rec:"audio/webm;codecs=opus",base:"audio/webm",ext:"webm"},{rec:"audio/ogg;codecs=opus",base:"audio/ogg",ext:"ogg"},{rec:"audio/webm",base:"audio/webm",ext:"webm"},{rec:"audio/mp4",base:"audio/mp4",ext:"m4a"}]),Cw="x-ours-duration",G2=4e3;function Q2(e){return!Number.isFinite(e)||e<=0?null:String(Math.round(e*100)/100)}function Z2(e,t){const n=t===null?null:Q2(t);return n===null?e:`${e};${Cw}=${n}`}function J2(e){if(!e)return null;const t=new RegExp(`${Cw}\\s*=\\s*([0-9]*\\.?[0-9]+)`,"i").exec(e);if(!t)return null;const n=Number(t[1]);return Number.isFinite(n)&&n>0?n:null}function eM(e,t=G2){return typeof Audio!="function"||typeof URL?.createObjectURL!="function"?Promise.resolve(null):new Promise(n=>{const i=URL.createObjectURL(e),s=new Audio;let l=!1;const a=d=>{l||(l=!0,clearTimeout(c),s.removeAttribute("src"),s.load(),URL.revokeObjectURL(i),n(Number.isFinite(d)&&(d??0)>0?d:null))},c=setTimeout(()=>a(null),t);s.addEventListener("loadedmetadata",()=>{Number.isFinite(s.duration)&&s.duration>0?a(s.duration):s.currentTime=Number.MAX_SAFE_INTEGER},{once:!0}),s.addEventListener("durationchange",()=>{Number.isFinite(s.duration)&&s.duration>0&&a(s.duration)}),s.addEventListener("error",()=>a(null),{once:!0}),s.preload="metadata",s.src=i})}const Ew=40,tM=44,Tw=.14,nM=.5,rM=e=>e<0?0:e>1?1:e;function Pw(e,{floor:t=Tw,gamma:n=nM}={}){const i=Math.pow(rM(Number.isFinite(e)?e:0),n);return t+(1-t)*i}function iM(e,t=Ew){const n=Math.max(1,Math.floor(t)),i=new Array(n).fill(0);if(!e||e.length===0)return i;const s=e.length/n;for(let l=0;l<n;l++){const a=Math.floor(l*s),c=Math.min(e.length,Math.max(a+1,Math.floor((l+1)*s)));let d=0;for(let h=a;h<c;h++)d+=e[h]*e[h];i[l]=Math.sqrt(d/(c-a))}return i}function oM(e,t={}){const{silenceFloor:n=1e-4}=t,i=e.reduce((s,l)=>l>s?l:s,0);return i>n?e.map(s=>Pw(s/i,t)):e.map(()=>Tw)}function sM({decay:e=.995,minReference:t=.02}={}){let n=t;return{push(i){const s=Number.isFinite(i)&&i>0?i:0;return n=Math.max(t,n*e,s),Pw(s/n)},get reference(){return n}}}function Rw(e){return Fd(e.mime,e.filename)}function zd(e){const[t,n]=S.useState({url:null,size:0,loaded:!1});return S.useEffect(()=>{let i=null,s=!1;n({url:null,size:0,loaded:!1});const l=e.available?mE(e.id):null;return l?(n({url:l,size:e.size,loaded:!0}),()=>{}):(Nl(e.id).then(a=>{if(s)return;if(!a){n({url:null,size:0,loaded:!0});return}const c=URL.createObjectURL(new Blob([a],{type:Rw(e)}));i=c,n({url:c,size:a.byteLength,loaded:!0})}),()=>{s=!0,i&&URL.revokeObjectURL(i)})},[e.id,e.available]),t}function Vd({label:e}){return v.jsxs("div",{className:"file-offdevice",children:[v.jsx("div",{className:"file-offdevice-ic",children:v.jsx(ve,{name:"inbox",size:16})}),v.jsxs("div",{className:"filecard-meta",children:[v.jsx("div",{className:"filecard-name",title:e,children:e}),v.jsx("div",{className:"filecard-sub",children:"Available on your original device"})]})]})}function aM(e){const t=new Date(e);return isNaN(t.getTime())?"":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function ly({rec:e}){if(!e.transcription)return null;const t=e.transcription.text?.trim();return v.jsx("div",{className:"voice-transcript",children:t||`Transcription ${e.transcription.status??"unavailable"}${e.transcription.error_category?` · ${e.transcription.error_category}`:""}`})}function lM({rec:e,receipt:t,receiptless:n,onPreview:i,onFetch:s}){const l=e.dir==="out",a=`bubble file-bubble${l?" me":""}`,c=qi(e.mime,e.filename)?"Voice message":"File",d=v.jsxs("div",{className:"bubble-at",children:[aM(e.date),l&&v.jsx(jx,{receipt:t,content:c,receiptless:n})]});return e.mime.startsWith("image/")?v.jsx(uM,{rec:e,cls:a,footer:d,onFetch:s}):qi(e.mime,e.filename)?v.jsx(cM,{rec:e,cls:a,footer:d,onFetch:s}):v.jsx(fM,{rec:e,cls:a,footer:d,onPreview:i,onFetch:s})}function Bd({rec:e,onFetch:t}){const[n,i]=S.useState(!1),[s,l]=S.useState(!1);return v.jsxs("div",{className:"file-offdevice",children:[v.jsx("div",{className:"file-offdevice-ic",children:v.jsx(ve,{name:"inbox",size:16})}),v.jsxs("div",{className:"filecard-meta",children:[v.jsx("div",{className:"filecard-name",title:e.filename,children:qi(e.mime,e.filename)?"Voice message":e.filename}),v.jsx("div",{className:"filecard-sub",children:s?"Could not fetch media":"Available after explicit fetch"})]}),v.jsx("button",{className:"btn sm",disabled:n,onClick:()=>{i(!0),l(!1),(t?.(e.id)??vE(e.id)).catch(()=>l(!0)).finally(()=>i(!1))},children:n?"Fetching…":"Fetch"})]})}function uM({rec:e,cls:t,footer:n,onFetch:i}){const{url:s,loaded:l}=zd(e);return l&&!s?v.jsxs("div",{className:t+" filecard-bubble file-offdevice-bubble",children:[e.available===!1?v.jsx(Bd,{rec:e,onFetch:i}):v.jsx(Vd,{label:e.filename&&e.filename!=="file"?e.filename:"Photo"}),n]}):v.jsxs("div",{className:t+" image-bubble",children:[s?v.jsx("a",{href:s,target:"_blank",rel:"noreferrer",title:e.filename,children:v.jsx("img",{src:s,alt:e.filename})}):v.jsx("div",{className:"file-loading",children:"loading…"}),n]})}function cM({rec:e,cls:t,footer:n,onFetch:i}){const{url:s,loaded:l}=zd(e),a=S.useRef(null),c=S.useRef(null),[d,h]=S.useState(!1),[m,p]=S.useState(0),[y,w]=S.useState(()=>J2(e.mime)),[k,C]=S.useState(!1),[T,E]=S.useState(null);if(S.useEffect(()=>{if(!s)return;let H=!1;const X=typeof window>"u"?void 0:window.AudioContext||window.webkitAudioContext;if(!X)return;const j=new X,G=()=>{try{j.close()?.catch?.(()=>{})}catch{}};return(async()=>{try{const U=await fetch(s).then(se=>se.arrayBuffer()),fe=await j.decodeAudioData(U);if(H)return;E(oM(iM(fe.getChannelData(0),Ew)))}catch{}finally{G()}})(),()=>{H=!0,G()}},[s]),l&&!s)return v.jsxs("div",{className:t+" filecard-bubble file-offdevice-bubble",children:[e.available===!1?v.jsx(Bd,{rec:e,onFetch:i}):v.jsx(Vd,{label:"Voice message"}),n,v.jsx(ly,{rec:e})]});const A=()=>{const H=a.current;H&&(d?H.pause():H.play())},M=H=>{const X=c.current;if(!X)return 0;const j=X.getBoundingClientRect();return Math.max(0,Math.min(1,(H-j.left)/j.width))},_=H=>{const X=a.current;p(H),X&&y&&isFinite(y)&&(X.currentTime=H*y)},W=H=>{s&&(H.currentTarget.setPointerCapture?.(H.pointerId),C(!0),_(M(H.clientX)))},D=H=>{k&&_(M(H.clientX))},Y=H=>{k&&(H.currentTarget.releasePointerCapture?.(H.pointerId),C(!1))};return v.jsxs("div",{className:t+" voice-bubble",children:[v.jsx("button",{className:"voice-play",onClick:A,disabled:!s,title:d?"Pause":"Play",children:v.jsx(ve,{name:d?"pause":"play",size:14})}),v.jsxs("div",{className:"voice-track"+(s?" seekable":"")+(k?" scrubbing":"")+(T?" has-wave":""),ref:c,onPointerDown:W,onPointerMove:D,onPointerUp:Y,onPointerCancel:Y,role:s?"slider":void 0,"aria-label":s?"Seek":void 0,"aria-valuenow":Math.round(m*100),children:[T?v.jsx("div",{className:"voice-wave","aria-hidden":!0,children:T.map((H,X)=>v.jsx("span",{className:"voice-wave-bar"+(X/T.length<m?" played":""),style:{height:`${Math.round(H*100)}%`}},X))}):v.jsx("div",{className:"voice-track-fill",style:{width:`${m*100}%`}}),s&&v.jsx("span",{className:"voice-track-knob",style:{left:`${m*100}%`}})]}),v.jsx("span",{className:"voice-dur mono",children:y!==null?`${Math.floor(y/60)}:${String(Math.floor(y%60)).padStart(2,"0")}`:"·:··"}),s&&v.jsx("audio",{ref:a,src:s,onPlay:()=>h(!0),onPause:()=>h(!1),onEnded:()=>{h(!1),p(0)},onTimeUpdate:H=>{const X=H.currentTarget;!k&&X.duration>0&&isFinite(X.duration)&&p(X.currentTime/X.duration)},onLoadedMetadata:H=>{const X=H.currentTarget.duration;isFinite(X)&&X>0&&w(X)}}),n,v.jsx(ly,{rec:e})]})}function fM({rec:e,cls:t,footer:n,onPreview:i,onFetch:s}){const{url:l,size:a,loaded:c}=zd(e);return c&&!l?v.jsxs("div",{className:t+" filecard-bubble file-offdevice-bubble",children:[e.available===!1?v.jsx(Bd,{rec:e,onFetch:s}):v.jsx(Vd,{label:e.filename}),n]}):v.jsxs("div",{className:t+" filecard-bubble",children:[v.jsxs("div",{className:"filecard",children:[v.jsx("div",{className:"filecard-ic",children:v.jsx(ve,{name:"copy",size:18})}),v.jsxs("div",{className:"filecard-meta",children:[v.jsx("div",{className:"filecard-name",title:e.filename,children:e.filename}),v.jsx("div",{className:"filecard-sub",children:a?Rr(a):e.size?Rr(e.size):""})]}),kw(e.filename)&&l&&i&&v.jsx("button",{className:"icon-btn",onClick:()=>i(e),title:"Preview markdown",children:v.jsx(ve,{name:"monitor",size:16})}),_l(e.filename,e.mime)&&l&&i&&v.jsx("button",{className:"icon-btn",onClick:()=>i(e),title:"Preview HTML",children:v.jsx(ve,{name:"monitor",size:16})}),v.jsx("a",{className:"icon-btn"+(l?"":" disabled"),href:l??void 0,download:e.filename,title:"Download",children:v.jsx(ve,{name:"download",size:16})})]}),n]})}function Mw(e){const{att:t}=e,[n,i]=S.useState(null);return S.useEffect(()=>{const s=Rw({mime:t.mime,filename:t.filename}),l=URL.createObjectURL(new Blob([t.bytes],{type:s}));return i(l),()=>URL.revokeObjectURL(l)},[t]),v.jsxs("div",{className:"attach-preview",children:[t.mime.startsWith("image/")&&n?v.jsx("img",{className:"attach-thumb",src:n,alt:t.filename}):t.voice&&n?v.jsx("audio",{className:"attach-audio",src:n,controls:!0}):v.jsx("div",{className:"filecard-ic",children:v.jsx(ve,{name:"copy",size:16})}),v.jsxs("div",{className:"filecard-meta",children:[v.jsx("div",{className:"filecard-name",title:t.filename,children:t.voice?"Voice message":t.filename}),v.jsxs("div",{className:"filecard-sub",children:[Rr(t.bytes.length),t.originalSize&&t.originalSize>t.bytes.length?` · optimized from ${Rr(t.originalSize)}`:""]})]}),v.jsx("button",{className:"btn primary sm",disabled:e.sending,onClick:e.onSend,children:e.sending?"Sending…":"Send"}),v.jsx("button",{className:"icon-btn",title:"Discard",disabled:e.sending,onClick:e.onDiscard,children:v.jsx(ve,{name:"close"})})]})}const dM={channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},hM=e=>`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,"0")}`,uy=84,cy=120,pM=550,mM=Math.floor(Qo/(If/8)),gM=Math.min(300,mM),yM=tM;function Aw(e){const[t,n]=S.useState("idle"),[i,s]=S.useState(0),[l,a]=S.useState([]),[c,d]=S.useState(0),[h,m]=S.useState(0),p=S.useRef("idle"),y=S.useRef(null),w=S.useRef(null),k=S.useRef([]),C=S.useRef("webm"),T=S.useRef("audio/webm"),E=S.useRef(!1),A=S.useRef({x:0,y:0}),M=S.useRef(0),_=S.useRef(!1),W=S.useRef(null),D=S.useRef(null),Y=S.useRef(null),H=S.useRef(e.onReady),X=S.useRef(e.onError),j=S.useRef(e.onActiveChange);H.current=e.onReady,X.current=e.onError,j.current=e.onActiveChange;const G=Z=>{p.current=Z,n(Z),j.current?.(Z==="recording"||Z==="locked"||Z==="arming")},U=()=>{D.current!=null&&cancelAnimationFrame(D.current),D.current=null,Y.current&&clearInterval(Y.current),Y.current=null,W.current?.close().catch(()=>{}),W.current=null,w.current?.getTracks().forEach(Z=>Z.stop()),w.current=null},fe=()=>{window.removeEventListener("pointermove",Ee),window.removeEventListener("pointerup",q),window.removeEventListener("pointercancel",q)},se=Z=>{E.current=Z;const de=y.current;de&&de.state!=="inactive"?de.stop():ee(),fe()},ee=()=>{U(),G("idle"),s(0),a([]),d(0),m(0)},xe=()=>{p.current==="recording"&&(fe(),m(0),G("locked"))};function Ee(Z){if(p.current!=="recording")return;const de=A.current.y-Z.clientY,ie=A.current.x-Z.clientX,Ce=Math.max(0,Math.min(1,de/uy)),ge=Math.max(0,Math.min(1,ie/cy));d(Ce),m(ge),de>=uy?xe():ie>=cy&&se(!0)}function q(){if(p.current==="arming"){_.current=!0,fe();return}if(p.current!=="recording")return;const Z=Date.now()-M.current<pM;se(Z)}const le=Z=>{e.disabled||p.current!=="idle"||(Z.preventDefault(),A.current={x:Z.clientX,y:Z.clientY},_.current=!1,E.current=!1,k.current=[],d(0),m(0),G("arming"),window.addEventListener("pointermove",Ee),window.addEventListener("pointerup",q),window.addEventListener("pointercancel",q),P())};async function P(){let Z;try{Z=await navigator.mediaDevices.getUserMedia({audio:dM})}catch{X.current("Microphone unavailable — check the browser permission."),fe(),G("idle");return}if(_.current||p.current==="idle"){Z.getTracks().forEach(Ce=>Ce.stop()),G("idle");return}w.current=Z;const de=Y2.find(Ce=>typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported(Ce.rec));C.current=de?.ext??"webm",T.current=de?.base??"audio/webm";const ie=de?new MediaRecorder(Z,{mimeType:de.rec,audioBitsPerSecond:If}):new MediaRecorder(Z,{audioBitsPerSecond:If});y.current=ie,ie.ondataavailable=Ce=>{Ce.data.size>0&&k.current.push(Ce.data)},ie.onstop=()=>{if(E.current){ee();return}const ge=new Blob(k.current,{type:T.current});Promise.all([ge.arrayBuffer(),eM(ge)]).then(([Te,je])=>{if(ee(),Te.byteLength===0)return;const $e=new Date().toISOString().replace(/[-:]/g,"").replace(/\..+/,"").replace("T","-");H.current({filename:`${Ax}${$e}.${C.current}`,mime:Z2(gE(T.current),je),bytes:new Uint8Array(Te),voice:!0})})},ie.start(),M.current=Date.now(),G("recording"),s(0),Y.current=setInterval(()=>{s(Ce=>{const ge=Ce+1;return ge>=gM&&se(!1),ge})},1e3),L(Z)}function L(Z){try{const de=window.AudioContext||window.webkitAudioContext,ie=new de;W.current=ie;const Ce=ie.createMediaStreamSource(Z),ge=ie.createAnalyser();ge.fftSize=256,Ce.connect(ge);const Te=new Uint8Array(ge.fftSize),je=sM();let $e=0;const kt=gt=>{if(D.current=requestAnimationFrame(kt),gt-$e<80)return;$e=gt,ge.getByteTimeDomainData(Te);let Dt=0;for(let it=0;it<Te.length;it++){const It=(Te[it]-128)/128;Dt+=It*It}const Qt=Math.sqrt(Dt/Te.length),Ut=je.push(Qt);a(it=>{const It=it.length>=yM?it.slice(1):it.slice();return It.push(Ut),It})};D.current=requestAnimationFrame(kt)}catch{}}S.useEffect(()=>()=>{E.current=!0,y.current?.stop(),fe(),U()},[]);const Q=t==="recording"||t==="locked"||t==="arming",R=v.jsx("div",{className:"vr-wave","aria-hidden":!0,children:l.map((Z,de)=>v.jsx("span",{className:"vr-bar",style:{height:`${Math.round(Z*100)}%`}},de))});return v.jsxs(v.Fragment,{children:[v.jsx("button",{className:"icon-btn composer-tool vr-mic",title:"Hold to record a voice message",disabled:e.disabled,onPointerDown:le,onContextMenu:Z=>Z.preventDefault(),children:v.jsx(ve,{name:"mic",size:18})}),Q&&v.jsxs("div",{className:"voice-rec-overlay","data-mode":t,children:[t==="recording"&&v.jsxs("div",{className:"vr-lock",style:{"--p":c},"aria-hidden":!0,children:[v.jsx(ve,{name:"lock",size:13}),v.jsx(ve,{name:"chevronDown",size:12})]}),v.jsx("span",{className:"voice-rec-dot"}),v.jsx("span",{className:"vr-time mono",children:hM(i)}),t==="locked"?v.jsxs(v.Fragment,{children:[R,v.jsx("button",{className:"icon-btn vr-trash",title:"Cancel",onClick:()=>se(!0),children:v.jsx(ve,{name:"trash",size:16})}),v.jsxs("button",{className:"btn primary sm vr-stop",onClick:()=>se(!1),children:[v.jsx(ve,{name:"check",size:13}),"Stop"]})]}):v.jsxs("div",{className:"vr-slide",style:{opacity:1-h},children:[R,v.jsx("span",{className:"vr-hint",children:"‹ slide to cancel · slide up to lock"})]})]})]})}const vM="modulepreload",xM=function(e){return"/"+e},fy={},Ud=function(t,n,i){let s=Promise.resolve();if(n&&n.length>0){let a=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");s=a(n.map(h=>{if(h=xM(h),h in fy)return;fy[h]=!0;const m=h.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${p}`))return;const y=document.createElement("link");if(y.rel=m?"stylesheet":vM,m||(y.as="script"),y.crossOrigin="",y.href=h,d&&y.setAttribute("nonce",d),document.head.appendChild(y),m)return new Promise((w,k)=>{y.addEventListener("load",w),y.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function l(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return s.then(a=>{for(const c of a||[])c.status==="rejected"&&l(c.reason);return t().catch(l)})};var wM=Object.defineProperty,Ji=(e,t)=>wM(e,"name",{value:t,configurable:!0}),Nw=!!(typeof window<"u"&&window.document&&window.document.createElement);function Pr(e,t,{checkForDefaultPrevented:n=!0}={}){return Ji(function(s){if(e?.(s),n===!1||!s||!s.defaultPrevented)return t?.(s)},"handleEvent")}Ji(Pr,"composeEventHandlers");function kM(e){if(!Nw)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}Ji(kM,"getOwnerWindow");function Lf(e){if(!Nw)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}Ji(Lf,"getOwnerDocument");function jw(e,t=!1){const{activeElement:n}=Lf(e);if(!n?.nodeName)return null;if(Dw(n)&&n.contentDocument)return jw(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const s=Lf(n).getElementById(i);if(s)return s}}return n}Ji(jw,"getActiveElement");function Dw(e){return e.tagName==="IFRAME"}Ji(Dw,"isFrame");var SM=Object.defineProperty,$d=(e,t)=>SM(e,"name",{value:t,configurable:!0});function _f(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}$d(_f,"setRef");function Iw(...e){return t=>{let n=!1;const i=e.map(s=>{const l=_f(s,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let s=0;s<i.length;s++){const l=i[s];typeof l=="function"?l():_f(e[s],null)}}}}$d(Iw,"composeRefs");function eo(...e){return S.useCallback(Iw(...e),e)}$d(eo,"useComposedRefs");var bM=Object.defineProperty,gn=(e,t)=>bM(e,"name",{value:t,configurable:!0});function CM(e,t){const n=S.createContext(t);n.displayName=e+"Context";const i=gn(l=>{const{children:a,...c}=l,d=S.useMemo(()=>c,Object.values(c));return v.jsx(n.Provider,{value:d,children:a})},"Provider");i.displayName=e+"Provider";function s(l,a={}){const{optional:c=!1}=a,d=S.useContext(n);if(d)return d;if(t!==void 0)return t;if(!c)throw new Error(`\`${l}\` must be used within \`${e}\``)}return gn(s,"useContext"),[i,s]}gn(CM,"createContext");function Lw(e,t=[]){let n=[];function i(l,a){const c=S.createContext(a);c.displayName=l+"Context";const d=n.length;n=[...n,a];const h=gn(p=>{const{scope:y,children:w,...k}=p,C=y?.[e]?.[d]||c,T=S.useMemo(()=>k,Object.values(k));return v.jsx(C.Provider,{value:T,children:w})},"Provider");h.displayName=l+"Provider";function m(p,y,w={}){const{optional:k=!1}=w,C=y?.[e]?.[d]||c,T=S.useContext(C);if(T)return T;if(a!==void 0)return a;if(!k)throw new Error(`\`${p}\` must be used within \`${l}\``)}return gn(m,"useContext"),[h,m]}gn(i,"createContext");const s=gn(()=>{const l=n.map(a=>S.createContext(a));return gn(function(c){const d=c?.[e]||l;return S.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])},"useScope")},"createScope");return s.scopeName=e,[i,_w(s,...t)]}gn(Lw,"createContextScope");function _w(...e){const t=e[0];if(e.length===1)return t;const n=gn(()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return gn(function(l){const a=i.reduce((c,{useScope:d,scopeName:h})=>{const p=d(l)[`__scope${h}`];return{...c,...p}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}gn(_w,"composeContextScopes");var Mr=globalThis?.document?S.useLayoutEffect:()=>{},EM=Object.defineProperty,TM=(e,t)=>EM(e,"name",{value:t,configurable:!0}),PM=ws[" useId ".trim().toString()]||(()=>{}),RM=0;function tl(e){const[t,n]=S.useState(PM());return Mr(()=>{e||n(i=>i??String(RM++))},[e]),e||(t?`radix-${t}`:"")}TM(tl,"useId");var MM=Object.defineProperty,AM=(e,t)=>MM(e,"name",{value:t,configurable:!0}),dy=ws[" useEffectEvent ".trim().toString()],hy=ws[" useInsertionEffect ".trim().toString()];function Ow(e){if(typeof dy=="function")return dy(e);const t=S.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof hy=="function"?hy(()=>{t.current=e}):Mr(()=>{t.current=e}),S.useMemo(()=>(...n)=>t.current?.(...n),[])}AM(Ow,"useEffectEvent");var NM=Object.defineProperty,bs=(e,t)=>NM(e,"name",{value:t,configurable:!0}),jM=ws[" useInsertionEffect ".trim().toString()]||Mr;function Fw({prop:e,defaultProp:t,onChange:n=bs(()=>{},"onChange"),caller:i}){const[s,l,a]=zw({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:s,h=S.useCallback(m=>{if(c){const p=Vw(m)?m(e):m;p!==e&&a.current?.(p)}else l(m)},[c,e,l,a]);return[d,h]}bs(Fw,"useControllableState");function zw({defaultProp:e,onChange:t}){const[n,i]=S.useState(e),s=S.useRef(n),l=S.useRef(t);return jM(()=>{l.current=t},[t]),S.useEffect(()=>{s.current!==n&&(l.current?.(n),s.current=n)},[n,s]),[n,i,l]}bs(zw,"useUncontrolledState");function Vw(e){return typeof e=="function"}bs(Vw,"isFunction");var py=Symbol("RADIX:SYNC_STATE");function DM(e,t,n,i){const{prop:s,defaultProp:l,onChange:a,caller:c}=t,d=s!==void 0,h=Ow(a),m=[{...n,state:l}];i&&m.push(i);const[p,y]=S.useReducer((T,E)=>{if(E.type===py)return{...T,state:E.state};const A=e(T,E);return d&&!Object.is(A.state,T.state)&&h(A.state),A},...m),w=p.state,k=S.useRef(w);S.useEffect(()=>{k.current!==w&&(k.current=w,d||h(w))},[w,k,d]);const C=S.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return S.useEffect(()=>{d&&!Object.is(s,p.state)&&y({type:py,state:s})},[s,p.state,d]),[C,y]}bs(DM,"useControllableStateReducer");var Bw=wx(),IM=Object.defineProperty,Nn=(e,t)=>IM(e,"name",{value:t,configurable:!0});function Wd(e){const t=S.forwardRef((n,i)=>{let{children:s,...l}=n,a=null,c=!1;const d=[];Of(s)&&typeof Va=="function"&&(s=Va(s._payload)),S.Children.forEach(s,y=>{if(Hw(y)){c=!0;const w=y;let k="child"in w.props?w.props.child:w.props.children;Of(k)&&typeof Va=="function"&&(k=Va(k._payload)),a=_M(w,k),d.push(a?.props?.children)}else d.push(y)}),a?a=S.cloneElement(a,void 0,d):!c&&S.Children.count(s)===1&&S.isValidElement(s)&&(a=s);const h=a?Ww(a):void 0,m=eo(i,h);if(!a){if(s||s===0)throw new Error(c?zM(e):FM(e));return s}const p=$w(l,a.props??{});return a.type!==S.Fragment&&(p.ref=i?m:h),S.cloneElement(a,p)});return t.displayName=`${e}.Slot`,t}Nn(Wd,"createSlot");var Uw=Symbol.for("radix.slottable");function LM(e){const t=Nn(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Uw,t}Nn(LM,"createSlottable");var _M=Nn((e,t)=>{if("child"in e.props){const n=e.props.child;return S.isValidElement(n)?S.cloneElement(n,void 0,e.props.children(n.props.children)):null}return S.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function $w(e,t){const n={...t};for(const i in t){const s=e[i],l=t[i];/^on[A-Z]/.test(i)?s&&l?n[i]=(...c)=>{const d=l(...c);return s(...c),d}:s&&(n[i]=s):i==="style"?n[i]={...s,...l}:i==="className"&&(n[i]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}Nn($w,"mergeProps");function Ww(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Nn(Ww,"getElementRef");function Hw(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Uw}Nn(Hw,"isSlottable");var OM=Symbol.for("react.lazy");function Of(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===OM&&"_payload"in e&&Kw(e._payload)}Nn(Of,"isLazyComponent");function Kw(e){return typeof e=="object"&&e!==null&&"then"in e}Nn(Kw,"isPromiseLike");var FM=Nn(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),zM=Nn(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Va=ws[" use ".trim().toString()],VM=Object.defineProperty,BM=(e,t)=>VM(e,"name",{value:t,configurable:!0}),UM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ai=UM.reduce((e,t)=>{const n=Wd(`Primitive.${t}`),i=S.forwardRef((s,l)=>{const{asChild:a,...c}=s,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(d,{...c,ref:l})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function qw(e,t){e&&Bw.flushSync(()=>e.dispatchEvent(t))}BM(qw,"dispatchDiscreteCustomEvent");var $M=Object.defineProperty,WM=(e,t)=>$M(e,"name",{value:t,configurable:!0});function Yi(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>t.current?.(...n),[])}WM(Yi,"useCallbackRef");var HM=Object.defineProperty,wt=(e,t)=>HM(e,"name",{value:t,configurable:!0}),Ff="dismissableLayer.update",KM="dismissableLayer.pointerDownOutside",qM="dismissableLayer.focusOutside",my,Xw=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),XM=S.forwardRef(wt(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:d,onDismiss:h,...m}=t,p=S.useContext(Xw),[y,w]=S.useState(null),k=y?.ownerDocument??globalThis?.document,[,C]=S.useState({}),T=eo(n,w),E=Array.from(p.layers),[A]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),M=A?E.indexOf(A):-1,_=y?E.indexOf(y):-1,W=p.layersWithOutsidePointerEventsDisabled.size>0,D=_>=M,Y=S.useRef(!1),H=Gw(U=>{a?.(U),d?.(U),U.defaultPrevented||h?.()},{ownerDocument:k,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:Y,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:S.useCallback(U=>{if(!(U instanceof Node))return!1;const fe=[...p.branches].some(se=>se.contains(U));return D&&!fe},[p.branches,D])}),X=Qw(U=>{if(s&&Y.current)return;const fe=U.target;[...p.branches].some(ee=>ee.contains(fe))||(c?.(U),d?.(U),U.defaultPrevented||h?.())},k),j=y?_===E.length-1:!1,G=Yi(U=>{U.key==="Escape"&&(l?.(U),!U.defaultPrevented&&h&&(U.preventDefault(),h()))});return S.useEffect(()=>{if(j)return k.addEventListener("keydown",G,{capture:!0}),()=>k.removeEventListener("keydown",G,{capture:!0})},[k,j,G]),S.useEffect(()=>{if(y)return i&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(my=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(y)),p.layers.add(y),zf(),()=>{i&&(p.layersWithOutsidePointerEventsDisabled.delete(y),p.layersWithOutsidePointerEventsDisabled.size===0&&(k.body.style.pointerEvents=my))}},[y,k,i,p]),S.useEffect(()=>()=>{y&&(p.layers.delete(y),p.layersWithOutsidePointerEventsDisabled.delete(y),zf())},[y,p]),S.useEffect(()=>{const U=wt(()=>C({}),"handleUpdate");return document.addEventListener(Ff,U),()=>document.removeEventListener(Ff,U)},[]),v.jsx(ai.div,{...m,ref:T,style:{pointerEvents:W?D?"auto":"none":void 0,...t.style},onFocusCapture:Pr(t.onFocusCapture,X.onFocusCapture),onBlurCapture:Pr(t.onBlurCapture,X.onBlurCapture),onPointerDownCapture:Pr(t.onPointerDownCapture,H.onPointerDownCapture)})},"DismissableLayer"));function Yw(){const e=S.useContext(Xw),[t,n]=S.useState(null);return S.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}wt(Yw,"useDismissableLayerSurface");var YM=wt(()=>!0,"IS_TRUE");function Gw(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:l,shouldHandlePointerDownOutside:a=YM}=t,c=Yi(e),d=S.useRef(!1),h=S.useRef(!1),m=S.useRef(new Map),p=S.useRef(()=>{});return S.useEffect(()=>{function y(){h.current=!1,s.current=!1,m.current.clear()}wt(y,"resetOutsideInteraction");function w(){return Array.from(m.current.values()).some(Boolean)}wt(w,"isOutsideInteractionIntercepted");function k(M){if(!h.current)return;const _=M.target;_ instanceof Node&&[...l].some(D=>D.contains(_))||m.current.set(M.type,!0),M.type==="click"&&window.setTimeout(()=>{h.current&&p.current()},0)}wt(k,"handleInteractionCapture");function C(M){h.current&&m.current.set(M.type,!1)}wt(C,"handleInteractionBubble");const T=wt(M=>{if(M.target&&!d.current){let _=function(){n.removeEventListener("click",p.current);const D=w();y(),D||Hd(KM,c,W,{discrete:!0})};if(wt(_,"handleAndDispatchPointerDownOutsideEvent"),!a(M.target)){n.removeEventListener("click",p.current),y(),d.current=!1;return}const W={originalEvent:M};h.current=!0,s.current=i&&M.button===0,m.current.clear(),!i||M.button!==0?_():(n.removeEventListener("click",p.current),p.current=_,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),y();d.current=!1},"handlePointerDown"),E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const M of E)n.addEventListener(M,k,!0),n.addEventListener(M,C);const A=window.setTimeout(()=>{n.addEventListener("pointerdown",T)},0);return()=>{window.clearTimeout(A),n.removeEventListener("pointerdown",T),n.removeEventListener("click",p.current);for(const M of E)n.removeEventListener(M,k,!0),n.removeEventListener(M,C)}},[n,c,i,s,l,a]),{onPointerDownCapture:wt(()=>d.current=!0,"onPointerDownCapture")}}wt(Gw,"usePointerDownOutside");function Qw(e,t=globalThis?.document){const n=Yi(e),i=S.useRef(!1);return S.useEffect(()=>{const s=wt(l=>{l.target&&!i.current&&Hd(qM,n,{originalEvent:l},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:wt(()=>i.current=!0,"onFocusCapture"),onBlurCapture:wt(()=>i.current=!1,"onBlurCapture")}}wt(Qw,"useFocusOutside");function zf(){const e=new CustomEvent(Ff);document.dispatchEvent(e)}wt(zf,"dispatchUpdate");function Hd(e,t,n,{discrete:i}){const s=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),i?qw(s,l):s.dispatchEvent(l)}wt(Hd,"handleAndDispatchCustomEvent");var GM=Object.defineProperty,zt=(e,t)=>GM(e,"name",{value:t,configurable:!0}),Vc="focusScope.autoFocusOnMount",Bc="focusScope.autoFocusOnUnmount",gy={bubbles:!1,cancelable:!0},QM=S.forwardRef(zt(function(t,n){const{loop:i=!1,trapped:s=!1,onMountAutoFocus:l,onUnmountAutoFocus:a,...c}=t,[d,h]=S.useState(null),m=Yi(l),p=Yi(a),y=S.useRef(null),w=eo(n,h),k=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(s){let T=function(_){if(k.paused||!d)return;const W=_.target;d.contains(W)?y.current=W:tr(y.current,{select:!0})},E=function(_){if(k.paused||!d)return;const W=_.relatedTarget;W!==null&&(d.contains(W)||tr(y.current,{select:!0}))},A=function(_){if(document.activeElement===document.body)for(const D of _)D.removedNodes.length>0&&tr(d)};zt(T,"handleFocusIn"),zt(E,"handleFocusOut"),zt(A,"handleMutations"),document.addEventListener("focusin",T),document.addEventListener("focusout",E);const M=new MutationObserver(A);return d&&M.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",T),document.removeEventListener("focusout",E),M.disconnect()}}},[s,d,k.paused]),S.useEffect(()=>{if(d){yy.add(k);const T=document.activeElement;if(!d.contains(T)){const A=new CustomEvent(Vc,gy);d.addEventListener(Vc,m),d.dispatchEvent(A),A.defaultPrevented||(Zw(r0(Kd(d)),{select:!0}),document.activeElement===T&&tr(d))}return()=>{d.removeEventListener(Vc,m),setTimeout(()=>{const A=new CustomEvent(Bc,gy);d.addEventListener(Bc,p),d.dispatchEvent(A),A.defaultPrevented||tr(T??document.body,{select:!0}),d.removeEventListener(Bc,p),yy.remove(k)},0)}}},[d,m,p,k]);const C=S.useCallback(T=>{if(!i&&!s||k.paused)return;const E=T.key==="Tab"&&!T.altKey&&!T.ctrlKey&&!T.metaKey,A=document.activeElement;if(E&&A){const M=T.currentTarget,[_,W]=Jw(M);_&&W?!T.shiftKey&&A===W?(T.preventDefault(),i&&tr(_,{select:!0})):T.shiftKey&&A===_&&(T.preventDefault(),i&&tr(W,{select:!0})):A===M&&T.preventDefault()}},[i,s,k.paused]);return v.jsx(ai.div,{tabIndex:-1,...c,ref:w,onKeyDown:C})},"FocusScope"));function Zw(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(tr(i,{select:t}),document.activeElement!==n)return}zt(Zw,"focusFirst");function Jw(e){const t=Kd(e),n=Vf(t,e),i=Vf(t.reverse(),e);return[n,i]}zt(Jw,"getTabbableEdges");function Kd(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:zt(i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}zt(Kd,"getTabbableCandidates");function Vf(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):e0(i,{upTo:t})))return i}zt(Vf,"findVisible");function e0(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}zt(e0,"isHidden");function t0(e){return e instanceof HTMLInputElement&&"select"in e}zt(t0,"isSelectableInput");function tr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&t0(e)&&t&&e.select()}}zt(tr,"focus");var yy=n0();function n0(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Bf(e,t),e.unshift(t)},remove(t){e=Bf(e,t),e[0]?.resume()}}}zt(n0,"createFocusScopesStack");function Bf(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}zt(Bf,"arrayRemove");function r0(e){return e.filter(t=>t.tagName!=="A")}zt(r0,"removeLinks");var ZM=Object.defineProperty,JM=(e,t)=>ZM(e,"name",{value:t,configurable:!0}),eA=S.forwardRef(JM(function(t,n){const{container:i,...s}=t,[l,a]=S.useState(!1);Mr(()=>a(!0),[]);const c=i||l&&globalThis?.document?.body;return c?Bw.createPortal(v.jsx(ai.div,{...s,ref:n}),c):null},"Portal")),tA=Object.defineProperty,nr=(e,t)=>tA(e,"name",{value:t,configurable:!0});function i0(e,t){return S.useReducer((n,i)=>t[n][i]??n,e)}nr(i0,"useStateMachine");var qd=nr(e=>{const{present:t,children:n}=e,i=o0(t),s=typeof n=="function"?n({present:i.isPresent}):S.Children.only(n),l=s0(i.ref,a0(s));return typeof n=="function"||i.isPresent?S.cloneElement(s,{ref:l}):null},"Presence");function o0(e){const[t,n]=S.useState(),i=S.useRef(null),s=S.useRef(e),l=S.useRef("none"),a=S.useRef(void 0),c=e?"mounted":"unmounted",[d,h]=i0(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{d==="mounted"?(l.current=a.current??Bi(i.current),a.current=void 0):l.current="none"},[d]),Mr(()=>{const m=i.current,p=s.current;if(p!==e){const w=l.current,k=Bi(m);e?(a.current=k,h("MOUNT")):k==="none"||m?.display==="none"?h("UNMOUNT"):h(p&&w!==k?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),Mr(()=>{if(t){let m;const p=t.ownerDocument.defaultView??window,y=nr(k=>{const T=Bi(i.current).includes(CSS.escape(k.animationName));if(k.target===t&&T&&(h("ANIMATION_END"),!s.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",m=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},"handleAnimationEnd"),w=nr(k=>{k.target===t&&(l.current=Bi(i.current))},"handleAnimationStart");return t.addEventListener("animationstart",w),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{p.clearTimeout(m),t.removeEventListener("animationstart",w),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:S.useCallback(m=>{if(m){const p=getComputedStyle(m);i.current=p,a.current=Bi(p)}else i.current=null;n(m)},[])}}nr(o0,"usePresence");function Uf(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}nr(Uf,"setRef");function s0(...e){const t=S.useRef(e);return t.current=e,S.useCallback(n=>{const i=t.current;let s=!1;const l=i.map(a=>{const c=Uf(a,n);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let a=0;a<l.length;a++){const c=l[a];typeof c=="function"?c():Uf(i[a],null)}}},[])}nr(s0,"useStableComposedRefs");function Bi(e){return e?.animationName||"none"}nr(Bi,"getAnimationName");function a0(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}nr(a0,"getElementRef");var nA=Object.defineProperty,Xd=(e,t)=>nA(e,"name",{value:t,configurable:!0}),Ba=0,Li=null;function rA(e){return Yd(),e.children}Xd(rA,"FocusGuards");function Yd(){S.useEffect(()=>{Li||(Li={start:$f(),end:$f()});const{start:e,end:t}=Li;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Ba++,()=>{Ba===1&&(Li?.start.remove(),Li?.end.remove(),Li=null),Ba=Math.max(0,Ba-1)}},[])}Xd(Yd,"useFocusGuards");function $f(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}Xd($f,"createFocusGuard");var Bn=function(){return Bn=Object.assign||function(t){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Bn.apply(this,arguments)};function l0(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]]);return n}function iA(e,t,n){if(n||arguments.length===2)for(var i=0,s=t.length,l;i<s;i++)(l||!(i in t))&&(l||(l=Array.prototype.slice.call(t,0,i)),l[i]=t[i]);return e.concat(l||Array.prototype.slice.call(t))}var nl="right-scroll-bar-position",rl="width-before-scroll-bar",oA="with-scroll-bars-hidden",sA="--removed-body-scroll-bar-size";function Uc(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function aA(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(i){var s=n.value;s!==i&&(n.value=i,n.callback(i,s))}}}})[0];return n.callback=t,n.facade}var lA=typeof window<"u"?S.useLayoutEffect:S.useEffect,vy=new WeakMap;function uA(e,t){var n=aA(null,function(i){return e.forEach(function(s){return Uc(s,i)})});return lA(function(){var i=vy.get(n);if(i){var s=new Set(i),l=new Set(e),a=n.current;s.forEach(function(c){l.has(c)||Uc(c,null)}),l.forEach(function(c){s.has(c)||Uc(c,a)})}vy.set(n,e)},[e]),n}function cA(e){return e}function fA(e,t){t===void 0&&(t=cA);var n=[],i=!1,s={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var a=t(l,i);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(l){for(i=!0;n.length;){var a=n;n=[],a.forEach(l)}n={push:function(c){return l(c)},filter:function(){return n}}},assignMedium:function(l){i=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(l),a=n}var d=function(){var m=a;a=[],m.forEach(l)},h=function(){return Promise.resolve().then(d)};h(),n={push:function(m){a.push(m),h()},filter:function(m){return a=a.filter(m),n}}}};return s}function dA(e){e===void 0&&(e={});var t=fA(null);return t.options=Bn({async:!0,ssr:!1},e),t}var u0=function(e){var t=e.sideCar,n=l0(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return S.createElement(i,Bn({},n))};u0.isSideCarExport=!0;function hA(e,t){return e.useMedium(t),u0}var c0=dA(),$c=function(){},Ol=S.forwardRef(function(e,t){var n=S.useRef(null),i=S.useState({onScrollCapture:$c,onWheelCapture:$c,onTouchMoveCapture:$c}),s=i[0],l=i[1],a=e.forwardProps,c=e.children,d=e.className,h=e.removeScrollBar,m=e.enabled,p=e.shards,y=e.sideCar,w=e.noRelative,k=e.noIsolation,C=e.inert,T=e.allowPinchZoom,E=e.as,A=E===void 0?"div":E,M=e.gapMode,_=l0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),W=y,D=uA([n,t]),Y=Bn(Bn({},_),s);return S.createElement(S.Fragment,null,m&&S.createElement(W,{sideCar:c0,removeScrollBar:h,shards:p,noRelative:w,noIsolation:k,inert:C,setCallbacks:l,allowPinchZoom:!!T,lockRef:n,gapMode:M}),a?S.cloneElement(S.Children.only(c),Bn(Bn({},Y),{ref:D})):S.createElement(A,Bn({},Y,{className:d,ref:D}),c))});Ol.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ol.classNames={fullWidth:rl,zeroRight:nl};var pA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=pA();return t&&e.setAttribute("nonce",t),e}function gA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function yA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var vA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=mA())&&(gA(t,n),yA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xA=function(){var e=vA();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},f0=function(){var e=xA(),t=function(n){var i=n.styles,s=n.dynamic;return e(i,s),null};return t},wA={left:0,top:0,right:0,gap:0},Wc=function(e){return parseInt(e||"",10)||0},kA=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],i=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Wc(n),Wc(i),Wc(s)]},SA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return wA;var t=kA(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},bA=f0(),Ki="data-scroll-locked",CA=function(e,t,n,i){var s=e.left,l=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
261
- .`.concat(oA,` {
262
- overflow: hidden `).concat(i,`;
263
- padding-right: `).concat(c,"px ").concat(i,`;
264
- }
265
- body[`).concat(Ki,`] {
266
- overflow: hidden `).concat(i,`;
267
- overscroll-behavior: contain;
268
- `).concat([t&&"position: relative ".concat(i,";"),n==="margin"&&`
269
- padding-left: `.concat(s,`px;
270
- padding-top: `).concat(l,`px;
271
- padding-right: `).concat(a,`px;
272
- margin-left:0;
273
- margin-top:0;
274
- margin-right: `).concat(c,"px ").concat(i,`;
275
- `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(i,";")].filter(Boolean).join(""),`
276
- }
277
-
278
- .`).concat(nl,` {
279
- right: `).concat(c,"px ").concat(i,`;
280
- }
281
-
282
- .`).concat(rl,` {
283
- margin-right: `).concat(c,"px ").concat(i,`;
284
- }
285
-
286
- .`).concat(nl," .").concat(nl,` {
287
- right: 0 `).concat(i,`;
288
- }
289
-
290
- .`).concat(rl," .").concat(rl,` {
291
- margin-right: 0 `).concat(i,`;
292
- }
293
-
294
- body[`).concat(Ki,`] {
295
- `).concat(sA,": ").concat(c,`px;
296
- }
297
- `)},xy=function(){var e=parseInt(document.body.getAttribute(Ki)||"0",10);return isFinite(e)?e:0},EA=function(){S.useEffect(function(){return document.body.setAttribute(Ki,(xy()+1).toString()),function(){var e=xy()-1;e<=0?document.body.removeAttribute(Ki):document.body.setAttribute(Ki,e.toString())}},[])},TA=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,s=i===void 0?"margin":i;EA();var l=S.useMemo(function(){return SA(s)},[s]);return S.createElement(bA,{styles:CA(l,!t,s,n?"":"!important")})},Wf=!1;if(typeof window<"u")try{var Ua=Object.defineProperty({},"passive",{get:function(){return Wf=!0,!0}});window.addEventListener("test",Ua,Ua),window.removeEventListener("test",Ua,Ua)}catch{Wf=!1}var _i=Wf?{passive:!1}:!1,PA=function(e){return e.tagName==="TEXTAREA"},d0=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!PA(e)&&n[t]==="visible")},RA=function(e){return d0(e,"overflowY")},MA=function(e){return d0(e,"overflowX")},wy=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var s=h0(e,i);if(s){var l=p0(e,i),a=l[1],c=l[2];if(a>c)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},AA=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},NA=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},h0=function(e,t){return e==="v"?RA(t):MA(t)},p0=function(e,t){return e==="v"?AA(t):NA(t)},jA=function(e,t){return e==="h"&&t==="rtl"?-1:1},DA=function(e,t,n,i,s){var l=jA(e,window.getComputedStyle(t).direction),a=l*i,c=n.target,d=t.contains(c),h=!1,m=a>0,p=0,y=0;do{if(!c)break;var w=p0(e,c),k=w[0],C=w[1],T=w[2],E=C-T-l*k;(k||E)&&h0(e,c)&&(p+=E,y+=k);var A=c.parentNode;c=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(m&&Math.abs(p)<1||!m&&Math.abs(y)<1)&&(h=!0),h},$a=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ky=function(e){return[e.deltaX,e.deltaY]},Sy=function(e){return e&&"current"in e?e.current:e},IA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},LA=function(e){return`
298
- .block-interactivity-`.concat(e,` {pointer-events: none;}
299
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
300
- `)},_A=0,Oi=[];function OA(e){var t=S.useRef([]),n=S.useRef([0,0]),i=S.useRef(),s=S.useState(_A++)[0],l=S.useState(f0)[0],a=S.useRef(e);S.useEffect(function(){a.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var C=iA([e.lockRef.current],(e.shards||[]).map(Sy),!0).filter(Boolean);return C.forEach(function(T){return T.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),C.forEach(function(T){return T.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=S.useCallback(function(C,T){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!a.current.allowPinchZoom;var E=$a(C),A=n.current,M="deltaX"in C?C.deltaX:A[0]-E[0],_="deltaY"in C?C.deltaY:A[1]-E[1],W,D=C.target,Y=Math.abs(M)>Math.abs(_)?"h":"v";if("touches"in C&&Y==="h"&&D.type==="range")return!1;var H=window.getSelection(),X=H&&H.anchorNode,j=X?X===D||X.contains(D):!1;if(j)return!1;var G=wy(Y,D);if(!G)return!0;if(G?W=Y:(W=Y==="v"?"h":"v",G=wy(Y,D)),!G)return!1;if(!i.current&&"changedTouches"in C&&(M||_)&&(i.current=W),!W)return!0;var U=i.current||W;return DA(U,T,C,U==="h"?M:_)},[]),d=S.useCallback(function(C){var T=C;if(!(!Oi.length||Oi[Oi.length-1]!==l)){var E="deltaY"in T?ky(T):$a(T),A=t.current.filter(function(W){return W.name===T.type&&(W.target===T.target||T.target===W.shadowParent)&&IA(W.delta,E)})[0];if(A&&A.should){T.cancelable&&T.preventDefault();return}if(!A){var M=(a.current.shards||[]).map(Sy).filter(Boolean).filter(function(W){return W.contains(T.target)}),_=M.length>0?c(T,M[0]):!a.current.noIsolation;_&&T.cancelable&&T.preventDefault()}}},[]),h=S.useCallback(function(C,T,E,A){var M={name:C,delta:T,target:E,should:A,shadowParent:FA(E)};t.current.push(M),setTimeout(function(){t.current=t.current.filter(function(_){return _!==M})},1)},[]),m=S.useCallback(function(C){n.current=$a(C),i.current=void 0},[]),p=S.useCallback(function(C){h(C.type,ky(C),C.target,c(C,e.lockRef.current))},[]),y=S.useCallback(function(C){h(C.type,$a(C),C.target,c(C,e.lockRef.current))},[]);S.useEffect(function(){return Oi.push(l),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:y}),document.addEventListener("wheel",d,_i),document.addEventListener("touchmove",d,_i),document.addEventListener("touchstart",m,_i),function(){Oi=Oi.filter(function(C){return C!==l}),document.removeEventListener("wheel",d,_i),document.removeEventListener("touchmove",d,_i),document.removeEventListener("touchstart",m,_i)}},[]);var w=e.removeScrollBar,k=e.inert;return S.createElement(S.Fragment,null,k?S.createElement(l,{styles:LA(s)}):null,w?S.createElement(TA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function FA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const zA=hA(c0,OA);var m0=S.forwardRef(function(e,t){return S.createElement(Ol,Bn({},e,{ref:t,sideCar:zA}))});m0.classNames=Ol.classNames;var VA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Fi=new WeakMap,Wa=new WeakMap,Ha={},Hc=0,g0=function(e){return e&&(e.host||g0(e.parentNode))},BA=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=g0(n);return i&&e.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},UA=function(e,t,n,i){var s=BA(t,Array.isArray(e)?e:[e]);Ha[n]||(Ha[n]=new WeakMap);var l=Ha[n],a=[],c=new Set,d=new Set(s),h=function(p){!p||c.has(p)||(c.add(p),h(p.parentNode))};s.forEach(h);var m=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(y){if(c.has(y))m(y);else try{var w=y.getAttribute(i),k=w!==null&&w!=="false",C=(Fi.get(y)||0)+1,T=(l.get(y)||0)+1;Fi.set(y,C),l.set(y,T),a.push(y),C===1&&k&&Wa.set(y,!0),T===1&&y.setAttribute(n,"true"),k||y.setAttribute(i,"true")}catch(E){console.error("aria-hidden: cannot operate on ",y,E)}})};return m(t),c.clear(),Hc++,function(){a.forEach(function(p){var y=Fi.get(p)-1,w=l.get(p)-1;Fi.set(p,y),l.set(p,w),y||(Wa.has(p)||p.removeAttribute(i),Wa.delete(p)),w||p.removeAttribute(n)}),Hc--,Hc||(Fi=new WeakMap,Fi=new WeakMap,Wa=new WeakMap,Ha={})}},$A=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),s=VA(e);return s?(i.push.apply(i,Array.from(s.querySelectorAll("[aria-live], script"))),UA(i,s,n,"aria-hidden")):function(){return null}},WA=Object.defineProperty,xn=(e,t)=>WA(e,"name",{value:t,configurable:!0}),Gd="Dialog",[y0,pz]=Lw(Gd),[HA,Hn]=y0(Gd),v0=xn(e=>{const{__scopeDialog:t,children:n,open:i,defaultOpen:s,onOpenChange:l,modal:a=!0}=e,c=S.useRef(null),d=S.useRef(null),[h,m]=Fw({prop:i,defaultProp:s??!1,onChange:l,caller:Gd}),[p,y]=S.useState(0),[w,k]=S.useState(0);return v.jsx(HA,{scope:t,triggerRef:c,contentRef:d,contentId:tl(),titleId:tl(),descriptionId:tl(),titlePresent:p>0,descriptionPresent:w>0,setTitleCount:y,setDescriptionCount:k,open:h,onOpenChange:m,onOpenToggle:S.useCallback(()=>m(C=>!C),[m]),modal:a,children:n})},"Dialog"),x0="DialogPortal",[KA,w0]=y0(x0,{forceMount:void 0}),k0=xn(e=>{const{__scopeDialog:t,forceMount:n,children:i,container:s}=e,l=Hn(x0,t);return v.jsx(KA,{scope:t,forceMount:n,children:S.Children.map(i,a=>v.jsx(qd,{present:n||l.open,children:v.jsx(eA,{asChild:!0,container:s,children:a})}))})},"DialogPortal"),Hf="DialogOverlay",S0=S.forwardRef(xn(function(t,n){const i=w0(Hf,t.__scopeDialog),{forceMount:s=i.forceMount,...l}=t,a=Hn(Hf,t.__scopeDialog);return a.modal?v.jsx(qd,{present:s||a.open,children:v.jsx(XA,{...l,ref:n})}):null},"DialogOverlay")),qA=Wd("DialogOverlay.RemoveScroll"),XA=S.forwardRef(xn(function(t,n){const{__scopeDialog:i,...s}=t,l=Hn(Hf,i),a=Yw(),c=eo(n,a);return v.jsx(m0,{as:qA,allowPinchZoom:!0,shards:[l.contentRef],children:v.jsx(ai.div,{"data-state":Qd(l.open),...s,ref:c,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),hs="DialogContent",b0=S.forwardRef(xn(function(t,n){const i=w0(hs,t.__scopeDialog),{forceMount:s=i.forceMount,...l}=t,a=Hn(hs,t.__scopeDialog);return v.jsx(qd,{present:s||a.open,children:a.modal?v.jsx(YA,{...l,ref:n}):v.jsx(GA,{...l,ref:n})})},"DialogContent")),YA=S.forwardRef(xn(function(t,n){const i=Hn(hs,t.__scopeDialog),s=S.useRef(null),l=eo(n,i.contentRef,s);return S.useEffect(()=>{const a=s.current;if(a)return $A(a)},[]),v.jsx(C0,{...t,ref:l,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:Pr(t.onCloseAutoFocus,a=>{a.preventDefault(),i.triggerRef.current?.focus()}),onPointerDownOutside:Pr(t.onPointerDownOutside,a=>{const c=a.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&a.preventDefault()}),onFocusOutside:Pr(t.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),GA=S.forwardRef(xn(function(t,n){const i=Hn(hs,t.__scopeDialog),s=S.useRef(!1),l=S.useRef(!1);return v.jsx(C0,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(s.current||i.triggerRef.current?.focus(),a.preventDefault()),s.current=!1,l.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const c=a.target;i.triggerRef.current?.contains(c)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&l.current&&a.preventDefault()}})},"DialogContentNonModal")),C0=S.forwardRef(xn(function(t,n){const{__scopeDialog:i,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:a,...c}=t,d=Hn(hs,i);return Yd(),v.jsx(v.Fragment,{children:v.jsx(QM,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:l,onUnmountAutoFocus:a,children:v.jsx(XM,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionPresent?d.descriptionId:void 0,"aria-labelledby":d.titlePresent?d.titleId:void 0,"data-state":Qd(d.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1)})})})},"DialogContentImpl")),QA="DialogTitle",E0=S.forwardRef(xn(function(t,n){const{__scopeDialog:i,...s}=t,l=Hn(QA,i),{setTitleCount:a}=l;return Mr(()=>(a(c=>c+1),()=>a(c=>c-1)),[a]),v.jsx(ai.h2,{id:l.titleId,...s,ref:n})},"DialogTitle")),ZA="DialogDescription",T0=S.forwardRef(xn(function(t,n){const{__scopeDialog:i,...s}=t,l=Hn(ZA,i),{setDescriptionCount:a}=l;return Mr(()=>(a(c=>c+1),()=>a(c=>c-1)),[a]),v.jsx(ai.p,{id:l.descriptionId,...s,ref:n})},"DialogDescription")),JA="DialogClose",P0=S.forwardRef(xn(function(t,n){const{__scopeDialog:i,...s}=t,l=Hn(JA,i);return v.jsx(ai.button,{type:"button",...s,ref:n,onClick:Pr(t.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function Qd(e){return e?"open":"closed"}xn(Qd,"getState");function eN(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const tN=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nN=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rN={};function by(e,t){return(rN.jsx?nN:tN).test(e)}const iN=/[ \t\n\f\r]/g;function oN(e){return typeof e=="object"?e.type==="text"?Cy(e.value):!1:Cy(e)}function Cy(e){return e.replace(iN,"")===""}class Cs{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Cs.prototype.normal={};Cs.prototype.property={};Cs.prototype.space=void 0;function R0(e,t){const n={},i={};for(const s of e)Object.assign(n,s.property),Object.assign(i,s.normal);return new Cs(n,i,t)}function Kf(e){return e.toLowerCase()}class Gt{constructor(t,n){this.attribute=n,this.property=t}}Gt.prototype.attribute="";Gt.prototype.booleanish=!1;Gt.prototype.boolean=!1;Gt.prototype.commaOrSpaceSeparated=!1;Gt.prototype.commaSeparated=!1;Gt.prototype.defined=!1;Gt.prototype.mustUseProperty=!1;Gt.prototype.number=!1;Gt.prototype.overloadedBoolean=!1;Gt.prototype.property="";Gt.prototype.spaceSeparated=!1;Gt.prototype.space=void 0;let sN=0;const De=li(),ft=li(),qf=li(),ue=li(),Ke=li(),ri=li(),rn=li();function li(){return 2**++sN}const Xf=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:ft,commaOrSpaceSeparated:rn,commaSeparated:ri,number:ue,overloadedBoolean:qf,spaceSeparated:Ke},Symbol.toStringTag,{value:"Module"})),Kc=Object.keys(Xf);class Zd extends Gt{constructor(t,n,i,s){let l=-1;if(super(t,n),Ey(this,"space",s),typeof i=="number")for(;++l<Kc.length;){const a=Kc[l];Ey(this,Kc[l],(i&Xf[a])===Xf[a])}}}Zd.prototype.defined=!0;function Ey(e,t,n){n&&(e[t]=n)}function to(e){const t={},n={};for(const[i,s]of Object.entries(e.properties)){const l=new Zd(i,e.transform(e.attributes||{},i),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(l.mustUseProperty=!0),t[i]=l,n[Kf(i)]=i,n[Kf(l.attribute)]=i}return new Cs(t,n,e.space)}const M0=to({properties:{ariaActiveDescendant:null,ariaAtomic:ft,ariaAutoComplete:null,ariaBusy:ft,ariaChecked:ft,ariaColCount:ue,ariaColIndex:ue,ariaColSpan:ue,ariaControls:Ke,ariaCurrent:null,ariaDescribedBy:Ke,ariaDetails:null,ariaDisabled:ft,ariaDropEffect:Ke,ariaErrorMessage:null,ariaExpanded:ft,ariaFlowTo:Ke,ariaGrabbed:ft,ariaHasPopup:null,ariaHidden:ft,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ke,ariaLevel:ue,ariaLive:null,ariaModal:ft,ariaMultiLine:ft,ariaMultiSelectable:ft,ariaOrientation:null,ariaOwns:Ke,ariaPlaceholder:null,ariaPosInSet:ue,ariaPressed:ft,ariaReadOnly:ft,ariaRelevant:null,ariaRequired:ft,ariaRoleDescription:Ke,ariaRowCount:ue,ariaRowIndex:ue,ariaRowSpan:ue,ariaSelected:ft,ariaSetSize:ue,ariaSort:null,ariaValueMax:ue,ariaValueMin:ue,ariaValueNow:ue,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function A0(e,t){return t in e?e[t]:t}function N0(e,t){return A0(e,t.toLowerCase())}const aN=to({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ri,acceptCharset:Ke,accessKey:Ke,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alpha:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:Ke,autoFocus:De,autoPlay:De,blocking:Ke,capture:null,charSet:null,checked:De,cite:null,className:Ke,closedBy:null,colorSpace:null,cols:ue,colSpan:ue,command:null,commandFor:null,content:null,contentEditable:ft,controls:De,controlsList:Ke,coords:ue|ri,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:qf,draggable:ft,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:Ke,height:ue,hidden:qf,high:ue,href:null,hrefLang:null,htmlFor:Ke,httpEquiv:Ke,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:Ke,itemRef:Ke,itemScope:De,itemType:Ke,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:ue,manifest:null,max:null,maxLength:ue,media:null,method:null,min:null,minLength:ue,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,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:De,optimum:ue,pattern:null,ping:Ke,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:Ke,required:De,reversed:De,rows:ue,rowSpan:ue,sandbox:Ke,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootCustomElementRegistry:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shadowRootSerializable:De,shape:null,size:ue,sizes:null,slot:null,span:ue,spellCheck:ft,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ue,step:null,style:null,tabIndex:ue,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:ft,width:ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ke,axis:null,background:null,bgColor:null,border:ue,borderColor:null,bottomMargin:ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:ue,leftMargin:ue,link:null,longDesc:null,lowSrc:null,marginHeight:ue,marginWidth:ue,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:ue,rules:null,scheme:null,scrolling:ft,standby:null,summary:null,text:null,topMargin:ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ue,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:De,disablePictureInPicture:De,disableRemotePlayback:De,exportParts:ri,part:Ke,prefix:null,property:null,results:ue,security:null,unselectable:null},space:"html",transform:N0}),lN=to({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:rn,accentHeight:ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ue,amplitude:ue,arabicForm:null,ascent:ue,attributeName:null,attributeType:null,azimuth:ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ue,by:null,calcMode:null,capHeight:ue,className:Ke,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:ue,diffuseConstant:ue,direction:null,display:null,dur:null,divisor:ue,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:ue,enableBackground:null,end:null,event:null,exponent:ue,externalResourcesRequired:null,fill:null,fillOpacity:ue,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:ri,g2:ri,glyphName:ri,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ue,horizOriginX:ue,horizOriginY:ue,id:null,ideographic:ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ue,k:ue,k1:ue,k2:ue,k3:ue,k4:ue,kernelMatrix:rn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ue,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:ue,overlineThickness:ue,paintOrder:null,panose1:null,path:null,pathLength:ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ke,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ue,pointsAtY:ue,pointsAtZ:ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:rn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:rn,rev:rn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:rn,requiredFeatures:rn,requiredFonts:rn,requiredFormats:rn,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:ue,specularExponent:ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ue,strikethroughThickness:ue,string:null,stroke:null,strokeDashArray:rn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ue,strokeOpacity:ue,strokeWidth:null,style:null,surfaceScale:ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:rn,tabIndex:ue,tableValues:null,target:null,targetX:ue,targetY:ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:rn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ue,underlineThickness:ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ue,values:null,vAlphabetic:ue,vMathematical:ue,vectorEffect:null,vHanging:ue,vIdeographic:ue,version:null,vertAdvY:ue,vertOriginX:ue,vertOriginY:ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:A0}),j0=to({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()}}),D0=to({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:N0}),I0=to({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),uN={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"},cN=/[A-Z]/g,Ty=/-[a-z]/g,fN=/^data[-\w.:]+$/i;function dN(e,t){const n=Kf(t);let i=t,s=Gt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&fN.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Ty,pN);i="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Ty.test(l)){let a=l.replace(cN,hN);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=Zd}return new s(i,t)}function hN(e){return"-"+e.toLowerCase()}function pN(e){return e.charAt(1).toUpperCase()}const mN=R0([M0,aN,j0,D0,I0],"html"),Jd=R0([M0,lN,j0,D0,I0],"svg");function gN(e){return e.join(" ").trim()}var zi={},qc,Py;function yN(){if(Py)return qc;Py=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
301
- `,h="/",m="*",p="",y="comment",w="declaration";function k(T,E){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];E=E||{};var A=1,M=1;function _(se){var ee=se.match(t);ee&&(A+=ee.length);var xe=se.lastIndexOf(d);M=~xe?se.length-xe:M+se.length}function W(){var se={line:A,column:M};return function(ee){return ee.position=new D(se),X(),ee}}function D(se){this.start=se,this.end={line:A,column:M},this.source=E.source}D.prototype.content=T;function Y(se){var ee=new Error(E.source+":"+A+":"+M+": "+se);if(ee.reason=se,ee.filename=E.source,ee.line=A,ee.column=M,ee.source=T,!E.silent)throw ee}function H(se){var ee=se.exec(T);if(ee){var xe=ee[0];return _(xe),T=T.slice(xe.length),ee}}function X(){H(n)}function j(se){var ee;for(se=se||[];ee=G();)ee!==!1&&se.push(ee);return se}function G(){var se=W();if(!(h!=T.charAt(0)||m!=T.charAt(1))){for(var ee=2;p!=T.charAt(ee)&&(m!=T.charAt(ee)||h!=T.charAt(ee+1));)++ee;if(ee+=2,p===T.charAt(ee-1))return Y("End of comment missing");var xe=T.slice(2,ee-2);return M+=2,_(xe),T=T.slice(ee),M+=2,se({type:y,comment:xe})}}function U(){var se=W(),ee=H(i);if(ee){if(G(),!H(s))return Y("property missing ':'");var xe=H(l),Ee=se({type:w,property:C(ee[0].replace(e,p)),value:xe?C(xe[0].replace(e,p)):p});return H(a),Ee}}function fe(){var se=[];j(se);for(var ee;ee=U();)ee!==!1&&(se.push(ee),j(se));return se}return X(),fe()}function C(T){return T?T.replace(c,p):p}return qc=k,qc}var Ry;function vN(){if(Ry)return zi;Ry=1;var e=zi&&zi.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=n;const t=e(yN());function n(i,s){let l=null;if(!i||typeof i!="string")return l;const a=(0,t.default)(i),c=typeof s=="function";return a.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:m}=d;c?s(h,m,d):m&&(l=l||{},l[h]=m)}),l}return zi}var qo={},My;function xN(){if(My)return qo;My=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,l=function(h){return!h||n.test(h)||e.test(h)},a=function(h,m){return m.toUpperCase()},c=function(h,m){return"".concat(m,"-")},d=function(h,m){return m===void 0&&(m={}),l(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(s,c):h=h.replace(i,c),h.replace(t,a))};return qo.camelCase=d,qo}var Xo,Ay;function wN(){if(Ay)return Xo;Ay=1;var e=Xo&&Xo.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(vN()),n=xN();function i(s,l){var a={};return!s||typeof s!="string"||(0,t.default)(s,function(c,d){c&&d&&(a[(0,n.camelCase)(c,l)]=d)}),a}return i.default=i,Xo=i,Xo}var kN=wN();const SN=Td(kN),L0=_0("end"),eh=_0("start");function _0(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function bN(e){const t=eh(e),n=L0(e);if(t&&n)return{start:t,end:n}}class jt extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let s="",l={},a=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?s=t:!l.cause&&t&&(a=!0,s=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof i=="string"){const d=i.indexOf(":");d===-1?l.ruleId=i:(l.source=i.slice(0,d),l.ruleId=i.slice(d+1))}if(!l.place&&l.ancestors&&l.ancestors){const d=l.ancestors[l.ancestors.length-1];d&&(l.place=d.position)}const c=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=c?c.line:void 0,this.name=ts(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=a&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}jt.prototype.file="";jt.prototype.name="";jt.prototype.reason="";jt.prototype.message="";jt.prototype.stack="";jt.prototype.column=void 0;jt.prototype.line=void 0;jt.prototype.ancestors=void 0;jt.prototype.cause=void 0;jt.prototype.fatal=void 0;jt.prototype.place=void 0;jt.prototype.ruleId=void 0;jt.prototype.source=void 0;const th={}.hasOwnProperty,CN=new Map,EN=/[A-Z]/g,TN=new Set(["table","tbody","thead","tfoot","tr"]),PN=new Set(["td","th"]),O0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function RN(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=_N(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=LN(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Jd:mN,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=F0(s,e,void 0);return l&&typeof l!="string"?l:s.create(e,s.Fragment,{children:l||void 0},void 0)}function F0(e,t,n){if(t.type==="element")return MN(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return AN(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return jN(e,t,n);if(t.type==="mdxjsEsm")return NN(e,t);if(t.type==="root")return DN(e,t,n);if(t.type==="text")return IN(e,t)}function MN(e,t,n){const i=e.schema;let s=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(s=Jd,e.schema=s),e.ancestors.push(t);const l=V0(e,t.tagName,!1),a=ON(e,t);let c=rh(e,t);return TN.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!oN(d):!0})),z0(e,a,l,t),nh(a,c),e.ancestors.pop(),e.schema=i,e.create(t,l,a,n)}function AN(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}ps(e,t.position)}function NN(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ps(e,t.position)}function jN(e,t,n){const i=e.schema;let s=i;t.name==="svg"&&i.space==="html"&&(s=Jd,e.schema=s),e.ancestors.push(t);const l=t.name===null?e.Fragment:V0(e,t.name,!0),a=FN(e,t),c=rh(e,t);return z0(e,a,l,t),nh(a,c),e.ancestors.pop(),e.schema=i,e.create(t,l,a,n)}function DN(e,t,n){const i={};return nh(i,rh(e,t)),e.create(t,e.Fragment,i,n)}function IN(e,t){return t.value}function z0(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function nh(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function LN(e,t,n){return i;function i(s,l,a,c){const h=Array.isArray(a.children)?n:t;return c?h(l,a,c):h(l,a)}}function _N(e,t){return n;function n(i,s,l,a){const c=Array.isArray(l.children),d=eh(i);return t(s,l,a,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function ON(e,t){const n={};let i,s;for(s in t.properties)if(s!=="children"&&th.call(t.properties,s)){const l=zN(e,s,t.properties[s]);if(l){const[a,c]=l;e.tableCellAlignToStyle&&a==="align"&&typeof c=="string"&&PN.has(t.tagName)?i=c:n[a]=c}}if(i){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function FN(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const l=i.data.estree.body[0];l.type;const a=l.expression;a.type;const c=a.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else ps(e,t.position);else{const s=i.name;let l;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const c=i.value.data.estree.body[0];c.type,l=e.evaluater.evaluateExpression(c.expression)}else ps(e,t.position);else l=i.value===null?!0:i.value;n[s]=l}return n}function rh(e,t){const n=[];let i=-1;const s=e.passKeys?new Map:CN;for(;++i<t.children.length;){const l=t.children[i];let a;if(e.passKeys){const d=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(d){const h=s.get(d)||0;a=d+"-"+h,s.set(d,h+1)}}const c=F0(e,l,a);c!==void 0&&n.push(c)}return n}function zN(e,t,n){const i=dN(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?eN(n):gN(n)),i.property==="style"){let s=typeof n=="object"?n:VN(e,String(n));return e.stylePropertyNameCase==="css"&&(s=BN(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&i.space?uN[i.property]||i.property:i.attribute,n]}}function VN(e,t){try{return SN(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,s=new jt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=O0+"#cannot-parse-style-attribute",s}}function V0(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let l=-1,a;for(;++l<s.length;){const c=by(s[l])?{type:"Identifier",name:s[l]}:{type:"Literal",value:s[l]};a=a?{type:"MemberExpression",object:a,property:c,computed:!!(l&&c.type==="Literal"),optional:!1}:c}i=a}else i=by(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const s=i.value;return th.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(i);ps(e)}function ps(e,t){const n=new jt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=O0+"#cannot-handle-mdx-estrees-without-createevaluater",n}function BN(e){const t={};let n;for(n in e)th.call(e,n)&&(t[UN(n)]=e[n]);return t}function UN(e){let t=e.replace(EN,$N);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function $N(e){return"-"+e.toLowerCase()}const Xc={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};function WN(e){const t=this;t.parser=n;function n(i){return cw(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function HN(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function KN(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
302
- `}]}function qN(e,t){const n=t.value?t.value+`
303
- `:"",i={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(i.className=["language-"+s[0]]);let l={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function XN(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YN(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GN(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),s=Zi(i.toLowerCase()),l=e.footnoteOrder.indexOf(i);let a,c=e.footnoteCounts.get(i);c===void 0?(c=0,e.footnoteOrder.push(i),a=e.footnoteOrder.length):a=l+1,c+=1,e.footnoteCounts.set(i,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function QN(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZN(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function B0(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const s=e.all(t),l=s[0];l&&l.type==="text"?l.value="["+l.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=i:s.push({type:"text",value:i}),s}function JN(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return B0(e,t);const s={src:Zi(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(s.title=i.title);const l={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,l),e.applyData(t,l)}function ej(e,t){const n={src:Zi(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function tj(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function nj(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return B0(e,t);const s={href:Zi(i.url||"")};i.title!==null&&i.title!==void 0&&(s.title=i.title);const l={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function rj(e,t){const n={href:Zi(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function ij(e,t,n){const i=e.all(t),s=n?oj(n):U0(t),l={},a=[];if(typeof t.checked=="boolean"){const m=i[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},i.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let c=-1;for(;++c<i.length;){const m=i[c];(s||c!==0||m.type!=="element"||m.tagName!=="p")&&a.push({type:"text",value:`
304
- `}),m.type==="element"&&m.tagName==="p"&&!s?a.push(...m.children):a.push(m)}const d=i[i.length-1];d&&(s||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
305
- `});const h={type:"element",tagName:"li",properties:l,children:a};return e.patch(t,h),e.applyData(t,h)}function oj(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=U0(n[i])}return t}function U0(e){const t=e.spread;return t??e.children.length>1}function sj(e,t){const n={},i=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<i.length;){const a=i[s];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function aj(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lj(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function uj(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cj(e,t){const n=e.all(t),i=n.shift(),s=[];if(i){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],a),s.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=eh(t.children[1]),d=L0(t.children[t.children.length-1]);c&&d&&(a.position={start:c,end:d}),s.push(a)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)}function fj(e,t,n){const i=n?n.children:void 0,l=(i?i.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,c=a?a.length:t.children.length;let d=-1;const h=[];for(;++d<c;){const p=t.children[d],y={},w=a?a[d]:void 0;w&&(y.align=w);let k={type:"element",tagName:l,properties:y,children:[]};p&&(k.children=e.all(p),e.patch(p,k),k=e.applyData(p,k)),h.push(k)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,m),e.applyData(t,m)}function dj(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ny=9,jy=32;function hj(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),s=0;const l=[];for(;i;)l.push(Dy(t.slice(s,i.index),s>0,!0),i[0]),s=i.index+i[0].length,i=n.exec(t);return l.push(Dy(t.slice(s),s>0,!1)),l.join("")}function Dy(e,t,n){let i=0,s=e.length;if(t){let l=e.codePointAt(i);for(;l===Ny||l===jy;)i++,l=e.codePointAt(i)}if(n){let l=e.codePointAt(s-1);for(;l===Ny||l===jy;)s--,l=e.codePointAt(s-1)}return s>i?e.slice(i,s):""}function pj(e,t){const n={type:"text",value:hj(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function mj(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const gj={blockquote:HN,break:KN,code:qN,delete:XN,emphasis:YN,footnoteReference:GN,heading:QN,html:ZN,imageReference:JN,image:ej,inlineCode:tj,linkReference:nj,link:rj,listItem:ij,list:sj,paragraph:aj,root:lj,strong:uj,table:cj,tableCell:dj,tableRow:fj,text:pj,thematicBreak:mj,toml:Ka,yaml:Ka,definition:Ka,footnoteDefinition:Ka};function Ka(){}const $0=-1,Fl=0,ns=1,yl=2,ih=3,oh=4,sh=5,ah=6,W0=7,H0=8,K0=typeof self=="object"?self:globalThis,Iy=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new K0[e](t)},yj=(e,t)=>{const n=(s,l)=>(e.set(l,s),s),i=s=>{if(e.has(s))return e.get(s);const[l,a]=t[s];switch(l){case Fl:case $0:return n(a,s);case ns:{const c=n([],s);for(const d of a)c.push(i(d));return c}case yl:{const c=n({},s);for(const[d,h]of a)c[i(d)]=i(h);return c}case ih:return n(new Date(a),s);case oh:{const{source:c,flags:d}=a;return n(new RegExp(c,d),s)}case sh:{const c=n(new Map,s);for(const[d,h]of a)c.set(i(d),i(h));return c}case ah:{const c=n(new Set,s);for(const d of a)c.add(i(d));return c}case W0:{const{name:c,message:d}=a;return n(typeof K0[c]=="function"?Iy(c,d):new Error(d),s)}case H0:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:c}=new Uint8Array(a);return n(new DataView(c),a)}}return n(Iy(l,a),s)};return i},Ly=e=>yj(new Map,e)(0),Zr="",{toString:vj}={},{keys:xj}=Object,Yo=e=>{const t=typeof e;if(t!=="object"||!e)return[Fl,t];const n=vj.call(e).slice(8,-1);switch(n){case"Array":return[ns,Zr];case"Object":return[yl,Zr];case"Date":return[ih,Zr];case"RegExp":return[oh,Zr];case"Map":return[sh,Zr];case"Set":return[ah,Zr];case"DataView":return[ns,n]}return n.includes("Array")?[ns,n]:e instanceof Error?[W0,e.name||"Error"]:[yl,n]},qa=([e,t])=>e===Fl&&(t==="function"||t==="symbol"),wj=(e,t,n,i)=>{const s=(a,c)=>{const d=i.push(a)-1;return n.set(c,d),d},l=a=>{if(n.has(a))return n.get(a);let[c,d]=Yo(a);switch(c){case Fl:{let m=a;switch(d){case"bigint":c=H0,m=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return s([$0],a)}return s([c,m],a)}case ns:{if(d){let y=a;return d==="DataView"?y=new Uint8Array(a.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(a)),s([d,[...y]],a)}const m=[],p=s([c,m],a);for(const y of a)m.push(l(y));return p}case yl:{if(d)switch(d){case"BigInt":return s([d,a.toString()],a);case"Boolean":case"Number":case"String":return s([d,a.valueOf()],a)}if(t&&"toJSON"in a)return l(a.toJSON());const m=[],p=s([c,m],a);for(const y of xj(a))(e||!qa(Yo(a[y])))&&m.push([l(y),l(a[y])]);return p}case ih:return s([c,isNaN(a.getTime())?Zr:a.toISOString()],a);case oh:{const{source:m,flags:p}=a;return s([c,{source:m,flags:p}],a)}case sh:{const m=[],p=s([c,m],a);for(const[y,w]of a)(e||!(qa(Yo(y))||qa(Yo(w))))&&m.push([l(y),l(w)]);return p}case ah:{const m=[],p=s([c,m],a);for(const y of a)(e||!qa(Yo(y)))&&m.push(l(y));return p}}const{message:h}=a;return s([c,{name:d,message:h}],a)};return l},_y=(e,{json:t,lossy:n}={})=>{const i=[];return wj(!(t||n),!!t,new Map,i)(e),i},vl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ly(_y(e,t)):structuredClone(e):(e,t)=>Ly(_y(e,t));function kj(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Sj(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function bj(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||kj,i=e.options.footnoteBackLabel||Sj,s=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[d]);if(!h)continue;const m=e.all(h),p=String(h.identifier).toUpperCase(),y=Zi(p.toLowerCase());let w=0;const k=[],C=e.footnoteCounts.get(p);for(;C!==void 0&&++w<=C;){k.length>0&&k.push({type:"text",value:" "});let A=typeof n=="string"?n:n(d,w);typeof A=="string"&&(A={type:"text",value:A}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(d,w),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const T=m[m.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const A=T.children[T.children.length-1];A&&A.type==="text"?A.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...k)}else m.push(...k);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(m,!0)};e.patch(h,E),c.push(E)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...vl(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
306
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
307
- `}]}}const Yf={}.hasOwnProperty,Cj={};function Ej(e,t){const n=t||Cj,i=new Map,s=new Map,l=new Map,a={...gj,...n.handlers},c={all:h,applyData:Pj,definitionById:i,footnoteById:s,footnoteCounts:l,footnoteOrder:[],handlers:a,one:d,options:n,patch:Tj,wrap:Mj};return jd(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?i:s,y=String(m.identifier).toUpperCase();p.has(y)||p.set(y,m)}}),c;function d(m,p){const y=m.type,w=c.handlers[y];if(Yf.call(c.handlers,y)&&w)return w(c,m,p);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in m){const{children:C,...T}=m,E=vl(T);return E.children=c.all(m),E}return vl(m)}return(c.options.unknownHandler||Rj)(c,m,p)}function h(m){const p=[];if("children"in m){const y=m.children;let w=-1;for(;++w<y.length;){const k=c.one(y[w],m);if(k){if(w&&y[w-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=Oy(k.value)),!Array.isArray(k)&&k.type==="element")){const C=k.children[0];C&&C.type==="text"&&(C.value=Oy(C.value))}Array.isArray(k)?p.push(...k):p.push(k)}}}return p}}function Tj(e,t){e.position&&(t.position=bN(e))}function Pj(e,t){let n=t;if(e&&e.data){const i=e.data.hName,s=e.data.hChildren,l=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const a="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:a}}n.type==="element"&&l&&Object.assign(n.properties,vl(l)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function Rj(e,t){const n=t.data||{},i="value"in t&&!(Yf.call(n,"hProperties")||Yf.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Mj(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
308
- `});++i<e.length;)i&&n.push({type:"text",value:`
309
- `}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
310
- `}),n}function Oy(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Fy(e,t){const n=Ej(e,t),i=n.one(e,void 0),s=bj(n),l=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return s&&l.children.push({type:"text",value:`
311
- `},s),l}function Aj(e,t){return e&&"run"in e?async function(n,i){const s=Fy(n,{file:i,...t});await e.run(s,i)}:function(n,i){return Fy(n,{file:i,...e||t})}}function zy(e){if(e)throw e}var Yc,Vy;function Nj(){if(Vy)return Yc;Vy=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},l=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var m=e.call(h,"constructor"),p=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!p)return!1;var y;for(y in h);return typeof y>"u"||e.call(h,y)},a=function(h,m){n&&m.name==="__proto__"?n(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},c=function(h,m){if(m==="__proto__")if(e.call(h,m)){if(i)return i(h,m).value}else return;return h[m]};return Yc=function d(){var h,m,p,y,w,k,C=arguments[0],T=1,E=arguments.length,A=!1;for(typeof C=="boolean"&&(A=C,C=arguments[1]||{},T=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});T<E;++T)if(h=arguments[T],h!=null)for(m in h)p=c(C,m),y=c(h,m),C!==y&&(A&&y&&(l(y)||(w=s(y)))?(w?(w=!1,k=p&&s(p)?p:[]):k=p&&l(p)?p:{},a(C,{name:m,newValue:d(A,k,y)})):typeof y<"u"&&a(C,{name:m,newValue:y}));return C},Yc}var jj=Nj();const Gc=Td(jj);function Gf(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Dj(){const e=[],t={run:n,use:i};return t;function n(...s){let l=-1;const a=s.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);c(null,...s);function c(d,...h){const m=e[++l];let p=-1;if(d){a(d);return}for(;++p<s.length;)(h[p]===null||h[p]===void 0)&&(h[p]=s[p]);s=h,m?Ij(m,c)(...h):a(null,...h)}}function i(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function Ij(e,t){let n;return i;function i(...a){const c=e.length>a.length;let d;c&&a.push(s);try{d=e.apply(this,a)}catch(h){const m=h;if(c&&n)throw m;return s(m)}c||(d&&d.then&&typeof d.then=="function"?d.then(l,s):d instanceof Error?s(d):l(d))}function s(a,...c){n||(n=!0,t(a,...c))}function l(a){s(null,a)}}const Fn={basename:Lj,dirname:_j,extname:Oj,join:Fj,sep:"/"};function Lj(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Es(e);let n=0,i=-1,s=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else i<0&&(l=!0,i=s+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let a=-1,c=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else a<0&&(l=!0,a=s+1),c>-1&&(e.codePointAt(s)===t.codePointAt(c--)?c<0&&(i=s):(c=-1,i=a));return n===i?i=a:i<0&&(i=e.length),e.slice(n,i)}function _j(e){if(Es(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Oj(e){Es(e);let t=e.length,n=-1,i=0,s=-1,l=0,a;for(;t--;){const c=e.codePointAt(t);if(c===47){if(a){i=t+1;break}continue}n<0&&(a=!0,n=t+1),c===46?s<0?s=t:l!==1&&(l=1):s>-1&&(l=-1)}return s<0||n<0||l===0||l===1&&s===n-1&&s===i+1?"":e.slice(s,n)}function Fj(...e){let t=-1,n;for(;++t<e.length;)Es(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":zj(n)}function zj(e){Es(e);const t=e.codePointAt(0)===47;let n=Vj(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Vj(e,t){let n="",i=0,s=-1,l=0,a=-1,c,d;for(;++a<=e.length;){if(a<e.length)c=e.codePointAt(a);else{if(c===47)break;c=47}if(c===47){if(!(s===a-1||l===1))if(s!==a-1&&l===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),s=a,l=0;continue}}else if(n.length>0){n="",i=0,s=a,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),i=a-s-1;s=a,l=0}else c===46&&l>-1?l++:l=-1}return n}function Es(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Bj={cwd:Uj};function Uj(){return"/"}function Qf(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $j(e){if(typeof e=="string")e=new URL(e);else if(!Qf(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Wj(e)}function Wj(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Qc=["history","path","basename","stem","extname","dirname"];class q0{constructor(t){let n;t?Qf(t)?n={path:t}:typeof t=="string"||Hj(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Bj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Qc.length;){const l=Qc[i];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let s;for(s in n)Qc.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Fn.basename(this.path):void 0}set basename(t){Jc(t,"basename"),Zc(t,"basename"),this.path=Fn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Fn.dirname(this.path):void 0}set dirname(t){By(this.basename,"dirname"),this.path=Fn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Fn.extname(this.path):void 0}set extname(t){if(Zc(t,"extname"),By(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Fn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Qf(t)&&(t=$j(t)),Jc(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Fn.basename(this.path,this.extname):void 0}set stem(t){Jc(t,"stem"),Zc(t,"stem"),this.path=Fn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const s=this.message(t,n,i);throw s.fatal=!0,s}info(t,n,i){const s=this.message(t,n,i);return s.fatal=void 0,s}message(t,n,i){const s=new jt(t,n,i);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Zc(e,t){if(e&&e.includes(Fn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Fn.sep+"`")}function Jc(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function By(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Hj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Kj=function(e){const i=this.constructor.prototype,s=i[e],l=function(){return s.apply(l,arguments)};return Object.setPrototypeOf(l,i),l},qj={}.hasOwnProperty;class lh extends Kj{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Dj()}copy(){const t=new lh;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(Gc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(nf("data",this.frozen),this.namespace[t]=n,this):qj.call(this.namespace,t)&&this.namespace[t]||void 0:t?(nf("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const s=n.call(t,...i);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Xa(t),i=this.parser||this.Parser;return ef("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),ef("process",this.parser||this.Parser),tf("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(l,a){const c=Xa(t),d=i.parse(c);i.run(d,c,function(m,p,y){if(m||!p||!y)return h(m);const w=p,k=i.stringify(w,y);Gj(k)?y.value=k:y.result=k,h(m,y)});function h(m,p){m||!p?a(m):l?l(p):n(void 0,p)}}}processSync(t){let n=!1,i;return this.freeze(),ef("processSync",this.parser||this.Parser),tf("processSync",this.compiler||this.Compiler),this.process(t,s),$y("processSync","process",n),i;function s(l,a){n=!0,zy(l),i=a}}run(t,n,i){Uy(t),this.freeze();const s=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?l(void 0,i):new Promise(l);function l(a,c){const d=Xa(n);s.run(t,d,h);function h(m,p,y){const w=p||t;m?c(m):a?a(w):i(void 0,w,y)}}}runSync(t,n){let i=!1,s;return this.run(t,n,l),$y("runSync","run",i),s;function l(a,c){zy(a),s=c,i=!0}}stringify(t,n){this.freeze();const i=Xa(n),s=this.compiler||this.Compiler;return tf("stringify",s),Uy(t),s(t,i)}use(t,...n){const i=this.attachers,s=this.namespace;if(nf("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...p]=h;d(m,p)}else a(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function a(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(h.plugins),h.settings&&(s.settings=Gc(!0,s.settings,h.settings))}function c(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const p=h[m];l(p)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,m){let p=-1,y=-1;for(;++p<i.length;)if(i[p][0]===h){y=p;break}if(y===-1)i.push([h,...m]);else if(m.length>0){let[w,...k]=m;const C=i[y][1];Gf(C)&&Gf(w)&&(w=Gc(!0,C,w)),i[y]=[h,w,...k]}}}}const Xj=new lh().freeze();function ef(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function tf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function nf(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Uy(e){if(!Gf(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function $y(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Xa(e){return Yj(e)?e:new q0(e)}function Yj(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Gj(e){return typeof e=="string"||Qj(e)}function Qj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Zj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Wy=[],Hy={allowDangerousHtml:!0},Jj=/^(https?|ircs?|mailto|xmpp)$/i,eD=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function X0(e){const t=tD(e),n=nD(e);return rD(t.runSync(t.parse(n),n),e)}function tD(e){const t=e.rehypePlugins||Wy,n=e.remarkPlugins||Wy,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Hy}:Hy;return Xj().use(WN).use(n).use(Aj,i).use(t)}function nD(e){const t=e.children||"",n=new q0;return typeof t=="string"&&(n.value=t),n}function rD(e,t){const n=t.allowedElements,i=t.allowElement,s=t.components,l=t.disallowedElements,a=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||iD;for(const m of eD)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+Zj+m.id,void 0);return jd(e,h),RN(e,{Fragment:v.Fragment,components:s,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function h(m,p,y){if(m.type==="raw"&&y&&typeof p=="number")return a?y.children.splice(p,1):y.children[p]={type:"text",value:m.value},p;if(m.type==="element"){let w;for(w in Xc)if(Object.hasOwn(Xc,w)&&Object.hasOwn(m.properties,w)){const k=m.properties[w],C=Xc[w];(C===null||C.includes(m.tagName))&&(m.properties[w]=d(String(k||""),w,m))}}if(m.type==="element"){let w=n?!n.includes(m.tagName):l?l.includes(m.tagName):!1;if(!w&&i&&typeof p=="number"&&(w=!i(m,p,y)),w&&y&&typeof p=="number")return c&&m.children?y.children.splice(p,1,...m.children):y.children.splice(p,1),p}}}function iD(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||i!==-1&&t>i||Jj.test(e.slice(0,t))?e:""}const oD={};function Y0(e){const t=this,n=e||oD,i=t.data(),s=i.micromarkExtensions||(i.micromarkExtensions=[]),l=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),a=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);s.push(ww(n)),l.push(Zx()),a.push(uP(n))}function Ts(e){return v.jsx(v0,{open:!0,onOpenChange:t=>{t||e.onClose()},children:v.jsxs(k0,{children:[v.jsx(S0,{className:"modal-backdrop"}),v.jsxs(b0,{className:"modal"+(e.wide?" modal-wide":"")+(e.className?` ${e.className}`:""),children:[v.jsxs("div",{className:"modal-head",children:[v.jsxs("div",{children:[v.jsx(E0,{asChild:!0,children:v.jsx("h3",{children:e.title})}),e.description&&v.jsx(T0,{className:"modal-description",children:e.description})]}),v.jsx(P0,{asChild:!0,children:v.jsx("button",{className:"icon-btn","aria-label":`Close ${e.title}`,children:v.jsx(ve,{name:"close"})})})]}),e.tabs,v.jsx("div",{className:"modal-body",children:e.children})]})]})})}const sD=.25,aD=8;let Ky=Promise.resolve();function qy(){return document.documentElement.classList.contains("theme-dark")?"dark":"default"}function lD(){const[e,t]=S.useState(qy);return S.useEffect(()=>{const n=document.documentElement,i=()=>t(qy()),s=new MutationObserver(i);return s.observe(n,{attributes:!0,attributeFilter:["class"]}),i(),()=>s.disconnect()},[]),e}function uD(e,t,n){const i=Ky.then(async()=>{const{default:s}=await Ud(async()=>{const{default:l}=await import("./mermaid.core-D_k6Q_o7.js").then(a=>a.bp);return{default:l}},[]);return s.initialize({startOnLoad:!1,securityLevel:"strict",theme:n,fontFamily:"var(--sans)"}),s.render(e,t)});return Ky=i.then(()=>{},()=>{}),i}function cD(e){return Math.min(aD,Math.max(sD,e))}function fD(e){const t=S.useRef(null),n=S.useRef(null),[i,s]=S.useState(1),[l,a]=S.useState({x:0,y:0}),[c,d]=S.useState(!1),h=()=>{s(1),a({x:0,y:0})},m=(p,y,w)=>{const k=cD(p);if(k===i)return;const C=t.current?.getBoundingClientRect();if(C){const T=(y??C.left+C.width/2)-C.left-C.width/2,E=(w??C.top+C.height/2)-C.top-C.height/2,A=k/i;a(M=>({x:T-A*(T-M.x),y:E-A*(E-M.y)}))}s(k)};return S.useEffect(()=>{const p=y=>{y.key==="+"||y.key==="="?(y.preventDefault(),m(i*1.25)):y.key==="-"?(y.preventDefault(),m(i/1.25)):y.key==="0"&&(y.preventDefault(),h())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)}),v.jsx(v0,{open:!0,onOpenChange:p=>{p||e.onClose()},children:v.jsxs(k0,{children:[v.jsx(S0,{className:"mermaid-fullscreen-backdrop"}),v.jsxs(b0,{className:"mermaid-fullscreen","data-mermaid-theme":e.theme,"aria-describedby":"mermaid-fullscreen-help",children:[v.jsx(E0,{className:"mermaid-fullscreen-title",children:"Diagram viewer"}),v.jsxs("div",{className:"mermaid-fullscreen-tools",children:[v.jsx("button",{className:"icon-btn","aria-label":"Zoom out",title:"Zoom out (−)",onClick:()=>m(i/1.25),children:v.jsx(ve,{name:"minus"})}),v.jsxs("button",{className:"mermaid-zoom-value",onClick:h,title:"Reset zoom and position",children:[Math.round(i*100),"%"]}),v.jsx("button",{className:"icon-btn","aria-label":"Zoom in",title:"Zoom in (+)",onClick:()=>m(i*1.25),children:v.jsx(ve,{name:"plus"})}),v.jsx(P0,{asChild:!0,children:v.jsx("button",{className:"icon-btn","aria-label":"Close diagram viewer",title:"Close (Esc)",children:v.jsx(ve,{name:"close"})})})]}),v.jsx("div",{ref:t,className:"mermaid-fullscreen-viewport"+(c?" dragging":""),onWheel:p=>{p.preventDefault(),m(i*Math.exp(-p.deltaY*.0015),p.clientX,p.clientY)},onDoubleClick:p=>m(i*1.5,p.clientX,p.clientY),onPointerDown:p=>{p.button===0&&(n.current={pointerId:p.pointerId,startX:p.clientX,startY:p.clientY,panX:l.x,panY:l.y},p.currentTarget.setPointerCapture(p.pointerId),d(!0))},onPointerMove:p=>{const y=n.current;!y||y.pointerId!==p.pointerId||a({x:y.panX+p.clientX-y.startX,y:y.panY+p.clientY-y.startY})},onPointerUp:p=>{n.current?.pointerId===p.pointerId&&(n.current=null,d(!1),p.currentTarget.releasePointerCapture(p.pointerId))},onPointerCancel:()=>{n.current=null,d(!1)},children:v.jsx("div",{className:"mermaid-fullscreen-canvas",style:{transform:`translate(${l.x}px, ${l.y}px) scale(${i})`},dangerouslySetInnerHTML:{__html:e.svg}})}),v.jsx(T0,{id:"mermaid-fullscreen-help",className:"mermaid-fullscreen-help",children:"Scroll to zoom · drag to move · double-click to zoom in"})]})]})})}function dD({source:e}){const t=S.useId(),[n,i]=S.useState(""),[s,l]=S.useState(""),[a,c]=S.useState("default"),[d,h]=S.useState(!1),m=lD();return S.useEffect(()=>{let p=!0;const y=`mermaid-${t.replace(/[^a-zA-Z0-9_-]/g,"")}`;return i(""),l(""),uD(y,e,m).then(w=>{p&&(c(m),i(w.svg))}).catch(w=>{p&&l(w instanceof Error?w.message:String(w))}),()=>{p=!1,document.getElementById(`d${y}`)?.remove()}},[t,e,m]),s?v.jsxs("pre",{className:"markdown-mermaid-error",children:["Mermaid error: ",s]}):n?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"markdown-mermaid","data-mermaid-theme":a,children:[v.jsx("button",{className:"icon-btn markdown-mermaid-expand","aria-label":"View diagram fullscreen",title:"View diagram fullscreen",onClick:()=>h(!0),children:v.jsx(ve,{name:"maximize"})}),v.jsx("div",{className:"markdown-mermaid-diagram",dangerouslySetInnerHTML:{__html:n}})]}),d&&v.jsx(fD,{svg:n,theme:a,onClose:()=>h(!1)})]}):v.jsx("div",{className:"markdown-mermaid-loading",children:"Rendering diagram…"})}const hD=S.memo(function(t){return v.jsx("article",{className:"markdown-body",ref:t.contentRef,children:v.jsx(X0,{remarkPlugins:[Y0],components:{a:({children:n,...i})=>v.jsx("a",{...i,target:"_blank",rel:"noreferrer",children:n}),code:({className:n,children:i,...s})=>{const l=/language-([\w-]+)/.exec(n??"")?.[1],a=String(i).replace(/\n$/,"");return l==="mermaid"?v.jsx(dD,{source:a}):v.jsx("code",{className:n,...s,children:i})}},children:t.markdown})})});function pD(e){const{rec:t}=e,n=S.useRef(null),[i,s]=S.useState(""),[l,a]=S.useState(null),[c,d]=S.useState("loading"),[h,m]=S.useState(""),[p,y]=S.useState(0),[w,k]=S.useState(""),[C,T]=S.useState(0),[E,A]=S.useState(!1),[M,_]=S.useState(""),[W,D]=S.useState(!1),[Y,H]=S.useState(!1),[X,j]=S.useState([]),[G,U]=S.useState(!1),[fe,se]=S.useState(null),[ee,xe]=S.useState(!1),[Ee,q]=S.useState("");S.useEffect(()=>{let R=!0,Z=null;return d("loading"),Nl(t.id).then(de=>{if(R){if(!de){d("missing");return}s(new TextDecoder("utf-8").decode(de)),Z=URL.createObjectURL(new Blob([de],{type:"text/markdown;charset=utf-8"})),a(Z),d("ready")}}).catch(()=>{R&&d("error")}),()=>{R=!1,Z&&URL.revokeObjectURL(Z)}},[t.id]),S.useEffect(()=>{const R=()=>{const Z=window.getSelection(),de=n.current;if(!Z||Z.isCollapsed||!de){m(""),y(0);return}if(!de.contains(Z.anchorNode)||!de.contains(Z.focusNode)){m(""),y(0);return}const ie=Z.getRangeAt(0),Ce=Z.toString(),ge=Ce.length-Ce.trimStart().length,Te=Ce.trim().slice(0,4e3),je=document.createRange();je.selectNodeContents(de),je.setEnd(ie.startContainer,ie.startOffset);const $e=je.toString().length+ge;m(Te),y(L2(de.textContent,Te,$e))};return document.addEventListener("selectionchange",R),()=>document.removeEventListener("selectionchange",R)},[]);const le=()=>{h&&(k(h),T(p),A(!0),q(""))},P=async()=>{if(Y){if(!w||!M.trim())return;j(Z=>[...Z,{selection:w,comment:M.trim(),occurrence:C}]),_(""),A(!1),q("Comment added to review");return}const R=D2(w,M);if(!(!R||!M.trim()||W)){D(!0),q("");try{await e.onSendText(R,t.id||void 0),_(""),A(!1),q("Feedback sent")}catch(Z){q(`Send failed: ${String(Z)}`)}finally{D(!1)}}},L=async()=>{if(X.length===0||G)return;const R=B2(i,X);U(!0),q("");try{e.onSendFile?await e.onSendFile({filename:I2(t.filename),mime:"text/markdown",bytes:new TextEncoder().encode(R)},t.id||void 0):await e.onSendText(R,t.id||void 0),j([]),H(!1),q("Review submitted")}catch(Z){q(`Review send failed: ${String(Z)}`)}finally{U(!1)}},Q=async()=>{if(!(!fe||!e.onSendFile||ee)){xe(!0),q("");try{await e.onSendFile(fe,t.id||void 0),se(null),q("Voice feedback sent")}catch(R){q(`Voice send failed: ${String(R)}`)}finally{xe(!1)}}};return v.jsx(Ts,{title:t.filename,description:"Markdown preview · select text to send precise feedback",onClose:e.onClose,wide:!0,className:"markdown-modal",children:v.jsxs("div",{className:"markdown-preview",children:[v.jsxs("div",{className:"markdown-review-toolbar",children:[v.jsxs("button",{className:"btn sm",disabled:!h,onMouseDown:R=>R.preventDefault(),onClick:le,children:[v.jsx(ve,{name:"reply",size:14}),Y?"Add review comment":"Quick message",h?` (${h.length})`:""]}),Y?v.jsx("button",{className:"btn sm",onClick:()=>{H(!1),j([]),A(!1),q("Review discarded")},children:"Cancel review"}):v.jsxs("button",{className:"btn sm",onClick:()=>{H(!0),j([]),q("Review started — select passages to add comments")},children:[v.jsx(ve,{name:"edit",size:14}),"Start review"]}),l&&v.jsxs("a",{className:"btn sm",href:l,download:t.filename,children:[v.jsx(ve,{name:"download",size:14}),"Download"]}),e.onSendFile&&v.jsx(Aw,{disabled:!!fe||ee,onReady:se,onError:q}),v.jsx("span",{className:"markdown-review-hint",children:h?"Selection ready for feedback":"Highlight any passage to comment on it"})]}),E&&v.jsxs("div",{className:"markdown-feedback",children:[v.jsx("blockquote",{children:w}),v.jsx("textarea",{className:"field",rows:3,autoFocus:!0,placeholder:"What should change?",value:M,onChange:R=>_(R.target.value)}),v.jsxs("div",{className:"markdown-feedback-actions",children:[v.jsx("button",{className:"btn sm",onClick:()=>A(!1),children:"Cancel"}),v.jsxs("button",{className:"btn sm primary",disabled:!M.trim()||W,onClick:()=>void P(),children:[v.jsx(ve,{name:"send",size:14}),Y?"Add to review":W?"Sending…":"Send feedback"]})]})]}),Y&&v.jsxs("div",{className:"markdown-review-draft",children:[v.jsxs("div",{className:"markdown-review-draft-head",children:[v.jsxs("strong",{children:["Review · ",X.length," comment",X.length===1?"":"s"]}),v.jsxs("button",{className:"btn sm primary",disabled:X.length===0||G,onClick:()=>void L(),children:[v.jsx(ve,{name:"send",size:14}),G?"Submitting…":"Submit review"]})]}),X.map((R,Z)=>v.jsxs("div",{className:"markdown-review-comment",children:[v.jsx("span",{children:Z+1}),v.jsxs("div",{children:[v.jsx("blockquote",{children:R.selection}),v.jsx("p",{children:R.comment})]}),v.jsx("button",{className:"icon-btn",title:"Remove comment",onClick:()=>j(de=>de.filter((ie,Ce)=>Ce!==Z)),children:v.jsx(ve,{name:"close",size:14})})]},`${Z}-${R.selection.slice(0,24)}`))]}),fe&&v.jsx(Mw,{att:fe,sending:ee,onSend:()=>void Q(),onDiscard:()=>se(null)}),Ee&&v.jsx("div",{className:"markdown-review-status",role:"status",children:Ee}),v.jsxs("div",{className:"markdown-preview-scroll",children:[c==="loading"&&v.jsx("div",{className:"markdown-empty",children:"Loading preview…"}),c==="missing"&&v.jsx("div",{className:"markdown-empty",children:"This file is available on the original device only."}),c==="error"&&v.jsx("div",{className:"markdown-empty",children:"The file could not be opened."}),c==="ready"&&v.jsx(hD,{markdown:i,contentRef:n})]})]})})}function mD(e){const{rec:t}=e,[n,i]=S.useState(""),[s,l]=S.useState(null),[a,c]=S.useState(0),[d,h]=S.useState("loading");return S.useEffect(()=>{let m=!0,p=null;return h("loading"),Nl(t.id).then(y=>{if(m){if(!y){h("missing");return}i(X2(new TextDecoder("utf-8").decode(y))),c(y.byteLength),p=URL.createObjectURL(new Blob([y],{type:Fd(t.mime,t.filename)})),l(p),h("ready")}}).catch(()=>{m&&h("error")}),()=>{m=!1,p&&URL.revokeObjectURL(p)}},[t.id,t.mime,t.filename]),v.jsx(Ts,{title:t.filename,description:"HTML preview · sandboxed, static rendering only",onClose:e.onClose,wide:!0,className:"markdown-modal html-modal",children:v.jsxs("div",{className:"html-preview",children:[v.jsxs("div",{className:"html-preview-toolbar",children:[v.jsxs("span",{className:"html-preview-shield",children:[v.jsx(ve,{name:"shield",size:14}),"Scripts, forms and network requests are blocked"]}),s&&v.jsxs("a",{className:"btn sm",href:s,download:t.filename,children:[v.jsx(ve,{name:"download",size:14}),"Download original",a?` · ${Rr(a)}`:""]})]}),v.jsxs("div",{className:"html-preview-frame",children:[d==="loading"&&v.jsx("div",{className:"markdown-empty",children:"Loading preview…"}),d==="missing"&&v.jsx("div",{className:"markdown-empty",children:"This file is available on the original device only."}),d==="error"&&v.jsx("div",{className:"markdown-empty",children:"The file could not be opened."}),d==="ready"&&v.jsx("iframe",{className:"html-preview-iframe",title:`Sandboxed preview of ${t.filename}`,sandbox:$2,referrerPolicy:"no-referrer",srcDoc:n})]})]})})}function Zf(e){const{message:t}=e,[n,i]=S.useState(null),[s,l]=S.useState(0),a=Nx(t.wireId)??{id:t.wireId,dir:t.dir,filename:t.filename??"file",mime:t.mime??"application/octet-stream",size:s,date:t.date};S.useEffect(()=>{let h=!0,m=null;if(t.wireId)return Nl(t.wireId).then(p=>{!h||!p||(l(p.byteLength),m=URL.createObjectURL(new Blob([p],{type:Fd(a.mime,a.filename)})),i(m))}).catch(()=>{}),()=>{h=!1,m&&URL.revokeObjectURL(m)}},[t.wireId,a.mime,a.filename]);const c=Df(t)==="photo",d=qi(a.mime,a.filename);return v.jsxs("div",{className:"shared-media-item"+(c?" shared-photo-item":""),children:[v.jsxs("button",{className:"shared-media-jump",onClick:()=>e.onJump(e.messageKey),children:[c&&n?v.jsx("img",{src:n,alt:a.filename}):v.jsx("span",{className:"shared-media-icon",children:v.jsx(ve,{name:d?"mic":"copy",size:18})}),v.jsxs("span",{className:"shared-media-copy",children:[v.jsx("strong",{children:c?a.filename||"Photo":d?"Voice message":a.filename}),v.jsxs("span",{children:[e.versionLabel?`${e.versionLabel} · `:"",cs(a.date),s?` · ${Rr(s)}`:""]})]})]}),v.jsxs("span",{className:"shared-media-actions",children:[kw(a.filename)&&n&&v.jsx("button",{className:"icon-btn",title:"Preview markdown",onClick:()=>e.onPreview(a),children:v.jsx(ve,{name:"monitor",size:16})}),_l(a.filename,a.mime)&&n&&v.jsx("button",{className:"icon-btn",title:"Preview HTML",onClick:()=>e.onPreview(a),children:v.jsx(ve,{name:"monitor",size:16})}),v.jsx("a",{className:"icon-btn"+(n?"":" disabled"),href:n??void 0,download:a.filename,title:"Download",children:v.jsx(ve,{name:"download",size:16})})]})]})}function gD(e){const[t,n]=S.useState(!1);if(e.versions.length===1){const i=e.versions[0];return v.jsx(Zf,{message:i.message,messageKey:i.key,onJump:e.onJump,onPreview:e.onPreview})}return v.jsxs("div",{className:"file-version-stack"+(t?" expanded":""),children:[v.jsxs("button",{className:"file-version-stack-head",onClick:()=>n(i=>!i),children:[v.jsx("span",{className:"shared-media-icon",children:v.jsx(ve,{name:"copy",size:18})}),v.jsxs("span",{className:"shared-media-copy",children:[v.jsx("strong",{children:e.filename}),v.jsxs("span",{children:[e.versions.length," versions · newest ",cs(e.versions[0].message.date)]})]}),v.jsx(ve,{name:t?"chevronDown":"chevron",size:16})]}),t&&v.jsx("div",{className:"file-version-stack-list",children:e.versions.map((i,s)=>v.jsx(Zf,{message:i.message,messageKey:i.key,versionLabel:`Version ${e.versions.length-s}`,onJump:e.onJump,onPreview:e.onPreview},i.key))})]})}function yD(e){const[t,n]=S.useState("photo"),i=e.messages.map((h,m)=>({message:h,key:h.wireId||`${h.date}-${(e.indexOffset??0)+m}`})),s=i.filter(({message:h})=>Df(h)==="photo"),l=i.filter(({message:h})=>Df(h)==="file"),a=O2(l),c=i.flatMap(({message:h,key:m})=>h.kind==="file"?[]:_2(h.text).map(p=>({url:p,message:h,key:m}))),d=[{id:"photo",label:"Photos",count:s.length},{id:"file",label:"Files",count:l.length},{id:"link",label:"Links",count:c.length}];return v.jsx(Ts,{title:"Shared media",description:"Photos, files, and links from this conversation",onClose:e.onClose,wide:!0,className:"shared-media-modal",tabs:v.jsx("div",{className:"shared-media-tabs",role:"tablist","aria-label":"Shared media type",children:d.map(h=>v.jsxs("button",{role:"tab","aria-selected":t===h.id,className:t===h.id?"active":"",onClick:()=>n(h.id),children:[h.label," ",v.jsx("span",{children:h.count})]},h.id))}),children:v.jsxs("div",{className:"shared-media-list"+(t==="photo"?" photos":""),children:[t==="photo"&&s.map(h=>v.jsx(Zf,{message:h.message,messageKey:h.key,onJump:e.onJump,onPreview:e.onPreview},h.key)),t==="file"&&a.map(h=>v.jsx(gD,{filename:h.filename,versions:h.versions,onJump:e.onJump,onPreview:e.onPreview},h.filename)),t==="link"&&c.map((h,m)=>v.jsxs("div",{className:"shared-media-item",children:[v.jsxs("a",{className:"shared-media-jump",href:h.url,target:"_blank",rel:"noreferrer",children:[v.jsx("span",{className:"shared-media-icon",children:v.jsx(ve,{name:"link",size:18})}),v.jsxs("span",{className:"shared-media-copy",children:[v.jsx("strong",{children:h.url}),v.jsx("span",{children:cs(h.message.date)})]})]}),v.jsx("button",{className:"icon-btn",title:"Jump to message",onClick:()=>e.onJump(h.key),children:v.jsx(ve,{name:"reply",size:16})})]},`${h.key}-${h.url}-${m}`)),(t==="photo"&&s.length===0||t==="file"&&l.length===0||t==="link"&&c.length===0)&&v.jsxs("div",{className:"markdown-empty",children:["No ",t==="photo"?"photos":`${t}s`," in this chat yet."]})]})})}const vD=Object.freeze(["image/avif","image/bmp","image/heic","image/heif","image/jpeg","image/jpg","image/png","image/webp"]),xD=/\.(avif|bmp|heic|heif|jpe?g|png|webp)$/i;function G0(e,t=""){return vD.includes(String(e??"").toLowerCase())||xD.test(String(t??""))}function wD(e){return`${(String(e||"photo").trim()||"photo").replace(/\.[^./\\]+$/,"")||"photo"}.jpg`}function kD(e,t,n){const i=Math.max(1,Number(e)||1),s=Math.max(1,Number(t)||1),l=Math.max(1,Number(n)||1),a=Math.min(1,l/Math.max(i,s));return{width:Math.max(1,Math.round(i*a)),height:Math.max(1,Math.round(s*a))}}const SD=2048,bD=640,CD=.82,ED=[.84,.7,.56,.44],TD=.94;function PD(e){return new Promise((t,n)=>{const i=URL.createObjectURL(e),s=new Image,l=()=>URL.revokeObjectURL(i);s.onload=()=>t({image:s,release:l}),s.onerror=()=>{l(),n(new Error("This browser could not decode the selected image."))},s.src=i})}function RD(e,t){return new Promise((n,i)=>{e.toBlob(s=>s?n(s):i(new Error("This browser could not encode the optimized photo.")),"image/jpeg",t)})}async function MD(e,t){if(!G0(e.type,e.name))throw new Error("This image format cannot be optimized safely in this browser.");const n=Math.max(1,Math.floor(t*TD)),{image:i,release:s}=await PD(e),l=document.createElement("canvas"),a=l.getContext("2d",{alpha:!1});if(!a)throw s(),new Error("Photo optimization is unavailable in this browser.");try{let c=Math.min(SD,Math.max(i.naturalWidth,i.naturalHeight));for(;c>=bD;){const d=kD(i.naturalWidth,i.naturalHeight,c);l.width=d.width,l.height=d.height,a.fillStyle="#fff",a.fillRect(0,0,l.width,l.height),a.drawImage(i,0,0,l.width,l.height);for(const h of ED){const m=await RD(l,h);if(m.size<=n)return{filename:wD(e.name),mime:"image/jpeg",bytes:new Uint8Array(await m.arrayBuffer()),width:l.width,height:l.height,originalSize:e.size}}c=Math.floor(c*CD)}}finally{s(),l.width=1,l.height=1}throw new Error("The photo is still too large after optimization.")}const AD=5e4,ND=new Set(["http:","https:","mailto:"]);function Q0(e){if(!(!e||e!==e.trim()||/[\u0000-\u001f\u007f]/u.test(e)))try{const t=new URL(e);return ND.has(t.protocol.toLowerCase())?e:void 0}catch{return}}function Z0(e){const t="language-";return e?.startsWith(t)&&e.slice(t.length)||void 0}function jD(e){return e.split(/(\n[ \t]*\n)/).map(t=>{if(/^\n[ \t]*\n$/.test(t))return t;const n=t.split(`
312
- `),i=n.filter(a=>a.trim().length>0);if(i.length===0)return t;const s=i.map(a=>a.match(/^[ \t]+/)?.[0]??"");if(s.some(a=>a.length===0))return t;const l=Math.min(...s.map(a=>a.length));return n.map(a=>a.trim().length>0?a.slice(l):a).join(`
313
- `)}).join("")}function DD({children:e}){const t=S.isValidElement(e)?e:null,n=Z0(t?.props.className);return v.jsxs("div",{className:"message-code-block","data-language":n||void 0,children:[n&&v.jsx("div",{className:"message-code-language",children:n}),v.jsx("pre",{children:e})]})}const ID=[Y0],LD={a:({node:e,children:t,href:n,...i})=>{const s=Q0(n);return s?v.jsx("a",{...i,href:s,target:"_blank",rel:"noopener noreferrer",children:t}):v.jsx("span",{className:"message-link-blocked",children:t})},img:({alt:e})=>v.jsxs("span",{className:"message-image-placeholder",children:["[image: ",e||"remote image blocked","]"]}),pre:DD,code:({node:e,className:t,children:n,...i})=>v.jsx("code",{className:t,"data-language":Z0(t),...i,children:n})},Xy=S.memo(function({text:t,className:n="bubble-text message-markdown"}){return t.length>AD?v.jsx("div",{className:`${n} message-markdown-plaintext`,"data-render-mode":"plaintext",children:t}):v.jsx("div",{className:n,"data-render-mode":"markdown",children:v.jsx(X0,{remarkPlugins:ID,components:LD,urlTransform:i=>Q0(i)??"",children:jD(t)})})}),uh=S.createContext({});function ch(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}const _D=typeof window<"u",fh=_D?S.useLayoutEffect:S.useEffect,zl=S.createContext(null);function dh(e,t){e.indexOf(t)===-1&&e.push(t)}function xl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const $n=(e,t,n)=>n>t?t:n<e?e:n;let Vl=()=>{};const Ar={},J0=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),e1=e=>typeof e=="object"&&e!==null,t1=e=>/^0[^.\s]+$/u.test(e);function n1(e){let t;return()=>(t===void 0&&(t=e()),t)}const vn=e=>e,Ps=(...e)=>e.reduce((t,n)=>i=>n(t(i))),ms=(e,t,n)=>{const i=t-e;return i?(n-e)/i:1};class hh{constructor(){this.subscriptions=[]}add(t){return dh(this.subscriptions,t),()=>xl(this.subscriptions,t)}notify(t,n,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,i);else for(let l=0;l<s;l++){const a=this.subscriptions[l];a&&a(t,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const sn=e=>e*1e3,yn=e=>e/1e3,r1=(e,t)=>t?e*(1e3/t):0,i1=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,OD=1e-7,FD=12;function zD(e,t,n,i,s){let l,a,c=0;do a=t+(n-t)/2,l=i1(a,i,s)-e,l>0?n=a:t=a;while(Math.abs(l)>OD&&++c<FD);return a}function Rs(e,t,n,i){if(e===t&&n===i)return vn;const s=l=>zD(l,0,1,e,n);return l=>l===0||l===1?l:i1(s(l),t,i)}const o1=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,s1=e=>t=>1-e(1-t),a1=Rs(.33,1.53,.69,.99),ph=s1(a1),l1=o1(ph),u1=e=>e>=1?1:(e*=2)<1?.5*ph(e):.5*(2-Math.pow(2,-10*(e-1))),mh=e=>1-Math.sin(Math.acos(e)),c1=s1(mh),f1=o1(mh),VD=Rs(.42,0,1,1),BD=Rs(0,0,.58,1),d1=Rs(.42,0,.58,1),UD=e=>Array.isArray(e)&&typeof e[0]!="number",h1=e=>Array.isArray(e)&&typeof e[0]=="number",$D={linear:vn,easeIn:VD,easeInOut:d1,easeOut:BD,circIn:mh,circInOut:f1,circOut:c1,backIn:ph,backInOut:l1,backOut:a1,anticipate:u1},WD=e=>typeof e=="string",Yy=e=>{if(h1(e)){Vl(e.length===4);const[t,n,i,s]=e;return Rs(t,n,i,s)}else if(WD(e))return $D[e];return e},Ya=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function HD(e){let t=new Set,n=new Set,i=!1,s=!1;const l=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(h){l.has(h)&&(d.schedule(h),e()),h(a)}const d={schedule:(h,m=!1,p=!1)=>{const w=p&&i?t:n;return m&&l.add(h),w.add(h),h},cancel:h=>{n.delete(h),l.delete(h)},process:h=>{if(a=h,i){s=!0;return}i=!0;const m=t;t=n,n=m,t.forEach(c),t.clear(),i=!1,s&&(s=!1,d.process(h))}};return d}const KD=40;function p1(e,t){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},l=()=>n=!0,a=Ya.reduce((M,_)=>(M[_]=HD(l),M),{}),{setup:c,read:d,resolveKeyframes:h,preUpdate:m,update:p,preRender:y,render:w,postRender:k}=a,C=()=>{const M=Ar.useManualTiming,_=M?s.timestamp:performance.now();n=!1,M||(s.delta=i?1e3/60:Math.max(Math.min(_-s.timestamp,KD),1)),s.timestamp=_,s.isProcessing=!0,c.process(s),d.process(s),h.process(s),m.process(s),p.process(s),y.process(s),w.process(s),k.process(s),s.isProcessing=!1,n&&t&&(i=!1,e(C))},T=()=>{n=!0,i=!0,s.isProcessing||e(C)};return{schedule:Ya.reduce((M,_)=>{const W=a[_];return M[_]=(D,Y=!1,H=!1)=>(n||T(),W.schedule(D,Y,H)),M},{}),cancel:M=>{for(let _=0;_<Ya.length;_++)a[Ya[_]].cancel(M)},state:s,steps:a}}const{schedule:Xe,cancel:Nr,state:Ct,steps:rf}=p1(typeof requestAnimationFrame<"u"?requestAnimationFrame:vn,!0);let il;function qD(){il=void 0}const Vt={now:()=>(il===void 0&&Vt.set(Ct.isProcessing||Ar.useManualTiming?Ct.timestamp:performance.now()),il),set:e=>{il=e,queueMicrotask(qD)}},m1=e=>t=>typeof t=="string"&&t.startsWith(e),g1=m1("--"),XD=m1("var(--"),gh=e=>XD(e)?YD.test(e.split("/*")[0].trim()):!1,YD=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Gy(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const no={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},gs={...no,transform:e=>$n(0,1,e)},Ga={...no,default:1},rs=e=>Math.round(e*1e5)/1e5,yh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function GD(e){return e==null}const QD=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,vh=(e,t)=>n=>!!(typeof n=="string"&&QD.test(n)&&n.startsWith(e)||t&&!GD(n)&&Object.prototype.hasOwnProperty.call(n,t)),y1=(e,t,n)=>i=>{if(typeof i!="string")return i;const[s,l,a,c]=i.match(yh);return{[e]:parseFloat(s),[t]:parseFloat(l),[n]:parseFloat(a),alpha:c!==void 0?parseFloat(c):1}},ZD=e=>$n(0,255,e),of={...no,transform:e=>Math.round(ZD(e))},ei={test:vh("rgb","red"),parse:y1("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+of.transform(e)+", "+of.transform(t)+", "+of.transform(n)+", "+rs(gs.transform(i))+")"};function JD(e){let t="",n="",i="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,i+=i,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const Jf={test:vh("#"),parse:JD,transform:ei.transform},Ms=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),er=Ms("deg"),Un=Ms("%"),ke=Ms("px"),eI=Ms("vh"),tI=Ms("vw"),Qy={...Un,parse:e=>Un.parse(e)/100,transform:e=>Un.transform(e*100)},$i={test:vh("hsl","hue"),parse:y1("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Un.transform(rs(t))+", "+Un.transform(rs(n))+", "+rs(gs.transform(i))+")"},dt={test:e=>ei.test(e)||Jf.test(e)||$i.test(e),parse:e=>ei.test(e)?ei.parse(e):$i.test(e)?$i.parse(e):Jf.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ei.transform(e):$i.transform(e),getAnimatableNone:e=>{const t=dt.parse(e);return t.alpha=0,dt.transform(t)}},nI=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function rI(e){return isNaN(e)&&typeof e=="string"&&(e.match(yh)?.length||0)+(e.match(nI)?.length||0)>0}const v1="number",x1="color",iI="var",oI="var(",Zy="${}",sI=/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 Gi(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},s=[];let l=0;const c=t.replace(sI,d=>(dt.test(d)?(i.color.push(l),s.push(x1),n.push(dt.parse(d))):d.startsWith(oI)?(i.var.push(l),s.push(iI),n.push(d)):(i.number.push(l),s.push(v1),n.push(parseFloat(d))),++l,Zy)).split(Zy);return{values:n,split:c,indexes:i,types:s}}function aI(e){return Gi(e).values}function w1({split:e,types:t}){const n=e.length;return i=>{let s="";for(let l=0;l<n;l++)if(s+=e[l],i[l]!==void 0){const a=t[l];a===v1?s+=rs(i[l]):a===x1?s+=dt.transform(i[l]):s+=i[l]}return s}}function lI(e){return w1(Gi(e))}const uI=e=>typeof e=="number"?0:dt.test(e)?dt.getAnimatableNone(e):e,cI=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:uI(e);function fI(e){const t=Gi(e);return w1(t)(t.values.map((i,s)=>cI(i,t.split[s])))}const An={test:rI,parse:aI,createTransformer:lI,getAnimatableNone:fI};function sf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function dI({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let s=0,l=0,a=0;if(!t)s=l=a=n;else{const c=n<.5?n*(1+t):n+t-n*t,d=2*n-c;s=sf(d,c,e+1/3),l=sf(d,c,e),a=sf(d,c,e-1/3)}return{red:Math.round(s*255),green:Math.round(l*255),blue:Math.round(a*255),alpha:i}}function wl(e,t){return n=>n>0?t:e}const qe=(e,t,n)=>e+(t-e)*n,af=(e,t,n)=>{const i=e*e,s=n*(t*t-i)+i;return s<0?0:Math.sqrt(s)},hI=[Jf,ei,$i],pI=e=>hI.find(t=>t.test(e));function Jy(e){const t=pI(e);if(!t)return!1;let n=t.parse(e);return t===$i&&(n=dI(n)),n}const ev=(e,t)=>{const n=Jy(e),i=Jy(t);if(!n||!i)return wl(e,t);const s={...n};return l=>(s.red=af(n.red,i.red,l),s.green=af(n.green,i.green,l),s.blue=af(n.blue,i.blue,l),s.alpha=qe(n.alpha,i.alpha,l),ei.transform(s))},ed=new Set(["none","hidden"]);function mI(e,t){return ed.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function gI(e,t){return n=>qe(e,t,n)}function xh(e){return typeof e=="number"?gI:typeof e=="string"?gh(e)?wl:dt.test(e)?ev:xI:Array.isArray(e)?k1:typeof e=="object"?dt.test(e)?ev:yI:wl}function k1(e,t){const n=[...e],i=n.length,s=e.map((l,a)=>xh(l)(l,t[a]));return l=>{for(let a=0;a<i;a++)n[a]=s[a](l);return n}}function yI(e,t){const n={...e,...t},i={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(i[s]=xh(e[s])(e[s],t[s]));return s=>{for(const l in i)n[l]=i[l](s);return n}}function vI(e,t){const n=[],i={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const l=t.types[s],a=e.indexes[l][i[l]],c=e.values[a]??0;n[s]=c,i[l]++}return n}const xI=(e,t)=>{const n=An.createTransformer(t),i=Gi(e),s=Gi(t);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?ed.has(e)&&!s.values.length||ed.has(t)&&!i.values.length?mI(e,t):Ps(k1(vI(i,s),s.values),n):wl(e,t)};function S1(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?qe(e,t,n):xh(e)(e,t)}const wI=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Xe.update(t,n),stop:()=>Nr(t),now:()=>Ct.isProcessing?Ct.timestamp:Vt.now()}},b1=(e,t,n=10)=>{let i="";const s=Math.max(Math.round(t/n),2);for(let l=0;l<s;l++)i+=Math.round(e(l/(s-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},kl=2e4;function wh(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<kl;)t+=n,i=e.next(t);return t>=kl?1/0:t}function kI(e,t=100,n){const i=n({...e,keyframes:[0,t]}),s=Math.min(wh(i),kl);return{type:"keyframes",ease:l=>i.next(s*l).value/t,duration:yn(s)}}const at={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 td(e,t){return e*Math.sqrt(1-t*t)}const SI=12;function bI(e,t,n){let i=n;for(let s=1;s<SI;s++)i=i-e(i)/t(i);return i}const lf=.001;function CI({duration:e=at.duration,bounce:t=at.bounce,velocity:n=at.velocity,mass:i=at.mass}){let s,l,a=1-t;a=$n(at.minDamping,at.maxDamping,a),e=$n(at.minDuration,at.maxDuration,yn(e)),a<1?(s=h=>{const m=h*a,p=m*e,y=m-n,w=td(h,a),k=Math.exp(-p);return lf-y/w*k},l=h=>{const p=h*a*e,y=p*n+n,w=Math.pow(a,2)*Math.pow(h,2)*e,k=Math.exp(-p),C=td(Math.pow(h,2),a);return(-s(h)+lf>0?-1:1)*((y-w)*k)/C}):(s=h=>{const m=Math.exp(-h*e),p=(h-n)*e+1;return-lf+m*p},l=h=>{const m=Math.exp(-h*e),p=(n-h)*(e*e);return m*p});const c=5/e,d=bI(s,l,c);if(e=sn(e),isNaN(d))return{stiffness:at.stiffness,damping:at.damping,duration:e};{const h=Math.pow(d,2)*i;return{stiffness:h,damping:a*2*Math.sqrt(i*h),duration:e}}}const EI=["duration","bounce"],TI=["stiffness","damping","mass"];function tv(e,t){return t.some(n=>e[n]!==void 0)}function PI(e){let t={velocity:at.velocity,stiffness:at.stiffness,damping:at.damping,mass:at.mass,isResolvedFromDuration:!1,...e};if(!tv(e,TI)&&tv(e,EI))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),s=i*i,l=2*$n(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:at.mass,stiffness:s,damping:l}}else{const n=CI({...e,velocity:0});t={...t,...n,mass:at.mass},t.isResolvedFromDuration=!0}return t}function Sl(e=at.visualDuration,t=at.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:s}=n;const l=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],c={done:!1,value:l},{stiffness:d,damping:h,mass:m,duration:p,velocity:y,isResolvedFromDuration:w}=PI({...n,velocity:-yn(n.velocity||0)}),k=y||0,C=h/(2*Math.sqrt(d*m)),T=a-l,E=yn(Math.sqrt(d/m)),A=Math.abs(T)<5;i||(i=A?at.restSpeed.granular:at.restSpeed.default),s||(s=A?at.restDelta.granular:at.restDelta.default);let M,_,W,D,Y,H;if(C<1)W=td(E,C),D=(k+C*E*T)/W,M=j=>{const G=Math.exp(-C*E*j);return a-G*(D*Math.sin(W*j)+T*Math.cos(W*j))},Y=C*E*D+T*W,H=C*E*T-D*W,_=j=>Math.exp(-C*E*j)*(Y*Math.sin(W*j)+H*Math.cos(W*j));else if(C===1){M=G=>a-Math.exp(-E*G)*(T+(k+E*T)*G);const j=k+E*T;_=G=>Math.exp(-E*G)*(E*j*G-k)}else{const j=E*Math.sqrt(C*C-1);M=se=>{const ee=Math.exp(-C*E*se),xe=Math.min(j*se,300);return a-ee*((k+C*E*T)*Math.sinh(xe)+j*T*Math.cosh(xe))/j};const G=(k+C*E*T)/j,U=C*E*G-T*j,fe=C*E*T-G*j;_=se=>{const ee=Math.exp(-C*E*se),xe=Math.min(j*se,300);return ee*(U*Math.sinh(xe)+fe*Math.cosh(xe))}}const X={calculatedDuration:w&&p||null,velocity:j=>sn(_(j)),next:j=>{if(!w&&C<1){const U=Math.exp(-C*E*j),fe=Math.sin(W*j),se=Math.cos(W*j),ee=a-U*(D*fe+T*se),xe=sn(U*(Y*fe+H*se));return c.done=Math.abs(xe)<=i&&Math.abs(a-ee)<=s,c.value=c.done?a:ee,c}const G=M(j);if(w)c.done=j>=p;else{const U=sn(_(j));c.done=Math.abs(U)<=i&&Math.abs(a-G)<=s}return c.value=c.done?a:G,c},toString:()=>{const j=Math.min(wh(X),kl),G=b1(U=>X.next(j*U).value,j,30);return j+"ms "+G},toTransition:()=>{}};return X}Sl.applyToOptions=e=>{const t=kI(e,100,Sl);return e.ease=t.ease,e.duration=sn(t.duration),e.type="keyframes",e};const RI=5;function C1(e,t,n){const i=Math.max(t-RI,0);return r1(n-e(i),t-i)}function nd({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:l=500,modifyTarget:a,min:c,max:d,restDelta:h=.5,restSpeed:m}){const p=e[0],y={done:!1,value:p},w=H=>c!==void 0&&H<c||d!==void 0&&H>d,k=H=>c===void 0?d:d===void 0||Math.abs(c-H)<Math.abs(d-H)?c:d;let C=n*t;const T=p+C,E=a===void 0?T:a(T);E!==T&&(C=E-p);const A=H=>-C*Math.exp(-H/i),M=H=>E+A(H),_=H=>{const X=A(H),j=M(H);y.done=Math.abs(X)<=h,y.value=y.done?E:j};let W,D;const Y=H=>{w(y.value)&&(W=H,D=Sl({keyframes:[y.value,k(y.value)],velocity:C1(M,H,y.value),damping:s,stiffness:l,restDelta:h,restSpeed:m}))};return Y(0),{calculatedDuration:null,next:H=>{let X=!1;return!D&&W===void 0&&(X=!0,_(H),Y(H)),W!==void 0&&H>=W?D.next(H-W):(!X&&_(H),y)}}}function MI(e,t,n){const i=[],s=n||Ar.mix||S1,l=e.length-1;for(let a=0;a<l;a++){let c=s(e[a],e[a+1]);if(t){const d=Array.isArray(t)?t[a]||vn:t;c=Ps(d,c)}i.push(c)}return i}function AI(e,t,{clamp:n=!0,ease:i,mixer:s}={}){const l=e.length;if(Vl(l===t.length),l===1)return()=>t[0];if(l===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=MI(t,i,s),d=c.length,h=m=>{if(a&&m<e[0])return t[0];let p=0;if(d>1)for(;p<e.length-2&&!(m<e[p+1]);p++);const y=ms(e[p],e[p+1],m);return c[p](y)};return n?m=>h($n(e[0],e[l-1],m)):h}function NI(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const s=ms(0,t,i);e.push(qe(n,1,s))}}function jI(e){const t=[0];return NI(t,e.length-1),t}function DI(e,t){return e.map(n=>n*t)}function II(e,t){return e.map(()=>t||d1).splice(0,e.length-1)}function is({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const s=UD(i)?i.map(Yy):Yy(i),l={done:!1,value:t[0]},a=DI(n&&n.length===t.length?n:jI(t),e),c=AI(a,t,{ease:Array.isArray(s)?s:II(t,s)});return{calculatedDuration:e,next:d=>(l.value=c(d),l.done=d>=e,l)}}const LI=e=>e!==null;function Bl(e,{repeat:t,repeatType:n="loop"},i,s=1){const l=e.filter(LI),c=s<0||t&&n!=="loop"&&t%2===1?0:l.length-1;return!c||i===void 0?l[c]:i}const _I={decay:nd,inertia:nd,tween:is,keyframes:is,spring:Sl};function E1(e){typeof e.type=="string"&&(e.type=_I[e.type])}class kh{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const OI=e=>e/100;class bl extends kh{constructor(t){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=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Vt.now()&&this.tick(Vt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;E1(t);const{type:n=is,repeat:i=0,repeatDelay:s=0,repeatType:l,velocity:a=0}=t;let{keyframes:c}=t;const d=n||is;d!==is&&typeof c[0]!="number"&&(this.mixKeyframes=Ps(OI,S1(c[0],c[1])),c=[0,100]);const h=d({...t,keyframes:c});l==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...c].reverse(),velocity:-a})),h.calculatedDuration===null&&(h.calculatedDuration=wh(h));const{calculatedDuration:m}=h;this.calculatedDuration=m,this.resolvedDuration=m+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=h}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:i,totalDuration:s,mixKeyframes:l,mirroredGenerator:a,resolvedDuration:c,calculatedDuration:d}=this;if(this.startTime===null)return i.next(0);const{delay:h=0,keyframes:m,repeat:p,repeatType:y,repeatDelay:w,type:k,onUpdate:C,finalKeyframe:T}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const E=this.currentTime-h*(this.playbackSpeed>=0?1:-1),A=this.playbackSpeed>=0?E<0:E>s;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let M=this.currentTime,_=i;if(p){const H=Math.min(this.currentTime,s)/c;let X=Math.floor(H),j=H%1;!j&&H>=1&&(j=1),j===1&&X--,X=Math.min(X,p+1),!!(X%2)&&(y==="reverse"?(j=1-j,w&&(j-=w/c)):y==="mirror"&&(_=a)),M=$n(0,1,j)*c}let W;A?(this.delayState.value=m[0],W=this.delayState):W=_.next(M),l&&!A&&(W.value=l(W.value));let{done:D}=W;!A&&d!==null&&(D=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const Y=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return Y&&k!==nd&&(W.value=Bl(m,this.options,T,this.speed)),C&&C(W.value),Y&&this.finish(),W}then(t,n){return this.finished.then(t,n)}get duration(){return yn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+yn(t)}get time(){return yn(this.currentTime)}set time(t){t=sn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return C1(i=>this.generator.next(i).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Vt.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=yn(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=wI,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=n??i),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(Vt.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}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function FI(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ti=e=>e*180/Math.PI,rd=e=>{const t=ti(Math.atan2(e[1],e[0]));return id(t)},zI={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:rd,rotateZ:rd,skewX:e=>ti(Math.atan(e[1])),skewY:e=>ti(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},id=e=>(e=e%360,e<0&&(e+=360),e),nv=rd,rv=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),iv=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),VI={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:rv,scaleY:iv,scale:e=>(rv(e)+iv(e))/2,rotateX:e=>id(ti(Math.atan2(e[6],e[5]))),rotateY:e=>id(ti(Math.atan2(-e[2],e[0]))),rotateZ:nv,rotate:nv,skewX:e=>ti(Math.atan(e[4])),skewY:e=>ti(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function od(e){return e.includes("scale")?1:0}function sd(e,t){if(!e||e==="none")return od(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=VI,s=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=zI,s=c}if(!s)return od(t);const l=i[t],a=s[1].split(",").map(UI);return typeof l=="function"?l(a):a[l]}const BI=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return sd(n,t)};function UI(e){return parseFloat(e.trim())}const ro=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],io=new Set([...ro,"pathRotation"]),ov=e=>e===no||e===ke,$I=new Set(["x","y","z"]),WI=ro.filter(e=>!$I.has(e));function HI(e){const t=[];return WI.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Er={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:i})=>{const s=e.max-e.min;return i==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:i})=>{const s=e.max-e.min;return i==="border-box"?s:s-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})=>sd(t,"x"),y:(e,{transform:t})=>sd(t,"y")};Er.translateX=Er.x;Er.translateY=Er.y;const ii=new Set;let ad=!1,ld=!1,ud=!1;function T1(){if(ld){const e=Array.from(ii).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const s=HI(i);s.length&&(n.set(i,s),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const s=n.get(i);s&&s.forEach(([l,a])=>{i.getValue(l)?.set(a)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}ld=!1,ad=!1,ii.forEach(e=>e.complete(ud)),ii.clear()}function P1(){ii.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ld=!0)})}function KI(){ud=!0,P1(),T1(),ud=!1}class Sh{constructor(t,n,i,s,l,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=s,this.element=l,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(ii.add(this),ad||(ad=!0,Xe.read(P1),Xe.resolveKeyframes(T1))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:s}=this;if(t[0]===null){const l=s?.get(),a=t[t.length-1];if(l!==void 0)t[0]=l;else if(i&&n){const c=i.readValue(n,a);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=a),s&&l===void 0&&s.set(t[0])}FI(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ii.delete(this)}cancel(){this.state==="scheduled"&&(ii.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const qI=e=>e.startsWith("--");function R1(e,t,n){qI(t)?e.style.setProperty(t,n):e.style[t]=n}const XI={};function M1(e,t){const n=n1(e);return()=>XI[t]??n()}const YI=M1(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),A1=M1(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Zo=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,sv={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Zo([0,.65,.55,1]),circOut:Zo([.55,0,1,.45]),backIn:Zo([.31,.01,.66,-.59]),backOut:Zo([.33,1.53,.69,.99])};function N1(e,t){if(e)return typeof e=="function"?A1()?b1(e,t):"ease-out":h1(e)?Zo(e):Array.isArray(e)?e.map(n=>N1(n,t)||sv.easeOut):sv[e]}function GI(e,t,n,{delay:i=0,duration:s=300,repeat:l=0,repeatType:a="loop",ease:c="easeOut",times:d}={},h=void 0){const m={[t]:n};d&&(m.offset=d);const p=N1(c,s);Array.isArray(p)&&(m.easing=p);const y={delay:i,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:l+1,direction:a==="reverse"?"alternate":"normal"};return h&&(y.pseudoElement=h),e.animate(m,y)}function j1(e){return typeof e=="function"&&"applyToOptions"in e}function QI({type:e,...t}){return j1(e)&&A1()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class D1 extends kh{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:s,pseudoElement:l,allowFlatten:a=!1,finalKeyframe:c,onComplete:d}=t;this.isPseudoElement=!!l,this.allowFlatten=a,this.options=t,Vl(typeof t.type!="string");const h=QI(t);this.animation=GI(n,i,s,h,l),h.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!l){const m=Bl(s,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(m),R1(n,i,m),this.animation.cancel()}d?.(),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;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return yn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+yn(t)}get time(){return yn(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=sn(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:i,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&YI()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),vn):s(this)}}const I1={anticipate:u1,backInOut:l1,circInOut:f1};function ZI(e){return e in I1}function JI(e){typeof e.ease=="string"&&ZI(e.ease)&&(e.ease=I1[e.ease])}const uf=10;class eL extends D1{constructor(t){JI(t),E1(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:s,element:l,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new bl({...a,autoplay:!1}),d=Math.max(uf,Vt.now()-this.startTime),h=$n(0,uf,d-uf),m=c.sample(d).value,{name:p}=this.options;l&&p&&R1(l,p,m),n.setWithVelocity(c.sample(Math.max(0,d-h)).value,m,h),c.stop()}}const av=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(An.test(e)||e==="0")&&!e.startsWith("url("));function tL(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function nL(e,t,n,i){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const l=e[e.length-1],a=av(s,t),c=av(l,t);return!a||!c?!1:tL(e)||(n==="spring"||j1(n))&&i}function cd(e){e.duration=0,e.type="keyframes"}const L1=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),rL=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function iL(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&rL.test(e[t]))return!0;return!1}const oL=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),sL=n1(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function aL(e){const{motionValue:t,name:n,repeatDelay:i,repeatType:s,damping:l,type:a,keyframes:c}=e,d=t?.owner?.current;if(!(d instanceof HTMLElement)&&!(d instanceof SVGElement))return!1;const{onUpdate:h,transformTemplate:m}=t.owner.getProps();return sL()&&n&&(L1.has(n)||oL.has(n)&&iL(c))&&(n!=="transform"||!m)&&!h&&!i&&s!=="mirror"&&l!==0&&a!=="inertia"}const lL=40;class uL extends kh{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:s=0,repeatDelay:l=0,repeatType:a="loop",keyframes:c,name:d,motionValue:h,element:m,...p}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Vt.now();const y={autoplay:t,delay:n,type:i,repeat:s,repeatDelay:l,repeatType:a,name:d,motionValue:h,element:m,...p},w=m?.KeyframeResolver||Sh;this.keyframeResolver=new w(c,(k,C,T)=>this.onKeyframesResolved(k,C,y,!T),d,h,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,i,s){this.keyframeResolver=void 0;const{name:l,type:a,velocity:c,delay:d,isHandoff:h,onUpdate:m}=i;this.resolvedAt=Vt.now();let p=!0;nL(t,l,a,c)||(p=!1,(Ar.instantAnimations||!d)&&m?.(Bl(t,i,n)),t[0]=t[t.length-1],cd(i),i.repeat=0);const w={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>lL?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},k=p&&!h&&aL(w),C=w.motionValue?.owner?.current;let T;if(k)try{T=new eL({...w,element:C})}catch{T=new bl(w)}else T=new bl(w);T.finished.then(()=>{this.notifyFinished()}).catch(vn),this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),KI()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function _1(e,t,n,i=0,s=1){const l=Array.from(e).sort((h,m)=>h.sortNodePosition(m)).indexOf(t),a=e.size,c=(a-1)*i;return typeof n=="function"?n(l,a):s===1?l*i:c-l*i}const lv=30,cL=e=>!isNaN(parseFloat(e));class fL{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const s=Vt.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Vt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=cL(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new hh);const i=this.events[t].add(n);return t==="change"?()=>{i(),Xe.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Vt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>lv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,lv);return r1(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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 Qi(e,t){return new fL(e,t)}function O1(e,t){if(e?.inherit&&t){const{inherit:n,...i}=e;return{...t,...i}}return e}function bh(e,t){const n=e?.[t]??e?.default??e;return n!==e?O1(n,e):n}const dL={type:"spring",stiffness:500,damping:25,restSpeed:10},hL=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),pL={type:"keyframes",duration:.8},mL={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},gL=(e,{keyframes:t})=>t.length>2?pL:io.has(e)?e.startsWith("scale")?hL(t[1]):dL:mL,yL=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function vL(e){for(const t in e)if(!yL.has(t))return!0;return!1}const Ch=(e,t,n,i={},s,l)=>a=>{const c=bh(i,e)||{},d=c.delay||i.delay||0;let{elapsed:h=0}=i;h=h-sn(d);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-h,onUpdate:y=>{t.set(y),c.onUpdate&&c.onUpdate(y)},onComplete:()=>{a(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:l?void 0:s};vL(c)||Object.assign(m,gL(e,m)),m.duration&&(m.duration=sn(m.duration)),m.repeatDelay&&(m.repeatDelay=sn(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let p=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(cd(m),m.delay===0&&(p=!0)),(Ar.instantAnimations||Ar.skipAnimations||s?.shouldSkipAnimations||c.skipAnimations)&&(p=!0,cd(m),m.delay=0),m.allowFlatten=!c.type&&!c.ease,p&&!l&&t.get()!==void 0){const y=Bl(m.keyframes,c);if(y!==void 0){Xe.update(()=>{m.onUpdate(y),m.onComplete()});return}}return c.isSync?new bl(m):new uL(m)},xL=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function wL(e){const t=xL.exec(e);if(!t)return[,];const[,n,i,s]=t;return[`--${n??i}`,s]}function F1(e,t,n=1){const[i,s]=wL(e);if(!i)return;const l=window.getComputedStyle(t).getPropertyValue(i);if(l){const a=l.trim();return J0(a)?parseFloat(a):a}return gh(s)?F1(s,t,n+1):s}function uv(e){const t=[{},{}];return e?.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function Eh(e,t,n,i){if(typeof t=="function"){const[s,l]=uv(i);t=t(n!==void 0?n:e.custom,s,l)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,l]=uv(i);t=t(n!==void 0?n:e.custom,s,l)}return t}function oi(e,t,n){const i=e.getProps();return Eh(i,t,n!==void 0?n:i.custom,e)}const z1=new Set(["width","height","top","left","right","bottom",...ro]),fd=e=>Array.isArray(e);function kL(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Qi(n))}function SL(e){return fd(e)?e[e.length-1]||0:e}function bL(e,t){const n=oi(e,t);let{transitionEnd:i={},transition:s={},...l}=n||{};l={...l,...i};for(const a in l){const c=SL(l[a]);kL(e,a,c)}}const Et=e=>!!(e&&e.getVelocity);function CL(e){return!!(Et(e)&&e.add)}function dd(e,t){const n=e.getValue("willChange");if(CL(n))return n.add(t);if(!n&&Ar.WillChange){const i=new Ar.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function Th(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const EL="framerAppearId",V1="data-"+Th(EL);function B1(e){return e.props[V1]}function TL({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function U1(e,t,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:l,transitionEnd:a,...c}=t;const d=e.getDefaultTransition();l=l?O1(l,d):d;const h=l?.reduceMotion,m=l?.skipAnimations;i&&(l=i);const p=[],y=s&&e.animationState&&e.animationState.getState()[s],w=l?.path;w&&w.animateVisualElement(e,c,l,n,p);for(const k in c){const C=e.getValue(k,e.latestValues[k]??null),T=c[k];if(T===void 0||y&&TL(y,k))continue;const E={delay:n,...bh(l||{},k)};m&&(E.skipAnimations=!0);const A=C.get();if(A!==void 0&&!C.isAnimating()&&!Array.isArray(T)&&T===A&&!E.velocity){Xe.update(()=>C.set(T));continue}let M=!1;if(window.MotionHandoffAnimation){const D=B1(e);if(D){const Y=window.MotionHandoffAnimation(D,k,Xe);Y!==null&&(E.startTime=Y,M=!0)}}dd(e,k);const _=h??e.shouldReduceMotion;C.start(Ch(k,C,T,_&&z1.has(k)?{type:!1}:E,e,M));const W=C.animation;W&&p.push(W)}if(a){const k=()=>Xe.update(()=>{a&&bL(e,a)});p.length?Promise.all(p).then(k):k()}return p}function hd(e,t,n={}){const i=oi(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const l=i?()=>Promise.all(U1(e,i,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:h=0,staggerChildren:m,staggerDirection:p}=s;return PL(e,t,d,h,m,p,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[d,h]=c==="beforeChildren"?[l,a]:[a,l];return d().then(()=>h())}else return Promise.all([l(),a(n.delay)])}function PL(e,t,n=0,i=0,s=0,l=1,a){const c=[];for(const d of e.variantChildren)d.notify("AnimationStart",t),c.push(hd(d,t,{...a,delay:n+(typeof i=="function"?0:i)+_1(e.variantChildren,d,i,s,l)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(c)}function RL(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const s=t.map(l=>hd(e,l,n));i=Promise.all(s)}else if(typeof t=="string")i=hd(e,t,n);else{const s=typeof t=="function"?oi(e,t,n.custom):t;i=Promise.all(U1(e,s,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const ML={test:e=>e==="auto",parse:e=>e},$1=e=>t=>t.test(e),W1=[no,ke,Un,er,tI,eI,ML],cv=e=>W1.find($1(e));function AL(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||t1(e):!0}const NL=new Set(["brightness","contrast","saturate","opacity"]);function jL(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(yh)||[];if(!i)return e;const s=n.replace(i,"");let l=NL.has(t)?1:0;return i!==n&&(l*=100),t+"("+l+s+")"}const DL=/\b([a-z-]*)\(.*?\)/gu,pd={...An,getAnimatableNone:e=>{const t=e.match(DL);return t?t.map(jL).join(" "):e}},md={...An,getAnimatableNone:e=>{const t=An.parse(e);return An.createTransformer(e)(t.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},fv={...no,transform:Math.round},IL={rotate:er,pathRotation:er,rotateX:er,rotateY:er,rotateZ:er,scale:Ga,scaleX:Ga,scaleY:Ga,scaleZ:Ga,skew:er,skewX:er,skewY:er,distance:ke,translateX:ke,translateY:ke,translateZ:ke,x:ke,y:ke,z:ke,perspective:ke,transformPerspective:ke,opacity:gs,originX:Qy,originY:Qy,originZ:ke},Cl={borderWidth:ke,borderTopWidth:ke,borderRightWidth:ke,borderBottomWidth:ke,borderLeftWidth:ke,borderRadius:ke,borderTopLeftRadius:ke,borderTopRightRadius:ke,borderBottomRightRadius:ke,borderBottomLeftRadius:ke,width:ke,maxWidth:ke,height:ke,maxHeight:ke,top:ke,right:ke,bottom:ke,left:ke,inset:ke,insetBlock:ke,insetBlockStart:ke,insetBlockEnd:ke,insetInline:ke,insetInlineStart:ke,insetInlineEnd:ke,padding:ke,paddingTop:ke,paddingRight:ke,paddingBottom:ke,paddingLeft:ke,paddingBlock:ke,paddingBlockStart:ke,paddingBlockEnd:ke,paddingInline:ke,paddingInlineStart:ke,paddingInlineEnd:ke,margin:ke,marginTop:ke,marginRight:ke,marginBottom:ke,marginLeft:ke,marginBlock:ke,marginBlockStart:ke,marginBlockEnd:ke,marginInline:ke,marginInlineStart:ke,marginInlineEnd:ke,fontSize:ke,backgroundPositionX:ke,backgroundPositionY:ke,...IL,zIndex:fv,fillOpacity:gs,strokeOpacity:gs,numOctaves:fv},LL={...Cl,color:dt,backgroundColor:dt,outlineColor:dt,fill:dt,stroke:dt,borderColor:dt,borderTopColor:dt,borderRightColor:dt,borderBottomColor:dt,borderLeftColor:dt,filter:pd,WebkitFilter:pd,mask:md,WebkitMask:md},H1=e=>LL[e],_L=new Set([pd,md]);function K1(e,t){let n=H1(e);return _L.has(n)||(n=An),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const OL=new Set(["auto","none","0"]);function FL(e,t,n){let i=0,s;for(;i<e.length&&!s;){const l=e[i];typeof l=="string"&&!OL.has(l)&&Gi(l).values.length&&(s=e[i]),i++}if(s&&n)for(const l of t)e[l]=K1(n,s)}class zL extends Sh{constructor(t,n,i,s,l){super(t,n,i,s,l,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let m=0;m<t.length;m++){let p=t[m];if(typeof p=="string"&&(p=p.trim(),gh(p))){const y=F1(p,n.current);y!==void 0&&(t[m]=y),m===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!z1.has(i)||t.length!==2)return;const[s,l]=t,a=cv(s),c=cv(l),d=Gy(s),h=Gy(l);if(d!==h&&Er[i]){this.needsMeasurement=!0;return}if(a!==c)if(ov(a)&&ov(c))for(let m=0;m<t.length;m++){const p=t[m];typeof p=="string"&&(t[m]=parseFloat(p))}else Er[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,i=[];for(let s=0;s<t.length;s++)(t[s]===null||AL(t[s]))&&i.push(s);i.length&&FL(t,i,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:i}=this;if(!t||!t.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Er[i](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(i,s).jump(s,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:i}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const l=i.length-1,a=i[l];i[l]=Er[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([c,d])=>{t.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const Ph=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function q1(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;const s=n?.[e]??i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(i=>i!=null)}const gd=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function ol(e){return e1(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Rh}=p1(queueMicrotask,!1),Rn={x:!1,y:!1};function X1(){return Rn.x||Rn.y}function VL(e){return e==="x"||e==="y"?Rn[e]?null:(Rn[e]=!0,()=>{Rn[e]=!1}):Rn.x||Rn.y?null:(Rn.x=Rn.y=!0,()=>{Rn.x=Rn.y=!1})}function Y1(e,t){const n=q1(e),i=new AbortController,s={passive:!0,...t,signal:i.signal};return[n,s,()=>i.abort()]}function BL(e){return!(e.pointerType==="touch"||X1())}function UL(e,t,n={}){const[i,s,l]=Y1(e,n);return i.forEach(a=>{let c=!1,d=!1,h;const m=()=>{a.removeEventListener("pointerleave",k)},p=T=>{h&&(h(T),h=void 0),m()},y=T=>{c=!1,window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),d&&(d=!1,p(T))},w=()=>{c=!0,window.addEventListener("pointerup",y,s),window.addEventListener("pointercancel",y,s)},k=T=>{if(T.pointerType!=="touch"){if(c){d=!0;return}p(T)}},C=T=>{if(!BL(T))return;d=!1;const E=t(a,T);typeof E=="function"&&(h=E,a.addEventListener("pointerleave",k,s))};a.addEventListener("pointerenter",C,s),a.addEventListener("pointerdown",w,s)}),l}const G1=(e,t)=>t?e===t?!0:G1(e,t.parentElement):!1,Mh=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,$L=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function WL(e){return $L.has(e.tagName)||e.isContentEditable===!0}const HL=new Set(["INPUT","SELECT","TEXTAREA"]);function KL(e){return HL.has(e.tagName)||e.isContentEditable===!0}const sl=new WeakSet;function dv(e){return t=>{t.key==="Enter"&&e(t)}}function cf(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const qL=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=dv(()=>{if(sl.has(n))return;cf(n,"down");const s=dv(()=>{cf(n,"up")}),l=()=>cf(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",l,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function hv(e){return Mh(e)&&!X1()}const pv=new WeakSet;function XL(e,t,n={}){const[i,s,l]=Y1(e,n),a=c=>{const d=c.currentTarget;if(!hv(c)||pv.has(c))return;sl.add(d),n.stopPropagation&&pv.add(c);const h=t(d,c),m={...s,capture:!0},p=(k,C)=>{window.removeEventListener("pointerup",y,m),window.removeEventListener("pointercancel",w,m),sl.has(d)&&sl.delete(d),hv(k)&&typeof h=="function"&&h(k,{success:C})},y=k=>{p(k,d===window||d===document||n.useGlobalTarget||G1(d,k.target))},w=k=>{p(k,!1)};window.addEventListener("pointerup",y,m),window.addEventListener("pointercancel",w,m)};return i.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",a,s),ol(c)&&(c.addEventListener("focus",h=>qL(h,s)),!WL(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),l}function Ah(e){return e1(e)&&"ownerSVGElement"in e}const al=new WeakMap;let ll;const Q1=(e,t,n)=>(i,s)=>s&&s[0]?s[0][e+"Size"]:Ah(i)&&"getBBox"in i?i.getBBox()[t]:i[n],YL=Q1("inline","width","offsetWidth"),GL=Q1("block","height","offsetHeight");function QL({target:e,borderBoxSize:t}){al.get(e)?.forEach(n=>{n(e,{get width(){return YL(e,t)},get height(){return GL(e,t)}})})}function ZL(e){e.forEach(QL)}function JL(){typeof ResizeObserver>"u"||(ll=new ResizeObserver(ZL))}function e_(e,t){ll||JL();const n=q1(e);return n.forEach(i=>{let s=al.get(i);s||(s=new Set,al.set(i,s)),s.add(t),ll?.observe(i)}),()=>{n.forEach(i=>{const s=al.get(i);s?.delete(t),s?.size||ll?.unobserve(i)})}}const ul=new Set;let Wi;function t_(){Wi=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ul.forEach(t=>t(e))},window.addEventListener("resize",Wi)}function n_(e){return ul.add(e),Wi||t_(),()=>{ul.delete(e),!ul.size&&typeof Wi=="function"&&(window.removeEventListener("resize",Wi),Wi=void 0)}}function mv(e,t){return typeof e=="function"?n_(e):e_(e,t)}function r_(e){return Ah(e)&&e.tagName==="svg"}const i_=[...W1,dt,An],o_=e=>i_.find($1(e)),gv=()=>({translate:0,scale:1,origin:0,originPoint:0}),Hi=()=>({x:gv(),y:gv()}),yv=()=>({min:0,max:0}),mt=()=>({x:yv(),y:yv()}),s_=new WeakMap;function Ul(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ys(e){return typeof e=="string"||Array.isArray(e)}const Nh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],jh=["initial",...Nh];function $l(e){return Ul(e.animate)||jh.some(t=>ys(e[t]))}function Z1(e){return!!($l(e)||e.variants)}function a_(e,t,n){for(const i in t){const s=t[i],l=n[i];if(Et(s))e.addValue(i,s);else if(Et(l))e.addValue(i,Qi(s,{owner:e}));else if(l!==s)if(e.hasValue(i)){const a=e.getValue(i);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=e.getStaticValue(i);e.addValue(i,Qi(a!==void 0?a:s,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const yd={current:null},J1={current:!1},l_=typeof window<"u";function u_(){if(J1.current=!0,!!l_)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>yd.current=e.matches;e.addEventListener("change",t),t()}else yd.current=!1}const vv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let El={};function ek(e){El=e}function c_(){return El}class f_{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:s,skipAnimations:l,blockInitialAnimation:a,visualState:c},d={}){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=Sh,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=()=>{const w=Vt.now();this.renderScheduledAt<w&&(this.renderScheduledAt=w,Xe.render(this.render,!1,!0))};const{latestValues:h,renderState:m}=c;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=m,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=l,this.options=d,this.blockInitialAnimation=!!a,this.isControllingVariants=$l(n),this.isVariantNode=Z1(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...y}=this.scrapeMotionValuesFromProps(n,{},this);for(const w in y){const k=y[w];h[w]!==void 0&&Et(k)&&k.set(h[w])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,s_.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(J1.current||u_(),this.shouldReduceMotion=yd.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(),Nr(this.notifyUpdate),Nr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&L1.has(t)&&this.current instanceof HTMLElement){const{factory:a,keyframes:c,times:d,ease:h,duration:m}=n.accelerate,p=new D1({element:this.current,name:t,keyframes:c,times:d,ease:h,duration:sn(m)}),y=a(p);this.valueSubscriptions.set(t,()=>{y(),p.cancel()});return}const i=io.has(t);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Xe.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let l;typeof window<"u"&&window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),l&&l()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in El){const n=El[t];if(!n)continue;const{isEnabled:i,Feature:s}=n;if(!this.features[t]&&s&&i(this.props)&&(this.features[t]=new s(this)),this.features[t]){const l=this.features[t];l.isMounted?l.update():(l.mount(),l.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):mt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<vv.length;i++){const s=vv[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const l="on"+s,a=t[l];a&&(this.propEventSubscriptions[s]=this.on(s,a))}this.prevMotionValues=a_(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const i=this.values.get(t);n!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=Qi(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(J0(i)||t1(i))?i=parseFloat(i):!o_(i)&&An.test(n)&&(i=K1(t,n)),this.setBaseTarget(t,Et(i)?i.get():i)),Et(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const l=Eh(this.props,n,this.presenceContext?.custom);l&&(i=l[t])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Et(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new hh),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Rh.render(this.render)}}class tk extends f_{constructor(){super(...arguments),this.KeyframeResolver=zL}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const i=t.style;return i?i[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Et(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Dr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function nk({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function d_({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function h_(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function ff(e){return e===void 0||e===1}function vd({scale:e,scaleX:t,scaleY:n}){return!ff(e)||!ff(t)||!ff(n)}function Jr(e){return vd(e)||rk(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function rk(e){return xv(e.x)||xv(e.y)}function xv(e){return e&&e!=="0%"}function Tl(e,t,n){const i=e-n,s=t*i;return n+s}function wv(e,t,n,i,s){return s!==void 0&&(e=Tl(e,s,i)),Tl(e,n,i)+t}function xd(e,t=0,n=1,i,s){e.min=wv(e.min,t,n,i,s),e.max=wv(e.max,t,n,i,s)}function ik(e,{x:t,y:n}){xd(e.x,t.translate,t.scale,t.originPoint),xd(e.y,n.translate,n.scale,n.originPoint)}const kv=.999999999999,Sv=1.0000000000001;function p_(e,t,n,i=!1){const s=n.length;if(!s)return;t.x=t.y=1;let l,a;for(let c=0;c<s;c++){l=n[c],a=l.projectionDelta;const{visualElement:d}=l.options;d&&d.props.style&&d.props.style.display==="contents"||(i&&l.options.layoutScroll&&l.scroll&&l!==l.root&&(Vn(e.x,-l.scroll.offset.x),Vn(e.y,-l.scroll.offset.y)),a&&(t.x*=a.x.scale,t.y*=a.y.scale,ik(e,a)),i&&Jr(l.latestValues)&&cl(e,l.latestValues,l.layout?.layoutBox))}t.x<Sv&&t.x>kv&&(t.x=1),t.y<Sv&&t.y>kv&&(t.y=1)}function Vn(e,t){e.min+=t,e.max+=t}function bv(e,t,n,i,s=.5){const l=qe(e.min,e.max,s);xd(e,t,n,l,i)}function Cv(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function cl(e,t,n){const i=n??e;bv(e.x,Cv(t.x,i.x),t.scaleX,t.scale,t.originX),bv(e.y,Cv(t.y,i.y),t.scaleY,t.scale,t.originY)}function ok(e,t){return nk(h_(e.getBoundingClientRect(),t))}function m_(e,t,n){const i=ok(e,n),{scroll:s}=t;return s&&(Vn(i.x,s.offset.x),Vn(i.y,s.offset.y)),i}const g_={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},y_=ro.length;function v_(e,t,n){let i="",s=!0;for(let a=0;a<y_;a++){const c=ro[a],d=e[c];if(d===void 0)continue;let h=!0;if(typeof d=="number")h=d===(c.startsWith("scale")?1:0);else{const m=parseFloat(d);h=c.startsWith("scale")?m===1:m===0}if(!h||n){const m=gd(d,Cl[c]);if(!h){s=!1;const p=g_[c]||c;i+=`${p}(${m}) `}n&&(t[c]=m)}}const l=e.pathRotation;return l&&(s=!1,i+=`rotate(${gd(l,Cl.pathRotation)}) `),i=i.trim(),n?i=n(t,s?"":i):s&&(i="none"),i}function Dh(e,t,n){const{style:i,vars:s,transformOrigin:l}=e;let a=!1,c=!1;for(const d in t){const h=t[d];if(io.has(d)){a=!0;continue}else if(g1(d)){s[d]=h;continue}else{const m=gd(h,Cl[d]);d.startsWith("origin")?(c=!0,l[d]=m):i[d]=m}}if(t.transform||(a||n?i.transform=v_(t,e.transform,n):i.transform&&(i.transform="none")),c){const{originX:d="50%",originY:h="50%",originZ:m=0}=l;i.transformOrigin=`${d} ${h} ${m}`}}function sk(e,{style:t,vars:n},i,s){const l=e.style;let a;for(a in t)l[a]=t[a];s?.applyProjectionStyles(l,i);for(a in n)l.setProperty(a,n[a])}function Ev(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Go={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ke.test(e))e=parseFloat(e);else return e;const n=Ev(e,t.target.x),i=Ev(e,t.target.y);return`${n}% ${i}%`}},x_={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,s=An.parse(e);if(s.length>5)return i;const l=An.createTransformer(e),a=typeof s[0]!="number"?1:0,c=n.x.scale*t.x,d=n.y.scale*t.y;s[0+a]/=c,s[1+a]/=d;const h=qe(c,d,.5);return typeof s[2+a]=="number"&&(s[2+a]/=h),typeof s[3+a]=="number"&&(s[3+a]/=h),l(s)}},wd={borderRadius:{...Go,applyTo:[...Ph]},borderTopLeftRadius:Go,borderTopRightRadius:Go,borderBottomLeftRadius:Go,borderBottomRightRadius:Go,boxShadow:x_};function ak(e,{layout:t,layoutId:n}){return io.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!wd[e]||e==="opacity")}function Ih(e,t,n){const i=e.style,s=t?.style,l={};if(!i)return l;for(const a in i)(Et(i[a])||s&&Et(s[a])||ak(a,e)||n?.getValue(a)?.liveStyle!==void 0)&&(l[a]=i[a]);return l}function w_(e){return window.getComputedStyle(e)}class k_ extends tk{constructor(){super(...arguments),this.type="html",this.renderInstance=sk}mount(t){Vl(!!t.style),super.mount(t)}readValueFromInstance(t,n){if(io.has(n))return this.projection?.isProjecting?od(n):BI(t,n);{const i=w_(t),s=(g1(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ok(t,n)}build(t,n,i){Dh(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return Ih(t,n,i)}}const S_={offset:"stroke-dashoffset",array:"stroke-dasharray"},b_={offset:"strokeDashoffset",array:"strokeDasharray"};function C_(e,t,n=1,i=0,s=!0){e.pathLength=1;const l=s?S_:b_;e[l.offset]=`${-i}`,e[l.array]=`${t} ${n}`}const E_=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function lk(e,{attrX:t,attrY:n,attrScale:i,pathLength:s,pathSpacing:l=1,pathOffset:a=0,...c},d,h,m){if(Dh(e,c,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:y}=e;p.transform&&(y.transform=p.transform,delete p.transform),(y.transform||p.transformOrigin)&&(y.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),y.transform&&(y.transformBox=m?.transformBox??"fill-box",delete p.transformBox);for(const w of E_)p[w]!==void 0&&(y[w]=p[w],delete p[w]);t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),i!==void 0&&(p.scale=i),s!==void 0&&C_(p,s,l,a,!1)}const uk=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"]),ck=e=>typeof e=="string"&&e.toLowerCase()==="svg";function T_(e,t,n,i){sk(e,t,void 0,i);for(const s in t.attrs)e.setAttribute(uk.has(s)?s:Th(s),t.attrs[s])}function fk(e,t,n){const i=Ih(e,t,n);for(const s in e)if(Et(e[s])||Et(t[s])){const l=ro.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[l]=e[s]}return i}class P_ extends tk{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=mt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(io.has(n)){const i=H1(n);return i&&i.default||0}return n=uk.has(n)?n:Th(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return fk(t,n,i)}build(t,n,i){lk(t,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,n,i,s){T_(t,n,i,s)}mount(t){this.isSVGTag=ck(t.tagName),super.mount(t)}}const R_=jh.length;function dk(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?dk(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<R_;n++){const i=jh[n],s=e.props[i];(ys(s)||s===!1)&&(t[i]=s)}return t}function hk(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}const M_=[...Nh].reverse(),A_=Nh.length;function N_(e){return t=>Promise.all(t.map(({animation:n,options:i})=>RL(e,n,i)))}function j_(e){let t=N_(e),n=Tv(),i=!0,s=!1;const l=h=>(m,p)=>{const y=oi(e,p,h==="exit"?e.presenceContext?.custom:void 0);if(y){const{transition:w,transitionEnd:k,...C}=y;m={...m,...C,...k}}return m};function a(h){t=h(e)}function c(h){const{props:m}=e,p=dk(e.parent)||{},y=[],w=new Set;let k={},C=1/0;for(let E=0;E<A_;E++){const A=M_[E],M=n[A],_=m[A]!==void 0?m[A]:p[A],W=ys(_),D=A===h?M.isActive:null;D===!1&&(C=E);let Y=_===p[A]&&_!==m[A]&&W;if(Y&&(i||s)&&e.manuallyAnimateOnMount&&(Y=!1),M.protectedKeys={...k},!M.isActive&&D===null||!_&&!M.prevProp||Ul(_)||typeof _=="boolean")continue;if(A==="exit"&&M.isActive&&D!==!0){M.prevResolvedValues&&(k={...k,...M.prevResolvedValues});continue}const H=D_(M.prevProp,_);let X=H||A===h&&M.isActive&&!Y&&W||E>C&&W,j=!1;const G=Array.isArray(_)?_:[_];let U=G.reduce(l(A),{});D===!1&&(U={});const{prevResolvedValues:fe={}}=M,se={...fe,...U},ee=q=>{X=!0,w.has(q)&&(j=!0,w.delete(q)),M.needsAnimating[q]=!0;const le=e.getValue(q);le&&(le.liveStyle=!1)};for(const q in se){const le=U[q],P=fe[q];if(k.hasOwnProperty(q))continue;let L=!1;fd(le)&&fd(P)?L=!hk(le,P)||H:L=le!==P,L?le!=null?ee(q):w.add(q):le!==void 0&&w.has(q)?ee(q):M.protectedKeys[q]=!0}M.prevProp=_,M.prevResolvedValues=U,M.isActive&&(k={...k,...U}),(i||s)&&e.blockInitialAnimation&&(X=!1);const xe=Y&&H;X&&(!xe||j)&&y.push(...G.map(q=>{const le={type:A};if(typeof q=="string"&&(i||s)&&!xe&&e.manuallyAnimateOnMount&&e.parent){const{parent:P}=e,L=oi(P,q);if(P.enteringChildren&&L){const{delayChildren:Q}=L.transition||{};le.delay=_1(P.enteringChildren,e,Q)}}return{animation:q,options:le}}))}if(w.size){const E={};if(typeof m.initial!="boolean"){const A=oi(e,Array.isArray(m.initial)?m.initial[0]:m.initial);A&&A.transition&&(E.transition=A.transition)}w.forEach(A=>{const M=e.getBaseTarget(A),_=e.getValue(A);_&&(_.liveStyle=!0),E[A]=M??null}),y.push({animation:E})}let T=!!y.length;return i&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(T=!1),i=!1,s=!1,T?t(y):Promise.resolve()}function d(h,m){if(n[h].isActive===m)return Promise.resolve();e.variantChildren?.forEach(y=>y.animationState?.setActive(h,m)),n[h].isActive=m;const p=c(h);for(const y in n)n[y].protectedKeys={};return p}return{animateChanges:c,setActive:d,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Tv(),s=!0}}}function D_(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!hk(t,e):!1}function Yr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Tv(){return{animate:Yr(!0),whileInView:Yr(),whileHover:Yr(),whileTap:Yr(),whileDrag:Yr(),whileFocus:Yr(),exit:Yr()}}function kd(e,t){e.min=t.min,e.max=t.max}function Pn(e,t){kd(e.x,t.x),kd(e.y,t.y)}function Pv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const pk=1e-4,I_=1-pk,L_=1+pk,mk=.01,__=0-mk,O_=0+mk;function Bt(e){return e.max-e.min}function F_(e,t,n){return Math.abs(e-t)<=n}function Rv(e,t,n,i=.5){e.origin=i,e.originPoint=qe(t.min,t.max,e.origin),e.scale=Bt(n)/Bt(t),e.translate=qe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=I_&&e.scale<=L_||isNaN(e.scale))&&(e.scale=1),(e.translate>=__&&e.translate<=O_||isNaN(e.translate))&&(e.translate=0)}function os(e,t,n,i){Rv(e.x,t.x,n.x,i?i.originX:void 0),Rv(e.y,t.y,n.y,i?i.originY:void 0)}function Mv(e,t,n,i=0){const s=i?qe(n.min,n.max,i):n.min;e.min=s+t.min,e.max=e.min+Bt(t)}function z_(e,t,n,i){Mv(e.x,t.x,n.x,i?.x),Mv(e.y,t.y,n.y,i?.y)}function Av(e,t,n,i=0){const s=i?qe(n.min,n.max,i):n.min;e.min=t.min-s,e.max=e.min+Bt(t)}function Pl(e,t,n,i){Av(e.x,t.x,n.x,i?.x),Av(e.y,t.y,n.y,i?.y)}function Nv(e,t,n,i,s){return e-=t,e=Tl(e,1/n,i),s!==void 0&&(e=Tl(e,1/s,i)),e}function V_(e,t=0,n=1,i=.5,s,l=e,a=e){if(Un.test(t)&&(t=parseFloat(t),t=qe(a.min,a.max,t/100)-a.min),typeof t!="number")return;let c=qe(l.min,l.max,i);e===l&&(c-=t),e.min=Nv(e.min,t,n,c,s),e.max=Nv(e.max,t,n,c,s)}function jv(e,t,[n,i,s],l,a){V_(e,t[n],t[i],t[s],t.scale,l,a)}const B_=["x","scaleX","originX"],U_=["y","scaleY","originY"];function Dv(e,t,n,i){jv(e.x,t,B_,n?n.x:void 0,i?i.x:void 0),jv(e.y,t,U_,n?n.y:void 0,i?i.y:void 0)}function Iv(e){return e.translate===0&&e.scale===1}function gk(e){return Iv(e.x)&&Iv(e.y)}function Lv(e,t){return e.min===t.min&&e.max===t.max}function $_(e,t){return Lv(e.x,t.x)&&Lv(e.y,t.y)}function _v(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function yk(e,t){return _v(e.x,t.x)&&_v(e.y,t.y)}function Ov(e){return Bt(e.x)/Bt(e.y)}function Fv(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function zn(e){return[e("x"),e("y")]}function W_(e,t,n){let i="";const s=e.x.translate/t.x,l=e.y.translate/t.y,a=n?.z||0;if((s||l||a)&&(i=`translate3d(${s}px, ${l}px, ${a}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:m,pathRotation:p,rotateX:y,rotateY:w,skewX:k,skewY:C}=n;h&&(i=`perspective(${h}px) ${i}`),m&&(i+=`rotate(${m}deg) `),p&&(i+=`rotate(${p}deg) `),y&&(i+=`rotateX(${y}deg) `),w&&(i+=`rotateY(${w}deg) `),k&&(i+=`skewX(${k}deg) `),C&&(i+=`skewY(${C}deg) `)}const c=e.x.scale*t.x,d=e.y.scale*t.y;return(c!==1||d!==1)&&(i+=`scale(${c}, ${d})`),i||"none"}const H_=Ph.length,zv=e=>typeof e=="string"?parseFloat(e):e,Vv=e=>typeof e=="number"||ke.test(e);function K_(e,t,n,i,s,l){s?(e.opacity=qe(0,n.opacity??1,q_(i)),e.opacityExit=qe(t.opacity??1,0,X_(i))):l&&(e.opacity=qe(t.opacity??1,n.opacity??1,i));for(let a=0;a<H_;a++){const c=Ph[a];let d=Bv(t,c),h=Bv(n,c);if(d===void 0&&h===void 0)continue;d||(d=0),h||(h=0),d===0||h===0||Vv(d)===Vv(h)?(e[c]=Math.max(qe(zv(d),zv(h),i),0),(Un.test(h)||Un.test(d))&&(e[c]+="%")):e[c]=h}(t.rotate||n.rotate)&&(e.rotate=qe(t.rotate||0,n.rotate||0,i))}function Bv(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const q_=vk(0,.5,c1),X_=vk(.5,.95,vn);function vk(e,t,n){return i=>i<e?0:i>t?1:n(ms(e,t,i))}function Y_(e,t,n){const i=Et(e)?e:Qi(e);return i.start(Ch("",i,t,n)),i.animation}function vs(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}const G_=(e,t)=>e.depth-t.depth;class Q_{constructor(){this.children=[],this.isDirty=!1}add(t){dh(this.children,t),this.isDirty=!0}remove(t){xl(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(G_),this.isDirty=!1,this.children.forEach(t)}}function Z_(e,t){const n=Vt.now(),i=({timestamp:s})=>{const l=s-n;l>=t&&(Nr(i),e(l-t))};return Xe.setup(i,!0),()=>Nr(i)}function fl(e){return Et(e)?e.get():e}class J_{constructor(){this.members=[]}add(t){dh(this.members,t);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;(!s||s.isConnected===!1)&&!i.snapshot&&(xl(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(xl(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){for(let n=this.members.indexOf(t)-1;n>=0;n--){const i=this.members[n];if(i.isPresent!==!1&&i.instance?.isConnected!==!1)return this.promote(i),!0}return!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=i.options,{layoutDependency:l}=t.options;(s===void 0||s!==l)&&(t.resumeFrom=i,n&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const dl={hasAnimatedSinceResize:!0,hasEverUpdated:!1},df=["","X","Y","Z"],eO=1e3;let tO=0;function hf(e,t,n,i){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),i&&(i[e]=0))}function xk(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=B1(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:l}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Xe,!(s||l))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&xk(i)}function wk({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(a={},c=t?.()){this.id=tO++,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,this.nodes.forEach(iO),this.nodes.forEach(cO),this.nodes.forEach(fO),this.nodes.forEach(oO)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new Q_)}addEventListener(a,c){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new hh),this.eventHandlers.get(a).add(c)}notifyListeners(a,...c){const d=this.eventHandlers.get(a);d&&d.notify(...c)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=Ah(a)&&!r_(a),this.instance=a;const{layoutId:c,layout:d,visualElement:h}=this.options;if(h&&!h.current&&h.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||c)&&(this.isLayoutDirty=!0),e){let m,p=0;const y=()=>this.root.updateBlockedByResize=!1;Xe.read(()=>{p=window.innerWidth}),e(a,()=>{const w=window.innerWidth;w!==p&&(p=w,this.root.updateBlockedByResize=!0,m&&m(),m=Z_(y,250),dl.hasAnimatedSinceResize&&(dl.hasAnimatedSinceResize=!1,this.nodes.forEach(Wv)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&h&&(c||d)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:p,hasRelativeLayoutChanged:y,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const k=this.options.transition||h.getDefaultTransition()||gO,{onLayoutAnimationStart:C,onLayoutAnimationComplete:T}=h.getProps(),E=!this.targetLayout||!yk(this.targetLayout,w),A=!p&&y;if(this.options.layoutRoot||this.resumeFrom||A||p&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const M={...bh(k,"layout"),onPlay:C,onComplete:T};(h.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M),this.setAnimationOrigin(m,A,M.path)}else p||Wv(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Nr(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(dO),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&xk(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m<this.path.length;m++){const p=this.path[m];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:c,layout:d}=this.options;if(c===void 0&&!d)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const d=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),d&&this.nodes.forEach(aO),this.nodes.forEach(Uv);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach($v);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(lO),this.nodes.forEach(uO),this.nodes.forEach(nO),this.nodes.forEach(rO)):this.nodes.forEach($v),this.clearAllSnapshots();const c=Vt.now();Ct.delta=$n(0,1e3/60,c-Ct.timestamp),Ct.timestamp=c,Ct.isProcessing=!0,rf.update.process(Ct),rf.preRender.process(Ct),rf.render.process(Ct),Ct.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Rh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(sO),this.sharedNodes.forEach(hO)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Xe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Xe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Bt(this.snapshot.measuredBox.x)&&!Bt(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 d=0;d<this.path.length;d++)this.path[d].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=mt()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(c=!1),c&&this.instance){const d=i(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:d,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!s)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!gk(this.projectionDelta),d=this.getTransformTemplate(),h=d?d(this.latestValues,""):void 0,m=h!==this.prevTransformTemplateValue;a&&this.instance&&(c||Jr(this.latestValues)||m)&&(s(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const c=this.measurePageBox();let d=this.removeElementScroll(c);return a&&(d=this.removeTransform(d)),yO(d),{animationId:this.root.animationId,measuredBox:c,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:a}=this.options;if(!a)return mt();const c=a.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(vO))){const{scroll:h}=this.root;h&&(Vn(c.x,h.offset.x),Vn(c.y,h.offset.y))}return c}removeElementScroll(a){const c=mt();if(Pn(c,a),this.scroll?.wasRoot)return c;for(let d=0;d<this.path.length;d++){const h=this.path[d],{scroll:m,options:p}=h;h!==this.root&&m&&p.layoutScroll&&(m.wasRoot&&Pn(c,a),Vn(c.x,m.offset.x),Vn(c.y,m.offset.y))}return c}applyTransform(a,c=!1,d){const h=d||mt();Pn(h,a);for(let m=0;m<this.path.length;m++){const p=this.path[m];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(Vn(h.x,-p.scroll.offset.x),Vn(h.y,-p.scroll.offset.y)),Jr(p.latestValues)&&cl(h,p.latestValues,p.layout?.layoutBox)}return Jr(this.latestValues)&&cl(h,this.latestValues,this.layout?.layoutBox),h}removeTransform(a){const c=mt();Pn(c,a);for(let d=0;d<this.path.length;d++){const h=this.path[d];if(!Jr(h.latestValues))continue;let m;h.instance&&(vd(h.latestValues)&&h.updateSnapshot(),m=mt(),Pn(m,h.measurePageBox())),Dv(c,h.latestValues,h.snapshot?.layoutBox,m)}return Jr(this.latestValues)&&Dv(c,this.latestValues),c}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}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!==Ct.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const d=!!this.resumingFrom||this!==c;if(!(a||d&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:p}=this.options;if(!this.layout||!(m||p))return;this.resolvedRelativeTargetAt=Ct.timestamp;const y=this.getClosestProjectingParent();y&&this.linkedParentVersion!==y.layoutVersion&&!y.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&y&&y.layout?this.createRelativeTarget(y,this.layout.layoutBox,y.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=mt(),this.targetWithTransforms=mt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),z_(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Pn(this.target,this.layout.layoutBox),ik(this.target,this.targetDelta)):Pn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?this.createRelativeTarget(y,this.target,y.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||vd(this.parent.latestValues)||rk(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,c,d){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=mt(),this.relativeTargetOrigin=mt(),Pl(this.relativeTargetOrigin,c,d,this.options.layoutAnchor||void 0),Pn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const a=this.getLead(),c=!!this.resumingFrom||this!==a;let d=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(d=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===Ct.timestamp&&(d=!1),d)return;const{layout:h,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||m))return;Pn(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,y=this.treeScale.y;p_(this.layoutCorrected,this.treeScale,this.path,c),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=mt());const{target:w}=a;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Pv(this.prevProjectionDelta.x,this.projectionDelta.x),Pv(this.prevProjectionDelta.y,this.projectionDelta.y)),os(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==y||!Fv(this.projectionDelta.x,this.prevProjectionDelta.x)||!Fv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",w))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){if(this.options.visualElement?.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Hi(),this.projectionDelta=Hi(),this.projectionDeltaWithTransform=Hi()}setAnimationOrigin(a,c=!1,d){const h=this.snapshot,m=h?h.latestValues:{},p={...this.latestValues},y=Hi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const w=mt(),k=h?h.source:void 0,C=this.layout?this.layout.source:void 0,T=k!==C,E=this.getStack(),A=!E||E.members.length<=1,M=!!(T&&!A&&this.options.crossfade===!0&&!this.path.some(mO));this.animationProgress=0;let _;const W=d?.interpolateProjection(a);this.mixTargetDelta=D=>{const Y=D/1e3,H=W?.(Y);H?(y.x.translate=H.x,y.x.scale=qe(a.x.scale,1,Y),y.x.origin=a.x.origin,y.x.originPoint=a.x.originPoint,y.y.translate=H.y,y.y.scale=qe(a.y.scale,1,Y),y.y.origin=a.y.origin,y.y.originPoint=a.y.originPoint):(Hv(y.x,a.x,Y),Hv(y.y,a.y,Y)),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Pl(w,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),pO(this.relativeTarget,this.relativeTargetOrigin,w,Y),_&&$_(this.relativeTarget,_)&&(this.isProjectionDirty=!1),_||(_=mt()),Pn(_,this.relativeTarget)),T&&(this.animationValues=p,K_(p,m,this.latestValues,Y,M,A)),H&&H.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=H.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=Y},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Nr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Xe.update(()=>{dl.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Qi(0)),this.motionValue.jump(0,!1),this.currentAnimation=Y_(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),a.onUpdate&&a.onUpdate(c)},onComplete:()=>{a.onComplete&&a.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);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(eO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:c,target:d,layout:h,latestValues:m}=a;if(!(!c||!d||!h)){if(this!==a&&this.layout&&h&&kk(this.options.animationType,this.layout.layoutBox,h.layoutBox)){d=this.target||mt();const p=Bt(this.layout.layoutBox.x);d.x.min=a.target.x.min,d.x.max=d.x.min+p;const y=Bt(this.layout.layoutBox.y);d.y.min=a.target.y.min,d.y.max=d.y.min+y}Pn(c,d),cl(c,m),os(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(a,c){this.sharedNodes.has(a)||this.sharedNodes.set(a,new J_),this.sharedNodes.get(a).add(c);const h=c.options.initialPromotionConfig;c.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(c):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){const{layoutId:a}=this.options;return a?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:c,preserveFollowOpacity:d}={}){const h=this.getStack();h&&h.promote(this,d),a&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let c=!1;const{latestValues:d}=a;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(c=!0),!c)return;const h={};d.z&&hf("z",a,h,this.animationValues);for(let m=0;m<df.length;m++)hf(`rotate${df[m]}`,a,h,this.animationValues),hf(`skew${df[m]}`,a,h,this.animationValues);a.render();for(const m in h)a.setStaticValue(m,h[m]),this.animationValues&&(this.animationValues[m]=h[m]);a.scheduleRender()}applyProjectionStyles(a,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const d=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=fl(c?.pointerEvents)||"",a.transform=d?d(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=fl(c?.pointerEvents)||""),this.hasProjected&&!Jr(this.latestValues)&&(a.transform=d?d({},""):"none",this.hasProjected=!1);return}a.visibility="";const m=h.animationValues||h.latestValues;this.applyTransformsToTarget();let p=W_(this.projectionDeltaWithTransform,this.treeScale,m);d&&(p=d(m,p)),a.transform=p;const{x:y,y:w}=this.projectionDelta;a.transformOrigin=`${y.origin*100}% ${w.origin*100}% 0`,h.animationValues?a.opacity=h===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:a.opacity=h===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const k in wd){if(m[k]===void 0)continue;const{correct:C,applyTo:T,isCSSVariable:E}=wd[k],A=p==="none"?m[k]:C(m[k],h);if(T){const M=T.length;for(let _=0;_<M;_++)a[T[_]]=A}else E?this.options.visualElement.renderState.vars[k]=A:a[k]=A}this.options.layoutId&&(a.pointerEvents=h===this?fl(c?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>a.currentAnimation?.stop()),this.root.nodes.forEach(Uv),this.root.sharedNodes.clear()}}}function nO(e){e.updateLayout()}function rO(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:s}=e.options,l=t.source!==e.layout.source;if(s==="size")zn(m=>{const p=l?t.measuredBox[m]:t.layoutBox[m],y=Bt(p);p.min=n[m].min,p.max=p.min+y});else if(s==="x"||s==="y"){const m=s==="x"?"y":"x";kd(l?t.measuredBox[m]:t.layoutBox[m],n[m])}else kk(s,t.layoutBox,n)&&zn(m=>{const p=l?t.measuredBox[m]:t.layoutBox[m],y=Bt(n[m]);p.max=p.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+y)});const a=Hi();os(a,n,t.layoutBox);const c=Hi();l?os(c,e.applyTransform(i,!0),t.measuredBox):os(c,n,t.layoutBox);const d=!gk(a);let h=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:p,layout:y}=m;if(p&&y){const w=e.options.layoutAnchor||void 0,k=mt();Pl(k,t.layoutBox,p.layoutBox,w);const C=mt();Pl(C,n,y.layoutBox,w),yk(k,C)||(h=!0),m.options.layoutRoot&&(e.relativeTarget=C,e.relativeTargetOrigin=k,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:d,hasRelativeLayoutChanged:h})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function iO(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function oO(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function sO(e){e.clearSnapshot()}function Uv(e){e.clearMeasurements()}function aO(e){e.isLayoutDirty=!0,e.updateLayout()}function $v(e){e.isLayoutDirty=!1}function lO(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function uO(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Wv(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function cO(e){e.resolveTargetDelta()}function fO(e){e.calcProjection()}function dO(e){e.resetSkewAndRotation()}function hO(e){e.removeLeadSnapshot()}function Hv(e,t,n){e.translate=qe(t.translate,0,n),e.scale=qe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Kv(e,t,n,i){e.min=qe(t.min,n.min,i),e.max=qe(t.max,n.max,i)}function pO(e,t,n,i){Kv(e.x,t.x,n.x,i),Kv(e.y,t.y,n.y,i)}function mO(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const gO={duration:.45,ease:[.4,0,.1,1]},qv=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Xv=qv("applewebkit/")&&!qv("chrome/")?Math.round:vn;function Yv(e){e.min=Xv(e.min),e.max=Xv(e.max)}function yO(e){Yv(e.x),Yv(e.y)}function kk(e,t,n){return e==="position"||e==="preserve-aspect"&&!F_(Ov(t),Ov(n),.2)}function vO(e){return e!==e.root&&e.scroll?.wasRoot}const xO=wk({attachResizeListener:(e,t)=>vs(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),pf={current:void 0},Sk=wk({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!pf.current){const e=new xO({});e.mount(window),e.setOptions({layoutScroll:!0}),pf.current=e}return pf.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Lh=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Gv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wO(...e){return t=>{let n=!1;const i=e.map(s=>{const l=Gv(s,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let s=0;s<i.length;s++){const l=i[s];typeof l=="function"?l():Gv(e[s],null)}}}}function kO(...e){return S.useCallback(wO(...e),e)}class SO extends S.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(ol(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const i=n.offsetParent,s=ol(i)&&i.offsetWidth||0,l=ol(i)&&i.offsetHeight||0,a=getComputedStyle(n),c=this.props.sizeRef.current;c.height=parseFloat(a.height),c.width=parseFloat(a.width),c.top=n.offsetTop,c.left=n.offsetLeft,c.right=s-c.width-c.left,c.bottom=l-c.height-c.top,c.direction=a.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function bO({children:e,isPresent:t,anchorX:n,anchorY:i,root:s,pop:l}){const a=S.useId(),c=S.useRef(null),d=S.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:h}=S.useContext(Lh),m=l!==!1?e.props?.ref??e?.ref:void 0,p=kO(c,m);return S.useInsertionEffect(()=>{const{width:y,height:w,top:k,left:C,right:T,bottom:E,direction:A}=d.current;if(t||l===!1||!c.current||!y||!w)return;const M=A==="rtl",_=n==="left"?M?`right: ${T}`:`left: ${C}`:M?`left: ${C}`:`right: ${T}`,W=i==="bottom"?`bottom: ${E}`:`top: ${k}`;c.current.dataset.motionPopId=a;const D=document.createElement("style");h&&(D.nonce=h);const Y=s??document.head;return Y.appendChild(D),D.sheet&&D.sheet.insertRule(`
314
- [data-motion-pop-id="${a}"] {
315
- position: absolute !important;
316
- width: ${y}px !important;
317
- height: ${w}px !important;
318
- ${_}px !important;
319
- ${W}px !important;
320
- }
321
- `),()=>{c.current?.removeAttribute("data-motion-pop-id"),Y.contains(D)&&Y.removeChild(D)}},[t]),v.jsx(SO,{isPresent:t,childRef:c,sizeRef:d,pop:l,children:l===!1?e:S.cloneElement(e,{ref:p})})}const CO=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:s,presenceAffectsLayout:l,mode:a,anchorX:c,anchorY:d,root:h})=>{const m=ch(EO),p=S.useId(),y=S.useRef(n),w=S.useRef(i);fh(()=>{y.current=n,w.current=i});let k=!0,C=S.useMemo(()=>(k=!1,{id:p,initial:t,isPresent:n,custom:s,onExitComplete:T=>{m.set(T,!0);for(const E of m.values())if(!E)return;i&&i()},register:T=>(m.set(T,!1),()=>{m.delete(T),!y.current&&!m.size&&w.current?.()})}),[n,m,i]);return l&&k&&(C={...C}),S.useMemo(()=>{m.forEach((T,E)=>m.set(E,!1))},[n]),S.useEffect(()=>{!n&&!m.size&&i&&i()},[n]),e=v.jsx(bO,{pop:a==="popLayout",isPresent:n,anchorX:c,anchorY:d,root:h,children:e}),v.jsx(zl.Provider,{value:C,children:e})};function EO(){return new Map}function bk(e=!0){const t=S.useContext(zl);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:s}=t,l=S.useId();S.useEffect(()=>{if(e)return s(l)},[e]);const a=S.useCallback(()=>e&&i&&i(l),[l,i,e]);return!n&&i?[!1,a]:[!0]}const Qa=e=>e.key||"";function Qv(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const TO=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:l="sync",propagate:a=!1,anchorX:c="left",anchorY:d="top",root:h})=>{const[m,p]=bk(a),y=S.useMemo(()=>Qv(e),[e]),w=a&&!m?[]:y.map(Qa),k=S.useRef(!0),C=S.useRef(y),T=ch(()=>new Map),E=S.useRef(new Set),[A,M]=S.useState(y),[_,W]=S.useState(y);fh(()=>{k.current=!1,C.current=y;for(let H=0;H<_.length;H++){const X=Qa(_[H]);w.includes(X)?(T.delete(X),E.current.delete(X)):T.get(X)!==!0&&T.set(X,!1)}},[_,w.length,w.join("-")]);const D=[];if(y!==A){let H=[...y];for(let X=0;X<_.length;X++){const j=_[X],G=Qa(j);w.includes(G)||(H.splice(X,0,j),D.push(j))}return l==="wait"&&D.length&&(H=D),W(Qv(H)),M(y),null}const{forceRender:Y}=S.useContext(uh);return v.jsx(v.Fragment,{children:_.map(H=>{const X=Qa(H),j=a&&!m?!1:y===_||w.includes(X),G=()=>{if(E.current.has(X))return;if(T.has(X))E.current.add(X),T.set(X,!0);else return;let U=!0;T.forEach(fe=>{fe||(U=!1)}),U&&(Y?.(),W(C.current),a&&p?.(),i&&i())};return v.jsx(CO,{isPresent:j,initial:!k.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:l,root:h,onExitComplete:j?void 0:G,anchorX:c,anchorY:d,children:H},X)})})},Ck=S.createContext({strict:!1}),Zv={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"]};let Jv=!1;function PO(){if(Jv)return;const e={};for(const t in Zv)e[t]={isEnabled:n=>Zv[t].some(i=>!!n[i])};ek(e),Jv=!0}function Ek(){return PO(),c_()}function RO(e){const t=Ek();for(const n in e)t[n]={...t[n],...e[n]};ek(t)}const MO=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"]);function Rl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||MO.has(e)}let Tk=e=>!Rl(e);function AO(e){typeof e=="function"&&(Tk=t=>t.startsWith("on")?!Rl(t):e(t))}try{AO(require("@emotion/is-prop-valid").default)}catch{}function NO(e,t,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||Et(e[s])||(Tk(s)||n===!0&&Rl(s)||!t&&!Rl(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}const Wl=S.createContext({});function jO(e,t){if($l(e)){const{initial:n,animate:i}=e;return{initial:n===!1||ys(n)?n:void 0,animate:ys(i)?i:void 0}}return e.inherit!==!1?t:{}}function DO(e){const{initial:t,animate:n}=jO(e,S.useContext(Wl));return S.useMemo(()=>({initial:t,animate:n}),[ex(t),ex(n)])}function ex(e){return Array.isArray(e)?e.join(" "):e}const _h=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Pk(e,t,n){for(const i in t)!Et(t[i])&&!ak(i,n)&&(e[i]=t[i])}function IO({transformTemplate:e},t){return S.useMemo(()=>{const n=_h();return Dh(n,t,e),Object.assign({},n.vars,n.style)},[t])}function LO(e,t){const n=e.style||{},i={};return Pk(i,n,e),Object.assign(i,IO(e,t)),i}function _O(e,t){const n={},i=LO(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.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=i,n}const Rk=()=>({..._h(),attrs:{}});function OO(e,t,n,i){const s=S.useMemo(()=>{const l=Rk();return lk(l,t,ck(i),e.transformTemplate,e.style),{...l.attrs,style:{...l.style}}},[t]);if(e.style){const l={};Pk(l,e.style,e),s.style={...l,...s.style}}return s}const FO=["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 Oh(e){return typeof e!="string"||e.includes("-")?!1:!!(FO.indexOf(e)>-1||/[A-Z]/u.test(e))}function zO(e,t,n,{latestValues:i},s,l=!1,a){const d=(a??Oh(e)?OO:_O)(t,i,s,e),h=NO(t,typeof e=="string",l),m=e!==S.Fragment?{...h,...d,ref:n}:{},{children:p}=t,y=S.useMemo(()=>Et(p)?p.get():p,[p]);return S.createElement(e,{...m,children:y})}function VO({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,s){return{latestValues:BO(n,i,s,e),renderState:t()}}function BO(e,t,n,i){const s={},l=i(e,{});for(const y in l)s[y]=fl(l[y]);let{initial:a,animate:c}=e;const d=$l(e),h=Z1(e);t&&h&&!d&&e.inherit!==!1&&(a===void 0&&(a=t.initial),c===void 0&&(c=t.animate));let m=n?n.initial===!1:!1;m=m||a===!1;const p=m?c:a;if(p&&typeof p!="boolean"&&!Ul(p)){const y=Array.isArray(p)?p:[p];for(let w=0;w<y.length;w++){const k=Eh(e,y[w]);if(k){const{transitionEnd:C,transition:T,...E}=k;for(const A in E){let M=E[A];if(Array.isArray(M)){const _=m?M.length-1:0;M=M[_]}M!==null&&(s[A]=M)}for(const A in C)s[A]=C[A]}}}return s}const Mk=e=>(t,n)=>{const i=S.useContext(Wl),s=S.useContext(zl),l=()=>VO(e,t,i,s);return n?l():ch(l)},UO=Mk({scrapeMotionValuesFromProps:Ih,createRenderState:_h}),$O=Mk({scrapeMotionValuesFromProps:fk,createRenderState:Rk}),WO=Symbol.for("motionComponentSymbol");function HO(e,t,n){const i=S.useRef(n);S.useInsertionEffect(()=>{i.current=n});const s=S.useRef(null);return S.useCallback(l=>{l&&e.onMount?.(l),t&&(l?t.mount(l):t.unmount());const a=i.current;if(typeof a=="function")if(l){const c=a(l);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):a(l);else a&&(a.current=l)},[t])}const Ak=S.createContext({});function Ui(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function KO(e,t,n,i,s,l){const{visualElement:a}=S.useContext(Wl),c=S.useContext(Ck),d=S.useContext(zl),h=S.useContext(Lh),m=h.reducedMotion,p=h.skipAnimations,y=S.useRef(null),w=S.useRef(!1);i=i||c.renderer,!y.current&&i&&(y.current=i(e,{visualState:t,parent:a,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:m,skipAnimations:p,isSVG:l}),w.current&&y.current&&(y.current.manuallyAnimateOnMount=!0));const k=y.current,C=S.useContext(Ak);k&&!k.projection&&s&&(k.type==="html"||k.type==="svg")&&qO(y.current,n,s,C);const T=S.useRef(!1);S.useInsertionEffect(()=>{k&&T.current&&k.update(n,d)});const E=n[V1],A=S.useRef(!!E&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(E)&&window.MotionHasOptimisedAnimation?.(E));return fh(()=>{w.current=!0,k&&(T.current=!0,window.MotionIsMounted=!0,k.updateFeatures(),k.scheduleRenderMicrotask(),A.current&&k.animationState&&k.animationState.animateChanges())}),S.useEffect(()=>{k&&(!A.current&&k.animationState&&k.animationState.animateChanges(),A.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(E)}),A.current=!1),k.enteringChildren=void 0)}),k}function qO(e,t,n,i){const{layoutId:s,layout:l,drag:a,dragConstraints:c,layoutScroll:d,layoutRoot:h,layoutAnchor:m,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Nk(e.parent)),e.projection.setOptions({layoutId:s,layout:l,alwaysMeasureLayout:!!a||c&&Ui(c),visualElement:e,animationType:typeof l=="string"?l:"both",initialPromotionConfig:i,crossfade:p,layoutScroll:d,layoutRoot:h,layoutAnchor:m})}function Nk(e){if(e)return e.options.allowProjection!==!1?e.projection:Nk(e.parent)}function mf(e,{forwardMotionProps:t=!1,type:n}={},i,s){i&&RO(i);const l=n?n==="svg":Oh(e),a=l?$O:UO;function c(h,m){let p;const y={...S.useContext(Lh),...h,layoutId:XO(h)},{isStatic:w}=y,k=DO(h),C=a(h,w);if(!w&&typeof window<"u"){YO();const T=GO(y);p=T.MeasureLayout,k.visualElement=KO(e,C,y,s,T.ProjectionNode,l)}return v.jsxs(Wl.Provider,{value:k,children:[p&&k.visualElement?v.jsx(p,{visualElement:k.visualElement,...y}):null,zO(e,h,HO(C,k.visualElement,m),C,w,t,l)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const d=S.forwardRef(c);return d[WO]=e,d}function XO({layoutId:e}){const t=S.useContext(uh).id;return t&&e!==void 0?t+"-"+e:e}function YO(e,t){S.useContext(Ck).strict}function GO(e){const t=Ek(),{drag:n,layout:i}=t;if(!n&&!i)return{};const s={...n,...i};return{MeasureLayout:n?.isEnabled(e)||i?.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function QO(e,t){if(typeof Proxy>"u")return mf;const n=new Map,i=(l,a)=>mf(l,a,e,t),s=(l,a)=>i(l,a);return new Proxy(s,{get:(l,a)=>a==="create"?i:(n.has(a)||n.set(a,mf(a,void 0,e,t)),n.get(a))})}const ZO=(e,t)=>t.isSVG??Oh(e)?new P_(t):new k_(t,{allowProjection:e!==S.Fragment});class JO extends Dr{constructor(t){super(t),t.animationState||(t.animationState=j_(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Ul(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let eF=0;class tF extends Dr{constructor(){super(...arguments),this.id=eF++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;if(t&&i===!1){if(this.isExitComplete){const{initial:l,custom:a}=this.node.getProps();if(typeof l=="string"||typeof l=="object"&&l!==null&&!Array.isArray(l)){const c=oi(this.node,l,a);if(c){const{transition:d,transitionEnd:h,...m}=c;for(const p in m)this.node.getValue(p)?.jump(m[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const nF={animation:{Feature:JO},exit:{Feature:tF}};function As(e){return{point:{x:e.pageX,y:e.pageY}}}const rF=e=>t=>Mh(t)&&e(t,As(t));function ss(e,t,n,i){return vs(e,t,rF(n),i)}const jk=({current:e})=>e?e.ownerDocument.defaultView:null,tx=(e,t)=>Math.abs(e-t);function iF(e,t){const n=tx(e.x,t.x),i=tx(e.y,t.y);return Math.sqrt(n**2+i**2)}const nx=new Set(["auto","scroll"]);class Dk{constructor(t,n,{transformPagePoint:i,contextWindow:s=window,dragSnapToOrigin:l=!1,distanceThreshold:a=3,element:c}={}){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=k=>{this.handleScroll(k.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Za(this.lastRawMoveEventInfo,this.transformPagePoint));const k=gf(this.lastMoveEventInfo,this.history),C=this.startEvent!==null,T=iF(k.offset,{x:0,y:0})>=this.distanceThreshold;if(!C&&!T)return;const{point:E}=k,{timestamp:A}=Ct;this.history.push({...E,timestamp:A});const{onStart:M,onMove:_}=this.handlers;C||(M&&M(this.lastMoveEvent,k),this.startEvent=this.lastMoveEvent),_&&_(this.lastMoveEvent,k)},this.handlePointerMove=(k,C)=>{this.lastMoveEvent=k,this.lastRawMoveEventInfo=C,this.lastMoveEventInfo=Za(C,this.transformPagePoint),Xe.update(this.updatePoint,!0)},this.handlePointerUp=(k,C)=>{this.end();const{onEnd:T,onSessionEnd:E,resumeAnimation:A}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&A&&A(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const M=gf(k.type==="pointercancel"?this.lastMoveEventInfo:Za(C,this.transformPagePoint),this.history);this.startEvent&&T&&T(k,M),E&&E(k,M)},!Mh(t))return;this.dragSnapToOrigin=l,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=a,this.contextWindow=s||window;const d=As(t),h=Za(d,this.transformPagePoint),{point:m}=h,{timestamp:p}=Ct;this.history=[{...m,timestamp:p}];const{onSessionStart:y}=n;y&&y(t,gf(h,this.history));const w={passive:!0,capture:!0};this.removeListeners=Ps(ss(this.contextWindow,"pointermove",this.handlePointerMove,w),ss(this.contextWindow,"pointerup",this.handlePointerUp,w),ss(this.contextWindow,"pointercancel",this.handlePointerUp,w)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const i=getComputedStyle(n);(nx.has(i.overflowX)||nx.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.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(t){const n=this.scrollPositions.get(t);if(!n)return;const i=t===window,s=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},l={x:s.x-n.x,y:s.y-n.y};l.x===0&&l.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=l.x,this.lastMoveEventInfo.point.y+=l.y):this.history.length>0&&(this.history[0].x-=l.x,this.history[0].y-=l.y),this.scrollPositions.set(t,s),Xe.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Nr(this.updatePoint)}}function Za(e,t){return t?{point:t(e.point)}:e}function rx(e,t){return{x:e.x-t.x,y:e.y-t.y}}function gf({point:e},t){return{point:e,delta:rx(e,Ik(t)),offset:rx(e,oF(t)),velocity:sF(t,.1)}}function oF(e){return e[0]}function Ik(e){return e[e.length-1]}function sF(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const s=Ik(e);for(;n>=0&&(i=e[n],!(s.timestamp-i.timestamp>sn(t)));)n--;if(!i)return{x:0,y:0};i===e[0]&&e.length>2&&s.timestamp-i.timestamp>sn(t)*2&&(i=e[1]);const l=yn(s.timestamp-i.timestamp);if(l===0)return{x:0,y:0};const a={x:(s.x-i.x)/l,y:(s.y-i.y)/l};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function aF(e,{min:t,max:n},i){return t!==void 0&&e<t?e=i?qe(t,e,i.min):Math.max(e,t):n!==void 0&&e>n&&(e=i?qe(n,e,i.max):Math.min(e,n)),e}function ix(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function lF(e,{top:t,left:n,bottom:i,right:s}){return{x:ix(e.x,n,s),y:ix(e.y,t,i)}}function ox(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,i]=[i,n]),{min:n,max:i}}function uF(e,t){return{x:ox(e.x,t.x),y:ox(e.y,t.y)}}function cF(e,t){let n=.5;const i=Bt(e),s=Bt(t);return s>i?n=ms(t.min,t.max-i,e.min):i>s&&(n=ms(e.min,e.max-s,t.min)),$n(0,1,n)}function fF(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Sd=.35;function dF(e=Sd){return e===!1?e=0:e===!0&&(e=Sd),{x:sx(e,"left","right"),y:sx(e,"top","bottom")}}function sx(e,t,n){return{min:ax(e,t),max:ax(e,n)}}function ax(e,t){return typeof e=="number"?e:e[t]||0}const hF=new WeakMap;class pF{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=mt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const l=p=>{n&&this.snapToCursor(As(p).point),this.stopAnimation()},a=(p,y)=>{const{drag:w,dragPropagation:k,onDragStart:C}=this.getProps();if(w&&!k&&(this.openDragLock&&this.openDragLock(),this.openDragLock=VL(w),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=y,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),zn(E=>{let A=this.getAxisMotionValue(E).get()||0;if(Un.test(A)){const{projection:M}=this.visualElement;if(M&&M.layout){const _=M.layout.layoutBox[E];_&&(A=Bt(_)*(parseFloat(A)/100))}}this.originPoint[E]=A}),C&&Xe.update(()=>C(p,y),!1,!0),dd(this.visualElement,"transform");const{animationState:T}=this.visualElement;T&&T.setActive("whileDrag",!0)},c=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y;const{dragPropagation:w,dragDirectionLock:k,onDirectionLock:C,onDrag:T}=this.getProps();if(!w&&!this.openDragLock)return;const{offset:E}=y;if(k&&this.currentDirection===null){this.currentDirection=gF(E),this.currentDirection!==null&&C&&C(this.currentDirection);return}this.updateAxis("x",y.point,E),this.updateAxis("y",y.point,E),this.visualElement.render(),T&&Xe.update(()=>T(p,y),!1,!0)},d=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y,this.stop(p,y),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new Dk(t,{onSessionStart:l,onStart:a,onMove:c,onSessionEnd:d,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:i,contextWindow:jk(this.visualElement),element:this.visualElement.current})}stop(t,n){const i=t||this.latestPointerEvent,s=n||this.latestPanInfo,l=this.isDragging;if(this.cancel(),!l||!s||!i)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:c}=this.getProps();c&&Xe.postRender(()=>c(i,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,i){const{drag:s}=this.getProps();if(!i||!Ja(t,s,this.currentDirection))return;const l=this.getAxisMotionValue(t);let a=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(a=aF(a,this.constraints[t],this.elastic[t])),l.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&Ui(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=lF(i.layoutBox,t):this.constraints=!1,this.elastic=dF(n),s!==this.constraints&&!Ui(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&zn(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=fF(i.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ui(t))return!1;const i=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const l=m_(i,s.root,this.visualElement.getTransformPagePoint());let a=uF(s.layout.layoutBox,l);if(n){const c=n(d_(a));this.hasMutatedConstraints=!!c,c&&(a=nk(c))}return a}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:l,dragSnapToOrigin:a,onDragTransitionEnd:c}=this.getProps(),d=this.constraints||{},h=zn(m=>{if(!Ja(m,n,this.currentDirection))return;let p=d&&d[m]||{};(a===!0||a===m)&&(p={min:0,max:0});const y=s?200:1e6,w=s?40:1e7,k={type:"inertia",velocity:i?t[m]:0,bounceStiffness:y,bounceDamping:w,timeConstant:750,restDelta:1,restSpeed:10,...l,...p};return this.startAxisValueAnimation(m,k)});return Promise.all(h).then(c)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return dd(this.visualElement,t),i.start(Ch(t,i,0,n,this.visualElement,!1))}stopAnimation(){zn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){zn(n=>{const{drag:i}=this.getProps();if(!Ja(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,l=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:c}=s.layout.layoutBox[n],d=l.get()||0;l.set(t[n]-qe(a,c,.5)+d)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Ui(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};zn(a=>{const c=this.getAxisMotionValue(a);if(c&&this.constraints!==!1){const d=c.get();s[a]=cF({min:d,max:d},this.constraints[a])}});const{transformTemplate:l}=this.visualElement.getProps();this.visualElement.current.style.transform=l?l({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),zn(a=>{if(!Ja(a,t,null))return;const c=this.getAxisMotionValue(a),{min:d,max:h}=this.constraints[a];c.set(qe(d,h,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;hF.set(this.visualElement,this);const t=this.visualElement.current,n=ss(t,"pointerdown",h=>{const{drag:m,dragListener:p=!0}=this.getProps(),y=h.target,w=y!==t&&KL(y);m&&p&&!w&&this.start(h)});let i;const s=()=>{const{dragConstraints:h}=this.getProps();Ui(h)&&h.current&&(this.constraints=this.resolveRefConstraints(),i||(i=mF(t,h.current,()=>this.scalePositionWithinConstraints())))},{projection:l}=this.visualElement,a=l.addEventListener("measure",s);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),Xe.read(s);const c=vs(window,"resize",()=>this.scalePositionWithinConstraints()),d=l.addEventListener("didUpdate",({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(zn(p=>{const y=this.getAxisMotionValue(p);y&&(this.originPoint[p]+=h[p].translate,y.set(y.get()+h[p].translate))}),this.visualElement.render())});return()=>{c(),n(),a(),d&&d(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:l=!1,dragElastic:a=Sd,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:l,dragElastic:a,dragMomentum:c}}}function lx(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function mF(e,t,n){const i=mv(e,lx(n)),s=mv(t,lx(n));return()=>{i(),s()}}function Ja(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function gF(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class yF extends Dr{constructor(t){super(t),this.removeGroupControls=vn,this.removeListeners=vn,this.controls=new pF(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||vn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const yf=e=>(t,n)=>{e&&Xe.update(()=>e(t,n),!1,!0)};class vF extends Dr{constructor(){super(...arguments),this.removePointerDownListener=vn}onPointerDown(t){this.session=new Dk(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:jk(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:yf(t),onStart:yf(n),onMove:yf(i),onEnd:(l,a)=>{delete this.session,s&&Xe.postRender(()=>s(l,a))}}}mount(){this.removePointerDownListener=ss(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let vf=!1;class xF extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:l}=t;l&&(n.group&&n.group.add(l),i&&i.register&&s&&i.register(l),vf&&l.root.didUpdate(),l.addEventListener("animationComplete",()=>{this.safeToRemove()}),l.setOptions({...l.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),dl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:s,isPresent:l}=this.props,{projection:a}=i;return a&&(a.isPresent=l,t.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),vf=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==l?a.willUpdate():this.safeToRemove(),t.isPresent!==l&&(l?a.promote():a.relegate()||Xe.postRender(()=>{const c=a.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:i}=t;i&&(i.options.layoutAnchor=n,i.root.didUpdate(),Rh.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=t;vf=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Lk(e){const[t,n]=bk(),i=S.useContext(uh);return v.jsx(xF,{...e,layoutGroup:i,switchLayoutGroup:S.useContext(Ak),isPresent:t,safeToRemove:n})}const wF={pan:{Feature:vF},drag:{Feature:yF,ProjectionNode:Sk,MeasureLayout:Lk}};function ux(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,l=i[s];l&&Xe.postRender(()=>l(t,As(t)))}class kF extends Dr{mount(){const{current:t}=this.node;t&&(this.unmount=UL(t,(n,i)=>(ux(this.node,i,"Start"),s=>ux(this.node,s,"End"))))}unmount(){}}class SF extends Dr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Ps(vs(this.node.current,"focus",()=>this.onFocus()),vs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function cx(e,t,n){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),l=i[s];l&&Xe.postRender(()=>l(t,As(t)))}class bF extends Dr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=XL(t,(s,l)=>(cx(this.node,l,"Start"),(a,{success:c})=>cx(this.node,a,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const bd=new WeakMap,xf=new WeakMap,CF=e=>{const t=bd.get(e.target);t&&t(e)},EF=e=>{e.forEach(CF)};function TF({root:e,...t}){const n=e||document;xf.has(n)||xf.set(n,{});const i=xf.get(n),s=JSON.stringify(t);return i[s]||(i[s]=new IntersectionObserver(EF,{root:e,...t})),i[s]}function PF(e,t,n){const i=TF(t);return bd.set(e,n),i.observe(e),()=>{bd.delete(e),i.unobserve(e)}}const RF={some:0,all:1};class MF extends Dr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:l}=t,a={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:RF[s]},c=d=>{const{isIntersecting:h}=d;if(this.isInView===h||(this.isInView=h,l&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:m,onViewportLeave:p}=this.node.getProps(),y=h?m:p;y&&y(d)};this.stopObserver=PF(this.node.current,a,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(AF(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function AF({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const NF={inView:{Feature:MF},tap:{Feature:bF},focus:{Feature:SF},hover:{Feature:kF}},jF={layout:{ProjectionNode:Sk,MeasureLayout:Lk}},DF={...nF,...NF,...wF,...jF},as=QO(DF,ZO),Cd="ours.chats.listMode",ls="recent";function _k(){try{return globalThis.localStorage}catch{return}}function IF(e=_k()){try{return e?.getItem(Cd)==="identity"?"identity":ls}catch{return ls}}function LF(e,t=_k()){const n=e==="identity"?"identity":ls;try{return t?.setItem(Cd,n),t?.getItem(Cd)===n?n:ls}catch{return ls}}function xs(e){return typeof e=="string"?e:""}function Ml(e,t){const n=xs(e),i=xs(t),s=n.normalize().toLowerCase(),l=i.normalize().toLowerCase();return s<l?-1:s>l?1:n<i?-1:n>i?1:0}function _F(e,t){const n=hl(xs(t.activityAt))-hl(xs(e.activityAt));if(n!==0)return n;const i=Ml(e.name,t.name);return i!==0?i:Ml(e.id,t.id)}function Ed(e){return[...e].sort(_F)}function fx(e){return e.contacts.length>0?hl(xs(e.contacts[0].activityAt)):0}function OF(e,t){const n=new Map,i=[];for(const l of e){const a=l.root||(t?.[l.id]?l.id:null);if(!a){i.push(l);continue}const c=t?.[a]||{label:a,note:""};let d=n.get(a);d||(d={id:`root:${a}`,rootId:a,label:c.label,note:c.note,contacts:[]},n.set(a,d)),d.contacts.push(l)}const s=[...n.values()].map(l=>({...l,contacts:Ed(l.contacts)}));return i.length>0&&s.push({id:"rootless",rootId:null,label:"Independent identities",note:"People, agents and apps without a verified Human/root group",contacts:Ed(i)}),s.sort((l,a)=>{const c=fx(a)-fx(l);if(c!==0)return c;const d=Ml(l.label,a.label);return d!==0?d:Ml(l.id,a.id)})}const FF=15e3;function wf(e){const{c:t,active:n,grouped:i}=e;return v.jsxs(as.button,{type:"button",layout:!0,className:"contact-row"+(n?" active":"")+(i?" grouped":"")+(t.status==="pending"?" pending":""),onClick:e.onClick,whileHover:{x:3},whileTap:{scale:.985},transition:{type:"spring",stiffness:420,damping:32},children:[v.jsx("span",{className:"contact-avatar","aria-hidden":!0,children:t.initials}),v.jsxs("span",{className:"contact-copy",children:[v.jsxs("span",{className:"contact-row-topline",children:[v.jsx("span",{className:"contact-name",children:t.name}),t.when&&v.jsx("span",{className:"contact-time",children:t.when})]}),v.jsxs("span",{className:"contact-row-bottomline",children:[v.jsx("span",{className:"contact-last",children:t.last}),t.status==="pending"&&v.jsx("span",{className:"chip",children:"invited"}),!!t.unread&&v.jsx("span",{className:"contact-unread",children:t.unread})]})]}),n&&v.jsx(as.span,{className:"contact-active-glow",layoutId:"active-contact"})]})}function zF(e){const{contacts:t,roots:n,selected:i}=e,[s,l]=S.useState(""),[a,c]=S.useState(()=>IF()),d=E=>E.name.toLowerCase().includes(s.toLowerCase()),h=t.filter(E=>E.status!=="pending"&&d(E)),m=t.filter(E=>E.status==="pending"&&d(E)),p=Ed(h),y=OF(h,n),w=h.length===0&&m.length===0,k=E=>{c(LF(E))},C=[{id:"recent",label:"Recent"},{id:"identity",label:"By identity"}],T=(E,A)=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(E.key))return;E.preventDefault();const _=E.key==="Home"?"recent":E.key==="End"||A==="recent"?"identity":"recent";k(_),document.getElementById(`conversation-list-${_}`)?.focus()};return v.jsxs("div",{className:"listcol",children:[v.jsxs("div",{className:"listcol-head",children:[v.jsxs("div",{className:"listcol-titlebar",children:[v.jsx("h2",{className:"listcol-title",children:"Chats"}),v.jsxs("div",{className:"listcol-actions",children:[v.jsxs("button",{className:"btn sm primary",onClick:e.onInvite,children:[v.jsx(ve,{name:"plus",size:15}),"Invite"]}),v.jsx("button",{className:"icon-btn",title:"Settings","aria-label":"Settings",onClick:e.onSettings,children:v.jsx(ve,{name:"settings"})})]})]}),v.jsxs("div",{className:"search",children:[v.jsx(ve,{name:"search"}),v.jsx("input",{className:"field",placeholder:"Search people, agents, apps…",value:s,onChange:E=>l(E.target.value)})]}),v.jsx("div",{className:"conversation-list-modes",role:"tablist","aria-label":"Conversation list layout",children:C.map(E=>v.jsx("button",{id:`conversation-list-${E.id}`,type:"button",role:"tab","aria-selected":a===E.id,"aria-controls":"conversation-list-panel",tabIndex:a===E.id?0:-1,className:a===E.id?"active":"",onClick:()=>k(E.id),onKeyDown:A=>T(A,E.id),children:E.label},E.id))})]}),v.jsxs("div",{id:"conversation-list-panel",className:"listcol-scroll",role:"tabpanel","aria-labelledby":`conversation-list-${a}`,children:[a==="recent"&&p.length>0&&v.jsx("div",{className:"conversation-group",children:p.map(E=>v.jsx(wf,{c:E,active:i===E.id,onClick:()=>e.onSelect(E.id)},E.id))}),a==="identity"&&y.map(E=>v.jsxs("div",{children:[v.jsxs("div",{className:"group-label",title:E.note,children:[E.rootId&&v.jsx(ve,{name:"clusters"}),v.jsx("span",{children:E.label}),E.note&&v.jsxs("span",{className:"gl-note",children:["· ",E.note]})]}),v.jsx("div",{className:"conversation-group",children:E.contacts.map(A=>v.jsx(wf,{c:A,grouped:E.rootId!==null,active:i===A.id,onClick:()=>e.onSelect(A.id)},A.id))})]},E.id)),m.length>0&&v.jsxs("div",{children:[v.jsx("div",{className:"group-label",children:v.jsx("span",{children:"Pending"})}),v.jsx("div",{className:"conversation-group",children:m.map(E=>v.jsx(wf,{c:E,active:!1,onClick:()=>{}},E.id))})]}),w&&v.jsx("p",{className:"muted",style:{padding:"14px 10px",fontSize:"0.85rem"},children:"No contacts yet — share an invite to start."})]})]})}const dx=e=>`chat-message-${encodeURIComponent(e)}`,VF=()=>typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function hx(e){const{dir:t,canReply:n,onReply:i}=e,s=S.useRef(null),l=S.useRef(null),a=t==="out"?-1:1,c=8,d=56,h=84,m=S.useRef({id:-1,x0:0,y0:0,mode:"idle",armed:!1}),p=C=>{const T=s.current,E=l.current;if(T&&(T.style.transform=C?`translateX(${C}px)`:""),E){const A=Math.min(1,Math.abs(C)/d);E.style.opacity=String(A),E.style.transform=`scale(${.5+.5*A})`}},y=C=>{!n||C.pointerType==="mouse"||(m.current={id:C.pointerId,x0:C.clientX,y0:C.clientY,mode:"maybe",armed:!1})},w=C=>{const T=m.current;if(T.id!==C.pointerId||T.mode==="idle")return;const E=C.clientX-T.x0,A=C.clientY-T.y0;if(T.mode==="maybe"){if(Math.abs(E)<c&&Math.abs(A)<c)return;if(Math.abs(E)>Math.abs(A)&&Math.sign(E)===a)T.mode="drag",s.current?.classList.add("swiping");else{T.mode="idle";return}}let M=E*a;M<0&&(M=0),M>d&&(M=d+(M-d)*.35),M=Math.min(M,h);const _=M*a,W=Math.abs(_)>=d;W!==T.armed&&(T.armed=W,l.current?.classList.toggle("armed",W),W&&navigator.vibrate?.(10)),p(_)},k=C=>{const T=m.current;if(T.id!==C.pointerId)return;const E=T.mode==="drag"&&T.armed;m.current={id:-1,x0:0,y0:0,mode:"idle",armed:!1},s.current?.classList.remove("swiping"),l.current?.classList.remove("armed"),p(0),E&&i()};return v.jsxs("div",{className:"msg-row "+(e.rowClass??t),style:n?{touchAction:"pan-y"}:void 0,onPointerDown:y,onPointerMove:w,onPointerUp:k,onPointerCancel:k,children:[n&&v.jsx("span",{className:"swipe-cue",ref:l,"aria-hidden":!0,children:v.jsx(ve,{name:"reply",size:16})}),v.jsx("div",{className:"bubble-wrap",ref:s,children:e.children}),e.after]})}function BF(e){const{contact:t,messages:n}=e,[i,s]=S.useState(""),[l,a]=S.useState(!1),[c,d]=S.useState(null),[h,m]=S.useState(null),[p,y]=S.useState(null),[w,k]=S.useState(null),[C,T]=S.useState(null),[E,A]=S.useState(!1),[M,_]=S.useState(null),[W,D]=S.useState(!1),[Y,H]=S.useState(!1),[X,j]=S.useState(!1),[G,U]=S.useState(null),[fe,se]=S.useState(!1),ee=S.useRef(null),xe=S.useRef(null),Ee=S.useRef(!1),q=S.useRef(null),le=S.useRef(!0),P=S.useRef(null),L=S.useRef(0),Q=S.useRef(null),R=S.useRef(new Map),Z=S.useRef(0),de=S.useRef(null),ie=S.useRef(null),Ce=S.useRef(0),ge=S.useRef(0);S.useEffect(()=>{s(""),m(null),y(null),d(null),k(null),T(null),A(!1),_(null),D(!1),H(!1),j(!1),L.current+=1,U(null),se(!1),R.current.clear(),de.current=null,ie.current=null},[t?.id]),S.useEffect(()=>{if(!p)return;const z=p.reply?.wireId;n.some(V=>V.kind!=="file"&&V.dir==="out"&&!!V.wireId&&!p.wireIds.has(V.wireId)&&V.text===p.text&&(V.replyTo?.wireId??void 0)===z)&&(y(null),m(null),s(V=>V===p.draft?"":V),k(V=>V===p.reply?null:V))},[n,p]);const Te=!!c?.wireId&&n.some(z=>z.wireId===c.wireId),je=S.useMemo(()=>c&&!Te?[...n,c.message]:n,[n,c,Te]);S.useEffect(()=>{Te&&d(null)},[Te]),S.useLayoutEffect(()=>{const z=xe.current;if(!z)return;z.style.height="0px";const he=Math.max(44,Math.min(z.scrollHeight,132));z.style.height=`${he}px`,z.style.overflowY=z.scrollHeight>132?"auto":"hidden"},[i,t?.id]);const $e=z=>{const he=q.current;if(!he)return;const V=Math.max(0,he.scrollHeight-he.clientHeight+8);if(Math.abs(he.scrollTop-V)<1){de.current=null,ie.current=null;return}const J=z&&!VF();if(de.current=J?V:null,ie.current=J?he.scrollTop:null,J)he.scrollTo({top:V,behavior:"smooth"});else{he.scrollTop=V;const F=()=>{const oe=q.current;oe===he&&le.current&&(oe.scrollTop=oe.scrollHeight-oe.clientHeight+8)};requestAnimationFrame(F),window.setTimeout(F,50),window.setTimeout(F,200)}};S.useLayoutEffect(()=>{if(!t){P.current=null,le.current=!0,Ce.current=0,ge.current=0;return}const z=q.current;if(!z)return;const he=P.current!==t.id,V=je.length!==Ce.current,J=ge.current;if(Ce.current=je.length,!he&&V&&J>0){const F=z.scrollHeight-z.clientHeight-z.scrollTop;le.current=J-z.clientHeight-z.scrollTop<=48||F<=160}!he&&!V&&de.current===null&&(le.current=z.scrollHeight-z.clientHeight-z.scrollTop<=48),(he||le.current)&&($e(V&&!he&&P.current!==null),le.current=!0),ge.current=z.scrollHeight,P.current=t.id},[t,je.length]),S.useLayoutEffect(()=>{const z=window.location.hash;if(!z.startsWith("#chat-message-"))return;const he=document.getElementById(z.slice(1));he&&(he.scrollIntoView({block:"center"}),le.current=!1)},[t?.id,je.length]),S.useLayoutEffect(()=>{const z=Q.current,he=q.current;if(z===null||!he)return;const V=requestAnimationFrame(()=>{Q.current===z&&(he.scrollTop=z.top+he.scrollHeight-z.height,Q.current=null)});return()=>cancelAnimationFrame(V)},[je.length]),S.useEffect(()=>{const z=q.current;if(!z||typeof ResizeObserver>"u")return;const he=z.firstElementChild;if(!he)return;const V=new ResizeObserver(J=>{if(J.some(F=>F.target===he)){const F=ge.current;if(F>0){const oe=z.scrollHeight-z.clientHeight-z.scrollTop;le.current=F-z.clientHeight-z.scrollTop<=48||oe<=160}ge.current=z.scrollHeight,le.current&&$e(!1);return}le.current&&$e(de.current!==null)});return V.observe(he),V.observe(z),()=>V.disconnect()},[t?.id]);const kt=async z=>{const he=++L.current;m(null),j(!0);try{if(z.size>Qo&&G0(z.type,z.name)){const J=await MD(z,Qo);if(he!==L.current)return;_({filename:J.filename,mime:J.mime,bytes:J.bytes,originalSize:J.originalSize});return}if(z.size>Qo){m(`"${z.name}" is ${Rr(z.size)} — files up to ${Rr(Qo)} can be sent.`);return}const V=await z.arrayBuffer();if(he!==L.current)return;_({filename:z.name||"file",mime:z.type||"application/octet-stream",bytes:new Uint8Array(V)})}catch(V){he===L.current&&m(`Photo optimization failed: ${V instanceof Error?V.message:String(V)}`)}finally{he===L.current&&j(!1)}},gt=()=>{!M||!e.onSendFile||Y||(H(!0),e.onSendFile(M,w?.wireId).then(()=>{_(null),k(null)}).catch(z=>m(`File send failed: ${String(z)} — it was not delivered.`)).finally(()=>H(!1)))},Dt=e.onDraftChange;S.useEffect(()=>(Dt?.(i.trim().length>0||l),()=>Dt?.(!1)),[i,l,Dt]);const Qt=new Map;for(const z of je)z.wireId&&Qt.set(z.wireId,z);const Ut=S.useMemo(()=>{const z=new Map;for(const he of je)z.set(he,he.kind==="file"?null:nE(t?.announcedName??"",he.text));return z},[je,t?.announcedName]),it=z=>Ut.get(z)??null,It=z=>{if(z.dir==="out")return"You";const he=it(z);return he&&he.variant==="chat"?he.author:t?.name??"Them"},Le=z=>{if(z.kind==="file")return z.mime?.startsWith("image/")?"Photo":qi(z.mime??"",z.filename??"")?"Voice message":z.filename||"File";const he=it(z);return he?he.text||oE(he):z.text},an=z=>{if(!z.replyTo)return null;const he=Qt.get(z.replyTo.wireId);return he?{author:It(he),text:Le(he)}:{author:"",text:"Original message"}};if(!t)return e.emptyOverride?v.jsx(v.Fragment,{children:e.emptyOverride}):v.jsx("div",{className:"detail",children:v.jsxs("div",{className:"detail-empty",children:[v.jsx(ve,{name:"chat"}),v.jsxs("div",{children:[v.jsx("div",{style:{fontWeight:650,color:"var(--text-2)"},children:"Select a conversation"}),v.jsx("div",{style:{fontSize:"0.85rem"},children:"Chat with people, agents and apps across ours."})]})]})});const Lt=async()=>{const z=i,he=z.trim(),V=!!p&&z===p.draft&&(w?.wireId??void 0)===p.reply?.wireId;if(!he||Ee.current||V)return;p&&y(null),Ee.current=!0,a(!0),m(null);const J=w,F=J?.wireId,oe=new AbortController;let te=!1,Ae=0;s(""),k(null);const Fe=`optimistic-${++Z.current}`;d({key:Fe,wireId:null,message:{dir:"out",text:he,date:new Date().toISOString(),read:!0,wireId:"",replyTo:F?{wireId:F}:null}});try{const pe=await Promise.race([e.onSend(he,F,oe.signal),new Promise((Ie,Tt)=>{Ae=window.setTimeout(()=>{te=!0,oe.abort(),Tt(new Error("send timeout"))},FF)})]);pe?(R.current.set(pe,Fe),d(Ie=>Ie?.key===Fe?{...Ie,wireId:pe}:Ie)):d(Ie=>Ie?.key===Fe?null:Ie),y(null)}catch(pe){d(null),s(Ie=>Ie===""?z:Ie),k(Ie=>Ie===null?J:Ie),te||!(pe instanceof kf)?(y({draft:z,text:he,reply:J,wireIds:new Set(n.flatMap(Ie=>Ie.wireId?[Ie.wireId]:[]))}),m(`${te?"Send timed out":"Send connection was interrupted"} — delivery status is unknown. Check the conversation; edit the draft before sending again.`)):m(`Send failed: ${String(pe)} — the message was not delivered.`)}finally{window.clearTimeout(Ae),Ee.current=!1,a(!1)}},jn=!!p&&i===p.draft&&(w?.wireId??void 0)===p.reply?.wireId,ln=z=>{z.wireId&&k({wireId:z.wireId,author:It(z),text:Le(z)})};return v.jsxs("div",{className:"detail detail-chat",children:[v.jsxs("div",{className:"detail-head",children:[v.jsxs("div",{className:"conv-peer",children:[v.jsx("button",{className:"icon-btn detail-back",onClick:e.onBack,children:v.jsx(ve,{name:"back"})}),v.jsx("div",{className:"avatar accent",children:t.initials}),v.jsxs("div",{className:"conv-peer-meta",children:[C!==null?v.jsx("input",{className:"field name-edit",value:C,autoFocus:!0,placeholder:t.name,onChange:z=>T(z.target.value),onKeyDown:z=>{z.key==="Enter"?(e.onRename?.(C),T(null)):z.key==="Escape"&&T(null)},onBlur:()=>T(null)}):v.jsxs("div",{className:"conv-peer-name",children:[t.name,e.onRename&&v.jsx("button",{className:"icon-btn name-pencil",title:"Rename (only changes how they appear to you)",onClick:()=>T(t.name),children:v.jsx(ve,{name:"edit",size:13})})]}),e.syncing&&v.jsxs("div",{className:"conv-sync",role:"status","aria-live":"polite",children:[v.jsx("span",{className:"conv-sync-dot","aria-hidden":!0}),e.syncing==="connecting"?"Connecting…":"Updating…"]}),!e.syncing&&(t.roleId?v.jsxs("button",{className:"idchip",onClick:()=>A(!0),children:[v.jsx(ve,{name:"shield",size:11}),"verified role of ",t.rootName]}):t.status!=="pending"&&v.jsxs("button",{className:"idchip quiet",onClick:()=>A(!0),children:[v.jsx(ve,{name:"lock",size:11}),"verified identity"]}))]})]}),E&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"pop-backdrop",onClick:()=>A(!1)}),v.jsxs("div",{className:"idcard anim-scale",children:[v.jsx("h4",{children:"Verified identity"}),t.roleId&&v.jsxs("p",{children:["This is the role ",v.jsxs("strong",{children:["“",t.roleId,"”"]})," of"," ",v.jsx("strong",{children:t.rootName})," — the link is cryptographically signed, not self-declared."]}),v.jsx("div",{className:"idcard-fp mono",children:t.id}),v.jsx("p",{className:"idcard-note",children:"This id is the fingerprint of their key. Names are what people show you; the fingerprint is what guarantees you're always talking to the same identity — no one can impersonate it. Renaming only changes how they appear to you."})]})]}),v.jsxs("div",{className:"conv-actions",children:[v.jsxs("button",{className:"btn sm",title:"Shared photos, files, and links",onClick:()=>se(!0),children:[v.jsx(ve,{name:"paperclip",size:14}),"Media"]}),v.jsxs("button",{className:"btn sm danger",title:"Remove contact",onClick:e.onRemove,children:[v.jsx(ve,{name:"trash",size:14}),"Remove"]})]})]}),v.jsx("div",{className:"messages",ref:q,onScroll:z=>{const he=z.currentTarget,V=he.scrollHeight-he.clientHeight-he.scrollTop;if(de.current!==null){const J=ie.current;if(J===null||he.scrollTop>=J-1){ie.current=he.scrollTop,V<=4&&(de.current=null,ie.current=null);return}de.current=null,ie.current=null}le.current=V<=48},onPointerDown:()=>{de.current=null,ie.current=null},onTouchStart:()=>{de.current=null,ie.current=null},onWheel:()=>{de.current=null,ie.current=null},onDragOver:z=>{e.onSendFile&&z.preventDefault()},onDrop:z=>{if(!e.onSendFile)return;z.preventDefault();const he=z.dataTransfer.files?.[0];he&&kt(he)},children:v.jsxs("div",{className:"messages-inner",children:[v.jsxs("div",{className:"e2e-note",children:[v.jsx(ve,{name:"lock"}),"End-to-end encrypted · the broker only sees ciphertext"]}),(e.hiddenEarlier??0)>0&&e.onLoadEarlier&&v.jsxs("button",{className:"btn sm chat-load-earlier",onClick:()=>{le.current=!1;const z=q.current;Q.current=z?{height:z.scrollHeight,top:z.scrollTop}:null,e.onLoadEarlier?.()},children:["Load earlier messages (",e.hiddenEarlier," remaining)"]}),v.jsx(TO,{initial:!1,children:je.map((z,he)=>{const V=z===c?.message?c.key:z.wireId&&R.current.get(z.wireId)||z.wireId||`${z.date}-${(e.hiddenEarlier??0)+he}`,J=dx(z.wireId||V),F=je[he-1],oe=je[he+1],te=it(z),Ae=We=>{if(!We)return null;const Zt=it(We);return Zt?Zt.variant==="system"?"room:system":`room:chat:${Zt.author}${Zt.role}`:We.dir},Fe=Ae(z),pe=!!F&&Ae(F)===Fe&&Fe!=="room:system",Ie=!!oe&&Ae(oe)===Fe&&Fe!=="room:system",Tt=(z.dir==="out"?"out":"in")+(pe?" cont-top":"")+(Ie?" cont-bot":""),ot=z.wireId?v.jsx("button",{className:"msg-reply",title:"Reply",onClick:()=>ln(z),children:v.jsx(ve,{name:"reply",size:15})}):null;if(te&&te.variant==="system")return v.jsx(as.div,{className:"message-motion",id:J,initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0},transition:{duration:.22,ease:[.22,1,.36,1]},children:v.jsxs("div",{className:"room-system",role:"note",children:[te.label&&v.jsx("span",{className:"room-system-label",children:te.label}),v.jsx(Xy,{text:te.text,className:"room-system-text message-markdown"}),v.jsx("span",{className:"room-system-at",children:cs(z.date)})]})},V);if(z.kind==="file"){const We=Nx(z.wireId)??{id:z.wireId,dir:z.dir,filename:z.filename??"file",mime:z.mime??"application/octet-stream",size:0,date:z.date};return v.jsx(as.div,{className:"message-motion",id:J,initial:{opacity:0,y:12,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.22,ease:[.22,1,.36,1]},children:v.jsx(hx,{dir:z.dir==="out"?"out":"in",rowClass:Tt,canReply:!!z.wireId,onReply:()=>ln(z),after:ot,children:v.jsx("div",{className:`ours-message ours-message-file ours-message--${z.dir}`,children:v.jsx(lM,{rec:We,receipt:z.receipt,receiptless:z.receiptless,onPreview:U,onFetch:e.onFetchFile})})})},V)}const Ze=an(z);return v.jsx(as.div,{className:"message-motion",id:J,initial:{opacity:0,y:12,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.22,ease:[.22,1,.36,1]},children:v.jsx(hx,{dir:z.dir==="out"?"out":"in",rowClass:Tt,canReply:!!z.wireId,onReply:()=>ln(z),after:ot,children:v.jsxs("div",{className:`ours-message ours-message--${z.dir}`,children:[Ze&&v.jsxs("div",{className:"quote",children:[Ze.author&&v.jsx("span",{className:"quote-author",children:Ze.author}),v.jsx("span",{className:"quote-text",children:Ze.text})]}),te&&!pe&&v.jsxs("div",{className:"room-author",children:[v.jsx("span",{className:"room-author-name",children:te.author}),te.role&&v.jsx("span",{className:"room-author-role",children:te.role})]}),v.jsx(Xy,{text:te?te.text:z.text}),v.jsxs("div",{className:"bubble-at",children:[cs(z.date),z.dir==="out"&&v.jsx(jx,{receipt:z.receipt,receiptless:z.receiptless})]})]})})},V)})}),v.jsx("div",{className:"thread-end","aria-hidden":!0})]})},t.id),h&&v.jsxs("div",{className:"banner error",role:"alert",children:[h,h.startsWith("Send failed:")&&v.jsx("span",{className:"banner-actions",children:v.jsx("button",{className:"linkbtn",onClick:()=>void Lt(),children:"retry"})})]}),v.jsxs("div",{className:"composer-wrap",children:[w&&v.jsxs("div",{className:"reply-bar",children:[v.jsx("div",{className:"reply-bar-line"}),v.jsxs("div",{className:"reply-bar-body",children:[v.jsxs("div",{className:"reply-bar-author",children:["Replying to ",w.author]}),v.jsx("div",{className:"reply-bar-text",children:w.text})]}),v.jsx("button",{className:"icon-btn",title:"Cancel reply",onClick:()=>k(null),children:v.jsx(ve,{name:"close",size:16})})]}),M&&v.jsx(Mw,{att:M,sending:Y,onSend:gt,onDiscard:()=>_(null)}),X&&v.jsx("div",{className:"attachment-processing",role:"status",children:"Optimizing photo for secure delivery…"}),v.jsxs("div",{className:"composer"+(W?" recording":""),children:[e.onSendFile&&v.jsxs(v.Fragment,{children:[v.jsx("input",{ref:ee,type:"file",style:{display:"none"},onChange:z=>{const he=z.target.files?.[0];he&&kt(he),z.target.value=""}}),v.jsx("button",{className:"icon-btn composer-tool",title:"Attach a file or photo",disabled:Y||X||W,onClick:()=>ee.current?.click(),children:v.jsx(ve,{name:"paperclip",size:18})}),v.jsx(Aw,{disabled:Y||X||!!M,onReady:z=>{D(!1),_(z)},onError:z=>{D(!1),m(z)},onActiveChange:D},t.id)]}),v.jsx("textarea",{ref:xe,className:"field",rows:1,placeholder:(w?"Reply to "+w.author:"Message "+t.name)+"…",value:i,"aria-busy":l,onChange:z=>s(z.target.value),onKeyDown:z=>{z.key==="Enter"?!(window.matchMedia("(pointer: coarse)").matches||window.innerWidth<=860)&&!z.shiftKey&&(z.preventDefault(),Lt()):z.key==="Escape"&&k(null)}}),v.jsxs("button",{className:"btn primary",onPointerDown:z=>{z.button===0&&document.activeElement===xe.current&&z.preventDefault()},onClick:()=>void Lt(),disabled:l||jn||!i.trim(),title:jn?"Delivery status unknown — edit before sending again":void 0,children:[v.jsx(ve,{name:"send",size:16}),"Send"]})]})]}),G&&(_l(G.filename,G.mime)?v.jsx(mD,{rec:G,onClose:()=>U(null)}):v.jsx(pD,{rec:G,onClose:()=>U(null),onSendText:e.onSend,onSendFile:e.onSendFile})),fe&&v.jsx(yD,{messages:n,indexOffset:e.hiddenEarlier??0,onClose:()=>se(!1),onPreview:z=>{se(!1),U(z)},onJump:z=>{document.getElementById(dx(z))?.scrollIntoView({behavior:"smooth",block:"center"}),se(!1)}})]})}const Ok=3;function UF(e,t,n=Ok){return[t,...e.filter(i=>i.cid!==t.cid)].slice(0,n)}function $F(e,t){return e.filter(n=>n.id!==t)}const WF=6e3,HF=UF,KF=$F;function qF(){const[e,t]=S.useState([]),n=S.useRef(0),i=S.useCallback((a,c,d)=>{const h=Date.now(),m={id:`${a}:${h}:${n.current++}`,cid:a,name:c,preview:"",at:h};t(p=>HF(p,m,Ok))},[]),s=S.useCallback(a=>t(c=>KF(c,a)),[]),l=S.useCallback(a=>t(c=>c.filter(d=>d.cid!==a)),[]);return{toasts:e,push:i,dismiss:s,clear:l}}function XF(e){const{item:t,onOpen:n,onDismiss:i}=e,[s,l]=S.useState(!1),[a,c]=S.useState(!1),d=s||a;return S.useEffect(()=>{if(d)return;const h=setTimeout(()=>i(t.id),WF);return()=>clearTimeout(h)},[t.id,d,i]),v.jsxs("div",{className:"banner msg",role:"status",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onFocus:()=>c(!0),onBlur:h=>{h.currentTarget.contains(h.relatedTarget)||c(!1)},children:[v.jsxs("button",{className:"msg-open",title:`Open the conversation with ${t.name}`,onClick:()=>n(t.cid),children:[v.jsx("span",{className:"avatar sm accent","aria-hidden":"true",children:us(t.name)}),v.jsxs("span",{className:"msg-text",children:[v.jsx("strong",{className:"msg-name",children:t.name}),v.jsx("span",{className:"msg-preview",children:t.preview||"New message"})]})]}),v.jsx("button",{className:"icon-btn msg-close",title:"Dismiss","aria-label":`Dismiss the notification from ${t.name}`,onClick:()=>i(t.id),children:v.jsx(ve,{name:"close",size:15})})]})}function YF(e){return v.jsx(v.Fragment,{children:e.items.map(t=>v.jsx(XF,{item:t,onOpen:e.onOpen,onDismiss:e.onDismiss},t.id))})}function GF(e){const t=S.useRef(null),{text:n,size:i=240}=e;return S.useEffect(()=>{if(!t.current||!n)return;const s=t.current;Ud(()=>import("./browser-DvYJInDg.js").then(l=>l.b),[]).then(l=>{l.toCanvas(s,n,{width:i,margin:2,errorCorrectionLevel:"M",color:{dark:"#000000",light:"#ffffff"}})})},[n,i]),v.jsx("div",{style:{display:"flex",justifyContent:"center",margin:"8px 0"},children:v.jsx("canvas",{ref:t,"data-testid":"qr-canvas","data-invite":n,width:i,height:i,style:{borderRadius:8,border:"1px solid var(--line)",imageRendering:"pixelated"}})})}function QF(e){const t=S.useRef(null),n=S.useRef(null),i=S.useRef(null),s=S.useRef(0),l=S.useRef(!0),[a,c]=S.useState("requesting"),[d,h]=S.useState(""),m=S.useCallback(()=>{s.current&&cancelAnimationFrame(s.current),i.current&&(i.current.getTracks().forEach(w=>w.stop()),i.current=null),t.current&&(t.current.srcObject=null)},[]),p=S.useCallback(w=>{i.current=w;const k=t.current;k.srcObject=w,k.setAttribute("playsinline","true"),k.play();const C=n.current,T=C.getContext("2d"),E=()=>{if(l.current)if(k.readyState>=k.HAVE_ENOUGH_DATA){const A=k.videoWidth||320,M=k.videoHeight||240;C.width=A,C.height=M,T.drawImage(k,0,0,A,M);const _=T.getImageData(0,0,A,M);Ud(()=>import("./jsQR-Bn11mi_e.js").then(W=>W.j),[]).then(W=>{const D=W.default,Y=D(_.data,_.width,_.height,{inversionAttempts:"dontInvert"});if(Y&&Y.data&&l.current){m(),e.onDecode(Y.data);return}l.current&&(s.current=requestAnimationFrame(E))})}else s.current=requestAnimationFrame(E)};s.current=requestAnimationFrame(E)},[m,e]);S.useEffect(()=>{if(l.current=!0,!navigator.mediaDevices?.getUserMedia){c("nocamera");return}return navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}}).then(w=>{if(!l.current){w.getTracks().forEach(k=>k.stop());return}c("scanning"),p(w)}).catch(w=>{if(!l.current)return;const k=w.name??"";k==="NotAllowedError"||k==="PermissionDeniedError"?c("denied"):k==="NotFoundError"||k==="DevicesNotFoundError"?c("nocamera"):(c("error"),h(w.message??String(w)))}),()=>{l.current=!1,m()}},[]);const y=()=>{m(),e.onClose()};return v.jsxs("div",{"data-testid":"qr-scanner",style:{display:"flex",flexDirection:"column",gap:12,padding:"12px 0"},children:[(a==="requesting"||a==="scanning")&&v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"muted",style:{margin:0,fontSize:"0.88rem"},children:a==="requesting"?"Requesting camera…":"Point your camera at the QR code."}),v.jsxs("div",{style:{position:"relative",borderRadius:8,overflow:"hidden",background:"#000",minHeight:200},children:[v.jsx("canvas",{ref:n,"data-testid":"scanner-canvas",style:{display:"none"}}),v.jsx("video",{ref:t,"data-testid":"scanner-video",muted:!0,playsInline:!0,style:{width:"100%",display:"block",borderRadius:8}}),a==="scanning"&&v.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:v.jsx("div",{style:{width:160,height:160,borderRadius:12,border:"2px solid var(--accent)",boxShadow:"0 0 0 9999px rgba(0,0,0,0.4)"}})})]})]}),a==="denied"&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"var(--text-2)"},children:[v.jsx(ve,{name:"shield",size:16}),v.jsx("span",{style:{fontWeight:600,fontSize:"0.9rem"},children:"Camera access denied"})]}),v.jsx("p",{className:"muted",style:{margin:0,fontSize:"0.88rem"},children:"Camera permission was denied. To scan QR codes, allow camera access in your browser settings, then try again. Or paste the invite text below instead."})]}),a==="nocamera"&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"var(--text-2)"},children:[v.jsx(ve,{name:"close",size:16}),v.jsx("span",{style:{fontWeight:600,fontSize:"0.9rem"},children:"No camera available"})]}),v.jsx("p",{className:"muted",style:{margin:0,fontSize:"0.88rem"},children:"No camera was found on this device. Paste the invite text below instead."})]}),a==="error"&&v.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:v.jsxs("p",{style:{margin:0,fontSize:"0.85rem",color:"var(--danger, #e53)"},children:["Camera error: ",d||"unknown error",". Paste the invite text below instead."]})}),v.jsx("button",{className:"btn",style:{justifyContent:"center"},onClick:y,children:a==="scanning"?v.jsxs(v.Fragment,{children:[v.jsx(ve,{name:"close",size:14}),"Cancel scan"]}):v.jsxs(v.Fragment,{children:[v.jsx(ve,{name:"close",size:14}),"Close scanner"]})})]})}function ZF(e){const[t,n]=S.useState("generate"),[i,s]=S.useState("one_time"),[l,a]=S.useState(""),[c,d]=S.useState(null),[h,m]=S.useState("one_time"),[p,y]=S.useState(""),[w,k]=S.useState(""),[C,T]=S.useState(!1),[E,A]=S.useState(null),[M,_]=S.useState(null),[W,D]=S.useState(!1),[Y,H]=S.useState(null),X=S.useRef(!1),j=async()=>{if(!X.current){X.current=!0,T(!0),_(null),A(null);try{m(i),d(await e.onCreate(i,i==="one_time"&&l.trim()||void 0))}catch(U){_(U instanceof Error?U.message:String(U))}finally{X.current=!1,T(!1)}}},G=v.jsxs("div",{className:"modal-tabs",role:"tablist","aria-label":"Invite mode",children:[v.jsx("button",{type:"button",role:"tab","aria-selected":t==="generate",className:"btn sm"+(t==="generate"?" primary":""),onClick:()=>n("generate"),children:"Generate invite"}),v.jsx("button",{type:"button",role:"tab","aria-selected":t==="accept",className:"btn sm"+(t==="accept"?" primary":""),onClick:()=>n("accept"),children:"Accept invite"})]});return v.jsxs(Ts,{title:t==="generate"?"Invite a contact":"Accept an invite",onClose:()=>{X.current||e.onClose()},tabs:G,children:[t==="generate"&&!c&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:13},children:[v.jsxs("p",{className:"muted","data-testid":"invite-identity",style:{margin:0,fontSize:"0.85rem"},children:["Creating as ",v.jsx("strong",{children:e.identity.name})," · ",v.jsxs("span",{className:"mono",children:["@",Md(e.identity.cid)]})]}),v.jsxs("div",{role:"radiogroup","aria-label":"Invite kind",style:{display:"flex",flexDirection:"column",gap:7},children:[v.jsxs("label",{children:[v.jsx("input",{type:"radio",name:"invite-kind",checked:i==="one_time",onChange:()=>s("one_time")})," One person (one time)"]}),v.jsxs("label",{children:[v.jsx("input",{type:"radio",name:"invite-kind",checked:i==="public",onChange:()=>s("public")})," Reusable public invite"]})]}),i==="one_time"?v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"muted",style:{margin:0,fontSize:"0.9rem"},children:"Optionally name the person or agent this invite is for."}),v.jsx("input",{className:"field",value:l,onChange:U=>a(U.target.value),placeholder:"Their name (optional), e.g. Bob",maxLength:64})]}):v.jsx("p",{className:"onb-warning","data-testid":"public-invite-warning",style:{margin:0,fontSize:"0.9rem"},children:"Anyone with this invite can connect until you revoke it. It has no expiry and stays valid across server restarts."}),v.jsx("button",{className:"btn primary",style:{justifyContent:"center"},disabled:C,onClick:()=>void j(),children:C?"Generating…":i==="public"?"Create public invite":"Generate invite"}),i==="public"&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[v.jsx("h4",{style:{margin:0,fontSize:"0.9rem"},children:"Active reusable invites"}),e.invites.filter(U=>U.mode==="public").length===0&&v.jsx("p",{className:"muted",style:{margin:0},children:"None right now."}),e.invites.filter(U=>U.mode==="public").map(U=>v.jsxs("div",{"data-testid":"public-invite-row",style:{padding:"8px 10px",background:"var(--inset)",borderRadius:7},children:[v.jsx("span",{className:"mono",children:U.invite_id}),v.jsxs("p",{className:"muted",children:["Created ",U.created?uE(U.created):"unknown"," · Active until revoked · No expiry"]}),Y===U.invite_id?v.jsxs("span",{children:[v.jsx("button",{className:"btn sm danger",onClick:()=>void e.onRevoke(U.invite_id).then(()=>(H(null),e.onRefresh())).catch(fe=>_(String(fe))),children:"Confirm revoke"})," ",v.jsx("button",{className:"btn sm",onClick:()=>H(null),children:"Keep it"})]}):v.jsx("button",{className:"btn sm",onClick:()=>H(U.invite_id),children:"Revoke"})]},U.invite_id))]}),E&&v.jsx("p",{className:"muted",children:E}),M&&v.jsx("p",{className:"onb-error",children:M})]}),t==="generate"&&c&&v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"muted","data-testid":h==="public"?"public-result-note":void 0,children:h==="public"?"Shown only on this screen. Copy it now; the text cannot be recovered later. The invite stays active until revoked.":`Send this invite to ${l.trim()||"your contact"}. It can be redeemed once.`}),v.jsx("textarea",{className:"field mono","data-testid":"invite-result-text",readOnly:!0,rows:5,value:c,onFocus:U=>U.currentTarget.select()}),h==="one_time"&&v.jsx(GF,{text:c}),v.jsxs("button",{className:"btn primary",onClick:()=>void navigator.clipboard.writeText(c).then(()=>A("Copied to clipboard.")),children:[v.jsx(ve,{name:"copy",size:15}),"Copy invite"]}),h==="public"&&v.jsx("button",{className:"btn","data-testid":"done-hide-invite",onClick:()=>{d(null),a(""),e.onRefresh()},children:"Done — hide invite"}),E&&v.jsx("p",{className:"muted",children:E})]}),t==="accept"&&v.jsxs("form",{style:{display:"flex",flexDirection:"column",gap:13},onSubmit:U=>{U.preventDefault(),!(!p.trim()||C)&&(T(!0),_(null),e.onAccept(p.trim(),w.trim()||void 0).then(()=>{A("Invite accepted — the contact will appear once the sender verifies your identity."),y(""),k("")}).catch(fe=>_(String(fe))).finally(()=>T(!1)))},children:[v.jsx("p",{className:"muted",children:"Paste the invite you received, or scan a QR code."}),W?v.jsx(QF,{onDecode:U=>{y(U),D(!1)},onClose:()=>D(!1)}):v.jsxs("button",{type:"button",className:"btn",onClick:()=>D(!0),children:[v.jsx(ve,{name:"monitor",size:15}),"Scan QR code"]}),v.jsx("textarea",{className:"field mono","aria-label":"Invite",rows:5,value:p,onChange:U=>y(U.target.value),placeholder:"Paste invite text…"}),v.jsx("input",{className:"field",value:w,onChange:U=>k(U.target.value),placeholder:"Rename them (optional)",maxLength:64}),v.jsx("button",{className:"btn primary",type:"submit",disabled:C||!p.trim(),children:C?"Connecting…":"Add contact"}),E&&v.jsx("p",{className:"muted",children:E}),M&&v.jsx("p",{className:"onb-error",children:M})]})]})}function JF(e){const[t,n]=S.useState(e.identity.bio??""),[i,s]=S.useState(!1),[l,a]=S.useState(null),[c,d]=S.useState(e.push.preview),h=sC(),m=!e.workerSupported||e.push.status==="unsupported"?h??"Unavailable — requires a secure browser with service-worker support.":e.push.status==="needs-permission"?h??"Needs permission — allow notifications, then choose Enable or Repair.":e.push.status==="on"?"On — this browser and the server agree on the current Web Push configuration.":e.push.status==="repairing"?"Repairing — checking the browser subscription and server acknowledgement…":e.push.status==="error"?"Repair needed — the browser and server could not confirm the same subscription.":"Off — enable notifications for this browser.";return v.jsxs(Ts,{title:"Settings",onClose:e.onClose,wide:!0,children:[v.jsxs("div",{children:[v.jsx("span",{className:"lbl",children:"Display name"}),v.jsx("input",{className:"field",readOnly:!0,value:e.identity.name})]}),v.jsxs("div",{children:[v.jsx("span",{className:"lbl",children:"Your address"}),v.jsx("input",{className:"field mono",readOnly:!0,value:e.identity.cid,onFocus:p=>p.currentTarget.select()}),v.jsx("p",{className:"muted",children:"Your public address on ours. Share an invite to connect more easily."})]}),v.jsxs("div",{children:[v.jsx("span",{className:"lbl",children:"Public bio"}),v.jsx("textarea",{className:"field",rows:3,value:t,onChange:p=>{n(p.target.value),s(!1),a(null)}}),v.jsx("button",{className:"btn sm",onClick:()=>{a(null),e.onSaveBio(t).then(()=>s(!0)).catch(p=>a(String(p)))},children:i?"Saved":"Save bio"}),l&&v.jsx("p",{className:"onb-error",children:l})]}),v.jsxs("label",{style:{display:"flex",gap:9},children:[v.jsx("input",{type:"checkbox",checked:e.dark,onChange:e.onToggleDark})," Dark mode"]}),v.jsxs("div",{style:{borderTop:"1px solid var(--line)",paddingTop:16},children:[v.jsx("h4",{children:"Notifications"}),v.jsx("p",{className:e.push.status==="needs-permission"||e.push.status==="error"?"onb-error":"muted",children:m}),h&&h!==m&&v.jsx("p",{className:"muted","data-testid":"push-platform-guidance",children:h}),v.jsxs("fieldset",{style:{border:0,padding:0,margin:"12px 0"},children:[v.jsx("legend",{className:"lbl",children:"Lock-screen preview"}),v.jsxs("label",{style:{display:"block",marginTop:7},children:[v.jsx("input",{type:"radio",name:"push-preview",checked:c==="full",onChange:()=>d("full")})," Full — sender and message text or filename"]}),v.jsxs("label",{style:{display:"block",marginTop:7},children:[v.jsx("input",{type:"radio",name:"push-preview",checked:c==="private",onChange:()=>d("private")})," Private — generic content only"]})]}),v.jsx("p",{className:"muted",children:"Full previews can expose sender names, message text, and filenames on the lock screen. The push provider still sees delivery endpoint, timing, and payload size metadata in either mode."}),v.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:e.push.status==="on"?v.jsxs(v.Fragment,{children:[v.jsx("button",{className:"btn",disabled:e.busy,onClick:()=>void e.onPushAction("disable",c),children:"Disable notifications"}),v.jsx("button",{className:"btn",disabled:e.busy,onClick:()=>void e.onPushAction("repair",c),children:"Repair"}),c!==e.push.preview&&v.jsx("button",{className:"btn primary",disabled:e.busy,onClick:()=>void e.onPushAction("enable",c),children:"Save preview"})]}):v.jsx("button",{className:"btn primary",disabled:e.busy||!e.workerSupported||e.push.status==="unsupported",onClick:()=>void e.onPushAction(e.push.status==="error"||e.push.blocked?"repair":"enable",c),children:e.busy?"Repairing…":e.push.status==="error"||e.push.blocked?"Repair":"Enable notifications"})})]}),v.jsxs("div",{style:{borderTop:"1px solid var(--line)",paddingTop:16},children:[v.jsx("h4",{children:"App status"}),v.jsx("p",{className:"muted",children:e.offline?"Offline — reconnecting. Message and identity data are never cached.":"Online."}),e.updateAvailable&&v.jsx("button",{className:"btn primary",onClick:e.onReloadUpdate,children:"Reload to update"})]}),v.jsxs("div",{style:{borderTop:"1px solid var(--line)",paddingTop:16},children:[v.jsx("h4",{children:"Build"}),v.jsx("input",{className:"field mono",readOnly:!0,value:e.build?`${e.build.version} · ${e.build.sha}`:"Loading…"})]})]})}function ez(e,t,n,i,s=6e4){return!t||!t.sha?"current":t.sha===e?(n.remoteSha=null,n.firstMismatchAt=null,"current"):(n.remoteSha=t.sha,(n.firstMismatchAt===null||n.firstMismatchAt===void 0)&&(n.firstMismatchAt=i),n.controllerChanged?"newer-available":i-n.firstMismatchAt>=s?"stuck":"newer-available")}const tz="afbd92120e3ad142c495034dc66797e49de83c82",nz=15*6e4,rz=6e4,iz=ez;async function oz(){try{const e=await fetch("/version.json",{cache:"no-store"});return e.ok?await e.json():null}catch{return null}}function sz(e){const t={remoteSha:null,firstMismatchAt:null,controllerChanged:!1},n=()=>{t.controllerChanged=!0};navigator.serviceWorker?.addEventListener("controllerchange",n);let i=!1;const s=async()=>{const d=await oz(),h=iz(tz,d,t,Date.now(),rz);h==="newer-available"?(e.onUpdateAvailable(),navigator.serviceWorker?.getRegistration().then(m=>m?.update())):h==="stuck"&&!i&&(i=!0,e.onStuck(d.sha))},l=setTimeout(()=>void s(),5e3),a=setInterval(()=>void s(),nz),c=()=>{document.visibilityState==="visible"&&s()};return document.addEventListener("visibilitychange",c),()=>{clearTimeout(l),clearInterval(a),document.removeEventListener("visibilitychange",c),navigator.serviceWorker?.removeEventListener("controllerchange",n)}}async function az(e){try{const t=await navigator.serviceWorker.getRegistrations();await Promise.all(t.map(i=>i.unregister()));const n=await caches.keys();await Promise.all(n.map(i=>caches.delete(i)))}catch{}return location.replace(location.pathname+"?v="+encodeURIComponent(e)),new Promise(()=>{})}function lz(){const e=new URL(location.href);e.searchParams.has("v")&&(e.searchParams.delete("v"),history.replaceState(null,"",e.pathname+e.search+e.hash))}const px=[0,100,400,1e3,3e3,6e3],mx=e=>new Promise(t=>setTimeout(t,e)),gx={delivered:1,read:2},yx="ours-dark-v3",vx="#chat-message-",xx=hl,uz=e=>e instanceof Error&&e.message?e.message:"The request could not be completed.";function Fk(e,t){const n=new Map,i=[];for(const s of e?.messages??[]){const l={dir:s.dir,text:s.text,date:s.date,read:s.read,wireId:s.wire_id,replyTo:s.reply_to?{wireId:s.reply_to.wire_id}:null,receipt:s.receipt??void 0,receiptless:s.dir==="out"&&!s.wire_id};s.wire_id?n.set(s.wire_id,l):i.push(l)}for(const s of t){const l=n.get(s.wire_id);n.set(s.wire_id,{dir:s.dir,text:"",date:s.date,read:l?.read??s.dir==="out",wireId:s.wire_id,replyTo:s.reply_to?{wireId:s.reply_to.wire_id}:l?.replyTo??null,kind:"file",filename:s.filename,mime:s.mime,receipt:l?.receipt})}return[...i,...n.values()].sort((s,l)=>{const a=xx(s.date)-xx(l.date);return a===0?s.wireId.localeCompare(l.wireId):a})}function cz(e){const t={};for(const n of Object.values(e.roots??{}))t[n.root_cid]={label:n.root_name,note:"Verified identity"};return t}function fz(e,t){return[...e.contacts.contacts.map(i=>{const s=e.contacts.roots?.[i.container_id],l=Qr(e,i.container_id),c=Fk(l,t[i.container_id]??[]).at(-1),d=Jo(i);return{id:i.container_id,name:d,announcedName:i.name,initials:us(d),when:c?lE(c.date):"",activityAt:c?.date??"",last:c?.kind==="file"?yE(c.filename,c.mime):l?.preview??c?.text??"",unread:l?.unread??0,status:"active",root:s?.root_cid??null,sub:s?`role “${s.role_id}” of ${s.root_name}`:"",roleId:s?.role_id??null,rootName:s?.root_name??null,mine:!1,kind:s?"agent":"person"}}),...e.contacts.pending.map(i=>{const s=Jo(i);return{id:`pending:${i.container_id}`,name:s,announcedName:i.name,initials:us(s),when:"",activityAt:"",last:`${i.queued} queued · approval required`,unread:0,status:"pending",root:null,sub:"",roleId:null,rootName:null,mine:!1,kind:"person"}})]}function dz(){return v.jsx(hz,{})}function hz(){const e=S.useRef(eC(Ag(window.location.pathname))).current,[t,n]=S.useReducer(Dg,e),i=S.useRef(t),s=S.useRef(new Zb),l=S.useRef(null),a=S.useRef(new Map),c=S.useRef(new Map),[d,h]=S.useState({}),m=S.useRef(d),[p,y]=S.useState(null),w=S.useRef(new Set),[k,C]=S.useState(null),T=S.useRef(k),E=S.useRef(!1),[A,M]=S.useState([]),[_,W]=S.useState(null),[D,Y]=S.useState(()=>localStorage.getItem(yx)!=="0"),[H,X]=S.useState(null),[j,G]=S.useState({supported:!1,offline:!navigator.onLine,updateAvailable:!1,registration:null}),[U,fe]=S.useState({status:"unsupported",preview:"full"}),[se,ee]=S.useState(!1),[xe,Ee]=S.useState(!1),[q,le]=S.useState(()=>window.location.hash.startsWith(vx)),{toasts:P,push:L,dismiss:Q,clear:R}=qF(),Z=S.useCallback(F=>{i.current=Dg(i.current,F),n(F)},[]),de=S.useCallback(F=>{E.current=F},[]);S.useEffect(()=>{i.current=t},[t]),T.current=k,m.current=d,S.useMemo(()=>(Bg(Object.values(d).flat()),null),[d]),S.useEffect(()=>(document.documentElement.classList.toggle("theme-dark",D),()=>document.documentElement.classList.remove("theme-dark")),[D]);const ie=S.useCallback(F=>Z({type:"error",message:uz(F)}),[Z]),Ce=S.useCallback(()=>{const F=i.current;return{visibility:document.visibilityState,appRoute:F.route.name==="chats"?"chats":"other",selectedContactCid:qr(F),desktopLayout:l.current?.matches??window.innerWidth>=861,mobileDetailOpen:F.mobileDetailOpen,conversationCoveringDialogOpen:T.current!==null}},[]),ge=S.useCallback(async(F,oe=!0)=>{try{const te=await Qe.conversation(F);return Z({type:"page",contactCid:F,page:te}),te}catch(te){return oe&&ie(te),null}},[Z,ie]),Te=S.useCallback(async(F,oe=!0)=>{try{const te=await Qe.files(F);return Bg(te.files),h(Ae=>({...Ae,[F]:te.files})),te.files}catch(te){return oe&&ie(te),null}},[ie]);S.useEffect(()=>sz({onUpdateAvailable:()=>G(F=>({...F,updateAvailable:!0})),onStuck:F=>{az(F)}}),[]);const je=S.useCallback(async()=>{const F=await Qe.contacts();return Z({type:"contacts",contacts:{...F,pending:F.pending??[]}}),F},[Z]),$e=S.useCallback(async()=>{try{const[F,oe,te]=await Promise.all([Qe.identity(),Qe.contacts(),Qe.buildInfo()]),Ae={...oe,pending:oe.pending??[]};return i.current.identity&&i.current.identity.cid!==F.cid&&(pE(),m.current={},h({})),Z({type:"snapshot",identity:F,contacts:Ae}),W(te),await Promise.all(Ae.contacts.flatMap(Fe=>[ge(Fe.container_id,!1),Te(Fe.container_id,!1)])),qr(i.current)}catch(F){return ie(F),null}},[Z,Te,ge,ie]),kt=S.useCallback(async F=>{await s.current.request(F,async()=>{Qb(F,Ce())&&(await Qe.markRead(F),await Promise.all([ge(F),je()]))}).catch(ie)},[Ce,je,ge,ie]),gt=S.useCallback(async(F,oe,te="page")=>{const Ae=`page:${F}:${te}`,Fe=(a.current.get(Ae)??0)+1;a.current.set(Ae,Fe);for(const pe of px){if(pe&&await mx(pe),a.current.get(Ae)!==Fe)return;const Ie=await ge(F,!1);if(Ie&&oe(Ie))return}},[ge]),Dt=S.useCallback(async(F,oe)=>{const te=`file:${F}`,Ae=(a.current.get(te)??0)+1;a.current.set(te,Ae);for(const Fe of px)if(Fe&&await mx(Fe),a.current.get(te)!==Ae||(await Te(F,!1))?.some(Ie=>Ie.wire_id===oe))return},[Te]),Qt=S.useRef(!1);S.useEffect(()=>{if(!q||!t.loaded)return;const F=decodeURIComponent(window.location.hash.slice(vx.length)),oe=qr(i.current);if(!F||!oe){le(!1);return}if(Qr(i.current,oe)?.messages.some(te=>te.wire_id===F)){le(!1);return}Qt.current||(Qt.current=!0,gt(oe,te=>te.messages.some(Ae=>Ae.wire_id===F),`anchor:${F}`).catch(()=>{}).finally(()=>le(!1)))},[q,gt,t.loaded,t.pages]),S.useMemo(()=>(hE({url:F=>Object.values(m.current).flat().find(te=>te.wire_id===F)?.available?Qe.mediaUrl(F):null,bytes:async F=>{if(!Object.values(m.current).flat().find(Ae=>Ae.wire_id===F)?.available)return null;const te=await fetch(Qe.mediaUrl(F),{cache:"no-store",credentials:"same-origin"});if(!te.ok)throw new Error(`Media request failed (HTTP ${te.status})`);return new Uint8Array(await te.arrayBuffer())},fetch:async F=>{const oe=Object.values(m.current).flat().find(te=>te.wire_id===F);if(!oe)throw new Error("Media record is unavailable");await Qe.fetchFiles([F]),await Te(oe.contact_id)}}),null),[Te]),S.useEffect(()=>{let F;rC(te=>{G(te),_g(te.registration).then(fe).catch(()=>fe(Ae=>({...Ae,status:"error"})))},{shouldDeferReload:()=>E.current||T.current!==null}).then(te=>{F=te}).catch(ie);const oe=te=>{te.preventDefault(),X(te)};return window.addEventListener("beforeinstallprompt",oe),()=>{F?.(),window.removeEventListener("beforeinstallprompt",oe)}},[ie]),S.useEffect(()=>fC(),[]),S.useEffect(()=>{if(!(!j.registration||U.status!=="on"))return Gb({registration:j.registration,identity:Qe.identity,onEvent:kx})},[U.status,U.bindingId,j.registration]),S.useEffect(()=>{const F=()=>fe(oe=>({...oe,status:"error"}));return window.addEventListener("ours-push-repair-required",F),()=>window.removeEventListener("ours-push-repair-required",F)},[]),S.useEffect(()=>{window.location.pathname==="/"&&window.history.replaceState(null,"",Wo()),l.current=window.matchMedia("(min-width: 861px)");const F=()=>Z({type:"route",route:Ag(window.location.pathname)}),oe=()=>{if(document.visibilityState!=="visible")return;const pe=qr(i.current);pe&&kt(pe),Ex(),j.registration&&_g(j.registration).then(fe).catch(()=>fe(Ie=>({...Ie,status:"error"})))};window.addEventListener("popstate",F),document.addEventListener("visibilitychange",oe);const te=pe=>{const Ie=pe.type==="sync_required"?`${pe.type}:${pe.reason}`:pe.type==="receipt_received"?`${pe.type}:${pe.contact_id}:${pe.kind}:${pe.wire_ids.join(",")}`:`${pe.type}:${pe.contact_id}:${pe.wire_id}`,Tt=Date.now(),ot=c.current.get(Ie)??0;c.current.set(Ie,Tt);for(const[Ze,We]of c.current)Tt-We>6e4&&c.current.delete(Ze);Tt-ot<6e4||(async()=>{if(pe.type==="sync_required"){await $e();return}if(je().catch(ie),pe.type==="file_received"){await Dt(pe.contact_id,pe.wire_id);const Ze=i.current.contacts.contacts.find(We=>We.container_id===pe.contact_id);qr(i.current)!==pe.contact_id&&Ze&&L(pe.contact_id,Jo(Ze),"New file");return}if(pe.type==="message_received"){const Ze=i.current.contacts.contacts.find(We=>We.container_id===pe.contact_id);await gt(pe.contact_id,We=>We.messages.some(Zt=>Zt.wire_id===pe.wire_id),`message:${pe.wire_id}`),qr(i.current)===pe.contact_id?await kt(pe.contact_id):Ze&&L(pe.contact_id,Jo(Ze),"New message");return}Z({type:"receipt",contactCid:pe.contact_id,kind:pe.kind,wireIds:pe.wire_ids}),await gt(pe.contact_id,Ze=>pe.wire_ids.every(We=>{const Zt=Ze.messages.find(oo=>oo.wire_id===We);return!!Zt?.receipt&&gx[Zt.receipt]>=gx[pe.kind]}),`receipt:${pe.wire_ids.join(",")}`)})().catch(ie)},Ae=Kb(te),Fe=qb(te,pe=>Z({type:"connection",connection:pe}));return $e().then(pe=>{pe&&kt(pe)}),()=>{Fe(),Ae(),window.removeEventListener("popstate",F),document.removeEventListener("visibilitychange",oe)}},[gt,Dt,Z,kt,L,je,$e,ie,j.registration]);const Ut=(F,oe,te)=>{window.history.pushState(null,"",oe),Z({type:"route",route:F,mobileDetailOpen:te})},it=async F=>{Ut({name:"chats",contactCid:F},Wo(F),!0),R(F),await Promise.all([ge(F),Te(F,!1)]),await kt(F)},It=async F=>{const oe=Qr(i.current,F);if(!(!oe?.nextBefore||w.current.has(F))){w.current.add(F),y(F);try{const te=await Qe.conversation(F,oe.nextBefore);Z({type:"older_page",contactCid:F,page:te,newer:oe.messages})}catch(te){ie(te)}finally{w.current.delete(F),y(null)}}},Le=qr(t),an=t.contacts.contacts.find(F=>F.container_id===Le),Lt=S.useMemo(()=>fz(t,d),[t,d]),jn=Lt.find(F=>F.id===Le)??null,ln=Le?Fk(Qr(t,Le),d[Le]??[]):[],z=t.identity,he=t.loaded?Le&&!Qr(t,Le)||q?"updating":t.connection!=="live"?"connecting":null:"connecting",V=async(F,oe=U.preview)=>{if(j.registration){ee(!0),fe(te=>({...te,status:"repairing",preview:oe}));try{fe(await(F==="enable"?Cx(j.registration,{preview:oe}):F==="repair"?uC(j.registration,oe):cC(j.registration,U)))}catch(te){fe(Ae=>({...Ae,status:"error"})),ie(te)}finally{ee(!1)}}},J=()=>{M([]),C("invite"),Qe.invites().then(M).catch(ie)};return t.route.name==="not_found"?v.jsxs("div",{className:"centered-screen",children:[v.jsx("h1",{children:"Page not found"}),v.jsx("button",{className:"btn primary",onClick:()=>Ut({name:"chats",contactCid:null},Wo()),children:"Open chats"})]}):z?v.jsx("div",{className:D?"theme-dark":"",style:{height:"100%"},children:v.jsxs("div",{className:"app signal-app",children:[v.jsxs("header",{className:"commandbar",children:[v.jsxs("div",{className:"command-brand","aria-label":"ours network",children:[v.jsx("span",{className:"command-mark","aria-hidden":!0,children:"o"}),v.jsx("span",{children:"ours"})]}),v.jsxs("div",{className:"command-copy",children:[v.jsx("strong",{children:"Messenger"}),v.jsx("span",{className:"command-kicker",children:"Private conversations on ours"})]}),v.jsxs("div",{className:"command-health "+(t.connection==="live"?"is-live":"is-connecting"),role:"status",children:[v.jsx("span",{"aria-hidden":!0}),t.connection==="live"?"Connected":"Connecting"]}),v.jsxs("div",{className:"command-actions",children:[H&&v.jsx("button",{className:"command-action",onClick:()=>void H.prompt().then(()=>X(null)),children:"Install app"}),v.jsxs("button",{className:"command-action",onClick:J,children:[v.jsx(ve,{name:"plus"}),v.jsx("span",{children:"New chat"})]}),v.jsx("button",{className:"icon-btn command-settings",title:"Settings","aria-label":"Settings",onClick:()=>C("settings"),children:v.jsx(ve,{name:"settings"})}),v.jsxs("button",{className:"rail-me command-me",title:z.name,onClick:()=>Ee(F=>!F),children:[us(z.name),v.jsx("span",{className:"conn-dot "+(t.connection==="live"?"on":"off")})]})]})]}),v.jsxs("main",{className:"section signal-stage"+(t.mobileDetailOpen?" show-detail":""),children:[v.jsx(zF,{contacts:Lt,roots:cz(t.contacts),selected:Le,onSelect:F=>{F.startsWith("pending:")||it(F)},onInvite:J,onSettings:()=>C("settings")}),v.jsx(BF,{contact:jn,messages:ln,syncing:he,hiddenEarlier:Qr(t,Le??"")?.hasMore?Math.max(1,(Qr(t,Le??"")?.total??ln.length)-ln.length):0,onLoadEarlier:Le&&p!==Le?()=>void It(Le):void 0,onBack:()=>Ut({name:"chats",contactCid:null},Wo(),!1),onDraftChange:de,onSend:async(F,oe,te)=>{if(!Le)return;const Ae=Le,Fe=await Qe.send(Ae,F,oe,te);return Z({type:"sent_message",contactCid:Ae,message:{dir:"out",text:F,date:new Date().toISOString(),read:!0,wire_id:Fe.wire_id??"",receipt:null,reply_to:oe?{wire_id:oe}:null}}),Fe.wire_id?gt(Ae,pe=>pe.messages.some(Ie=>Ie.wire_id===Fe.wire_id),`send:${Fe.wire_id}`):je().catch(ie),Fe.wire_id??void 0},onSendFile:async(F,oe)=>{Le&&(await Qe.sendFile(Le,new Blob([F.bytes],{type:F.mime}),F.filename,F.mime,oe),await Promise.all([Te(Le),ge(Le,!1)]))},onFetchFile:async F=>{await Qe.fetchFiles([F]),Le&&await Te(Le)},onRename:F=>{Le&&Qe.renameContact(Le,F).then($e).catch(ie)},onRemove:()=>{Le&&confirm(`Remove “${an?.name??"contact"}”?`)&&Qe.removeContact(Le).then(()=>(Ut({name:"chats",contactCid:null},Wo(),!1),$e())).catch(ie)}},Le??"no-conversation")]}),v.jsxs("nav",{className:"mobile-tabbar","aria-label":"Primary navigation",children:[v.jsxs("button",{className:"mobile-tab active","aria-current":"page",children:[v.jsx(ve,{name:"chat"}),v.jsx("span",{children:"Chats"})]}),v.jsxs("button",{className:"mobile-tab",onClick:()=>C("settings"),children:[v.jsx(ve,{name:"bell"}),v.jsx("span",{children:"Alerts"})]}),v.jsxs("button",{className:"mobile-tab",onClick:()=>C("settings"),children:[v.jsx(ve,{name:"settings"}),v.jsx("span",{children:"Settings"})]})]}),v.jsxs("div",{className:"app-banners",children:[j.offline&&v.jsx("div",{className:"banner warn",children:"Offline — reconnecting to the network…"}),t.connection!=="live"&&v.jsx("div",{className:"banner warn",children:t.connection==="retrying"?"Live updates interrupted — reconnecting…":"Connecting to live updates…"}),j.updateAvailable&&v.jsxs("div",{className:"banner info",children:["A new version is available.",v.jsx("span",{className:"banner-actions",children:v.jsx("button",{className:"linkbtn",onClick:()=>{j.registration&&Ig(j.registration)},children:"Restart now"})})]}),t.contacts.pending.map(F=>v.jsxs("div",{className:"banner info",children:["Introduction from ",Jo(F)," · ",F.queued," queued",v.jsxs("span",{className:"banner-actions",children:[v.jsx("button",{className:"linkbtn",onClick:()=>void Qe.respondToIntroduction(F.container_id,"approve").then($e).catch(ie),children:"Approve"}),v.jsx("button",{className:"linkbtn quiet",onClick:()=>void Qe.respondToIntroduction(F.container_id,"reject").then($e).catch(ie),children:"Reject"})]})]},F.container_id)),v.jsx(YF,{items:P,onDismiss:Q,onOpen:F=>void it(F)})]}),xe&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"pop-backdrop",onClick:()=>Ee(!1)}),v.jsxs("div",{className:"menu command-menu",children:[v.jsxs("div",{className:"menu-head",children:[v.jsx("div",{className:"avatar accent lg",children:us(z.name)}),v.jsxs("div",{children:[v.jsx("strong",{children:z.name}),v.jsxs("div",{className:"faint mono",children:["@",Md(z.cid)]})]})]}),v.jsxs("button",{className:"menu-item",onClick:()=>{Ee(!1),J()},children:[v.jsx(ve,{name:"plus"}),"Invite a contact"]}),v.jsxs("button",{className:"menu-item",onClick:()=>{Ee(!1),C("settings")},children:[v.jsx(ve,{name:"settings"}),"Settings"]})]})]}),k==="invite"&&v.jsx(ZF,{identity:z,invites:A,onRefresh:async()=>M(await Qe.invites()),onCreate:async(F,oe)=>(await Qe.createInvite(F,oe)).blob,onAccept:async(F,oe)=>{await Qe.addContact(F,oe),await $e()},onRevoke:async F=>{await Qe.revokeInvite(F)},onClose:()=>{C(null),$e()}}),k==="settings"&&v.jsx(JF,{identity:z,push:U,workerSupported:j.supported,busy:se,offline:j.offline,updateAvailable:j.updateAvailable,build:_,dark:D,onToggleDark:()=>Y(F=>(localStorage.setItem(yx,F?"0":"1"),!F)),onSaveBio:async F=>{await Qe.setBio(F),await $e()},onPushAction:V,onReloadUpdate:()=>{j.registration&&Ig(j.registration)},onClose:()=>{T.current=null,C(null),Le&&kt(Le)}}),t.error&&v.jsxs("div",{className:"banner error",children:[t.error,v.jsx("button",{className:"linkbtn",onClick:()=>Z({type:"error",message:null}),children:"dismiss"})]})]})}):v.jsx("div",{className:D?"theme-dark":"",style:{height:"100%"},children:v.jsx("div",{className:"centered-screen",children:v.jsx("p",{className:"muted",children:"Loading…"})})})}lz();const zk=document.getElementById("root");if(!zk)throw new Error("missing #root");Ub.createRoot(zk).render(v.jsx(dz,{}));export{Ud as _,Td as g};
322
- //# sourceMappingURL=index-DQ7ZNp6t.js.map