@ours.network/messenger-server 1.0.27 → 1.0.29

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-57ATYRSM.js → chunk-6LWVJVT2.js} +1 -1
  2. package/dist/chunks/{server-4AGPXARB.js → server-JTQADJPW.js} +1 -1
  3. package/dist/cli.js +2 -2
  4. package/dist/web/assets/{abnfDiagram-N423BO3Z-BwZpfEGF.js → abnfDiagram-N423BO3Z-eMcnf3sa.js} +2 -2
  5. package/dist/web/assets/{abnfDiagram-N423BO3Z-BwZpfEGF.js.map → abnfDiagram-N423BO3Z-eMcnf3sa.js.map} +1 -1
  6. package/dist/web/assets/{arc-BFaE218e.js → arc-ISTBh79f.js} +2 -2
  7. package/dist/web/assets/{arc-BFaE218e.js.map → arc-ISTBh79f.js.map} +1 -1
  8. package/dist/web/assets/{architectureDiagram-T3A2C74G-C5THhoig.js → architectureDiagram-T3A2C74G-DjjekLv0.js} +2 -2
  9. package/dist/web/assets/{architectureDiagram-T3A2C74G-C5THhoig.js.map → architectureDiagram-T3A2C74G-DjjekLv0.js.map} +1 -1
  10. package/dist/web/assets/{blockDiagram-VBNYF7ZC-DnCtG56-.js → blockDiagram-VBNYF7ZC-CBWhEmiT.js} +2 -2
  11. package/dist/web/assets/{blockDiagram-VBNYF7ZC-DnCtG56-.js.map → blockDiagram-VBNYF7ZC-CBWhEmiT.js.map} +1 -1
  12. package/dist/web/assets/{browser-ByIBVK5q.js → browser-DcF8ESpZ.js} +2 -2
  13. package/dist/web/assets/{browser-ByIBVK5q.js.map → browser-DcF8ESpZ.js.map} +1 -1
  14. package/dist/web/assets/{c4Diagram-5PPSVZJV-DwQkOksn.js → c4Diagram-5PPSVZJV-MnZADCwp.js} +2 -2
  15. package/dist/web/assets/{c4Diagram-5PPSVZJV-DwQkOksn.js.map → c4Diagram-5PPSVZJV-MnZADCwp.js.map} +1 -1
  16. package/dist/web/assets/channel-DT2iE9aL.js +2 -0
  17. package/dist/web/assets/{channel-CeQIUqXs.js.map → channel-DT2iE9aL.js.map} +1 -1
  18. package/dist/web/assets/{chunk-2GRJ4B5K-BC7cfF0z.js → chunk-2GRJ4B5K-Dy8MTGIv.js} +2 -2
  19. package/dist/web/assets/{chunk-2GRJ4B5K-BC7cfF0z.js.map → chunk-2GRJ4B5K-Dy8MTGIv.js.map} +1 -1
  20. package/dist/web/assets/{chunk-2Q5K7J3B-DSl8ovDM.js → chunk-2Q5K7J3B-BqNi0f8w.js} +2 -2
  21. package/dist/web/assets/{chunk-2Q5K7J3B-DSl8ovDM.js.map → chunk-2Q5K7J3B-BqNi0f8w.js.map} +1 -1
  22. package/dist/web/assets/{chunk-5RXB4S5H-DEuB2ZNu.js → chunk-5RXB4S5H-BGKdzoYX.js} +2 -2
  23. package/dist/web/assets/{chunk-5RXB4S5H-DEuB2ZNu.js.map → chunk-5RXB4S5H-BGKdzoYX.js.map} +1 -1
  24. package/dist/web/assets/{chunk-5VM5RSS4-G2C_wvpZ.js → chunk-5VM5RSS4-Bi_g7AVv.js} +2 -2
  25. package/dist/web/assets/{chunk-5VM5RSS4-G2C_wvpZ.js.map → chunk-5VM5RSS4-Bi_g7AVv.js.map} +1 -1
  26. package/dist/web/assets/{chunk-6Q2QTUOP-n48Dn6tF.js → chunk-6Q2QTUOP-DB50HLAr.js} +2 -2
  27. package/dist/web/assets/{chunk-6Q2QTUOP-n48Dn6tF.js.map → chunk-6Q2QTUOP-DB50HLAr.js.map} +1 -1
  28. package/dist/web/assets/{chunk-GF5L2VYU-0cDRfE0v.js → chunk-GF5L2VYU-eWZWppwn.js} +2 -2
  29. package/dist/web/assets/{chunk-GF5L2VYU-0cDRfE0v.js.map → chunk-GF5L2VYU-eWZWppwn.js.map} +1 -1
  30. package/dist/web/assets/{chunk-JWPE2WC7-B-sIaUe_.js → chunk-JWPE2WC7-BB9SVR70.js} +2 -2
  31. package/dist/web/assets/{chunk-JWPE2WC7-B-sIaUe_.js.map → chunk-JWPE2WC7-BB9SVR70.js.map} +1 -1
  32. package/dist/web/assets/{chunk-KBJHAD2P-CJdfxI0W.js → chunk-KBJHAD2P-CzKIPigC.js} +2 -2
  33. package/dist/web/assets/{chunk-KBJHAD2P-CJdfxI0W.js.map → chunk-KBJHAD2P-CzKIPigC.js.map} +1 -1
  34. package/dist/web/assets/{chunk-RYQCIY6F-B-bC01qp.js → chunk-RYQCIY6F-DWr6rt-Y.js} +2 -2
  35. package/dist/web/assets/{chunk-RYQCIY6F-B-bC01qp.js.map → chunk-RYQCIY6F-DWr6rt-Y.js.map} +1 -1
  36. package/dist/web/assets/{chunk-XXDRQBXY-B2zsroXX.js → chunk-XXDRQBXY-5MQmFJ6O.js} +2 -2
  37. package/dist/web/assets/{chunk-XXDRQBXY-B2zsroXX.js.map → chunk-XXDRQBXY-5MQmFJ6O.js.map} +1 -1
  38. package/dist/web/assets/classDiagram-JCYQIIEL-DKoQnhxP.js +2 -0
  39. package/dist/web/assets/{classDiagram-JCYQIIEL-CkjBLoHE.js.map → classDiagram-JCYQIIEL-DKoQnhxP.js.map} +1 -1
  40. package/dist/web/assets/classDiagram-v2-OCEON4UE-DKoQnhxP.js +2 -0
  41. package/dist/web/assets/{classDiagram-v2-OCEON4UE-CkjBLoHE.js.map → classDiagram-v2-OCEON4UE-DKoQnhxP.js.map} +1 -1
  42. package/dist/web/assets/{cose-bilkent-JH36ORCC-DDphJuHu.js → cose-bilkent-JH36ORCC-BwXLjS8x.js} +2 -2
  43. package/dist/web/assets/{cose-bilkent-JH36ORCC-DDphJuHu.js.map → cose-bilkent-JH36ORCC-BwXLjS8x.js.map} +1 -1
  44. package/dist/web/assets/{cynefin-VYW2F7L2-BoKcfef3.js → cynefin-VYW2F7L2-CmgKHy3_.js} +2 -2
  45. package/dist/web/assets/{cynefin-VYW2F7L2-BoKcfef3.js.map → cynefin-VYW2F7L2-CmgKHy3_.js.map} +1 -1
  46. package/dist/web/assets/{cynefinDiagram-MW4NZA55-C0L9ol2q.js → cynefinDiagram-MW4NZA55-DPFRvJll.js} +2 -2
  47. package/dist/web/assets/{cynefinDiagram-MW4NZA55-C0L9ol2q.js.map → cynefinDiagram-MW4NZA55-DPFRvJll.js.map} +1 -1
  48. package/dist/web/assets/{dagre-VZM6K2ZE-CeDDh-x1.js → dagre-VZM6K2ZE-BGGDSW4a.js} +2 -2
  49. package/dist/web/assets/{dagre-VZM6K2ZE-CeDDh-x1.js.map → dagre-VZM6K2ZE-BGGDSW4a.js.map} +1 -1
  50. package/dist/web/assets/{diagram-7IWD3JNH-D_tUp0VL.js → diagram-7IWD3JNH-DvKxtSCT.js} +2 -2
  51. package/dist/web/assets/{diagram-7IWD3JNH-D_tUp0VL.js.map → diagram-7IWD3JNH-DvKxtSCT.js.map} +1 -1
  52. package/dist/web/assets/{diagram-B4RE2ZJO-DZDYOecW.js → diagram-B4RE2ZJO-zsnFo1Bq.js} +2 -2
  53. package/dist/web/assets/{diagram-B4RE2ZJO-DZDYOecW.js.map → diagram-B4RE2ZJO-zsnFo1Bq.js.map} +1 -1
  54. package/dist/web/assets/{diagram-LBJQPF4R-Cpc35PFW.js → diagram-LBJQPF4R-Ctc5RS_V.js} +2 -2
  55. package/dist/web/assets/{diagram-LBJQPF4R-Cpc35PFW.js.map → diagram-LBJQPF4R-Ctc5RS_V.js.map} +1 -1
  56. package/dist/web/assets/{diagram-Q27KOJAE-BOz6TqHv.js → diagram-Q27KOJAE-DzdXf-me.js} +2 -2
  57. package/dist/web/assets/{diagram-Q27KOJAE-BOz6TqHv.js.map → diagram-Q27KOJAE-DzdXf-me.js.map} +1 -1
  58. package/dist/web/assets/{diagram-UB23O5K3-Ds6nWxHH.js → diagram-UB23O5K3-CYPr_O7I.js} +2 -2
  59. package/dist/web/assets/{diagram-UB23O5K3-Ds6nWxHH.js.map → diagram-UB23O5K3-CYPr_O7I.js.map} +1 -1
  60. package/dist/web/assets/{ebnfDiagram-BXEA7PRR-CCFR7qwF.js → ebnfDiagram-BXEA7PRR-DSVgYU-G.js} +2 -2
  61. package/dist/web/assets/{ebnfDiagram-BXEA7PRR-CCFR7qwF.js.map → ebnfDiagram-BXEA7PRR-DSVgYU-G.js.map} +1 -1
  62. package/dist/web/assets/{erDiagram-JOGREHBK-Dy3fKeW1.js → erDiagram-JOGREHBK-CPz_pLmW.js} +2 -2
  63. package/dist/web/assets/{erDiagram-JOGREHBK-Dy3fKeW1.js.map → erDiagram-JOGREHBK-CPz_pLmW.js.map} +1 -1
  64. package/dist/web/assets/{flowDiagram-UKHOOZJN-DmGXUo_i.js → flowDiagram-UKHOOZJN-D6zFqxDL.js} +2 -2
  65. package/dist/web/assets/{flowDiagram-UKHOOZJN-DmGXUo_i.js.map → flowDiagram-UKHOOZJN-D6zFqxDL.js.map} +1 -1
  66. package/dist/web/assets/{ganttDiagram-PKOTCBZU-DRlsIr-9.js → ganttDiagram-PKOTCBZU-DbX4-76p.js} +2 -2
  67. package/dist/web/assets/{ganttDiagram-PKOTCBZU-DRlsIr-9.js.map → ganttDiagram-PKOTCBZU-DbX4-76p.js.map} +1 -1
  68. package/dist/web/assets/{gitGraphDiagram-DS77QQ5N-BF8sMWrB.js → gitGraphDiagram-DS77QQ5N-DFZT-WD4.js} +2 -2
  69. package/dist/web/assets/{gitGraphDiagram-DS77QQ5N-BF8sMWrB.js.map → gitGraphDiagram-DS77QQ5N-DFZT-WD4.js.map} +1 -1
  70. package/dist/web/assets/index-CnTZR2tj.js +332 -0
  71. package/dist/web/assets/index-CnTZR2tj.js.map +1 -0
  72. package/dist/web/assets/{index-FK_mwHiI.css → index-SAASLXJR.css} +1 -1
  73. package/dist/web/assets/{infoDiagram-6WML65LV-C2ziOwwF.js → infoDiagram-6WML65LV-ByBP1t70.js} +2 -2
  74. package/dist/web/assets/{infoDiagram-6WML65LV-C2ziOwwF.js.map → infoDiagram-6WML65LV-ByBP1t70.js.map} +1 -1
  75. package/dist/web/assets/{ishikawaDiagram-WSZJBQD7-Dj6G7tMI.js → ishikawaDiagram-WSZJBQD7-CIrdAqjG.js} +2 -2
  76. package/dist/web/assets/{ishikawaDiagram-WSZJBQD7-Dj6G7tMI.js.map → ishikawaDiagram-WSZJBQD7-CIrdAqjG.js.map} +1 -1
  77. package/dist/web/assets/{journeyDiagram-NVQOT4AX-YHJIDkiw.js → journeyDiagram-NVQOT4AX-CKnLFiYj.js} +2 -2
  78. package/dist/web/assets/{journeyDiagram-NVQOT4AX-YHJIDkiw.js.map → journeyDiagram-NVQOT4AX-CKnLFiYj.js.map} +1 -1
  79. package/dist/web/assets/{jsQR-Ck2KRhtk.js → jsQR-BPP3Ngrl.js} +2 -2
  80. package/dist/web/assets/{jsQR-Ck2KRhtk.js.map → jsQR-BPP3Ngrl.js.map} +1 -1
  81. package/dist/web/assets/{kanban-definition-27J2QSJJ-CR6vkjK8.js → kanban-definition-27J2QSJJ-OPn8R2vY.js} +2 -2
  82. package/dist/web/assets/{kanban-definition-27J2QSJJ-CR6vkjK8.js.map → kanban-definition-27J2QSJJ-OPn8R2vY.js.map} +1 -1
  83. package/dist/web/assets/{linear-B80VHMM1.js → linear-CTXB1fPp.js} +2 -2
  84. package/dist/web/assets/{linear-B80VHMM1.js.map → linear-CTXB1fPp.js.map} +1 -1
  85. package/dist/web/assets/{mermaid.core-Bo5ITjWV.js → mermaid.core-pc_WsE8Z.js} +5 -5
  86. package/dist/web/assets/{mermaid.core-Bo5ITjWV.js.map → mermaid.core-pc_WsE8Z.js.map} +1 -1
  87. package/dist/web/assets/{mindmap-definition-FAOFIHXS-BzBemuVP.js → mindmap-definition-FAOFIHXS-CSJMRloy.js} +2 -2
  88. package/dist/web/assets/{mindmap-definition-FAOFIHXS-BzBemuVP.js.map → mindmap-definition-FAOFIHXS-CSJMRloy.js.map} +1 -1
  89. package/dist/web/assets/{pegDiagram-VL7TDLO6-DdouWlYr.js → pegDiagram-VL7TDLO6-1eV9ws-j.js} +2 -2
  90. package/dist/web/assets/{pegDiagram-VL7TDLO6-DdouWlYr.js.map → pegDiagram-VL7TDLO6-1eV9ws-j.js.map} +1 -1
  91. package/dist/web/assets/{pieDiagram-7S7Q4E2Y-C5fE7edx.js → pieDiagram-7S7Q4E2Y-EkDI8iEc.js} +2 -2
  92. package/dist/web/assets/{pieDiagram-7S7Q4E2Y-C5fE7edx.js.map → pieDiagram-7S7Q4E2Y-EkDI8iEc.js.map} +1 -1
  93. package/dist/web/assets/{quadrantDiagram-CIZ2JOQS-fB-F7K1O.js → quadrantDiagram-CIZ2JOQS-7IhyJps_.js} +2 -2
  94. package/dist/web/assets/{quadrantDiagram-CIZ2JOQS-fB-F7K1O.js.map → quadrantDiagram-CIZ2JOQS-7IhyJps_.js.map} +1 -1
  95. package/dist/web/assets/{railroadDiagram-AXF67PYL-DUAfsiQL.js → railroadDiagram-AXF67PYL-CNeu0unU.js} +2 -2
  96. package/dist/web/assets/{railroadDiagram-AXF67PYL-DUAfsiQL.js.map → railroadDiagram-AXF67PYL-CNeu0unU.js.map} +1 -1
  97. package/dist/web/assets/{requirementDiagram-LRYGKXZP-DqY0pzOx.js → requirementDiagram-LRYGKXZP-CemLirhA.js} +2 -2
  98. package/dist/web/assets/{requirementDiagram-LRYGKXZP-DqY0pzOx.js.map → requirementDiagram-LRYGKXZP-CemLirhA.js.map} +1 -1
  99. package/dist/web/assets/{sankeyDiagram-W5VNT64P-vrR_C7WB.js → sankeyDiagram-W5VNT64P-Gkjt9cYT.js} +2 -2
  100. package/dist/web/assets/{sankeyDiagram-W5VNT64P-vrR_C7WB.js.map → sankeyDiagram-W5VNT64P-Gkjt9cYT.js.map} +1 -1
  101. package/dist/web/assets/{sequenceDiagram-SI44F4Z6-CHym7nQT.js → sequenceDiagram-SI44F4Z6-pc7eDMf0.js} +2 -2
  102. package/dist/web/assets/{sequenceDiagram-SI44F4Z6-CHym7nQT.js.map → sequenceDiagram-SI44F4Z6-pc7eDMf0.js.map} +1 -1
  103. package/dist/web/assets/{sizeCapture-X5ZJPWSS-DaDxWiPk.js → sizeCapture-X5ZJPWSS-BmzpmmGx.js} +2 -2
  104. package/dist/web/assets/{sizeCapture-X5ZJPWSS-DaDxWiPk.js.map → sizeCapture-X5ZJPWSS-BmzpmmGx.js.map} +1 -1
  105. package/dist/web/assets/{stateDiagram-OKZ733FA-CoZ6mTYC.js → stateDiagram-OKZ733FA-CcnYudwZ.js} +2 -2
  106. package/dist/web/assets/{stateDiagram-OKZ733FA-CoZ6mTYC.js.map → stateDiagram-OKZ733FA-CcnYudwZ.js.map} +1 -1
  107. package/dist/web/assets/stateDiagram-v2-UEYNNEHI-ZQlKaamB.js +2 -0
  108. package/dist/web/assets/{stateDiagram-v2-UEYNNEHI-J-MJucj5.js.map → stateDiagram-v2-UEYNNEHI-ZQlKaamB.js.map} +1 -1
  109. package/dist/web/assets/{swimlanes-SLNWSIFB-CYNnaMLq.js → swimlanes-SLNWSIFB-DMGffyER.js} +3 -3
  110. package/dist/web/assets/{swimlanes-SLNWSIFB-CYNnaMLq.js.map → swimlanes-SLNWSIFB-DMGffyER.js.map} +1 -1
  111. package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-0jY86G7x.js +9 -0
  112. package/dist/web/assets/{swimlanesDiagram-ULZ7WXOC-CkkSw8Sw.js.map → swimlanesDiagram-ULZ7WXOC-0jY86G7x.js.map} +1 -1
  113. package/dist/web/assets/{timeline-definition-Z64GVDOM-DZ1Y1cvh.js → timeline-definition-Z64GVDOM-BRB03_Z6.js} +2 -2
  114. package/dist/web/assets/{timeline-definition-Z64GVDOM-DZ1Y1cvh.js.map → timeline-definition-Z64GVDOM-BRB03_Z6.js.map} +1 -1
  115. package/dist/web/assets/{vennDiagram-T6HMQDX7-jmfMoaEa.js → vennDiagram-T6HMQDX7-B8DanJYH.js} +2 -2
  116. package/dist/web/assets/{vennDiagram-T6HMQDX7-jmfMoaEa.js.map → vennDiagram-T6HMQDX7-B8DanJYH.js.map} +1 -1
  117. package/dist/web/assets/{wardleyDiagram-T6FBY63Y-Kt8p2YSi.js → wardleyDiagram-T6FBY63Y-DeadcCSS.js} +2 -2
  118. package/dist/web/assets/{wardleyDiagram-T6FBY63Y-Kt8p2YSi.js.map → wardleyDiagram-T6FBY63Y-DeadcCSS.js.map} +1 -1
  119. package/dist/web/assets/{xychartDiagram-ELKLHX3M-CSD7wGPG.js → xychartDiagram-ELKLHX3M-PGJvOpi1.js} +2 -2
  120. package/dist/web/assets/{xychartDiagram-ELKLHX3M-CSD7wGPG.js.map → xychartDiagram-ELKLHX3M-PGJvOpi1.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 -2
  125. package/dist/web/assets/channel-CeQIUqXs.js +0 -2
  126. package/dist/web/assets/classDiagram-JCYQIIEL-CkjBLoHE.js +0 -2
  127. package/dist/web/assets/classDiagram-v2-OCEON4UE-CkjBLoHE.js +0 -2
  128. package/dist/web/assets/index-BWJKsro0.js +0 -326
  129. package/dist/web/assets/index-BWJKsro0.js.map +0 -1
  130. package/dist/web/assets/stateDiagram-v2-UEYNNEHI-J-MJucj5.js +0 -2
  131. package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-CkkSw8Sw.js +0 -9
@@ -0,0 +1,332 @@
1
+ function dC(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 a=Object.getOwnPropertyDescriptor(i,s);a&&Object.defineProperty(e,s,a.get?a:{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 a of s)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();function oh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nf={exports:{}},ys={},rf={exports:{}},Ve={};/**
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 $g;function hC(){if($g)return Ve;$g=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"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.iterator;function v(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function E(F,Y,M){this.props=F,this.context=Y,this.refs=C,this.updater=M||w}E.prototype.isReactComponent={},E.prototype.setState=function(F,Y){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,Y,"setState")},E.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function P(){}P.prototype=E.prototype;function A(F,Y,M){this.props=F,this.context=Y,this.refs=C,this.updater=M||w}var T=A.prototype=new P;T.constructor=A,S(T,E.prototype),T.isPureReactComponent=!0;var L=Array.isArray,j=Object.prototype.hasOwnProperty,I={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function B(F,Y,M){var se,ue={},ae=null,me=null;if(Y!=null)for(se in Y.ref!==void 0&&(me=Y.ref),Y.key!==void 0&&(ae=""+Y.key),Y)j.call(Y,se)&&!K.hasOwnProperty(se)&&(ue[se]=Y[se]);var Se=arguments.length-2;if(Se===1)ue.children=M;else if(1<Se){for(var xe=Array(Se),Ue=0;Ue<Se;Ue++)xe[Ue]=arguments[Ue+2];ue.children=xe}if(F&&F.defaultProps)for(se in Se=F.defaultProps,Se)ue[se]===void 0&&(ue[se]=Se[se]);return{$$typeof:e,type:F,key:ae,ref:me,props:ue,_owner:I.current}}function _(F,Y){return{$$typeof:e,type:F.type,key:Y,ref:F.ref,props:F.props,_owner:F._owner}}function N(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function $(F){var Y={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(M){return Y[M]})}var V=/\/+/g;function he(F,Y){return typeof F=="object"&&F!==null&&F.key!=null?$(""+F.key):Y.toString(36)}function J(F,Y,M,se,ue){var ae=typeof F;(ae==="undefined"||ae==="boolean")&&(F=null);var me=!1;if(F===null)me=!0;else switch(ae){case"string":case"number":me=!0;break;case"object":switch(F.$$typeof){case e:case t:me=!0}}if(me)return me=F,ue=ue(me),F=se===""?"."+he(me,0):se,L(ue)?(M="",F!=null&&(M=F.replace(V,"$&/")+"/"),J(ue,Y,M,"",function(Ue){return Ue})):ue!=null&&(N(ue)&&(ue=_(ue,M+(!ue.key||me&&me.key===ue.key?"":(""+ue.key).replace(V,"$&/")+"/")+F)),Y.push(ue)),1;if(me=0,se=se===""?".":se+":",L(F))for(var Se=0;Se<F.length;Se++){ae=F[Se];var xe=se+he(ae,Se);me+=J(ae,Y,M,xe,ue)}else if(xe=v(F),typeof xe=="function")for(F=xe.call(F),Se=0;!(ae=F.next()).done;)ae=ae.value,xe=se+he(ae,Se++),me+=J(ae,Y,M,xe,ue);else if(ae==="object")throw Y=String(F),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.");return me}function Z(F,Y,M){if(F==null)return F;var se=[],ue=0;return J(F,se,"","",function(ae){return Y.call(M,ae,ue++)}),se}function ve(F){if(F._status===-1){var Y=F._result;Y=Y(),Y.then(function(M){(F._status===0||F._status===-1)&&(F._status=1,F._result=M)},function(M){(F._status===0||F._status===-1)&&(F._status=2,F._result=M)}),F._status===-1&&(F._status=0,F._result=Y)}if(F._status===1)return F._result.default;throw F._result}var ke={current:null},Q={transition:null},pe={ReactCurrentDispatcher:ke,ReactCurrentBatchConfig:Q,ReactCurrentOwner:I};function R(){throw Error("act(...) is not supported in production builds of React.")}return Ve.Children={map:Z,forEach:function(F,Y,M){Z(F,function(){Y.apply(this,arguments)},M)},count:function(F){var Y=0;return Z(F,function(){Y++}),Y},toArray:function(F){return Z(F,function(Y){return Y})||[]},only:function(F){if(!N(F))throw Error("React.Children.only expected to receive a single React element child.");return F}},Ve.Component=E,Ve.Fragment=n,Ve.Profiler=s,Ve.PureComponent=A,Ve.StrictMode=i,Ve.Suspense=f,Ve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pe,Ve.act=R,Ve.cloneElement=function(F,Y,M){if(F==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+F+".");var se=S({},F.props),ue=F.key,ae=F.ref,me=F._owner;if(Y!=null){if(Y.ref!==void 0&&(ae=Y.ref,me=I.current),Y.key!==void 0&&(ue=""+Y.key),F.type&&F.type.defaultProps)var Se=F.type.defaultProps;for(xe in Y)j.call(Y,xe)&&!K.hasOwnProperty(xe)&&(se[xe]=Y[xe]===void 0&&Se!==void 0?Se[xe]:Y[xe])}var xe=arguments.length-2;if(xe===1)se.children=M;else if(1<xe){Se=Array(xe);for(var Ue=0;Ue<xe;Ue++)Se[Ue]=arguments[Ue+2];se.children=Se}return{$$typeof:e,type:F.type,key:ue,ref:ae,props:se,_owner:me}},Ve.createContext=function(F){return F={$$typeof:l,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},F.Provider={$$typeof:a,_context:F},F.Consumer=F},Ve.createElement=B,Ve.createFactory=function(F){var Y=B.bind(null,F);return Y.type=F,Y},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(F){return{$$typeof:c,render:F}},Ve.isValidElement=N,Ve.lazy=function(F){return{$$typeof:m,_payload:{_status:-1,_result:F},_init:ve}},Ve.memo=function(F,Y){return{$$typeof:h,type:F,compare:Y===void 0?null:Y}},Ve.startTransition=function(F){var Y=Q.transition;Q.transition={};try{F()}finally{Q.transition=Y}},Ve.unstable_act=R,Ve.useCallback=function(F,Y){return ke.current.useCallback(F,Y)},Ve.useContext=function(F){return ke.current.useContext(F)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(F){return ke.current.useDeferredValue(F)},Ve.useEffect=function(F,Y){return ke.current.useEffect(F,Y)},Ve.useId=function(){return ke.current.useId()},Ve.useImperativeHandle=function(F,Y,M){return ke.current.useImperativeHandle(F,Y,M)},Ve.useInsertionEffect=function(F,Y){return ke.current.useInsertionEffect(F,Y)},Ve.useLayoutEffect=function(F,Y){return ke.current.useLayoutEffect(F,Y)},Ve.useMemo=function(F,Y){return ke.current.useMemo(F,Y)},Ve.useReducer=function(F,Y,M){return ke.current.useReducer(F,Y,M)},Ve.useRef=function(F){return ke.current.useRef(F)},Ve.useState=function(F){return ke.current.useState(F)},Ve.useSyncExternalStore=function(F,Y,M){return ke.current.useSyncExternalStore(F,Y,M)},Ve.useTransition=function(){return ke.current.useTransition()},Ve.version="18.3.1",Ve}var Ug;function sh(){return Ug||(Ug=1,rf.exports=hC()),rf.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 Wg;function pC(){if(Wg)return ys;Wg=1;var e=sh(),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,a={key:!0,ref:!0,__self:!0,__source:!0};function l(c,f,h){var m,p={},v=null,w=null;h!==void 0&&(v=""+h),f.key!==void 0&&(v=""+f.key),f.ref!==void 0&&(w=f.ref);for(m in f)i.call(f,m)&&!a.hasOwnProperty(m)&&(p[m]=f[m]);if(c&&c.defaultProps)for(m in f=c.defaultProps,f)p[m]===void 0&&(p[m]=f[m]);return{$$typeof:t,type:c,key:v,ref:w,props:p,_owner:s.current}}return ys.Fragment=n,ys.jsx=l,ys.jsxs=l,ys}var Hg;function mC(){return Hg||(Hg=1,nf.exports=pC()),nf.exports}var y=mC(),fl={},of={exports:{}},mn={},sf={exports:{}},af={};/**
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 Kg;function gC(){return Kg||(Kg=1,function(e){function t(Q,pe){var R=Q.length;Q.push(pe);e:for(;0<R;){var F=R-1>>>1,Y=Q[F];if(0<s(Y,pe))Q[F]=pe,Q[R]=Y,R=F;else break e}}function n(Q){return Q.length===0?null:Q[0]}function i(Q){if(Q.length===0)return null;var pe=Q[0],R=Q.pop();if(R!==pe){Q[0]=R;e:for(var F=0,Y=Q.length,M=Y>>>1;F<M;){var se=2*(F+1)-1,ue=Q[se],ae=se+1,me=Q[ae];if(0>s(ue,R))ae<Y&&0>s(me,ue)?(Q[F]=me,Q[ae]=R,F=ae):(Q[F]=ue,Q[se]=R,F=se);else if(ae<Y&&0>s(me,R))Q[F]=me,Q[ae]=R,F=ae;else break e}}return pe}function s(Q,pe){var R=Q.sortIndex-pe.sortIndex;return R!==0?R:Q.id-pe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],h=[],m=1,p=null,v=3,w=!1,S=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,P=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 T(Q){for(var pe=n(h);pe!==null;){if(pe.callback===null)i(h);else if(pe.startTime<=Q)i(h),pe.sortIndex=pe.expirationTime,t(f,pe);else break;pe=n(h)}}function L(Q){if(C=!1,T(Q),!S)if(n(f)!==null)S=!0,ve(j);else{var pe=n(h);pe!==null&&ke(L,pe.startTime-Q)}}function j(Q,pe){S=!1,C&&(C=!1,P(B),B=-1),w=!0;var R=v;try{for(T(pe),p=n(f);p!==null&&(!(p.expirationTime>pe)||Q&&!$());){var F=p.callback;if(typeof F=="function"){p.callback=null,v=p.priorityLevel;var Y=F(p.expirationTime<=pe);pe=e.unstable_now(),typeof Y=="function"?p.callback=Y:p===n(f)&&i(f),T(pe)}else i(f);p=n(f)}if(p!==null)var M=!0;else{var se=n(h);se!==null&&ke(L,se.startTime-pe),M=!1}return M}finally{p=null,v=R,w=!1}}var I=!1,K=null,B=-1,_=5,N=-1;function $(){return!(e.unstable_now()-N<_)}function V(){if(K!==null){var Q=e.unstable_now();N=Q;var pe=!0;try{pe=K(!0,Q)}finally{pe?he():(I=!1,K=null)}}else I=!1}var he;if(typeof A=="function")he=function(){A(V)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,Z=J.port2;J.port1.onmessage=V,he=function(){Z.postMessage(null)}}else he=function(){E(V,0)};function ve(Q){K=Q,I||(I=!0,he())}function ke(Q,pe){B=E(function(){Q(e.unstable_now())},pe)}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(){S||w||(S=!0,ve(j))},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"):_=0<Q?Math.floor(1e3/Q):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(Q){switch(v){case 1:case 2:case 3:var pe=3;break;default:pe=v}var R=v;v=pe;try{return Q()}finally{v=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Q,pe){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var R=v;v=Q;try{return pe()}finally{v=R}},e.unstable_scheduleCallback=function(Q,pe,R){var F=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?F+R:F):R=F,Q){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=R+Y,Q={id:m++,callback:pe,priorityLevel:Q,startTime:R,expirationTime:Y,sortIndex:-1},R>F?(Q.sortIndex=R,t(h,Q),n(f)===null&&Q===n(h)&&(C?(P(B),B=-1):C=!0,ke(L,R-F))):(Q.sortIndex=Y,t(f,Q),S||w||(S=!0,ve(j))),Q},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(Q){var pe=v;return function(){var R=v;v=pe;try{return Q.apply(this,arguments)}finally{v=R}}}}(af)),af}var qg;function yC(){return qg||(qg=1,sf.exports=gC()),sf.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 Xg;function vC(){if(Xg)return mn;Xg=1;var e=sh(),t=yC();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 a(r,o){l(r,o),l(r+"Capture",o)}function l(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"),f=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 v(r){return f.call(p,r)?!0:f.call(m,r)?!1:h.test(r)?p[r]=!0:(m[r]=!0,!1)}function w(r,o,u,d){if(u!==null&&u.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return d?!1:u!==null?!u.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function S(r,o,u,d){if(o===null||typeof o>"u"||w(r,o,u,d))return!0;if(d)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,d,g,x,b){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=d,this.attributeNamespace=g,this.mustUseProperty=u,this.propertyName=r,this.type=o,this.sanitizeURL=x,this.removeEmptyString=b}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){E[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];E[o]=new C(o,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){E[r]=new C(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){E[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){E[r]=new C(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){E[r]=new C(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){E[r]=new C(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){E[r]=new C(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){E[r]=new C(r,5,!1,r.toLowerCase(),null,!1,!1)});var P=/[\-:]([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(P,A);E[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(P,A);E[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(P,A);E[o]=new C(o,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){E[r]=new C(r,1,!1,r.toLowerCase(),null,!1,!1)}),E.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){E[r]=new C(r,1,!1,r.toLowerCase(),null,!0,!0)});function T(r,o,u,d){var g=E.hasOwnProperty(o)?E[o]:null;(g!==null?g.type!==0:d||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(S(o,u,g,d)&&(u=null),d||g===null?v(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,d=g.attributeNamespace,u===null?r.removeAttribute(o):(g=g.type,u=g===3||g===4&&u===!0?"":""+u,d?r.setAttributeNS(d,o,u):r.setAttribute(o,u))))}var L=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,j=Symbol.for("react.element"),I=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),$=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),he=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),ve=Symbol.for("react.lazy"),ke=Symbol.for("react.offscreen"),Q=Symbol.iterator;function pe(r){return r===null||typeof r!="object"?null:(r=Q&&r[Q]||r["@@iterator"],typeof r=="function"?r:null)}var R=Object.assign,F;function Y(r){if(F===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);F=o&&o[1]||""}return`
34
+ `+F+r}var M=!1;function se(r,o){if(!r||M)return"";M=!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(q){var d=q}Reflect.construct(r,[],o)}else{try{o.call()}catch(q){d=q}r.call(o.prototype)}else{try{throw Error()}catch(q){d=q}r()}}catch(q){if(q&&d&&typeof q.stack=="string"){for(var g=q.stack.split(`
35
+ `),x=d.stack.split(`
36
+ `),b=g.length-1,D=x.length-1;1<=b&&0<=D&&g[b]!==x[D];)D--;for(;1<=b&&0<=D;b--,D--)if(g[b]!==x[D]){if(b!==1||D!==1)do if(b--,D--,0>D||g[b]!==x[D]){var O=`
37
+ `+g[b].replace(" at new "," at ");return r.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",r.displayName)),O}while(1<=b&&0<=D);break}}}finally{M=!1,Error.prepareStackTrace=u}return(r=r?r.displayName||r.name:"")?Y(r):""}function ue(r){switch(r.tag){case 5:return Y(r.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return r=se(r.type,!1),r;case 11:return r=se(r.type.render,!1),r;case 1:return r=se(r.type,!0),r;default:return""}}function ae(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 K:return"Fragment";case I:return"Portal";case _:return"Profiler";case B:return"StrictMode";case he:return"Suspense";case J:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case $:return(r.displayName||"Context")+".Consumer";case N:return(r._context.displayName||"Context")+".Provider";case V:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case Z:return o=r.displayName||null,o!==null?o:ae(r.type)||"Memo";case ve:o=r._payload,r=r._init;try{return ae(r(o))}catch{}}return null}function me(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 ae(o);case 8:return o===B?"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 Se(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function xe(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Ue(r){var o=xe(r)?"checked":"value",u=Object.getOwnPropertyDescriptor(r.constructor.prototype,o),d=""+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){d=""+b,x.call(this,b)}}),Object.defineProperty(r,o,{enumerable:u.enumerable}),{getValue:function(){return d},setValue:function(b){d=""+b},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function Fe(r){r._valueTracker||(r._valueTracker=Ue(r))}function Ke(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var u=o.getValue(),d="";return r&&(d=xe(r)?r.checked?"true":"false":r.value),r=d,r!==u?(o.setValue(r),!0):!1}function ot(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 st(r,o){var u=o.checked;return R({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??r._wrapperState.initialChecked})}function Ft(r,o){var u=o.defaultValue==null?"":o.defaultValue,d=o.checked!=null?o.checked:o.defaultChecked;u=Se(o.value!=null?o.value:u),r._wrapperState={initialChecked:d,initialValue:u,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function Zt(r,o){o=o.checked,o!=null&&T(r,"checked",o,!1)}function et(r,o){Zt(r,o);var u=Se(o.value),d=o.type;if(u!=null)d==="number"?(u===0&&r.value===""||r.value!=u)&&(r.value=""+u):r.value!==""+u&&(r.value=""+u);else if(d==="submit"||d==="reset"){r.removeAttribute("value");return}o.hasOwnProperty("value")?Tn(r,o.type,u):o.hasOwnProperty("defaultValue")&&Tn(r,o.type,Se(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(r.defaultChecked=!!o.defaultChecked)}function Wt(r,o,u){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var d=o.type;if(!(d!=="submit"&&d!=="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 Tn(r,o,u){(o!=="number"||ot(r.ownerDocument)!==r)&&(u==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+u&&(r.defaultValue=""+u))}var zt=Array.isArray;function en(r,o,u,d){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&&d&&(r[u].defaultSelected=!0)}else{for(u=""+Se(u),o=null,g=0;g<r.length;g++){if(r[g].value===u){r[g].selected=!0,d&&(r[g].defaultSelected=!0);return}o!==null||r[g].disabled||(o=r[g])}o!==null&&(o.selected=!0)}}function bt(r,o){if(o.dangerouslySetInnerHTML!=null)throw Error(n(91));return R({},o,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function Jn(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(zt(u)){if(1<u.length)throw Error(n(93));u=u[0]}o=u}o==null&&(o=""),u=o}r._wrapperState={initialValue:Se(u)}}function We(r,o){var u=Se(o.value),d=Se(o.defaultValue);u!=null&&(u=""+u,u!==r.value&&(r.value=u),o.defaultValue==null&&r.defaultValue!==u&&(r.defaultValue=u)),d!=null&&(r.defaultValue=""+d)}function Ar(r){var o=r.textContent;o===r._wrapperState.initialValue&&o!==""&&o!==null&&(r.value=o)}function G(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 ee(r,o){return r==null||r==="http://www.w3.org/1999/xhtml"?G(o):r==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Re,je=function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,u,d,g){MSApp.execUnsafeLocalFunction(function(){return r(o,u,d,g)})}:r}(function(r,o){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=o;else{for(Re=Re||document.createElement("div"),Re.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=Re.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;o.firstChild;)r.appendChild(o.firstChild)}});function ze(r,o){if(o){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=o;return}}r.textContent=o}var at={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},Mt=["Webkit","ms","Moz","O"];Object.keys(at).forEach(function(r){Mt.forEach(function(o){o=o+r.charAt(0).toUpperCase()+r.substring(1),at[o]=at[r]})});function W(r,o,u){return o==null||typeof o=="boolean"||o===""?"":u||typeof o!="number"||o===0||at.hasOwnProperty(r)&&at[r]?(""+o).trim():o+"px"}function ge(r,o){r=r.style;for(var u in o)if(o.hasOwnProperty(u)){var d=u.indexOf("--")===0,g=W(u,o[u],d);u==="float"&&(u="cssFloat"),d?r.setProperty(u,g):r[u]=g}}var ie=R({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 ye(r,o){if(o){if(ie[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 De(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 de=null;function qe(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var wt=null,ft=null,Je=null;function yt(r){if(r=ns(r)){if(typeof wt!="function")throw Error(n(280));var o=r.stateNode;o&&(o=Ta(o),wt(r.stateNode,r.type,o))}}function ht(r){ft?Je?Je.push(r):Je=[r]:ft=r}function Ht(){if(ft){var r=ft,o=Je;if(Je=ft=null,yt(r),o)for(r=0;r<o.length;r++)yt(o[r])}}function Pt(r,o){return r(o)}function ia(){}var Oi=!1;function ui(r,o,u){if(Oi)return r(o,u);Oi=!0;try{return Pt(r,o,u)}finally{Oi=!1,(ft!==null||Je!==null)&&(ia(),Ht())}}function jr(r,o){var u=r.stateNode;if(u===null)return null;var d=Ta(u);if(d===null)return null;u=d[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":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(n(231,o,typeof u));return u}var Fi=!1;if(c)try{var vn={};Object.defineProperty(vn,"passive",{get:function(){Fi=!0}}),window.addEventListener("test",vn,vn),window.removeEventListener("test",vn,vn)}catch{Fi=!1}function oa(r,o,u,d,g,x,b,D,O){var q=Array.prototype.slice.call(arguments,3);try{o.apply(u,q)}catch(re){this.onError(re)}}var Zn=!1,It=null,Nr=!1,mr=null,sa={onError:function(r){Zn=!0,It=r}};function Su(r,o,u,d,g,x,b,D,O){Zn=!1,It=null,oa.apply(sa,arguments)}function _o(r,o,u,d,g,x,b,D,O){if(Su.apply(this,arguments),Zn){if(Zn){var q=It;Zn=!1,It=null}else throw Error(n(198));Nr||(Nr=!0,mr=q)}}function gr(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 zi(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 Oo(r){if(gr(r)!==r)throw Error(n(188))}function X(r){var o=r.alternate;if(!o){if(o=gr(r),o===null)throw Error(n(188));return o!==r?null:r}for(var u=r,d=o;;){var g=u.return;if(g===null)break;var x=g.alternate;if(x===null){if(d=g.return,d!==null){u=d;continue}break}if(g.child===x.child){for(x=g.child;x;){if(x===u)return Oo(g),r;if(x===d)return Oo(g),o;x=x.sibling}throw Error(n(188))}if(u.return!==d.return)u=g,d=x;else{for(var b=!1,D=g.child;D;){if(D===u){b=!0,u=g,d=x;break}if(D===d){b=!0,d=g,u=x;break}D=D.sibling}if(!b){for(D=x.child;D;){if(D===u){b=!0,u=x,d=g;break}if(D===d){b=!0,d=x,u=g;break}D=D.sibling}if(!b)throw Error(n(189))}}if(u.alternate!==d)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?r:o}function ne(r){return r=X(r),r!==null?ce(r):null}function ce(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var o=ce(r);if(o!==null)return o;r=r.sibling}return null}var Oe=t.unstable_scheduleCallback,pt=t.unstable_cancelCallback,Rt=t.unstable_shouldYield,Pn=t.unstable_requestPaint,Qe=t.unstable_now,Kt=t.unstable_getCurrentPriorityLevel,un=t.unstable_ImmediatePriority,kt=t.unstable_UserBlockingPriority,zn=t.unstable_NormalPriority,TS=t.unstable_LowPriority,vp=t.unstable_IdlePriority,aa=null,er=null;function PS(r){if(er&&typeof er.onCommitFiberRoot=="function")try{er.onCommitFiberRoot(aa,r,void 0,(r.current.flags&128)===128)}catch{}}var Vn=Math.clz32?Math.clz32:jS,RS=Math.log,AS=Math.LN2;function jS(r){return r>>>=0,r===0?32:31-(RS(r)/AS|0)|0}var la=64,ua=4194304;function Fo(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 ca(r,o){var u=r.pendingLanes;if(u===0)return 0;var d=0,g=r.suspendedLanes,x=r.pingedLanes,b=u&268435455;if(b!==0){var D=b&~g;D!==0?d=Fo(D):(x&=b,x!==0&&(d=Fo(x)))}else b=u&~g,b!==0?d=Fo(b):x!==0&&(d=Fo(x));if(d===0)return 0;if(o!==0&&o!==d&&(o&g)===0&&(g=d&-d,x=o&-o,g>=x||g===16&&(x&4194240)!==0))return o;if((d&4)!==0&&(d|=u&16),o=r.entangledLanes,o!==0)for(r=r.entanglements,o&=d;0<o;)u=31-Vn(o),g=1<<u,d|=r[u],o&=~g;return d}function NS(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 MS(r,o){for(var u=r.suspendedLanes,d=r.pingedLanes,g=r.expirationTimes,x=r.pendingLanes;0<x;){var b=31-Vn(x),D=1<<b,O=g[b];O===-1?((D&u)===0||(D&d)!==0)&&(g[b]=NS(D,o)):O<=o&&(r.expiredLanes|=D),x&=~D}}function bu(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function xp(){var r=la;return la<<=1,(la&4194240)===0&&(la=64),r}function Cu(r){for(var o=[],u=0;31>u;u++)o.push(r);return o}function zo(r,o,u){r.pendingLanes|=o,o!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,o=31-Vn(o),r[o]=u}function IS(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 d=r.eventTimes;for(r=r.expirationTimes;0<u;){var g=31-Vn(u),x=1<<g;o[g]=0,d[g]=-1,r[g]=-1,u&=~x}}function Eu(r,o){var u=r.entangledLanes|=o;for(r=r.entanglements;u;){var d=31-Vn(u),g=1<<d;g&o|r[d]&o&&(r[d]|=o),u&=~g}}var Ze=0;function wp(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var kp,Tu,Sp,bp,Cp,Pu=!1,fa=[],Mr=null,Ir=null,Dr=null,Vo=new Map,Bo=new Map,Lr=[],DS="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 Ep(r,o){switch(r){case"focusin":case"focusout":Mr=null;break;case"dragenter":case"dragleave":Ir=null;break;case"mouseover":case"mouseout":Dr=null;break;case"pointerover":case"pointerout":Vo.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bo.delete(o.pointerId)}}function $o(r,o,u,d,g,x){return r===null||r.nativeEvent!==x?(r={blockedOn:o,domEventName:u,eventSystemFlags:d,nativeEvent:x,targetContainers:[g]},o!==null&&(o=ns(o),o!==null&&Tu(o)),r):(r.eventSystemFlags|=d,o=r.targetContainers,g!==null&&o.indexOf(g)===-1&&o.push(g),r)}function LS(r,o,u,d,g){switch(o){case"focusin":return Mr=$o(Mr,r,o,u,d,g),!0;case"dragenter":return Ir=$o(Ir,r,o,u,d,g),!0;case"mouseover":return Dr=$o(Dr,r,o,u,d,g),!0;case"pointerover":var x=g.pointerId;return Vo.set(x,$o(Vo.get(x)||null,r,o,u,d,g)),!0;case"gotpointercapture":return x=g.pointerId,Bo.set(x,$o(Bo.get(x)||null,r,o,u,d,g)),!0}return!1}function Tp(r){var o=ci(r.target);if(o!==null){var u=gr(o);if(u!==null){if(o=u.tag,o===13){if(o=zi(u),o!==null){r.blockedOn=o,Cp(r.priority,function(){Sp(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 da(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var u=Au(r.domEventName,r.eventSystemFlags,o[0],r.nativeEvent);if(u===null){u=r.nativeEvent;var d=new u.constructor(u.type,u);de=d,u.target.dispatchEvent(d),de=null}else return o=ns(u),o!==null&&Tu(o),r.blockedOn=u,!1;o.shift()}return!0}function Pp(r,o,u){da(r)&&u.delete(o)}function _S(){Pu=!1,Mr!==null&&da(Mr)&&(Mr=null),Ir!==null&&da(Ir)&&(Ir=null),Dr!==null&&da(Dr)&&(Dr=null),Vo.forEach(Pp),Bo.forEach(Pp)}function Uo(r,o){r.blockedOn===o&&(r.blockedOn=null,Pu||(Pu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,_S)))}function Wo(r){function o(g){return Uo(g,r)}if(0<fa.length){Uo(fa[0],r);for(var u=1;u<fa.length;u++){var d=fa[u];d.blockedOn===r&&(d.blockedOn=null)}}for(Mr!==null&&Uo(Mr,r),Ir!==null&&Uo(Ir,r),Dr!==null&&Uo(Dr,r),Vo.forEach(o),Bo.forEach(o),u=0;u<Lr.length;u++)d=Lr[u],d.blockedOn===r&&(d.blockedOn=null);for(;0<Lr.length&&(u=Lr[0],u.blockedOn===null);)Tp(u),u.blockedOn===null&&Lr.shift()}var Vi=L.ReactCurrentBatchConfig,ha=!0;function OS(r,o,u,d){var g=Ze,x=Vi.transition;Vi.transition=null;try{Ze=1,Ru(r,o,u,d)}finally{Ze=g,Vi.transition=x}}function FS(r,o,u,d){var g=Ze,x=Vi.transition;Vi.transition=null;try{Ze=4,Ru(r,o,u,d)}finally{Ze=g,Vi.transition=x}}function Ru(r,o,u,d){if(ha){var g=Au(r,o,u,d);if(g===null)Ku(r,o,d,pa,u),Ep(r,d);else if(LS(g,r,o,u,d))d.stopPropagation();else if(Ep(r,d),o&4&&-1<DS.indexOf(r)){for(;g!==null;){var x=ns(g);if(x!==null&&kp(x),x=Au(r,o,u,d),x===null&&Ku(r,o,d,pa,u),x===g)break;g=x}g!==null&&d.stopPropagation()}else Ku(r,o,d,null,u)}}var pa=null;function Au(r,o,u,d){if(pa=null,r=qe(d),r=ci(r),r!==null)if(o=gr(r),o===null)r=null;else if(u=o.tag,u===13){if(r=zi(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 pa=r,null}function Rp(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(Kt()){case un:return 1;case kt:return 4;case zn:case TS:return 16;case vp:return 536870912;default:return 16}default:return 16}}var _r=null,ju=null,ma=null;function Ap(){if(ma)return ma;var r,o=ju,u=o.length,d,g="value"in _r?_r.value:_r.textContent,x=g.length;for(r=0;r<u&&o[r]===g[r];r++);var b=u-r;for(d=1;d<=b&&o[u-d]===g[x-d];d++);return ma=g.slice(r,1<d?1-d:void 0)}function ga(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 ya(){return!0}function jp(){return!1}function xn(r){function o(u,d,g,x,b){this._reactName=u,this._targetInst=g,this.type=d,this.nativeEvent=x,this.target=b,this.currentTarget=null;for(var D in r)r.hasOwnProperty(D)&&(u=r[D],this[D]=u?u(x):x[D]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?ya:jp,this.isPropagationStopped=jp,this}return R(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=ya)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=ya)},persist:function(){},isPersistent:ya}),o}var Bi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nu=xn(Bi),Ho=R({},Bi,{view:0,detail:0}),zS=xn(Ho),Mu,Iu,Ko,va=R({},Ho,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Lu,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!==Ko&&(Ko&&r.type==="mousemove"?(Mu=r.screenX-Ko.screenX,Iu=r.screenY-Ko.screenY):Iu=Mu=0,Ko=r),Mu)},movementY:function(r){return"movementY"in r?r.movementY:Iu}}),Np=xn(va),VS=R({},va,{dataTransfer:0}),BS=xn(VS),$S=R({},Ho,{relatedTarget:0}),Du=xn($S),US=R({},Bi,{animationName:0,elapsedTime:0,pseudoElement:0}),WS=xn(US),HS=R({},Bi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),KS=xn(HS),qS=R({},Bi,{data:0}),Mp=xn(qS),XS={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"},GS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function QS(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=GS[r])?!!o[r]:!1}function Lu(){return QS}var JS=R({},Ho,{key:function(r){if(r.key){var o=XS[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=ga(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:Lu,charCode:function(r){return r.type==="keypress"?ga(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?ga(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),ZS=xn(JS),eb=R({},va,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ip=xn(eb),tb=R({},Ho,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Lu}),nb=xn(tb),rb=R({},Bi,{propertyName:0,elapsedTime:0,pseudoElement:0}),ib=xn(rb),ob=R({},va,{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}),sb=xn(ob),ab=[9,13,27,32],_u=c&&"CompositionEvent"in window,qo=null;c&&"documentMode"in document&&(qo=document.documentMode);var lb=c&&"TextEvent"in window&&!qo,Dp=c&&(!_u||qo&&8<qo&&11>=qo),Lp=" ",_p=!1;function Op(r,o){switch(r){case"keyup":return ab.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fp(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var $i=!1;function ub(r,o){switch(r){case"compositionend":return Fp(o);case"keypress":return o.which!==32?null:(_p=!0,Lp);case"textInput":return r=o.data,r===Lp&&_p?null:r;default:return null}}function cb(r,o){if($i)return r==="compositionend"||!_u&&Op(r,o)?(r=Ap(),ma=ju=_r=null,$i=!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 Dp&&o.locale!=="ko"?null:o.data;default:return null}}var fb={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 zp(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!fb[r.type]:o==="textarea"}function Vp(r,o,u,d){ht(d),o=ba(o,"onChange"),0<o.length&&(u=new Nu("onChange","change",null,u,d),r.push({event:u,listeners:o}))}var Xo=null,Yo=null;function db(r){im(r,0)}function xa(r){var o=qi(r);if(Ke(o))return r}function hb(r,o){if(r==="change")return o}var Bp=!1;if(c){var Ou;if(c){var Fu="oninput"in document;if(!Fu){var $p=document.createElement("div");$p.setAttribute("oninput","return;"),Fu=typeof $p.oninput=="function"}Ou=Fu}else Ou=!1;Bp=Ou&&(!document.documentMode||9<document.documentMode)}function Up(){Xo&&(Xo.detachEvent("onpropertychange",Wp),Yo=Xo=null)}function Wp(r){if(r.propertyName==="value"&&xa(Yo)){var o=[];Vp(o,Yo,r,qe(r)),ui(db,o)}}function pb(r,o,u){r==="focusin"?(Up(),Xo=o,Yo=u,Xo.attachEvent("onpropertychange",Wp)):r==="focusout"&&Up()}function mb(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return xa(Yo)}function gb(r,o){if(r==="click")return xa(o)}function yb(r,o){if(r==="input"||r==="change")return xa(o)}function vb(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var Bn=typeof Object.is=="function"?Object.is:vb;function Go(r,o){if(Bn(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var u=Object.keys(r),d=Object.keys(o);if(u.length!==d.length)return!1;for(d=0;d<u.length;d++){var g=u[d];if(!f.call(o,g)||!Bn(r[g],o[g]))return!1}return!0}function Hp(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Kp(r,o){var u=Hp(r);r=0;for(var d;u;){if(u.nodeType===3){if(d=r+u.textContent.length,r<=o&&d>=o)return{node:u,offset:o-r};r=d}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Hp(u)}}function qp(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?qp(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function Xp(){for(var r=window,o=ot();o instanceof r.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)r=o.contentWindow;else break;o=ot(r.document)}return o}function zu(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 xb(r){var o=Xp(),u=r.focusedElem,d=r.selectionRange;if(o!==u&&u&&u.ownerDocument&&qp(u.ownerDocument.documentElement,u)){if(d!==null&&zu(u)){if(o=d.start,r=d.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(d.start,g);d=d.end===void 0?x:Math.min(d.end,g),!r.extend&&x>d&&(g=d,d=x,x=g),g=Kp(u,x);var b=Kp(u,d);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>d?(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 wb=c&&"documentMode"in document&&11>=document.documentMode,Ui=null,Vu=null,Qo=null,Bu=!1;function Yp(r,o,u){var d=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Bu||Ui==null||Ui!==ot(d)||(d=Ui,"selectionStart"in d&&zu(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Qo&&Go(Qo,d)||(Qo=d,d=ba(Vu,"onSelect"),0<d.length&&(o=new Nu("onSelect","select",null,o,u),r.push({event:o,listeners:d}),o.target=Ui)))}function wa(r,o){var u={};return u[r.toLowerCase()]=o.toLowerCase(),u["Webkit"+r]="webkit"+o,u["Moz"+r]="moz"+o,u}var Wi={animationend:wa("Animation","AnimationEnd"),animationiteration:wa("Animation","AnimationIteration"),animationstart:wa("Animation","AnimationStart"),transitionend:wa("Transition","TransitionEnd")},$u={},Gp={};c&&(Gp=document.createElement("div").style,"AnimationEvent"in window||(delete Wi.animationend.animation,delete Wi.animationiteration.animation,delete Wi.animationstart.animation),"TransitionEvent"in window||delete Wi.transitionend.transition);function ka(r){if($u[r])return $u[r];if(!Wi[r])return r;var o=Wi[r],u;for(u in o)if(o.hasOwnProperty(u)&&u in Gp)return $u[r]=o[u];return r}var Qp=ka("animationend"),Jp=ka("animationiteration"),Zp=ka("animationstart"),em=ka("transitionend"),tm=new Map,nm="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 Or(r,o){tm.set(r,o),a(o,[r])}for(var Uu=0;Uu<nm.length;Uu++){var Wu=nm[Uu],kb=Wu.toLowerCase(),Sb=Wu[0].toUpperCase()+Wu.slice(1);Or(kb,"on"+Sb)}Or(Qp,"onAnimationEnd"),Or(Jp,"onAnimationIteration"),Or(Zp,"onAnimationStart"),Or("dblclick","onDoubleClick"),Or("focusin","onFocus"),Or("focusout","onBlur"),Or(em,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jo="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(" "),bb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Jo));function rm(r,o,u){var d=r.type||"unknown-event";r.currentTarget=u,_o(d,o,void 0,r),r.currentTarget=null}function im(r,o){o=(o&4)!==0;for(var u=0;u<r.length;u++){var d=r[u],g=d.event;d=d.listeners;e:{var x=void 0;if(o)for(var b=d.length-1;0<=b;b--){var D=d[b],O=D.instance,q=D.currentTarget;if(D=D.listener,O!==x&&g.isPropagationStopped())break e;rm(g,D,q),x=O}else for(b=0;b<d.length;b++){if(D=d[b],O=D.instance,q=D.currentTarget,D=D.listener,O!==x&&g.isPropagationStopped())break e;rm(g,D,q),x=O}}}if(Nr)throw r=mr,Nr=!1,mr=null,r}function ut(r,o){var u=o[Ju];u===void 0&&(u=o[Ju]=new Set);var d=r+"__bubble";u.has(d)||(om(o,r,2,!1),u.add(d))}function Hu(r,o,u){var d=0;o&&(d|=4),om(u,r,d,o)}var Sa="_reactListening"+Math.random().toString(36).slice(2);function Zo(r){if(!r[Sa]){r[Sa]=!0,i.forEach(function(u){u!=="selectionchange"&&(bb.has(u)||Hu(u,!1,r),Hu(u,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[Sa]||(o[Sa]=!0,Hu("selectionchange",!1,o))}}function om(r,o,u,d){switch(Rp(o)){case 1:var g=OS;break;case 4:g=FS;break;default:g=Ru}u=g.bind(null,o,u,r),g=void 0,!Fi||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(g=!0),d?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 Ku(r,o,u,d,g){var x=d;if((o&1)===0&&(o&2)===0&&d!==null)e:for(;;){if(d===null)return;var b=d.tag;if(b===3||b===4){var D=d.stateNode.containerInfo;if(D===g||D.nodeType===8&&D.parentNode===g)break;if(b===4)for(b=d.return;b!==null;){var O=b.tag;if((O===3||O===4)&&(O=b.stateNode.containerInfo,O===g||O.nodeType===8&&O.parentNode===g))return;b=b.return}for(;D!==null;){if(b=ci(D),b===null)return;if(O=b.tag,O===5||O===6){d=x=b;continue e}D=D.parentNode}}d=d.return}ui(function(){var q=x,re=qe(u),oe=[];e:{var te=tm.get(r);if(te!==void 0){var we=Nu,Ee=r;switch(r){case"keypress":if(ga(u)===0)break e;case"keydown":case"keyup":we=ZS;break;case"focusin":Ee="focus",we=Du;break;case"focusout":Ee="blur",we=Du;break;case"beforeblur":case"afterblur":we=Du;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":we=Np;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":we=BS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":we=nb;break;case Qp:case Jp:case Zp:we=WS;break;case em:we=ib;break;case"scroll":we=zS;break;case"wheel":we=sb;break;case"copy":case"cut":case"paste":we=KS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":we=Ip}var Pe=(o&4)!==0,St=!Pe&&r==="scroll",U=Pe?te!==null?te+"Capture":null:te;Pe=[];for(var z=q,H;z!==null;){H=z;var fe=H.stateNode;if(H.tag===5&&fe!==null&&(H=fe,U!==null&&(fe=jr(z,U),fe!=null&&Pe.push(es(z,fe,H)))),St)break;z=z.return}0<Pe.length&&(te=new we(te,Ee,null,u,re),oe.push({event:te,listeners:Pe}))}}if((o&7)===0){e:{if(te=r==="mouseover"||r==="pointerover",we=r==="mouseout"||r==="pointerout",te&&u!==de&&(Ee=u.relatedTarget||u.fromElement)&&(ci(Ee)||Ee[yr]))break e;if((we||te)&&(te=re.window===re?re:(te=re.ownerDocument)?te.defaultView||te.parentWindow:window,we?(Ee=u.relatedTarget||u.toElement,we=q,Ee=Ee?ci(Ee):null,Ee!==null&&(St=gr(Ee),Ee!==St||Ee.tag!==5&&Ee.tag!==6)&&(Ee=null)):(we=null,Ee=q),we!==Ee)){if(Pe=Np,fe="onMouseLeave",U="onMouseEnter",z="mouse",(r==="pointerout"||r==="pointerover")&&(Pe=Ip,fe="onPointerLeave",U="onPointerEnter",z="pointer"),St=we==null?te:qi(we),H=Ee==null?te:qi(Ee),te=new Pe(fe,z+"leave",we,u,re),te.target=St,te.relatedTarget=H,fe=null,ci(re)===q&&(Pe=new Pe(U,z+"enter",Ee,u,re),Pe.target=H,Pe.relatedTarget=St,fe=Pe),St=fe,we&&Ee)t:{for(Pe=we,U=Ee,z=0,H=Pe;H;H=Hi(H))z++;for(H=0,fe=U;fe;fe=Hi(fe))H++;for(;0<z-H;)Pe=Hi(Pe),z--;for(;0<H-z;)U=Hi(U),H--;for(;z--;){if(Pe===U||U!==null&&Pe===U.alternate)break t;Pe=Hi(Pe),U=Hi(U)}Pe=null}else Pe=null;we!==null&&sm(oe,te,we,Pe,!1),Ee!==null&&St!==null&&sm(oe,St,Ee,Pe,!0)}}e:{if(te=q?qi(q):window,we=te.nodeName&&te.nodeName.toLowerCase(),we==="select"||we==="input"&&te.type==="file")var Ae=hb;else if(zp(te))if(Bp)Ae=yb;else{Ae=mb;var Ne=pb}else(we=te.nodeName)&&we.toLowerCase()==="input"&&(te.type==="checkbox"||te.type==="radio")&&(Ae=gb);if(Ae&&(Ae=Ae(r,q))){Vp(oe,Ae,u,re);break e}Ne&&Ne(r,te,q),r==="focusout"&&(Ne=te._wrapperState)&&Ne.controlled&&te.type==="number"&&Tn(te,"number",te.value)}switch(Ne=q?qi(q):window,r){case"focusin":(zp(Ne)||Ne.contentEditable==="true")&&(Ui=Ne,Vu=q,Qo=null);break;case"focusout":Qo=Vu=Ui=null;break;case"mousedown":Bu=!0;break;case"contextmenu":case"mouseup":case"dragend":Bu=!1,Yp(oe,u,re);break;case"selectionchange":if(wb)break;case"keydown":case"keyup":Yp(oe,u,re)}var Me;if(_u)e:{switch(r){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else $i?Op(r,u)&&(Le="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(Le="onCompositionStart");Le&&(Dp&&u.locale!=="ko"&&($i||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&$i&&(Me=Ap()):(_r=re,ju="value"in _r?_r.value:_r.textContent,$i=!0)),Ne=ba(q,Le),0<Ne.length&&(Le=new Mp(Le,r,null,u,re),oe.push({event:Le,listeners:Ne}),Me?Le.data=Me:(Me=Fp(u),Me!==null&&(Le.data=Me)))),(Me=lb?ub(r,u):cb(r,u))&&(q=ba(q,"onBeforeInput"),0<q.length&&(re=new Mp("onBeforeInput","beforeinput",null,u,re),oe.push({event:re,listeners:q}),re.data=Me))}im(oe,o)})}function es(r,o,u){return{instance:r,listener:o,currentTarget:u}}function ba(r,o){for(var u=o+"Capture",d=[];r!==null;){var g=r,x=g.stateNode;g.tag===5&&x!==null&&(g=x,x=jr(r,u),x!=null&&d.unshift(es(r,x,g)),x=jr(r,o),x!=null&&d.push(es(r,x,g))),r=r.return}return d}function Hi(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function sm(r,o,u,d,g){for(var x=o._reactName,b=[];u!==null&&u!==d;){var D=u,O=D.alternate,q=D.stateNode;if(O!==null&&O===d)break;D.tag===5&&q!==null&&(D=q,g?(O=jr(u,x),O!=null&&b.unshift(es(u,O,D))):g||(O=jr(u,x),O!=null&&b.push(es(u,O,D)))),u=u.return}b.length!==0&&r.push({event:o,listeners:b})}var Cb=/\r\n?/g,Eb=/\u0000|\uFFFD/g;function am(r){return(typeof r=="string"?r:""+r).replace(Cb,`
38
+ `).replace(Eb,"")}function Ca(r,o,u){if(o=am(o),am(r)!==o&&u)throw Error(n(425))}function Ea(){}var qu=null,Xu=null;function Yu(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 Gu=typeof setTimeout=="function"?setTimeout:void 0,Tb=typeof clearTimeout=="function"?clearTimeout:void 0,lm=typeof Promise=="function"?Promise:void 0,Pb=typeof queueMicrotask=="function"?queueMicrotask:typeof lm<"u"?function(r){return lm.resolve(null).then(r).catch(Rb)}:Gu;function Rb(r){setTimeout(function(){throw r})}function Qu(r,o){var u=o,d=0;do{var g=u.nextSibling;if(r.removeChild(u),g&&g.nodeType===8)if(u=g.data,u==="/$"){if(d===0){r.removeChild(g),Wo(o);return}d--}else u!=="$"&&u!=="$?"&&u!=="$!"||d++;u=g}while(u);Wo(o)}function Fr(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 um(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 Ki=Math.random().toString(36).slice(2),tr="__reactFiber$"+Ki,ts="__reactProps$"+Ki,yr="__reactContainer$"+Ki,Ju="__reactEvents$"+Ki,Ab="__reactListeners$"+Ki,jb="__reactHandles$"+Ki;function ci(r){var o=r[tr];if(o)return o;for(var u=r.parentNode;u;){if(o=u[yr]||u[tr]){if(u=o.alternate,o.child!==null||u!==null&&u.child!==null)for(r=um(r);r!==null;){if(u=r[tr])return u;r=um(r)}return o}r=u,u=r.parentNode}return null}function ns(r){return r=r[tr]||r[yr],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function qi(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function Ta(r){return r[ts]||null}var Zu=[],Xi=-1;function zr(r){return{current:r}}function ct(r){0>Xi||(r.current=Zu[Xi],Zu[Xi]=null,Xi--)}function lt(r,o){Xi++,Zu[Xi]=r.current,r.current=o}var Vr={},qt=zr(Vr),cn=zr(!1),fi=Vr;function Yi(r,o){var u=r.type.contextTypes;if(!u)return Vr;var d=r.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===o)return d.__reactInternalMemoizedMaskedChildContext;var g={},x;for(x in u)g[x]=o[x];return d&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=o,r.__reactInternalMemoizedMaskedChildContext=g),g}function fn(r){return r=r.childContextTypes,r!=null}function Pa(){ct(cn),ct(qt)}function cm(r,o,u){if(qt.current!==Vr)throw Error(n(168));lt(qt,o),lt(cn,u)}function fm(r,o,u){var d=r.stateNode;if(o=o.childContextTypes,typeof d.getChildContext!="function")return u;d=d.getChildContext();for(var g in d)if(!(g in o))throw Error(n(108,me(r)||"Unknown",g));return R({},u,d)}function Ra(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||Vr,fi=qt.current,lt(qt,r),lt(cn,cn.current),!0}function dm(r,o,u){var d=r.stateNode;if(!d)throw Error(n(169));u?(r=fm(r,o,fi),d.__reactInternalMemoizedMergedChildContext=r,ct(cn),ct(qt),lt(qt,r)):ct(cn),lt(cn,u)}var vr=null,Aa=!1,ec=!1;function hm(r){vr===null?vr=[r]:vr.push(r)}function Nb(r){Aa=!0,hm(r)}function Br(){if(!ec&&vr!==null){ec=!0;var r=0,o=Ze;try{var u=vr;for(Ze=1;r<u.length;r++){var d=u[r];do d=d(!0);while(d!==null)}vr=null,Aa=!1}catch(g){throw vr!==null&&(vr=vr.slice(r+1)),Oe(un,Br),g}finally{Ze=o,ec=!1}}return null}var Gi=[],Qi=0,ja=null,Na=0,Rn=[],An=0,di=null,xr=1,wr="";function hi(r,o){Gi[Qi++]=Na,Gi[Qi++]=ja,ja=r,Na=o}function pm(r,o,u){Rn[An++]=xr,Rn[An++]=wr,Rn[An++]=di,di=r;var d=xr;r=wr;var g=32-Vn(d)-1;d&=~(1<<g),u+=1;var x=32-Vn(o)+g;if(30<x){var b=g-g%5;x=(d&(1<<b)-1).toString(32),d>>=b,g-=b,xr=1<<32-Vn(o)+g|u<<g|d,wr=x+r}else xr=1<<x|u<<g|d,wr=r}function tc(r){r.return!==null&&(hi(r,1),pm(r,1,0))}function nc(r){for(;r===ja;)ja=Gi[--Qi],Gi[Qi]=null,Na=Gi[--Qi],Gi[Qi]=null;for(;r===di;)di=Rn[--An],Rn[An]=null,wr=Rn[--An],Rn[An]=null,xr=Rn[--An],Rn[An]=null}var wn=null,kn=null,dt=!1,$n=null;function mm(r,o){var u=In(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 gm(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,wn=r,kn=Fr(o.firstChild),!0):!1;case 6:return o=r.pendingProps===""||o.nodeType!==3?null:o,o!==null?(r.stateNode=o,wn=r,kn=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(u=di!==null?{id:xr,overflow:wr}:null,r.memoizedState={dehydrated:o,treeContext:u,retryLane:1073741824},u=In(18,null,null,0),u.stateNode=o,u.return=r,r.child=u,wn=r,kn=null,!0):!1;default:return!1}}function rc(r){return(r.mode&1)!==0&&(r.flags&128)===0}function ic(r){if(dt){var o=kn;if(o){var u=o;if(!gm(r,o)){if(rc(r))throw Error(n(418));o=Fr(u.nextSibling);var d=wn;o&&gm(r,o)?mm(d,u):(r.flags=r.flags&-4097|2,dt=!1,wn=r)}}else{if(rc(r))throw Error(n(418));r.flags=r.flags&-4097|2,dt=!1,wn=r}}}function ym(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;wn=r}function Ma(r){if(r!==wn)return!1;if(!dt)return ym(r),dt=!0,!1;var o;if((o=r.tag!==3)&&!(o=r.tag!==5)&&(o=r.type,o=o!=="head"&&o!=="body"&&!Yu(r.type,r.memoizedProps)),o&&(o=kn)){if(rc(r))throw vm(),Error(n(418));for(;o;)mm(r,o),o=Fr(o.nextSibling)}if(ym(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){kn=Fr(r.nextSibling);break e}o--}else u!=="$"&&u!=="$!"&&u!=="$?"||o++}r=r.nextSibling}kn=null}}else kn=wn?Fr(r.stateNode.nextSibling):null;return!0}function vm(){for(var r=kn;r;)r=Fr(r.nextSibling)}function Ji(){kn=wn=null,dt=!1}function oc(r){$n===null?$n=[r]:$n.push(r)}var Mb=L.ReactCurrentBatchConfig;function rs(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 d=u.stateNode}if(!d)throw Error(n(147,r));var g=d,x=""+r;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===x?o.ref:(o=function(b){var D=g.refs;b===null?delete D[x]:D[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 Ia(r,o){throw r=Object.prototype.toString.call(o),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r))}function xm(r){var o=r._init;return o(r._payload)}function wm(r){function o(U,z){if(r){var H=U.deletions;H===null?(U.deletions=[z],U.flags|=16):H.push(z)}}function u(U,z){if(!r)return null;for(;z!==null;)o(U,z),z=z.sibling;return null}function d(U,z){for(U=new Map;z!==null;)z.key!==null?U.set(z.key,z):U.set(z.index,z),z=z.sibling;return U}function g(U,z){return U=Yr(U,z),U.index=0,U.sibling=null,U}function x(U,z,H){return U.index=H,r?(H=U.alternate,H!==null?(H=H.index,H<z?(U.flags|=2,z):H):(U.flags|=2,z)):(U.flags|=1048576,z)}function b(U){return r&&U.alternate===null&&(U.flags|=2),U}function D(U,z,H,fe){return z===null||z.tag!==6?(z=Gc(H,U.mode,fe),z.return=U,z):(z=g(z,H),z.return=U,z)}function O(U,z,H,fe){var Ae=H.type;return Ae===K?re(U,z,H.props.children,fe,H.key):z!==null&&(z.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===ve&&xm(Ae)===z.type)?(fe=g(z,H.props),fe.ref=rs(U,z,H),fe.return=U,fe):(fe=rl(H.type,H.key,H.props,null,U.mode,fe),fe.ref=rs(U,z,H),fe.return=U,fe)}function q(U,z,H,fe){return z===null||z.tag!==4||z.stateNode.containerInfo!==H.containerInfo||z.stateNode.implementation!==H.implementation?(z=Qc(H,U.mode,fe),z.return=U,z):(z=g(z,H.children||[]),z.return=U,z)}function re(U,z,H,fe,Ae){return z===null||z.tag!==7?(z=ki(H,U.mode,fe,Ae),z.return=U,z):(z=g(z,H),z.return=U,z)}function oe(U,z,H){if(typeof z=="string"&&z!==""||typeof z=="number")return z=Gc(""+z,U.mode,H),z.return=U,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case j:return H=rl(z.type,z.key,z.props,null,U.mode,H),H.ref=rs(U,null,z),H.return=U,H;case I:return z=Qc(z,U.mode,H),z.return=U,z;case ve:var fe=z._init;return oe(U,fe(z._payload),H)}if(zt(z)||pe(z))return z=ki(z,U.mode,H,null),z.return=U,z;Ia(U,z)}return null}function te(U,z,H,fe){var Ae=z!==null?z.key:null;if(typeof H=="string"&&H!==""||typeof H=="number")return Ae!==null?null:D(U,z,""+H,fe);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case j:return H.key===Ae?O(U,z,H,fe):null;case I:return H.key===Ae?q(U,z,H,fe):null;case ve:return Ae=H._init,te(U,z,Ae(H._payload),fe)}if(zt(H)||pe(H))return Ae!==null?null:re(U,z,H,fe,null);Ia(U,H)}return null}function we(U,z,H,fe,Ae){if(typeof fe=="string"&&fe!==""||typeof fe=="number")return U=U.get(H)||null,D(z,U,""+fe,Ae);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case j:return U=U.get(fe.key===null?H:fe.key)||null,O(z,U,fe,Ae);case I:return U=U.get(fe.key===null?H:fe.key)||null,q(z,U,fe,Ae);case ve:var Ne=fe._init;return we(U,z,H,Ne(fe._payload),Ae)}if(zt(fe)||pe(fe))return U=U.get(H)||null,re(z,U,fe,Ae,null);Ia(z,fe)}return null}function Ee(U,z,H,fe){for(var Ae=null,Ne=null,Me=z,Le=z=0,_t=null;Me!==null&&Le<H.length;Le++){Me.index>Le?(_t=Me,Me=null):_t=Me.sibling;var Ge=te(U,Me,H[Le],fe);if(Ge===null){Me===null&&(Me=_t);break}r&&Me&&Ge.alternate===null&&o(U,Me),z=x(Ge,z,Le),Ne===null?Ae=Ge:Ne.sibling=Ge,Ne=Ge,Me=_t}if(Le===H.length)return u(U,Me),dt&&hi(U,Le),Ae;if(Me===null){for(;Le<H.length;Le++)Me=oe(U,H[Le],fe),Me!==null&&(z=x(Me,z,Le),Ne===null?Ae=Me:Ne.sibling=Me,Ne=Me);return dt&&hi(U,Le),Ae}for(Me=d(U,Me);Le<H.length;Le++)_t=we(Me,U,Le,H[Le],fe),_t!==null&&(r&&_t.alternate!==null&&Me.delete(_t.key===null?Le:_t.key),z=x(_t,z,Le),Ne===null?Ae=_t:Ne.sibling=_t,Ne=_t);return r&&Me.forEach(function(Gr){return o(U,Gr)}),dt&&hi(U,Le),Ae}function Pe(U,z,H,fe){var Ae=pe(H);if(typeof Ae!="function")throw Error(n(150));if(H=Ae.call(H),H==null)throw Error(n(151));for(var Ne=Ae=null,Me=z,Le=z=0,_t=null,Ge=H.next();Me!==null&&!Ge.done;Le++,Ge=H.next()){Me.index>Le?(_t=Me,Me=null):_t=Me.sibling;var Gr=te(U,Me,Ge.value,fe);if(Gr===null){Me===null&&(Me=_t);break}r&&Me&&Gr.alternate===null&&o(U,Me),z=x(Gr,z,Le),Ne===null?Ae=Gr:Ne.sibling=Gr,Ne=Gr,Me=_t}if(Ge.done)return u(U,Me),dt&&hi(U,Le),Ae;if(Me===null){for(;!Ge.done;Le++,Ge=H.next())Ge=oe(U,Ge.value,fe),Ge!==null&&(z=x(Ge,z,Le),Ne===null?Ae=Ge:Ne.sibling=Ge,Ne=Ge);return dt&&hi(U,Le),Ae}for(Me=d(U,Me);!Ge.done;Le++,Ge=H.next())Ge=we(Me,U,Le,Ge.value,fe),Ge!==null&&(r&&Ge.alternate!==null&&Me.delete(Ge.key===null?Le:Ge.key),z=x(Ge,z,Le),Ne===null?Ae=Ge:Ne.sibling=Ge,Ne=Ge);return r&&Me.forEach(function(fC){return o(U,fC)}),dt&&hi(U,Le),Ae}function St(U,z,H,fe){if(typeof H=="object"&&H!==null&&H.type===K&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case j:e:{for(var Ae=H.key,Ne=z;Ne!==null;){if(Ne.key===Ae){if(Ae=H.type,Ae===K){if(Ne.tag===7){u(U,Ne.sibling),z=g(Ne,H.props.children),z.return=U,U=z;break e}}else if(Ne.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===ve&&xm(Ae)===Ne.type){u(U,Ne.sibling),z=g(Ne,H.props),z.ref=rs(U,Ne,H),z.return=U,U=z;break e}u(U,Ne);break}else o(U,Ne);Ne=Ne.sibling}H.type===K?(z=ki(H.props.children,U.mode,fe,H.key),z.return=U,U=z):(fe=rl(H.type,H.key,H.props,null,U.mode,fe),fe.ref=rs(U,z,H),fe.return=U,U=fe)}return b(U);case I:e:{for(Ne=H.key;z!==null;){if(z.key===Ne)if(z.tag===4&&z.stateNode.containerInfo===H.containerInfo&&z.stateNode.implementation===H.implementation){u(U,z.sibling),z=g(z,H.children||[]),z.return=U,U=z;break e}else{u(U,z);break}else o(U,z);z=z.sibling}z=Qc(H,U.mode,fe),z.return=U,U=z}return b(U);case ve:return Ne=H._init,St(U,z,Ne(H._payload),fe)}if(zt(H))return Ee(U,z,H,fe);if(pe(H))return Pe(U,z,H,fe);Ia(U,H)}return typeof H=="string"&&H!==""||typeof H=="number"?(H=""+H,z!==null&&z.tag===6?(u(U,z.sibling),z=g(z,H),z.return=U,U=z):(u(U,z),z=Gc(H,U.mode,fe),z.return=U,U=z),b(U)):u(U,z)}return St}var Zi=wm(!0),km=wm(!1),Da=zr(null),La=null,eo=null,sc=null;function ac(){sc=eo=La=null}function lc(r){var o=Da.current;ct(Da),r._currentValue=o}function uc(r,o,u){for(;r!==null;){var d=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,d!==null&&(d.childLanes|=o)):d!==null&&(d.childLanes&o)!==o&&(d.childLanes|=o),r===u)break;r=r.return}}function to(r,o){La=r,sc=eo=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&o)!==0&&(dn=!0),r.firstContext=null)}function jn(r){var o=r._currentValue;if(sc!==r)if(r={context:r,memoizedValue:o,next:null},eo===null){if(La===null)throw Error(n(308));eo=r,La.dependencies={lanes:0,firstContext:r}}else eo=eo.next=r;return o}var pi=null;function cc(r){pi===null?pi=[r]:pi.push(r)}function Sm(r,o,u,d){var g=o.interleaved;return g===null?(u.next=u,cc(o)):(u.next=g.next,g.next=u),o.interleaved=u,kr(r,d)}function kr(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 $r=!1;function fc(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function bm(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 Sr(r,o){return{eventTime:r,lane:o,tag:0,payload:null,callback:null,next:null}}function Ur(r,o,u){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(Xe&2)!==0){var g=d.pending;return g===null?o.next=o:(o.next=g.next,g.next=o),d.pending=o,kr(r,u)}return g=d.interleaved,g===null?(o.next=o,cc(d)):(o.next=g.next,g.next=o),d.interleaved=o,kr(r,u)}function _a(r,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194240)!==0)){var d=o.lanes;d&=r.pendingLanes,u|=d,o.lanes=u,Eu(r,u)}}function Cm(r,o){var u=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,u===d)){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:d.baseState,firstBaseUpdate:g,lastBaseUpdate:x,shared:d.shared,effects:d.effects},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=o:r.next=o,u.lastBaseUpdate=o}function Oa(r,o,u,d){var g=r.updateQueue;$r=!1;var x=g.firstBaseUpdate,b=g.lastBaseUpdate,D=g.shared.pending;if(D!==null){g.shared.pending=null;var O=D,q=O.next;O.next=null,b===null?x=q:b.next=q,b=O;var re=r.alternate;re!==null&&(re=re.updateQueue,D=re.lastBaseUpdate,D!==b&&(D===null?re.firstBaseUpdate=q:D.next=q,re.lastBaseUpdate=O))}if(x!==null){var oe=g.baseState;b=0,re=q=O=null,D=x;do{var te=D.lane,we=D.eventTime;if((d&te)===te){re!==null&&(re=re.next={eventTime:we,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var Ee=r,Pe=D;switch(te=o,we=u,Pe.tag){case 1:if(Ee=Pe.payload,typeof Ee=="function"){oe=Ee.call(we,oe,te);break e}oe=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Pe.payload,te=typeof Ee=="function"?Ee.call(we,oe,te):Ee,te==null)break e;oe=R({},oe,te);break e;case 2:$r=!0}}D.callback!==null&&D.lane!==0&&(r.flags|=64,te=g.effects,te===null?g.effects=[D]:te.push(D))}else we={eventTime:we,lane:te,tag:D.tag,payload:D.payload,callback:D.callback,next:null},re===null?(q=re=we,O=oe):re=re.next=we,b|=te;if(D=D.next,D===null){if(D=g.shared.pending,D===null)break;te=D,D=te.next,te.next=null,g.lastBaseUpdate=te,g.shared.pending=null}}while(!0);if(re===null&&(O=oe),g.baseState=O,g.firstBaseUpdate=q,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);yi|=b,r.lanes=b,r.memoizedState=oe}}function Em(r,o,u){if(r=o.effects,o.effects=null,r!==null)for(o=0;o<r.length;o++){var d=r[o],g=d.callback;if(g!==null){if(d.callback=null,d=u,typeof g!="function")throw Error(n(191,g));g.call(d)}}}var is={},nr=zr(is),os=zr(is),ss=zr(is);function mi(r){if(r===is)throw Error(n(174));return r}function dc(r,o){switch(lt(ss,o),lt(os,r),lt(nr,is),r=o.nodeType,r){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:ee(null,"");break;default:r=r===8?o.parentNode:o,o=r.namespaceURI||null,r=r.tagName,o=ee(o,r)}ct(nr),lt(nr,o)}function no(){ct(nr),ct(os),ct(ss)}function Tm(r){mi(ss.current);var o=mi(nr.current),u=ee(o,r.type);o!==u&&(lt(os,r),lt(nr,u))}function hc(r){os.current===r&&(ct(nr),ct(os))}var mt=zr(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 pc=[];function mc(){for(var r=0;r<pc.length;r++)pc[r]._workInProgressVersionPrimary=null;pc.length=0}var za=L.ReactCurrentDispatcher,gc=L.ReactCurrentBatchConfig,gi=0,gt=null,At=null,Dt=null,Va=!1,as=!1,ls=0,Ib=0;function Xt(){throw Error(n(321))}function yc(r,o){if(o===null)return!1;for(var u=0;u<o.length&&u<r.length;u++)if(!Bn(r[u],o[u]))return!1;return!0}function vc(r,o,u,d,g,x){if(gi=x,gt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,za.current=r===null||r.memoizedState===null?Ob:Fb,r=u(d,g),as){x=0;do{if(as=!1,ls=0,25<=x)throw Error(n(301));x+=1,Dt=At=null,o.updateQueue=null,za.current=zb,r=u(d,g)}while(as)}if(za.current=Ua,o=At!==null&&At.next!==null,gi=0,Dt=At=gt=null,Va=!1,o)throw Error(n(300));return r}function xc(){var r=ls!==0;return ls=0,r}function rr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?gt.memoizedState=Dt=r:Dt=Dt.next=r,Dt}function Nn(){if(At===null){var r=gt.alternate;r=r!==null?r.memoizedState:null}else r=At.next;var o=Dt===null?gt.memoizedState:Dt.next;if(o!==null)Dt=o,At=r;else{if(r===null)throw Error(n(310));At=r,r={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},Dt===null?gt.memoizedState=Dt=r:Dt=Dt.next=r}return Dt}function us(r,o){return typeof o=="function"?o(r):o}function wc(r){var o=Nn(),u=o.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var d=At,g=d.baseQueue,x=u.pending;if(x!==null){if(g!==null){var b=g.next;g.next=x.next,x.next=b}d.baseQueue=g=x,u.pending=null}if(g!==null){x=g.next,d=d.baseState;var D=b=null,O=null,q=x;do{var re=q.lane;if((gi&re)===re)O!==null&&(O=O.next={lane:0,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),d=q.hasEagerState?q.eagerState:r(d,q.action);else{var oe={lane:re,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null};O===null?(D=O=oe,b=d):O=O.next=oe,gt.lanes|=re,yi|=re}q=q.next}while(q!==null&&q!==x);O===null?b=d:O.next=D,Bn(d,o.memoizedState)||(dn=!0),o.memoizedState=d,o.baseState=b,o.baseQueue=O,u.lastRenderedState=d}if(r=u.interleaved,r!==null){g=r;do x=g.lane,gt.lanes|=x,yi|=x,g=g.next;while(g!==r)}else g===null&&(u.lanes=0);return[o.memoizedState,u.dispatch]}function kc(r){var o=Nn(),u=o.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var d=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);Bn(x,o.memoizedState)||(dn=!0),o.memoizedState=x,o.baseQueue===null&&(o.baseState=x),u.lastRenderedState=x}return[x,d]}function Pm(){}function Rm(r,o){var u=gt,d=Nn(),g=o(),x=!Bn(d.memoizedState,g);if(x&&(d.memoizedState=g,dn=!0),d=d.queue,Sc(Nm.bind(null,u,d,r),[r]),d.getSnapshot!==o||x||Dt!==null&&Dt.memoizedState.tag&1){if(u.flags|=2048,cs(9,jm.bind(null,u,d,g,o),void 0,null),Lt===null)throw Error(n(349));(gi&30)!==0||Am(u,o,g)}return g}function Am(r,o,u){r.flags|=16384,r={getSnapshot:o,value:u},o=gt.updateQueue,o===null?(o={lastEffect:null,stores:null},gt.updateQueue=o,o.stores=[r]):(u=o.stores,u===null?o.stores=[r]:u.push(r))}function jm(r,o,u,d){o.value=u,o.getSnapshot=d,Mm(o)&&Im(r)}function Nm(r,o,u){return u(function(){Mm(o)&&Im(r)})}function Mm(r){var o=r.getSnapshot;r=r.value;try{var u=o();return!Bn(r,u)}catch{return!0}}function Im(r){var o=kr(r,1);o!==null&&Kn(o,r,1,-1)}function Dm(r){var o=rr();return typeof r=="function"&&(r=r()),o.memoizedState=o.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:r},o.queue=r,r=r.dispatch=_b.bind(null,gt,r),[o.memoizedState,r]}function cs(r,o,u,d){return r={tag:r,create:o,destroy:u,deps:d,next:null},o=gt.updateQueue,o===null?(o={lastEffect:null,stores:null},gt.updateQueue=o,o.lastEffect=r.next=r):(u=o.lastEffect,u===null?o.lastEffect=r.next=r:(d=u.next,u.next=r,r.next=d,o.lastEffect=r)),r}function Lm(){return Nn().memoizedState}function Ba(r,o,u,d){var g=rr();gt.flags|=r,g.memoizedState=cs(1|o,u,void 0,d===void 0?null:d)}function $a(r,o,u,d){var g=Nn();d=d===void 0?null:d;var x=void 0;if(At!==null){var b=At.memoizedState;if(x=b.destroy,d!==null&&yc(d,b.deps)){g.memoizedState=cs(o,u,x,d);return}}gt.flags|=r,g.memoizedState=cs(1|o,u,x,d)}function _m(r,o){return Ba(8390656,8,r,o)}function Sc(r,o){return $a(2048,8,r,o)}function Om(r,o){return $a(4,2,r,o)}function Fm(r,o){return $a(4,4,r,o)}function zm(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 Vm(r,o,u){return u=u!=null?u.concat([r]):null,$a(4,4,zm.bind(null,o,r),u)}function bc(){}function Bm(r,o){var u=Nn();o=o===void 0?null:o;var d=u.memoizedState;return d!==null&&o!==null&&yc(o,d[1])?d[0]:(u.memoizedState=[r,o],r)}function $m(r,o){var u=Nn();o=o===void 0?null:o;var d=u.memoizedState;return d!==null&&o!==null&&yc(o,d[1])?d[0]:(r=r(),u.memoizedState=[r,o],r)}function Um(r,o,u){return(gi&21)===0?(r.baseState&&(r.baseState=!1,dn=!0),r.memoizedState=u):(Bn(u,o)||(u=xp(),gt.lanes|=u,yi|=u,r.baseState=!0),o)}function Db(r,o){var u=Ze;Ze=u!==0&&4>u?u:4,r(!0);var d=gc.transition;gc.transition={};try{r(!1),o()}finally{Ze=u,gc.transition=d}}function Wm(){return Nn().memoizedState}function Lb(r,o,u){var d=qr(r);if(u={lane:d,action:u,hasEagerState:!1,eagerState:null,next:null},Hm(r))Km(o,u);else if(u=Sm(r,o,u,d),u!==null){var g=nn();Kn(u,r,d,g),qm(u,o,d)}}function _b(r,o,u){var d=qr(r),g={lane:d,action:u,hasEagerState:!1,eagerState:null,next:null};if(Hm(r))Km(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,D=x(b,u);if(g.hasEagerState=!0,g.eagerState=D,Bn(D,b)){var O=o.interleaved;O===null?(g.next=g,cc(o)):(g.next=O.next,O.next=g),o.interleaved=g;return}}catch{}finally{}u=Sm(r,o,g,d),u!==null&&(g=nn(),Kn(u,r,d,g),qm(u,o,d))}}function Hm(r){var o=r.alternate;return r===gt||o!==null&&o===gt}function Km(r,o){as=Va=!0;var u=r.pending;u===null?o.next=o:(o.next=u.next,u.next=o),r.pending=o}function qm(r,o,u){if((u&4194240)!==0){var d=o.lanes;d&=r.pendingLanes,u|=d,o.lanes=u,Eu(r,u)}}var Ua={readContext:jn,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useInsertionEffect:Xt,useLayoutEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useMutableSource:Xt,useSyncExternalStore:Xt,useId:Xt,unstable_isNewReconciler:!1},Ob={readContext:jn,useCallback:function(r,o){return rr().memoizedState=[r,o===void 0?null:o],r},useContext:jn,useEffect:_m,useImperativeHandle:function(r,o,u){return u=u!=null?u.concat([r]):null,Ba(4194308,4,zm.bind(null,o,r),u)},useLayoutEffect:function(r,o){return Ba(4194308,4,r,o)},useInsertionEffect:function(r,o){return Ba(4,2,r,o)},useMemo:function(r,o){var u=rr();return o=o===void 0?null:o,r=r(),u.memoizedState=[r,o],r},useReducer:function(r,o,u){var d=rr();return o=u!==void 0?u(o):o,d.memoizedState=d.baseState=o,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:o},d.queue=r,r=r.dispatch=Lb.bind(null,gt,r),[d.memoizedState,r]},useRef:function(r){var o=rr();return r={current:r},o.memoizedState=r},useState:Dm,useDebugValue:bc,useDeferredValue:function(r){return rr().memoizedState=r},useTransition:function(){var r=Dm(!1),o=r[0];return r=Db.bind(null,r[1]),rr().memoizedState=r,[o,r]},useMutableSource:function(){},useSyncExternalStore:function(r,o,u){var d=gt,g=rr();if(dt){if(u===void 0)throw Error(n(407));u=u()}else{if(u=o(),Lt===null)throw Error(n(349));(gi&30)!==0||Am(d,o,u)}g.memoizedState=u;var x={value:u,getSnapshot:o};return g.queue=x,_m(Nm.bind(null,d,x,r),[r]),d.flags|=2048,cs(9,jm.bind(null,d,x,u,o),void 0,null),u},useId:function(){var r=rr(),o=Lt.identifierPrefix;if(dt){var u=wr,d=xr;u=(d&~(1<<32-Vn(d)-1)).toString(32)+u,o=":"+o+"R"+u,u=ls++,0<u&&(o+="H"+u.toString(32)),o+=":"}else u=Ib++,o=":"+o+"r"+u.toString(32)+":";return r.memoizedState=o},unstable_isNewReconciler:!1},Fb={readContext:jn,useCallback:Bm,useContext:jn,useEffect:Sc,useImperativeHandle:Vm,useInsertionEffect:Om,useLayoutEffect:Fm,useMemo:$m,useReducer:wc,useRef:Lm,useState:function(){return wc(us)},useDebugValue:bc,useDeferredValue:function(r){var o=Nn();return Um(o,At.memoizedState,r)},useTransition:function(){var r=wc(us)[0],o=Nn().memoizedState;return[r,o]},useMutableSource:Pm,useSyncExternalStore:Rm,useId:Wm,unstable_isNewReconciler:!1},zb={readContext:jn,useCallback:Bm,useContext:jn,useEffect:Sc,useImperativeHandle:Vm,useInsertionEffect:Om,useLayoutEffect:Fm,useMemo:$m,useReducer:kc,useRef:Lm,useState:function(){return kc(us)},useDebugValue:bc,useDeferredValue:function(r){var o=Nn();return At===null?o.memoizedState=r:Um(o,At.memoizedState,r)},useTransition:function(){var r=kc(us)[0],o=Nn().memoizedState;return[r,o]},useMutableSource:Pm,useSyncExternalStore:Rm,useId:Wm,unstable_isNewReconciler:!1};function Un(r,o){if(r&&r.defaultProps){o=R({},o),r=r.defaultProps;for(var u in r)o[u]===void 0&&(o[u]=r[u]);return o}return o}function Cc(r,o,u,d){o=r.memoizedState,u=u(d,o),u=u==null?o:R({},o,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var Wa={isMounted:function(r){return(r=r._reactInternals)?gr(r)===r:!1},enqueueSetState:function(r,o,u){r=r._reactInternals;var d=nn(),g=qr(r),x=Sr(d,g);x.payload=o,u!=null&&(x.callback=u),o=Ur(r,x,g),o!==null&&(Kn(o,r,g,d),_a(o,r,g))},enqueueReplaceState:function(r,o,u){r=r._reactInternals;var d=nn(),g=qr(r),x=Sr(d,g);x.tag=1,x.payload=o,u!=null&&(x.callback=u),o=Ur(r,x,g),o!==null&&(Kn(o,r,g,d),_a(o,r,g))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var u=nn(),d=qr(r),g=Sr(u,d);g.tag=2,o!=null&&(g.callback=o),o=Ur(r,g,d),o!==null&&(Kn(o,r,d,u),_a(o,r,d))}};function Xm(r,o,u,d,g,x,b){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,x,b):o.prototype&&o.prototype.isPureReactComponent?!Go(u,d)||!Go(g,x):!0}function Ym(r,o,u){var d=!1,g=Vr,x=o.contextType;return typeof x=="object"&&x!==null?x=jn(x):(g=fn(o)?fi:qt.current,d=o.contextTypes,x=(d=d!=null)?Yi(r,g):Vr),o=new o(u,x),r.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Wa,r.stateNode=o,o._reactInternals=r,d&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=g,r.__reactInternalMemoizedMaskedChildContext=x),o}function Gm(r,o,u,d){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(u,d),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(u,d),o.state!==r&&Wa.enqueueReplaceState(o,o.state,null)}function Ec(r,o,u,d){var g=r.stateNode;g.props=u,g.state=r.memoizedState,g.refs={},fc(r);var x=o.contextType;typeof x=="object"&&x!==null?g.context=jn(x):(x=fn(o)?fi:qt.current,g.context=Yi(r,x)),g.state=r.memoizedState,x=o.getDerivedStateFromProps,typeof x=="function"&&(Cc(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&&Wa.enqueueReplaceState(g,g.state,null),Oa(r,u,g,d),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308)}function ro(r,o){try{var u="",d=o;do u+=ue(d),d=d.return;while(d);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 Tc(r,o,u){return{value:r,source:null,stack:u??null,digest:o??null}}function Pc(r,o){try{console.error(o.value)}catch(u){setTimeout(function(){throw u})}}var Vb=typeof WeakMap=="function"?WeakMap:Map;function Qm(r,o,u){u=Sr(-1,u),u.tag=3,u.payload={element:null};var d=o.value;return u.callback=function(){Qa||(Qa=!0,$c=d),Pc(r,o)},u}function Jm(r,o,u){u=Sr(-1,u),u.tag=3;var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var g=o.value;u.payload=function(){return d(g)},u.callback=function(){Pc(r,o)}}var x=r.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(u.callback=function(){Pc(r,o),typeof d!="function"&&(Hr===null?Hr=new Set([this]):Hr.add(this));var b=o.stack;this.componentDidCatch(o.value,{componentStack:b!==null?b:""})}),u}function Zm(r,o,u){var d=r.pingCache;if(d===null){d=r.pingCache=new Vb;var g=new Set;d.set(o,g)}else g=d.get(o),g===void 0&&(g=new Set,d.set(o,g));g.has(u)||(g.add(u),r=eC.bind(null,r,o,u),o.then(r,r))}function eg(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 tg(r,o,u,d,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=Sr(-1,1),o.tag=2,Ur(u,o,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=g,r)}var Bb=L.ReactCurrentOwner,dn=!1;function tn(r,o,u,d){o.child=r===null?km(o,null,u,d):Zi(o,r.child,u,d)}function ng(r,o,u,d,g){u=u.render;var x=o.ref;return to(o,g),d=vc(r,o,u,d,x,g),u=xc(),r!==null&&!dn?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~g,br(r,o,g)):(dt&&u&&tc(o),o.flags|=1,tn(r,o,d,g),o.child)}function rg(r,o,u,d,g){if(r===null){var x=u.type;return typeof x=="function"&&!Yc(x)&&x.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(o.tag=15,o.type=x,ig(r,o,x,d,g)):(r=rl(u.type,null,d,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:Go,u(b,d)&&r.ref===o.ref)return br(r,o,g)}return o.flags|=1,r=Yr(x,d),r.ref=o.ref,r.return=o,o.child=r}function ig(r,o,u,d,g){if(r!==null){var x=r.memoizedProps;if(Go(x,d)&&r.ref===o.ref)if(dn=!1,o.pendingProps=d=x,(r.lanes&g)!==0)(r.flags&131072)!==0&&(dn=!0);else return o.lanes=r.lanes,br(r,o,g)}return Rc(r,o,u,d,g)}function og(r,o,u){var d=o.pendingProps,g=d.children,x=r!==null?r.memoizedState:null;if(d.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},lt(oo,Sn),Sn|=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,lt(oo,Sn),Sn|=r,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=x!==null?x.baseLanes:u,lt(oo,Sn),Sn|=d}else x!==null?(d=x.baseLanes|u,o.memoizedState=null):d=u,lt(oo,Sn),Sn|=d;return tn(r,o,g,u),o.child}function sg(r,o){var u=o.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(o.flags|=512,o.flags|=2097152)}function Rc(r,o,u,d,g){var x=fn(u)?fi:qt.current;return x=Yi(o,x),to(o,g),u=vc(r,o,u,d,x,g),d=xc(),r!==null&&!dn?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~g,br(r,o,g)):(dt&&d&&tc(o),o.flags|=1,tn(r,o,u,g),o.child)}function ag(r,o,u,d,g){if(fn(u)){var x=!0;Ra(o)}else x=!1;if(to(o,g),o.stateNode===null)Ka(r,o),Ym(o,u,d),Ec(o,u,d,g),d=!0;else if(r===null){var b=o.stateNode,D=o.memoizedProps;b.props=D;var O=b.context,q=u.contextType;typeof q=="object"&&q!==null?q=jn(q):(q=fn(u)?fi:qt.current,q=Yi(o,q));var re=u.getDerivedStateFromProps,oe=typeof re=="function"||typeof b.getSnapshotBeforeUpdate=="function";oe||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(D!==d||O!==q)&&Gm(o,b,d,q),$r=!1;var te=o.memoizedState;b.state=te,Oa(o,d,b,g),O=o.memoizedState,D!==d||te!==O||cn.current||$r?(typeof re=="function"&&(Cc(o,u,re,d),O=o.memoizedState),(D=$r||Xm(o,u,D,d,te,O,q))?(oe||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=d,o.memoizedState=O),b.props=d,b.state=O,b.context=q,d=D):(typeof b.componentDidMount=="function"&&(o.flags|=4194308),d=!1)}else{b=o.stateNode,bm(r,o),D=o.memoizedProps,q=o.type===o.elementType?D:Un(o.type,D),b.props=q,oe=o.pendingProps,te=b.context,O=u.contextType,typeof O=="object"&&O!==null?O=jn(O):(O=fn(u)?fi:qt.current,O=Yi(o,O));var we=u.getDerivedStateFromProps;(re=typeof we=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(D!==oe||te!==O)&&Gm(o,b,d,O),$r=!1,te=o.memoizedState,b.state=te,Oa(o,d,b,g);var Ee=o.memoizedState;D!==oe||te!==Ee||cn.current||$r?(typeof we=="function"&&(Cc(o,u,we,d),Ee=o.memoizedState),(q=$r||Xm(o,u,q,d,te,Ee,O)||!1)?(re||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(d,Ee,O),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(d,Ee,O)),typeof b.componentDidUpdate=="function"&&(o.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof b.componentDidUpdate!="function"||D===r.memoizedProps&&te===r.memoizedState||(o.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||D===r.memoizedProps&&te===r.memoizedState||(o.flags|=1024),o.memoizedProps=d,o.memoizedState=Ee),b.props=d,b.state=Ee,b.context=O,d=q):(typeof b.componentDidUpdate!="function"||D===r.memoizedProps&&te===r.memoizedState||(o.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||D===r.memoizedProps&&te===r.memoizedState||(o.flags|=1024),d=!1)}return Ac(r,o,u,d,x,g)}function Ac(r,o,u,d,g,x){sg(r,o);var b=(o.flags&128)!==0;if(!d&&!b)return g&&dm(o,u,!1),br(r,o,x);d=o.stateNode,Bb.current=o;var D=b&&typeof u.getDerivedStateFromError!="function"?null:d.render();return o.flags|=1,r!==null&&b?(o.child=Zi(o,r.child,null,x),o.child=Zi(o,null,D,x)):tn(r,o,D,x),o.memoizedState=d.state,g&&dm(o,u,!0),o.child}function lg(r){var o=r.stateNode;o.pendingContext?cm(r,o.pendingContext,o.pendingContext!==o.context):o.context&&cm(r,o.context,!1),dc(r,o.containerInfo)}function ug(r,o,u,d,g){return Ji(),oc(g),o.flags|=256,tn(r,o,u,d),o.child}var jc={dehydrated:null,treeContext:null,retryLane:0};function Nc(r){return{baseLanes:r,cachePool:null,transitions:null}}function cg(r,o,u){var d=o.pendingProps,g=mt.current,x=!1,b=(o.flags&128)!==0,D;if((D=b)||(D=r!==null&&r.memoizedState===null?!1:(g&2)!==0),D?(x=!0,o.flags&=-129):(r===null||r.memoizedState!==null)&&(g|=1),lt(mt,g&1),r===null)return ic(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=d.children,r=d.fallback,x?(d=o.mode,x=o.child,b={mode:"hidden",children:b},(d&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=b):x=il(b,d,0,null),r=ki(r,d,u,null),x.return=o,r.return=o,x.sibling=r,o.child=x,o.child.memoizedState=Nc(u),o.memoizedState=jc,r):Mc(o,b));if(g=r.memoizedState,g!==null&&(D=g.dehydrated,D!==null))return $b(r,o,b,d,D,g,u);if(x){x=d.fallback,b=o.mode,g=r.child,D=g.sibling;var O={mode:"hidden",children:d.children};return(b&1)===0&&o.child!==g?(d=o.child,d.childLanes=0,d.pendingProps=O,o.deletions=null):(d=Yr(g,O),d.subtreeFlags=g.subtreeFlags&14680064),D!==null?x=Yr(D,x):(x=ki(x,b,u,null),x.flags|=2),x.return=o,d.return=o,d.sibling=x,o.child=d,d=x,x=o.child,b=r.child.memoizedState,b=b===null?Nc(u):{baseLanes:b.baseLanes|u,cachePool:null,transitions:b.transitions},x.memoizedState=b,x.childLanes=r.childLanes&~u,o.memoizedState=jc,d}return x=r.child,r=x.sibling,d=Yr(x,{mode:"visible",children:d.children}),(o.mode&1)===0&&(d.lanes=u),d.return=o,d.sibling=null,r!==null&&(u=o.deletions,u===null?(o.deletions=[r],o.flags|=16):u.push(r)),o.child=d,o.memoizedState=null,d}function Mc(r,o){return o=il({mode:"visible",children:o},r.mode,0,null),o.return=r,r.child=o}function Ha(r,o,u,d){return d!==null&&oc(d),Zi(o,r.child,null,u),r=Mc(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function $b(r,o,u,d,g,x,b){if(u)return o.flags&256?(o.flags&=-257,d=Tc(Error(n(422))),Ha(r,o,b,d)):o.memoizedState!==null?(o.child=r.child,o.flags|=128,null):(x=d.fallback,g=o.mode,d=il({mode:"visible",children:d.children},g,0,null),x=ki(x,g,b,null),x.flags|=2,d.return=o,x.return=o,d.sibling=x,o.child=d,(o.mode&1)!==0&&Zi(o,r.child,null,b),o.child.memoizedState=Nc(b),o.memoizedState=jc,x);if((o.mode&1)===0)return Ha(r,o,b,null);if(g.data==="$!"){if(d=g.nextSibling&&g.nextSibling.dataset,d)var D=d.dgst;return d=D,x=Error(n(419)),d=Tc(x,d,void 0),Ha(r,o,b,d)}if(D=(b&r.childLanes)!==0,dn||D){if(d=Lt,d!==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&(d.suspendedLanes|b))!==0?0:g,g!==0&&g!==x.retryLane&&(x.retryLane=g,kr(r,g),Kn(d,r,g,-1))}return Xc(),d=Tc(Error(n(421))),Ha(r,o,b,d)}return g.data==="$?"?(o.flags|=128,o.child=r.child,o=tC.bind(null,r),g._reactRetry=o,null):(r=x.treeContext,kn=Fr(g.nextSibling),wn=o,dt=!0,$n=null,r!==null&&(Rn[An++]=xr,Rn[An++]=wr,Rn[An++]=di,xr=r.id,wr=r.overflow,di=o),o=Mc(o,d.children),o.flags|=4096,o)}function fg(r,o,u){r.lanes|=o;var d=r.alternate;d!==null&&(d.lanes|=o),uc(r.return,o,u)}function Ic(r,o,u,d,g){var x=r.memoizedState;x===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:d,tail:u,tailMode:g}:(x.isBackwards=o,x.rendering=null,x.renderingStartTime=0,x.last=d,x.tail=u,x.tailMode=g)}function dg(r,o,u){var d=o.pendingProps,g=d.revealOrder,x=d.tail;if(tn(r,o,d.children,u),d=mt.current,(d&2)!==0)d=d&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&&fg(r,u,o);else if(r.tag===19)fg(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}d&=1}if(lt(mt,d),(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),Ic(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}Ic(o,!0,u,null,x);break;case"together":Ic(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function Ka(r,o){(o.mode&1)===0&&r!==null&&(r.alternate=null,o.alternate=null,o.flags|=2)}function br(r,o,u){if(r!==null&&(o.dependencies=r.dependencies),yi|=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=Yr(r,r.pendingProps),o.child=u,u.return=o;r.sibling!==null;)r=r.sibling,u=u.sibling=Yr(r,r.pendingProps),u.return=o;u.sibling=null}return o.child}function Ub(r,o,u){switch(o.tag){case 3:lg(o),Ji();break;case 5:Tm(o);break;case 1:fn(o.type)&&Ra(o);break;case 4:dc(o,o.stateNode.containerInfo);break;case 10:var d=o.type._context,g=o.memoizedProps.value;lt(Da,d._currentValue),d._currentValue=g;break;case 13:if(d=o.memoizedState,d!==null)return d.dehydrated!==null?(lt(mt,mt.current&1),o.flags|=128,null):(u&o.child.childLanes)!==0?cg(r,o,u):(lt(mt,mt.current&1),r=br(r,o,u),r!==null?r.sibling:null);lt(mt,mt.current&1);break;case 19:if(d=(u&o.childLanes)!==0,(r.flags&128)!==0){if(d)return dg(r,o,u);o.flags|=128}if(g=o.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),lt(mt,mt.current),d)break;return null;case 22:case 23:return o.lanes=0,og(r,o,u)}return br(r,o,u)}var hg,Dc,pg,mg;hg=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}},Dc=function(){},pg=function(r,o,u,d){var g=r.memoizedProps;if(g!==d){r=o.stateNode,mi(nr.current);var x=null;switch(u){case"input":g=st(r,g),d=st(r,d),x=[];break;case"select":g=R({},g,{value:void 0}),d=R({},d,{value:void 0}),x=[];break;case"textarea":g=bt(r,g),d=bt(r,d),x=[];break;default:typeof g.onClick!="function"&&typeof d.onClick=="function"&&(r.onclick=Ea)}ye(u,d);var b;u=null;for(q in g)if(!d.hasOwnProperty(q)&&g.hasOwnProperty(q)&&g[q]!=null)if(q==="style"){var D=g[q];for(b in D)D.hasOwnProperty(b)&&(u||(u={}),u[b]="")}else q!=="dangerouslySetInnerHTML"&&q!=="children"&&q!=="suppressContentEditableWarning"&&q!=="suppressHydrationWarning"&&q!=="autoFocus"&&(s.hasOwnProperty(q)?x||(x=[]):(x=x||[]).push(q,null));for(q in d){var O=d[q];if(D=g?.[q],d.hasOwnProperty(q)&&O!==D&&(O!=null||D!=null))if(q==="style")if(D){for(b in D)!D.hasOwnProperty(b)||O&&O.hasOwnProperty(b)||(u||(u={}),u[b]="");for(b in O)O.hasOwnProperty(b)&&D[b]!==O[b]&&(u||(u={}),u[b]=O[b])}else u||(x||(x=[]),x.push(q,u)),u=O;else q==="dangerouslySetInnerHTML"?(O=O?O.__html:void 0,D=D?D.__html:void 0,O!=null&&D!==O&&(x=x||[]).push(q,O)):q==="children"?typeof O!="string"&&typeof O!="number"||(x=x||[]).push(q,""+O):q!=="suppressContentEditableWarning"&&q!=="suppressHydrationWarning"&&(s.hasOwnProperty(q)?(O!=null&&q==="onScroll"&&ut("scroll",r),x||D===O||(x=[])):(x=x||[]).push(q,O))}u&&(x=x||[]).push("style",u);var q=x;(o.updateQueue=q)&&(o.flags|=4)}},mg=function(r,o,u,d){u!==d&&(o.flags|=4)};function fs(r,o){if(!dt)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 d=null;u!==null;)u.alternate!==null&&(d=u),u=u.sibling;d===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function Yt(r){var o=r.alternate!==null&&r.alternate.child===r.child,u=0,d=0;if(o)for(var g=r.child;g!==null;)u|=g.lanes|g.childLanes,d|=g.subtreeFlags&14680064,d|=g.flags&14680064,g.return=r,g=g.sibling;else for(g=r.child;g!==null;)u|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=r,g=g.sibling;return r.subtreeFlags|=d,r.childLanes=u,o}function Wb(r,o,u){var d=o.pendingProps;switch(nc(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yt(o),null;case 1:return fn(o.type)&&Pa(),Yt(o),null;case 3:return d=o.stateNode,no(),ct(cn),ct(qt),mc(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(r===null||r.child===null)&&(Ma(o)?o.flags|=4:r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,$n!==null&&(Hc($n),$n=null))),Dc(r,o),Yt(o),null;case 5:hc(o);var g=mi(ss.current);if(u=o.type,r!==null&&o.stateNode!=null)pg(r,o,u,d,g),r.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!d){if(o.stateNode===null)throw Error(n(166));return Yt(o),null}if(r=mi(nr.current),Ma(o)){d=o.stateNode,u=o.type;var x=o.memoizedProps;switch(d[tr]=o,d[ts]=x,r=(o.mode&1)!==0,u){case"dialog":ut("cancel",d),ut("close",d);break;case"iframe":case"object":case"embed":ut("load",d);break;case"video":case"audio":for(g=0;g<Jo.length;g++)ut(Jo[g],d);break;case"source":ut("error",d);break;case"img":case"image":case"link":ut("error",d),ut("load",d);break;case"details":ut("toggle",d);break;case"input":Ft(d,x),ut("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!x.multiple},ut("invalid",d);break;case"textarea":Jn(d,x),ut("invalid",d)}ye(u,x),g=null;for(var b in x)if(x.hasOwnProperty(b)){var D=x[b];b==="children"?typeof D=="string"?d.textContent!==D&&(x.suppressHydrationWarning!==!0&&Ca(d.textContent,D,r),g=["children",D]):typeof D=="number"&&d.textContent!==""+D&&(x.suppressHydrationWarning!==!0&&Ca(d.textContent,D,r),g=["children",""+D]):s.hasOwnProperty(b)&&D!=null&&b==="onScroll"&&ut("scroll",d)}switch(u){case"input":Fe(d),Wt(d,x,!0);break;case"textarea":Fe(d),Ar(d);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(d.onclick=Ea)}d=g,o.updateQueue=d,d!==null&&(o.flags|=4)}else{b=g.nodeType===9?g:g.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=G(u)),r==="http://www.w3.org/1999/xhtml"?u==="script"?(r=b.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof d.is=="string"?r=b.createElement(u,{is:d.is}):(r=b.createElement(u),u==="select"&&(b=r,d.multiple?b.multiple=!0:d.size&&(b.size=d.size))):r=b.createElementNS(r,u),r[tr]=o,r[ts]=d,hg(r,o,!1,!1),o.stateNode=r;e:{switch(b=De(u,d),u){case"dialog":ut("cancel",r),ut("close",r),g=d;break;case"iframe":case"object":case"embed":ut("load",r),g=d;break;case"video":case"audio":for(g=0;g<Jo.length;g++)ut(Jo[g],r);g=d;break;case"source":ut("error",r),g=d;break;case"img":case"image":case"link":ut("error",r),ut("load",r),g=d;break;case"details":ut("toggle",r),g=d;break;case"input":Ft(r,d),g=st(r,d),ut("invalid",r);break;case"option":g=d;break;case"select":r._wrapperState={wasMultiple:!!d.multiple},g=R({},d,{value:void 0}),ut("invalid",r);break;case"textarea":Jn(r,d),g=bt(r,d),ut("invalid",r);break;default:g=d}ye(u,g),D=g;for(x in D)if(D.hasOwnProperty(x)){var O=D[x];x==="style"?ge(r,O):x==="dangerouslySetInnerHTML"?(O=O?O.__html:void 0,O!=null&&je(r,O)):x==="children"?typeof O=="string"?(u!=="textarea"||O!=="")&&ze(r,O):typeof O=="number"&&ze(r,""+O):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(s.hasOwnProperty(x)?O!=null&&x==="onScroll"&&ut("scroll",r):O!=null&&T(r,x,O,b))}switch(u){case"input":Fe(r),Wt(r,d,!1);break;case"textarea":Fe(r),Ar(r);break;case"option":d.value!=null&&r.setAttribute("value",""+Se(d.value));break;case"select":r.multiple=!!d.multiple,x=d.value,x!=null?en(r,!!d.multiple,x,!1):d.defaultValue!=null&&en(r,!!d.multiple,d.defaultValue,!0);break;default:typeof g.onClick=="function"&&(r.onclick=Ea)}switch(u){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}}d&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return Yt(o),null;case 6:if(r&&o.stateNode!=null)mg(r,o,r.memoizedProps,d);else{if(typeof d!="string"&&o.stateNode===null)throw Error(n(166));if(u=mi(ss.current),mi(nr.current),Ma(o)){if(d=o.stateNode,u=o.memoizedProps,d[tr]=o,(x=d.nodeValue!==u)&&(r=wn,r!==null))switch(r.tag){case 3:Ca(d.nodeValue,u,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&Ca(d.nodeValue,u,(r.mode&1)!==0)}x&&(o.flags|=4)}else d=(u.nodeType===9?u:u.ownerDocument).createTextNode(d),d[tr]=o,o.stateNode=d}return Yt(o),null;case 13:if(ct(mt),d=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(dt&&kn!==null&&(o.mode&1)!==0&&(o.flags&128)===0)vm(),Ji(),o.flags|=98560,x=!1;else if(x=Ma(o),d!==null&&d.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[tr]=o}else Ji(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Yt(o),x=!1}else $n!==null&&(Hc($n),$n=null),x=!0;if(!x)return o.flags&65536?o:null}return(o.flags&128)!==0?(o.lanes=u,o):(d=d!==null,d!==(r!==null&&r.memoizedState!==null)&&d&&(o.child.flags|=8192,(o.mode&1)!==0&&(r===null||(mt.current&1)!==0?jt===0&&(jt=3):Xc())),o.updateQueue!==null&&(o.flags|=4),Yt(o),null);case 4:return no(),Dc(r,o),r===null&&Zo(o.stateNode.containerInfo),Yt(o),null;case 10:return lc(o.type._context),Yt(o),null;case 17:return fn(o.type)&&Pa(),Yt(o),null;case 19:if(ct(mt),x=o.memoizedState,x===null)return Yt(o),null;if(d=(o.flags&128)!==0,b=x.rendering,b===null)if(d)fs(x,!1);else{if(jt!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(b=Fa(r),b!==null){for(o.flags|=128,fs(x,!1),d=b.updateQueue,d!==null&&(o.updateQueue=d,o.flags|=4),o.subtreeFlags=0,d=u,u=o.child;u!==null;)x=u,r=d,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 lt(mt,mt.current&1|2),o.child}r=r.sibling}x.tail!==null&&Qe()>so&&(o.flags|=128,d=!0,fs(x,!1),o.lanes=4194304)}else{if(!d)if(r=Fa(b),r!==null){if(o.flags|=128,d=!0,u=r.updateQueue,u!==null&&(o.updateQueue=u,o.flags|=4),fs(x,!0),x.tail===null&&x.tailMode==="hidden"&&!b.alternate&&!dt)return Yt(o),null}else 2*Qe()-x.renderingStartTime>so&&u!==1073741824&&(o.flags|=128,d=!0,fs(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=Qe(),o.sibling=null,u=mt.current,lt(mt,d?u&1|2:u&1),o):(Yt(o),null);case 22:case 23:return qc(),d=o.memoizedState!==null,r!==null&&r.memoizedState!==null!==d&&(o.flags|=8192),d&&(o.mode&1)!==0?(Sn&1073741824)!==0&&(Yt(o),o.subtreeFlags&6&&(o.flags|=8192)):Yt(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function Hb(r,o){switch(nc(o),o.tag){case 1:return fn(o.type)&&Pa(),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return no(),ct(cn),ct(qt),mc(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 5:return hc(o),null;case 13:if(ct(mt),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(n(340));Ji()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return ct(mt),null;case 4:return no(),null;case 10:return lc(o.type._context),null;case 22:case 23:return qc(),null;case 24:return null;default:return null}}var qa=!1,Gt=!1,Kb=typeof WeakSet=="function"?WeakSet:Set,Ce=null;function io(r,o){var u=r.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(d){vt(r,o,d)}else u.current=null}function Lc(r,o,u){try{u()}catch(d){vt(r,o,d)}}var gg=!1;function qb(r,o){if(qu=ha,r=Xp(),zu(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var d=u.getSelection&&u.getSelection();if(d&&d.rangeCount!==0){u=d.anchorNode;var g=d.anchorOffset,x=d.focusNode;d=d.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var b=0,D=-1,O=-1,q=0,re=0,oe=r,te=null;t:for(;;){for(var we;oe!==u||g!==0&&oe.nodeType!==3||(D=b+g),oe!==x||d!==0&&oe.nodeType!==3||(O=b+d),oe.nodeType===3&&(b+=oe.nodeValue.length),(we=oe.firstChild)!==null;)te=oe,oe=we;for(;;){if(oe===r)break t;if(te===u&&++q===g&&(D=b),te===x&&++re===d&&(O=b),(we=oe.nextSibling)!==null)break;oe=te,te=oe.parentNode}oe=we}u=D===-1||O===-1?null:{start:D,end:O}}else u=null}u=u||{start:0,end:0}}else u=null;for(Xu={focusedElem:r,selectionRange:u},ha=!1,Ce=o;Ce!==null;)if(o=Ce,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,Ce=r;else for(;Ce!==null;){o=Ce;try{var Ee=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(Ee!==null){var Pe=Ee.memoizedProps,St=Ee.memoizedState,U=o.stateNode,z=U.getSnapshotBeforeUpdate(o.elementType===o.type?Pe:Un(o.type,Pe),St);U.__reactInternalSnapshotBeforeUpdate=z}break;case 3:var H=o.stateNode.containerInfo;H.nodeType===1?H.textContent="":H.nodeType===9&&H.documentElement&&H.removeChild(H.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(fe){vt(o,o.return,fe)}if(r=o.sibling,r!==null){r.return=o.return,Ce=r;break}Ce=o.return}return Ee=gg,gg=!1,Ee}function ds(r,o,u){var d=o.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var g=d=d.next;do{if((g.tag&r)===r){var x=g.destroy;g.destroy=void 0,x!==void 0&&Lc(o,u,x)}g=g.next}while(g!==d)}}function Xa(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 d=u.create;u.destroy=d()}u=u.next}while(u!==o)}}function _c(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 yg(r){var o=r.alternate;o!==null&&(r.alternate=null,yg(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&(delete o[tr],delete o[ts],delete o[Ju],delete o[Ab],delete o[jb])),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 vg(r){return r.tag===5||r.tag===3||r.tag===4}function xg(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||vg(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 Oc(r,o,u){var d=r.tag;if(d===5||d===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=Ea));else if(d!==4&&(r=r.child,r!==null))for(Oc(r,o,u),r=r.sibling;r!==null;)Oc(r,o,u),r=r.sibling}function Fc(r,o,u){var d=r.tag;if(d===5||d===6)r=r.stateNode,o?u.insertBefore(r,o):u.appendChild(r);else if(d!==4&&(r=r.child,r!==null))for(Fc(r,o,u),r=r.sibling;r!==null;)Fc(r,o,u),r=r.sibling}var Vt=null,Wn=!1;function Wr(r,o,u){for(u=u.child;u!==null;)wg(r,o,u),u=u.sibling}function wg(r,o,u){if(er&&typeof er.onCommitFiberUnmount=="function")try{er.onCommitFiberUnmount(aa,u)}catch{}switch(u.tag){case 5:Gt||io(u,o);case 6:var d=Vt,g=Wn;Vt=null,Wr(r,o,u),Vt=d,Wn=g,Vt!==null&&(Wn?(r=Vt,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):Vt.removeChild(u.stateNode));break;case 18:Vt!==null&&(Wn?(r=Vt,u=u.stateNode,r.nodeType===8?Qu(r.parentNode,u):r.nodeType===1&&Qu(r,u),Wo(r)):Qu(Vt,u.stateNode));break;case 4:d=Vt,g=Wn,Vt=u.stateNode.containerInfo,Wn=!0,Wr(r,o,u),Vt=d,Wn=g;break;case 0:case 11:case 14:case 15:if(!Gt&&(d=u.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){g=d=d.next;do{var x=g,b=x.destroy;x=x.tag,b!==void 0&&((x&2)!==0||(x&4)!==0)&&Lc(u,o,b),g=g.next}while(g!==d)}Wr(r,o,u);break;case 1:if(!Gt&&(io(u,o),d=u.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=u.memoizedProps,d.state=u.memoizedState,d.componentWillUnmount()}catch(D){vt(u,o,D)}Wr(r,o,u);break;case 21:Wr(r,o,u);break;case 22:u.mode&1?(Gt=(d=Gt)||u.memoizedState!==null,Wr(r,o,u),Gt=d):Wr(r,o,u);break;default:Wr(r,o,u)}}function kg(r){var o=r.updateQueue;if(o!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new Kb),o.forEach(function(d){var g=nC.bind(null,r,d);u.has(d)||(u.add(d),d.then(g,g))})}}function Hn(r,o){var u=o.deletions;if(u!==null)for(var d=0;d<u.length;d++){var g=u[d];try{var x=r,b=o,D=b;e:for(;D!==null;){switch(D.tag){case 5:Vt=D.stateNode,Wn=!1;break e;case 3:Vt=D.stateNode.containerInfo,Wn=!0;break e;case 4:Vt=D.stateNode.containerInfo,Wn=!0;break e}D=D.return}if(Vt===null)throw Error(n(160));wg(x,b,g),Vt=null,Wn=!1;var O=g.alternate;O!==null&&(O.return=null),g.return=null}catch(q){vt(g,o,q)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)Sg(o,r),o=o.sibling}function Sg(r,o){var u=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(Hn(o,r),ir(r),d&4){try{ds(3,r,r.return),Xa(3,r)}catch(Pe){vt(r,r.return,Pe)}try{ds(5,r,r.return)}catch(Pe){vt(r,r.return,Pe)}}break;case 1:Hn(o,r),ir(r),d&512&&u!==null&&io(u,u.return);break;case 5:if(Hn(o,r),ir(r),d&512&&u!==null&&io(u,u.return),r.flags&32){var g=r.stateNode;try{ze(g,"")}catch(Pe){vt(r,r.return,Pe)}}if(d&4&&(g=r.stateNode,g!=null)){var x=r.memoizedProps,b=u!==null?u.memoizedProps:x,D=r.type,O=r.updateQueue;if(r.updateQueue=null,O!==null)try{D==="input"&&x.type==="radio"&&x.name!=null&&Zt(g,x),De(D,b);var q=De(D,x);for(b=0;b<O.length;b+=2){var re=O[b],oe=O[b+1];re==="style"?ge(g,oe):re==="dangerouslySetInnerHTML"?je(g,oe):re==="children"?ze(g,oe):T(g,re,oe,q)}switch(D){case"input":et(g,x);break;case"textarea":We(g,x);break;case"select":var te=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!x.multiple;var we=x.value;we!=null?en(g,!!x.multiple,we,!1):te!==!!x.multiple&&(x.defaultValue!=null?en(g,!!x.multiple,x.defaultValue,!0):en(g,!!x.multiple,x.multiple?[]:"",!1))}g[ts]=x}catch(Pe){vt(r,r.return,Pe)}}break;case 6:if(Hn(o,r),ir(r),d&4){if(r.stateNode===null)throw Error(n(162));g=r.stateNode,x=r.memoizedProps;try{g.nodeValue=x}catch(Pe){vt(r,r.return,Pe)}}break;case 3:if(Hn(o,r),ir(r),d&4&&u!==null&&u.memoizedState.isDehydrated)try{Wo(o.containerInfo)}catch(Pe){vt(r,r.return,Pe)}break;case 4:Hn(o,r),ir(r);break;case 13:Hn(o,r),ir(r),g=r.child,g.flags&8192&&(x=g.memoizedState!==null,g.stateNode.isHidden=x,!x||g.alternate!==null&&g.alternate.memoizedState!==null||(Bc=Qe())),d&4&&kg(r);break;case 22:if(re=u!==null&&u.memoizedState!==null,r.mode&1?(Gt=(q=Gt)||re,Hn(o,r),Gt=q):Hn(o,r),ir(r),d&8192){if(q=r.memoizedState!==null,(r.stateNode.isHidden=q)&&!re&&(r.mode&1)!==0)for(Ce=r,re=r.child;re!==null;){for(oe=Ce=re;Ce!==null;){switch(te=Ce,we=te.child,te.tag){case 0:case 11:case 14:case 15:ds(4,te,te.return);break;case 1:io(te,te.return);var Ee=te.stateNode;if(typeof Ee.componentWillUnmount=="function"){d=te,u=te.return;try{o=d,Ee.props=o.memoizedProps,Ee.state=o.memoizedState,Ee.componentWillUnmount()}catch(Pe){vt(d,u,Pe)}}break;case 5:io(te,te.return);break;case 22:if(te.memoizedState!==null){Eg(oe);continue}}we!==null?(we.return=te,Ce=we):Eg(oe)}re=re.sibling}e:for(re=null,oe=r;;){if(oe.tag===5){if(re===null){re=oe;try{g=oe.stateNode,q?(x=g.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(D=oe.stateNode,O=oe.memoizedProps.style,b=O!=null&&O.hasOwnProperty("display")?O.display:null,D.style.display=W("display",b))}catch(Pe){vt(r,r.return,Pe)}}}else if(oe.tag===6){if(re===null)try{oe.stateNode.nodeValue=q?"":oe.memoizedProps}catch(Pe){vt(r,r.return,Pe)}}else if((oe.tag!==22&&oe.tag!==23||oe.memoizedState===null||oe===r)&&oe.child!==null){oe.child.return=oe,oe=oe.child;continue}if(oe===r)break e;for(;oe.sibling===null;){if(oe.return===null||oe.return===r)break e;re===oe&&(re=null),oe=oe.return}re===oe&&(re=null),oe.sibling.return=oe.return,oe=oe.sibling}}break;case 19:Hn(o,r),ir(r),d&4&&kg(r);break;case 21:break;default:Hn(o,r),ir(r)}}function ir(r){var o=r.flags;if(o&2){try{e:{for(var u=r.return;u!==null;){if(vg(u)){var d=u;break e}u=u.return}throw Error(n(160))}switch(d.tag){case 5:var g=d.stateNode;d.flags&32&&(ze(g,""),d.flags&=-33);var x=xg(r);Fc(r,x,g);break;case 3:case 4:var b=d.stateNode.containerInfo,D=xg(r);Oc(r,D,b);break;default:throw Error(n(161))}}catch(O){vt(r,r.return,O)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function Xb(r,o,u){Ce=r,bg(r)}function bg(r,o,u){for(var d=(r.mode&1)!==0;Ce!==null;){var g=Ce,x=g.child;if(g.tag===22&&d){var b=g.memoizedState!==null||qa;if(!b){var D=g.alternate,O=D!==null&&D.memoizedState!==null||Gt;D=qa;var q=Gt;if(qa=b,(Gt=O)&&!q)for(Ce=g;Ce!==null;)b=Ce,O=b.child,b.tag===22&&b.memoizedState!==null?Tg(g):O!==null?(O.return=b,Ce=O):Tg(g);for(;x!==null;)Ce=x,bg(x),x=x.sibling;Ce=g,qa=D,Gt=q}Cg(r)}else(g.subtreeFlags&8772)!==0&&x!==null?(x.return=g,Ce=x):Cg(r)}}function Cg(r){for(;Ce!==null;){var o=Ce;if((o.flags&8772)!==0){var u=o.alternate;try{if((o.flags&8772)!==0)switch(o.tag){case 0:case 11:case 15:Gt||Xa(5,o);break;case 1:var d=o.stateNode;if(o.flags&4&&!Gt)if(u===null)d.componentDidMount();else{var g=o.elementType===o.type?u.memoizedProps:Un(o.type,u.memoizedProps);d.componentDidUpdate(g,u.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var x=o.updateQueue;x!==null&&Em(o,x,d);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}Em(o,b,u)}break;case 5:var D=o.stateNode;if(u===null&&o.flags&4){u=D;var O=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":O.autoFocus&&u.focus();break;case"img":O.src&&(u.src=O.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var q=o.alternate;if(q!==null){var re=q.memoizedState;if(re!==null){var oe=re.dehydrated;oe!==null&&Wo(oe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Gt||o.flags&512&&_c(o)}catch(te){vt(o,o.return,te)}}if(o===r){Ce=null;break}if(u=o.sibling,u!==null){u.return=o.return,Ce=u;break}Ce=o.return}}function Eg(r){for(;Ce!==null;){var o=Ce;if(o===r){Ce=null;break}var u=o.sibling;if(u!==null){u.return=o.return,Ce=u;break}Ce=o.return}}function Tg(r){for(;Ce!==null;){var o=Ce;try{switch(o.tag){case 0:case 11:case 15:var u=o.return;try{Xa(4,o)}catch(O){vt(o,u,O)}break;case 1:var d=o.stateNode;if(typeof d.componentDidMount=="function"){var g=o.return;try{d.componentDidMount()}catch(O){vt(o,g,O)}}var x=o.return;try{_c(o)}catch(O){vt(o,x,O)}break;case 5:var b=o.return;try{_c(o)}catch(O){vt(o,b,O)}}}catch(O){vt(o,o.return,O)}if(o===r){Ce=null;break}var D=o.sibling;if(D!==null){D.return=o.return,Ce=D;break}Ce=o.return}}var Yb=Math.ceil,Ya=L.ReactCurrentDispatcher,zc=L.ReactCurrentOwner,Mn=L.ReactCurrentBatchConfig,Xe=0,Lt=null,Ct=null,Bt=0,Sn=0,oo=zr(0),jt=0,hs=null,yi=0,Ga=0,Vc=0,ps=null,hn=null,Bc=0,so=1/0,Cr=null,Qa=!1,$c=null,Hr=null,Ja=!1,Kr=null,Za=0,ms=0,Uc=null,el=-1,tl=0;function nn(){return(Xe&6)!==0?Qe():el!==-1?el:el=Qe()}function qr(r){return(r.mode&1)===0?1:(Xe&2)!==0&&Bt!==0?Bt&-Bt:Mb.transition!==null?(tl===0&&(tl=xp()),tl):(r=Ze,r!==0||(r=window.event,r=r===void 0?16:Rp(r.type)),r)}function Kn(r,o,u,d){if(50<ms)throw ms=0,Uc=null,Error(n(185));zo(r,u,d),((Xe&2)===0||r!==Lt)&&(r===Lt&&((Xe&2)===0&&(Ga|=u),jt===4&&Xr(r,Bt)),pn(r,d),u===1&&Xe===0&&(o.mode&1)===0&&(so=Qe()+500,Aa&&Br()))}function pn(r,o){var u=r.callbackNode;MS(r,o);var d=ca(r,r===Lt?Bt:0);if(d===0)u!==null&&pt(u),r.callbackNode=null,r.callbackPriority=0;else if(o=d&-d,r.callbackPriority!==o){if(u!=null&&pt(u),o===1)r.tag===0?Nb(Rg.bind(null,r)):hm(Rg.bind(null,r)),Pb(function(){(Xe&6)===0&&Br()}),u=null;else{switch(wp(d)){case 1:u=un;break;case 4:u=kt;break;case 16:u=zn;break;case 536870912:u=vp;break;default:u=zn}u=_g(u,Pg.bind(null,r))}r.callbackPriority=o,r.callbackNode=u}}function Pg(r,o){if(el=-1,tl=0,(Xe&6)!==0)throw Error(n(327));var u=r.callbackNode;if(ao()&&r.callbackNode!==u)return null;var d=ca(r,r===Lt?Bt:0);if(d===0)return null;if((d&30)!==0||(d&r.expiredLanes)!==0||o)o=nl(r,d);else{o=d;var g=Xe;Xe|=2;var x=jg();(Lt!==r||Bt!==o)&&(Cr=null,so=Qe()+500,xi(r,o));do try{Jb();break}catch(D){Ag(r,D)}while(!0);ac(),Ya.current=x,Xe=g,Ct!==null?o=0:(Lt=null,Bt=0,o=jt)}if(o!==0){if(o===2&&(g=bu(r),g!==0&&(d=g,o=Wc(r,g))),o===1)throw u=hs,xi(r,0),Xr(r,d),pn(r,Qe()),u;if(o===6)Xr(r,d);else{if(g=r.current.alternate,(d&30)===0&&!Gb(g)&&(o=nl(r,d),o===2&&(x=bu(r),x!==0&&(d=x,o=Wc(r,x))),o===1))throw u=hs,xi(r,0),Xr(r,d),pn(r,Qe()),u;switch(r.finishedWork=g,r.finishedLanes=d,o){case 0:case 1:throw Error(n(345));case 2:wi(r,hn,Cr);break;case 3:if(Xr(r,d),(d&130023424)===d&&(o=Bc+500-Qe(),10<o)){if(ca(r,0)!==0)break;if(g=r.suspendedLanes,(g&d)!==d){nn(),r.pingedLanes|=r.suspendedLanes&g;break}r.timeoutHandle=Gu(wi.bind(null,r,hn,Cr),o);break}wi(r,hn,Cr);break;case 4:if(Xr(r,d),(d&4194240)===d)break;for(o=r.eventTimes,g=-1;0<d;){var b=31-Vn(d);x=1<<b,b=o[b],b>g&&(g=b),d&=~x}if(d=g,d=Qe()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*Yb(d/1960))-d,10<d){r.timeoutHandle=Gu(wi.bind(null,r,hn,Cr),d);break}wi(r,hn,Cr);break;case 5:wi(r,hn,Cr);break;default:throw Error(n(329))}}}return pn(r,Qe()),r.callbackNode===u?Pg.bind(null,r):null}function Wc(r,o){var u=ps;return r.current.memoizedState.isDehydrated&&(xi(r,o).flags|=256),r=nl(r,o),r!==2&&(o=hn,hn=u,o!==null&&Hc(o)),r}function Hc(r){hn===null?hn=r:hn.push.apply(hn,r)}function Gb(r){for(var o=r;;){if(o.flags&16384){var u=o.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var d=0;d<u.length;d++){var g=u[d],x=g.getSnapshot;g=g.value;try{if(!Bn(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 Xr(r,o){for(o&=~Vc,o&=~Ga,r.suspendedLanes|=o,r.pingedLanes&=~o,r=r.expirationTimes;0<o;){var u=31-Vn(o),d=1<<u;r[u]=-1,o&=~d}}function Rg(r){if((Xe&6)!==0)throw Error(n(327));ao();var o=ca(r,0);if((o&1)===0)return pn(r,Qe()),null;var u=nl(r,o);if(r.tag!==0&&u===2){var d=bu(r);d!==0&&(o=d,u=Wc(r,d))}if(u===1)throw u=hs,xi(r,0),Xr(r,o),pn(r,Qe()),u;if(u===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=o,wi(r,hn,Cr),pn(r,Qe()),null}function Kc(r,o){var u=Xe;Xe|=1;try{return r(o)}finally{Xe=u,Xe===0&&(so=Qe()+500,Aa&&Br())}}function vi(r){Kr!==null&&Kr.tag===0&&(Xe&6)===0&&ao();var o=Xe;Xe|=1;var u=Mn.transition,d=Ze;try{if(Mn.transition=null,Ze=1,r)return r()}finally{Ze=d,Mn.transition=u,Xe=o,(Xe&6)===0&&Br()}}function qc(){Sn=oo.current,ct(oo)}function xi(r,o){r.finishedWork=null,r.finishedLanes=0;var u=r.timeoutHandle;if(u!==-1&&(r.timeoutHandle=-1,Tb(u)),Ct!==null)for(u=Ct.return;u!==null;){var d=u;switch(nc(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&Pa();break;case 3:no(),ct(cn),ct(qt),mc();break;case 5:hc(d);break;case 4:no();break;case 13:ct(mt);break;case 19:ct(mt);break;case 10:lc(d.type._context);break;case 22:case 23:qc()}u=u.return}if(Lt=r,Ct=r=Yr(r.current,null),Bt=Sn=o,jt=0,hs=null,Vc=Ga=yi=0,hn=ps=null,pi!==null){for(o=0;o<pi.length;o++)if(u=pi[o],d=u.interleaved,d!==null){u.interleaved=null;var g=d.next,x=u.pending;if(x!==null){var b=x.next;x.next=g,d.next=b}u.pending=d}pi=null}return r}function Ag(r,o){do{var u=Ct;try{if(ac(),za.current=Ua,Va){for(var d=gt.memoizedState;d!==null;){var g=d.queue;g!==null&&(g.pending=null),d=d.next}Va=!1}if(gi=0,Dt=At=gt=null,as=!1,ls=0,zc.current=null,u===null||u.return===null){jt=1,hs=o,Ct=null;break}e:{var x=r,b=u.return,D=u,O=o;if(o=Bt,D.flags|=32768,O!==null&&typeof O=="object"&&typeof O.then=="function"){var q=O,re=D,oe=re.tag;if((re.mode&1)===0&&(oe===0||oe===11||oe===15)){var te=re.alternate;te?(re.updateQueue=te.updateQueue,re.memoizedState=te.memoizedState,re.lanes=te.lanes):(re.updateQueue=null,re.memoizedState=null)}var we=eg(b);if(we!==null){we.flags&=-257,tg(we,b,D,x,o),we.mode&1&&Zm(x,q,o),o=we,O=q;var Ee=o.updateQueue;if(Ee===null){var Pe=new Set;Pe.add(O),o.updateQueue=Pe}else Ee.add(O);break e}else{if((o&1)===0){Zm(x,q,o),Xc();break e}O=Error(n(426))}}else if(dt&&D.mode&1){var St=eg(b);if(St!==null){(St.flags&65536)===0&&(St.flags|=256),tg(St,b,D,x,o),oc(ro(O,D));break e}}x=O=ro(O,D),jt!==4&&(jt=2),ps===null?ps=[x]:ps.push(x),x=b;do{switch(x.tag){case 3:x.flags|=65536,o&=-o,x.lanes|=o;var U=Qm(x,O,o);Cm(x,U);break e;case 1:D=O;var z=x.type,H=x.stateNode;if((x.flags&128)===0&&(typeof z.getDerivedStateFromError=="function"||H!==null&&typeof H.componentDidCatch=="function"&&(Hr===null||!Hr.has(H)))){x.flags|=65536,o&=-o,x.lanes|=o;var fe=Jm(x,D,o);Cm(x,fe);break e}}x=x.return}while(x!==null)}Mg(u)}catch(Ae){o=Ae,Ct===u&&u!==null&&(Ct=u=u.return);continue}break}while(!0)}function jg(){var r=Ya.current;return Ya.current=Ua,r===null?Ua:r}function Xc(){(jt===0||jt===3||jt===2)&&(jt=4),Lt===null||(yi&268435455)===0&&(Ga&268435455)===0||Xr(Lt,Bt)}function nl(r,o){var u=Xe;Xe|=2;var d=jg();(Lt!==r||Bt!==o)&&(Cr=null,xi(r,o));do try{Qb();break}catch(g){Ag(r,g)}while(!0);if(ac(),Xe=u,Ya.current=d,Ct!==null)throw Error(n(261));return Lt=null,Bt=0,jt}function Qb(){for(;Ct!==null;)Ng(Ct)}function Jb(){for(;Ct!==null&&!Rt();)Ng(Ct)}function Ng(r){var o=Lg(r.alternate,r,Sn);r.memoizedProps=r.pendingProps,o===null?Mg(r):Ct=o,zc.current=null}function Mg(r){var o=r;do{var u=o.alternate;if(r=o.return,(o.flags&32768)===0){if(u=Wb(u,o,Sn),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{jt=6,Ct=null;return}}if(o=o.sibling,o!==null){Ct=o;return}Ct=o=r}while(o!==null);jt===0&&(jt=5)}function wi(r,o,u){var d=Ze,g=Mn.transition;try{Mn.transition=null,Ze=1,Zb(r,o,u,d)}finally{Mn.transition=g,Ze=d}return null}function Zb(r,o,u,d){do ao();while(Kr!==null);if((Xe&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(IS(r,x),r===Lt&&(Ct=Lt=null,Bt=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||Ja||(Ja=!0,_g(zn,function(){return ao(),null})),x=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||x){x=Mn.transition,Mn.transition=null;var b=Ze;Ze=1;var D=Xe;Xe|=4,zc.current=null,qb(r,u),Sg(u,r),xb(Xu),ha=!!qu,Xu=qu=null,r.current=u,Xb(u),Pn(),Xe=D,Ze=b,Mn.transition=x}else r.current=u;if(Ja&&(Ja=!1,Kr=r,Za=g),x=r.pendingLanes,x===0&&(Hr=null),PS(u.stateNode),pn(r,Qe()),o!==null)for(d=r.onRecoverableError,u=0;u<o.length;u++)g=o[u],d(g.value,{componentStack:g.stack,digest:g.digest});if(Qa)throw Qa=!1,r=$c,$c=null,r;return(Za&1)!==0&&r.tag!==0&&ao(),x=r.pendingLanes,(x&1)!==0?r===Uc?ms++:(ms=0,Uc=r):ms=0,Br(),null}function ao(){if(Kr!==null){var r=wp(Za),o=Mn.transition,u=Ze;try{if(Mn.transition=null,Ze=16>r?16:r,Kr===null)var d=!1;else{if(r=Kr,Kr=null,Za=0,(Xe&6)!==0)throw Error(n(331));var g=Xe;for(Xe|=4,Ce=r.current;Ce!==null;){var x=Ce,b=x.child;if((Ce.flags&16)!==0){var D=x.deletions;if(D!==null){for(var O=0;O<D.length;O++){var q=D[O];for(Ce=q;Ce!==null;){var re=Ce;switch(re.tag){case 0:case 11:case 15:ds(8,re,x)}var oe=re.child;if(oe!==null)oe.return=re,Ce=oe;else for(;Ce!==null;){re=Ce;var te=re.sibling,we=re.return;if(yg(re),re===q){Ce=null;break}if(te!==null){te.return=we,Ce=te;break}Ce=we}}}var Ee=x.alternate;if(Ee!==null){var Pe=Ee.child;if(Pe!==null){Ee.child=null;do{var St=Pe.sibling;Pe.sibling=null,Pe=St}while(Pe!==null)}}Ce=x}}if((x.subtreeFlags&2064)!==0&&b!==null)b.return=x,Ce=b;else e:for(;Ce!==null;){if(x=Ce,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:ds(9,x,x.return)}var U=x.sibling;if(U!==null){U.return=x.return,Ce=U;break e}Ce=x.return}}var z=r.current;for(Ce=z;Ce!==null;){b=Ce;var H=b.child;if((b.subtreeFlags&2064)!==0&&H!==null)H.return=b,Ce=H;else e:for(b=z;Ce!==null;){if(D=Ce,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:Xa(9,D)}}catch(Ae){vt(D,D.return,Ae)}if(D===b){Ce=null;break e}var fe=D.sibling;if(fe!==null){fe.return=D.return,Ce=fe;break e}Ce=D.return}}if(Xe=g,Br(),er&&typeof er.onPostCommitFiberRoot=="function")try{er.onPostCommitFiberRoot(aa,r)}catch{}d=!0}return d}finally{Ze=u,Mn.transition=o}}return!1}function Ig(r,o,u){o=ro(u,o),o=Qm(r,o,1),r=Ur(r,o,1),o=nn(),r!==null&&(zo(r,1,o),pn(r,o))}function vt(r,o,u){if(r.tag===3)Ig(r,r,u);else for(;o!==null;){if(o.tag===3){Ig(o,r,u);break}else if(o.tag===1){var d=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Hr===null||!Hr.has(d))){r=ro(u,r),r=Jm(o,r,1),o=Ur(o,r,1),r=nn(),o!==null&&(zo(o,1,r),pn(o,r));break}}o=o.return}}function eC(r,o,u){var d=r.pingCache;d!==null&&d.delete(o),o=nn(),r.pingedLanes|=r.suspendedLanes&u,Lt===r&&(Bt&u)===u&&(jt===4||jt===3&&(Bt&130023424)===Bt&&500>Qe()-Bc?xi(r,0):Vc|=u),pn(r,o)}function Dg(r,o){o===0&&((r.mode&1)===0?o=1:(o=ua,ua<<=1,(ua&130023424)===0&&(ua=4194304)));var u=nn();r=kr(r,o),r!==null&&(zo(r,o,u),pn(r,u))}function tC(r){var o=r.memoizedState,u=0;o!==null&&(u=o.retryLane),Dg(r,u)}function nC(r,o){var u=0;switch(r.tag){case 13:var d=r.stateNode,g=r.memoizedState;g!==null&&(u=g.retryLane);break;case 19:d=r.stateNode;break;default:throw Error(n(314))}d!==null&&d.delete(o),Dg(r,u)}var Lg;Lg=function(r,o,u){if(r!==null)if(r.memoizedProps!==o.pendingProps||cn.current)dn=!0;else{if((r.lanes&u)===0&&(o.flags&128)===0)return dn=!1,Ub(r,o,u);dn=(r.flags&131072)!==0}else dn=!1,dt&&(o.flags&1048576)!==0&&pm(o,Na,o.index);switch(o.lanes=0,o.tag){case 2:var d=o.type;Ka(r,o),r=o.pendingProps;var g=Yi(o,qt.current);to(o,u),g=vc(null,o,d,r,g,u);var x=xc();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,fn(d)?(x=!0,Ra(o)):x=!1,o.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,fc(o),g.updater=Wa,o.stateNode=g,g._reactInternals=o,Ec(o,d,r,u),o=Ac(null,o,d,!0,x,u)):(o.tag=0,dt&&x&&tc(o),tn(null,o,g,u),o=o.child),o;case 16:d=o.elementType;e:{switch(Ka(r,o),r=o.pendingProps,g=d._init,d=g(d._payload),o.type=d,g=o.tag=iC(d),r=Un(d,r),g){case 0:o=Rc(null,o,d,r,u);break e;case 1:o=ag(null,o,d,r,u);break e;case 11:o=ng(null,o,d,r,u);break e;case 14:o=rg(null,o,d,Un(d.type,r),u);break e}throw Error(n(306,d,""))}return o;case 0:return d=o.type,g=o.pendingProps,g=o.elementType===d?g:Un(d,g),Rc(r,o,d,g,u);case 1:return d=o.type,g=o.pendingProps,g=o.elementType===d?g:Un(d,g),ag(r,o,d,g,u);case 3:e:{if(lg(o),r===null)throw Error(n(387));d=o.pendingProps,x=o.memoizedState,g=x.element,bm(r,o),Oa(o,d,null,u);var b=o.memoizedState;if(d=b.element,x.isDehydrated)if(x={element:d,isDehydrated:!1,cache:b.cache,pendingSuspenseBoundaries:b.pendingSuspenseBoundaries,transitions:b.transitions},o.updateQueue.baseState=x,o.memoizedState=x,o.flags&256){g=ro(Error(n(423)),o),o=ug(r,o,d,u,g);break e}else if(d!==g){g=ro(Error(n(424)),o),o=ug(r,o,d,u,g);break e}else for(kn=Fr(o.stateNode.containerInfo.firstChild),wn=o,dt=!0,$n=null,u=km(o,null,d,u),o.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Ji(),d===g){o=br(r,o,u);break e}tn(r,o,d,u)}o=o.child}return o;case 5:return Tm(o),r===null&&ic(o),d=o.type,g=o.pendingProps,x=r!==null?r.memoizedProps:null,b=g.children,Yu(d,g)?b=null:x!==null&&Yu(d,x)&&(o.flags|=32),sg(r,o),tn(r,o,b,u),o.child;case 6:return r===null&&ic(o),null;case 13:return cg(r,o,u);case 4:return dc(o,o.stateNode.containerInfo),d=o.pendingProps,r===null?o.child=Zi(o,null,d,u):tn(r,o,d,u),o.child;case 11:return d=o.type,g=o.pendingProps,g=o.elementType===d?g:Un(d,g),ng(r,o,d,g,u);case 7:return tn(r,o,o.pendingProps,u),o.child;case 8:return tn(r,o,o.pendingProps.children,u),o.child;case 12:return tn(r,o,o.pendingProps.children,u),o.child;case 10:e:{if(d=o.type._context,g=o.pendingProps,x=o.memoizedProps,b=g.value,lt(Da,d._currentValue),d._currentValue=b,x!==null)if(Bn(x.value,b)){if(x.children===g.children&&!cn.current){o=br(r,o,u);break e}}else for(x=o.child,x!==null&&(x.return=o);x!==null;){var D=x.dependencies;if(D!==null){b=x.child;for(var O=D.firstContext;O!==null;){if(O.context===d){if(x.tag===1){O=Sr(-1,u&-u),O.tag=2;var q=x.updateQueue;if(q!==null){q=q.shared;var re=q.pending;re===null?O.next=O:(O.next=re.next,re.next=O),q.pending=O}}x.lanes|=u,O=x.alternate,O!==null&&(O.lanes|=u),uc(x.return,u,o),D.lanes|=u;break}O=O.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,D=b.alternate,D!==null&&(D.lanes|=u),uc(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}tn(r,o,g.children,u),o=o.child}return o;case 9:return g=o.type,d=o.pendingProps.children,to(o,u),g=jn(g),d=d(g),o.flags|=1,tn(r,o,d,u),o.child;case 14:return d=o.type,g=Un(d,o.pendingProps),g=Un(d.type,g),rg(r,o,d,g,u);case 15:return ig(r,o,o.type,o.pendingProps,u);case 17:return d=o.type,g=o.pendingProps,g=o.elementType===d?g:Un(d,g),Ka(r,o),o.tag=1,fn(d)?(r=!0,Ra(o)):r=!1,to(o,u),Ym(o,d,g),Ec(o,d,g,u),Ac(null,o,d,!0,r,u);case 19:return dg(r,o,u);case 22:return og(r,o,u)}throw Error(n(156,o.tag))};function _g(r,o){return Oe(r,o)}function rC(r,o,u,d){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=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function In(r,o,u,d){return new rC(r,o,u,d)}function Yc(r){return r=r.prototype,!(!r||!r.isReactComponent)}function iC(r){if(typeof r=="function")return Yc(r)?1:0;if(r!=null){if(r=r.$$typeof,r===V)return 11;if(r===Z)return 14}return 2}function Yr(r,o){var u=r.alternate;return u===null?(u=In(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 rl(r,o,u,d,g,x){var b=2;if(d=r,typeof r=="function")Yc(r)&&(b=1);else if(typeof r=="string")b=5;else e:switch(r){case K:return ki(u.children,g,x,o);case B:b=8,g|=8;break;case _:return r=In(12,u,o,g|2),r.elementType=_,r.lanes=x,r;case he:return r=In(13,u,o,g),r.elementType=he,r.lanes=x,r;case J:return r=In(19,u,o,g),r.elementType=J,r.lanes=x,r;case ke:return il(u,g,x,o);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case N:b=10;break e;case $:b=9;break e;case V:b=11;break e;case Z:b=14;break e;case ve:b=16,d=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return o=In(b,u,o,g),o.elementType=r,o.type=d,o.lanes=x,o}function ki(r,o,u,d){return r=In(7,r,d,o),r.lanes=u,r}function il(r,o,u,d){return r=In(22,r,d,o),r.elementType=ke,r.lanes=u,r.stateNode={isHidden:!1},r}function Gc(r,o,u){return r=In(6,r,null,o),r.lanes=u,r}function Qc(r,o,u){return o=In(4,r.children!==null?r.children:[],r.key,o),o.lanes=u,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}function oC(r,o,u,d,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=Cu(0),this.expirationTimes=Cu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Cu(0),this.identifierPrefix=d,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Jc(r,o,u,d,g,x,b,D,O){return r=new oC(r,o,u,D,O),o===1?(o=1,x===!0&&(o|=8)):o=0,x=In(3,null,null,o),r.current=x,x.stateNode=r,x.memoizedState={element:d,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},fc(x),r}function sC(r,o,u){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:I,key:d==null?null:""+d,children:r,containerInfo:o,implementation:u}}function Og(r){if(!r)return Vr;r=r._reactInternals;e:{if(gr(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(fn(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(fn(u))return fm(r,u,o)}return o}function Fg(r,o,u,d,g,x,b,D,O){return r=Jc(u,d,!0,r,g,x,b,D,O),r.context=Og(null),u=r.current,d=nn(),g=qr(u),x=Sr(d,g),x.callback=o??null,Ur(u,x,g),r.current.lanes=g,zo(r,g,d),pn(r,d),r}function ol(r,o,u,d){var g=o.current,x=nn(),b=qr(g);return u=Og(u),o.context===null?o.context=u:o.pendingContext=u,o=Sr(x,b),o.payload={element:r},d=d===void 0?null:d,d!==null&&(o.callback=d),r=Ur(g,o,b),r!==null&&(Kn(r,g,b,x),_a(r,g,b)),b}function sl(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 zg(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<o?u:o}}function Zc(r,o){zg(r,o),(r=r.alternate)&&zg(r,o)}function aC(){return null}var Vg=typeof reportError=="function"?reportError:function(r){console.error(r)};function ef(r){this._internalRoot=r}al.prototype.render=ef.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(n(409));ol(r,o,null,null)},al.prototype.unmount=ef.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;vi(function(){ol(null,r,null,null)}),o[yr]=null}};function al(r){this._internalRoot=r}al.prototype.unstable_scheduleHydration=function(r){if(r){var o=bp();r={blockedOn:null,target:r,priority:o};for(var u=0;u<Lr.length&&o!==0&&o<Lr[u].priority;u++);Lr.splice(u,0,r),u===0&&Tp(r)}};function tf(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function ll(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Bg(){}function lC(r,o,u,d,g){if(g){if(typeof d=="function"){var x=d;d=function(){var q=sl(b);x.call(q)}}var b=Fg(o,d,r,0,null,!1,!1,"",Bg);return r._reactRootContainer=b,r[yr]=b.current,Zo(r.nodeType===8?r.parentNode:r),vi(),b}for(;g=r.lastChild;)r.removeChild(g);if(typeof d=="function"){var D=d;d=function(){var q=sl(O);D.call(q)}}var O=Jc(r,0,!1,null,null,!1,!1,"",Bg);return r._reactRootContainer=O,r[yr]=O.current,Zo(r.nodeType===8?r.parentNode:r),vi(function(){ol(o,O,u,d)}),O}function ul(r,o,u,d,g){var x=u._reactRootContainer;if(x){var b=x;if(typeof g=="function"){var D=g;g=function(){var O=sl(b);D.call(O)}}ol(o,b,r,g)}else b=lC(u,o,r,g,d);return sl(b)}kp=function(r){switch(r.tag){case 3:var o=r.stateNode;if(o.current.memoizedState.isDehydrated){var u=Fo(o.pendingLanes);u!==0&&(Eu(o,u|1),pn(o,Qe()),(Xe&6)===0&&(so=Qe()+500,Br()))}break;case 13:vi(function(){var d=kr(r,1);if(d!==null){var g=nn();Kn(d,r,1,g)}}),Zc(r,1)}},Tu=function(r){if(r.tag===13){var o=kr(r,134217728);if(o!==null){var u=nn();Kn(o,r,134217728,u)}Zc(r,134217728)}},Sp=function(r){if(r.tag===13){var o=qr(r),u=kr(r,o);if(u!==null){var d=nn();Kn(u,r,o,d)}Zc(r,o)}},bp=function(){return Ze},Cp=function(r,o){var u=Ze;try{return Ze=r,o()}finally{Ze=u}},wt=function(r,o,u){switch(o){case"input":if(et(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 d=u[o];if(d!==r&&d.form===r.form){var g=Ta(d);if(!g)throw Error(n(90));Ke(d),et(d,g)}}}break;case"textarea":We(r,u);break;case"select":o=u.value,o!=null&&en(r,!!u.multiple,o,!1)}},Pt=Kc,ia=vi;var uC={usingClientEntryPoint:!1,Events:[ns,qi,Ta,ht,Ht,Kc]},gs={findFiberByHostInstance:ci,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},cC={bundleType:gs.bundleType,version:gs.version,rendererPackageName:gs.rendererPackageName,rendererConfig:gs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:L.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=ne(r),r===null?null:r.stateNode},findFiberByHostInstance:gs.findFiberByHostInstance||aC,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 cl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cl.isDisabled&&cl.supportsFiber)try{aa=cl.inject(cC),er=cl}catch{}}return mn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uC,mn.createPortal=function(r,o){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tf(o))throw Error(n(200));return sC(r,o,null,u)},mn.createRoot=function(r,o){if(!tf(r))throw Error(n(299));var u=!1,d="",g=Vg;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(d=o.identifierPrefix),o.onRecoverableError!==void 0&&(g=o.onRecoverableError)),o=Jc(r,1,!1,null,null,u,!1,d,g),r[yr]=o.current,Zo(r.nodeType===8?r.parentNode:r),new ef(o)},mn.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=ne(o),r=r===null?null:r.stateNode,r},mn.flushSync=function(r){return vi(r)},mn.hydrate=function(r,o,u){if(!ll(o))throw Error(n(200));return ul(null,r,o,!0,u)},mn.hydrateRoot=function(r,o,u){if(!tf(r))throw Error(n(405));var d=u!=null&&u.hydratedSources||null,g=!1,x="",b=Vg;if(u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onRecoverableError!==void 0&&(b=u.onRecoverableError)),o=Fg(o,null,r,1,u??null,g,!1,x,b),r[yr]=o.current,Zo(r),d)for(r=0;r<d.length;r++)u=d[r],g=u._getVersion,g=g(u._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[u,g]:o.mutableSourceEagerHydrationData.push(u,g);return new al(o)},mn.render=function(r,o,u){if(!ll(o))throw Error(n(200));return ul(null,r,o,!1,u)},mn.unmountComponentAtNode=function(r){if(!ll(r))throw Error(n(40));return r._reactRootContainer?(vi(function(){ul(null,null,r,!1,function(){r._reactRootContainer=null,r[yr]=null})}),!0):!1},mn.unstable_batchedUpdates=Kc,mn.unstable_renderSubtreeIntoContainer=function(r,o,u,d){if(!ll(u))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return ul(r,o,u,!1,d)},mn.version="18.3.1-next-f1338f8080-20240426",mn}var Yg;function Zx(){if(Yg)return of.exports;Yg=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(),of.exports=vC(),of.exports}var Gg;function xC(){if(Gg)return fl;Gg=1;var e=Zx();return fl.createRoot=e.createRoot,fl.hydrateRoot=e.hydrateRoot,fl}var wC=xC(),k=sh();const kC=oh(k),Ks=dC({__proto__:null,default:kC},[k]),ah=k.createContext({});function lu(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const SC=typeof window<"u",lh=SC?k.useLayoutEffect:k.useEffect,uu=k.createContext(null);function uh(e,t){e.indexOf(t)===-1&&e.push(t)}function Bl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const dr=(e,t,n)=>n>t?t:n<e?e:n;let cu=()=>{};const ri={},ew=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),tw=e=>typeof e=="object"&&e!==null,nw=e=>/^0[^.\s]+$/u.test(e);function rw(e){let t;return()=>(t===void 0&&(t=e()),t)}const On=e=>e,qs=(...e)=>e.reduce((t,n)=>i=>n(t(i))),Ls=(e,t,n)=>{const i=t-e;return i?(n-e)/i:1};class ch{constructor(){this.subscriptions=[]}add(t){return uh(this.subscriptions,t),()=>Bl(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 a=0;a<s;a++){const l=this.subscriptions[a];l&&l(t,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Cn=e=>e*1e3,_n=e=>e/1e3,iw=(e,t)=>t?e*(1e3/t):0,ow=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,bC=1e-7,CC=12;function EC(e,t,n,i,s){let a,l,c=0;do l=t+(n-t)/2,a=ow(l,i,s)-e,a>0?n=l:t=l;while(Math.abs(a)>bC&&++c<CC);return l}function Xs(e,t,n,i){if(e===t&&n===i)return On;const s=a=>EC(a,0,1,e,n);return a=>a===0||a===1?a:ow(s(a),t,i)}const sw=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,aw=e=>t=>1-e(1-t),lw=Xs(.33,1.53,.69,.99),fh=aw(lw),uw=sw(fh),cw=e=>e>=1?1:(e*=2)<1?.5*fh(e):.5*(2-Math.pow(2,-10*(e-1))),dh=e=>1-Math.sin(Math.acos(e)),fw=aw(dh),dw=sw(dh),TC=Xs(.42,0,1,1),PC=Xs(0,0,.58,1),hw=Xs(.42,0,.58,1),RC=e=>Array.isArray(e)&&typeof e[0]!="number",pw=e=>Array.isArray(e)&&typeof e[0]=="number",AC={linear:On,easeIn:TC,easeInOut:hw,easeOut:PC,circIn:dh,circInOut:dw,circOut:fw,backIn:fh,backInOut:uw,backOut:lw,anticipate:cw},jC=e=>typeof e=="string",Qg=e=>{if(pw(e)){cu(e.length===4);const[t,n,i,s]=e;return Xs(t,n,i,s)}else if(jC(e))return AC[e];return e},dl=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function NC(e){let t=new Set,n=new Set,i=!1,s=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(h){a.has(h)&&(f.schedule(h),e()),h(l)}const f={schedule:(h,m=!1,p=!1)=>{const w=p&&i?t:n;return m&&a.add(h),w.add(h),h},cancel:h=>{n.delete(h),a.delete(h)},process:h=>{if(l=h,i){s=!0;return}i=!0;const m=t;t=n,n=m,t.forEach(c),t.clear(),i=!1,s&&(s=!1,f.process(h))}};return f}const MC=40;function mw(e,t){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,l=dl.reduce((T,L)=>(T[L]=NC(a),T),{}),{setup:c,read:f,resolveKeyframes:h,preUpdate:m,update:p,preRender:v,render:w,postRender:S}=l,C=()=>{const T=ri.useManualTiming,L=T?s.timestamp:performance.now();n=!1,T||(s.delta=i?1e3/60:Math.max(Math.min(L-s.timestamp,MC),1)),s.timestamp=L,s.isProcessing=!0,c.process(s),f.process(s),h.process(s),m.process(s),p.process(s),v.process(s),w.process(s),S.process(s),s.isProcessing=!1,n&&t&&(i=!1,e(C))},E=()=>{n=!0,i=!0,s.isProcessing||e(C)};return{schedule:dl.reduce((T,L)=>{const j=l[L];return T[L]=(I,K=!1,B=!1)=>(n||E(),j.schedule(I,K,B)),T},{}),cancel:T=>{for(let L=0;L<dl.length;L++)l[dl[L]].cancel(T)},state:s,steps:l}}const{schedule:rt,cancel:ii,state:$t,steps:lf}=mw(typeof requestAnimationFrame<"u"?requestAnimationFrame:On,!0);let Pl;function IC(){Pl=void 0}const sn={now:()=>(Pl===void 0&&sn.set($t.isProcessing||ri.useManualTiming?$t.timestamp:performance.now()),Pl),set:e=>{Pl=e,queueMicrotask(IC)}},gw=e=>t=>typeof t=="string"&&t.startsWith(e),yw=gw("--"),DC=gw("var(--"),hh=e=>DC(e)?LC.test(e.split("/*")[0].trim()):!1,LC=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Jg(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Ao={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},_s={...Ao,transform:e=>dr(0,1,e)},hl={...Ao,default:1},Ps=e=>Math.round(e*1e5)/1e5,ph=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function _C(e){return e==null}const OC=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,mh=(e,t)=>n=>!!(typeof n=="string"&&OC.test(n)&&n.startsWith(e)||t&&!_C(n)&&Object.prototype.hasOwnProperty.call(n,t)),vw=(e,t,n)=>i=>{if(typeof i!="string")return i;const[s,a,l,c]=i.match(ph);return{[e]:parseFloat(s),[t]:parseFloat(a),[n]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},FC=e=>dr(0,255,e),uf={...Ao,transform:e=>Math.round(FC(e))},Pi={test:mh("rgb","red"),parse:vw("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+uf.transform(e)+", "+uf.transform(t)+", "+uf.transform(n)+", "+Ps(_s.transform(i))+")"};function zC(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 Qf={test:mh("#"),parse:zC,transform:Pi.transform},Ys=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Er=Ys("deg"),fr=Ys("%"),Te=Ys("px"),VC=Ys("vh"),BC=Ys("vw"),Zg={...fr,parse:e=>fr.parse(e)/100,transform:e=>fr.transform(e*100)},vo={test:mh("hsl","hue"),parse:vw("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+fr.transform(Ps(t))+", "+fr.transform(Ps(n))+", "+Ps(_s.transform(i))+")"},Tt={test:e=>Pi.test(e)||Qf.test(e)||vo.test(e),parse:e=>Pi.test(e)?Pi.parse(e):vo.test(e)?vo.parse(e):Qf.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Pi.transform(e):vo.transform(e),getAnimatableNone:e=>{const t=Tt.parse(e);return t.alpha=0,Tt.transform(t)}},$C=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function UC(e){return isNaN(e)&&typeof e=="string"&&(e.match(ph)?.length||0)+(e.match($C)?.length||0)>0}const xw="number",ww="color",WC="var",HC="var(",ey="${}",KC=/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 Co(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},s=[];let a=0;const c=t.replace(KC,f=>(Tt.test(f)?(i.color.push(a),s.push(ww),n.push(Tt.parse(f))):f.startsWith(HC)?(i.var.push(a),s.push(WC),n.push(f)):(i.number.push(a),s.push(xw),n.push(parseFloat(f))),++a,ey)).split(ey);return{values:n,split:c,indexes:i,types:s}}function qC(e){return Co(e).values}function kw({split:e,types:t}){const n=e.length;return i=>{let s="";for(let a=0;a<n;a++)if(s+=e[a],i[a]!==void 0){const l=t[a];l===xw?s+=Ps(i[a]):l===ww?s+=Tt.transform(i[a]):s+=i[a]}return s}}function XC(e){return kw(Co(e))}const YC=e=>typeof e=="number"?0:Tt.test(e)?Tt.getAnimatableNone(e):e,GC=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:YC(e);function QC(e){const t=Co(e);return kw(t)(t.values.map((i,s)=>GC(i,t.split[s])))}const Yn={test:UC,parse:qC,createTransformer:XC,getAnimatableNone:QC};function cf(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 JC({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let s=0,a=0,l=0;if(!t)s=a=l=n;else{const c=n<.5?n*(1+t):n+t-n*t,f=2*n-c;s=cf(f,c,e+1/3),a=cf(f,c,e),l=cf(f,c,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(l*255),alpha:i}}function $l(e,t){return n=>n>0?t:e}const nt=(e,t,n)=>e+(t-e)*n,ff=(e,t,n)=>{const i=e*e,s=n*(t*t-i)+i;return s<0?0:Math.sqrt(s)},ZC=[Qf,Pi,vo],eE=e=>ZC.find(t=>t.test(e));function ty(e){const t=eE(e);if(!t)return!1;let n=t.parse(e);return t===vo&&(n=JC(n)),n}const ny=(e,t)=>{const n=ty(e),i=ty(t);if(!n||!i)return $l(e,t);const s={...n};return a=>(s.red=ff(n.red,i.red,a),s.green=ff(n.green,i.green,a),s.blue=ff(n.blue,i.blue,a),s.alpha=nt(n.alpha,i.alpha,a),Pi.transform(s))},Jf=new Set(["none","hidden"]);function tE(e,t){return Jf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function nE(e,t){return n=>nt(e,t,n)}function gh(e){return typeof e=="number"?nE:typeof e=="string"?hh(e)?$l:Tt.test(e)?ny:oE:Array.isArray(e)?Sw:typeof e=="object"?Tt.test(e)?ny:rE:$l}function Sw(e,t){const n=[...e],i=n.length,s=e.map((a,l)=>gh(a)(a,t[l]));return a=>{for(let l=0;l<i;l++)n[l]=s[l](a);return n}}function rE(e,t){const n={...e,...t},i={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(i[s]=gh(e[s])(e[s],t[s]));return s=>{for(const a in i)n[a]=i[a](s);return n}}function iE(e,t){const n=[],i={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const a=t.types[s],l=e.indexes[a][i[a]],c=e.values[l]??0;n[s]=c,i[a]++}return n}const oE=(e,t)=>{const n=Yn.createTransformer(t),i=Co(e),s=Co(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?Jf.has(e)&&!s.values.length||Jf.has(t)&&!i.values.length?tE(e,t):qs(Sw(iE(i,s),s.values),n):$l(e,t)};function bw(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?nt(e,t,n):gh(e)(e,t)}const sE=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>rt.update(t,n),stop:()=>ii(t),now:()=>$t.isProcessing?$t.timestamp:sn.now()}},Cw=(e,t,n=10)=>{let i="";const s=Math.max(Math.round(t/n),2);for(let a=0;a<s;a++)i+=Math.round(e(a/(s-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Ul=2e4;function yh(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<Ul;)t+=n,i=e.next(t);return t>=Ul?1/0:t}function aE(e,t=100,n){const i=n({...e,keyframes:[0,t]}),s=Math.min(yh(i),Ul);return{type:"keyframes",ease:a=>i.next(s*a).value/t,duration:_n(s)}}const xt={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 Zf(e,t){return e*Math.sqrt(1-t*t)}const lE=12;function uE(e,t,n){let i=n;for(let s=1;s<lE;s++)i=i-e(i)/t(i);return i}const df=.001;function cE({duration:e=xt.duration,bounce:t=xt.bounce,velocity:n=xt.velocity,mass:i=xt.mass}){let s,a,l=1-t;l=dr(xt.minDamping,xt.maxDamping,l),e=dr(xt.minDuration,xt.maxDuration,_n(e)),l<1?(s=h=>{const m=h*l,p=m*e,v=m-n,w=Zf(h,l),S=Math.exp(-p);return df-v/w*S},a=h=>{const p=h*l*e,v=p*n+n,w=Math.pow(l,2)*Math.pow(h,2)*e,S=Math.exp(-p),C=Zf(Math.pow(h,2),l);return(-s(h)+df>0?-1:1)*((v-w)*S)/C}):(s=h=>{const m=Math.exp(-h*e),p=(h-n)*e+1;return-df+m*p},a=h=>{const m=Math.exp(-h*e),p=(n-h)*(e*e);return m*p});const c=5/e,f=uE(s,a,c);if(e=Cn(e),isNaN(f))return{stiffness:xt.stiffness,damping:xt.damping,duration:e};{const h=Math.pow(f,2)*i;return{stiffness:h,damping:l*2*Math.sqrt(i*h),duration:e}}}const fE=["duration","bounce"],dE=["stiffness","damping","mass"];function ry(e,t){return t.some(n=>e[n]!==void 0)}function hE(e){let t={velocity:xt.velocity,stiffness:xt.stiffness,damping:xt.damping,mass:xt.mass,isResolvedFromDuration:!1,...e};if(!ry(e,dE)&&ry(e,fE))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),s=i*i,a=2*dr(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:xt.mass,stiffness:s,damping:a}}else{const n=cE({...e,velocity:0});t={...t,...n,mass:xt.mass},t.isResolvedFromDuration=!0}return t}function Wl(e=xt.visualDuration,t=xt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:s}=n;const a=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],c={done:!1,value:a},{stiffness:f,damping:h,mass:m,duration:p,velocity:v,isResolvedFromDuration:w}=hE({...n,velocity:-_n(n.velocity||0)}),S=v||0,C=h/(2*Math.sqrt(f*m)),E=l-a,P=_n(Math.sqrt(f/m)),A=Math.abs(E)<5;i||(i=A?xt.restSpeed.granular:xt.restSpeed.default),s||(s=A?xt.restDelta.granular:xt.restDelta.default);let T,L,j,I,K,B;if(C<1)j=Zf(P,C),I=(S+C*P*E)/j,T=N=>{const $=Math.exp(-C*P*N);return l-$*(I*Math.sin(j*N)+E*Math.cos(j*N))},K=C*P*I+E*j,B=C*P*E-I*j,L=N=>Math.exp(-C*P*N)*(K*Math.sin(j*N)+B*Math.cos(j*N));else if(C===1){T=$=>l-Math.exp(-P*$)*(E+(S+P*E)*$);const N=S+P*E;L=$=>Math.exp(-P*$)*(P*N*$-S)}else{const N=P*Math.sqrt(C*C-1);T=J=>{const Z=Math.exp(-C*P*J),ve=Math.min(N*J,300);return l-Z*((S+C*P*E)*Math.sinh(ve)+N*E*Math.cosh(ve))/N};const $=(S+C*P*E)/N,V=C*P*$-E*N,he=C*P*E-$*N;L=J=>{const Z=Math.exp(-C*P*J),ve=Math.min(N*J,300);return Z*(V*Math.sinh(ve)+he*Math.cosh(ve))}}const _={calculatedDuration:w&&p||null,velocity:N=>Cn(L(N)),next:N=>{if(!w&&C<1){const V=Math.exp(-C*P*N),he=Math.sin(j*N),J=Math.cos(j*N),Z=l-V*(I*he+E*J),ve=Cn(V*(K*he+B*J));return c.done=Math.abs(ve)<=i&&Math.abs(l-Z)<=s,c.value=c.done?l:Z,c}const $=T(N);if(w)c.done=N>=p;else{const V=Cn(L(N));c.done=Math.abs(V)<=i&&Math.abs(l-$)<=s}return c.value=c.done?l:$,c},toString:()=>{const N=Math.min(yh(_),Ul),$=Cw(V=>_.next(N*V).value,N,30);return N+"ms "+$},toTransition:()=>{}};return _}Wl.applyToOptions=e=>{const t=aE(e,100,Wl);return e.ease=t.ease,e.duration=Cn(t.duration),e.type="keyframes",e};const pE=5;function Ew(e,t,n){const i=Math.max(t-pE,0);return iw(n-e(i),t-i)}function ed({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:a=500,modifyTarget:l,min:c,max:f,restDelta:h=.5,restSpeed:m}){const p=e[0],v={done:!1,value:p},w=B=>c!==void 0&&B<c||f!==void 0&&B>f,S=B=>c===void 0?f:f===void 0||Math.abs(c-B)<Math.abs(f-B)?c:f;let C=n*t;const E=p+C,P=l===void 0?E:l(E);P!==E&&(C=P-p);const A=B=>-C*Math.exp(-B/i),T=B=>P+A(B),L=B=>{const _=A(B),N=T(B);v.done=Math.abs(_)<=h,v.value=v.done?P:N};let j,I;const K=B=>{w(v.value)&&(j=B,I=Wl({keyframes:[v.value,S(v.value)],velocity:Ew(T,B,v.value),damping:s,stiffness:a,restDelta:h,restSpeed:m}))};return K(0),{calculatedDuration:null,next:B=>{let _=!1;return!I&&j===void 0&&(_=!0,L(B),K(B)),j!==void 0&&B>=j?I.next(B-j):(!_&&L(B),v)}}}function mE(e,t,n){const i=[],s=n||ri.mix||bw,a=e.length-1;for(let l=0;l<a;l++){let c=s(e[l],e[l+1]);if(t){const f=Array.isArray(t)?t[l]||On:t;c=qs(f,c)}i.push(c)}return i}function gE(e,t,{clamp:n=!0,ease:i,mixer:s}={}){const a=e.length;if(cu(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=mE(t,i,s),f=c.length,h=m=>{if(l&&m<e[0])return t[0];let p=0;if(f>1)for(;p<e.length-2&&!(m<e[p+1]);p++);const v=Ls(e[p],e[p+1],m);return c[p](v)};return n?m=>h(dr(e[0],e[a-1],m)):h}function yE(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const s=Ls(0,t,i);e.push(nt(n,1,s))}}function vE(e){const t=[0];return yE(t,e.length-1),t}function xE(e,t){return e.map(n=>n*t)}function wE(e,t){return e.map(()=>t||hw).splice(0,e.length-1)}function Rs({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const s=RC(i)?i.map(Qg):Qg(i),a={done:!1,value:t[0]},l=xE(n&&n.length===t.length?n:vE(t),e),c=gE(l,t,{ease:Array.isArray(s)?s:wE(t,s)});return{calculatedDuration:e,next:f=>(a.value=c(f),a.done=f>=e,a)}}const kE=e=>e!==null;function fu(e,{repeat:t,repeatType:n="loop"},i,s=1){const a=e.filter(kE),c=s<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!c||i===void 0?a[c]:i}const SE={decay:ed,inertia:ed,tween:Rs,keyframes:Rs,spring:Wl};function Tw(e){typeof e.type=="string"&&(e.type=SE[e.type])}class vh{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 bE=e=>e/100;class Hl extends vh{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!==sn.now()&&this.tick(sn.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;Tw(t);const{type:n=Rs,repeat:i=0,repeatDelay:s=0,repeatType:a,velocity:l=0}=t;let{keyframes:c}=t;const f=n||Rs;f!==Rs&&typeof c[0]!="number"&&(this.mixKeyframes=qs(bE,bw(c[0],c[1])),c=[0,100]);const h=f({...t,keyframes:c});a==="mirror"&&(this.mirroredGenerator=f({...t,keyframes:[...c].reverse(),velocity:-l})),h.calculatedDuration===null&&(h.calculatedDuration=yh(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:a,mirroredGenerator:l,resolvedDuration:c,calculatedDuration:f}=this;if(this.startTime===null)return i.next(0);const{delay:h=0,keyframes:m,repeat:p,repeatType:v,repeatDelay:w,type:S,onUpdate:C,finalKeyframe:E}=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 P=this.currentTime-h*(this.playbackSpeed>=0?1:-1),A=this.playbackSpeed>=0?P<0:P>s;this.currentTime=Math.max(P,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let T=this.currentTime,L=i;if(p){const B=Math.min(this.currentTime,s)/c;let _=Math.floor(B),N=B%1;!N&&B>=1&&(N=1),N===1&&_--,_=Math.min(_,p+1),!!(_%2)&&(v==="reverse"?(N=1-N,w&&(N-=w/c)):v==="mirror"&&(L=l)),T=dr(0,1,N)*c}let j;A?(this.delayState.value=m[0],j=this.delayState):j=L.next(T),a&&!A&&(j.value=a(j.value));let{done:I}=j;!A&&f!==null&&(I=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const K=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&I);return K&&S!==ed&&(j.value=fu(m,this.options,E,this.speed)),C&&C(j.value),K&&this.finish(),j}then(t,n){return this.finished.then(t,n)}get duration(){return _n(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+_n(t)}get time(){return _n(this.currentTime)}set time(t){t=Cn(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 Ew(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(sn.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=_n(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=sE,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(sn.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 CE(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ri=e=>e*180/Math.PI,td=e=>{const t=Ri(Math.atan2(e[1],e[0]));return nd(t)},EE={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:td,rotateZ:td,skewX:e=>Ri(Math.atan(e[1])),skewY:e=>Ri(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},nd=e=>(e=e%360,e<0&&(e+=360),e),iy=td,oy=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),sy=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),TE={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:oy,scaleY:sy,scale:e=>(oy(e)+sy(e))/2,rotateX:e=>nd(Ri(Math.atan2(e[6],e[5]))),rotateY:e=>nd(Ri(Math.atan2(-e[2],e[0]))),rotateZ:iy,rotate:iy,skewX:e=>Ri(Math.atan(e[4])),skewY:e=>Ri(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function rd(e){return e.includes("scale")?1:0}function id(e,t){if(!e||e==="none")return rd(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=TE,s=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=EE,s=c}if(!s)return rd(t);const a=i[t],l=s[1].split(",").map(RE);return typeof a=="function"?a(l):l[a]}const PE=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return id(n,t)};function RE(e){return parseFloat(e.trim())}const jo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],No=new Set([...jo,"pathRotation"]),ay=e=>e===Ao||e===Te,AE=new Set(["x","y","z"]),jE=jo.filter(e=>!AE.has(e));function NE(e){const t=[];return jE.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const ti={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})=>id(t,"x"),y:(e,{transform:t})=>id(t,"y")};ti.translateX=ti.x;ti.translateY=ti.y;const Ai=new Set;let od=!1,sd=!1,ad=!1;function Pw(){if(sd){const e=Array.from(Ai).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const s=NE(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(([a,l])=>{i.getValue(a)?.set(l)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}sd=!1,od=!1,Ai.forEach(e=>e.complete(ad)),Ai.clear()}function Rw(){Ai.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(sd=!0)})}function ME(){ad=!0,Rw(),Pw(),ad=!1}class xh{constructor(t,n,i,s,a,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=s,this.element=a,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(Ai.add(this),od||(od=!0,rt.read(Rw),rt.resolveKeyframes(Pw))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:s}=this;if(t[0]===null){const a=s?.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(i&&n){const c=i.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),s&&a===void 0&&s.set(t[0])}CE(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ai.delete(this)}cancel(){this.state==="scheduled"&&(Ai.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const IE=e=>e.startsWith("--");function Aw(e,t,n){IE(t)?e.style.setProperty(t,n):e.style[t]=n}const DE={};function jw(e,t){const n=rw(e);return()=>DE[t]??n()}const LE=jw(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Nw=jw(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Cs=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,ly={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Cs([0,.65,.55,1]),circOut:Cs([.55,0,1,.45]),backIn:Cs([.31,.01,.66,-.59]),backOut:Cs([.33,1.53,.69,.99])};function Mw(e,t){if(e)return typeof e=="function"?Nw()?Cw(e,t):"ease-out":pw(e)?Cs(e):Array.isArray(e)?e.map(n=>Mw(n,t)||ly.easeOut):ly[e]}function _E(e,t,n,{delay:i=0,duration:s=300,repeat:a=0,repeatType:l="loop",ease:c="easeOut",times:f}={},h=void 0){const m={[t]:n};f&&(m.offset=f);const p=Mw(c,s);Array.isArray(p)&&(m.easing=p);const v={delay:i,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:a+1,direction:l==="reverse"?"alternate":"normal"};return h&&(v.pseudoElement=h),e.animate(m,v)}function Iw(e){return typeof e=="function"&&"applyToOptions"in e}function OE({type:e,...t}){return Iw(e)&&Nw()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Dw extends vh{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:s,pseudoElement:a,allowFlatten:l=!1,finalKeyframe:c,onComplete:f}=t;this.isPseudoElement=!!a,this.allowFlatten=l,this.options=t,cu(typeof t.type!="string");const h=OE(t);this.animation=_E(n,i,s,h,a),h.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const m=fu(s,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(m),Aw(n,i,m),this.animation.cancel()}f?.(),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 _n(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+_n(t)}get time(){return _n(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Cn(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&&LE()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),On):s(this)}}const Lw={anticipate:cw,backInOut:uw,circInOut:dw};function FE(e){return e in Lw}function zE(e){typeof e.ease=="string"&&FE(e.ease)&&(e.ease=Lw[e.ease])}const hf=10;class VE extends Dw{constructor(t){zE(t),Tw(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:a,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new Hl({...l,autoplay:!1}),f=Math.max(hf,sn.now()-this.startTime),h=dr(0,hf,f-hf),m=c.sample(f).value,{name:p}=this.options;a&&p&&Aw(a,p,m),n.setWithVelocity(c.sample(Math.max(0,f-h)).value,m,h),c.stop()}}const uy=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Yn.test(e)||e==="0")&&!e.startsWith("url("));function BE(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 $E(e,t,n,i){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],l=uy(s,t),c=uy(a,t);return!l||!c?!1:BE(e)||(n==="spring"||Iw(n))&&i}function ld(e){e.duration=0,e.type="keyframes"}const _w=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),UE=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function WE(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&UE.test(e[t]))return!0;return!1}const HE=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),KE=rw(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function qE(e){const{motionValue:t,name:n,repeatDelay:i,repeatType:s,damping:a,type:l,keyframes:c}=e,f=t?.owner?.current;if(!(f instanceof HTMLElement)&&!(f instanceof SVGElement))return!1;const{onUpdate:h,transformTemplate:m}=t.owner.getProps();return KE()&&n&&(_w.has(n)||HE.has(n)&&WE(c))&&(n!=="transform"||!m)&&!h&&!i&&s!=="mirror"&&a!==0&&l!=="inertia"}const XE=40;class YE extends vh{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:l="loop",keyframes:c,name:f,motionValue:h,element:m,...p}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=sn.now();const v={autoplay:t,delay:n,type:i,repeat:s,repeatDelay:a,repeatType:l,name:f,motionValue:h,element:m,...p},w=m?.KeyframeResolver||xh;this.keyframeResolver=new w(c,(S,C,E)=>this.onKeyframesResolved(S,C,v,!E),f,h,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,i,s){this.keyframeResolver=void 0;const{name:a,type:l,velocity:c,delay:f,isHandoff:h,onUpdate:m}=i;this.resolvedAt=sn.now();let p=!0;$E(t,a,l,c)||(p=!1,(ri.instantAnimations||!f)&&m?.(fu(t,i,n)),t[0]=t[t.length-1],ld(i),i.repeat=0);const w={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>XE?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},S=p&&!h&&qE(w),C=w.motionValue?.owner?.current;let E;if(S)try{E=new VE({...w,element:C})}catch{E=new Hl(w)}else E=new Hl(w);E.finished.then(()=>{this.notifyFinished()}).catch(On),this.pendingTimeline&&(this.stopTimeline=E.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=E}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(),ME()),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 Ow(e,t,n,i=0,s=1){const a=Array.from(e).sort((h,m)=>h.sortNodePosition(m)).indexOf(t),l=e.size,c=(l-1)*i;return typeof n=="function"?n(a,l):s===1?a*i:c-a*i}const cy=30,GE=e=>!isNaN(parseFloat(e));class QE{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const s=sn.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 a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=sn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=GE(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 ch);const i=this.events[t].add(n);return t==="change"?()=>{i(),rt.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=sn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>cy)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,cy);return iw(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 Eo(e,t){return new QE(e,t)}function wh(e,t){if(e?.inherit&&t){const{inherit:n,...i}=e;return{...t,...i}}return e}function kh(e,t){const n=e?.[t]??e?.default??e;return n!==e?wh(n,e):n}const JE={type:"spring",stiffness:500,damping:25,restSpeed:10},ZE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),eT={type:"keyframes",duration:.8},tT={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nT=(e,{keyframes:t})=>t.length>2?eT:No.has(e)?e.startsWith("scale")?ZE(t[1]):JE:tT,rT=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function iT(e){for(const t in e)if(!rT.has(t))return!0;return!1}const Sh=(e,t,n,i={},s,a)=>l=>{const c=kh(i,e)||{},f=c.delay||i.delay||0;let{elapsed:h=0}=i;h=h-Cn(f);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-h,onUpdate:v=>{t.set(v),c.onUpdate&&c.onUpdate(v)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:a?void 0:s};iT(c)||Object.assign(m,nT(e,m)),m.duration&&(m.duration=Cn(m.duration)),m.repeatDelay&&(m.repeatDelay=Cn(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let p=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(ld(m),m.delay===0&&(p=!0)),(ri.instantAnimations||ri.skipAnimations||s?.shouldSkipAnimations||c.skipAnimations)&&(p=!0,ld(m),m.delay=0),m.allowFlatten=!c.type&&!c.ease,p&&!a&&t.get()!==void 0){const v=fu(m.keyframes,c);if(v!==void 0){rt.update(()=>{m.onUpdate(v),m.onComplete()});return}}return c.isSync?new Hl(m):new YE(m)},oT=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function sT(e){const t=oT.exec(e);if(!t)return[,];const[,n,i,s]=t;return[`--${n??i}`,s]}function Fw(e,t,n=1){const[i,s]=sT(e);if(!i)return;const a=window.getComputedStyle(t).getPropertyValue(i);if(a){const l=a.trim();return ew(l)?parseFloat(l):l}return hh(s)?Fw(s,t,n+1):s}function fy(e){const t=[{},{}];return e?.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function bh(e,t,n,i){if(typeof t=="function"){const[s,a]=fy(i);t=t(n!==void 0?n:e.custom,s,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,a]=fy(i);t=t(n!==void 0?n:e.custom,s,a)}return t}function ji(e,t,n){const i=e.getProps();return bh(i,t,n!==void 0?n:i.custom,e)}const zw=new Set(["width","height","top","left","right","bottom",...jo]),ud=e=>Array.isArray(e);function aT(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Eo(n))}function lT(e){return ud(e)?e[e.length-1]||0:e}function uT(e,t){const n=ji(e,t);let{transitionEnd:i={},transition:s={},...a}=n||{};a={...a,...i};for(const l in a){const c=lT(a[l]);aT(e,l,c)}}const Ut=e=>!!(e&&e.getVelocity);function cT(e){return!!(Ut(e)&&e.add)}function cd(e,t){const n=e.getValue("willChange");if(cT(n))return n.add(t);if(!n&&ri.WillChange){const i=new ri.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function Ch(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const fT="framerAppearId",Vw="data-"+Ch(fT);function Bw(e){return e.props[Vw]}function dT({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function $w(e,t,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:a,transitionEnd:l,...c}=t;const f=e.getDefaultTransition();a=a?wh(a,f):f;const h=a?.reduceMotion,m=a?.skipAnimations;i&&(a=i);const p=[],v=s&&e.animationState&&e.animationState.getState()[s],w=a?.path;w&&w.animateVisualElement(e,c,a,n,p);for(const S in c){const C=e.getValue(S,e.latestValues[S]??null),E=c[S];if(E===void 0||v&&dT(v,S))continue;const P={delay:n,...kh(a||{},S)};m&&(P.skipAnimations=!0);const A=C.get();if(A!==void 0&&!C.isAnimating()&&!Array.isArray(E)&&E===A&&!P.velocity){rt.update(()=>C.set(E));continue}let T=!1;if(window.MotionHandoffAnimation){const I=Bw(e);if(I){const K=window.MotionHandoffAnimation(I,S,rt);K!==null&&(P.startTime=K,T=!0)}}cd(e,S);const L=h??e.shouldReduceMotion;C.start(Sh(S,C,E,L&&zw.has(S)?{type:!1}:P,e,T));const j=C.animation;j&&p.push(j)}if(l){const S=()=>rt.update(()=>{l&&uT(e,l)});p.length?Promise.all(p).then(S):S()}return p}function fd(e,t,n={}){const i=ji(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const a=i?()=>Promise.all($w(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(f=0)=>{const{delayChildren:h=0,staggerChildren:m,staggerDirection:p}=s;return hT(e,t,f,h,m,p,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[f,h]=c==="beforeChildren"?[a,l]:[l,a];return f().then(()=>h())}else return Promise.all([a(),l(n.delay)])}function hT(e,t,n=0,i=0,s=0,a=1,l){const c=[];for(const f of e.variantChildren)f.notify("AnimationStart",t),c.push(fd(f,t,{...l,delay:n+(typeof i=="function"?0:i)+Ow(e.variantChildren,f,i,s,a)}).then(()=>f.notify("AnimationComplete",t)));return Promise.all(c)}function pT(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const s=t.map(a=>fd(e,a,n));i=Promise.all(s)}else if(typeof t=="string")i=fd(e,t,n);else{const s=typeof t=="function"?ji(e,t,n.custom):t;i=Promise.all($w(e,s,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const mT={test:e=>e==="auto",parse:e=>e},Uw=e=>t=>t.test(e),Ww=[Ao,Te,fr,Er,BC,VC,mT],dy=e=>Ww.find(Uw(e));function gT(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||nw(e):!0}const yT=new Set(["brightness","contrast","saturate","opacity"]);function vT(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(ph)||[];if(!i)return e;const s=n.replace(i,"");let a=yT.has(t)?1:0;return i!==n&&(a*=100),t+"("+a+s+")"}const xT=/\b([a-z-]*)\(.*?\)/gu,dd={...Yn,getAnimatableNone:e=>{const t=e.match(xT);return t?t.map(vT).join(" "):e}},hd={...Yn,getAnimatableNone:e=>{const t=Yn.parse(e);return Yn.createTransformer(e)(t.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},hy={...Ao,transform:Math.round},wT={rotate:Er,pathRotation:Er,rotateX:Er,rotateY:Er,rotateZ:Er,scale:hl,scaleX:hl,scaleY:hl,scaleZ:hl,skew:Er,skewX:Er,skewY:Er,distance:Te,translateX:Te,translateY:Te,translateZ:Te,x:Te,y:Te,z:Te,perspective:Te,transformPerspective:Te,opacity:_s,originX:Zg,originY:Zg,originZ:Te},Kl={borderWidth:Te,borderTopWidth:Te,borderRightWidth:Te,borderBottomWidth:Te,borderLeftWidth:Te,borderRadius:Te,borderTopLeftRadius:Te,borderTopRightRadius:Te,borderBottomRightRadius:Te,borderBottomLeftRadius:Te,width:Te,maxWidth:Te,height:Te,maxHeight:Te,top:Te,right:Te,bottom:Te,left:Te,inset:Te,insetBlock:Te,insetBlockStart:Te,insetBlockEnd:Te,insetInline:Te,insetInlineStart:Te,insetInlineEnd:Te,padding:Te,paddingTop:Te,paddingRight:Te,paddingBottom:Te,paddingLeft:Te,paddingBlock:Te,paddingBlockStart:Te,paddingBlockEnd:Te,paddingInline:Te,paddingInlineStart:Te,paddingInlineEnd:Te,margin:Te,marginTop:Te,marginRight:Te,marginBottom:Te,marginLeft:Te,marginBlock:Te,marginBlockStart:Te,marginBlockEnd:Te,marginInline:Te,marginInlineStart:Te,marginInlineEnd:Te,fontSize:Te,backgroundPositionX:Te,backgroundPositionY:Te,...wT,zIndex:hy,fillOpacity:_s,strokeOpacity:_s,numOctaves:hy},kT={...Kl,color:Tt,backgroundColor:Tt,outlineColor:Tt,fill:Tt,stroke:Tt,borderColor:Tt,borderTopColor:Tt,borderRightColor:Tt,borderBottomColor:Tt,borderLeftColor:Tt,filter:dd,WebkitFilter:dd,mask:hd,WebkitMask:hd},Hw=e=>kT[e],ST=new Set([dd,hd]);function Kw(e,t){let n=Hw(e);return ST.has(n)||(n=Yn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const bT=new Set(["auto","none","0"]);function CT(e,t,n){let i=0,s;for(;i<e.length&&!s;){const a=e[i];typeof a=="string"&&!bT.has(a)&&Co(a).values.length&&(s=e[i]),i++}if(s&&n)for(const a of t)e[a]=Kw(n,s)}class ET extends xh{constructor(t,n,i,s,a){super(t,n,i,s,a,!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(),hh(p))){const v=Fw(p,n.current);v!==void 0&&(t[m]=v),m===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!zw.has(i)||t.length!==2)return;const[s,a]=t,l=dy(s),c=dy(a),f=Jg(s),h=Jg(a);if(f!==h&&ti[i]){this.needsMeasurement=!0;return}if(l!==c)if(ay(l)&&ay(c))for(let m=0;m<t.length;m++){const p=t[m];typeof p=="string"&&(t[m]=parseFloat(p))}else ti[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,i=[];for(let s=0;s<t.length;s++)(t[s]===null||gT(t[s]))&&i.push(s);i.length&&CT(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=ti[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 a=i.length-1,l=i[a];i[a]=ti[n](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),this.removedTransforms?.length&&this.removedTransforms.forEach(([c,f])=>{t.getValue(c).set(f)}),this.resolveNoneKeyframes()}}const Eh=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function qw(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 pd=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Rl(e){return tw(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Th}=mw(queueMicrotask,!1),Xn={x:!1,y:!1};function Xw(){return Xn.x||Xn.y}function TT(e){return e==="x"||e==="y"?Xn[e]?null:(Xn[e]=!0,()=>{Xn[e]=!1}):Xn.x||Xn.y?null:(Xn.x=Xn.y=!0,()=>{Xn.x=Xn.y=!1})}function Yw(e,t){const n=qw(e),i=new AbortController,s={passive:!0,...t,signal:i.signal};return[n,s,()=>i.abort()]}function PT(e){return!(e.pointerType==="touch"||Xw())}function RT(e,t,n={}){const[i,s,a]=Yw(e,n);return i.forEach(l=>{let c=!1,f=!1,h;const m=()=>{l.removeEventListener("pointerleave",S)},p=E=>{h&&(h(E),h=void 0),m()},v=E=>{c=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),f&&(f=!1,p(E))},w=()=>{c=!0,window.addEventListener("pointerup",v,s),window.addEventListener("pointercancel",v,s)},S=E=>{if(E.pointerType!=="touch"){if(c){f=!0;return}p(E)}},C=E=>{if(!PT(E))return;f=!1;const P=t(l,E);typeof P=="function"&&(h=P,l.addEventListener("pointerleave",S,s))};l.addEventListener("pointerenter",C,s),l.addEventListener("pointerdown",w,s)}),a}const Gw=(e,t)=>t?e===t?!0:Gw(e,t.parentElement):!1,Ph=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,AT=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function jT(e){return AT.has(e.tagName)||e.isContentEditable===!0}const NT=new Set(["INPUT","SELECT","TEXTAREA"]);function MT(e){return NT.has(e.tagName)||e.isContentEditable===!0}const Al=new WeakSet;function py(e){return t=>{t.key==="Enter"&&e(t)}}function pf(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const IT=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=py(()=>{if(Al.has(n))return;pf(n,"down");const s=py(()=>{pf(n,"up")}),a=()=>pf(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function my(e){return Ph(e)&&!Xw()}const gy=new WeakSet;function DT(e,t,n={}){const[i,s,a]=Yw(e,n),l=c=>{const f=c.currentTarget;if(!my(c)||gy.has(c))return;Al.add(f),n.stopPropagation&&gy.add(c);const h=t(f,c),m={...s,capture:!0},p=(S,C)=>{window.removeEventListener("pointerup",v,m),window.removeEventListener("pointercancel",w,m),Al.has(f)&&Al.delete(f),my(S)&&typeof h=="function"&&h(S,{success:C})},v=S=>{p(S,f===window||f===document||n.useGlobalTarget||Gw(f,S.target))},w=S=>{p(S,!1)};window.addEventListener("pointerup",v,m),window.addEventListener("pointercancel",w,m)};return i.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",l,s),Rl(c)&&(c.addEventListener("focus",h=>IT(h,s)),!jT(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),a}function Rh(e){return tw(e)&&"ownerSVGElement"in e}const jl=new WeakMap;let Nl;const Qw=(e,t,n)=>(i,s)=>s&&s[0]?s[0][e+"Size"]:Rh(i)&&"getBBox"in i?i.getBBox()[t]:i[n],LT=Qw("inline","width","offsetWidth"),_T=Qw("block","height","offsetHeight");function OT({target:e,borderBoxSize:t}){jl.get(e)?.forEach(n=>{n(e,{get width(){return LT(e,t)},get height(){return _T(e,t)}})})}function FT(e){e.forEach(OT)}function zT(){typeof ResizeObserver>"u"||(Nl=new ResizeObserver(FT))}function VT(e,t){Nl||zT();const n=qw(e);return n.forEach(i=>{let s=jl.get(i);s||(s=new Set,jl.set(i,s)),s.add(t),Nl?.observe(i)}),()=>{n.forEach(i=>{const s=jl.get(i);s?.delete(t),s?.size||Nl?.unobserve(i)})}}const Ml=new Set;let xo;function BT(){xo=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ml.forEach(t=>t(e))},window.addEventListener("resize",xo)}function $T(e){return Ml.add(e),xo||BT(),()=>{Ml.delete(e),!Ml.size&&typeof xo=="function"&&(window.removeEventListener("resize",xo),xo=void 0)}}function yy(e,t){return typeof e=="function"?$T(e):VT(e,t)}function UT(e){return Rh(e)&&e.tagName==="svg"}const WT=[...Ww,Tt,Yn],HT=e=>WT.find(Uw(e)),vy=()=>({translate:0,scale:1,origin:0,originPoint:0}),wo=()=>({x:vy(),y:vy()}),xy=()=>({min:0,max:0}),Nt=()=>({x:xy(),y:xy()}),KT=new WeakMap;function du(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Os(e){return typeof e=="string"||Array.isArray(e)}const Ah=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],jh=["initial",...Ah];function hu(e){return du(e.animate)||jh.some(t=>Os(e[t]))}function Jw(e){return!!(hu(e)||e.variants)}function qT(e,t,n){for(const i in t){const s=t[i],a=n[i];if(Ut(s))e.addValue(i,s);else if(Ut(a))e.addValue(i,Eo(s,{owner:e}));else if(a!==s)if(e.hasValue(i)){const l=e.getValue(i);l.liveStyle===!0?l.jump(s):l.hasAnimated||l.set(s)}else{const l=e.getStaticValue(i);e.addValue(i,Eo(l!==void 0?l:s,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const md={current:null},Zw={current:!1},XT=typeof window<"u";function YT(){if(Zw.current=!0,!!XT)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>md.current=e.matches;e.addEventListener("change",t),t()}else md.current=!1}const wy=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ql={};function e0(e){ql=e}function GT(){return ql}class QT{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:s,skipAnimations:a,blockInitialAnimation:l,visualState:c},f={}){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=xh,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=sn.now();this.renderScheduledAt<w&&(this.renderScheduledAt=w,rt.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=a,this.options=f,this.blockInitialAnimation=!!l,this.isControllingVariants=hu(n),this.isVariantNode=Jw(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...v}=this.scrapeMotionValuesFromProps(n,{},this);for(const w in v){const S=v[w];h[w]!==void 0&&Ut(S)&&S.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,KT.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:(Zw.current||YT(),this.shouldReduceMotion=md.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(),ii(this.notifyUpdate),ii(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&&_w.has(t)&&this.current instanceof HTMLElement){const{factory:l,keyframes:c,times:f,ease:h,duration:m}=n.accelerate,p=new Dw({element:this.current,name:t,keyframes:c,times:f,ease:h,duration:Cn(m)}),v=l(p);this.valueSubscriptions.set(t,()=>{v(),p.cancel()});return}const i=No.has(t);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&rt.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),a&&a()})}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 ql){const n=ql[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 a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Nt()}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<wy.length;i++){const s=wy[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const a="on"+s,l=t[a];l&&(this.propEventSubscriptions[s]=this.on(s,l))}this.prevMotionValues=qT(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=Eo(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"&&(ew(i)||nw(i))?i=parseFloat(i):!HT(i)&&Yn.test(n)&&(i=Kw(t,n)),this.setBaseTarget(t,Ut(i)?i.get():i)),Ut(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 a=bh(this.props,n,this.presenceContext?.custom);a&&(i=a[t])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Ut(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 ch),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Th.render(this.render)}}class t0 extends QT{constructor(){super(...arguments),this.KeyframeResolver=ET}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;Ut(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ai{constructor(t){this.isMounted=!1,this.node=t}update(){}}function n0({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function JT({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ZT(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 mf(e){return e===void 0||e===1}function gd({scale:e,scaleX:t,scaleY:n}){return!mf(e)||!mf(t)||!mf(n)}function Ci(e){return gd(e)||r0(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function r0(e){return ky(e.x)||ky(e.y)}function ky(e){return e&&e!=="0%"}function Xl(e,t,n){const i=e-n,s=t*i;return n+s}function Sy(e,t,n,i,s){return s!==void 0&&(e=Xl(e,s,i)),Xl(e,n,i)+t}function yd(e,t=0,n=1,i,s){e.min=Sy(e.min,t,n,i,s),e.max=Sy(e.max,t,n,i,s)}function i0(e,{x:t,y:n}){yd(e.x,t.translate,t.scale,t.originPoint),yd(e.y,n.translate,n.scale,n.originPoint)}const by=.999999999999,Cy=1.0000000000001;function eP(e,t,n,i=!1){const s=n.length;if(!s)return;t.x=t.y=1;let a,l;for(let c=0;c<s;c++){a=n[c],l=a.projectionDelta;const{visualElement:f}=a.options;f&&f.props.style&&f.props.style.display==="contents"||(i&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(ur(e.x,-a.scroll.offset.x),ur(e.y,-a.scroll.offset.y)),l&&(t.x*=l.x.scale,t.y*=l.y.scale,i0(e,l)),i&&Ci(a.latestValues)&&Il(e,a.latestValues,a.layout?.layoutBox))}t.x<Cy&&t.x>by&&(t.x=1),t.y<Cy&&t.y>by&&(t.y=1)}function ur(e,t){e.min+=t,e.max+=t}function Ey(e,t,n,i,s=.5){const a=nt(e.min,e.max,s);yd(e,t,n,a,i)}function Ty(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Il(e,t,n){const i=n??e;Ey(e.x,Ty(t.x,i.x),t.scaleX,t.scale,t.originX),Ey(e.y,Ty(t.y,i.y),t.scaleY,t.scale,t.originY)}function o0(e,t){return n0(ZT(e.getBoundingClientRect(),t))}function tP(e,t,n){const i=o0(e,n),{scroll:s}=t;return s&&(ur(i.x,s.offset.x),ur(i.y,s.offset.y)),i}const nP={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},rP=jo.length;function iP(e,t,n){let i="",s=!0;for(let l=0;l<rP;l++){const c=jo[l],f=e[c];if(f===void 0)continue;let h=!0;if(typeof f=="number")h=f===(c.startsWith("scale")?1:0);else{const m=parseFloat(f);h=c.startsWith("scale")?m===1:m===0}if(!h||n){const m=pd(f,Kl[c]);if(!h){s=!1;const p=nP[c]||c;i+=`${p}(${m}) `}n&&(t[c]=m)}}const a=e.pathRotation;return a&&(s=!1,i+=`rotate(${pd(a,Kl.pathRotation)}) `),i=i.trim(),n?i=n(t,s?"":i):s&&(i="none"),i}function Nh(e,t,n){const{style:i,vars:s,transformOrigin:a}=e;let l=!1,c=!1;for(const f in t){const h=t[f];if(No.has(f)){l=!0;continue}else if(yw(f)){s[f]=h;continue}else{const m=pd(h,Kl[f]);f.startsWith("origin")?(c=!0,a[f]=m):i[f]=m}}if(t.transform||(l||n?i.transform=iP(t,e.transform,n):i.transform&&(i.transform="none")),c){const{originX:f="50%",originY:h="50%",originZ:m=0}=a;i.transformOrigin=`${f} ${h} ${m}`}}function s0(e,{style:t,vars:n},i,s){const a=e.style;let l;for(l in t)a[l]=t[l];s?.applyProjectionStyles(a,i);for(l in n)a.setProperty(l,n[l])}function Py(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const vs={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Te.test(e))e=parseFloat(e);else return e;const n=Py(e,t.target.x),i=Py(e,t.target.y);return`${n}% ${i}%`}},oP={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,s=Yn.parse(e);if(s.length>5)return i;const a=Yn.createTransformer(e),l=typeof s[0]!="number"?1:0,c=n.x.scale*t.x,f=n.y.scale*t.y;s[0+l]/=c,s[1+l]/=f;const h=nt(c,f,.5);return typeof s[2+l]=="number"&&(s[2+l]/=h),typeof s[3+l]=="number"&&(s[3+l]/=h),a(s)}},vd={borderRadius:{...vs,applyTo:[...Eh]},borderTopLeftRadius:vs,borderTopRightRadius:vs,borderBottomLeftRadius:vs,borderBottomRightRadius:vs,boxShadow:oP};function a0(e,{layout:t,layoutId:n}){return No.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!vd[e]||e==="opacity")}function Mh(e,t,n){const i=e.style,s=t?.style,a={};if(!i)return a;for(const l in i)(Ut(i[l])||s&&Ut(s[l])||a0(l,e)||n?.getValue(l)?.liveStyle!==void 0)&&(a[l]=i[l]);return a}function sP(e){return window.getComputedStyle(e)}class aP extends t0{constructor(){super(...arguments),this.type="html",this.renderInstance=s0}mount(t){cu(!!t.style),super.mount(t)}readValueFromInstance(t,n){if(No.has(n))return this.projection?.isProjecting?rd(n):PE(t,n);{const i=sP(t),s=(yw(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return o0(t,n)}build(t,n,i){Nh(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return Mh(t,n,i)}}const lP={offset:"stroke-dashoffset",array:"stroke-dasharray"},uP={offset:"strokeDashoffset",array:"strokeDasharray"};function cP(e,t,n=1,i=0,s=!0){e.pathLength=1;const a=s?lP:uP;e[a.offset]=`${-i}`,e[a.array]=`${t} ${n}`}const fP=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function l0(e,{attrX:t,attrY:n,attrScale:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},f,h,m){if(Nh(e,c,h),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:v}=e;p.transform&&(v.transform=p.transform,delete p.transform),(v.transform||p.transformOrigin)&&(v.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),v.transform&&(v.transformBox=m?.transformBox??"fill-box",delete p.transformBox);for(const w of fP)p[w]!==void 0&&(v[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&&cP(p,s,a,l,!1)}const u0=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"]),c0=e=>typeof e=="string"&&e.toLowerCase()==="svg";function dP(e,t,n,i){s0(e,t,void 0,i);for(const s in t.attrs)e.setAttribute(u0.has(s)?s:Ch(s),t.attrs[s])}function f0(e,t,n){const i=Mh(e,t,n);for(const s in e)if(Ut(e[s])||Ut(t[s])){const a=jo.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[a]=e[s]}return i}class hP extends t0{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Nt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(No.has(n)){const i=Hw(n);return i&&i.default||0}return n=u0.has(n)?n:Ch(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return f0(t,n,i)}build(t,n,i){l0(t,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,n,i,s){dP(t,n,i,s)}mount(t){this.isSVGTag=c0(t.tagName),super.mount(t)}}const pP=jh.length;function d0(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?d0(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<pP;n++){const i=jh[n],s=e.props[i];(Os(s)||s===!1)&&(t[i]=s)}return t}function h0(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 mP=[...Ah].reverse(),gP=Ah.length;function yP(e){return t=>Promise.all(t.map(({animation:n,options:i})=>pT(e,n,i)))}function vP(e){let t=yP(e),n=Ry(),i=!0,s=!1;const a=h=>(m,p)=>{const v=ji(e,p,h==="exit"?e.presenceContext?.custom:void 0);if(v){const{transition:w,transitionEnd:S,...C}=v;m={...m,...C,...S}}return m};function l(h){t=h(e)}function c(h){const{props:m}=e,p=d0(e.parent)||{},v=[],w=new Set;let S={},C=1/0;for(let P=0;P<gP;P++){const A=mP[P],T=n[A],L=m[A]!==void 0?m[A]:p[A],j=Os(L),I=A===h?T.isActive:null;I===!1&&(C=P);let K=L===p[A]&&L!==m[A]&&j;if(K&&(i||s)&&e.manuallyAnimateOnMount&&(K=!1),T.protectedKeys={...S},!T.isActive&&I===null||!L&&!T.prevProp||du(L)||typeof L=="boolean")continue;if(A==="exit"&&T.isActive&&I!==!0){T.prevResolvedValues&&(S={...S,...T.prevResolvedValues});continue}const B=xP(T.prevProp,L);let _=B||A===h&&T.isActive&&!K&&j||P>C&&j,N=!1;const $=Array.isArray(L)?L:[L];let V=$.reduce(a(A),{});I===!1&&(V={});const{prevResolvedValues:he={}}=T,J={...he,...V},Z=Q=>{_=!0,w.has(Q)&&(N=!0,w.delete(Q)),T.needsAnimating[Q]=!0;const pe=e.getValue(Q);pe&&(pe.liveStyle=!1)};for(const Q in J){const pe=V[Q],R=he[Q];if(S.hasOwnProperty(Q))continue;let F=!1;ud(pe)&&ud(R)?F=!h0(pe,R)||B:F=pe!==R,F?pe!=null?Z(Q):w.add(Q):pe!==void 0&&w.has(Q)?Z(Q):T.protectedKeys[Q]=!0}T.prevProp=L,T.prevResolvedValues=V,T.isActive&&(S={...S,...V}),(i||s)&&e.blockInitialAnimation&&(_=!1);const ve=K&&B;_&&(!ve||N)&&v.push(...$.map(Q=>{const pe={type:A};if(typeof Q=="string"&&(i||s)&&!ve&&e.manuallyAnimateOnMount&&e.parent){const{parent:R}=e,F=ji(R,Q);if(R.enteringChildren&&F){const{delayChildren:Y}=F.transition||{};pe.delay=Ow(R.enteringChildren,e,Y)}}return{animation:Q,options:pe}}))}if(w.size){const P={};if(typeof m.initial!="boolean"){const A=ji(e,Array.isArray(m.initial)?m.initial[0]:m.initial);A&&A.transition&&(P.transition=A.transition)}w.forEach(A=>{const T=e.getBaseTarget(A),L=e.getValue(A);L&&(L.liveStyle=!0),P[A]=T??null}),v.push({animation:P})}let E=!!v.length;return i&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(E=!1),i=!1,s=!1,E?t(v):Promise.resolve()}function f(h,m){if(n[h].isActive===m)return Promise.resolve();e.variantChildren?.forEach(v=>v.animationState?.setActive(h,m)),n[h].isActive=m;const p=c(h);for(const v in n)n[v].protectedKeys={};return p}return{animateChanges:c,setActive:f,setAnimateFunction:l,getState:()=>n,reset:()=>{n=Ry(),s=!0}}}function xP(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!h0(t,e):!1}function Si(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ry(){return{animate:Si(!0),whileInView:Si(),whileHover:Si(),whileTap:Si(),whileDrag:Si(),whileFocus:Si(),exit:Si()}}function xd(e,t){e.min=t.min,e.max=t.max}function qn(e,t){xd(e.x,t.x),xd(e.y,t.y)}function Ay(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const p0=1e-4,wP=1-p0,kP=1+p0,m0=.01,SP=0-m0,bP=0+m0;function an(e){return e.max-e.min}function CP(e,t,n){return Math.abs(e-t)<=n}function jy(e,t,n,i=.5){e.origin=i,e.originPoint=nt(t.min,t.max,e.origin),e.scale=an(n)/an(t),e.translate=nt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=wP&&e.scale<=kP||isNaN(e.scale))&&(e.scale=1),(e.translate>=SP&&e.translate<=bP||isNaN(e.translate))&&(e.translate=0)}function As(e,t,n,i){jy(e.x,t.x,n.x,i?i.originX:void 0),jy(e.y,t.y,n.y,i?i.originY:void 0)}function Ny(e,t,n,i=0){const s=i?nt(n.min,n.max,i):n.min;e.min=s+t.min,e.max=e.min+an(t)}function EP(e,t,n,i){Ny(e.x,t.x,n.x,i?.x),Ny(e.y,t.y,n.y,i?.y)}function My(e,t,n,i=0){const s=i?nt(n.min,n.max,i):n.min;e.min=t.min-s,e.max=e.min+an(t)}function Yl(e,t,n,i){My(e.x,t.x,n.x,i?.x),My(e.y,t.y,n.y,i?.y)}function Iy(e,t,n,i,s){return e-=t,e=Xl(e,1/n,i),s!==void 0&&(e=Xl(e,1/s,i)),e}function TP(e,t=0,n=1,i=.5,s,a=e,l=e){if(fr.test(t)&&(t=parseFloat(t),t=nt(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=nt(a.min,a.max,i);e===a&&(c-=t),e.min=Iy(e.min,t,n,c,s),e.max=Iy(e.max,t,n,c,s)}function Dy(e,t,[n,i,s],a,l){TP(e,t[n],t[i],t[s],t.scale,a,l)}const PP=["x","scaleX","originX"],RP=["y","scaleY","originY"];function Ly(e,t,n,i){Dy(e.x,t,PP,n?n.x:void 0,i?i.x:void 0),Dy(e.y,t,RP,n?n.y:void 0,i?i.y:void 0)}function _y(e){return e.translate===0&&e.scale===1}function g0(e){return _y(e.x)&&_y(e.y)}function Oy(e,t){return e.min===t.min&&e.max===t.max}function AP(e,t){return Oy(e.x,t.x)&&Oy(e.y,t.y)}function Fy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function y0(e,t){return Fy(e.x,t.x)&&Fy(e.y,t.y)}function zy(e){return an(e.x)/an(e.y)}function Vy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ar(e){return[e("x"),e("y")]}function jP(e,t,n){let i="";const s=e.x.translate/t.x,a=e.y.translate/t.y,l=n?.z||0;if((s||a||l)&&(i=`translate3d(${s}px, ${a}px, ${l}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:m,pathRotation:p,rotateX:v,rotateY:w,skewX:S,skewY:C}=n;h&&(i=`perspective(${h}px) ${i}`),m&&(i+=`rotate(${m}deg) `),p&&(i+=`rotate(${p}deg) `),v&&(i+=`rotateX(${v}deg) `),w&&(i+=`rotateY(${w}deg) `),S&&(i+=`skewX(${S}deg) `),C&&(i+=`skewY(${C}deg) `)}const c=e.x.scale*t.x,f=e.y.scale*t.y;return(c!==1||f!==1)&&(i+=`scale(${c}, ${f})`),i||"none"}const NP=Eh.length,By=e=>typeof e=="string"?parseFloat(e):e,$y=e=>typeof e=="number"||Te.test(e);function MP(e,t,n,i,s,a){s?(e.opacity=nt(0,n.opacity??1,IP(i)),e.opacityExit=nt(t.opacity??1,0,DP(i))):a&&(e.opacity=nt(t.opacity??1,n.opacity??1,i));for(let l=0;l<NP;l++){const c=Eh[l];let f=Uy(t,c),h=Uy(n,c);if(f===void 0&&h===void 0)continue;f||(f=0),h||(h=0),f===0||h===0||$y(f)===$y(h)?(e[c]=Math.max(nt(By(f),By(h),i),0),(fr.test(h)||fr.test(f))&&(e[c]+="%")):e[c]=h}(t.rotate||n.rotate)&&(e.rotate=nt(t.rotate||0,n.rotate||0,i))}function Uy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const IP=v0(0,.5,fw),DP=v0(.5,.95,On);function v0(e,t,n){return i=>i<e?0:i>t?1:n(Ls(e,t,i))}function LP(e,t,n){const i=Ut(e)?e:Eo(e);return i.start(Sh("",i,t,n)),i.animation}function Fs(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}const _P=(e,t)=>e.depth-t.depth;class OP{constructor(){this.children=[],this.isDirty=!1}add(t){uh(this.children,t),this.isDirty=!0}remove(t){Bl(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(_P),this.isDirty=!1,this.children.forEach(t)}}function FP(e,t){const n=sn.now(),i=({timestamp:s})=>{const a=s-n;a>=t&&(ii(i),e(a-t))};return rt.setup(i,!0),()=>ii(i)}function Dl(e){return Ut(e)?e.get():e}class zP{constructor(){this.members=[]}add(t){uh(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&&(Bl(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(Bl(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:a}=t.options;(s===void 0||s!==a)&&(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 Ll={hasAnimatedSinceResize:!0,hasEverUpdated:!1},gf=["","X","Y","Z"],VP=1e3;let BP=0;function yf(e,t,n,i){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),i&&(i[e]=0))}function x0(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Bw(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",rt,!(s||a))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&x0(i)}function w0({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(l={},c=t?.()){this.id=BP++,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(WP),this.nodes.forEach(GP),this.nodes.forEach(QP),this.nodes.forEach(HP)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,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 f=0;f<this.path.length;f++)this.path[f].shouldResetTransform=!0;this.root===this&&(this.nodes=new OP)}addEventListener(l,c){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new ch),this.eventHandlers.get(l).add(c)}notifyListeners(l,...c){const f=this.eventHandlers.get(l);f&&f.notify(...c)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=Rh(l)&&!UT(l),this.instance=l;const{layoutId:c,layout:f,visualElement:h}=this.options;if(h&&!h.current&&h.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(f||c)&&(this.isLayoutDirty=!0),e){let m,p=0;const v=()=>this.root.updateBlockedByResize=!1;rt.read(()=>{p=window.innerWidth}),e(l,()=>{const w=window.innerWidth;w!==p&&(p=w,this.root.updateBlockedByResize=!0,m&&m(),m=FP(v,250),Ll.hasAnimatedSinceResize&&(Ll.hasAnimatedSinceResize=!1,this.nodes.forEach(Ky)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&h&&(c||f)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:p,hasRelativeLayoutChanged:v,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||h.getDefaultTransition()||nR,{onLayoutAnimationStart:C,onLayoutAnimationComplete:E}=h.getProps(),P=!this.targetLayout||!y0(this.targetLayout,w),A=!p&&v;if(this.options.layoutRoot||this.resumeFrom||A||p&&(P||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...kh(S,"layout"),onPlay:C,onComplete:E};(h.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(m,A,T.path)}else p||Ky(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ii(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(JP),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&x0(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:f}=this.options;if(c===void 0&&!f)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const f=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),f&&this.nodes.forEach(qP),this.nodes.forEach(Wy);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Hy);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(XP),this.nodes.forEach(YP),this.nodes.forEach($P),this.nodes.forEach(UP)):this.nodes.forEach(Hy),this.clearAllSnapshots();const c=sn.now();$t.delta=dr(0,1e3/60,c-$t.timestamp),$t.timestamp=c,$t.isProcessing=!0,lf.update.process($t),lf.preRender.process($t),lf.render.process($t),$t.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Th.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(KP),this.sharedNodes.forEach(ZP)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,rt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){rt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!an(this.snapshot.measuredBox.x)&&!an(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 f=0;f<this.path.length;f++)this.path[f].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Nt()),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,l?l.layoutBox:void 0)}updateScroll(l="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(c=!1),c&&this.instance){const f=i(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:f,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:f}}}resetTransform(){if(!s)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!g0(this.projectionDelta),f=this.getTransformTemplate(),h=f?f(this.latestValues,""):void 0,m=h!==this.prevTransformTemplateValue;l&&this.instance&&(c||Ci(this.latestValues)||m)&&(s(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const c=this.measurePageBox();let f=this.removeElementScroll(c);return l&&(f=this.removeTransform(f)),rR(f),{animationId:this.root.animationId,measuredBox:c,layoutBox:f,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return Nt();const c=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(iR))){const{scroll:h}=this.root;h&&(ur(c.x,h.offset.x),ur(c.y,h.offset.y))}return c}removeElementScroll(l){const c=Nt();if(qn(c,l),this.scroll?.wasRoot)return c;for(let f=0;f<this.path.length;f++){const h=this.path[f],{scroll:m,options:p}=h;h!==this.root&&m&&p.layoutScroll&&(m.wasRoot&&qn(c,l),ur(c.x,m.offset.x),ur(c.y,m.offset.y))}return c}applyTransform(l,c=!1,f){const h=f||Nt();qn(h,l);for(let m=0;m<this.path.length;m++){const p=this.path[m];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(ur(h.x,-p.scroll.offset.x),ur(h.y,-p.scroll.offset.y)),Ci(p.latestValues)&&Il(h,p.latestValues,p.layout?.layoutBox)}return Ci(this.latestValues)&&Il(h,this.latestValues,this.layout?.layoutBox),h}removeTransform(l){const c=Nt();qn(c,l);for(let f=0;f<this.path.length;f++){const h=this.path[f];if(!Ci(h.latestValues))continue;let m;h.instance&&(gd(h.latestValues)&&h.updateSnapshot(),m=Nt(),qn(m,h.measurePageBox())),Ly(c,h.latestValues,h.snapshot?.layoutBox,m)}return Ci(this.latestValues)&&Ly(c,this.latestValues),c}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.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!==$t.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==c;if(!(l||f&&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=$t.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Nt(),this.targetWithTransforms=Nt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),EP(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):qn(this.target,this.layout.layoutBox),i0(this.target,this.targetDelta)):qn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||gd(this.parent.latestValues)||r0(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,c,f){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Nt(),this.relativeTargetOrigin=Nt(),Yl(this.relativeTargetOrigin,c,f,this.options.layoutAnchor||void 0),qn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const l=this.getLead(),c=!!this.resumingFrom||this!==l;let f=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(f=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===$t.timestamp&&(f=!1),f)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;qn(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,v=this.treeScale.y;eP(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Nt());const{target:w}=l;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ay(this.prevProjectionDelta.x,this.projectionDelta.x),Ay(this.prevProjectionDelta.y,this.projectionDelta.y)),As(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==v||!Vy(this.projectionDelta.x,this.prevProjectionDelta.x)||!Vy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",w))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.visualElement?.scheduleRender(),l){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=wo(),this.projectionDelta=wo(),this.projectionDeltaWithTransform=wo()}setAnimationOrigin(l,c=!1,f){const h=this.snapshot,m=h?h.latestValues:{},p={...this.latestValues},v=wo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const w=Nt(),S=h?h.source:void 0,C=this.layout?this.layout.source:void 0,E=S!==C,P=this.getStack(),A=!P||P.members.length<=1,T=!!(E&&!A&&this.options.crossfade===!0&&!this.path.some(tR));this.animationProgress=0;let L;const j=f?.interpolateProjection(l);this.mixTargetDelta=I=>{const K=I/1e3,B=j?.(K);B?(v.x.translate=B.x,v.x.scale=nt(l.x.scale,1,K),v.x.origin=l.x.origin,v.x.originPoint=l.x.originPoint,v.y.translate=B.y,v.y.scale=nt(l.y.scale,1,K),v.y.origin=l.y.origin,v.y.originPoint=l.y.originPoint):(qy(v.x,l.x,K),qy(v.y,l.y,K)),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Yl(w,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),eR(this.relativeTarget,this.relativeTargetOrigin,w,K),L&&AP(this.relativeTarget,L)&&(this.isProjectionDirty=!1),L||(L=Nt()),qn(L,this.relativeTarget)),E&&(this.animationValues=p,MP(p,m,this.latestValues,K,T,A)),B&&B.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=B.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=K},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ii(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rt.update(()=>{Ll.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Eo(0)),this.motionValue.jump(0,!1),this.currentAnimation=LP(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),l.onUpdate&&l.onUpdate(c)},onComplete:()=>{l.onComplete&&l.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 l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(VP),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:f,layout:h,latestValues:m}=l;if(!(!c||!f||!h)){if(this!==l&&this.layout&&h&&k0(this.options.animationType,this.layout.layoutBox,h.layoutBox)){f=this.target||Nt();const p=an(this.layout.layoutBox.x);f.x.min=l.target.x.min,f.x.max=f.x.min+p;const v=an(this.layout.layoutBox.y);f.y.min=l.target.y.min,f.y.max=f.y.min+v}qn(c,f),Il(c,m),As(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new zP),this.sharedNodes.get(l).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 l=this.getStack();return l?l.lead===this:!0}getLead(){const{layoutId:l}=this.options;return l?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:l}=this.options;return l?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:c,preserveFollowOpacity:f}={}){const h=this.getStack();h&&h.promote(this,f),l&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let c=!1;const{latestValues:f}=l;if((f.z||f.rotate||f.rotateX||f.rotateY||f.rotateZ||f.skewX||f.skewY)&&(c=!0),!c)return;const h={};f.z&&yf("z",l,h,this.animationValues);for(let m=0;m<gf.length;m++)yf(`rotate${gf[m]}`,l,h,this.animationValues),yf(`skew${gf[m]}`,l,h,this.animationValues);l.render();for(const m in h)l.setStaticValue(m,h[m]),this.animationValues&&(this.animationValues[m]=h[m]);l.scheduleRender()}applyProjectionStyles(l,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const f=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=Dl(c?.pointerEvents)||"",l.transform=f?f(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=Dl(c?.pointerEvents)||""),this.hasProjected&&!Ci(this.latestValues)&&(l.transform=f?f({},""):"none",this.hasProjected=!1);return}l.visibility="";const m=h.animationValues||h.latestValues;this.applyTransformsToTarget();let p=jP(this.projectionDeltaWithTransform,this.treeScale,m);f&&(p=f(m,p)),l.transform=p;const{x:v,y:w}=this.projectionDelta;l.transformOrigin=`${v.origin*100}% ${w.origin*100}% 0`,h.animationValues?l.opacity=h===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:l.opacity=h===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const S in vd){if(m[S]===void 0)continue;const{correct:C,applyTo:E,isCSSVariable:P}=vd[S],A=p==="none"?m[S]:C(m[S],h);if(E){const T=E.length;for(let L=0;L<T;L++)l[E[L]]=A}else P?this.options.visualElement.renderState.vars[S]=A:l[S]=A}this.options.layoutId&&(l.pointerEvents=h===this?Dl(c?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(Wy),this.root.sharedNodes.clear()}}}function $P(e){e.updateLayout()}function UP(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,a=t.source!==e.layout.source;if(s==="size")ar(m=>{const p=a?t.measuredBox[m]:t.layoutBox[m],v=an(p);p.min=n[m].min,p.max=p.min+v});else if(s==="x"||s==="y"){const m=s==="x"?"y":"x";xd(a?t.measuredBox[m]:t.layoutBox[m],n[m])}else k0(s,t.layoutBox,n)&&ar(m=>{const p=a?t.measuredBox[m]:t.layoutBox[m],v=an(n[m]);p.max=p.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+v)});const l=wo();As(l,n,t.layoutBox);const c=wo();a?As(c,e.applyTransform(i,!0),t.measuredBox):As(c,n,t.layoutBox);const f=!g0(l);let h=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:p,layout:v}=m;if(p&&v){const w=e.options.layoutAnchor||void 0,S=Nt();Yl(S,t.layoutBox,p.layoutBox,w);const C=Nt();Yl(C,n,v.layoutBox,w),y0(S,C)||(h=!0),m.options.layoutRoot&&(e.relativeTarget=C,e.relativeTargetOrigin=S,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:f,hasRelativeLayoutChanged:h})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function WP(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 HP(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function KP(e){e.clearSnapshot()}function Wy(e){e.clearMeasurements()}function qP(e){e.isLayoutDirty=!0,e.updateLayout()}function Hy(e){e.isLayoutDirty=!1}function XP(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function YP(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ky(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function GP(e){e.resolveTargetDelta()}function QP(e){e.calcProjection()}function JP(e){e.resetSkewAndRotation()}function ZP(e){e.removeLeadSnapshot()}function qy(e,t,n){e.translate=nt(t.translate,0,n),e.scale=nt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Xy(e,t,n,i){e.min=nt(t.min,n.min,i),e.max=nt(t.max,n.max,i)}function eR(e,t,n,i){Xy(e.x,t.x,n.x,i),Xy(e.y,t.y,n.y,i)}function tR(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const nR={duration:.45,ease:[.4,0,.1,1]},Yy=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Gy=Yy("applewebkit/")&&!Yy("chrome/")?Math.round:On;function Qy(e){e.min=Gy(e.min),e.max=Gy(e.max)}function rR(e){Qy(e.x),Qy(e.y)}function k0(e,t,n){return e==="position"||e==="preserve-aspect"&&!CP(zy(t),zy(n),.2)}function iR(e){return e!==e.root&&e.scroll?.wasRoot}const oR=w0({attachResizeListener:(e,t)=>Fs(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),vf={current:void 0},S0=w0({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!vf.current){const e=new oR({});e.mount(window),e.setOptions({layoutScroll:!0}),vf.current=e}return vf.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),zs=k.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Jy(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function sR(...e){return t=>{let n=!1;const i=e.map(s=>{const a=Jy(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<i.length;s++){const a=i[s];typeof a=="function"?a():Jy(e[s],null)}}}}function aR(...e){return k.useCallback(sR(...e),e)}class lR extends k.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Rl(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const i=n.offsetParent,s=Rl(i)&&i.offsetWidth||0,a=Rl(i)&&i.offsetHeight||0,l=getComputedStyle(n),c=this.props.sizeRef.current;c.height=parseFloat(l.height),c.width=parseFloat(l.width),c.top=n.offsetTop,c.left=n.offsetLeft,c.right=s-c.width-c.left,c.bottom=a-c.height-c.top,c.direction=l.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function uR({children:e,isPresent:t,anchorX:n,anchorY:i,root:s,pop:a}){const l=k.useId(),c=k.useRef(null),f=k.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:h}=k.useContext(zs),m=a!==!1?e.props?.ref??e?.ref:void 0,p=aR(c,m);return k.useInsertionEffect(()=>{const{width:v,height:w,top:S,left:C,right:E,bottom:P,direction:A}=f.current;if(t||a===!1||!c.current||!v||!w)return;const T=A==="rtl",L=n==="left"?T?`right: ${E}`:`left: ${C}`:T?`left: ${C}`:`right: ${E}`,j=i==="bottom"?`bottom: ${P}`:`top: ${S}`;c.current.dataset.motionPopId=l;const I=document.createElement("style");h&&(I.nonce=h);const K=s??document.head;return K.appendChild(I),I.sheet&&I.sheet.insertRule(`
41
+ [data-motion-pop-id="${l}"] {
42
+ position: absolute !important;
43
+ width: ${v}px !important;
44
+ height: ${w}px !important;
45
+ ${L}px !important;
46
+ ${j}px !important;
47
+ }
48
+ `),()=>{c.current?.removeAttribute("data-motion-pop-id"),K.contains(I)&&K.removeChild(I)}},[t]),y.jsx(lR,{isPresent:t,childRef:c,sizeRef:f,pop:a,children:a===!1?e:k.cloneElement(e,{ref:p})})}const cR=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:s,presenceAffectsLayout:a,mode:l,anchorX:c,anchorY:f,root:h})=>{const m=lu(fR),p=k.useId(),v=k.useRef(n),w=k.useRef(i);lh(()=>{v.current=n,w.current=i});let S=!0,C=k.useMemo(()=>(S=!1,{id:p,initial:t,isPresent:n,custom:s,onExitComplete:E=>{m.set(E,!0);for(const P of m.values())if(!P)return;i&&i()},register:E=>(m.set(E,!1),()=>{m.delete(E),!v.current&&!m.size&&w.current?.()})}),[n,m,i]);return a&&S&&(C={...C}),k.useMemo(()=>{m.forEach((E,P)=>m.set(P,!1))},[n]),k.useEffect(()=>{!n&&!m.size&&i&&i()},[n]),e=y.jsx(uR,{pop:l==="popLayout",isPresent:n,anchorX:c,anchorY:f,root:h,children:e}),y.jsx(uu.Provider,{value:C,children:e})};function fR(){return new Map}function b0(e=!0){const t=k.useContext(uu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:s}=t,a=k.useId();k.useEffect(()=>{if(e)return s(a)},[e]);const l=k.useCallback(()=>e&&i&&i(a),[a,i,e]);return!n&&i?[!1,l]:[!0]}const pl=e=>e.key||"";function Zy(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const dR=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:a="sync",propagate:l=!1,anchorX:c="left",anchorY:f="top",root:h})=>{const[m,p]=b0(l),v=k.useMemo(()=>Zy(e),[e]),w=l&&!m?[]:v.map(pl),S=k.useRef(!0),C=k.useRef(v),E=lu(()=>new Map),P=k.useRef(new Set),[A,T]=k.useState(v),[L,j]=k.useState(v);lh(()=>{S.current=!1,C.current=v;for(let B=0;B<L.length;B++){const _=pl(L[B]);w.includes(_)?(E.delete(_),P.current.delete(_)):E.get(_)!==!0&&E.set(_,!1)}},[L,w.length,w.join("-")]);const I=[];if(v!==A){let B=[...v];for(let _=0;_<L.length;_++){const N=L[_],$=pl(N);w.includes($)||(B.splice(_,0,N),I.push(N))}return a==="wait"&&I.length&&(B=I),j(Zy(B)),T(v),null}const{forceRender:K}=k.useContext(ah);return y.jsx(y.Fragment,{children:L.map(B=>{const _=pl(B),N=l&&!m?!1:v===L||w.includes(_),$=()=>{if(P.current.has(_))return;if(E.has(_))P.current.add(_),E.set(_,!0);else return;let V=!0;E.forEach(he=>{he||(V=!1)}),V&&(K?.(),j(C.current),l&&p?.(),i&&i())};return y.jsx(cR,{isPresent:N,initial:!S.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:a,root:h,onExitComplete:N?void 0:$,anchorX:c,anchorY:f,children:B},_)})})},C0=k.createContext({strict:!1}),ev={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 tv=!1;function hR(){if(tv)return;const e={};for(const t in ev)e[t]={isEnabled:n=>ev[t].some(i=>!!n[i])};e0(e),tv=!0}function E0(){return hR(),GT()}function pR(e){const t=E0();for(const n in e)t[n]={...t[n],...e[n]};e0(t)}const mR=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 Gl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||mR.has(e)}let T0=e=>!Gl(e);function P0(e){typeof e=="function"&&(T0=t=>t.startsWith("on")?!Gl(t):e(t))}try{P0(require("@emotion/is-prop-valid").default)}catch{}function gR(e,t,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||Ut(e[s])||(T0(s)||n===!0&&Gl(s)||!t&&!Gl(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}function yR({children:e,isValidProp:t,...n}){t&&P0(t);const i=k.useContext(zs);n={...i,...n},n.transition=wh(n.transition,i.transition),n.isStatic=lu(()=>n.isStatic);const s=k.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations]);return y.jsx(zs.Provider,{value:s,children:e})}const pu=k.createContext({});function vR(e,t){if(hu(e)){const{initial:n,animate:i}=e;return{initial:n===!1||Os(n)?n:void 0,animate:Os(i)?i:void 0}}return e.inherit!==!1?t:{}}function xR(e){const{initial:t,animate:n}=vR(e,k.useContext(pu));return k.useMemo(()=>({initial:t,animate:n}),[nv(t),nv(n)])}function nv(e){return Array.isArray(e)?e.join(" "):e}const Ih=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function R0(e,t,n){for(const i in t)!Ut(t[i])&&!a0(i,n)&&(e[i]=t[i])}function wR({transformTemplate:e},t){return k.useMemo(()=>{const n=Ih();return Nh(n,t,e),Object.assign({},n.vars,n.style)},[t])}function kR(e,t){const n=e.style||{},i={};return R0(i,n,e),Object.assign(i,wR(e,t)),i}function SR(e,t){const n={},i=kR(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 A0=()=>({...Ih(),attrs:{}});function bR(e,t,n,i){const s=k.useMemo(()=>{const a=A0();return l0(a,t,c0(i),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};R0(a,e.style,e),s.style={...a,...s.style}}return s}const CR=["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 Dh(e){return typeof e!="string"||e.includes("-")?!1:!!(CR.indexOf(e)>-1||/[A-Z]/u.test(e))}function ER(e,t,n,{latestValues:i},s,a=!1,l){const f=(l??Dh(e)?bR:SR)(t,i,s,e),h=gR(t,typeof e=="string",a),m=e!==k.Fragment?{...h,...f,ref:n}:{},{children:p}=t,v=k.useMemo(()=>Ut(p)?p.get():p,[p]);return k.createElement(e,{...m,children:v})}function TR({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,s){return{latestValues:PR(n,i,s,e),renderState:t()}}function PR(e,t,n,i){const s={},a=i(e,{});for(const v in a)s[v]=Dl(a[v]);let{initial:l,animate:c}=e;const f=hu(e),h=Jw(e);t&&h&&!f&&e.inherit!==!1&&(l===void 0&&(l=t.initial),c===void 0&&(c=t.animate));let m=n?n.initial===!1:!1;m=m||l===!1;const p=m?c:l;if(p&&typeof p!="boolean"&&!du(p)){const v=Array.isArray(p)?p:[p];for(let w=0;w<v.length;w++){const S=bh(e,v[w]);if(S){const{transitionEnd:C,transition:E,...P}=S;for(const A in P){let T=P[A];if(Array.isArray(T)){const L=m?T.length-1:0;T=T[L]}T!==null&&(s[A]=T)}for(const A in C)s[A]=C[A]}}}return s}const j0=e=>(t,n)=>{const i=k.useContext(pu),s=k.useContext(uu),a=()=>TR(e,t,i,s);return n?a():lu(a)},RR=j0({scrapeMotionValuesFromProps:Mh,createRenderState:Ih}),AR=j0({scrapeMotionValuesFromProps:f0,createRenderState:A0}),jR=Symbol.for("motionComponentSymbol");function NR(e,t,n){const i=k.useRef(n);k.useInsertionEffect(()=>{i.current=n});const s=k.useRef(null);return k.useCallback(a=>{a&&e.onMount?.(a),t&&(a?t.mount(a):t.unmount());const l=i.current;if(typeof l=="function")if(a){const c=l(a);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):l(a);else l&&(l.current=a)},[t])}const N0=k.createContext({});function mo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function MR(e,t,n,i,s,a){const{visualElement:l}=k.useContext(pu),c=k.useContext(C0),f=k.useContext(uu),h=k.useContext(zs),m=h.reducedMotion,p=h.skipAnimations,v=k.useRef(null),w=k.useRef(!1);i=i||c.renderer,!v.current&&i&&(v.current=i(e,{visualState:t,parent:l,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:m,skipAnimations:p,isSVG:a}),w.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const S=v.current,C=k.useContext(N0);S&&!S.projection&&s&&(S.type==="html"||S.type==="svg")&&IR(v.current,n,s,C);const E=k.useRef(!1);k.useInsertionEffect(()=>{S&&E.current&&S.update(n,f)});const P=n[Vw],A=k.useRef(!!P&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(P)&&window.MotionHasOptimisedAnimation?.(P));return lh(()=>{w.current=!0,S&&(E.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),A.current&&S.animationState&&S.animationState.animateChanges())}),k.useEffect(()=>{S&&(!A.current&&S.animationState&&S.animationState.animateChanges(),A.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(P)}),A.current=!1),S.enteringChildren=void 0)}),S}function IR(e,t,n,i){const{layoutId:s,layout:a,drag:l,dragConstraints:c,layoutScroll:f,layoutRoot:h,layoutAnchor:m,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:M0(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!l||c&&mo(c),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:i,crossfade:p,layoutScroll:f,layoutRoot:h,layoutAnchor:m})}function M0(e){if(e)return e.options.allowProjection!==!1?e.projection:M0(e.parent)}function xf(e,{forwardMotionProps:t=!1,type:n}={},i,s){i&&pR(i);const a=n?n==="svg":Dh(e),l=a?AR:RR;function c(h,m){let p;const v={...k.useContext(zs),...h,layoutId:DR(h)},{isStatic:w}=v,S=xR(h),C=l(h,w);if(!w&&typeof window<"u"){LR();const E=_R(v);p=E.MeasureLayout,S.visualElement=MR(e,C,v,s,E.ProjectionNode,a)}return y.jsxs(pu.Provider,{value:S,children:[p&&S.visualElement?y.jsx(p,{visualElement:S.visualElement,...v}):null,ER(e,h,NR(C,S.visualElement,m),C,w,t,a)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const f=k.forwardRef(c);return f[jR]=e,f}function DR({layoutId:e}){const t=k.useContext(ah).id;return t&&e!==void 0?t+"-"+e:e}function LR(e,t){k.useContext(C0).strict}function _R(e){const t=E0(),{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 OR(e,t){if(typeof Proxy>"u")return xf;const n=new Map,i=(a,l)=>xf(a,l,e,t),s=(a,l)=>i(a,l);return new Proxy(s,{get:(a,l)=>l==="create"?i:(n.has(l)||n.set(l,xf(l,void 0,e,t)),n.get(l))})}const FR=(e,t)=>t.isSVG??Dh(e)?new hP(t):new aP(t,{allowProjection:e!==k.Fragment});class zR extends ai{constructor(t){super(t),t.animationState||(t.animationState=vP(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();du(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 VR=0;class BR extends ai{constructor(){super(...arguments),this.id=VR++,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:a,custom:l}=this.node.getProps();if(typeof a=="string"||typeof a=="object"&&a!==null&&!Array.isArray(a)){const c=ji(this.node,a,l);if(c){const{transition:f,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 $R={animation:{Feature:zR},exit:{Feature:BR}};function Gs(e){return{point:{x:e.pageX,y:e.pageY}}}const UR=e=>t=>Ph(t)&&e(t,Gs(t));function js(e,t,n,i){return Fs(e,t,UR(n),i)}const I0=({current:e})=>e?e.ownerDocument.defaultView:null,rv=(e,t)=>Math.abs(e-t);function WR(e,t){const n=rv(e.x,t.x),i=rv(e.y,t.y);return Math.sqrt(n**2+i**2)}const iv=new Set(["auto","scroll"]);class D0{constructor(t,n,{transformPagePoint:i,contextWindow:s=window,dragSnapToOrigin:a=!1,distanceThreshold:l=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=S=>{this.handleScroll(S.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ml(this.lastRawMoveEventInfo,this.transformPagePoint));const S=wf(this.lastMoveEventInfo,this.history),C=this.startEvent!==null,E=WR(S.offset,{x:0,y:0})>=this.distanceThreshold;if(!C&&!E)return;const{point:P}=S,{timestamp:A}=$t;this.history.push({...P,timestamp:A});const{onStart:T,onMove:L}=this.handlers;C||(T&&T(this.lastMoveEvent,S),this.startEvent=this.lastMoveEvent),L&&L(this.lastMoveEvent,S)},this.handlePointerMove=(S,C)=>{this.lastMoveEvent=S,this.lastRawMoveEventInfo=C,this.lastMoveEventInfo=ml(C,this.transformPagePoint),rt.update(this.updatePoint,!0)},this.handlePointerUp=(S,C)=>{this.end();const{onEnd:E,onSessionEnd:P,resumeAnimation:A}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&A&&A(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=wf(S.type==="pointercancel"?this.lastMoveEventInfo:ml(C,this.transformPagePoint),this.history);this.startEvent&&E&&E(S,T),P&&P(S,T)},!Ph(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=l,this.contextWindow=s||window;const f=Gs(t),h=ml(f,this.transformPagePoint),{point:m}=h,{timestamp:p}=$t;this.history=[{...m,timestamp:p}];const{onSessionStart:v}=n;v&&v(t,wf(h,this.history));const w={passive:!0,capture:!0};this.removeListeners=qs(js(this.contextWindow,"pointermove",this.handlePointerMove,w),js(this.contextWindow,"pointerup",this.handlePointerUp,w),js(this.contextWindow,"pointercancel",this.handlePointerUp,w)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const i=getComputedStyle(n);(iv.has(i.overflowX)||iv.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},a={x:s.x-n.x,y:s.y-n.y};a.x===0&&a.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(t,s),rt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ii(this.updatePoint)}}function ml(e,t){return t?{point:t(e.point)}:e}function ov(e,t){return{x:e.x-t.x,y:e.y-t.y}}function wf({point:e},t){return{point:e,delta:ov(e,L0(t)),offset:ov(e,HR(t)),velocity:KR(t,.1)}}function HR(e){return e[0]}function L0(e){return e[e.length-1]}function KR(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const s=L0(e);for(;n>=0&&(i=e[n],!(s.timestamp-i.timestamp>Cn(t)));)n--;if(!i)return{x:0,y:0};i===e[0]&&e.length>2&&s.timestamp-i.timestamp>Cn(t)*2&&(i=e[1]);const a=_n(s.timestamp-i.timestamp);if(a===0)return{x:0,y:0};const l={x:(s.x-i.x)/a,y:(s.y-i.y)/a};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function qR(e,{min:t,max:n},i){return t!==void 0&&e<t?e=i?nt(t,e,i.min):Math.max(e,t):n!==void 0&&e>n&&(e=i?nt(n,e,i.max):Math.min(e,n)),e}function sv(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 XR(e,{top:t,left:n,bottom:i,right:s}){return{x:sv(e.x,n,s),y:sv(e.y,t,i)}}function av(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 YR(e,t){return{x:av(e.x,t.x),y:av(e.y,t.y)}}function GR(e,t){let n=.5;const i=an(e),s=an(t);return s>i?n=Ls(t.min,t.max-i,e.min):i>s&&(n=Ls(e.min,e.max-s,t.min)),dr(0,1,n)}function QR(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 wd=.35;function JR(e=wd){return e===!1?e=0:e===!0&&(e=wd),{x:lv(e,"left","right"),y:lv(e,"top","bottom")}}function lv(e,t,n){return{min:uv(e,t),max:uv(e,n)}}function uv(e,t){return typeof e=="number"?e:e[t]||0}const ZR=new WeakMap;class eA{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=Nt(),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 a=p=>{n&&this.snapToCursor(Gs(p).point),this.stopAnimation()},l=(p,v)=>{const{drag:w,dragPropagation:S,onDragStart:C}=this.getProps();if(w&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=TT(w),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ar(P=>{let A=this.getAxisMotionValue(P).get()||0;if(fr.test(A)){const{projection:T}=this.visualElement;if(T&&T.layout){const L=T.layout.layoutBox[P];L&&(A=an(L)*(parseFloat(A)/100))}}this.originPoint[P]=A}),C&&rt.update(()=>C(p,v),!1,!0),cd(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},c=(p,v)=>{this.latestPointerEvent=p,this.latestPanInfo=v;const{dragPropagation:w,dragDirectionLock:S,onDirectionLock:C,onDrag:E}=this.getProps();if(!w&&!this.openDragLock)return;const{offset:P}=v;if(S&&this.currentDirection===null){this.currentDirection=nA(P),this.currentDirection!==null&&C&&C(this.currentDirection);return}this.updateAxis("x",v.point,P),this.updateAxis("y",v.point,P),this.visualElement.render(),E&&rt.update(()=>E(p,v),!1,!0)},f=(p,v)=>{this.latestPointerEvent=p,this.latestPanInfo=v,this.stop(p,v),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 D0(t,{onSessionStart:a,onStart:l,onMove:c,onSessionEnd:f,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:i,contextWindow:I0(this.visualElement),element:this.visualElement.current})}stop(t,n){const i=t||this.latestPointerEvent,s=n||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!s||!i)return;const{velocity:l}=s;this.startAnimation(l);const{onDragEnd:c}=this.getProps();c&&rt.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||!gl(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let l=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(l=qR(l,this.constraints[t],this.elastic[t])),a.set(l)}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&&mo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=XR(i.layoutBox,t):this.constraints=!1,this.elastic=JR(n),s!==this.constraints&&!mo(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&ar(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=QR(i.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!mo(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 a=tP(i,s.root,this.visualElement.getTransformPagePoint());let l=YR(s.layout.layoutBox,a);if(n){const c=n(JT(l));this.hasMutatedConstraints=!!c,c&&(l=n0(c))}return l}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:a,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),f=this.constraints||{},h=ar(m=>{if(!gl(m,n,this.currentDirection))return;let p=f&&f[m]||{};(l===!0||l===m)&&(p={min:0,max:0});const v=s?200:1e6,w=s?40:1e7,S={type:"inertia",velocity:i?t[m]:0,bounceStiffness:v,bounceDamping:w,timeConstant:750,restDelta:1,restSpeed:10,...a,...p};return this.startAxisValueAnimation(m,S)});return Promise.all(h).then(c)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return cd(this.visualElement,t),i.start(Sh(t,i,0,n,this.visualElement,!1))}stopAnimation(){ar(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){ar(n=>{const{drag:i}=this.getProps();if(!gl(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,a=this.getAxisMotionValue(n);if(s&&s.layout){const{min:l,max:c}=s.layout.layoutBox[n],f=a.get()||0;a.set(t[n]-nt(l,c,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!mo(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};ar(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const f=c.get();s[l]=GR({min:f,max:f},this.constraints[l])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),ar(l=>{if(!gl(l,t,null))return;const c=this.getAxisMotionValue(l),{min:f,max:h}=this.constraints[l];c.set(nt(f,h,s[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;ZR.set(this.visualElement,this);const t=this.visualElement.current,n=js(t,"pointerdown",h=>{const{drag:m,dragListener:p=!0}=this.getProps(),v=h.target,w=v!==t&&MT(v);m&&p&&!w&&this.start(h)});let i;const s=()=>{const{dragConstraints:h}=this.getProps();mo(h)&&h.current&&(this.constraints=this.resolveRefConstraints(),i||(i=tA(t,h.current,()=>this.scalePositionWithinConstraints())))},{projection:a}=this.visualElement,l=a.addEventListener("measure",s);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),rt.read(s);const c=Fs(window,"resize",()=>this.scalePositionWithinConstraints()),f=a.addEventListener("didUpdate",({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(ar(p=>{const v=this.getAxisMotionValue(p);v&&(this.originPoint[p]+=h[p].translate,v.set(v.get()+h[p].translate))}),this.visualElement.render())});return()=>{c(),n(),l(),f&&f(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:a=!1,dragElastic:l=wd,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:a,dragElastic:l,dragMomentum:c}}}function cv(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function tA(e,t,n){const i=yy(e,cv(n)),s=yy(t,cv(n));return()=>{i(),s()}}function gl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function nA(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class rA extends ai{constructor(t){super(t),this.removeGroupControls=On,this.removeListeners=On,this.controls=new eA(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||On}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 kf=e=>(t,n)=>{e&&rt.update(()=>e(t,n),!1,!0)};class iA extends ai{constructor(){super(...arguments),this.removePointerDownListener=On}onPointerDown(t){this.session=new D0(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:I0(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:kf(t),onStart:kf(n),onMove:kf(i),onEnd:(a,l)=>{delete this.session,s&&rt.postRender(()=>s(a,l))}}}mount(){this.removePointerDownListener=js(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 Sf=!1;class oA extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:a}=t;a&&(n.group&&n.group.add(a),i&&i.register&&s&&i.register(a),Sf&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ll.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:s,isPresent:a}=this.props,{projection:l}=i;return l&&(l.isPresent=a,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),Sf=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==a?l.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?l.promote():l.relegate()||rt.postRender(()=>{const c=l.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(),Th.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=t;Sf=!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 _0(e){const[t,n]=b0(),i=k.useContext(ah);return y.jsx(oA,{...e,layoutGroup:i,switchLayoutGroup:k.useContext(N0),isPresent:t,safeToRemove:n})}const sA={pan:{Feature:iA},drag:{Feature:rA,ProjectionNode:S0,MeasureLayout:_0}};function fv(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,a=i[s];a&&rt.postRender(()=>a(t,Gs(t)))}class aA extends ai{mount(){const{current:t}=this.node;t&&(this.unmount=RT(t,(n,i)=>(fv(this.node,i,"Start"),s=>fv(this.node,s,"End"))))}unmount(){}}class lA extends ai{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=qs(Fs(this.node.current,"focus",()=>this.onFocus()),Fs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function dv(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),a=i[s];a&&rt.postRender(()=>a(t,Gs(t)))}class uA extends ai{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=DT(t,(s,a)=>(dv(this.node,a,"Start"),(l,{success:c})=>dv(this.node,l,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const kd=new WeakMap,bf=new WeakMap,cA=e=>{const t=kd.get(e.target);t&&t(e)},fA=e=>{e.forEach(cA)};function dA({root:e,...t}){const n=e||document;bf.has(n)||bf.set(n,{});const i=bf.get(n),s=JSON.stringify(t);return i[s]||(i[s]=new IntersectionObserver(fA,{root:e,...t})),i[s]}function hA(e,t,n){const i=dA(t);return kd.set(e,n),i.observe(e),()=>{kd.delete(e),i.unobserve(e)}}const pA={some:0,all:1};class mA extends ai{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:a}=t,l={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:pA[s]},c=f=>{const{isIntersecting:h}=f;if(this.isInView===h||(this.isInView=h,a&&!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(),v=h?m:p;v&&v(f)};this.stopObserver=hA(this.node.current,l,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(gA(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function gA({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const yA={inView:{Feature:mA},tap:{Feature:uA},focus:{Feature:lA},hover:{Feature:aA}},vA={layout:{ProjectionNode:S0,MeasureLayout:_0}},xA={...$R,...yA,...sA,...vA},ko=OR(xA,FR);class Ql extends Error{constructor(t,n){super(n),this.status=t}}function wA(e){let t="";for(let i=0;i<e.length;i+=32768)t+=String.fromCharCode(...e.subarray(i,i+32768));return btoa(t)}function kA(e=globalThis.fetch.bind(globalThis)){async function t(n,i){const s=(i?.method??"GET").toUpperCase(),l=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 l.text();let f=null;if(c)try{f=JSON.parse(c)}catch{throw new Ql(l.status,l.ok?"Server returned an invalid response":`HTTP ${l.status}`)}if(!l.ok){const h=f&&typeof f=="object"&&"error"in f&&f.error&&typeof f.error=="object"&&"message"in f.error&&typeof f.error.message=="string"?f.error.message:`HTTP ${l.status}`;throw new Ql(l.status,h)}return f}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,s)=>t(`/api/conversations/${encodeURIComponent(n)}/page?limit=50${i?`&before=${encodeURIComponent(i)}`:""}`,{signal:s}),markRead:n=>t(`/api/conversations/${encodeURIComponent(n)}/read`,{method:"POST"}),send:(n,i,s,a)=>t("/api/messages/send",{method:"POST",signal:a,body:JSON.stringify({contact:n,text:i,...s?{reply_to_wire_id:s}:{}})}),commands:(n,i)=>t(`/api/contacts/${encodeURIComponent(n)}/commands`,{signal:i}),sendCommand:(n,i,s,a,l,c)=>t("/api/commands/send",{method:"POST",signal:c,body:JSON.stringify({contact:n,recipient_cid:n,command:i,arguments:s,invocation_id:a,catalog_fingerprint:l,confirmed:!0})}),sendFile:async(n,i,s,a,l)=>t("/api/messages/send-file",{method:"POST",body:JSON.stringify({contact:n,data_base64:wA(new Uint8Array(await i.arrayBuffer())),filename:s,mime:a,...l?{reply_to_wire_id:l}:{}})}),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 Ye=kA(),Sd="ours-messenger-live-event";function O0(e){window.dispatchEvent(new CustomEvent(Sd,{detail:e}))}function SA(e){const t=n=>{const i=n.detail;i?.v===1&&e(i)};return window.addEventListener(Sd,t),()=>window.removeEventListener(Sd,t)}function bA(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=a=>{n.addEventListener(a,l=>{try{const c=JSON.parse(l.data);c&&c.v===1&&e({...c,type:a})}catch{}})};return s("sync_required"),s("message_received"),s("receipt_received"),s("file_received"),()=>n.close()}function CA(e=window.location){return`${e.protocol==="https:"?"wss:":"ws:"}//${e.host}/api/presence`}function EA(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 TA(e){let t=!1,n=null,i,s=1e3,a=0;const l=()=>{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,f()},m)},f=async()=>{if(l(),t||document.visibilityState!=="visible")return;const m=++a;e.onState?.("connecting");try{const[p,v]=await Promise.all([e.identity(),e.registration.pushManager.getSubscription()]);if(t||m!==a||document.visibilityState!=="visible")return;const w=v?.toJSON(),S=v?.endpoint,C=w?.keys?.auth;if(!S||!C)return;const E=new WebSocket(CA());n=E,E.onopen=()=>E.send(JSON.stringify({identity:p.cid,endpoint:S,auth:C})),E.onmessage=P=>{let A;try{A=JSON.parse(String(P.data))}catch{return}if(A?.ok===!0){s=1e3,e.onState?.("live");return}const T=EA(A);T&&e.onEvent(T)},E.onclose=()=>{n===E&&(n=null),m===a&&c()},E.onerror=()=>E.close()}catch{m===a&&c()}},h=()=>{a++,document.visibilityState==="visible"?(s=1e3,f()):l()};return document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",l),f(),()=>{t=!0,a++,document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",l),l()}}function PA(e,t){return t.visibility==="visible"&&t.appRoute==="chats"&&t.selectedContactCid===e&&(t.desktopLayout||t.mobileDetailOpen)&&!t.conversationCoveringDialogOpen}class RA{#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 Cf(e){if(e==="/"||e==="/chats"||e==="/chats/")return{name:"chats",contactCid:null};const t=/^\/chats\/([^/]+)\/contact\/?$/.exec(e);if(t)try{const i=decodeURIComponent(t[1]);if(i)return{name:"contact",contactCid:i}}catch{}const n=/^\/chats\/([^/]+)\/?$/.exec(e);if(n)try{const i=decodeURIComponent(n[1]);if(i)return{name:"chats",contactCid:i}}catch{}return{name:"not_found",pathname:e}}function Qr(e){return e?`/chats/${encodeURIComponent(e)}`:"/chats"}function AA(e){return`/chats/${encodeURIComponent(e)}/contact`}function jA(e){return typeof e=="object"&&e!==null&&e.oursMessenger===!0?"back":"replace"}const hv={read:2,delivered:1};function pv(e){return e&&Object.hasOwn(hv,e)?hv[e]:0}function bd(e,t){return pv(t)>pv(e)?t:e}const NA=()=>({contacts:[],pending:[]});function MA(e){return{identity:null,contacts:NA(),route:e,pages:{},pendingSends:{},drafts:{},replies:{},connection:"connecting",search:"",mobileDetailOpen:e.name==="chats"&&e.contactCid!==null||e.name==="contact",coveringDialog:!1,dialogBusy:!1,generatedInvite:null,sendingDialog:null,error:null,loaded:!1}}function Ei(e,t){return`${e}:${t}`}function or(e){return e.route.name==="chats"||e.route.name==="contact"?e.route.contactCid:null}function sr(e,t){return e.identity?e.pages[Ei(e.identity.cid,t)]??null:null}function IA(e,t){const n=bd(e.receipt,t.receipt);return n===t.receipt?t:{...t,receipt:n}}function lo(e,t){const n=[...e],i=new Map;n.forEach((s,a)=>{s.wire_id&&i.set(s.wire_id,a)});for(const s of t){const a=s.wire_id?i.get(s.wire_id):void 0;a===void 0?(s.wire_id&&i.set(s.wire_id,n.length),n.push(s)):n[a]=IA(n[a],s)}return n}function mv(e,t){const n=or(e);return!n||t.contacts.some(i=>i.container_id===n)?{}:{route:{name:"chats",contactCid:null},mobileDetailOpen:!1}}function gv(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}:{},...mv(e,t.contacts)}}case"contacts":return{...e,contacts:t.contacts,...mv(e,t.contacts)};case"page":{if(!e.identity)return e;const n=Ei(e.identity.cid,t.contactCid),i=e.pages[n],s=e.pendingSends[n]??[],a=new Set(t.page.messages.map(v=>v.wire_id)),l=s.filter(v=>!a.has(v.wire_id)),c=new Map(i?.messages.map(v=>[v.wire_id,v.receipt])??[]),f=i?t.page.messages.map(v=>{const w=bd(c.get(v.wire_id)??null,v.receipt);return w===v.receipt?v:{...v,receipt:w}}):t.page.messages,h=i&&i.messages.length>50?{...t.page,messages:lo(i.messages,f),hasMore:i.hasMore,nextBefore:i.nextBefore}:{...t.page,messages:f},m=lo(h.messages,l),p={...h,messages:m,total:Math.max(h.total+l.length,m.length)};return{...e,pages:{...e.pages,[n]:p},pendingSends:{...e.pendingSends,[n]:l.length?l:void 0}}}case"sent_message":{if(!e.identity)return e;const n=Ei(e.identity.cid,t.contactCid),i=e.pages[n];if(i?.messages.some(l=>l.wire_id===t.message.wire_id))return e;const s=lo(e.pendingSends[n]??[],[t.message]);if(!i)return{...e,pendingSends:{...e.pendingSends,[n]:s}};const a=lo(i.messages,[t.message]);return{...e,pages:{...e.pages,[n]:{...i,messages:a,total:Math.max(i.total+1,a.length)}},pendingSends:{...e.pendingSends,[n]:s}}}case"receipt":{if(!e.identity)return e;const n=Ei(e.identity.cid,t.contactCid),i=e.pages[n],s=e.pendingSends[n],a=new Set(t.wireIds),l=h=>{let m=!1;const p=h.map(v=>{if(!v.wire_id||!a.has(v.wire_id))return v;const w=bd(v.receipt,t.kind);return w===v.receipt?v:(m=!0,{...v,receipt:w})});return m?p:h},c=i?l(i.messages):void 0,f=s?l(s):void 0;return c===i?.messages&&f===s?e:{...e,pages:i&&c?{...e.pages,[n]:{...i,messages:c}}:e.pages,pendingSends:s&&f?{...e.pendingSends,[n]:f}:e.pendingSends}}case"older_page":{if(!e.identity)return e;const n=Ei(e.identity.cid,t.contactCid),i=e.pages[n];if(!i)return e;const s=lo(lo(t.page.messages,t.newer),i.messages),a={...t.page,preview:i.preview,total:Math.max(t.page.total,i.total,s.length),messages:s};return{...e,pages:{...e.pages,[n]:a}}}case"route":return{...e,route:t.route,mobileDetailOpen:t.mobileDetailOpen??(t.route.name==="chats"&&t.route.contactCid!==null||t.route.name==="contact")};case"connection":return{...e,connection:t.connection};case"search":return{...e,search:t.search};case"draft":return e.identity?{...e,drafts:{...e.drafts,[Ei(e.identity.cid,t.contactCid)]:t.value}}:e;case"reply":return e.identity?{...e,replies:{...e.replies,[Ei(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 DA(e,t,n){return!e||t?"ignore":n?"defer":"reload"}function Qs(){return{api:Ye,notification:globalThis.Notification,navigator}}function ei(e,t,n){return new Promise((i,s)=>{const a=setTimeout(()=>s(new Error(`${n} did not complete within ${t/1e3}s — try again`)),t);e.then(l=>{clearTimeout(a),i(l)},l=>{clearTimeout(a),s(l)})})}async function LA(e,t={}){let n=null,i=!1,s=!1;const a="serviceWorker"in navigator&&window.isSecureContext,l=()=>e({supported:a,offline:!navigator.onLine,updateAvailable:i,registration:n}),c=()=>l(),f=()=>l(),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 S=w.data.contact_id,C=w.data.wire_id,E=w.data.kind;typeof S=="string"&&typeof C=="string"&&O0({v:1,type:E==="file"?"file_received":"message_received",contact_id:S,wire_id:C,date:new Date().toISOString()})}},p=a&&!!navigator.serviceWorker.controller,v=()=>{const w=DA(p,s,t.shouldDeferReload?.()??!1);if(w!=="ignore"){if(w==="defer"){i=!0,l();return}s=!0,(t.reload??(()=>location.reload()))()}};if(window.addEventListener("online",c),window.addEventListener("offline",f),document.addEventListener("visibilitychange",h),navigator.serviceWorker?.addEventListener("message",m),navigator.serviceWorker?.addEventListener("controllerchange",v),a){n=await navigator.serviceWorker.register("/sw.js",{scope:"/",updateViaCache:"none"}),await navigator.serviceWorker.ready;const w=S=>S?.addEventListener("statechange",()=>{S.state==="installed"&&navigator.serviceWorker.controller&&(i=!0,l())});w(n.installing),n.addEventListener("updatefound",()=>w(n?.installing??null)),n.update().catch(()=>{})}return l(),()=>{window.removeEventListener("online",c),window.removeEventListener("offline",f),document.removeEventListener("visibilitychange",h),navigator.serviceWorker?.removeEventListener("message",m),navigator.serviceWorker?.removeEventListener("controllerchange",v)}}async function yv(e,t=()=>location.reload(),n=navigator.serviceWorker){const i=e.waiting;if(!i){t();return}await ei(new Promise(s=>{let a=!1;const l=()=>{a||(a=!0,n.removeEventListener("controllerchange",l),t(),s())};n.addEventListener("controllerchange",l),i.postMessage({type:"SKIP_WAITING"})}),1e4,"service-worker update")}function _A(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 OA(e){return e?e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength):null}function vv(e,t){const n=OA(e);return!!n&&n.length===t.length&&n.every((i,s)=>i===t[s])}function Cd(e=navigator.userAgent){return/iP(?:hone|ad|od)/.test(e)}function Ed(e=navigator,t=window){return Cd(e.userAgent)&&(e.standalone===!0||t.matchMedia("(display-mode: standalone)").matches)}function FA(){return Cd()&&!Ed()?"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"?Cd()?"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 zA(e={}){const t=e.notification??Qs().notification;if(!t)return Promise.reject(new Error("notification permission is unavailable"));const n=new Promise((i,s)=>{let a=!1;const l=c=>{if(a)return;const f=c??t.permission;f!=="granted"&&f!=="denied"&&f!=="default"||(a=!0,i(f))};try{const c=t.requestPermission(l);c&&typeof c.then=="function"&&c.then(l,s)}catch(c){s(c)}});return ei(n,e.timeoutMs??15e3,"notification permission")}function F0(e,t){return!!e&&!!e.pushManager&&!!t.notification&&!!t.navigator.serviceWorker}function Ni(e,t={}){return{status:e,preview:"full",...t}}async function VA(e,t,n){let i=await ei(e.pushManager.getSubscription(),5e3,"push subscription lookup");if((n||i?.options.applicationServerKey&&!vv(i.options.applicationServerKey,t))&&(i&&await ei(i.unsubscribe(),5e3,"stale push unsubscribe"),i=null),i&&vv(i.options.applicationServerKey,t))return i;try{return await ei(e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t}),15e3,"push subscribe")}catch(s){const a=await e.pushManager.getSubscription();if(!a)throw s;return await ei(a.unsubscribe(),5e3,"stale push unsubscribe"),ei(e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t}),15e3,"push repair")}}async function z0(e,t,n,i){const s=await i.api.vapidPublicKey(),l=await ei(Promise.resolve(i.navigator.serviceWorker.ready),1e4,"service-worker readiness")??e,c=_A(s.publicKey),h=(await VA(l,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 xv(e,t=Qs()){return F0(e,t)?t.notification.permission!=="granted"?Ni("needs-permission",{blocked:t.notification.permission==="denied"}):await e.pushManager.getSubscription()?z0(e,void 0,!1,t):Ni("off"):Ni("unsupported")}async function V0(e,t={},n=Qs()){if(!F0(e,n))return Ni("unsupported");const i=await zA({notification:n.notification});return i!=="granted"?Ni("needs-permission",{blocked:i==="denied"}):z0(e,t.preview??"full",t.forceFresh??!1,n)}const BA=(e,t,n=Qs())=>V0(e,{preview:t,forceFresh:!0},n);async function $A(e,t,n=Qs()){const i=await e.pushManager.getSubscription(),s=[];if(t.bindingId)try{await n.api.deletePush(t.bindingId)}catch(a){s.push(a)}if(i)try{await i.unsubscribe()}catch(a){s.push(a)}if(s.length)throw new Error("notification disable did not fully converge — choose Repair and try again");return Ni("off",{preview:t.preview})}function UA(e=15e3){if(!("serviceWorker"in navigator))return()=>{};let t;const n=()=>{const a={type:"ours-visibility",state:document.visibilityState,ts:Date.now(),iosStandalone:Ed()};navigator.serviceWorker.ready.then(l=>{(navigator.serviceWorker.controller??l.active)?.postMessage(a)}).catch(()=>{})},i=()=>{n(),t!==void 0&&clearInterval(t),t=document.visibilityState==="visible"?setInterval(n,e):void 0,document.visibilityState==="visible"&&B0()},s=a=>{a.data?.type!=="ours-visibility-query"||!a.ports?.[0]||a.ports[0].postMessage({type:"ours-visibility-reply",state:document.visibilityState,iosStandalone:Ed()})};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 B0(){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{}}/**
49
+ * @license lucide-react v0.468.0 - ISC
50
+ *
51
+ * This source code is licensed under the ISC license.
52
+ * See the LICENSE file in the root directory of this source tree.
53
+ */const WA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$0=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/**
54
+ * @license lucide-react v0.468.0 - ISC
55
+ *
56
+ * This source code is licensed under the ISC license.
57
+ * See the LICENSE file in the root directory of this source tree.
58
+ */var HA={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"};/**
59
+ * @license lucide-react v0.468.0 - ISC
60
+ *
61
+ * This source code is licensed under the ISC license.
62
+ * See the LICENSE file in the root directory of this source tree.
63
+ */const KA=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:s="",children:a,iconNode:l,...c},f)=>k.createElement("svg",{ref:f,...HA,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:$0("lucide",s),...c},[...l.map(([h,m])=>k.createElement(h,m)),...Array.isArray(a)?a:[a]]));/**
64
+ * @license lucide-react v0.468.0 - ISC
65
+ *
66
+ * This source code is licensed under the ISC license.
67
+ * See the LICENSE file in the root directory of this source tree.
68
+ */const $e=(e,t)=>{const n=k.forwardRef(({className:i,...s},a)=>k.createElement(KA,{ref:a,iconNode:t,className:$0(`lucide-${WA(e)}`,i),...s}));return n.displayName=`${e}`,n};/**
69
+ * @license lucide-react v0.468.0 - ISC
70
+ *
71
+ * This source code is licensed under the ISC license.
72
+ * See the LICENSE file in the root directory of this source tree.
73
+ */const qA=$e("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
74
+ * @license lucide-react v0.468.0 - ISC
75
+ *
76
+ * This source code is licensed under the ISC license.
77
+ * See the LICENSE file in the root directory of this source tree.
78
+ */const XA=$e("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"}]]);/**
79
+ * @license lucide-react v0.468.0 - ISC
80
+ *
81
+ * This source code is licensed under the ISC license.
82
+ * See the LICENSE file in the root directory of this source tree.
83
+ */const YA=$e("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"}]]);/**
84
+ * @license lucide-react v0.468.0 - ISC
85
+ *
86
+ * This source code is licensed under the ISC license.
87
+ * See the LICENSE file in the root directory of this source tree.
88
+ */const wv=$e("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"}]]);/**
89
+ * @license lucide-react v0.468.0 - ISC
90
+ *
91
+ * This source code is licensed under the ISC license.
92
+ * See the LICENSE file in the root directory of this source tree.
93
+ */const GA=$e("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
94
+ * @license lucide-react v0.468.0 - ISC
95
+ *
96
+ * This source code is licensed under the ISC license.
97
+ * See the LICENSE file in the root directory of this source tree.
98
+ */const QA=$e("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
99
+ * @license lucide-react v0.468.0 - ISC
100
+ *
101
+ * This source code is licensed under the ISC license.
102
+ * See the LICENSE file in the root directory of this source tree.
103
+ */const JA=$e("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
104
+ * @license lucide-react v0.468.0 - ISC
105
+ *
106
+ * This source code is licensed under the ISC license.
107
+ * See the LICENSE file in the root directory of this source tree.
108
+ */const ZA=$e("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"}]]);/**
109
+ * @license lucide-react v0.468.0 - ISC
110
+ *
111
+ * This source code is licensed under the ISC license.
112
+ * See the LICENSE file in the root directory of this source tree.
113
+ */const ej=$e("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
114
+ * @license lucide-react v0.468.0 - ISC
115
+ *
116
+ * This source code is licensed under the ISC license.
117
+ * See the LICENSE file in the root directory of this source tree.
118
+ */const tj=$e("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"}]]);/**
119
+ * @license lucide-react v0.468.0 - ISC
120
+ *
121
+ * This source code is licensed under the ISC license.
122
+ * See the LICENSE file in the root directory of this source tree.
123
+ */const nj=$e("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"}]]);/**
124
+ * @license lucide-react v0.468.0 - ISC
125
+ *
126
+ * This source code is licensed under the ISC license.
127
+ * See the LICENSE file in the root directory of this source tree.
128
+ */const rj=$e("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"}]]);/**
129
+ * @license lucide-react v0.468.0 - ISC
130
+ *
131
+ * This source code is licensed under the ISC license.
132
+ * See the LICENSE file in the root directory of this source tree.
133
+ */const kv=$e("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"}]]);/**
134
+ * @license lucide-react v0.468.0 - ISC
135
+ *
136
+ * This source code is licensed under the ISC license.
137
+ * See the LICENSE file in the root directory of this source tree.
138
+ */const ij=$e("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"}]]);/**
139
+ * @license lucide-react v0.468.0 - ISC
140
+ *
141
+ * This source code is licensed under the ISC license.
142
+ * See the LICENSE file in the root directory of this source tree.
143
+ */const oj=$e("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"}]]);/**
144
+ * @license lucide-react v0.468.0 - ISC
145
+ *
146
+ * This source code is licensed under the ISC license.
147
+ * See the LICENSE file in the root directory of this source tree.
148
+ */const sj=$e("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"}]]);/**
149
+ * @license lucide-react v0.468.0 - ISC
150
+ *
151
+ * This source code is licensed under the ISC license.
152
+ * See the LICENSE file in the root directory of this source tree.
153
+ */const aj=$e("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"}]]);/**
154
+ * @license lucide-react v0.468.0 - ISC
155
+ *
156
+ * This source code is licensed under the ISC license.
157
+ * See the LICENSE file in the root directory of this source tree.
158
+ */const lj=$e("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"}]]);/**
159
+ * @license lucide-react v0.468.0 - ISC
160
+ *
161
+ * This source code is licensed under the ISC license.
162
+ * See the LICENSE file in the root directory of this source tree.
163
+ */const uj=$e("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
164
+ * @license lucide-react v0.468.0 - ISC
165
+ *
166
+ * This source code is licensed under the ISC license.
167
+ * See the LICENSE file in the root directory of this source tree.
168
+ */const cj=$e("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"}]]);/**
169
+ * @license lucide-react v0.468.0 - ISC
170
+ *
171
+ * This source code is licensed under the ISC license.
172
+ * See the LICENSE file in the root directory of this source tree.
173
+ */const fj=$e("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"}]]);/**
174
+ * @license lucide-react v0.468.0 - ISC
175
+ *
176
+ * This source code is licensed under the ISC license.
177
+ * See the LICENSE file in the root directory of this source tree.
178
+ */const dj=$e("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"}]]);/**
179
+ * @license lucide-react v0.468.0 - ISC
180
+ *
181
+ * This source code is licensed under the ISC license.
182
+ * See the LICENSE file in the root directory of this source tree.
183
+ */const hj=$e("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
184
+ * @license lucide-react v0.468.0 - ISC
185
+ *
186
+ * This source code is licensed under the ISC license.
187
+ * See the LICENSE file in the root directory of this source tree.
188
+ */const pj=$e("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"}]]);/**
189
+ * @license lucide-react v0.468.0 - ISC
190
+ *
191
+ * This source code is licensed under the ISC license.
192
+ * See the LICENSE file in the root directory of this source tree.
193
+ */const mj=$e("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"}]]);/**
194
+ * @license lucide-react v0.468.0 - ISC
195
+ *
196
+ * This source code is licensed under the ISC license.
197
+ * See the LICENSE file in the root directory of this source tree.
198
+ */const gj=$e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
199
+ * @license lucide-react v0.468.0 - ISC
200
+ *
201
+ * This source code is licensed under the ISC license.
202
+ * See the LICENSE file in the root directory of this source tree.
203
+ */const yj=$e("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"}]]);/**
204
+ * @license lucide-react v0.468.0 - ISC
205
+ *
206
+ * This source code is licensed under the ISC license.
207
+ * See the LICENSE file in the root directory of this source tree.
208
+ */const vj=$e("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
209
+ * @license lucide-react v0.468.0 - ISC
210
+ *
211
+ * This source code is licensed under the ISC license.
212
+ * See the LICENSE file in the root directory of this source tree.
213
+ */const xj=$e("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"}]]);/**
214
+ * @license lucide-react v0.468.0 - ISC
215
+ *
216
+ * This source code is licensed under the ISC license.
217
+ * See the LICENSE file in the root directory of this source tree.
218
+ */const wj=$e("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"}]]);/**
219
+ * @license lucide-react v0.468.0 - ISC
220
+ *
221
+ * This source code is licensed under the ISC license.
222
+ * See the LICENSE file in the root directory of this source tree.
223
+ */const kj=$e("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"}]]);/**
224
+ * @license lucide-react v0.468.0 - ISC
225
+ *
226
+ * This source code is licensed under the ISC license.
227
+ * See the LICENSE file in the root directory of this source tree.
228
+ */const Sj=$e("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"}]]);/**
229
+ * @license lucide-react v0.468.0 - ISC
230
+ *
231
+ * This source code is licensed under the ISC license.
232
+ * See the LICENSE file in the root directory of this source tree.
233
+ */const bj=$e("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"}]]);/**
234
+ * @license lucide-react v0.468.0 - ISC
235
+ *
236
+ * This source code is licensed under the ISC license.
237
+ * See the LICENSE file in the root directory of this source tree.
238
+ */const Cj=$e("UserRoundPlus",[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M22 19h-6",key:"vcuq98"}]]);/**
239
+ * @license lucide-react v0.468.0 - ISC
240
+ *
241
+ * This source code is licensed under the ISC license.
242
+ * See the LICENSE file in the root directory of this source tree.
243
+ */const Ej=$e("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
244
+ * @license lucide-react v0.468.0 - ISC
245
+ *
246
+ * This source code is licensed under the ISC license.
247
+ * See the LICENSE file in the root directory of this source tree.
248
+ */const Tj=$e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Pj={app:ij,back:qA,bolt:XA,chat:fj,check:GA,chevron:JA,chevronDown:QA,close:Tj,clusters:wv,copy:tj,download:nj,edit:mj,inbox:oj,link:sj,lock:aj,mic:dj,maximize:lj,menu:uj,minus:hj,monitor:kv,monitorEye:kv,more:rj,paperclip:pj,pause:ZA,play:ej,plus:gj,refresh:yj,reply:cj,search:vj,send:xj,settings:wj,shield:kj,sliders:Sj,trash:bj,user:Ej,invite:Cj,agent:YA,network:wv};function be(e){const{name:t,size:n=18,stroke:i=1.8,fill:s=!1,style:a,className:l}=e,c=Pj[t];return c?y.jsx(c,{className:"ic "+(l||""),width:n,height:n,strokeWidth:i,fill:s?"currentColor":"none",style:a,"aria-hidden":"true"}):null}function U0(e){if(typeof e!="string")return null;const t=/^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:(Z)|([+-]\d{2}:\d{2})|\s*\(UTC\))?$/i.exec(e.trim());if(!t)return null;const n=t[7]?t[7].slice(0,3).padEnd(3,"0"):"000",i=`${t[1]}-${t[2]}-${t[3]}T${t[4]}:${t[5]}:${t[6]}.${n}`,s=new Date(`${i}Z`);if(Number.isNaN(s.getTime())||s.getUTCFullYear()!==Number(t[1])||s.getUTCMonth()+1!==Number(t[2])||s.getUTCDate()!==Number(t[3])||s.getUTCHours()!==Number(t[4])||s.getUTCMinutes()!==Number(t[5])||s.getUTCSeconds()!==Number(t[6]))return null;if(t[9]){const a=new Date(`${i}${t[9]}`);return Number.isNaN(a.getTime())?null:a.toISOString()}return s.toISOString()}function Jl(e){const t=U0(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 Rj(e){const t=U0(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 xs="room",Aj="room_",Zl="ours-cowork-room:",Sv="ours-cowork:",bv="ours-cowork-",Cv="cowork-room-",Td=/^[0-7][0-9a-hjkmnp-tv-z]{25}$/,jj=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,Nj=25,Mj=64,Ij=80,Ev=1e3,Vs=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),rn=e=>typeof e=="string"&&e.length>0;function Dj(e,t){if(typeof e!="string")return null;const n=e.trim();if(!n.startsWith("{")||!n.endsWith("}"))return null;let i;try{i=JSON.parse(n)}catch{return null}return!Vs(i)||i.version!==1||!rn(i.kind)||!i.kind.startsWith(Aj)||!rn(i.room_id)||t&&!rn(i.signature)?null:i}function Lj(e){const t=Vs(e.author)?e.author:{};return{name:rn(t.display_name)?t.display_name:"",role:rn(t.role)?t.role:""}}function Ef(e){const n=Array.from(String(e)).slice(0,Ij).join("").replace(/^room_/,"").split("_").filter(Boolean);return n.length===0?"Room notice":n.join(" ").replace(/^./,i=>i.toUpperCase())}function _j(e){if(!Vs(e))return null;const t=rn(e.kind)?e.kind:"",n=Lj(e),i=typeof e.text=="string"?e.text:"",s=Number.isSafeInteger(e.briefing_version)&&e.briefing_version>0?e.briefing_version:null,a={roomName:W0(e.room_name)??"",authoredAt:rn(e.at)?e.at:""};switch(t){case"room_msg":return n.role===xs?Zr(t,"Room message",i||"Room notice",{...a,authoredBy:n.name}):{variant:"chat",kind:t,author:n.name||"Unknown member",role:n.role,label:"",text:i,...a};case"room_briefing":return Zr(t,s===null?"Room briefing":`Room briefing · v${s}`,i||"The room briefing was updated.",{...a,authoredBy:n.name,presentation:"briefing"});case"room_role_briefing":{const l=rn(e.briefing_role)?e.briefing_role:"",c=["Role briefing",l,s===null?"":`v${s}`].filter(Boolean).join(" · ");return Zr(t,c,i||"Your role briefing was updated.",{...a,authoredBy:n.name,presentation:"role",details:l?[`Role: ${l}`]:[]})}case"room_membership":{const l=Vs(e.membership)?e.membership:{},c=[rn(l.action)?`Status: ${zj(l.action)}`:"",rn(l.alias)?`Member: ${l.alias}`:"",rn(l.role)?`Role: ${l.role}`:"",Number.isSafeInteger(l.epoch)&&l.epoch>=0?`Epoch: ${l.epoch}`:""].filter(Boolean);return Zr(t,"Membership",i||Uj(l),{...a,authoredBy:n.name,presentation:"membership",details:c})}case"room_file":{const l=rn(e.filename)?e.filename:"Shared file",c=[rn(e.mime)?`Type: ${e.mime}`:"",Number.isSafeInteger(e.size)&&e.size>=0?`Size: ${Vj(e.size)}`:"",rn(e.sha256)?`SHA-256: ${Bj(e.sha256)}`:""].filter(Boolean);return Zr(t,"Room file",l,{...a,authoredBy:n.name,role:n.role,presentation:"file",details:c})}case"room_not_member":return Zr(t,"Room access","You are no longer a member of this room.",{...a,presentation:"lifecycle",details:["Status: Removed"]});default:return i?{variant:n.role&&n.role!==xs?"chat":"system",kind:t,author:n.role&&n.role!==xs?n.name||"Unknown member":"",role:n.role&&n.role!==xs?n.role:"",label:n.role&&n.role!==xs?"":Ef(t),text:$j(i),...a}:Zr(t,Ef(t),`${Ef(t)} from the room.`,a)}}function Oj(e,t){if(!Fj(e))return null;const n=Oh(e)?.roomId??null,i=Lh(e),s=_h(e),a=Dj(t,n===null&&s===null);return a!==null&&n!==null&&a.room_id!==n||a!==null&&i!==null&&a.room_id!==i?Tv("Room provenance mismatch"):_j(a)}function W0(e){if(typeof e!="string"||/[\p{Cc}\p{Cf}]/u.test(e))return null;const t=e.trim().normalize("NFC"),n=Array.from(t).length;return n>=1&&n<=Mj?t:null}function Lh(e){if(typeof e!="string"||!e.startsWith(Cv))return null;const t=e.slice(Cv.length);return Td.test(t)?t:null}function _h(e){return typeof e!="string"||!e.startsWith(Sv)?null:W0(e.slice(Sv.length))}function Oh(e){if(typeof e!="string"||!e.startsWith(bv))return null;const t=e.slice(bv.length);if(Td.test(t))return{roomId:t,slug:null};const n=t.slice(-26),i=t.at(-27),s=t.slice(0,-27);return i!=="-"||!Td.test(n)||s.length<1||s.length>Nj?null:jj.test(s)?{roomId:n,slug:s}:null}function Fj(e){const t=String(e??"").trim();return t.startsWith(Zl)&&t.slice(Zl.length).trim().length>0||_h(e)!==null||Oh(e)!==null||Lh(e)!==null}function Zr(e,t,n,i={}){return{variant:"system",kind:e,author:"",role:"",label:t,text:n,...i}}function zj(e){return String(e).replace(/_/g," ").replace(/^./,t=>t.toUpperCase())}function Vj(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function Bj(e){const t=String(e);return t.length<=20?t:`${t.slice(0,12)}…${t.slice(-6)}`}function $j(e){const t=Array.from(String(e));return t.length<=Ev?t.join(""):`${t.slice(0,Ev).join("")}…`}function Tv(e){return Zr("room_invalid","Room notice","This room envelope could not be displayed safely.",{presentation:"lifecycle",details:[`Status: ${e}`]})}function Uj(e){if(!Vs(e))return"The room membership changed.";const t=rn(e.alias)?e.alias:"A member";return e.action==="remove"?`${t} left the room.`:"The room membership changed."}function Wj(e){if(!e)return"";const t=e.variant==="chat"?e.author:e.label,n=Hj(e.text);return t?n?`${t} · ${n}`:t:n}function Hj(e){return String(e??"").replace(/\s+/g," ").trim()}function Kj(e){const t=String(e??"").trim();if(t.startsWith(Zl))return t.slice(Zl.length).trim()||null;const n=_h(e);if(n!==null)return n;const i=Oh(e);if(i?.slug)return i.slug.replace(/-/g," ").replace(/[a-z]/,l=>l.toUpperCase());if(i)return`Room ${i.roomId.slice(0,8)}`;const s=Lh(e);return s===null?null:`Room ${s.slice(0,8)}`}const Fh=Rj;function Pd(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(a=>/[\p{L}\p{N}]/u.test(a));return(s.length?s.slice(0,2).join(""):i[0]??"?").toUpperCase()}return(n(t[0])+n(t.at(-1)??"")).toUpperCase()}function qj(e){const t=Fh(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 Mi(e){const t=Fh(e);return t?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function Xj(e){const t=Fh(e);return t?t.toLocaleString():e}function H0(e){return e.length<=14?e:`${e.slice(0,8)}…${e.slice(-4)}`}function Yj(e){return/^[0-9A-Fa-f]{40,}$/.test(e.trim())}function Gj(e,t,n){const i=(e??"").trim(),s=Kj(i);return s||(i&&!Yj(i)?i:i?H0(i):"Unnamed")}function eu(e){return e.display_name?.trim()||Gj(e.name)}const Qj="x-ours-kind=voice-message",K0="voice-message-",Es=20*1024*1024;let Bs=null,Rd=[];const zh=new Map;function Jj(e){Bs=e;for(const t of Rd)t(e);Rd=[]}function Pv(e){for(const t of e)zh.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 Zj(){zh.clear()}function q0(e){return zh.get(e)??null}function eN(e){return Bs?.url(e)??null}function tN(e){return`${e}; ${Qj}`}function To(e,t){return/x-ours-kind\s*=\s*voice-message/i.test(e)||t.toLowerCase().startsWith(K0)&&e.toLowerCase().startsWith("audio/")}function nN(e,t){const n=e??"file",i=t??"";return To(i,n)?"🎤 Voice message":i.toLowerCase().startsWith("image/")?"🖼 Photo":`📎 ${n}`}async function mu(e){return(Bs??await new Promise(n=>Rd.push(n))).bytes(e)}async function rN(e){if(!Bs)throw new Error("Media provider is not ready");await Bs.fetch(e)}function oi(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function iN(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 Ad({receipt:e,content:t="Message",receiptless:n=!1}){const i=iN(e,n);return y.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 Rv(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 on=li(/[A-Za-z]/),Qt=li(/[\dA-Za-z]/),oN=li(/[#-'*+\--9=?A-Z^-~]/);function tu(e){return e!==null&&(e<32||e===127)}const jd=li(/\d/),sN=li(/[\dA-Fa-f]/),aN=li(/[!-/:-@[-`{-~]/);function Ie(e){return e!==null&&e<-2}function it(e){return e!==null&&(e<0||e===32)}function Be(e){return e===-2||e===-1||e===32}const gu=li(/\p{P}|\p{S}/u),Di=li(/\s/);function li(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function lN(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const yu=function(e){if(e==null)return dN;if(typeof e=="function")return vu(e);if(typeof e=="object")return Array.isArray(e)?uN(e):cN(e);if(typeof e=="string")return fN(e);throw new Error("Expected function, string, or object as test")};function uN(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=yu(e[n]);return vu(i);function i(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function cN(e){const t=e;return vu(n);function n(i){const s=i;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function fN(e){return vu(t);function t(n){return n&&n.type===e}}function vu(e){return t;function t(n,i,s){return!!(hN(n)&&e.call(this,n,typeof i=="number"?i:void 0,s||void 0))}}function dN(){return!0}function hN(e){return e!==null&&typeof e=="object"&&"type"in e}const X0=[],pN=!0,Nd=!1,mN="skip";function Y0(e,t,n,i){let s;typeof t=="function"&&typeof n!="function"?(i=n,n=t):s=t;const a=yu(s),l=i?-1:1;c(e,void 0,[])();function c(f,h,m){const p=f&&typeof f=="object"?f:{};if(typeof p.type=="string"){const w=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(f.type+(w?"<"+w+">":""))+")"})}return v;function v(){let w=X0,S,C,E;if((!t||a(f,h,m[m.length-1]||void 0))&&(w=gN(n(f,m)),w[0]===Nd))return w;if("children"in f&&f.children){const P=f;if(P.children&&w[0]!==mN)for(C=(i?P.children.length:-1)+l,E=m.concat(P);C>-1&&C<P.children.length;){const A=P.children[C];if(S=c(A,C,E)(),S[0]===Nd)return S;C=typeof S[1]=="number"?S[1]:C+l}}return w}}}function gN(e){return Array.isArray(e)?e:typeof e=="number"?[pN,e]:e==null?X0:[e]}function yN(e,t,n){const s=yu((n||{}).ignore||[]),a=vN(t);let l=-1;for(;++l<a.length;)Y0(e,"text",c);function c(h,m){let p=-1,v;for(;++p<m.length;){const w=m[p],S=v?v.children:void 0;if(s(w,S?S.indexOf(w):void 0,v))return;v=w}if(v)return f(h,m)}function f(h,m){const p=m[m.length-1],v=a[l][0],w=a[l][1];let S=0;const E=p.children.indexOf(h);let P=!1,A=[];v.lastIndex=0;let T=v.exec(h.value);for(;T;){const L=T.index,j={index:T.index,input:T.input,stack:[...m,h]};let I=w(...T,j);if(typeof I=="string"&&(I=I.length>0?{type:"text",value:I}:void 0),I===!1?v.lastIndex=L+1:(S!==L&&A.push({type:"text",value:h.value.slice(S,L)}),Array.isArray(I)?A.push(...I):I&&A.push(I),S=L+T[0].length,P=!0),!v.global)break;T=v.exec(h.value)}return P?(S<h.value.length&&A.push({type:"text",value:h.value.slice(S)}),p.children.splice(E,1,...A)):A=[h],E+A.length}}function vN(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([xN(s[0]),wN(s[1])])}return t}function xN(e){return typeof e=="string"?new RegExp(lN(e),"g"):e}function wN(e){return typeof e=="function"?e:function(){return e}}const Tf="phrasing",Pf=["autolink","link","image","label"];function kN(){return{transforms:[RN],enter:{literalAutolink:bN,literalAutolinkEmail:Rf,literalAutolinkHttp:Rf,literalAutolinkWww:Rf},exit:{literalAutolink:PN,literalAutolinkEmail:TN,literalAutolinkHttp:CN,literalAutolinkWww:EN}}}function SN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Tf,notInConstruct:Pf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Tf,notInConstruct:Pf},{character:":",before:"[ps]",after:"\\/",inConstruct:Tf,notInConstruct:Pf}]}}function bN(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Rf(e){this.config.enter.autolinkProtocol.call(this,e)}function CN(e){this.config.exit.autolinkProtocol.call(this,e)}function EN(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 TN(e){this.config.exit.autolinkEmail.call(this,e)}function PN(e){this.exit(e)}function RN(e){yN(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,AN],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,jN]],{ignore:["link","linkReference"]})}function AN(e,t,n,i,s){let a="";if(!G0(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!NN(n)))return!1;const l=MN(n+i);if(!l[0])return!1;const c={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function jN(e,t,n,i){return!G0(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function NN(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 MN(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=Rv(e,"(");let a=Rv(e,")");for(;i!==-1&&s>a;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),a++;return[e,n]}function G0(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Di(n)||gu(n))&&(!t||n!==47)}function Gn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}Q0.peek=BN;function IN(){this.buffer()}function DN(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function LN(){this.buffer()}function _N(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ON(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Gn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function FN(e){this.exit(e)}function zN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Gn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function VN(e){this.exit(e)}function BN(){return"["}function Q0(e,t,n,i){const s=n.createTracker(i);let a=s.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),c(),l(),a+=s.move("]"),a}function $N(){return{enter:{gfmFootnoteCallString:IN,gfmFootnoteCall:DN,gfmFootnoteDefinitionLabelString:LN,gfmFootnoteDefinition:_N},exit:{gfmFootnoteCallString:ON,gfmFootnoteCall:FN,gfmFootnoteDefinitionLabelString:zN,gfmFootnoteDefinition:VN}}}function UN(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Q0},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,s,a,l){const c=a.createTracker(l);let f=c.move("[^");const h=a.enter("footnoteDefinition"),m=a.enter("label");return f+=c.move(a.safe(a.associationId(i),{before:f,after:"]"})),m(),f+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),f+=c.move((t?`
249
+ `:" ")+a.indentLines(a.containerFlow(i,c.current()),t?J0:WN))),h(),f}}function WN(e,t,n){return t===0?e:J0(e,t,n)}function J0(e,t,n){return(n?"":" ")+e}const HN=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Z0.peek=GN;function KN(){return{canContainEols:["delete"],enter:{strikethrough:XN},exit:{strikethrough:YN}}}function qN(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:HN}],handlers:{delete:Z0}}}function XN(e){this.enter({type:"delete",children:[]},e)}function YN(e){this.exit(e)}function Z0(e,t,n,i){const s=n.createTracker(i),a=n.enter("strikethrough");let l=s.move("~~");return l+=n.containerPhrasing(e,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),a(),l}function GN(){return"~"}function QN(e){return e.length}function JN(e,t){const n=t||{},i=(n.align||[]).concat(),s=n.stringLength||QN,a=[],l=[],c=[],f=[];let h=0,m=-1;for(;++m<e.length;){const C=[],E=[];let P=-1;for(e[m].length>h&&(h=e[m].length);++P<e[m].length;){const A=ZN(e[m][P]);if(n.alignDelimiters!==!1){const T=s(A);E[P]=T,(f[P]===void 0||T>f[P])&&(f[P]=T)}C.push(A)}l[m]=C,c[m]=E}let p=-1;if(typeof i=="object"&&"length"in i)for(;++p<h;)a[p]=Av(i[p]);else{const C=Av(i);for(;++p<h;)a[p]=C}p=-1;const v=[],w=[];for(;++p<h;){const C=a[p];let E="",P="";C===99?(E=":",P=":"):C===108?E=":":C===114&&(P=":");let A=n.alignDelimiters===!1?1:Math.max(1,f[p]-E.length-P.length);const T=E+"-".repeat(A)+P;n.alignDelimiters!==!1&&(A=E.length+A+P.length,A>f[p]&&(f[p]=A),w[p]=A),v[p]=T}l.splice(1,0,v),c.splice(1,0,w),m=-1;const S=[];for(;++m<l.length;){const C=l[m],E=c[m];p=-1;const P=[];for(;++p<h;){const A=C[p]||"";let T="",L="";if(n.alignDelimiters!==!1){const j=f[p]-(E[p]||0),I=a[p];I===114?T=" ".repeat(j):I===99?j%2?(T=" ".repeat(j/2+.5),L=" ".repeat(j/2-.5)):(T=" ".repeat(j/2),L=T):L=" ".repeat(j)}n.delimiterStart!==!1&&!p&&P.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||p)&&P.push(" "),n.alignDelimiters!==!1&&P.push(T),P.push(A),n.alignDelimiters!==!1&&P.push(L),n.padding!==!1&&P.push(" "),(n.delimiterEnd!==!1||p!==h-1)&&P.push("|")}S.push(n.delimiterEnd===!1?P.join("").replace(/ +$/,""):P.join(""))}return S.join(`
250
+ `)}function ZN(e){return e==null?"":String(e)}function Av(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 eM(e,t,n,i){const s=n.enter("blockquote"),a=n.createTracker(i);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),tM);return s(),l}function tM(e,t,n){return">"+(n?"":" ")+e}function nM(e,t){return jv(e,t.inConstruct,!0)&&!jv(e,t.notInConstruct,!1)}function jv(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 Nv(e,t,n,i){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
251
+ `&&nM(n.stack,n.unsafe[s]))return/[ \t]/.test(i.before)?"":" ";return`\\
252
+ `}function rM(e,t){const n=String(e);let i=n.indexOf(t),s=i,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===s?++a>l&&(l=a):a=1,s=i+t.length,i=n.indexOf(t,s);return l}function iM(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 oM(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 sM(e,t,n,i){const s=oM(n),a=e.value||"",l=s==="`"?"GraveAccent":"Tilde";if(iM(e,n)){const p=n.enter("codeIndented"),v=n.indentLines(a,aM);return p(),v}const c=n.createTracker(i),f=s.repeat(Math.max(rM(a,s)+1,3)),h=n.enter("codeFenced");let m=c.move(f);if(e.lang){const p=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
253
+ `,encode:["`"],...c.current()})),p()}return m+=c.move(`
254
+ `),a&&(m+=c.move(a+`
255
+ `)),m+=c.move(f),h(),m}function aM(e,t,n){return(n?"":" ")+e}function Vh(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 lM(e,t,n,i){const s=Vh(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const f=n.createTracker(i);let h=f.move("[");return h+=f.move(n.safe(n.associationId(e),{before:h,after:"]",...f.current()})),h+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":`
256
+ `,...f.current()}))),c(),e.title&&(c=n.enter(`title${a}`),h+=f.move(" "+s),h+=f.move(n.safe(e.title,{before:h,after:s,...f.current()})),h+=f.move(s),c()),l(),h}function uM(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 $s(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Po(e){if(e===null||it(e)||Di(e))return 1;if(gu(e))return 2}function nu(e,t,n){const i=Po(e),s=Po(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}}e1.peek=cM;function e1(e,t,n,i){const s=uM(n),a=n.enter("emphasis"),l=n.createTracker(i),c=l.move(s);let f=l.move(n.containerPhrasing(e,{after:s,before:c,...l.current()}));const h=f.charCodeAt(0),m=nu(i.before.charCodeAt(i.before.length-1),h,s);m.inside&&(f=$s(h)+f.slice(1));const p=f.charCodeAt(f.length-1),v=nu(i.after.charCodeAt(0),p,s);v.inside&&(f=f.slice(0,-1)+$s(p));const w=l.move(s);return a(),n.attentionEncodeSurroundingInfo={after:v.outside,before:m.outside},c+f+w}function cM(e,t,n){return n.options.emphasis||"*"}function Bh(e,t,n,i){let s,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,s=n):(a=t,l=n,s=i),Y0(e,a,c,s);function c(f,h){const m=h[h.length-1],p=m?m.children.indexOf(f):void 0;return l(f,p,m)}}const fM={};function $h(e,t){const n=fM,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return t1(e,i,s)}function t1(e,t,n){if(dM(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 Mv(e.children,t,n)}return Array.isArray(e)?Mv(e,t,n):""}function Mv(e,t,n){const i=[];let s=-1;for(;++s<e.length;)i[s]=t1(e[s],t,n);return i.join("")}function dM(e){return!!(e&&typeof e=="object")}function hM(e,t){let n=!1;return Bh(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,Nd}),!!((!e.depth||e.depth<3)&&$h(e)&&(t.options.setext||n))}function pM(e,t,n,i){const s=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(i);if(hM(e,n)){const m=n.enter("headingSetext"),p=n.enter("phrasing"),v=n.containerPhrasing(e,{...a.current(),before:`
257
+ `,after:`
258
+ `});return p(),m(),v+`
259
+ `+(s===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
260
+ `))+1))}const l="#".repeat(s),c=n.enter("headingAtx"),f=n.enter("phrasing");a.move(l+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
261
+ `,...a.current()});return/^[\t ]/.test(h)&&(h=$s(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),f(),c(),h}n1.peek=mM;function n1(e){return e.value||""}function mM(){return"<"}r1.peek=gM;function r1(e,t,n,i){const s=Vh(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const f=n.createTracker(i);let h=f.move("![");return h+=f.move(n.safe(e.alt,{before:h,after:"]",...f.current()})),h+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${a}`),h+=f.move(" "+s),h+=f.move(n.safe(e.title,{before:h,after:s,...f.current()})),h+=f.move(s),c()),h+=f.move(")"),l(),h}function gM(){return"!"}i1.peek=yM;function i1(e,t,n,i){const s=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(i);let f=c.move("![");const h=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(h+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,a(),s==="full"||!h||h!==p?f+=c.move(p+"]"):s==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function yM(){return"!"}o1.peek=vM;function o1(e,t,n){let i=e.value||"",s="`",a=-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+" ");++a<n.unsafe.length;){const l=n.unsafe[a],c=n.compilePattern(l);let f;if(l.atBreak)for(;f=c.exec(i);){let h=f.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(f.index+1)}}return s+i+s}function vM(){return"`"}function s1(e,t){const n=$h(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))}a1.peek=xM;function a1(e,t,n,i){const s=Vh(n),a=s==='"'?"Quote":"Apostrophe",l=n.createTracker(i);let c,f;if(s1(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),c(),n.stack=m,p}c=n.enter("link"),f=n.enter("label");let h=l.move("[");return h+=l.move(n.containerPhrasing(e,{before:h,after:"](",...l.current()})),h+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(e.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(f=n.enter("destinationRaw"),h+=l.move(n.safe(e.url,{before:h,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${a}`),h+=l.move(" "+s),h+=l.move(n.safe(e.title,{before:h,after:s,...l.current()})),h+=l.move(s),f()),h+=l.move(")"),c(),h}function xM(e,t,n){return s1(e,n)?"<":"["}l1.peek=wM;function l1(e,t,n,i){const s=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(i);let f=c.move("[");const h=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(h+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,a(),s==="full"||!h||h!==p?f+=c.move(p+"]"):s==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function wM(){return"["}function Uh(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 kM(e){const t=Uh(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 SM(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 u1(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 bM(e,t,n,i){const s=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?SM(n):Uh(n);const c=e.ordered?l==="."?")":".":kM(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&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&&(f=!0),u1(n)===l&&m){let p=-1;for(;++p<e.children.length;){const v=e.children[p];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=c),n.bulletCurrent=l;const h=n.containerFlow(e,i);return n.bulletLastUsed=l,n.bulletCurrent=a,s(),h}function CM(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 EM(e,t,n,i){const s=CM(n);let a=n.bulletCurrent||Uh(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(i);c.move(a+" ".repeat(l-a.length)),c.shift(l);const f=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,c.current()),m);return f(),h;function m(p,v,w){return v?(w?"":" ".repeat(l))+p:(w?a:a+" ".repeat(l-a.length))+p}}function TM(e,t,n,i){const s=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,i);return a(),s(),l}const PM=yu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function RM(e,t,n,i){return(e.children.some(function(l){return PM(l)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function AM(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}c1.peek=jM;function c1(e,t,n,i){const s=AM(n),a=n.enter("strong"),l=n.createTracker(i),c=l.move(s+s);let f=l.move(n.containerPhrasing(e,{after:s,before:c,...l.current()}));const h=f.charCodeAt(0),m=nu(i.before.charCodeAt(i.before.length-1),h,s);m.inside&&(f=$s(h)+f.slice(1));const p=f.charCodeAt(f.length-1),v=nu(i.after.charCodeAt(0),p,s);v.inside&&(f=f.slice(0,-1)+$s(p));const w=l.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:v.outside,before:m.outside},c+f+w}function jM(e,t,n){return n.options.strong||"*"}function NM(e,t,n,i){return n.safe(e.value,i)}function MM(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 IM(e,t,n){const i=(u1(n)+(n.options.ruleSpaces?" ":"")).repeat(MM(n));return n.options.ruleSpaces?i.slice(0,-1):i}const f1={blockquote:eM,break:Nv,code:sM,definition:lM,emphasis:e1,hardBreak:Nv,heading:pM,html:n1,image:r1,imageReference:i1,inlineCode:o1,link:a1,linkReference:l1,list:bM,listItem:EM,paragraph:TM,root:RM,strong:c1,text:NM,thematicBreak:IM},Iv=document.createElement("i");function Wh(e){const t="&"+e+";";Iv.innerHTML=t;const n=Iv.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function d1(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 DM=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function LM(e){return e.replace(DM,_M)}function _M(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return d1(n.slice(a?2:1),a?16:10)}return Wh(n)||e}function OM(){return{enter:{table:FM,tableData:Dv,tableHeader:Dv,tableRow:VM},exit:{codeText:BM,table:zM,tableData:Af,tableHeader:Af,tableRow:Af}}}function FM(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 zM(e){this.exit(e),this.data.inTable=void 0}function VM(e){this.enter({type:"tableRow",children:[]},e)}function Af(e){this.exit(e)}function Dv(e){this.enter({type:"tableCell",children:[]},e)}function BM(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,$M));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function $M(e,t){return t==="|"?t:e}function UM(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
262
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:l,tableCell:f,tableRow:c}};function l(w,S,C,E){return h(m(w,C,E),w.align)}function c(w,S,C,E){const P=p(w,C,E),A=h([P]);return A.slice(0,A.indexOf(`
263
+ `))}function f(w,S,C,E){const P=C.enter("tableCell"),A=C.enter("phrasing"),T=C.containerPhrasing(w,{...E,before:a,after:a});return A(),P(),T}function h(w,S){return JN(w,{align:S,alignDelimiters:i,padding:n,stringLength:s})}function m(w,S,C){const E=w.children;let P=-1;const A=[],T=S.enter("table");for(;++P<E.length;)A[P]=p(E[P],S,C);return T(),A}function p(w,S,C){const E=w.children;let P=-1;const A=[],T=S.enter("tableRow");for(;++P<E.length;)A[P]=f(E[P],w,S,C);return T(),A}function v(w,S,C){let E=f1.inlineCode(w,S,C);return C.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function WM(){return{exit:{taskListCheckValueChecked:Lv,taskListCheckValueUnchecked:Lv,paragraph:KM}}}function HM(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:qM}}}function Lv(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function KM(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 a=-1,l;for(;++a<s.length;){const c=s[a];if(c.type==="paragraph"){l=c;break}}l===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 qM(e,t,n,i){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(i);a&&c.move(l);let f=f1.listItem(e,t,n,{...i,...c.current()});return a&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),f;function h(m){return m+l}}function h1(){return[kN(),$N(),KN(),OM(),WM()]}function XM(e){return{extensions:[SN(),UN(e),qN(),UM(e),HM()]}}function En(e,t,n,i){const s=e.length;let a=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,i.length<1e4)l=Array.from(i),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<i.length;)l=i.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Dn(e,t){return e.length>0?(En(e,e.length,0,t),e):t}const _v={}.hasOwnProperty;function p1(e){const t={};let n=-1;for(;++n<e.length;)YM(t,e[n]);return t}function YM(e,t){let n;for(n in t){const s=(_v.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){_v.call(s,l)||(s[l]=[]);const c=a[l];GM(s[l],Array.isArray(c)?c:c?[c]:[])}}}function GM(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);En(e,0,0,i)}function Mo(e){const t=[];let n=-1,i=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&Qt(e.charCodeAt(n+1))&&Qt(e.charCodeAt(n+2)))s=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(l=String.fromCharCode(a,c),s=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(i,n),encodeURIComponent(l)),i=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(i)}function He(e,t,n,i){const s=i?i-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(f){return Be(f)?(e.enter(n),c(f)):t(f)}function c(f){return Be(f)&&a++<s?(e.consume(f),c):(e.exit(n),t(f))}}const QM={tokenize:JM};function JM(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"),He(e,t,"linePrefix")}function s(c){return e.enter("paragraph"),a(c)}function a(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Ie(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),l)}}const ZM={tokenize:e2},Ov={tokenize:t2};function e2(e){const t=this,n=[];let i=0,s,a,l;return c;function c(T){if(i<n.length){const L=n[i];return t.containerState=L[1],e.attempt(L[0].continuation,f,h)(T)}return h(T)}function f(T){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&A();const L=t.events.length;let j=L,I;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){I=t.events[j][1].end;break}P(i);let K=L;for(;K<t.events.length;)t.events[K][1].end={...I},K++;return En(t.events,j+1,0,t.events.slice(L)),t.events.length=K,h(T)}return c(T)}function h(T){if(i===n.length){if(!s)return v(T);if(s.currentConstruct&&s.currentConstruct.concrete)return S(T);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ov,m,p)(T)}function m(T){return s&&A(),P(i),v(T)}function p(T){return t.parser.lazy[t.now().line]=i!==n.length,l=t.now().offset,S(T)}function v(T){return t.containerState={},e.attempt(Ov,w,S)(T)}function w(T){return i++,n.push([t.currentConstruct,t.containerState]),v(T)}function S(T){if(T===null){s&&A(),P(0),e.consume(T);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),C(T)}function C(T){if(T===null){E(e.exit("chunkFlow"),!0),P(0),e.consume(T);return}return Ie(T)?(e.consume(T),E(e.exit("chunkFlow")),i=0,t.interrupt=void 0,c):(e.consume(T),C)}function E(T,L){const j=t.sliceStream(T);if(L&&j.push(null),T.previous=a,a&&(a.next=T),a=T,s.defineSkip(T.start),s.write(j),t.parser.lazy[T.start.line]){let I=s.events.length;for(;I--;)if(s.events[I][1].start.offset<l&&(!s.events[I][1].end||s.events[I][1].end.offset>l))return;const K=t.events.length;let B=K,_,N;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(_){N=t.events[B][1].end;break}_=!0}for(P(i),I=K;I<t.events.length;)t.events[I][1].end={...N},I++;En(t.events,B+1,0,t.events.slice(K)),t.events.length=I}}function P(T){let L=n.length;for(;L-- >T;){const j=n[L];t.containerState=j[1],j[0].exit.call(t,e)}n.length=T}function A(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function t2(e,t,n){return He(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function xu(e,t,n){const i=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!i.includes(a)&&(t=a(t,n),i.push(a))}return t}const Md={name:"attention",resolveAll:n2,tokenize:r2};function n2(e,t){let n=-1,i,s,a,l,c,f,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;f=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},v={...e[n][1].start};Fv(p,-f),Fv(v,f),l={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...e[i][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},a={type:f>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},s={type:f>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[i][1].end={...l.start},e[n][1].start={...c.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=Dn(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=Dn(h,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",a,t]]),h=Dn(h,xu(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),h=Dn(h,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,h=Dn(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,En(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 r2(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,s=Po(i);let a;return l;function l(f){return a=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===a)return e.consume(f),c;const h=e.exit("attentionSequence"),m=Po(f),p=!m||m===2&&s||n.includes(f),v=!s||s===2&&m||n.includes(i);return h._open=!!(a===42?p:p&&(s||!v)),h._close=!!(a===42?v:v&&(m||!p)),t(f)}}function Fv(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const i2={name:"autolink",tokenize:o2};function o2(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"),a}function a(w){return on(w)?(e.consume(w),l):w===64?n(w):h(w)}function l(w){return w===43||w===45||w===46||Qt(w)?(i=1,c(w)):h(w)}function c(w){return w===58?(e.consume(w),i=0,f):(w===43||w===45||w===46||Qt(w))&&i++<32?(e.consume(w),c):(i=0,h(w))}function f(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||tu(w)?n(w):(e.consume(w),f)}function h(w){return w===64?(e.consume(w),m):oN(w)?(e.consume(w),h):n(w)}function m(w){return Qt(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):v(w)}function v(w){if((w===45||Qt(w))&&i++<63){const S=w===45?v:p;return e.consume(w),S}return n(w)}}const Js={partial:!0,tokenize:s2};function s2(e,t,n){return i;function i(a){return Be(a)?He(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||Ie(a)?t(a):n(a)}}const m1={continuation:{tokenize:l2},exit:u2,name:"blockQuote",tokenize:a2};function a2(e,t,n){const i=this;return s;function s(l){if(l===62){const c=i.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return Be(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function l2(e,t,n){const i=this;return s;function s(l){return Be(l)?He(e,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(m1,t,n)(l)}}function u2(e){e.exit("blockQuote")}const g1={name:"characterEscape",tokenize:c2};function c2(e,t,n){return i;function i(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return aN(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const y1={name:"characterReference",tokenize:f2};function f2(e,t,n){const i=this;let s=0,a,l;return c;function c(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),f}function f(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),a=31,l=Qt,m(p))}function h(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=sN,m):(e.enter("characterReferenceValue"),a=7,l=jd,m(p))}function m(p){if(p===59&&s){const v=e.exit("characterReferenceValue");return l===Qt&&!Wh(i.sliceSerialize(v))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&s++<a?(e.consume(p),m):n(p)}}const zv={partial:!0,tokenize:h2},Vv={concrete:!0,name:"codeFenced",tokenize:d2};function d2(e,t,n){const i=this,s={partial:!0,tokenize:j};let a=0,l=0,c;return f;function f(I){return h(I)}function h(I){const K=i.events[i.events.length-1];return a=K&&K[1].type==="linePrefix"?K[2].sliceSerialize(K[1],!0).length:0,c=I,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(I)}function m(I){return I===c?(l++,e.consume(I),m):l<3?n(I):(e.exit("codeFencedFenceSequence"),Be(I)?He(e,p,"whitespace")(I):p(I))}function p(I){return I===null||Ie(I)?(e.exit("codeFencedFence"),i.interrupt?t(I):e.check(zv,C,L)(I)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(I))}function v(I){return I===null||Ie(I)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(I)):Be(I)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),He(e,w,"whitespace")(I)):I===96&&I===c?n(I):(e.consume(I),v)}function w(I){return I===null||Ie(I)?p(I):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(I))}function S(I){return I===null||Ie(I)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(I)):I===96&&I===c?n(I):(e.consume(I),S)}function C(I){return e.attempt(s,L,E)(I)}function E(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),P}function P(I){return a>0&&Be(I)?He(e,A,"linePrefix",a+1)(I):A(I)}function A(I){return I===null||Ie(I)?e.check(zv,C,L)(I):(e.enter("codeFlowValue"),T(I))}function T(I){return I===null||Ie(I)?(e.exit("codeFlowValue"),A(I)):(e.consume(I),T)}function L(I){return e.exit("codeFenced"),t(I)}function j(I,K,B){let _=0;return N;function N(Z){return I.enter("lineEnding"),I.consume(Z),I.exit("lineEnding"),$}function $(Z){return I.enter("codeFencedFence"),Be(Z)?He(I,V,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):V(Z)}function V(Z){return Z===c?(I.enter("codeFencedFenceSequence"),he(Z)):B(Z)}function he(Z){return Z===c?(_++,I.consume(Z),he):_>=l?(I.exit("codeFencedFenceSequence"),Be(Z)?He(I,J,"whitespace")(Z):J(Z)):B(Z)}function J(Z){return Z===null||Ie(Z)?(I.exit("codeFencedFence"),K(Z)):B(Z)}}}function h2(e,t,n){const i=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}const jf={name:"codeIndented",tokenize:m2},p2={partial:!0,tokenize:g2};function m2(e,t,n){const i=this;return s;function s(h){return e.enter("codeIndented"),He(e,a,"linePrefix",5)(h)}function a(h){const m=i.events[i.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?f(h):Ie(h)?e.attempt(p2,l,f)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||Ie(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),c)}function f(h){return e.exit("codeIndented"),t(h)}}function g2(e,t,n){const i=this;return s;function s(l){return i.parser.lazy[i.now().line]?n(l):Ie(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):He(e,a,"linePrefix",5)(l)}function a(l){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):Ie(l)?s(l):n(l)}}const y2={name:"codeText",previous:x2,resolve:v2,tokenize:w2};function v2(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 x2(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function w2(e,t,n){let i=0,s,a;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),c(p)}function c(p){return p===96?(e.consume(p),i++,c):(e.exit("codeTextSequence"),f(p))}function f(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),f):p===96?(a=e.enter("codeTextSequence"),s=0,m(p)):Ie(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("codeTextData"),h(p))}function h(p){return p===null||p===32||p===96||Ie(p)?(e.exit("codeTextData"),f(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)):(a.type="codeTextData",h(p))}}class k2{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 a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return i&&ws(this.left,i),a.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),ws(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ws(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);ws(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ws(this.left,n.reverse())}}}function ws(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 v1(e){const t={};let n=-1,i,s,a,l,c,f,h;const m=new k2(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"&&(f=i[1]._tokenizer.events,a=0,a<f.length&&f[a][1].type==="lineEndingBlank"&&(a+=2),a<f.length&&f[a][1].type==="content"))for(;++a<f.length&&f[a][1].type!=="content";)f[a][1].type==="chunkText"&&(f[a][1]._isInFirstContentOfListItem=!0,a++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,S2(m,n)),n=t[n],h=!0);else if(i[1]._container){for(a=n,s=void 0;a--;)if(l=m.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(m.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=a);else if(!(l[1].type==="linePrefix"||l[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 En(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function S2(e,t){const n=e.get(t)[1],i=e.get(t)[2];let s=t-1;const a=[];let l=n._tokenizer;l||(l=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,f=[],h={};let m,p,v=-1,w=n,S=0,C=0;const E=[C];for(;w;){for(;e.get(++s)[1]!==w;);a.push(s),w._tokenizer||(m=i.sliceStream(w),w.next||m.push(null),p&&l.defineSkip(w.start),w._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),w._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=w,w=w.next}for(w=n;++v<c.length;)c[v][0]==="exit"&&c[v-1][0]==="enter"&&c[v][1].type===c[v-1][1].type&&c[v][1].start.line!==c[v][1].end.line&&(C=v+1,E.push(C),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(l.events=[],w?(w._tokenizer=void 0,w.previous=void 0):E.pop(),v=E.length;v--;){const P=c.slice(E[v],E[v+1]),A=a.pop();f.push([A,A+P.length-1]),e.splice(A,2,P)}for(f.reverse(),v=-1;++v<f.length;)h[S+f[v][0]]=S+f[v][1],S+=f[v][1]-f[v][0]-1;return h}const b2={resolve:E2,tokenize:T2},C2={partial:!0,tokenize:P2};function E2(e){return v1(e),e}function T2(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?a(c):Ie(c)?e.check(C2,l,a)(c):(e.consume(c),s)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function P2(e,t,n){const i=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),He(e,a,"linePrefix")}function a(l){if(l===null||Ie(l))return n(l);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(l):e.interrupt(i.parser.constructs.flow,n,t)(l)}}function x1(e,t,n,i,s,a,l,c,f){const h=f||Number.POSITIVE_INFINITY;let m=0;return p;function p(P){return P===60?(e.enter(i),e.enter(s),e.enter(a),e.consume(P),e.exit(a),v):P===null||P===32||P===41||tu(P)?n(P):(e.enter(i),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),C(P))}function v(P){return P===62?(e.enter(a),e.consume(P),e.exit(a),e.exit(s),e.exit(i),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),w(P))}function w(P){return P===62?(e.exit("chunkString"),e.exit(c),v(P)):P===null||P===60||Ie(P)?n(P):(e.consume(P),P===92?S:w)}function S(P){return P===60||P===62||P===92?(e.consume(P),w):w(P)}function C(P){return!m&&(P===null||P===41||it(P))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(i),t(P)):m<h&&P===40?(e.consume(P),m++,C):P===41?(e.consume(P),m--,C):P===null||P===32||P===40||tu(P)?n(P):(e.consume(P),P===92?E:C)}function E(P){return P===40||P===41||P===92?(e.consume(P),C):C(P)}}function w1(e,t,n,i,s,a){const l=this;let c=0,f;return h;function h(w){return e.enter(i),e.enter(s),e.consume(w),e.exit(s),e.enter(a),m}function m(w){return c>999||w===null||w===91||w===93&&!f||w===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(w):w===93?(e.exit(a),e.enter(s),e.consume(w),e.exit(s),e.exit(i),t):Ie(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||Ie(w)||c++>999?(e.exit("chunkString"),m(w)):(e.consume(w),f||(f=!Be(w)),w===92?v:p)}function v(w){return w===91||w===92||w===93?(e.consume(w),c++,p):p(w)}}function k1(e,t,n,i,s,a){let l;return c;function c(v){return v===34||v===39||v===40?(e.enter(i),e.enter(s),e.consume(v),e.exit(s),l=v===40?41:v,f):n(v)}function f(v){return v===l?(e.enter(s),e.consume(v),e.exit(s),e.exit(i),t):(e.enter(a),h(v))}function h(v){return v===l?(e.exit(a),f(l)):v===null?n(v):Ie(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),He(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===l||v===null||Ie(v)?(e.exit("chunkString"),h(v)):(e.consume(v),v===92?p:m)}function p(v){return v===l||v===92?(e.consume(v),m):m(v)}}function Ns(e,t){let n;return i;function i(s){return Ie(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,i):Be(s)?He(e,i,n?"linePrefix":"lineSuffix")(s):t(s)}}const R2={name:"definition",tokenize:j2},A2={partial:!0,tokenize:N2};function j2(e,t,n){const i=this;let s;return a;function a(w){return e.enter("definition"),l(w)}function l(w){return w1.call(i,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function c(w){return s=Gn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),f):n(w)}function f(w){return it(w)?Ns(e,h)(w):h(w)}function h(w){return x1(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return e.attempt(A2,p,p)(w)}function p(w){return Be(w)?He(e,v,"whitespace")(w):v(w)}function v(w){return w===null||Ie(w)?(e.exit("definition"),i.parser.defined.push(s),t(w)):n(w)}}function N2(e,t,n){return i;function i(c){return it(c)?Ns(e,s)(c):n(c)}function s(c){return k1(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return Be(c)?He(e,l,"whitespace")(c):l(c)}function l(c){return c===null||Ie(c)?t(c):n(c)}}const M2={name:"hardBreakEscape",tokenize:I2};function I2(e,t,n){return i;function i(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return Ie(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const D2={name:"headingAtx",resolve:L2,tokenize:_2};function L2(e,t){let n=e.length-2,i=3,s,a;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},a={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},En(e,i,n-i+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function _2(e,t,n){let i=0;return s;function s(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&i++<6?(e.consume(m),l):m===null||it(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),f(m)):m===null||Ie(m)?(e.exit("atxHeading"),t(m)):Be(m)?He(e,c,"whitespace")(m):(e.enter("atxHeadingText"),h(m))}function f(m){return m===35?(e.consume(m),f):(e.exit("atxHeadingSequence"),c(m))}function h(m){return m===null||m===35||it(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),h)}}const O2=["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"],Bv=["pre","script","style","textarea"],F2={concrete:!0,name:"htmlFlow",resolveTo:B2,tokenize:$2},z2={partial:!0,tokenize:W2},V2={partial:!0,tokenize:U2};function B2(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 $2(e,t,n){const i=this;let s,a,l,c,f;return h;function h(M){return m(M)}function m(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),p}function p(M){return M===33?(e.consume(M),v):M===47?(e.consume(M),a=!0,C):M===63?(e.consume(M),s=3,i.interrupt?t:R):on(M)?(e.consume(M),l=String.fromCharCode(M),E):n(M)}function v(M){return M===45?(e.consume(M),s=2,w):M===91?(e.consume(M),s=5,c=0,S):on(M)?(e.consume(M),s=4,i.interrupt?t:R):n(M)}function w(M){return M===45?(e.consume(M),i.interrupt?t:R):n(M)}function S(M){const se="CDATA[";return M===se.charCodeAt(c++)?(e.consume(M),c===se.length?i.interrupt?t:V:S):n(M)}function C(M){return on(M)?(e.consume(M),l=String.fromCharCode(M),E):n(M)}function E(M){if(M===null||M===47||M===62||it(M)){const se=M===47,ue=l.toLowerCase();return!se&&!a&&Bv.includes(ue)?(s=1,i.interrupt?t(M):V(M)):O2.includes(l.toLowerCase())?(s=6,se?(e.consume(M),P):i.interrupt?t(M):V(M)):(s=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(M):a?A(M):T(M))}return M===45||Qt(M)?(e.consume(M),l+=String.fromCharCode(M),E):n(M)}function P(M){return M===62?(e.consume(M),i.interrupt?t:V):n(M)}function A(M){return Be(M)?(e.consume(M),A):N(M)}function T(M){return M===47?(e.consume(M),N):M===58||M===95||on(M)?(e.consume(M),L):Be(M)?(e.consume(M),T):N(M)}function L(M){return M===45||M===46||M===58||M===95||Qt(M)?(e.consume(M),L):j(M)}function j(M){return M===61?(e.consume(M),I):Be(M)?(e.consume(M),j):T(M)}function I(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),f=M,K):Be(M)?(e.consume(M),I):B(M)}function K(M){return M===f?(e.consume(M),f=null,_):M===null||Ie(M)?n(M):(e.consume(M),K)}function B(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||it(M)?j(M):(e.consume(M),B)}function _(M){return M===47||M===62||Be(M)?T(M):n(M)}function N(M){return M===62?(e.consume(M),$):n(M)}function $(M){return M===null||Ie(M)?V(M):Be(M)?(e.consume(M),$):n(M)}function V(M){return M===45&&s===2?(e.consume(M),ve):M===60&&s===1?(e.consume(M),ke):M===62&&s===4?(e.consume(M),F):M===63&&s===3?(e.consume(M),R):M===93&&s===5?(e.consume(M),pe):Ie(M)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(z2,Y,he)(M)):M===null||Ie(M)?(e.exit("htmlFlowData"),he(M)):(e.consume(M),V)}function he(M){return e.check(V2,J,Y)(M)}function J(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),Z}function Z(M){return M===null||Ie(M)?he(M):(e.enter("htmlFlowData"),V(M))}function ve(M){return M===45?(e.consume(M),R):V(M)}function ke(M){return M===47?(e.consume(M),l="",Q):V(M)}function Q(M){if(M===62){const se=l.toLowerCase();return Bv.includes(se)?(e.consume(M),F):V(M)}return on(M)&&l.length<8?(e.consume(M),l+=String.fromCharCode(M),Q):V(M)}function pe(M){return M===93?(e.consume(M),R):V(M)}function R(M){return M===62?(e.consume(M),F):M===45&&s===2?(e.consume(M),R):V(M)}function F(M){return M===null||Ie(M)?(e.exit("htmlFlowData"),Y(M)):(e.consume(M),F)}function Y(M){return e.exit("htmlFlow"),t(M)}}function U2(e,t,n){const i=this;return s;function s(l){return Ie(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}function W2(e,t,n){return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Js,t,n)}}const H2={name:"htmlText",tokenize:K2};function K2(e,t,n){const i=this;let s,a,l;return c;function c(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),f}function f(R){return R===33?(e.consume(R),h):R===47?(e.consume(R),j):R===63?(e.consume(R),T):on(R)?(e.consume(R),B):n(R)}function h(R){return R===45?(e.consume(R),m):R===91?(e.consume(R),a=0,S):on(R)?(e.consume(R),A):n(R)}function m(R){return R===45?(e.consume(R),w):n(R)}function p(R){return R===null?n(R):R===45?(e.consume(R),v):Ie(R)?(l=p,ke(R)):(e.consume(R),p)}function v(R){return R===45?(e.consume(R),w):p(R)}function w(R){return R===62?ve(R):R===45?v(R):p(R)}function S(R){const F="CDATA[";return R===F.charCodeAt(a++)?(e.consume(R),a===F.length?C:S):n(R)}function C(R){return R===null?n(R):R===93?(e.consume(R),E):Ie(R)?(l=C,ke(R)):(e.consume(R),C)}function E(R){return R===93?(e.consume(R),P):C(R)}function P(R){return R===62?ve(R):R===93?(e.consume(R),P):C(R)}function A(R){return R===null||R===62?ve(R):Ie(R)?(l=A,ke(R)):(e.consume(R),A)}function T(R){return R===null?n(R):R===63?(e.consume(R),L):Ie(R)?(l=T,ke(R)):(e.consume(R),T)}function L(R){return R===62?ve(R):T(R)}function j(R){return on(R)?(e.consume(R),I):n(R)}function I(R){return R===45||Qt(R)?(e.consume(R),I):K(R)}function K(R){return Ie(R)?(l=K,ke(R)):Be(R)?(e.consume(R),K):ve(R)}function B(R){return R===45||Qt(R)?(e.consume(R),B):R===47||R===62||it(R)?_(R):n(R)}function _(R){return R===47?(e.consume(R),ve):R===58||R===95||on(R)?(e.consume(R),N):Ie(R)?(l=_,ke(R)):Be(R)?(e.consume(R),_):ve(R)}function N(R){return R===45||R===46||R===58||R===95||Qt(R)?(e.consume(R),N):$(R)}function $(R){return R===61?(e.consume(R),V):Ie(R)?(l=$,ke(R)):Be(R)?(e.consume(R),$):_(R)}function V(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),s=R,he):Ie(R)?(l=V,ke(R)):Be(R)?(e.consume(R),V):(e.consume(R),J)}function he(R){return R===s?(e.consume(R),s=void 0,Z):R===null?n(R):Ie(R)?(l=he,ke(R)):(e.consume(R),he)}function J(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||it(R)?_(R):(e.consume(R),J)}function Z(R){return R===47||R===62||it(R)?_(R):n(R)}function ve(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function ke(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),Q}function Q(R){return Be(R)?He(e,pe,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):pe(R)}function pe(R){return e.enter("htmlTextData"),l(R)}}const Hh={name:"labelEnd",resolveAll:G2,resolveTo:Q2,tokenize:J2},q2={tokenize:Z2},X2={tokenize:eI},Y2={tokenize:tI};function G2(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&&En(e,0,e.length,n),e}function Q2(e,t){let n=e.length,i=0,s,a,l,c;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){i=2;break}}else s.type==="labelEnd"&&(l=n);const f={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[a+i+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",f,t],["enter",h,t]],c=Dn(c,e.slice(a+1,a+i+3)),c=Dn(c,[["enter",m,t]]),c=Dn(c,xu(t.parser.constructs.insideSpan.null,e.slice(a+i+4,l-3),t)),c=Dn(c,[["exit",m,t],e[l-2],e[l-1],["exit",h,t]]),c=Dn(c,e.slice(l+1)),c=Dn(c,[["exit",f,t]]),En(e,a,e.length,c),e}function J2(e,t,n){const i=this;let s=i.events.length,a,l;for(;s--;)if((i.events[s][1].type==="labelImage"||i.events[s][1].type==="labelLink")&&!i.events[s][1]._balanced){a=i.events[s][1];break}return c;function c(v){return a?a._inactive?p(v):(l=i.parser.defined.includes(Gn(i.sliceSerialize({start:a.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),f):n(v)}function f(v){return v===40?e.attempt(q2,m,l?m:p)(v):v===91?e.attempt(X2,m,l?h:p)(v):l?m(v):p(v)}function h(v){return e.attempt(Y2,m,p)(v)}function m(v){return t(v)}function p(v){return a._balanced=!0,n(v)}}function Z2(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 it(p)?Ns(e,a)(p):a(p)}function a(p){return p===41?m(p):x1(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return it(p)?Ns(e,f)(p):m(p)}function c(p){return n(p)}function f(p){return p===34||p===39||p===40?k1(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function h(p){return it(p)?Ns(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 eI(e,t,n){const i=this;return s;function s(c){return w1.call(i,e,a,l,"reference","referenceMarker","referenceString")(c)}function a(c){return i.parser.defined.includes(Gn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function tI(e,t,n){return i;function i(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const nI={name:"labelStartImage",resolveAll:Hh.resolveAll,tokenize:rI};function rI(e,t,n){const i=this;return s;function s(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(c):t(c)}}const iI={name:"labelStartLink",resolveAll:Hh.resolveAll,tokenize:oI};function oI(e,t,n){const i=this;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(l):t(l)}}const Nf={name:"lineEnding",tokenize:sI};function sI(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),He(e,t,"linePrefix")}}const _l={name:"thematicBreak",tokenize:aI};function aI(e,t,n){let i=0,s;return a;function a(h){return e.enter("thematicBreak"),l(h)}function l(h){return s=h,c(h)}function c(h){return h===s?(e.enter("thematicBreakSequence"),f(h)):i>=3&&(h===null||Ie(h))?(e.exit("thematicBreak"),t(h)):n(h)}function f(h){return h===s?(e.consume(h),i++,f):(e.exit("thematicBreakSequence"),Be(h)?He(e,c,"whitespace")(h):c(h))}}const gn={continuation:{tokenize:fI},exit:hI,name:"list",tokenize:cI},lI={partial:!0,tokenize:pI},uI={partial:!0,tokenize:dI};function cI(e,t,n){const i=this,s=i.events[i.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return c;function c(w){const S=i.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!i.containerState.marker||w===i.containerState.marker:jd(w)){if(i.containerState.type||(i.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(_l,n,h)(w):h(w);if(!i.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(w)}return n(w)}function f(w){return jd(w)&&++l<10?(e.consume(w),f):(!i.interrupt||l<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(Js,i.interrupt?n:m,e.attempt(lI,v,p))}function m(w){return i.containerState.initialBlankLine=!0,a++,v(w)}function p(w){return Be(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),v):n(w)}function v(w){return i.containerState.size=a+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function fI(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Js,s,a);function s(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,He(e,t,"listItemIndent",i.containerState.size+1)(c)}function a(c){return i.containerState.furtherBlankLines||!Be(c)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,l(c)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(uI,t,l)(c))}function l(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,He(e,e.attempt(gn,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function dI(e,t,n){const i=this;return He(e,s,"listItemIndent",i.containerState.size+1);function s(a){const l=i.events[i.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===i.containerState.size?t(a):n(a)}}function hI(e){e.exit(this.containerState.type)}function pI(e,t,n){const i=this;return He(e,s,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const l=i.events[i.events.length-1];return!Be(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const $v={name:"setextUnderline",resolveTo:mI,tokenize:gI};function mI(e,t){let n=e.length,i,s,a;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),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",l,t]),e.splice(a+1,0,["exit",e[i][1],t]),e[i][1].end={...e[a][1].end}):e[i][1]=l,e.push(["exit",l,t]),e}function gI(e,t,n){const i=this;let s;return a;function a(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,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===s?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),Be(h)?He(e,f,"lineSuffix")(h):f(h))}function f(h){return h===null||Ie(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const yI={tokenize:vI};function vI(e){const t=this,n=e.attempt(Js,i,e.attempt(this.parser.constructs.flowInitial,s,He(e,e.attempt(this.parser.constructs.flow,s,e.attempt(b2,s)),"linePrefix")));return n;function i(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const xI={resolveAll:b1()},wI=S1("string"),kI=S1("text");function S1(e){return{resolveAll:b1(e==="text"?SI:void 0),tokenize:t};function t(n){const i=this,s=this.parser.constructs[e],a=n.attempt(s,l,c);return l;function l(m){return h(m)?a(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),f}function f(m){return h(m)?(n.exit("data"),a(m)):(n.consume(m),f)}function h(m){if(m===null)return!0;const p=s[m];let v=-1;if(p)for(;++v<p.length;){const w=p[v];if(!w.previous||w.previous.call(i,i.previous))return!0}return!1}}}function b1(e){return t;function t(n,i){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,i):n}}function SI(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 a=s.length,l=-1,c=0,f;for(;a--;){const h=s[a];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(h===-2)f=!0,c++;else if(h!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const h={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:i.start._bufferIndex+l,_index:i.start._index+a,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 bI={42:gn,43:gn,45:gn,48:gn,49:gn,50:gn,51:gn,52:gn,53:gn,54:gn,55:gn,56:gn,57:gn,62:m1},CI={91:R2},EI={[-2]:jf,[-1]:jf,32:jf},TI={35:D2,42:_l,45:[$v,_l],60:F2,61:$v,95:_l,96:Vv,126:Vv},PI={38:y1,92:g1},RI={[-5]:Nf,[-4]:Nf,[-3]:Nf,33:nI,38:y1,42:Md,60:[i2,H2],91:iI,92:[M2,g1],93:Hh,95:Md,96:y2},AI={null:[Md,xI]},jI={null:[42,95]},NI={null:[]},MI=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:jI,contentInitial:CI,disable:NI,document:bI,flow:TI,flowInitial:EI,insideSpan:AI,string:PI,text:RI},Symbol.toStringTag,{value:"Module"}));function II(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={},a=[];let l=[],c=[];const f={attempt:K(j),check:K(I),consume:A,enter:T,exit:L,interrupt:K(I,{interrupt:!0})},h={code:null,containerState:{},defineSkip:C,events:[],now:S,parser:e,previous:null,sliceSerialize:v,sliceStream:w,write:p};let m=t.tokenize.call(h,f);return t.resolveAll&&a.push(t),h;function p($){return l=Dn(l,$),E(),l[l.length-1]!==null?[]:(B(t,0),h.events=xu(a,h.events,h),h.events)}function v($,V){return LI(w($),V)}function w($){return DI(l,$)}function S(){const{_bufferIndex:$,_index:V,line:he,column:J,offset:Z}=i;return{_bufferIndex:$,_index:V,line:he,column:J,offset:Z}}function C($){s[$.line]=$.column,N()}function E(){let $;for(;i._index<l.length;){const V=l[i._index];if(typeof V=="string")for($=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===$&&i._bufferIndex<V.length;)P(V.charCodeAt(i._bufferIndex));else P(V)}}function P($){m=m($)}function A($){Ie($)?(i.line++,i.column=1,i.offset+=$===-3?2:1,N()):$!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===l[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=$}function T($,V){const he=V||{};return he.type=$,he.start=S(),h.events.push(["enter",he,h]),c.push(he),he}function L($){const V=c.pop();return V.end=S(),h.events.push(["exit",V,h]),V}function j($,V){B($,V.from)}function I($,V){V.restore()}function K($,V){return he;function he(J,Z,ve){let ke,Q,pe,R;return Array.isArray(J)?Y(J):"tokenize"in J?Y([J]):F(J);function F(ae){return me;function me(Se){const xe=Se!==null&&ae[Se],Ue=Se!==null&&ae.null,Fe=[...Array.isArray(xe)?xe:xe?[xe]:[],...Array.isArray(Ue)?Ue:Ue?[Ue]:[]];return Y(Fe)(Se)}}function Y(ae){return ke=ae,Q=0,ae.length===0?ve:M(ae[Q])}function M(ae){return me;function me(Se){return R=_(),pe=ae,ae.partial||(h.currentConstruct=ae),ae.name&&h.parser.constructs.disable.null.includes(ae.name)?ue():ae.tokenize.call(V?Object.assign(Object.create(h),V):h,f,se,ue)(Se)}}function se(ae){return $(pe,R),Z}function ue(ae){return R.restore(),++Q<ke.length?M(ke[Q]):ve}}}function B($,V){$.resolveAll&&!a.includes($)&&a.push($),$.resolve&&En(h.events,V,h.events.length-V,$.resolve(h.events.slice(V),h)),$.resolveTo&&(h.events=$.resolveTo(h.events,h))}function _(){const $=S(),V=h.previous,he=h.currentConstruct,J=h.events.length,Z=Array.from(c);return{from:J,restore:ve};function ve(){i=$,h.previous=V,h.currentConstruct=he,h.events.length=J,c=Z,N()}}function N(){i.line in s&&i.column<2&&(i.column=s[i.line],i.offset+=s[i.line]-1)}}function DI(e,t){const n=t.start._index,i=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(i,a)];else{if(l=e.slice(n,s),i>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(i):l.shift()}a>0&&l.push(e[s].slice(0,a))}return l}function LI(e,t){let n=-1;const i=[];let s;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
264
+ `;break}case-3:{l=`\r
265
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(a)}s=a===-2,i.push(l)}return i.join("")}function _I(e){const i={constructs:p1([MI,...(e||{}).extensions||[]]),content:s(QM),defined:[],document:s(ZM),flow:s(yI),lazy:{},string:s(wI),text:s(kI)};return i;function s(a){return l;function l(c){return II(i,a,c)}}}function OI(e){for(;!v1(e););return e}const Uv=/[\0\t\n\r]/g;function FI(){let e=1,t="",n=!0,i;return s;function s(a,l,c){const f=[];let h,m,p,v,w;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),p=0,t="",n&&(a.charCodeAt(0)===65279&&p++,n=void 0);p<a.length;){if(Uv.lastIndex=p,h=Uv.exec(a),v=h&&h.index!==void 0?h.index:a.length,w=a.charCodeAt(v),!h){t=a.slice(p);break}if(w===10&&p===v&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),p<v&&(f.push(a.slice(p,v)),e+=v-p),w){case 0:{f.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,f.push(-2);e++<m;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:i=!0,e=1}p=v+1}return c&&(i&&f.push(-5),t&&f.push(t),f.push(null)),f}}function Ms(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Wv(e.position):"start"in e||"end"in e?Wv(e):"line"in e||"column"in e?Id(e):""}function Id(e){return Hv(e&&e.line)+":"+Hv(e&&e.column)}function Wv(e){return Id(e&&e.start)+"-"+Id(e&&e.end)}function Hv(e){return e&&typeof e=="number"?e:1}const C1={}.hasOwnProperty;function E1(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),zI(n)(OI(_I(n).document().write(FI()(e,t,!0))))}function zI(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Tn),autolinkProtocol:_,autolinkEmail:_,atxHeading:a(Ft),blockQuote:a(Ue),characterEscape:_,characterReference:_,codeFenced:a(Fe),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Fe,l),codeText:a(Ke,l),codeTextData:_,data:_,codeFlowValue:_,definition:a(ot),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(st),hardBreakEscape:a(Zt),hardBreakTrailing:a(Zt),htmlFlow:a(et,l),htmlFlowData:_,htmlText:a(et,l),htmlTextData:_,image:a(Wt),label:l,link:a(Tn),listItem:a(en),listItemValue:v,listOrdered:a(zt,p),listUnordered:a(zt),paragraph:a(bt),reference:M,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Ft),strong:a(Jn),thematicBreak:a(Ar)},exit:{atxHeading:f(),atxHeadingSequence:j,autolink:f(),autolinkEmail:xe,autolinkProtocol:Se,blockQuote:f(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:ae,characterReference:me,codeFenced:f(E),codeFencedFence:C,codeFencedFenceInfo:w,codeFencedFenceMeta:S,codeFlowValue:N,codeIndented:f(P),codeText:f(Z),codeTextData:N,data:N,definition:f(),definitionDestinationString:L,definitionLabelString:A,definitionTitleString:T,emphasis:f(),hardBreakEscape:f(V),hardBreakTrailing:f(V),htmlFlow:f(he),htmlFlowData:N,htmlText:f(J),htmlTextData:N,image:f(ke),label:pe,labelText:Q,lineEnding:$,link:f(ve),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:se,resourceDestinationString:R,resourceTitleString:F,resource:Y,setextHeading:f(B),setextHeadingLineSequence:K,setextHeadingText:I,strong:f(),thematicBreak:f()}};T1(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(G){let ee={type:"root",children:[]};const Re={stack:[ee],tokenStack:[],config:t,enter:c,exit:h,buffer:l,resume:m,data:n},je=[];let ze=-1;for(;++ze<G.length;)if(G[ze][1].type==="listOrdered"||G[ze][1].type==="listUnordered")if(G[ze][0]==="enter")je.push(ze);else{const at=je.pop();ze=s(G,at,ze)}for(ze=-1;++ze<G.length;){const at=t[G[ze][0]];C1.call(at,G[ze][1].type)&&at[G[ze][1].type].call(Object.assign({sliceSerialize:G[ze][2].sliceSerialize},Re),G[ze][1])}if(Re.tokenStack.length>0){const at=Re.tokenStack[Re.tokenStack.length-1];(at[1]||Kv).call(Re,void 0,at[0])}for(ee.position={start:Jr(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:Jr(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},ze=-1;++ze<t.transforms.length;)ee=t.transforms[ze](ee)||ee;return ee}function s(G,ee,Re){let je=ee-1,ze=-1,at=!1,Mt,W,ge,ie;for(;++je<=Re;){const ye=G[je];switch(ye[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ye[0]==="enter"?ze++:ze--,ie=void 0;break}case"lineEndingBlank":{ye[0]==="enter"&&(Mt&&!ie&&!ze&&!ge&&(ge=je),ie=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ie=void 0}if(!ze&&ye[0]==="enter"&&ye[1].type==="listItemPrefix"||ze===-1&&ye[0]==="exit"&&(ye[1].type==="listUnordered"||ye[1].type==="listOrdered")){if(Mt){let De=je;for(W=void 0;De--;){const de=G[De];if(de[1].type==="lineEnding"||de[1].type==="lineEndingBlank"){if(de[0]==="exit")continue;W&&(G[W][1].type="lineEndingBlank",at=!0),de[1].type="lineEnding",W=De}else if(!(de[1].type==="linePrefix"||de[1].type==="blockQuotePrefix"||de[1].type==="blockQuotePrefixWhitespace"||de[1].type==="blockQuoteMarker"||de[1].type==="listItemIndent"))break}ge&&(!W||ge<W)&&(Mt._spread=!0),Mt.end=Object.assign({},W?G[W][1].start:ye[1].end),G.splice(W||je,0,["exit",Mt,ye[2]]),je++,Re++}if(ye[1].type==="listItemPrefix"){const De={type:"listItem",_spread:!1,start:Object.assign({},ye[1].start),end:void 0};Mt=De,G.splice(je,0,["enter",De,ye[2]]),je++,Re++,ge=void 0,ie=!0}}}return G[ee][1]._spread=at,Re}function a(G,ee){return Re;function Re(je){c.call(this,G(je),je),ee&&ee.call(this,je)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(G,ee,Re){this.stack[this.stack.length-1].children.push(G),this.stack.push(G),this.tokenStack.push([ee,Re||void 0]),G.position={start:Jr(ee.start),end:void 0}}function f(G){return ee;function ee(Re){G&&G.call(this,Re),h.call(this,Re)}}function h(G,ee){const Re=this.stack.pop(),je=this.tokenStack.pop();if(je)je[0].type!==G.type&&(ee?ee.call(this,G,je[0]):(je[1]||Kv).call(this,G,je[0]));else throw new Error("Cannot close `"+G.type+"` ("+Ms({start:G.start,end:G.end})+"): it’s not open");Re.position.end=Jr(G.end)}function m(){return $h(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function v(G){if(this.data.expectingFirstListItemValue){const ee=this.stack[this.stack.length-2];ee.start=Number.parseInt(this.sliceSerialize(G),10),this.data.expectingFirstListItemValue=void 0}}function w(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.lang=G}function S(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.meta=G}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.value=G.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function P(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.value=G.replace(/(\r?\n|\r)$/g,"")}function A(G){const ee=this.resume(),Re=this.stack[this.stack.length-1];Re.label=ee,Re.identifier=Gn(this.sliceSerialize(G)).toLowerCase()}function T(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.title=G}function L(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.url=G}function j(G){const ee=this.stack[this.stack.length-1];if(!ee.depth){const Re=this.sliceSerialize(G).length;ee.depth=Re}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function K(G){const ee=this.stack[this.stack.length-1];ee.depth=this.sliceSerialize(G).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function _(G){const Re=this.stack[this.stack.length-1].children;let je=Re[Re.length-1];(!je||je.type!=="text")&&(je=We(),je.position={start:Jr(G.start),end:void 0},Re.push(je)),this.stack.push(je)}function N(G){const ee=this.stack.pop();ee.value+=this.sliceSerialize(G),ee.position.end=Jr(G.end)}function $(G){const ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Re=ee.children[ee.children.length-1];Re.position.end=Jr(G.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ee.type)&&(_.call(this,G),N.call(this,G))}function V(){this.data.atHardBreak=!0}function he(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.value=G}function J(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.value=G}function Z(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.value=G}function ve(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=ee,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function ke(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=ee,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function Q(G){const ee=this.sliceSerialize(G),Re=this.stack[this.stack.length-2];Re.label=LM(ee),Re.identifier=Gn(ee).toLowerCase()}function pe(){const G=this.stack[this.stack.length-1],ee=this.resume(),Re=this.stack[this.stack.length-1];if(this.data.inReference=!0,Re.type==="link"){const je=G.children;Re.children=je}else Re.alt=ee}function R(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.url=G}function F(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.title=G}function Y(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function se(G){const ee=this.resume(),Re=this.stack[this.stack.length-1];Re.label=ee,Re.identifier=Gn(this.sliceSerialize(G)).toLowerCase(),this.data.referenceType="full"}function ue(G){this.data.characterReferenceType=G.type}function ae(G){const ee=this.sliceSerialize(G),Re=this.data.characterReferenceType;let je;Re?(je=d1(ee,Re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):je=Wh(ee);const ze=this.stack[this.stack.length-1];ze.value+=je}function me(G){const ee=this.stack.pop();ee.position.end=Jr(G.end)}function Se(G){N.call(this,G);const ee=this.stack[this.stack.length-1];ee.url=this.sliceSerialize(G)}function xe(G){N.call(this,G);const ee=this.stack[this.stack.length-1];ee.url="mailto:"+this.sliceSerialize(G)}function Ue(){return{type:"blockquote",children:[]}}function Fe(){return{type:"code",lang:null,meta:null,value:""}}function Ke(){return{type:"inlineCode",value:""}}function ot(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function st(){return{type:"emphasis",children:[]}}function Ft(){return{type:"heading",depth:0,children:[]}}function Zt(){return{type:"break"}}function et(){return{type:"html",value:""}}function Wt(){return{type:"image",title:null,url:"",alt:null}}function Tn(){return{type:"link",title:null,url:"",children:[]}}function zt(G){return{type:"list",ordered:G.type==="listOrdered",start:null,spread:G._spread,children:[]}}function en(G){return{type:"listItem",spread:G._spread,checked:null,children:[]}}function bt(){return{type:"paragraph",children:[]}}function Jn(){return{type:"strong",children:[]}}function We(){return{type:"text",value:""}}function Ar(){return{type:"thematicBreak"}}}function Jr(e){return{line:e.line,column:e.column,offset:e.offset}}function T1(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?T1(e,i):VI(e,i)}}function VI(e,t){let n;for(n in t)if(C1.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 Kv(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ms({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ms({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ms({start:t.start,end:t.end})+") is still open")}const BI={tokenize:qI,partial:!0},P1={tokenize:XI,partial:!0},R1={tokenize:YI,partial:!0},A1={tokenize:GI,partial:!0},$I={tokenize:QI,partial:!0},j1={name:"wwwAutolink",tokenize:HI,previous:M1},N1={name:"protocolAutolink",tokenize:KI,previous:I1},Rr={name:"emailAutolink",tokenize:WI,previous:D1},hr={};function UI(){return{text:hr}}let bi=48;for(;bi<123;)hr[bi]=Rr,bi++,bi===58?bi=65:bi===91&&(bi=97);hr[43]=Rr;hr[45]=Rr;hr[46]=Rr;hr[95]=Rr;hr[72]=[Rr,N1];hr[104]=[Rr,N1];hr[87]=[Rr,j1];hr[119]=[Rr,j1];function WI(e,t,n){const i=this;let s,a;return l;function l(p){return!Dd(p)||!D1.call(i,i.previous)||Kh(i.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(p))}function c(p){return Dd(p)?(e.consume(p),c):p===64?(e.consume(p),f):n(p)}function f(p){return p===46?e.check($I,m,h)(p):p===45||p===95||Qt(p)?(a=!0,e.consume(p),f):m(p)}function h(p){return e.consume(p),s=!0,f}function m(p){return a&&s&&on(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function HI(e,t,n){const i=this;return s;function s(l){return l!==87&&l!==119||!M1.call(i,i.previous)||Kh(i.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(BI,e.attempt(P1,e.attempt(R1,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function KI(e,t,n){const i=this;let s="",a=!1;return l;function l(p){return(p===72||p===104)&&I1.call(i,i.previous)&&!Kh(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),c):n(p)}function c(p){if(on(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),c;if(p===58){const v=s.toLowerCase();if(v==="http"||v==="https")return e.consume(p),f}return n(p)}function f(p){return p===47?(e.consume(p),a?h:(a=!0,f)):n(p)}function h(p){return p===null||tu(p)||it(p)||Di(p)||gu(p)?n(p):e.attempt(P1,e.attempt(R1,m),n)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function qI(e,t,n){let i=0;return s;function s(l){return(l===87||l===119)&&i<3?(i++,e.consume(l),s):l===46&&i===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function XI(e,t,n){let i,s,a;return l;function l(h){return h===46||h===95?e.check(A1,f,c)(h):h===null||it(h)||Di(h)||h!==45&&gu(h)?f(h):(a=!0,e.consume(h),l)}function c(h){return h===95?i=!0:(s=i,i=void 0),e.consume(h),l}function f(h){return s||i||!a?n(h):t(h)}}function YI(e,t){let n=0,i=0;return s;function s(l){return l===40?(n++,e.consume(l),s):l===41&&i<n?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(A1,t,a)(l):l===null||it(l)||Di(l)?t(l):(e.consume(l),s)}function a(l){return l===41&&i++,e.consume(l),s}}function GI(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),a):c===93?(e.consume(c),s):c===60||c===null||it(c)||Di(c)?t(c):n(c)}function s(c){return c===null||c===40||c===91||it(c)||Di(c)?t(c):i(c)}function a(c){return on(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),i):on(c)?(e.consume(c),l):n(c)}}function QI(e,t,n){return i;function i(a){return e.consume(a),s}function s(a){return Qt(a)?n(a):t(a)}}function M1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||it(e)}function I1(e){return!on(e)}function D1(e){return!(e===47||Dd(e))}function Dd(e){return e===43||e===45||e===46||e===95||Qt(e)}function Kh(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 JI={tokenize:sD,partial:!0};function ZI(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:rD,continuation:{tokenize:iD},exit:oD}},text:{91:{name:"gfmFootnoteCall",tokenize:nD},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:eD,resolveTo:tD}}}}function eD(e,t,n){const i=this;let s=i.events.length;const a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l;for(;s--;){const f=i.events[s][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!l||!l._balanced)return n(f);const h=Gn(i.sliceSerialize({start:l.end,end:i.now()}));return h.codePointAt(0)!==94||!a.includes(h.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function tD(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 a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},c=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...c),e}function nD(e,t,n){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a=0,l;return c;function c(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),f}function f(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(a>999||p===93&&!l||p===null||p===91||it(p))return n(p);if(p===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return s.includes(Gn(i.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return it(p)||(l=!0),a++,e.consume(p),p===92?m:h}function m(p){return p===91||p===92||p===93?(e.consume(p),a++,h):h(p)}}function rD(e,t,n){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a,l=0,c;return f;function f(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(S)}function m(S){if(l>999||S===93&&!c||S===null||S===91||it(S))return n(S);if(S===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return a=Gn(i.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return it(S)||(c=!0),l++,e.consume(S),S===92?p:m}function p(S){return S===91||S===92||S===93?(e.consume(S),l++,m):m(S)}function v(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(a)||s.push(a),He(e,w,"gfmFootnoteDefinitionWhitespace")):n(S)}function w(S){return t(S)}}function iD(e,t,n){return e.check(Js,t,e.attempt(JI,t,n))}function oD(e){e.exit("gfmFootnoteDefinition")}function sD(e,t,n){const i=this;return He(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const l=i.events[i.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function aD(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function s(l,c){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let h=f;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[f][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[f][1].end)},p={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[f][1].start)},v=[["enter",m,c],["enter",l[h][1],c],["exit",l[h][1],c],["enter",p,c]],w=c.parser.constructs.insideSpan.null;w&&En(v,v.length,0,xu(w,l.slice(h+1,f),c)),En(v,v.length,0,[["exit",p,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",m,c]]),En(l,h-1,f-h+3,v),f=h+v.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function a(l,c,f){const h=this.previous,m=this.events;let p=0;return v;function v(S){return h===126&&m[m.length-1][1].type!=="characterEscape"?f(S):(l.enter("strikethroughSequenceTemporary"),w(S))}function w(S){const C=Po(h);if(S===126)return p>1?f(S):(l.consume(S),p++,w);if(p<2&&!n)return f(S);const E=l.exit("strikethroughSequenceTemporary"),P=Po(S);return E._open=!P||P===2&&!!C,E._close=!C||C===2&&!!P,c(S)}}}class lD{constructor(){this.map=[]}add(t,n,i){uD(this,t,n,i)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[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 a of s)t.push(a);s=i.pop()}this.map.length=0}}function uD(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 cD(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 a=i.length-1;i[a]=i[a]==="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 fD(){return{flow:{null:{name:"table",tokenize:dD,resolveAll:hD}}}}function dD(e,t,n){const i=this;let s=0,a=0,l;return c;function c(N){let $=i.events.length-1;for(;$>-1;){const J=i.events[$][1].type;if(J==="lineEnding"||J==="linePrefix")$--;else break}const V=$>-1?i.events[$][1].type:null,he=V==="tableHead"||V==="tableRow"?I:f;return he===I&&i.parser.lazy[i.now().line]?n(N):he(N)}function f(N){return e.enter("tableHead"),e.enter("tableRow"),h(N)}function h(N){return N===124||(l=!0,a+=1),m(N)}function m(N){return N===null?n(N):Ie(N)?a>1?(a=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),w):n(N):Be(N)?He(e,m,"whitespace")(N):(a+=1,l&&(l=!1,s+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),p(N)))}function p(N){return N===null||N===124||it(N)?(e.exit("data"),m(N)):(e.consume(N),N===92?v:p)}function v(N){return N===92||N===124?(e.consume(N),p):p(N)}function w(N){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(N):(e.enter("tableDelimiterRow"),l=!1,Be(N)?He(e,S,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):S(N))}function S(N){return N===45||N===58?E(N):N===124?(l=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),C):j(N)}function C(N){return Be(N)?He(e,E,"whitespace")(N):E(N)}function E(N){return N===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),P):N===45?(a+=1,P(N)):N===null||Ie(N)?L(N):j(N)}function P(N){return N===45?(e.enter("tableDelimiterFiller"),A(N)):j(N)}function A(N){return N===45?(e.consume(N),A):N===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(N))}function T(N){return Be(N)?He(e,L,"whitespace")(N):L(N)}function L(N){return N===124?S(N):N===null||Ie(N)?!l||s!==a?j(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):j(N)}function j(N){return n(N)}function I(N){return e.enter("tableRow"),K(N)}function K(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),K):N===null||Ie(N)?(e.exit("tableRow"),t(N)):Be(N)?He(e,K,"whitespace")(N):(e.enter("data"),B(N))}function B(N){return N===null||N===124||it(N)?(e.exit("data"),K(N)):(e.consume(N),N===92?_:B)}function _(N){return N===92||N===124?(e.consume(N),B):B(N)}}function hD(e,t){let n=-1,i=!0,s=0,a=[0,0,0,0],l=[0,0,0,0],c=!1,f=0,h,m,p;const v=new lD;for(;++n<e.length;){const w=e[n],S=w[1];w[0]==="enter"?S.type==="tableHead"?(c=!1,f!==0&&(qv(v,t,f,h,m),m=void 0,f=0),h={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},v.add(n,0,[["enter",h,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(i=!0,p=void 0,a=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},v.add(n,0,[["enter",m,t]])),s=S.type==="tableDelimiterRow"?2:m?3:1):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],p=yl(v,t,a,s,void 0,p),a=[0,0,0,0]),l[2]=n)):S.type==="tableCellDivider"&&(i?i=!1:(a[1]!==0&&(l[0]=l[1],p=yl(v,t,a,s,void 0,p)),a=l,l=[a[1],n,0,0])):S.type==="tableHead"?(c=!0,f=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(f=n,a[1]!==0?(l[0]=l[1],p=yl(v,t,a,s,n,p)):l[1]!==0&&(p=yl(v,t,l,s,n,p)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&qv(v,t,f,h,m),v.consume(t.events),n=-1;++n<t.events.length;){const w=t.events[n];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=cD(t.events,n))}return e}function yl(e,t,n,i,s,a){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},go(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const f=go(t.events,n[1]);if(a={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const h=go(t.events,n[2]),m=go(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 v=t.events[n[2]],w=t.events[n[3]];if(v[1].end=Object.assign({},w[1].end),v[1].type="chunkText",v[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,C=n[3]-n[2]-1;e.add(S,C,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return s!==void 0&&(a.end=Object.assign({},go(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function qv(e,t,n,i,s){const a=[],l=go(t.events,n);s&&(s.end=Object.assign({},l),a.push(["exit",s,t])),i.end=Object.assign({},l),a.push(["exit",i,t]),e.add(n+1,0,a)}function go(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const pD={name:"tasklistCheck",tokenize:gD};function mD(){return{text:{91:pD}}}function gD(e,t,n){const i=this;return s;function s(f){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),a)}function a(f){return it(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return Ie(f)?t(f):Be(f)?e.check({tokenize:yD},t,n)(f):n(f)}}function yD(e,t,n){return He(e,i,"whitespace");function i(s){return s===null?n(s):t(s)}}function L1(e){return p1([UI(),ZI(),aD(e),fD(),mD()])}function _1(e){return typeof e=="string"&&/\.md$/i.test(e.trim())}function vD(e,t){const n=String(e??"").trim().split(/\r?\n/).map(s=>`> ${s}`).join(`
266
+ `),i=String(t??"").trim();return n&&i?`${n}
267
+
268
+ ${i}`:n||i}function xD(e){const t=String(e??""),n=t.lastIndexOf(".");return`${n>0?t.slice(0,n):t}_review.md`}function wD(e,t,n){const i=String(e??""),s=String(t??""),a=Math.max(0,Number(n)||0);if(!s)return 0;let l=0,c=0;for(;c<=i.length;){const f=i.indexOf(s,c);if(f<0||f>=a)return l;l+=1,c=f+Math.max(s.length,1)}return l}function kD(e){return(String(e??"").match(/https?:\/\/[^\s<>()\[\]{}"']+/gi)??[]).map(n=>n.replace(/[.,!?;:]+$/,""))}function Ld(e){return e?.kind!=="file"?null:String(e.mime??"").toLowerCase().startsWith("image/")?"photo":"file"}function SD(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"),a=n.get(s)??[];a.push(i),n.set(s,a)}return[...n.entries()].map(([i,s])=>({filename:i,versions:s.sort((a,l)=>t(l.message?.date)-t(a.message?.date))})).sort((i,s)=>t(s.versions[0]?.message?.date)-t(i.versions[0]?.message?.date))}const bD=new Set(["delete","emphasis","inlineCode","link","linkReference","strong"]);function CD(e){const t=E1(e,{extensions:[L1()],mdastExtensions:[h1()]}),n=[],i=[],s=[],a=(c,f)=>{const h=String(c??""),m=f.position?.start?.offset,p=f.position?.end?.offset;if(!h||!Number.isInteger(m)||!Number.isInteger(p))return;const v=e.slice(m,p),w=v.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 S=0;for(const C of h){const E=v.indexOf(C,S),P=E>=0?E:Math.min(S,Math.max(v.length-1,0));n.push(C),i.push(m+P+1),S=P+1}},l=c=>{const f=n.length;if(c.type==="text"||c.type==="inlineCode"||c.type==="code")a(c.value,c);else for(const p of c.children??[])l(p);const h=n.length,m=c.position?.end?.offset;h>f&&bD.has(c.type)&&Number.isInteger(m)&&s.push({visibleEnd:h,rawEnd:m})};return l(t),{text:n.join(""),rawEnds:i,trailingRanges:s}}function ED(e,t,n){let i=-1,s=0;for(let a=0;a<=n;a+=1){if(i=e.indexOf(t,s),i<0)return-1;s=i+Math.max(t.length,1)}return i}function TD(e,t){const n=String(e??""),i=CD(n),s=new Map,a=[];for(const[f,h]of(t??[]).entries()){const m=String(h?.selection??"").trim(),p=String(h?.comment??"").trim().replace(/\s+/g," ").replace(/\]\]/g,"] ]");if(!p)continue;const v=`[[REVIEW COMMENT ${f+1}: ${p}]]`,w=Number.isInteger(h?.occurrence)&&h.occurrence>=0?h.occurrence:0,S=m?ED(i.text,m,w):-1,C=S+m.length;let E=S>=0?i.rawEnds[C-1]:void 0;if(!Number.isInteger(E)){a.push(`[[REVIEW COMMENT ${f+1} — ANCHOR NOT FOUND: ${p}]]`);continue}for(const A of i.trailingRanges)A.visibleEnd===C&&(E=Math.max(E,A.rawEnd));const P=s.get(E)??[];P.push(v),s.set(E,P)}let l=n;const c=[...s.keys()].sort((f,h)=>h-f);for(const f of c)l=`${l.slice(0,f)} ${s.get(f).join(" ")}${l.slice(f)}`;return a.length>0&&(l=`${l.trimEnd()}
269
+
270
+ ${a.join(`
271
+ `)}
272
+ `),l}const PD="",RD="application/octet-stream",AD=/\.([A-Za-z0-9]{1,12})$/;function O1(e){return String(e??"").split(";")[0].trim().toLowerCase()}function F1(e){const t=AD.exec(String(e??"").trim());return t?t[1].toLowerCase():""}function jD(e){const t=F1(e);return t==="html"||t==="htm"}function Zs(e,t){return jD(e)?!0:F1(e)?!1:O1(t)==="text/html"}function qh(e,t){const n=O1(e);return n==="text/html"||Zs(t,e)?RD:n}const _d=48e3,ND=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"}]),z1="x-ours-duration",MD=4e3;function ID(e){return!Number.isFinite(e)||e<=0?null:String(Math.round(e*100)/100)}function DD(e,t){const n=t===null?null:ID(t);return n===null?e:`${e};${z1}=${n}`}function LD(e){if(!e)return null;const t=new RegExp(`${z1}\\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 _D(e,t=MD){return typeof Audio!="function"||typeof URL?.createObjectURL!="function"?Promise.resolve(null):new Promise(n=>{const i=URL.createObjectURL(e),s=new Audio;let a=!1;const l=f=>{a||(a=!0,clearTimeout(c),s.removeAttribute("src"),s.load(),URL.revokeObjectURL(i),n(Number.isFinite(f)&&(f??0)>0?f:null))},c=setTimeout(()=>l(null),t);s.addEventListener("loadedmetadata",()=>{Number.isFinite(s.duration)&&s.duration>0?l(s.duration):s.currentTime=Number.MAX_SAFE_INTEGER},{once:!0}),s.addEventListener("durationchange",()=>{Number.isFinite(s.duration)&&s.duration>0&&l(s.duration)}),s.addEventListener("error",()=>l(null),{once:!0}),s.preload="metadata",s.src=i})}const V1=40,OD=44,B1=.14,FD=.5,zD=e=>e<0?0:e>1?1:e;function $1(e,{floor:t=B1,gamma:n=FD}={}){const i=Math.pow(zD(Number.isFinite(e)?e:0),n);return t+(1-t)*i}function VD(e,t=V1){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 a=0;a<n;a++){const l=Math.floor(a*s),c=Math.min(e.length,Math.max(l+1,Math.floor((a+1)*s)));let f=0;for(let h=l;h<c;h++)f+=e[h]*e[h];i[a]=Math.sqrt(f/(c-l))}return i}function BD(e,t={}){const{silenceFloor:n=1e-4}=t,i=e.reduce((s,a)=>a>s?a:s,0);return i>n?e.map(s=>$1(s/i,t)):e.map(()=>B1)}function $D({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),$1(s/n)},get reference(){return n}}}function U1(e){return qh(e.mime,e.filename)}function Xh(e){const[t,n]=k.useState({url:null,size:0,loaded:!1});return k.useEffect(()=>{let i=null,s=!1;n({url:null,size:0,loaded:!1});const a=e.available?eN(e.id):null;return a?(n({url:a,size:e.size,loaded:!0}),()=>{}):(mu(e.id).then(l=>{if(s)return;if(!l){n({url:null,size:0,loaded:!0});return}const c=URL.createObjectURL(new Blob([l],{type:U1(e)}));i=c,n({url:c,size:l.byteLength,loaded:!0})}),()=>{s=!0,i&&URL.revokeObjectURL(i)})},[e.id,e.available]),t}function Yh({label:e}){return y.jsxs("div",{className:"file-offdevice",children:[y.jsx("div",{className:"file-offdevice-ic",children:y.jsx(be,{name:"inbox",size:16})}),y.jsxs("div",{className:"filecard-meta",children:[y.jsx("div",{className:"filecard-name",title:e,children:e}),y.jsx("div",{className:"filecard-sub",children:"Available on your original device"})]})]})}function Xv({rec:e}){if(!e.transcription)return null;const t=e.transcription.text?.trim();return y.jsx("div",{className:"voice-transcript",children:t||`Transcription ${e.transcription.status??"unavailable"}${e.transcription.error_category?` · ${e.transcription.error_category}`:""}`})}function UD({rec:e,receipt:t,receiptless:n,onPreview:i,onFetch:s}){const a=e.dir==="out",l=`bubble file-bubble${a?" me":""}`,c=To(e.mime,e.filename)?"Voice message":"File",f=y.jsxs("div",{className:"bubble-at",children:[Mi(e.date),a&&y.jsx(Ad,{receipt:t,content:c,receiptless:n})]});return e.mime.startsWith("image/")?y.jsx(WD,{rec:e,cls:l,footer:f,onFetch:s}):To(e.mime,e.filename)?y.jsx(HD,{rec:e,cls:l,footer:f,onFetch:s}):y.jsx(KD,{rec:e,cls:l,footer:f,onPreview:i,onFetch:s})}function Gh({rec:e,onFetch:t}){const[n,i]=k.useState(!1),[s,a]=k.useState(!1);return y.jsxs("div",{className:"file-offdevice",children:[y.jsx("div",{className:"file-offdevice-ic",children:y.jsx(be,{name:"inbox",size:16})}),y.jsxs("div",{className:"filecard-meta",children:[y.jsx("div",{className:"filecard-name",title:e.filename,children:To(e.mime,e.filename)?"Voice message":e.filename}),y.jsx("div",{className:"filecard-sub",children:s?"Could not fetch media":"Available after explicit fetch"})]}),y.jsx("button",{className:"btn sm",disabled:n,onClick:()=>{i(!0),a(!1),(t?.(e.id)??rN(e.id)).catch(()=>a(!0)).finally(()=>i(!1))},children:n?"Fetching…":"Fetch"})]})}function WD({rec:e,cls:t,footer:n,onFetch:i}){const{url:s,loaded:a}=Xh(e);return a&&!s?y.jsxs("div",{className:t+" filecard-bubble file-offdevice-bubble",children:[e.available===!1?y.jsx(Gh,{rec:e,onFetch:i}):y.jsx(Yh,{label:e.filename&&e.filename!=="file"?e.filename:"Photo"}),n]}):y.jsxs("div",{className:t+" image-bubble",children:[s?y.jsx("a",{href:s,target:"_blank",rel:"noreferrer",title:e.filename,children:y.jsx("img",{src:s,alt:e.filename})}):y.jsx("div",{className:"file-loading",children:"loading…"}),n]})}function HD({rec:e,cls:t,footer:n,onFetch:i}){const{url:s,loaded:a}=Xh(e),l=k.useRef(null),c=k.useRef(null),[f,h]=k.useState(!1),[m,p]=k.useState(0),[v,w]=k.useState(()=>LD(e.mime)),[S,C]=k.useState(!1),[E,P]=k.useState(null);if(k.useEffect(()=>{if(!s)return;let B=!1;const _=typeof window>"u"?void 0:window.AudioContext||window.webkitAudioContext;if(!_)return;const N=new _,$=()=>{try{N.close()?.catch?.(()=>{})}catch{}};return(async()=>{try{const V=await fetch(s).then(J=>J.arrayBuffer()),he=await N.decodeAudioData(V);if(B)return;P(BD(VD(he.getChannelData(0),V1)))}catch{}finally{$()}})(),()=>{B=!0,$()}},[s]),a&&!s)return y.jsxs("div",{className:t+" filecard-bubble file-offdevice-bubble",children:[e.available===!1?y.jsx(Gh,{rec:e,onFetch:i}):y.jsx(Yh,{label:"Voice message"}),n,y.jsx(Xv,{rec:e})]});const A=()=>{const B=l.current;B&&(f?B.pause():B.play())},T=B=>{const _=c.current;if(!_)return 0;const N=_.getBoundingClientRect();return Math.max(0,Math.min(1,(B-N.left)/N.width))},L=B=>{const _=l.current;p(B),_&&v&&isFinite(v)&&(_.currentTime=B*v)},j=B=>{s&&(B.currentTarget.setPointerCapture?.(B.pointerId),C(!0),L(T(B.clientX)))},I=B=>{S&&L(T(B.clientX))},K=B=>{S&&(B.currentTarget.releasePointerCapture?.(B.pointerId),C(!1))};return y.jsxs("div",{className:t+" voice-bubble",children:[y.jsx("button",{className:"voice-play",onClick:A,disabled:!s,title:f?"Pause":"Play",children:y.jsx(be,{name:f?"pause":"play",size:14})}),y.jsxs("div",{className:"voice-track"+(s?" seekable":"")+(S?" scrubbing":"")+(E?" has-wave":""),ref:c,onPointerDown:j,onPointerMove:I,onPointerUp:K,onPointerCancel:K,role:s?"slider":void 0,"aria-label":s?"Seek":void 0,"aria-valuenow":Math.round(m*100),children:[E?y.jsx("div",{className:"voice-wave","aria-hidden":!0,children:E.map((B,_)=>y.jsx("span",{className:"voice-wave-bar"+(_/E.length<m?" played":""),style:{height:`${Math.round(B*100)}%`}},_))}):y.jsx("div",{className:"voice-track-fill",style:{width:`${m*100}%`}}),s&&y.jsx("span",{className:"voice-track-knob",style:{left:`${m*100}%`}})]}),y.jsx("span",{className:"voice-dur mono",children:v!==null?`${Math.floor(v/60)}:${String(Math.floor(v%60)).padStart(2,"0")}`:"·:··"}),s&&y.jsx("audio",{ref:l,src:s,onPlay:()=>h(!0),onPause:()=>h(!1),onEnded:()=>{h(!1),p(0)},onTimeUpdate:B=>{const _=B.currentTarget;!S&&_.duration>0&&isFinite(_.duration)&&p(_.currentTime/_.duration)},onLoadedMetadata:B=>{const _=B.currentTarget.duration;isFinite(_)&&_>0&&w(_)}}),n,y.jsx(Xv,{rec:e})]})}function KD({rec:e,cls:t,footer:n,onPreview:i,onFetch:s}){const{url:a,size:l,loaded:c}=Xh(e);return c&&!a?y.jsxs("div",{className:t+" filecard-bubble file-offdevice-bubble",children:[e.available===!1?y.jsx(Gh,{rec:e,onFetch:s}):y.jsx(Yh,{label:e.filename}),n]}):y.jsxs("div",{className:t+" filecard-bubble",children:[y.jsxs("div",{className:"filecard",children:[y.jsx("div",{className:"filecard-ic",children:y.jsx(be,{name:"copy",size:18})}),y.jsxs("div",{className:"filecard-meta",children:[y.jsx("div",{className:"filecard-name",title:e.filename,children:e.filename}),y.jsx("div",{className:"filecard-sub",children:l?oi(l):e.size?oi(e.size):""})]}),_1(e.filename)&&a&&i&&y.jsx("button",{className:"icon-btn",onClick:()=>i(e),title:"Preview markdown",children:y.jsx(be,{name:"monitor",size:16})}),Zs(e.filename,e.mime)&&a&&i&&y.jsx("button",{className:"icon-btn",onClick:()=>i(e),title:"Preview HTML",children:y.jsx(be,{name:"monitor",size:16})}),y.jsx("a",{className:"icon-btn"+(a?"":" disabled"),href:a??void 0,download:e.filename,title:"Download",children:y.jsx(be,{name:"download",size:16})})]}),n]})}function W1(e){const{att:t}=e,[n,i]=k.useState(null);return k.useEffect(()=>{const s=U1({mime:t.mime,filename:t.filename}),a=URL.createObjectURL(new Blob([t.bytes],{type:s}));return i(a),()=>URL.revokeObjectURL(a)},[t]),y.jsxs("div",{className:"attach-preview",children:[t.mime.startsWith("image/")&&n?y.jsx("img",{className:"attach-thumb",src:n,alt:t.filename}):t.voice&&n?y.jsx("audio",{className:"attach-audio",src:n,controls:!0}):y.jsx("div",{className:"filecard-ic",children:y.jsx(be,{name:"copy",size:16})}),y.jsxs("div",{className:"filecard-meta",children:[y.jsx("div",{className:"filecard-name",title:t.filename,children:t.voice?"Voice message":t.filename}),y.jsxs("div",{className:"filecard-sub",children:[oi(t.bytes.length),t.originalSize&&t.originalSize>t.bytes.length?` · optimized from ${oi(t.originalSize)}`:""]})]}),y.jsx("button",{className:"btn primary sm",disabled:e.sending,onClick:e.onSend,children:e.sending?"Sending…":"Send"}),y.jsx("button",{className:"icon-btn",title:"Discard",disabled:e.sending,onClick:e.onDiscard,children:y.jsx(be,{name:"close"})})]})}const qD={channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},XD=e=>`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,"0")}`,Yv=84,Gv=120,YD=550,GD=Math.floor(Es/(_d/8)),QD=Math.min(300,GD),JD=OD;function H1(e){const[t,n]=k.useState("idle"),[i,s]=k.useState(0),[a,l]=k.useState([]),[c,f]=k.useState(0),[h,m]=k.useState(0),p=k.useRef("idle"),v=k.useRef(null),w=k.useRef(null),S=k.useRef([]),C=k.useRef("webm"),E=k.useRef("audio/webm"),P=k.useRef(!1),A=k.useRef({x:0,y:0}),T=k.useRef(0),L=k.useRef(!1),j=k.useRef(null),I=k.useRef(null),K=k.useRef(null),B=k.useRef(e.onReady),_=k.useRef(e.onError),N=k.useRef(e.onActiveChange);B.current=e.onReady,_.current=e.onError,N.current=e.onActiveChange;const $=se=>{p.current=se,n(se),N.current?.(se==="recording"||se==="locked"||se==="arming")},V=()=>{I.current!=null&&cancelAnimationFrame(I.current),I.current=null,K.current&&clearInterval(K.current),K.current=null,j.current?.close().catch(()=>{}),j.current=null,w.current?.getTracks().forEach(se=>se.stop()),w.current=null},he=()=>{window.removeEventListener("pointermove",ke),window.removeEventListener("pointerup",Q),window.removeEventListener("pointercancel",Q)},J=se=>{P.current=se;const ue=v.current;ue&&ue.state!=="inactive"?ue.stop():Z(),he()},Z=()=>{V(),$("idle"),s(0),l([]),f(0),m(0)},ve=()=>{p.current==="recording"&&(he(),m(0),$("locked"))};function ke(se){if(p.current!=="recording")return;const ue=A.current.y-se.clientY,ae=A.current.x-se.clientX,me=Math.max(0,Math.min(1,ue/Yv)),Se=Math.max(0,Math.min(1,ae/Gv));f(me),m(Se),ue>=Yv?ve():ae>=Gv&&J(!0)}function Q(){if(p.current==="arming"){L.current=!0,he();return}if(p.current!=="recording")return;const se=Date.now()-T.current<YD;J(se)}const pe=se=>{e.disabled||p.current!=="idle"||(se.preventDefault(),A.current={x:se.clientX,y:se.clientY},L.current=!1,P.current=!1,S.current=[],f(0),m(0),$("arming"),window.addEventListener("pointermove",ke),window.addEventListener("pointerup",Q),window.addEventListener("pointercancel",Q),R())};async function R(){let se;try{se=await navigator.mediaDevices.getUserMedia({audio:qD})}catch{_.current("Microphone unavailable — check the browser permission."),he(),$("idle");return}if(L.current||p.current==="idle"){se.getTracks().forEach(me=>me.stop()),$("idle");return}w.current=se;const ue=ND.find(me=>typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported(me.rec));C.current=ue?.ext??"webm",E.current=ue?.base??"audio/webm";const ae=ue?new MediaRecorder(se,{mimeType:ue.rec,audioBitsPerSecond:_d}):new MediaRecorder(se,{audioBitsPerSecond:_d});v.current=ae,ae.ondataavailable=me=>{me.data.size>0&&S.current.push(me.data)},ae.onstop=()=>{if(P.current){Z();return}const Se=new Blob(S.current,{type:E.current});Promise.all([Se.arrayBuffer(),_D(Se)]).then(([xe,Ue])=>{if(Z(),xe.byteLength===0)return;const Fe=new Date().toISOString().replace(/[-:]/g,"").replace(/\..+/,"").replace("T","-");B.current({filename:`${K0}${Fe}.${C.current}`,mime:DD(tN(E.current),Ue),bytes:new Uint8Array(xe),voice:!0})})},ae.start(),T.current=Date.now(),$("recording"),s(0),K.current=setInterval(()=>{s(me=>{const Se=me+1;return Se>=QD&&J(!1),Se})},1e3),F(se)}function F(se){try{const ue=window.AudioContext||window.webkitAudioContext,ae=new ue;j.current=ae;const me=ae.createMediaStreamSource(se),Se=ae.createAnalyser();Se.fftSize=256,me.connect(Se);const xe=new Uint8Array(Se.fftSize),Ue=$D();let Fe=0;const Ke=ot=>{if(I.current=requestAnimationFrame(Ke),ot-Fe<80)return;Fe=ot,Se.getByteTimeDomainData(xe);let st=0;for(let et=0;et<xe.length;et++){const Wt=(xe[et]-128)/128;st+=Wt*Wt}const Ft=Math.sqrt(st/xe.length),Zt=Ue.push(Ft);l(et=>{const Wt=et.length>=JD?et.slice(1):et.slice();return Wt.push(Zt),Wt})};I.current=requestAnimationFrame(Ke)}catch{}}k.useEffect(()=>()=>{P.current=!0,v.current?.stop(),he(),V()},[]);const Y=t==="recording"||t==="locked"||t==="arming",M=y.jsx("div",{className:"vr-wave","aria-hidden":!0,children:a.map((se,ue)=>y.jsx("span",{className:"vr-bar",style:{height:`${Math.round(se*100)}%`}},ue))});return y.jsxs(y.Fragment,{children:[y.jsx("button",{className:"icon-btn composer-tool vr-mic",title:"Hold to record a voice message",disabled:e.disabled,onPointerDown:pe,onContextMenu:se=>se.preventDefault(),children:y.jsx(be,{name:"mic",size:18})}),Y&&y.jsxs("div",{className:"voice-rec-overlay","data-mode":t,children:[t==="recording"&&y.jsxs("div",{className:"vr-lock",style:{"--p":c},"aria-hidden":!0,children:[y.jsx(be,{name:"lock",size:13}),y.jsx(be,{name:"chevronDown",size:12})]}),y.jsx("span",{className:"voice-rec-dot"}),y.jsx("span",{className:"vr-time mono",children:XD(i)}),t==="locked"?y.jsxs(y.Fragment,{children:[M,y.jsx("button",{className:"icon-btn vr-trash",title:"Cancel",onClick:()=>J(!0),children:y.jsx(be,{name:"trash",size:16})}),y.jsxs("button",{className:"btn primary sm vr-stop",onClick:()=>J(!1),children:[y.jsx(be,{name:"check",size:13}),"Stop"]})]}):y.jsxs("div",{className:"vr-slide",style:{opacity:1-h},children:[M,y.jsx("span",{className:"vr-hint",children:"‹ slide to cancel · slide up to lock"})]})]})]})}function ZD(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const eL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nL={};function Qv(e,t){return(nL.jsx?tL:eL).test(e)}const rL=/[ \t\n\f\r]/g;function iL(e){return typeof e=="object"?e.type==="text"?Jv(e.value):!1:Jv(e)}function Jv(e){return e.replace(rL,"")===""}class ea{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}ea.prototype.normal={};ea.prototype.property={};ea.prototype.space=void 0;function K1(e,t){const n={},i={};for(const s of e)Object.assign(n,s.property),Object.assign(i,s.normal);return new ea(n,i,t)}function Od(e){return e.toLowerCase()}class yn{constructor(t,n){this.attribute=n,this.property=t}}yn.prototype.attribute="";yn.prototype.booleanish=!1;yn.prototype.boolean=!1;yn.prototype.commaOrSpaceSeparated=!1;yn.prototype.commaSeparated=!1;yn.prototype.defined=!1;yn.prototype.mustUseProperty=!1;yn.prototype.number=!1;yn.prototype.overloadedBoolean=!1;yn.prototype.property="";yn.prototype.spaceSeparated=!1;yn.prototype.space=void 0;let oL=0;const _e=Li(),Et=Li(),Fd=Li(),le=Li(),tt=Li(),Ii=Li(),bn=Li();function Li(){return 2**++oL}const zd=Object.freeze(Object.defineProperty({__proto__:null,boolean:_e,booleanish:Et,commaOrSpaceSeparated:bn,commaSeparated:Ii,number:le,overloadedBoolean:Fd,spaceSeparated:tt},Symbol.toStringTag,{value:"Module"})),Mf=Object.keys(zd);class Qh extends yn{constructor(t,n,i,s){let a=-1;if(super(t,n),Zv(this,"space",s),typeof i=="number")for(;++a<Mf.length;){const l=Mf[a];Zv(this,Mf[a],(i&zd[l])===zd[l])}}}Qh.prototype.defined=!0;function Zv(e,t,n){n&&(e[t]=n)}function Io(e){const t={},n={};for(const[i,s]of Object.entries(e.properties)){const a=new Qh(i,e.transform(e.attributes||{},i),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(a.mustUseProperty=!0),t[i]=a,n[Od(i)]=i,n[Od(a.attribute)]=i}return new ea(t,n,e.space)}const q1=Io({properties:{ariaActiveDescendant:null,ariaAtomic:Et,ariaAutoComplete:null,ariaBusy:Et,ariaChecked:Et,ariaColCount:le,ariaColIndex:le,ariaColSpan:le,ariaControls:tt,ariaCurrent:null,ariaDescribedBy:tt,ariaDetails:null,ariaDisabled:Et,ariaDropEffect:tt,ariaErrorMessage:null,ariaExpanded:Et,ariaFlowTo:tt,ariaGrabbed:Et,ariaHasPopup:null,ariaHidden:Et,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:tt,ariaLevel:le,ariaLive:null,ariaModal:Et,ariaMultiLine:Et,ariaMultiSelectable:Et,ariaOrientation:null,ariaOwns:tt,ariaPlaceholder:null,ariaPosInSet:le,ariaPressed:Et,ariaReadOnly:Et,ariaRelevant:null,ariaRequired:Et,ariaRoleDescription:tt,ariaRowCount:le,ariaRowIndex:le,ariaRowSpan:le,ariaSelected:Et,ariaSetSize:le,ariaSort:null,ariaValueMax:le,ariaValueMin:le,ariaValueNow:le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function X1(e,t){return t in e?e[t]:t}function Y1(e,t){return X1(e,t.toLowerCase())}const sL=Io({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ii,acceptCharset:tt,accessKey:tt,action:null,allow:null,allowFullScreen:_e,allowPaymentRequest:_e,allowUserMedia:_e,alpha:_e,alt:null,as:null,async:_e,autoCapitalize:null,autoComplete:tt,autoFocus:_e,autoPlay:_e,blocking:tt,capture:null,charSet:null,checked:_e,cite:null,className:tt,closedBy:null,colorSpace:null,cols:le,colSpan:le,command:null,commandFor:null,content:null,contentEditable:Et,controls:_e,controlsList:tt,coords:le|Ii,crossOrigin:null,data:null,dateTime:null,decoding:null,default:_e,defer:_e,dir:null,dirName:null,disabled:_e,download:Fd,draggable:Et,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:_e,formTarget:null,headers:tt,height:le,hidden:Fd,high:le,href:null,hrefLang:null,htmlFor:tt,httpEquiv:tt,id:null,imageSizes:null,imageSrcSet:null,inert:_e,inputMode:null,integrity:null,is:null,isMap:_e,itemId:null,itemProp:tt,itemRef:tt,itemScope:_e,itemType:tt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:_e,low:le,manifest:null,max:null,maxLength:le,media:null,method:null,min:null,minLength:le,multiple:_e,muted:_e,name:null,nonce:null,noModule:_e,noValidate:_e,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:_e,optimum:le,pattern:null,ping:tt,placeholder:null,playsInline:_e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:_e,referrerPolicy:null,rel:tt,required:_e,reversed:_e,rows:le,rowSpan:le,sandbox:tt,scope:null,scoped:_e,seamless:_e,selected:_e,shadowRootClonable:_e,shadowRootCustomElementRegistry:_e,shadowRootDelegatesFocus:_e,shadowRootMode:null,shadowRootSerializable:_e,shape:null,size:le,sizes:null,slot:null,span:le,spellCheck:Et,src:null,srcDoc:null,srcLang:null,srcSet:null,start:le,step:null,style:null,tabIndex:le,target:null,title:null,translate:null,type:null,typeMustMatch:_e,useMap:null,value:Et,width:le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:tt,axis:null,background:null,bgColor:null,border:le,borderColor:null,bottomMargin:le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:_e,declare:_e,event:null,face:null,frame:null,frameBorder:null,hSpace:le,leftMargin:le,link:null,longDesc:null,lowSrc:null,marginHeight:le,marginWidth:le,noResize:_e,noHref:_e,noShade:_e,noWrap:_e,object:null,profile:null,prompt:null,rev:null,rightMargin:le,rules:null,scheme:null,scrolling:Et,standby:null,summary:null,text:null,topMargin:le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:le,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:_e,disablePictureInPicture:_e,disableRemotePlayback:_e,exportParts:Ii,part:tt,prefix:null,property:null,results:le,security:null,unselectable:null},space:"html",transform:Y1}),aL=Io({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:bn,accentHeight:le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:le,amplitude:le,arabicForm:null,ascent:le,attributeName:null,attributeType:null,azimuth:le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:le,by:null,calcMode:null,capHeight:le,className:tt,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:le,diffuseConstant:le,direction:null,display:null,dur:null,divisor:le,dominantBaseline:null,download:_e,dx:null,dy:null,edgeMode:null,editable:null,elevation:le,enableBackground:null,end:null,event:null,exponent:le,externalResourcesRequired:null,fill:null,fillOpacity:le,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:Ii,g2:Ii,glyphName:Ii,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:le,horizOriginX:le,horizOriginY:le,id:null,ideographic:le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:le,k:le,k1:le,k2:le,k3:le,k4:le,kernelMatrix:bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:le,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:le,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:le,overlineThickness:le,paintOrder:null,panose1:null,path:null,pathLength:le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:tt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:le,pointsAtY:le,pointsAtZ:le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bn,rev:bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bn,requiredFeatures:bn,requiredFonts:bn,requiredFormats:bn,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:le,specularExponent:le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:le,strikethroughThickness:le,string:null,stroke:null,strokeDashArray:bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:le,strokeOpacity:le,strokeWidth:null,style:null,surfaceScale:le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bn,tabIndex:le,tableValues:null,target:null,targetX:le,targetY:le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:le,underlineThickness:le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:le,values:null,vAlphabetic:le,vMathematical:le,vectorEffect:null,vHanging:le,vIdeographic:le,version:null,vertAdvY:le,vertOriginX:le,vertOriginY:le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:X1}),G1=Io({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()}}),Q1=Io({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Y1}),J1=Io({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),lL={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"},uL=/[A-Z]/g,ex=/-[a-z]/g,cL=/^data[-\w.:]+$/i;function fL(e,t){const n=Od(t);let i=t,s=yn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&cL.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(ex,hL);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!ex.test(a)){let l=a.replace(uL,dL);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=Qh}return new s(i,t)}function dL(e){return"-"+e.toLowerCase()}function hL(e){return e.charAt(1).toUpperCase()}const pL=K1([q1,sL,G1,Q1,J1],"html"),Jh=K1([q1,aL,G1,Q1,J1],"svg");function mL(e){return e.join(" ").trim()}var uo={},If,tx;function gL(){if(tx)return If;tx=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
273
+ `,h="/",m="*",p="",v="comment",w="declaration";function S(E,P){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];P=P||{};var A=1,T=1;function L(J){var Z=J.match(t);Z&&(A+=Z.length);var ve=J.lastIndexOf(f);T=~ve?J.length-ve:T+J.length}function j(){var J={line:A,column:T};return function(Z){return Z.position=new I(J),_(),Z}}function I(J){this.start=J,this.end={line:A,column:T},this.source=P.source}I.prototype.content=E;function K(J){var Z=new Error(P.source+":"+A+":"+T+": "+J);if(Z.reason=J,Z.filename=P.source,Z.line=A,Z.column=T,Z.source=E,!P.silent)throw Z}function B(J){var Z=J.exec(E);if(Z){var ve=Z[0];return L(ve),E=E.slice(ve.length),Z}}function _(){B(n)}function N(J){var Z;for(J=J||[];Z=$();)Z!==!1&&J.push(Z);return J}function $(){var J=j();if(!(h!=E.charAt(0)||m!=E.charAt(1))){for(var Z=2;p!=E.charAt(Z)&&(m!=E.charAt(Z)||h!=E.charAt(Z+1));)++Z;if(Z+=2,p===E.charAt(Z-1))return K("End of comment missing");var ve=E.slice(2,Z-2);return T+=2,L(ve),E=E.slice(Z),T+=2,J({type:v,comment:ve})}}function V(){var J=j(),Z=B(i);if(Z){if($(),!B(s))return K("property missing ':'");var ve=B(a),ke=J({type:w,property:C(Z[0].replace(e,p)),value:ve?C(ve[0].replace(e,p)):p});return B(l),ke}}function he(){var J=[];N(J);for(var Z;Z=V();)Z!==!1&&(J.push(Z),N(J));return J}return _(),he()}function C(E){return E?E.replace(c,p):p}return If=S,If}var nx;function yL(){if(nx)return uo;nx=1;var e=uo&&uo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(uo,"__esModule",{value:!0}),uo.default=n;const t=e(gL());function n(i,s){let a=null;if(!i||typeof i!="string")return a;const l=(0,t.default)(i),c=typeof s=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:m}=f;c?s(h,m,f):m&&(a=a||{},a[h]=m)}),a}return uo}var ks={},rx;function vL(){if(rx)return ks;rx=1,Object.defineProperty(ks,"__esModule",{value:!0}),ks.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(h){return!h||n.test(h)||e.test(h)},l=function(h,m){return m.toUpperCase()},c=function(h,m){return"".concat(m,"-")},f=function(h,m){return m===void 0&&(m={}),a(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(s,c):h=h.replace(i,c),h.replace(t,l))};return ks.camelCase=f,ks}var Ss,ix;function xL(){if(ix)return Ss;ix=1;var e=Ss&&Ss.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(yL()),n=vL();function i(s,a){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(c,f){c&&f&&(l[(0,n.camelCase)(c,a)]=f)}),l}return i.default=i,Ss=i,Ss}var wL=xL();const kL=oh(wL),Z1=ek("end"),Zh=ek("start");function ek(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 SL(e){const t=Zh(e),n=Z1(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="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(l=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof i=="string"){const f=i.indexOf(":");f===-1?a.ruleId=i:(a.source=i.slice(0,f),a.ruleId=i.slice(f+1))}if(!a.place&&a.ancestors&&a.ancestors){const f=a.ancestors[a.ancestors.length-1];f&&(a.place=f.position)}const c=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.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=Ms(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.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 ep={}.hasOwnProperty,bL=new Map,CL=/[A-Z]/g,EL=new Set(["table","tbody","thead","tfoot","tr"]),TL=new Set(["td","th"]),tk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function PL(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=LL(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=DL(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"?Jh:pL,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=nk(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function nk(e,t,n){if(t.type==="element")return RL(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return AL(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return NL(e,t,n);if(t.type==="mdxjsEsm")return jL(e,t);if(t.type==="root")return ML(e,t,n);if(t.type==="text")return IL(e,t)}function RL(e,t,n){const i=e.schema;let s=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(s=Jh,e.schema=s),e.ancestors.push(t);const a=ik(e,t.tagName,!1),l=_L(e,t);let c=np(e,t);return EL.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!iL(f):!0})),rk(e,l,a,t),tp(l,c),e.ancestors.pop(),e.schema=i,e.create(t,a,l,n)}function AL(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)}Us(e,t.position)}function jL(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Us(e,t.position)}function NL(e,t,n){const i=e.schema;let s=i;t.name==="svg"&&i.space==="html"&&(s=Jh,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:ik(e,t.name,!0),l=OL(e,t),c=np(e,t);return rk(e,l,a,t),tp(l,c),e.ancestors.pop(),e.schema=i,e.create(t,a,l,n)}function ML(e,t,n){const i={};return tp(i,np(e,t)),e.create(t,e.Fragment,i,n)}function IL(e,t){return t.value}function rk(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function tp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function DL(e,t,n){return i;function i(s,a,l,c){const h=Array.isArray(l.children)?n:t;return c?h(a,l,c):h(a,l)}}function LL(e,t){return n;function n(i,s,a,l){const c=Array.isArray(a.children),f=Zh(i);return t(s,a,l,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function _L(e,t){const n={};let i,s;for(s in t.properties)if(s!=="children"&&ep.call(t.properties,s)){const a=FL(e,s,t.properties[s]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&TL.has(t.tagName)?i=c:n[l]=c}}if(i){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function OL(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const a=i.data.estree.body[0];a.type;const l=a.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Us(e,t.position);else{const s=i.name;let a;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,a=e.evaluater.evaluateExpression(c.expression)}else Us(e,t.position);else a=i.value===null?!0:i.value;n[s]=a}return n}function np(e,t){const n=[];let i=-1;const s=e.passKeys?new Map:bL;for(;++i<t.children.length;){const a=t.children[i];let l;if(e.passKeys){const f=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(f){const h=s.get(f)||0;l=f+"-"+h,s.set(f,h+1)}}const c=nk(e,a,l);c!==void 0&&n.push(c)}return n}function FL(e,t,n){const i=fL(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?ZD(n):mL(n)),i.property==="style"){let s=typeof n=="object"?n:zL(e,String(n));return e.stylePropertyNameCase==="css"&&(s=VL(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&i.space?lL[i.property]||i.property:i.attribute,n]}}function zL(e,t){try{return kL(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=tk+"#cannot-parse-style-attribute",s}}function ik(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,l;for(;++a<s.length;){const c=Qv(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}i=l}else i=Qv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const s=i.value;return ep.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(i);Us(e)}function Us(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=tk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function VL(e){const t={};let n;for(n in e)ep.call(e,n)&&(t[BL(n)]=e[n]);return t}function BL(e){let t=e.replace(CL,$L);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function $L(e){return"-"+e.toLowerCase()}const Df={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 UL(e){const t=this;t.parser=n;function n(i){return E1(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function WL(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 HL(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
274
+ `}]}function KL(e,t){const n=t.value?t.value+`
275
+ `:"",i={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(i.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function qL(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function XL(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YL(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),s=Mo(i.toLowerCase()),a=e.footnoteOrder.indexOf(i);let l,c=e.footnoteCounts.get(i);c===void 0?(c=0,e.footnoteOrder.push(i),l=e.footnoteOrder.length):l=a+1,c+=1,e.footnoteCounts.set(i,c);const f={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(l)}]};e.patch(t,f);const h={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,h),e.applyData(t,h)}function GL(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 QL(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ok(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),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=i:s.push({type:"text",value:i}),s}function JL(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return ok(e,t);const s={src:Mo(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(s.title=i.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function ZL(e,t){const n={src:Mo(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 e_(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 t_(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return ok(e,t);const s={href:Mo(i.url||"")};i.title!==null&&i.title!==void 0&&(s.title=i.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function n_(e,t){const n={href:Mo(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 r_(e,t,n){const i=e.all(t),s=n?i_(n):sk(t),a={},l=[];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:[]}),a.className=["task-list-item"]}let c=-1;for(;++c<i.length;){const m=i[c];(s||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
276
+ `}),m.type==="element"&&m.tagName==="p"&&!s?l.push(...m.children):l.push(m)}const f=i[i.length-1];f&&(s||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
277
+ `});const h={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,h),e.applyData(t,h)}function i_(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=sk(n[i])}return t}function sk(e){const t=e.spread;return t??e.children.length>1}function o_(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 l=i[s];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function s_(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function a_(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function l_(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function u_(e,t){const n=e.all(t),i=n.shift(),s=[];if(i){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Zh(t.children[1]),f=Z1(t.children[t.children.length-1]);c&&f&&(l.position={start:c,end:f}),s.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function c_(e,t,n){const i=n?n.children:void 0,a=(i?i.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let f=-1;const h=[];for(;++f<c;){const p=t.children[f],v={},w=l?l[f]:void 0;w&&(v.align=w);let S={type:"element",tagName:a,properties:v,children:[]};p&&(S.children=e.all(p),e.patch(p,S),S=e.applyData(p,S)),h.push(S)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,m),e.applyData(t,m)}function f_(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ox=9,sx=32;function d_(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),s=0;const a=[];for(;i;)a.push(ax(t.slice(s,i.index),s>0,!0),i[0]),s=i.index+i[0].length,i=n.exec(t);return a.push(ax(t.slice(s),s>0,!1)),a.join("")}function ax(e,t,n){let i=0,s=e.length;if(t){let a=e.codePointAt(i);for(;a===ox||a===sx;)i++,a=e.codePointAt(i)}if(n){let a=e.codePointAt(s-1);for(;a===ox||a===sx;)s--,a=e.codePointAt(s-1)}return s>i?e.slice(i,s):""}function h_(e,t){const n={type:"text",value:d_(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function p_(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const m_={blockquote:WL,break:HL,code:KL,delete:qL,emphasis:XL,footnoteReference:YL,heading:GL,html:QL,imageReference:JL,image:ZL,inlineCode:e_,linkReference:t_,link:n_,listItem:r_,list:o_,paragraph:s_,root:a_,strong:l_,table:u_,tableCell:f_,tableRow:c_,text:h_,thematicBreak:p_,toml:vl,yaml:vl,definition:vl,footnoteDefinition:vl};function vl(){}const ak=-1,wu=0,Is=1,ru=2,rp=3,ip=4,op=5,sp=6,lk=7,uk=8,ck=typeof self=="object"?self:globalThis,lx=(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 ck[e](t)},g_=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),i=s=>{if(e.has(s))return e.get(s);const[a,l]=t[s];switch(a){case wu:case ak:return n(l,s);case Is:{const c=n([],s);for(const f of l)c.push(i(f));return c}case ru:{const c=n({},s);for(const[f,h]of l)c[i(f)]=i(h);return c}case rp:return n(new Date(l),s);case ip:{const{source:c,flags:f}=l;return n(new RegExp(c,f),s)}case op:{const c=n(new Map,s);for(const[f,h]of l)c.set(i(f),i(h));return c}case sp:{const c=n(new Set,s);for(const f of l)c.add(i(f));return c}case lk:{const{name:c,message:f}=l;return n(typeof ck[c]=="function"?lx(c,f):new Error(f),s)}case uk:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(lx(a,l),s)};return i},ux=e=>g_(new Map,e)(0),Ti="",{toString:y_}={},{keys:v_}=Object,bs=e=>{const t=typeof e;if(t!=="object"||!e)return[wu,t];const n=y_.call(e).slice(8,-1);switch(n){case"Array":return[Is,Ti];case"Object":return[ru,Ti];case"Date":return[rp,Ti];case"RegExp":return[ip,Ti];case"Map":return[op,Ti];case"Set":return[sp,Ti];case"DataView":return[Is,n]}return n.includes("Array")?[Is,n]:e instanceof Error?[lk,e.name||"Error"]:[ru,n]},xl=([e,t])=>e===wu&&(t==="function"||t==="symbol"),x_=(e,t,n,i)=>{const s=(l,c)=>{const f=i.push(l)-1;return n.set(c,f),f},a=l=>{if(n.has(l))return n.get(l);let[c,f]=bs(l);switch(c){case wu:{let m=l;switch(f){case"bigint":c=uk,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);m=null;break;case"undefined":return s([ak],l)}return s([c,m],l)}case Is:{if(f){let v=l;return f==="DataView"?v=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(v=new Uint8Array(l)),s([f,[...v]],l)}const m=[],p=s([c,m],l);for(const v of l)m.push(a(v));return p}case ru:{if(f)switch(f){case"BigInt":return s([f,l.toString()],l);case"Boolean":case"Number":case"String":return s([f,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const m=[],p=s([c,m],l);for(const v of v_(l))(e||!xl(bs(l[v])))&&m.push([a(v),a(l[v])]);return p}case rp:return s([c,isNaN(l.getTime())?Ti:l.toISOString()],l);case ip:{const{source:m,flags:p}=l;return s([c,{source:m,flags:p}],l)}case op:{const m=[],p=s([c,m],l);for(const[v,w]of l)(e||!(xl(bs(v))||xl(bs(w))))&&m.push([a(v),a(w)]);return p}case sp:{const m=[],p=s([c,m],l);for(const v of l)(e||!xl(bs(v)))&&m.push(a(v));return p}}const{message:h}=l;return s([c,{name:f,message:h}],l)};return a},cx=(e,{json:t,lossy:n}={})=>{const i=[];return x_(!(t||n),!!t,new Map,i)(e),i},iu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ux(cx(e,t)):structuredClone(e):(e,t)=>ux(cx(e,t));function w_(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 k_(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function S_(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||w_,i=e.options.footnoteBackLabel||k_,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[f]);if(!h)continue;const m=e.all(h),p=String(h.identifier).toUpperCase(),v=Mo(p.toLowerCase());let w=0;const S=[],C=e.footnoteCounts.get(p);for(;C!==void 0&&++w<=C;){S.length>0&&S.push({type:"text",value:" "});let A=typeof n=="string"?n:n(f,w);typeof A=="string"&&(A={type:"text",value:A}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(f,w),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const E=m[m.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const A=E.children[E.children.length-1];A&&A.type==="text"?A.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...S)}else m.push(...S);const P={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(m,!0)};e.patch(h,P),c.push(P)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...iu(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
278
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
279
+ `}]}}const Vd={}.hasOwnProperty,b_={};function C_(e,t){const n=t||b_,i=new Map,s=new Map,a=new Map,l={...m_,...n.handlers},c={all:h,applyData:T_,definitionById:i,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:l,one:f,options:n,patch:E_,wrap:R_};return Bh(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?i:s,v=String(m.identifier).toUpperCase();p.has(v)||p.set(v,m)}}),c;function f(m,p){const v=m.type,w=c.handlers[v];if(Vd.call(c.handlers,v)&&w)return w(c,m,p);if(c.options.passThrough&&c.options.passThrough.includes(v)){if("children"in m){const{children:C,...E}=m,P=iu(E);return P.children=c.all(m),P}return iu(m)}return(c.options.unknownHandler||P_)(c,m,p)}function h(m){const p=[];if("children"in m){const v=m.children;let w=-1;for(;++w<v.length;){const S=c.one(v[w],m);if(S){if(w&&v[w-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=fx(S.value)),!Array.isArray(S)&&S.type==="element")){const C=S.children[0];C&&C.type==="text"&&(C.value=fx(C.value))}Array.isArray(S)?p.push(...S):p.push(S)}}}return p}}function E_(e,t){e.position&&(t.position=SL(e))}function T_(e,t){let n=t;if(e&&e.data){const i=e.data.hName,s=e.data.hChildren,a=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const l="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,iu(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function P_(e,t){const n=t.data||{},i="value"in t&&!(Vd.call(n,"hProperties")||Vd.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 R_(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
280
+ `});++i<e.length;)i&&n.push({type:"text",value:`
281
+ `}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
282
+ `}),n}function fx(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function dx(e,t){const n=C_(e,t),i=n.one(e,void 0),s=S_(n),a=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
283
+ `},s),a}function A_(e,t){return e&&"run"in e?async function(n,i){const s=dx(n,{file:i,...t});await e.run(s,i)}:function(n,i){return dx(n,{file:i,...e||t})}}function hx(e){if(e)throw e}var Lf,px;function j_(){if(px)return Lf;px=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]"},a=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 v;for(v in h);return typeof v>"u"||e.call(h,v)},l=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 Lf=function f(){var h,m,p,v,w,S,C=arguments[0],E=1,P=arguments.length,A=!1;for(typeof C=="boolean"&&(A=C,C=arguments[1]||{},E=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});E<P;++E)if(h=arguments[E],h!=null)for(m in h)p=c(C,m),v=c(h,m),C!==v&&(A&&v&&(a(v)||(w=s(v)))?(w?(w=!1,S=p&&s(p)?p:[]):S=p&&a(p)?p:{},l(C,{name:m,newValue:f(A,S,v)})):typeof v<"u"&&l(C,{name:m,newValue:v}));return C},Lf}var N_=j_();const _f=oh(N_);function Bd(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 M_(){const e=[],t={run:n,use:i};return t;function n(...s){let a=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...s);function c(f,...h){const m=e[++a];let p=-1;if(f){l(f);return}for(;++p<s.length;)(h[p]===null||h[p]===void 0)&&(h[p]=s[p]);s=h,m?I_(m,c)(...h):l(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 I_(e,t){let n;return i;function i(...l){const c=e.length>l.length;let f;c&&l.push(s);try{f=e.apply(this,l)}catch(h){const m=h;if(c&&n)throw m;return s(m)}c||(f&&f.then&&typeof f.then=="function"?f.then(a,s):f instanceof Error?s(f):a(f))}function s(l,...c){n||(n=!0,t(l,...c))}function a(l){s(null,l)}}const lr={basename:D_,dirname:L_,extname:__,join:O_,sep:"/"};function D_(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ta(e);let n=0,i=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else i<0&&(a=!0,i=s+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let l=-1,c=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else l<0&&(a=!0,l=s+1),c>-1&&(e.codePointAt(s)===t.codePointAt(c--)?c<0&&(i=s):(c=-1,i=l));return n===i?i=l:i<0&&(i=e.length),e.slice(n,i)}function L_(e){if(ta(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 __(e){ta(e);let t=e.length,n=-1,i=0,s=-1,a=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){i=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===i+1?"":e.slice(s,n)}function O_(...e){let t=-1,n;for(;++t<e.length;)ta(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":F_(n)}function F_(e){ta(e);const t=e.codePointAt(0)===47;let n=z_(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function z_(e,t){let n="",i=0,s=-1,a=0,l=-1,c,f;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(s===l-1||a===1))if(s!==l-1&&a===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",i=0):(n=n.slice(0,f),i=n.length-1-n.lastIndexOf("/")),s=l,a=0;continue}}else if(n.length>0){n="",i=0,s=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),i=l-s-1;s=l,a=0}else c===46&&a>-1?a++:a=-1}return n}function ta(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const V_={cwd:B_};function B_(){return"/"}function $d(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $_(e){if(typeof e=="string")e=new URL(e);else if(!$d(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 U_(e)}function U_(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 Of=["history","path","basename","stem","extname","dirname"];class fk{constructor(t){let n;t?$d(t)?n={path:t}:typeof t=="string"||W_(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":V_.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Of.length;){const a=Of[i];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)Of.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?lr.basename(this.path):void 0}set basename(t){zf(t,"basename"),Ff(t,"basename"),this.path=lr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?lr.dirname(this.path):void 0}set dirname(t){mx(this.basename,"dirname"),this.path=lr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?lr.extname(this.path):void 0}set extname(t){if(Ff(t,"extname"),mx(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=lr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){$d(t)&&(t=$_(t)),zf(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?lr.basename(this.path,this.extname):void 0}set stem(t){zf(t,"stem"),Ff(t,"stem"),this.path=lr.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 Ff(e,t){if(e&&e.includes(lr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+lr.sep+"`")}function zf(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function mx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function W_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const H_=function(e){const i=this.constructor.prototype,s=i[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,i),a},K_={}.hasOwnProperty;class ap extends H_{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=M_()}copy(){const t=new ap;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(_f(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?($f("data",this.frozen),this.namespace[t]=n,this):K_.call(this.namespace,t)&&this.namespace[t]||void 0:t?($f("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=wl(t),i=this.parser||this.Parser;return Vf("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),Vf("process",this.parser||this.Parser),Bf("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,l){const c=wl(t),f=i.parse(c);i.run(f,c,function(m,p,v){if(m||!p||!v)return h(m);const w=p,S=i.stringify(w,v);Y_(S)?v.value=S:v.result=S,h(m,v)});function h(m,p){m||!p?l(m):a?a(p):n(void 0,p)}}}processSync(t){let n=!1,i;return this.freeze(),Vf("processSync",this.parser||this.Parser),Bf("processSync",this.compiler||this.Compiler),this.process(t,s),yx("processSync","process",n),i;function s(a,l){n=!0,hx(a),i=l}}run(t,n,i){gx(t),this.freeze();const s=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?a(void 0,i):new Promise(a);function a(l,c){const f=wl(n);s.run(t,f,h);function h(m,p,v){const w=p||t;m?c(m):l?l(w):i(void 0,w,v)}}}runSync(t,n){let i=!1,s;return this.run(t,n,a),yx("runSync","run",i),s;function a(l,c){hx(l),s=c,i=!0}}stringify(t,n){this.freeze();const i=wl(n),s=this.compiler||this.Compiler;return Bf("stringify",s),gx(t),s(t,i)}use(t,...n){const i=this.attachers,s=this.namespace;if($f("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(h){if(typeof h=="function")f(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...p]=h;f(m,p)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(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=_f(!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];a(p)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function f(h,m){let p=-1,v=-1;for(;++p<i.length;)if(i[p][0]===h){v=p;break}if(v===-1)i.push([h,...m]);else if(m.length>0){let[w,...S]=m;const C=i[v][1];Bd(C)&&Bd(w)&&(w=_f(!0,C,w)),i[v]=[h,w,...S]}}}}const q_=new ap().freeze();function Vf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Bf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function $f(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 gx(e){if(!Bd(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function yx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function wl(e){return X_(e)?e:new fk(e)}function X_(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Y_(e){return typeof e=="string"||G_(e)}function G_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Q_="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",vx=[],xx={allowDangerousHtml:!0},J_=/^(https?|ircs?|mailto|xmpp)$/i,Z_=[{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 dk(e){const t=eO(e),n=tO(e);return nO(t.runSync(t.parse(n),n),e)}function eO(e){const t=e.rehypePlugins||vx,n=e.remarkPlugins||vx,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...xx}:xx;return q_().use(UL).use(n).use(A_,i).use(t)}function tO(e){const t=e.children||"",n=new fk;return typeof t=="string"&&(n.value=t),n}function nO(e,t){const n=t.allowedElements,i=t.allowElement,s=t.components,a=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||rO;for(const m of Z_)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+Q_+m.id,void 0);return Bh(e,h),PL(e,{Fragment:y.Fragment,components:s,ignoreInvalidStyle:!0,jsx:y.jsx,jsxs:y.jsxs,passKeys:!0,passNode:!0});function h(m,p,v){if(m.type==="raw"&&v&&typeof p=="number")return l?v.children.splice(p,1):v.children[p]={type:"text",value:m.value},p;if(m.type==="element"){let w;for(w in Df)if(Object.hasOwn(Df,w)&&Object.hasOwn(m.properties,w)){const S=m.properties[w],C=Df[w];(C===null||C.includes(m.tagName))&&(m.properties[w]=f(String(S||""),w,m))}}if(m.type==="element"){let w=n?!n.includes(m.tagName):a?a.includes(m.tagName):!1;if(!w&&i&&typeof p=="number"&&(w=!i(m,p,v)),w&&v&&typeof p=="number")return c&&m.children?v.children.splice(p,1,...m.children):v.children.splice(p,1),p}}}function rO(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||J_.test(e.slice(0,t))?e:""}const iO={};function hk(e){const t=this,n=e||iO,i=t.data(),s=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);s.push(L1(n)),a.push(h1()),l.push(XM(n))}var oO=Object.defineProperty,Do=(e,t)=>oO(e,"name",{value:t,configurable:!0}),pk=!!(typeof window<"u"&&window.document&&window.document.createElement);function ni(e,t,{checkForDefaultPrevented:n=!0}={}){return Do(function(s){if(e?.(s),n===!1||!s||!s.defaultPrevented)return t?.(s)},"handleEvent")}Do(ni,"composeEventHandlers");function sO(e){if(!pk)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}Do(sO,"getOwnerWindow");function Ud(e){if(!pk)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}Do(Ud,"getOwnerDocument");function mk(e,t=!1){const{activeElement:n}=Ud(e);if(!n?.nodeName)return null;if(gk(n)&&n.contentDocument)return mk(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const s=Ud(n).getElementById(i);if(s)return s}}return n}Do(mk,"getActiveElement");function gk(e){return e.tagName==="IFRAME"}Do(gk,"isFrame");var aO=Object.defineProperty,lp=(e,t)=>aO(e,"name",{value:t,configurable:!0});function Wd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}lp(Wd,"setRef");function yk(...e){return t=>{let n=!1;const i=e.map(s=>{const a=Wd(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<i.length;s++){const a=i[s];typeof a=="function"?a():Wd(e[s],null)}}}}lp(yk,"composeRefs");function Lo(...e){return k.useCallback(yk(...e),e)}lp(Lo,"useComposedRefs");var lO=Object.defineProperty,Ln=(e,t)=>lO(e,"name",{value:t,configurable:!0});function uO(e,t){const n=k.createContext(t);n.displayName=e+"Context";const i=Ln(a=>{const{children:l,...c}=a,f=k.useMemo(()=>c,Object.values(c));return y.jsx(n.Provider,{value:f,children:l})},"Provider");i.displayName=e+"Provider";function s(a,l={}){const{optional:c=!1}=l,f=k.useContext(n);if(f)return f;if(t!==void 0)return t;if(!c)throw new Error(`\`${a}\` must be used within \`${e}\``)}return Ln(s,"useContext"),[i,s]}Ln(uO,"createContext");function vk(e,t=[]){let n=[];function i(a,l){const c=k.createContext(l);c.displayName=a+"Context";const f=n.length;n=[...n,l];const h=Ln(p=>{const{scope:v,children:w,...S}=p,C=v?.[e]?.[f]||c,E=k.useMemo(()=>S,Object.values(S));return y.jsx(C.Provider,{value:E,children:w})},"Provider");h.displayName=a+"Provider";function m(p,v,w={}){const{optional:S=!1}=w,C=v?.[e]?.[f]||c,E=k.useContext(C);if(E)return E;if(l!==void 0)return l;if(!S)throw new Error(`\`${p}\` must be used within \`${a}\``)}return Ln(m,"useContext"),[h,m]}Ln(i,"createContext");const s=Ln(()=>{const a=n.map(l=>k.createContext(l));return Ln(function(c){const f=c?.[e]||a;return k.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])},"useScope")},"createScope");return s.scopeName=e,[i,xk(s,...t)]}Ln(vk,"createContextScope");function xk(...e){const t=e[0];if(e.length===1)return t;const n=Ln(()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return Ln(function(a){const l=i.reduce((c,{useScope:f,scopeName:h})=>{const p=f(a)[`__scope${h}`];return{...c,...p}},{});return k.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Ln(xk,"composeContextScopes");var si=globalThis?.document?k.useLayoutEffect:()=>{},cO=Object.defineProperty,fO=(e,t)=>cO(e,"name",{value:t,configurable:!0}),dO=Ks[" useId ".trim().toString()]||(()=>{}),hO=0;function Ol(e){const[t,n]=k.useState(dO());return si(()=>{e||n(i=>i??String(hO++))},[e]),e||(t?`radix-${t}`:"")}fO(Ol,"useId");var pO=Object.defineProperty,mO=(e,t)=>pO(e,"name",{value:t,configurable:!0}),wx=Ks[" useEffectEvent ".trim().toString()],kx=Ks[" useInsertionEffect ".trim().toString()];function wk(e){if(typeof wx=="function")return wx(e);const t=k.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof kx=="function"?kx(()=>{t.current=e}):si(()=>{t.current=e}),k.useMemo(()=>(...n)=>t.current?.(...n),[])}mO(wk,"useEffectEvent");var gO=Object.defineProperty,na=(e,t)=>gO(e,"name",{value:t,configurable:!0}),yO=Ks[" useInsertionEffect ".trim().toString()]||si;function kk({prop:e,defaultProp:t,onChange:n=na(()=>{},"onChange"),caller:i}){const[s,a,l]=Sk({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:s,h=k.useCallback(m=>{if(c){const p=bk(m)?m(e):m;p!==e&&l.current?.(p)}else a(m)},[c,e,a,l]);return[f,h]}na(kk,"useControllableState");function Sk({defaultProp:e,onChange:t}){const[n,i]=k.useState(e),s=k.useRef(n),a=k.useRef(t);return yO(()=>{a.current=t},[t]),k.useEffect(()=>{s.current!==n&&(a.current?.(n),s.current=n)},[n,s]),[n,i,a]}na(Sk,"useUncontrolledState");function bk(e){return typeof e=="function"}na(bk,"isFunction");var Sx=Symbol("RADIX:SYNC_STATE");function vO(e,t,n,i){const{prop:s,defaultProp:a,onChange:l,caller:c}=t,f=s!==void 0,h=wk(l),m=[{...n,state:a}];i&&m.push(i);const[p,v]=k.useReducer((E,P)=>{if(P.type===Sx)return{...E,state:P.state};const A=e(E,P);return f&&!Object.is(A.state,E.state)&&h(A.state),A},...m),w=p.state,S=k.useRef(w);k.useEffect(()=>{S.current!==w&&(S.current=w,f||h(w))},[w,S,f]);const C=k.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return k.useEffect(()=>{f&&!Object.is(s,p.state)&&v({type:Sx,state:s})},[s,p.state,f]),[C,v]}na(vO,"useControllableStateReducer");var Ck=Zx(),xO=Object.defineProperty,Qn=(e,t)=>xO(e,"name",{value:t,configurable:!0});function up(e){const t=k.forwardRef((n,i)=>{let{children:s,...a}=n,l=null,c=!1;const f=[];Hd(s)&&typeof kl=="function"&&(s=kl(s._payload)),k.Children.forEach(s,v=>{if(Rk(v)){c=!0;const w=v;let S="child"in w.props?w.props.child:w.props.children;Hd(S)&&typeof kl=="function"&&(S=kl(S._payload)),l=kO(w,S),f.push(l?.props?.children)}else f.push(v)}),l?l=k.cloneElement(l,void 0,f):!c&&k.Children.count(s)===1&&k.isValidElement(s)&&(l=s);const h=l?Pk(l):void 0,m=Lo(i,h);if(!l){if(s||s===0)throw new Error(c?CO(e):bO(e));return s}const p=Tk(a,l.props??{});return l.type!==k.Fragment&&(p.ref=i?m:h),k.cloneElement(l,p)});return t.displayName=`${e}.Slot`,t}Qn(up,"createSlot");var Ek=Symbol.for("radix.slottable");function wO(e){const t=Qn(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Ek,t}Qn(wO,"createSlottable");var kO=Qn((e,t)=>{if("child"in e.props){const n=e.props.child;return k.isValidElement(n)?k.cloneElement(n,void 0,e.props.children(n.props.children)):null}return k.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function Tk(e,t){const n={...t};for(const i in t){const s=e[i],a=t[i];/^on[A-Z]/.test(i)?s&&a?n[i]=(...c)=>{const f=a(...c);return s(...c),f}:s&&(n[i]=s):i==="style"?n[i]={...s,...a}:i==="className"&&(n[i]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}Qn(Tk,"mergeProps");function Pk(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)}Qn(Pk,"getElementRef");function Rk(e){return k.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ek}Qn(Rk,"isSlottable");var SO=Symbol.for("react.lazy");function Hd(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===SO&&"_payload"in e&&Ak(e._payload)}Qn(Hd,"isLazyComponent");function Ak(e){return typeof e=="object"&&e!==null&&"then"in e}Qn(Ak,"isPromiseLike");var bO=Qn(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),CO=Qn(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),kl=Ks[" use ".trim().toString()],EO=Object.defineProperty,TO=(e,t)=>EO(e,"name",{value:t,configurable:!0}),PO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_i=PO.reduce((e,t)=>{const n=up(`Primitive.${t}`),i=k.forwardRef((s,a)=>{const{asChild:l,...c}=s,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(f,{...c,ref:a})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function jk(e,t){e&&Ck.flushSync(()=>e.dispatchEvent(t))}TO(jk,"dispatchDiscreteCustomEvent");var RO=Object.defineProperty,AO=(e,t)=>RO(e,"name",{value:t,configurable:!0});function Ro(e){const t=k.useRef(e);return k.useEffect(()=>{t.current=e}),k.useMemo(()=>(...n)=>t.current?.(...n),[])}AO(Ro,"useCallbackRef");var jO=Object.defineProperty,Ot=(e,t)=>jO(e,"name",{value:t,configurable:!0}),Kd="dismissableLayer.update",NO="dismissableLayer.pointerDownOutside",MO="dismissableLayer.focusOutside",bx,Nk=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),IO=k.forwardRef(Ot(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:f,onDismiss:h,...m}=t,p=k.useContext(Nk),[v,w]=k.useState(null),S=v?.ownerDocument??globalThis?.document,[,C]=k.useState({}),E=Lo(n,w),P=Array.from(p.layers),[A]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),T=A?P.indexOf(A):-1,L=v?P.indexOf(v):-1,j=p.layersWithOutsidePointerEventsDisabled.size>0,I=L>=T,K=k.useRef(!1),B=Ik(V=>{l?.(V),f?.(V),V.defaultPrevented||h?.()},{ownerDocument:S,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:K,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:k.useCallback(V=>{if(!(V instanceof Node))return!1;const he=[...p.branches].some(J=>J.contains(V));return I&&!he},[p.branches,I])}),_=Dk(V=>{if(s&&K.current)return;const he=V.target;[...p.branches].some(Z=>Z.contains(he))||(c?.(V),f?.(V),V.defaultPrevented||h?.())},S),N=v?L===P.length-1:!1,$=Ro(V=>{V.key==="Escape"&&(a?.(V),!V.defaultPrevented&&h&&(V.preventDefault(),h()))});return k.useEffect(()=>{if(N)return S.addEventListener("keydown",$,{capture:!0}),()=>S.removeEventListener("keydown",$,{capture:!0})},[S,N,$]),k.useEffect(()=>{if(v)return i&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(bx=S.body.style.pointerEvents,S.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(v)),p.layers.add(v),qd(),()=>{i&&(p.layersWithOutsidePointerEventsDisabled.delete(v),p.layersWithOutsidePointerEventsDisabled.size===0&&(S.body.style.pointerEvents=bx))}},[v,S,i,p]),k.useEffect(()=>()=>{v&&(p.layers.delete(v),p.layersWithOutsidePointerEventsDisabled.delete(v),qd())},[v,p]),k.useEffect(()=>{const V=Ot(()=>C({}),"handleUpdate");return document.addEventListener(Kd,V),()=>document.removeEventListener(Kd,V)},[]),y.jsx(_i.div,{...m,ref:E,style:{pointerEvents:j?I?"auto":"none":void 0,...t.style},onFocusCapture:ni(t.onFocusCapture,_.onFocusCapture),onBlurCapture:ni(t.onBlurCapture,_.onBlurCapture),onPointerDownCapture:ni(t.onPointerDownCapture,B.onPointerDownCapture)})},"DismissableLayer"));function Mk(){const e=k.useContext(Nk),[t,n]=k.useState(null);return k.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ot(Mk,"useDismissableLayerSurface");var DO=Ot(()=>!0,"IS_TRUE");function Ik(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:a,shouldHandlePointerDownOutside:l=DO}=t,c=Ro(e),f=k.useRef(!1),h=k.useRef(!1),m=k.useRef(new Map),p=k.useRef(()=>{});return k.useEffect(()=>{function v(){h.current=!1,s.current=!1,m.current.clear()}Ot(v,"resetOutsideInteraction");function w(){return Array.from(m.current.values()).some(Boolean)}Ot(w,"isOutsideInteractionIntercepted");function S(T){if(!h.current)return;const L=T.target;L instanceof Node&&[...a].some(I=>I.contains(L))||m.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{h.current&&p.current()},0)}Ot(S,"handleInteractionCapture");function C(T){h.current&&m.current.set(T.type,!1)}Ot(C,"handleInteractionBubble");const E=Ot(T=>{if(T.target&&!f.current){let L=function(){n.removeEventListener("click",p.current);const I=w();v(),I||cp(NO,c,j,{discrete:!0})};if(Ot(L,"handleAndDispatchPointerDownOutsideEvent"),!l(T.target)){n.removeEventListener("click",p.current),v(),f.current=!1;return}const j={originalEvent:T};h.current=!0,s.current=i&&T.button===0,m.current.clear(),!i||T.button!==0?L():(n.removeEventListener("click",p.current),p.current=L,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),v();f.current=!1},"handlePointerDown"),P=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of P)n.addEventListener(T,S,!0),n.addEventListener(T,C);const A=window.setTimeout(()=>{n.addEventListener("pointerdown",E)},0);return()=>{window.clearTimeout(A),n.removeEventListener("pointerdown",E),n.removeEventListener("click",p.current);for(const T of P)n.removeEventListener(T,S,!0),n.removeEventListener(T,C)}},[n,c,i,s,a,l]),{onPointerDownCapture:Ot(()=>f.current=!0,"onPointerDownCapture")}}Ot(Ik,"usePointerDownOutside");function Dk(e,t=globalThis?.document){const n=Ro(e),i=k.useRef(!1);return k.useEffect(()=>{const s=Ot(a=>{a.target&&!i.current&&cp(MO,n,{originalEvent:a},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:Ot(()=>i.current=!0,"onFocusCapture"),onBlurCapture:Ot(()=>i.current=!1,"onBlurCapture")}}Ot(Dk,"useFocusOutside");function qd(){const e=new CustomEvent(Kd);document.dispatchEvent(e)}Ot(qd,"dispatchUpdate");function cp(e,t,n,{discrete:i}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),i?jk(s,a):s.dispatchEvent(a)}Ot(cp,"handleAndDispatchCustomEvent");var LO=Object.defineProperty,ln=(e,t)=>LO(e,"name",{value:t,configurable:!0}),Uf="focusScope.autoFocusOnMount",Wf="focusScope.autoFocusOnUnmount",Cx={bubbles:!1,cancelable:!0},_O=k.forwardRef(ln(function(t,n){const{loop:i=!1,trapped:s=!1,onMountAutoFocus:a,onUnmountAutoFocus:l,...c}=t,[f,h]=k.useState(null),m=Ro(a),p=Ro(l),v=k.useRef(null),w=Lo(n,h),S=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(s){let E=function(L){if(S.paused||!f)return;const j=L.target;f.contains(j)?v.current=j:Tr(v.current,{select:!0})},P=function(L){if(S.paused||!f)return;const j=L.relatedTarget;j!==null&&(f.contains(j)||Tr(v.current,{select:!0}))},A=function(L){if(document.activeElement===document.body)for(const I of L)I.removedNodes.length>0&&Tr(f)};ln(E,"handleFocusIn"),ln(P,"handleFocusOut"),ln(A,"handleMutations"),document.addEventListener("focusin",E),document.addEventListener("focusout",P);const T=new MutationObserver(A);return f&&T.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",P),T.disconnect()}}},[s,f,S.paused]),k.useEffect(()=>{if(f){Ex.add(S);const E=document.activeElement;if(!f.contains(E)){const A=new CustomEvent(Uf,Cx);f.addEventListener(Uf,m),f.dispatchEvent(A),A.defaultPrevented||(Lk(Vk(fp(f)),{select:!0}),document.activeElement===E&&Tr(f))}return()=>{f.removeEventListener(Uf,m),setTimeout(()=>{const A=new CustomEvent(Wf,Cx);f.addEventListener(Wf,p),f.dispatchEvent(A),A.defaultPrevented||Tr(E??document.body,{select:!0}),f.removeEventListener(Wf,p),Ex.remove(S)},0)}}},[f,m,p,S]);const C=k.useCallback(E=>{if(!i&&!s||S.paused)return;const P=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,A=document.activeElement;if(P&&A){const T=E.currentTarget,[L,j]=_k(T);L&&j?!E.shiftKey&&A===j?(E.preventDefault(),i&&Tr(L,{select:!0})):E.shiftKey&&A===L&&(E.preventDefault(),i&&Tr(j,{select:!0})):A===T&&E.preventDefault()}},[i,s,S.paused]);return y.jsx(_i.div,{tabIndex:-1,...c,ref:w,onKeyDown:C})},"FocusScope"));function Lk(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(Tr(i,{select:t}),document.activeElement!==n)return}ln(Lk,"focusFirst");function _k(e){const t=fp(e),n=Xd(t,e),i=Xd(t.reverse(),e);return[n,i]}ln(_k,"getTabbableEdges");function fp(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ln(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}ln(fp,"getTabbableCandidates");function Xd(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):Ok(i,{upTo:t})))return i}ln(Xd,"findVisible");function Ok(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}ln(Ok,"isHidden");function Fk(e){return e instanceof HTMLInputElement&&"select"in e}ln(Fk,"isSelectableInput");function Tr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Fk(e)&&t&&e.select()}}ln(Tr,"focus");var Ex=zk();function zk(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Yd(e,t),e.unshift(t)},remove(t){e=Yd(e,t),e[0]?.resume()}}}ln(zk,"createFocusScopesStack");function Yd(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}ln(Yd,"arrayRemove");function Vk(e){return e.filter(t=>t.tagName!=="A")}ln(Vk,"removeLinks");var OO=Object.defineProperty,FO=(e,t)=>OO(e,"name",{value:t,configurable:!0}),zO=k.forwardRef(FO(function(t,n){const{container:i,...s}=t,[a,l]=k.useState(!1);si(()=>l(!0),[]);const c=i||a&&globalThis?.document?.body;return c?Ck.createPortal(y.jsx(_i.div,{...s,ref:n}),c):null},"Portal")),VO=Object.defineProperty,Pr=(e,t)=>VO(e,"name",{value:t,configurable:!0});function Bk(e,t){return k.useReducer((n,i)=>t[n][i]??n,e)}Pr(Bk,"useStateMachine");var dp=Pr(e=>{const{present:t,children:n}=e,i=$k(t),s=typeof n=="function"?n({present:i.isPresent}):k.Children.only(n),a=Uk(i.ref,Wk(s));return typeof n=="function"||i.isPresent?k.cloneElement(s,{ref:a}):null},"Presence");function $k(e){const[t,n]=k.useState(),i=k.useRef(null),s=k.useRef(e),a=k.useRef("none"),l=k.useRef(void 0),c=e?"mounted":"unmounted",[f,h]=Bk(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{f==="mounted"?(a.current=l.current??yo(i.current),l.current=void 0):a.current="none"},[f]),si(()=>{const m=i.current,p=s.current;if(p!==e){const w=a.current,S=yo(m);e?(l.current=S,h("MOUNT")):S==="none"||m?.display==="none"?h("UNMOUNT"):h(p&&w!==S?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),si(()=>{if(t){let m;const p=t.ownerDocument.defaultView??window,v=Pr(S=>{const E=yo(i.current).includes(CSS.escape(S.animationName));if(S.target===t&&E&&(h("ANIMATION_END"),!s.current)){const P=t.style.animationFillMode;t.style.animationFillMode="forwards",m=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=P)})}},"handleAnimationEnd"),w=Pr(S=>{S.target===t&&(a.current=yo(i.current))},"handleAnimationStart");return t.addEventListener("animationstart",w),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{p.clearTimeout(m),t.removeEventListener("animationstart",w),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:k.useCallback(m=>{if(m){const p=getComputedStyle(m);i.current=p,l.current=yo(p)}else i.current=null;n(m)},[])}}Pr($k,"usePresence");function Gd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Pr(Gd,"setRef");function Uk(...e){const t=k.useRef(e);return t.current=e,k.useCallback(n=>{const i=t.current;let s=!1;const a=i.map(l=>{const c=Gd(l,n);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let l=0;l<a.length;l++){const c=a[l];typeof c=="function"?c():Gd(i[l],null)}}},[])}Pr(Uk,"useStableComposedRefs");function yo(e){return e?.animationName||"none"}Pr(yo,"getAnimationName");function Wk(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)}Pr(Wk,"getElementRef");var BO=Object.defineProperty,hp=(e,t)=>BO(e,"name",{value:t,configurable:!0}),Sl=0,co=null;function $O(e){return pp(),e.children}hp($O,"FocusGuards");function pp(){k.useEffect(()=>{co||(co={start:Qd(),end:Qd()});const{start:e,end:t}=co;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Sl++,()=>{Sl===1&&(co?.start.remove(),co?.end.remove(),co=null),Sl=Math.max(0,Sl-1)}},[])}hp(pp,"useFocusGuards");function Qd(){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}hp(Qd,"createFocusGuard");var cr=function(){return cr=Object.assign||function(t){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},cr.apply(this,arguments)};function Hk(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 UO(e,t,n){if(n||arguments.length===2)for(var i=0,s=t.length,a;i<s;i++)(a||!(i in t))&&(a||(a=Array.prototype.slice.call(t,0,i)),a[i]=t[i]);return e.concat(a||Array.prototype.slice.call(t))}var Fl="right-scroll-bar-position",zl="width-before-scroll-bar",WO="with-scroll-bars-hidden",HO="--removed-body-scroll-bar-size";function Hf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function KO(e,t){var n=k.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 qO=typeof window<"u"?k.useLayoutEffect:k.useEffect,Tx=new WeakMap;function XO(e,t){var n=KO(null,function(i){return e.forEach(function(s){return Hf(s,i)})});return qO(function(){var i=Tx.get(n);if(i){var s=new Set(i),a=new Set(e),l=n.current;s.forEach(function(c){a.has(c)||Hf(c,null)}),a.forEach(function(c){s.has(c)||Hf(c,l)})}Tx.set(n,e)},[e]),n}function YO(e){return e}function GO(e,t){t===void 0&&(t=YO);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(a){var l=t(a,i);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(a){for(i=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){i=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(a),l=n}var f=function(){var m=l;l=[],m.forEach(a)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(m){l.push(m),h()},filter:function(m){return l=l.filter(m),n}}}};return s}function QO(e){e===void 0&&(e={});var t=GO(null);return t.options=cr({async:!0,ssr:!1},e),t}var Kk=function(e){var t=e.sideCar,n=Hk(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 k.createElement(i,cr({},n))};Kk.isSideCarExport=!0;function JO(e,t){return e.useMedium(t),Kk}var qk=QO(),Kf=function(){},ku=k.forwardRef(function(e,t){var n=k.useRef(null),i=k.useState({onScrollCapture:Kf,onWheelCapture:Kf,onTouchMoveCapture:Kf}),s=i[0],a=i[1],l=e.forwardProps,c=e.children,f=e.className,h=e.removeScrollBar,m=e.enabled,p=e.shards,v=e.sideCar,w=e.noRelative,S=e.noIsolation,C=e.inert,E=e.allowPinchZoom,P=e.as,A=P===void 0?"div":P,T=e.gapMode,L=Hk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=v,I=XO([n,t]),K=cr(cr({},L),s);return k.createElement(k.Fragment,null,m&&k.createElement(j,{sideCar:qk,removeScrollBar:h,shards:p,noRelative:w,noIsolation:S,inert:C,setCallbacks:a,allowPinchZoom:!!E,lockRef:n,gapMode:T}),l?k.cloneElement(k.Children.only(c),cr(cr({},K),{ref:I})):k.createElement(A,cr({},K,{className:f,ref:I}),c))});ku.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ku.classNames={fullWidth:zl,zeroRight:Fl};var ZO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function eF(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ZO();return t&&e.setAttribute("nonce",t),e}function tF(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function nF(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var rF=function(){var e=0,t=null;return{add:function(n){e==0&&(t=eF())&&(tF(t,n),nF(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},iF=function(){var e=rF();return function(t,n){k.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Xk=function(){var e=iF(),t=function(n){var i=n.styles,s=n.dynamic;return e(i,s),null};return t},oF={left:0,top:0,right:0,gap:0},qf=function(e){return parseInt(e||"",10)||0},sF=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[qf(n),qf(i),qf(s)]},aF=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return oF;var t=sF(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])}},lF=Xk(),So="data-scroll-locked",uF=function(e,t,n,i){var s=e.left,a=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
284
+ .`.concat(WO,` {
285
+ overflow: hidden `).concat(i,`;
286
+ padding-right: `).concat(c,"px ").concat(i,`;
287
+ }
288
+ body[`).concat(So,`] {
289
+ overflow: hidden `).concat(i,`;
290
+ overscroll-behavior: contain;
291
+ `).concat([t&&"position: relative ".concat(i,";"),n==="margin"&&`
292
+ padding-left: `.concat(s,`px;
293
+ padding-top: `).concat(a,`px;
294
+ padding-right: `).concat(l,`px;
295
+ margin-left:0;
296
+ margin-top:0;
297
+ margin-right: `).concat(c,"px ").concat(i,`;
298
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(i,";")].filter(Boolean).join(""),`
299
+ }
300
+
301
+ .`).concat(Fl,` {
302
+ right: `).concat(c,"px ").concat(i,`;
303
+ }
304
+
305
+ .`).concat(zl,` {
306
+ margin-right: `).concat(c,"px ").concat(i,`;
307
+ }
308
+
309
+ .`).concat(Fl," .").concat(Fl,` {
310
+ right: 0 `).concat(i,`;
311
+ }
312
+
313
+ .`).concat(zl," .").concat(zl,` {
314
+ margin-right: 0 `).concat(i,`;
315
+ }
316
+
317
+ body[`).concat(So,`] {
318
+ `).concat(HO,": ").concat(c,`px;
319
+ }
320
+ `)},Px=function(){var e=parseInt(document.body.getAttribute(So)||"0",10);return isFinite(e)?e:0},cF=function(){k.useEffect(function(){return document.body.setAttribute(So,(Px()+1).toString()),function(){var e=Px()-1;e<=0?document.body.removeAttribute(So):document.body.setAttribute(So,e.toString())}},[])},fF=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,s=i===void 0?"margin":i;cF();var a=k.useMemo(function(){return aF(s)},[s]);return k.createElement(lF,{styles:uF(a,!t,s,n?"":"!important")})},Jd=!1;if(typeof window<"u")try{var bl=Object.defineProperty({},"passive",{get:function(){return Jd=!0,!0}});window.addEventListener("test",bl,bl),window.removeEventListener("test",bl,bl)}catch{Jd=!1}var fo=Jd?{passive:!1}:!1,dF=function(e){return e.tagName==="TEXTAREA"},Yk=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!dF(e)&&n[t]==="visible")},hF=function(e){return Yk(e,"overflowY")},pF=function(e){return Yk(e,"overflowX")},Rx=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var s=Gk(e,i);if(s){var a=Qk(e,i),l=a[1],c=a[2];if(l>c)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},mF=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},gF=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},Gk=function(e,t){return e==="v"?hF(t):pF(t)},Qk=function(e,t){return e==="v"?mF(t):gF(t)},yF=function(e,t){return e==="h"&&t==="rtl"?-1:1},vF=function(e,t,n,i,s){var a=yF(e,window.getComputedStyle(t).direction),l=a*i,c=n.target,f=t.contains(c),h=!1,m=l>0,p=0,v=0;do{if(!c)break;var w=Qk(e,c),S=w[0],C=w[1],E=w[2],P=C-E-a*S;(S||P)&&Gk(e,c)&&(p+=P,v+=S);var A=c.parentNode;c=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(m&&Math.abs(p)<1||!m&&Math.abs(v)<1)&&(h=!0),h},Cl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ax=function(e){return[e.deltaX,e.deltaY]},jx=function(e){return e&&"current"in e?e.current:e},xF=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wF=function(e){return`
321
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
322
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
323
+ `)},kF=0,ho=[];function SF(e){var t=k.useRef([]),n=k.useRef([0,0]),i=k.useRef(),s=k.useState(kF++)[0],a=k.useState(Xk)[0],l=k.useRef(e);k.useEffect(function(){l.current=e},[e]),k.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var C=UO([e.lockRef.current],(e.shards||[]).map(jx),!0).filter(Boolean);return C.forEach(function(E){return E.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),C.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=k.useCallback(function(C,E){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!l.current.allowPinchZoom;var P=Cl(C),A=n.current,T="deltaX"in C?C.deltaX:A[0]-P[0],L="deltaY"in C?C.deltaY:A[1]-P[1],j,I=C.target,K=Math.abs(T)>Math.abs(L)?"h":"v";if("touches"in C&&K==="h"&&I.type==="range")return!1;var B=window.getSelection(),_=B&&B.anchorNode,N=_?_===I||_.contains(I):!1;if(N)return!1;var $=Rx(K,I);if(!$)return!0;if($?j=K:(j=K==="v"?"h":"v",$=Rx(K,I)),!$)return!1;if(!i.current&&"changedTouches"in C&&(T||L)&&(i.current=j),!j)return!0;var V=i.current||j;return vF(V,E,C,V==="h"?T:L)},[]),f=k.useCallback(function(C){var E=C;if(!(!ho.length||ho[ho.length-1]!==a)){var P="deltaY"in E?Ax(E):Cl(E),A=t.current.filter(function(j){return j.name===E.type&&(j.target===E.target||E.target===j.shadowParent)&&xF(j.delta,P)})[0];if(A&&A.should){E.cancelable&&E.preventDefault();return}if(!A){var T=(l.current.shards||[]).map(jx).filter(Boolean).filter(function(j){return j.contains(E.target)}),L=T.length>0?c(E,T[0]):!l.current.noIsolation;L&&E.cancelable&&E.preventDefault()}}},[]),h=k.useCallback(function(C,E,P,A){var T={name:C,delta:E,target:P,should:A,shadowParent:bF(P)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(L){return L!==T})},1)},[]),m=k.useCallback(function(C){n.current=Cl(C),i.current=void 0},[]),p=k.useCallback(function(C){h(C.type,Ax(C),C.target,c(C,e.lockRef.current))},[]),v=k.useCallback(function(C){h(C.type,Cl(C),C.target,c(C,e.lockRef.current))},[]);k.useEffect(function(){return ho.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",f,fo),document.addEventListener("touchmove",f,fo),document.addEventListener("touchstart",m,fo),function(){ho=ho.filter(function(C){return C!==a}),document.removeEventListener("wheel",f,fo),document.removeEventListener("touchmove",f,fo),document.removeEventListener("touchstart",m,fo)}},[]);var w=e.removeScrollBar,S=e.inert;return k.createElement(k.Fragment,null,S?k.createElement(a,{styles:wF(s)}):null,w?k.createElement(fF,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function bF(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const CF=JO(qk,SF);var Jk=k.forwardRef(function(e,t){return k.createElement(ku,cr({},e,{ref:t,sideCar:CF}))});Jk.classNames=ku.classNames;var EF=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},po=new WeakMap,El=new WeakMap,Tl={},Xf=0,Zk=function(e){return e&&(e.host||Zk(e.parentNode))},TF=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=Zk(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})},PF=function(e,t,n,i){var s=TF(t,Array.isArray(e)?e:[e]);Tl[n]||(Tl[n]=new WeakMap);var a=Tl[n],l=[],c=new Set,f=new Set(s),h=function(p){!p||c.has(p)||(c.add(p),h(p.parentNode))};s.forEach(h);var m=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(v){if(c.has(v))m(v);else try{var w=v.getAttribute(i),S=w!==null&&w!=="false",C=(po.get(v)||0)+1,E=(a.get(v)||0)+1;po.set(v,C),a.set(v,E),l.push(v),C===1&&S&&El.set(v,!0),E===1&&v.setAttribute(n,"true"),S||v.setAttribute(i,"true")}catch(P){console.error("aria-hidden: cannot operate on ",v,P)}})};return m(t),c.clear(),Xf++,function(){l.forEach(function(p){var v=po.get(p)-1,w=a.get(p)-1;po.set(p,v),a.set(p,w),v||(El.has(p)||p.removeAttribute(i),El.delete(p)),w||p.removeAttribute(n)}),Xf--,Xf||(po=new WeakMap,po=new WeakMap,El=new WeakMap,Tl={})}},RF=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),s=EF(e);return s?(i.push.apply(i,Array.from(s.querySelectorAll("[aria-live], script"))),PF(i,s,n,"aria-hidden")):function(){return null}},AF=Object.defineProperty,Fn=(e,t)=>AF(e,"name",{value:t,configurable:!0}),mp="Dialog",[eS,l4]=vk(mp),[jF,pr]=eS(mp),tS=Fn(e=>{const{__scopeDialog:t,children:n,open:i,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,c=k.useRef(null),f=k.useRef(null),[h,m]=kk({prop:i,defaultProp:s??!1,onChange:a,caller:mp}),[p,v]=k.useState(0),[w,S]=k.useState(0);return y.jsx(jF,{scope:t,triggerRef:c,contentRef:f,contentId:Ol(),titleId:Ol(),descriptionId:Ol(),titlePresent:p>0,descriptionPresent:w>0,setTitleCount:v,setDescriptionCount:S,open:h,onOpenChange:m,onOpenToggle:k.useCallback(()=>m(C=>!C),[m]),modal:l,children:n})},"Dialog"),nS="DialogPortal",[NF,rS]=eS(nS,{forceMount:void 0}),iS=Fn(e=>{const{__scopeDialog:t,forceMount:n,children:i,container:s}=e,a=pr(nS,t);return y.jsx(NF,{scope:t,forceMount:n,children:k.Children.map(i,l=>y.jsx(dp,{present:n||a.open,children:y.jsx(zO,{asChild:!0,container:s,children:l})}))})},"DialogPortal"),Zd="DialogOverlay",oS=k.forwardRef(Fn(function(t,n){const i=rS(Zd,t.__scopeDialog),{forceMount:s=i.forceMount,...a}=t,l=pr(Zd,t.__scopeDialog);return l.modal?y.jsx(dp,{present:s||l.open,children:y.jsx(IF,{...a,ref:n})}):null},"DialogOverlay")),MF=up("DialogOverlay.RemoveScroll"),IF=k.forwardRef(Fn(function(t,n){const{__scopeDialog:i,...s}=t,a=pr(Zd,i),l=Mk(),c=Lo(n,l);return y.jsx(Jk,{as:MF,allowPinchZoom:!0,shards:[a.contentRef],children:y.jsx(_i.div,{"data-state":gp(a.open),...s,ref:c,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),Ws="DialogContent",sS=k.forwardRef(Fn(function(t,n){const i=rS(Ws,t.__scopeDialog),{forceMount:s=i.forceMount,...a}=t,l=pr(Ws,t.__scopeDialog);return y.jsx(dp,{present:s||l.open,children:l.modal?y.jsx(DF,{...a,ref:n}):y.jsx(LF,{...a,ref:n})})},"DialogContent")),DF=k.forwardRef(Fn(function(t,n){const i=pr(Ws,t.__scopeDialog),s=k.useRef(null),a=Lo(n,i.contentRef,s);return k.useEffect(()=>{const l=s.current;if(l)return RF(l)},[]),y.jsx(aS,{...t,ref:a,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:ni(t.onCloseAutoFocus,l=>{l.preventDefault(),i.triggerRef.current?.focus()}),onPointerDownOutside:ni(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&l.preventDefault()}),onFocusOutside:ni(t.onFocusOutside,l=>l.preventDefault())})},"DialogContentModal")),LF=k.forwardRef(Fn(function(t,n){const i=pr(Ws,t.__scopeDialog),s=k.useRef(!1),a=k.useRef(!1);return y.jsx(aS,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{t.onCloseAutoFocus?.(l),l.defaultPrevented||(s.current||i.triggerRef.current?.focus(),l.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:l=>{t.onInteractOutside?.(l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=l.target;i.triggerRef.current?.contains(c)&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&a.current&&l.preventDefault()}})},"DialogContentNonModal")),aS=k.forwardRef(Fn(function(t,n){const{__scopeDialog:i,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,...c}=t,f=pr(Ws,i);return pp(),y.jsx(y.Fragment,{children:y.jsx(_O,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:l,children:y.jsx(IO,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionPresent?f.descriptionId:void 0,"aria-labelledby":f.titlePresent?f.titleId:void 0,"data-state":gp(f.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1)})})})},"DialogContentImpl")),_F="DialogTitle",lS=k.forwardRef(Fn(function(t,n){const{__scopeDialog:i,...s}=t,a=pr(_F,i),{setTitleCount:l}=a;return si(()=>(l(c=>c+1),()=>l(c=>c-1)),[l]),y.jsx(_i.h2,{id:a.titleId,...s,ref:n})},"DialogTitle")),OF="DialogDescription",uS=k.forwardRef(Fn(function(t,n){const{__scopeDialog:i,...s}=t,a=pr(OF,i),{setDescriptionCount:l}=a;return si(()=>(l(c=>c+1),()=>l(c=>c-1)),[l]),y.jsx(_i.p,{id:a.descriptionId,...s,ref:n})},"DialogDescription")),FF="DialogClose",cS=k.forwardRef(Fn(function(t,n){const{__scopeDialog:i,...s}=t,a=pr(FF,i);return y.jsx(_i.button,{type:"button",...s,ref:n,onClick:ni(t.onClick,()=>a.onOpenChange(!1))})},"DialogClose"));function gp(e){return e?"open":"closed"}Fn(gp,"getState");function ra(e){const t=k.useRef(null);return k.useEffect(()=>(t.current=document.activeElement instanceof HTMLElement?document.activeElement:null,()=>{const n=t.current;n?.isConnected&&requestAnimationFrame(()=>n.focus())}),[]),y.jsx(tS,{open:!0,onOpenChange:n=>{n||e.onClose()},children:y.jsxs(iS,{children:[y.jsx(oS,{className:"modal-backdrop"}),y.jsxs(sS,{id:e.contentId,className:"modal"+(e.wide?" modal-wide":"")+(e.className?` ${e.className}`:""),children:[y.jsxs("div",{className:"modal-head",children:[y.jsxs("div",{children:[y.jsx(lS,{asChild:!0,children:y.jsx("h3",{children:e.title})}),e.description&&y.jsx(uS,{className:"modal-description",children:e.description})]}),y.jsx(cS,{asChild:!0,children:y.jsx("button",{className:"icon-btn","aria-label":`Close ${e.title}`,children:y.jsx(be,{name:"close"})})})]}),e.tabs,y.jsx("div",{className:"modal-body",children:e.children})]})]})})}const zF="modulepreload",VF=function(e){return"/"+e},Nx={},yp=function(t,n,i){let s=Promise.resolve();if(n&&n.length>0){let l=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]"),f=c?.nonce||c?.getAttribute("nonce");s=l(n.map(h=>{if(h=VF(h),h in Nx)return;Nx[h]=!0;const m=h.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${p}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":zF,m||(v.as="script"),v.crossOrigin="",v.href=h,f&&v.setAttribute("nonce",f),document.head.appendChild(v),m)return new Promise((w,S)=>{v.addEventListener("load",w),v.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return s.then(l=>{for(const c of l||[])c.status==="rejected"&&a(c.reason);return t().catch(a)})};let BF=0;const $F=.25,UF=8;let Mx=Promise.resolve();function Ix(){return typeof document<"u"&&document.documentElement.classList.contains("theme-dark")?"dark":"default"}function WF(){const[e,t]=k.useState(Ix);return k.useEffect(()=>{const n=document.documentElement,i=()=>t(Ix()),s=new MutationObserver(i);return s.observe(n,{attributes:!0,attributeFilter:["class"]}),i(),()=>s.disconnect()},[]),e}function HF(e,t,n,i){const s=Mx.then(async()=>{if(!i())return"";const{default:a}=await yp(async()=>{const{default:c}=await import("./mermaid.core-pc_WsE8Z.js").then(f=>f.bp);return{default:c}},[]);if(!i())return"";if(a.initialize({startOnLoad:!1,securityLevel:"strict",theme:n,fontFamily:"Arial, sans-serif",htmlLabels:!1,flowchart:{htmlLabels:!1},suppressErrorRendering:!0}),t.length>5e4)throw new Error("Diagram exceeds the rendering limit.");if(/^\s*---(?:\r?\n|$)|%%\s*\{/.test(t))throw new Error("Diagram configuration overrides are not supported.");if(await document.fonts.ready,!i())return"";const l=document.createElement("div");l.style.fontFamily="Arial, sans-serif",l.style.fontSize="16px",l.style.lineHeight="normal",l.style.position="absolute",l.style.visibility="hidden",document.body.append(l);try{const c=await a.render(e,t,l),h=new DOMParser().parseFromString(c.svg,"image/svg+xml").documentElement,m=h.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number);if(h.localName!=="svg"||!m||m.length!==4||!m.every(Number.isFinite)||m[2]<=0||m[3]<=0)throw new Error("Diagram has no usable dimensions.");return h.setAttribute("width",String(m[2])),h.setAttribute("height",String(m[3])),URL.createObjectURL(new Blob([new XMLSerializer().serializeToString(h)],{type:"image/svg+xml"}))}finally{l.remove()}});return Mx=s.then(()=>{},()=>{}),s}function KF(e){return Math.min(UF,Math.max($F,e))}function qF(e){const t=k.useRef(null),n=k.useRef(null),[i,s]=k.useState(1),[a,l]=k.useState({x:0,y:0}),[c,f]=k.useState(!1),h=()=>{s(1),l({x:0,y:0})},m=(p,v,w)=>{const S=KF(p);if(S===i)return;const C=t.current?.getBoundingClientRect();if(C){const E=(v??C.left+C.width/2)-C.left-C.width/2,P=(w??C.top+C.height/2)-C.top-C.height/2,A=S/i;l(T=>({x:E-A*(E-T.x),y:P-A*(P-T.y)}))}s(S)};return k.useEffect(()=>{const p=v=>{v.key==="+"||v.key==="="?(v.preventDefault(),m(i*1.25)):v.key==="-"?(v.preventDefault(),m(i/1.25)):v.key==="0"&&(v.preventDefault(),h())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)}),y.jsx(tS,{open:!0,onOpenChange:p=>{p||e.onClose()},children:y.jsxs(iS,{children:[y.jsx(oS,{className:"mermaid-fullscreen-backdrop"}),y.jsxs(sS,{className:"mermaid-fullscreen","data-mermaid-theme":e.theme,"aria-describedby":"mermaid-fullscreen-help",children:[y.jsx(lS,{className:"mermaid-fullscreen-title",children:"Diagram viewer"}),y.jsxs("div",{className:"mermaid-fullscreen-tools",children:[y.jsx("button",{className:"icon-btn","aria-label":"Zoom out",title:"Zoom out (−)",onClick:()=>m(i/1.25),children:y.jsx(be,{name:"minus"})}),y.jsxs("button",{className:"mermaid-zoom-value",onClick:h,title:"Reset zoom and position",children:[Math.round(i*100),"%"]}),y.jsx("button",{className:"icon-btn","aria-label":"Zoom in",title:"Zoom in (+)",onClick:()=>m(i*1.25),children:y.jsx(be,{name:"plus"})}),y.jsx(cS,{asChild:!0,children:y.jsx("button",{className:"icon-btn","aria-label":"Close diagram viewer",title:"Close (Esc)",children:y.jsx(be,{name:"close"})})})]}),y.jsx("div",{ref:t,tabIndex:0,role:"region","aria-label":"Diagram navigation; use arrow keys to pan",onKeyDown:p=>{const v={ArrowLeft:[40,0],ArrowRight:[-40,0],ArrowUp:[0,40],ArrowDown:[0,-40]}[p.key];v&&(p.preventDefault(),l(w=>({x:w.x+v[0],y:w.y+v[1]})))},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:a.x,panY:a.y},p.currentTarget.setPointerCapture(p.pointerId),f(!0))},onPointerMove:p=>{const v=n.current;!v||v.pointerId!==p.pointerId||l({x:v.panX+p.clientX-v.startX,y:v.panY+p.clientY-v.startY})},onPointerUp:p=>{n.current?.pointerId===p.pointerId&&(n.current=null,f(!1),p.currentTarget.releasePointerCapture(p.pointerId))},onPointerCancel:()=>{n.current=null,f(!1)},children:y.jsx("div",{className:"mermaid-fullscreen-canvas",style:{transform:`translate(${a.x}px, ${a.y}px) scale(${i})`},children:y.jsx("img",{src:e.svg,alt:"Mermaid diagram"})})}),y.jsx(uS,{id:"mermaid-fullscreen-help",className:"mermaid-fullscreen-help",children:"Scroll or +/− to zoom · drag or arrow keys to move · 0 to reset"})]})]})})}function fS({source:e}){const t=k.useId(),[n,i]=k.useState(""),[s,a]=k.useState(""),[l,c]=k.useState("default"),[f,h]=k.useState(!1),m=WF();return k.useEffect(()=>{let p=!0,v="";const w=`mermaid-${++BF}-${t.replace(/[^a-zA-Z0-9_-]/g,"")}`;return i(""),a(""),h(!1),HF(w,e,m,()=>p).then(S=>{p?(c(m),v=S,i(S)):URL.revokeObjectURL(S)}).catch(S=>{p&&a(S instanceof Error?S.message:String(S))}),()=>{p=!1,v&&URL.revokeObjectURL(v)}},[t,e,m]),y.jsxs("div",{className:"mermaid-block",children:[s?y.jsxs("p",{className:"markdown-mermaid-error",role:"status",children:["Unable to render diagram: ",s]}):n?y.jsxs("div",{className:"markdown-mermaid","data-mermaid-theme":l,children:[y.jsx("button",{className:"icon-btn markdown-mermaid-expand","aria-label":"View diagram fullscreen",title:"View diagram fullscreen",onClick:()=>h(!0),children:y.jsx(be,{name:"maximize"})}),y.jsx("div",{className:"markdown-mermaid-diagram",tabIndex:0,role:"region","aria-label":"Scrollable Mermaid diagram",children:y.jsx("img",{src:n,alt:"Mermaid diagram; original source follows",onError:()=>a("Diagram image could not be displayed.")})})]}):y.jsx("div",{className:"markdown-mermaid-loading",role:"status",children:"Rendering diagram…"}),y.jsxs("details",{className:"mermaid-source",open:s?!0:void 0,children:[y.jsx("summary",{children:"Mermaid source"}),y.jsx("pre",{children:y.jsx("code",{children:e})})]}),f&&n&&!s&&y.jsx(qF,{svg:n,theme:l,onClose:()=>h(!1)})]})}const XF=k.memo(function(t){return y.jsx("article",{className:"markdown-body",ref:t.contentRef,children:y.jsx(dk,{remarkPlugins:[hk],components:{a:({children:n,...i})=>y.jsx("a",{...i,target:"_blank",rel:"noreferrer",children:n}),pre:({children:n})=>{const i=k.isValidElement(n)?n:null;return i?.props.className==="language-mermaid"?y.jsx(fS,{source:String(i.props.children).replace(/\n$/,"")}):y.jsx("pre",{children:n})}},children:t.markdown})})});function dS(e){const{rec:t}=e,n=k.useRef(null),[i,s]=k.useState(""),[a,l]=k.useState(!1),[c,f]=k.useState(null),[h,m]=k.useState("loading"),[p,v]=k.useState(""),[w,S]=k.useState(0),[C,E]=k.useState(""),[P,A]=k.useState(0),[T,L]=k.useState(!1),[j,I]=k.useState(""),[K,B]=k.useState(!1),[_,N]=k.useState(!1),[$,V]=k.useState([]),[he,J]=k.useState(!1),[Z,ve]=k.useState(null),[ke,Q]=k.useState(!1),[pe,R]=k.useState("");k.useEffect(()=>{let ue=!0,ae=null;return m("loading"),mu(t.id).then(me=>{if(ue){if(!me){m("missing");return}s(new TextDecoder("utf-8").decode(me)),ae=URL.createObjectURL(new Blob([me],{type:"text/markdown;charset=utf-8"})),f(ae),m("ready")}}).catch(()=>{ue&&m("error")}),()=>{ue=!1,ae&&URL.revokeObjectURL(ae)}},[t.id]),k.useEffect(()=>{const ue=()=>{const ae=window.getSelection(),me=n.current;if(!ae||ae.isCollapsed||!me){v(""),S(0);return}if(!me.contains(ae.anchorNode)||!me.contains(ae.focusNode)){v(""),S(0);return}const Se=ae.getRangeAt(0),xe=ae.toString(),Ue=xe.length-xe.trimStart().length,Fe=xe.trim().slice(0,4e3),Ke=document.createRange();Ke.selectNodeContents(me),Ke.setEnd(Se.startContainer,Se.startOffset);const ot=Ke.toString().length+Ue;v(Fe),S(wD(me.textContent,Fe,ot))};return document.addEventListener("selectionchange",ue),()=>document.removeEventListener("selectionchange",ue)},[]);const F=()=>{p&&(E(p),A(w),L(!0),R(""))},Y=async()=>{if(_){if(!C||!j.trim())return;V(ae=>[...ae,{selection:C,comment:j.trim(),occurrence:P}]),I(""),L(!1),R("Comment added to review");return}const ue=vD(C,j);if(!(!ue||!j.trim()||K)){B(!0),R("");try{await e.onSendText(ue,t.id||void 0),I(""),L(!1),R("Feedback sent")}catch(ae){R(`Send failed: ${String(ae)}`)}finally{B(!1)}}},M=async()=>{if($.length===0||he)return;const ue=TD(i,$);J(!0),R("");try{e.onSendFile?await e.onSendFile({filename:xD(t.filename),mime:"text/markdown",bytes:new TextEncoder().encode(ue)},t.id||void 0):await e.onSendText(ue,t.id||void 0),V([]),N(!1),R("Review submitted")}catch(ae){R(`Review send failed: ${String(ae)}`)}finally{J(!1)}},se=async()=>{if(!(!Z||!e.onSendFile||ke)){Q(!0),R("");try{await e.onSendFile(Z,t.id||void 0),ve(null),R("Voice feedback sent")}catch(ue){R(`Voice send failed: ${String(ue)}`)}finally{Q(!1)}}};return y.jsx(ra,{title:t.filename,description:"Markdown preview · select text to send precise feedback",onClose:e.onClose,wide:!0,className:"markdown-modal"+(a?" markdown-reader-fullscreen":""),children:y.jsxs("div",{className:"markdown-preview",children:[y.jsxs("div",{className:"markdown-review-toolbar",children:[y.jsxs("button",{className:"btn sm",type:"button","aria-label":a?"Exit reader fullscreen":"View reader fullscreen","aria-pressed":a,onMouseDown:ue=>ue.preventDefault(),onClick:()=>l(ue=>!ue),children:[y.jsx(be,{name:"maximize",size:14}),a?"Exit fullscreen":"Fullscreen"]}),y.jsxs("button",{className:"btn sm",disabled:!p,onMouseDown:ue=>ue.preventDefault(),onClick:F,children:[y.jsx(be,{name:"reply",size:14}),_?"Add review comment":"Quick message",p?` (${p.length})`:""]}),_?y.jsx("button",{className:"btn sm",onClick:()=>{N(!1),V([]),L(!1),R("Review discarded")},children:"Cancel review"}):y.jsxs("button",{className:"btn sm",onClick:()=>{N(!0),V([]),R("Review started — select passages to add comments")},children:[y.jsx(be,{name:"edit",size:14}),"Start review"]}),c&&y.jsxs("a",{className:"btn sm",href:c,download:t.filename,children:[y.jsx(be,{name:"download",size:14}),"Download"]}),e.onSendFile&&y.jsx(H1,{disabled:!!Z||ke,onReady:ve,onError:R}),y.jsx("span",{className:"markdown-review-hint",children:p?"Selection ready for feedback":"Highlight any passage to comment on it"})]}),T&&y.jsxs("div",{className:"markdown-feedback",children:[y.jsx("blockquote",{children:C}),y.jsx("textarea",{className:"field",rows:3,autoFocus:!0,placeholder:"What should change?",value:j,onChange:ue=>I(ue.target.value)}),y.jsxs("div",{className:"markdown-feedback-actions",children:[y.jsx("button",{className:"btn sm",onClick:()=>L(!1),children:"Cancel"}),y.jsxs("button",{className:"btn sm primary",disabled:!j.trim()||K,onClick:()=>void Y(),children:[y.jsx(be,{name:"send",size:14}),_?"Add to review":K?"Sending…":"Send feedback"]})]})]}),_&&y.jsxs("div",{className:"markdown-review-draft",children:[y.jsxs("div",{className:"markdown-review-draft-head",children:[y.jsxs("strong",{children:["Review · ",$.length," comment",$.length===1?"":"s"]}),y.jsxs("button",{className:"btn sm primary",disabled:$.length===0||he,onClick:()=>void M(),children:[y.jsx(be,{name:"send",size:14}),he?"Submitting…":"Submit review"]})]}),$.map((ue,ae)=>y.jsxs("div",{className:"markdown-review-comment",children:[y.jsx("span",{children:ae+1}),y.jsxs("div",{children:[y.jsx("blockquote",{children:ue.selection}),y.jsx("p",{children:ue.comment})]}),y.jsx("button",{className:"icon-btn",title:"Remove comment",onClick:()=>V(me=>me.filter((Se,xe)=>xe!==ae)),children:y.jsx(be,{name:"close",size:14})})]},`${ae}-${ue.selection.slice(0,24)}`))]}),Z&&y.jsx(W1,{att:Z,sending:ke,onSend:()=>void se(),onDiscard:()=>ve(null)}),pe&&y.jsx("div",{className:"markdown-review-status",role:"status",children:pe}),y.jsxs("div",{className:"markdown-preview-scroll",children:[h==="loading"&&y.jsx("div",{className:"markdown-empty",children:"Loading preview…"}),h==="missing"&&y.jsx("div",{className:"markdown-empty",children:"This file is available on the original device only."}),h==="error"&&y.jsx("div",{className:"markdown-empty",children:"The file could not be opened."}),h==="ready"&&y.jsx(XF,{markdown:i,contentRef:n})]})]})})}function hS(e){const{rec:t}=e,[n,i]=k.useState(null),[s,a]=k.useState(0),[l,c]=k.useState(!1),[f,h]=k.useState("loading");return k.useEffect(()=>{let m=!0,p=null;return h("loading"),mu(t.id).then(v=>{if(m){if(!v){h("missing");return}a(v.byteLength),p=URL.createObjectURL(new Blob([v],{type:qh(t.mime,t.filename)})),i(p),h("ready")}}).catch(()=>{m&&h("error")}),()=>{m=!1,p&&URL.revokeObjectURL(p)}},[t.id,t.mime,t.filename]),y.jsx(ra,{title:t.filename,description:"Transformed safe preview · external navigation disabled",onClose:e.onClose,wide:!0,className:"markdown-modal html-modal"+(l?" html-modal-fullscreen":""),children:y.jsxs("div",{className:"html-preview",children:[y.jsxs("div",{className:"html-preview-toolbar",children:[y.jsxs("span",{className:"html-preview-shield",children:[y.jsx(be,{name:"shield",size:14}),"Scripts, forms and network requests are blocked"]}),y.jsxs("span",{className:"html-preview-actions",children:[f==="ready"&&y.jsxs("button",{className:"btn sm",type:"button",title:"View HTML fullscreen","aria-label":"View HTML fullscreen",onClick:()=>c(!0),children:[y.jsx(be,{name:"maximize",size:14}),"Fullscreen"]}),n&&y.jsxs("a",{className:"btn sm",href:n,download:t.filename,children:[y.jsx(be,{name:"download",size:14}),"Download original",s?` · ${oi(s)}`:""]})]})]}),y.jsxs("div",{className:"html-preview-frame",children:[f==="loading"&&y.jsx("div",{className:"markdown-empty",children:"Loading preview…"}),f==="missing"&&y.jsx("div",{className:"markdown-empty",children:"This file is available on the original device only."}),f==="error"&&y.jsx("div",{className:"markdown-empty",children:"The file could not be opened."}),f==="ready"&&y.jsx("iframe",{className:"html-preview-iframe",title:`Sandboxed preview of ${t.filename}`,sandbox:PD,referrerPolicy:"no-referrer",src:`/api/html-preview/${encodeURIComponent(t.id)}`},t.id)]})]})})}function pS(e){const t=(n,i)=>{const{key:s}=n;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(s))return;n.preventDefault();const a=e.options.length-1,l=s==="Home"?0:s==="End"?a:s==="ArrowLeft"||s==="ArrowUp"?(i-1+e.options.length)%e.options.length:(i+1)%e.options.length,c=e.options[l];c&&(e.onChange(c.id),document.getElementById(`${e.idPrefix}-${c.id}`)?.focus())};return y.jsx("div",{className:e.className,role:"tablist","aria-label":e.label,children:e.options.map((n,i)=>y.jsxs("button",{id:`${e.idPrefix}-${n.id}`,type:"button",role:"tab","aria-selected":e.value===n.id,"aria-controls":e.panelId,tabIndex:e.value===n.id?0:-1,className:"tab"+(e.value===n.id?" active":""),onClick:()=>e.onChange(n.id),onKeyDown:s=>t(s,i),children:[n.label,n.count===void 0?null:y.jsxs(y.Fragment,{children:[" ",y.jsx("span",{children:n.count})]})]},n.id))})}function eh(e){const{message:t}=e,[n,i]=k.useState(null),[s,a]=k.useState(0),l=q0(t.wireId)??{id:t.wireId,dir:t.dir,filename:t.filename??"file",mime:t.mime??"application/octet-stream",size:s,date:t.date};k.useEffect(()=>{let h=!0,m=null;if(t.wireId)return mu(t.wireId).then(p=>{!h||!p||(a(p.byteLength),m=URL.createObjectURL(new Blob([p],{type:qh(l.mime,l.filename)})),i(m))}).catch(()=>{}),()=>{h=!1,m&&URL.revokeObjectURL(m)}},[t.wireId,l.mime,l.filename]);const c=Ld(t)==="photo",f=To(l.mime,l.filename);return y.jsxs("div",{className:"shared-media-item"+(c?" shared-photo-item":""),children:[y.jsxs("button",{className:"shared-media-jump",onClick:()=>e.onJump(e.messageKey),children:[c&&n?y.jsx("img",{src:n,alt:l.filename}):y.jsx("span",{className:"shared-media-icon",children:y.jsx(be,{name:f?"mic":"copy",size:18})}),y.jsxs("span",{className:"shared-media-copy",children:[y.jsx("strong",{children:c?l.filename||"Photo":f?"Voice message":l.filename}),y.jsxs("span",{children:[e.versionLabel?`${e.versionLabel} · `:"",Mi(l.date),s?` · ${oi(s)}`:""]})]})]}),y.jsxs("span",{className:"shared-media-actions",children:[_1(l.filename)&&n&&y.jsx("button",{className:"icon-btn",title:"Preview markdown",onClick:()=>e.onPreview(l),children:y.jsx(be,{name:"monitor",size:16})}),Zs(l.filename,l.mime)&&n&&y.jsx("button",{className:"icon-btn",title:"Preview HTML",onClick:()=>e.onPreview(l),children:y.jsx(be,{name:"monitor",size:16})}),y.jsx("a",{className:"icon-btn"+(n?"":" disabled"),href:n??void 0,download:l.filename,title:"Download",children:y.jsx(be,{name:"download",size:16})})]})]})}function YF(e){const[t,n]=k.useState(!1);if(e.versions.length===1){const i=e.versions[0];return y.jsx(eh,{message:i.message,messageKey:i.key,onJump:e.onJump,onPreview:e.onPreview})}return y.jsxs("div",{className:"file-version-stack"+(t?" expanded":""),children:[y.jsxs("button",{className:"file-version-stack-head",onClick:()=>n(i=>!i),children:[y.jsx("span",{className:"shared-media-icon",children:y.jsx(be,{name:"copy",size:18})}),y.jsxs("span",{className:"shared-media-copy",children:[y.jsx("strong",{children:e.filename}),y.jsxs("span",{children:[e.versions.length," versions · newest ",Mi(e.versions[0].message.date)]})]}),y.jsx(be,{name:t?"chevronDown":"chevron",size:16})]}),t&&y.jsx("div",{className:"file-version-stack-list",children:e.versions.map((i,s)=>y.jsx(eh,{message:i.message,messageKey:i.key,versionLabel:`Version ${e.versions.length-s}`,onJump:e.onJump,onPreview:e.onPreview},i.key))})]})}function GF(e){const[t,n]=k.useState("photo"),i=e.messages.map((h,m)=>({message:h,key:h.wireId||`${h.date}-${(e.indexOffset??0)+m}`})),s=i.filter(({message:h})=>Ld(h)==="photo"),a=i.filter(({message:h})=>Ld(h)==="file"),l=SD(a),c=i.flatMap(({message:h,key:m})=>h.kind==="file"?[]:kD(h.text).map(p=>({url:p,message:h,key:m}))),f=[{id:"photo",label:"Photos",count:s.length},{id:"file",label:"Files",count:a.length},{id:"link",label:"Links",count:c.length}];return y.jsx(ra,{title:"Shared media",description:"Photos, files, and links from this conversation",onClose:e.onClose,wide:!0,className:"shared-media-modal",tabs:y.jsx(pS,{className:"shared-media-tabs",label:"Shared media type",options:f,value:t,onChange:n,idPrefix:"shared-media-tab",panelId:"shared-media-panel"}),children:y.jsxs("div",{id:"shared-media-panel",role:"tabpanel","aria-labelledby":`shared-media-tab-${t}`,className:"shared-media-list"+(t==="photo"?" photos":""),children:[t==="photo"&&s.map(h=>y.jsx(eh,{message:h.message,messageKey:h.key,onJump:e.onJump,onPreview:e.onPreview},h.key)),t==="file"&&l.map(h=>y.jsx(YF,{filename:h.filename,versions:h.versions,onJump:e.onJump,onPreview:e.onPreview},h.filename)),t==="link"&&c.map((h,m)=>y.jsxs("div",{className:"shared-media-item",children:[y.jsxs("a",{className:"shared-media-jump",href:h.url,target:"_blank",rel:"noreferrer",children:[y.jsx("span",{className:"shared-media-icon",children:y.jsx(be,{name:"link",size:18})}),y.jsxs("span",{className:"shared-media-copy",children:[y.jsx("strong",{children:h.url}),y.jsx("span",{children:Mi(h.message.date)})]})]}),y.jsx("button",{className:"icon-btn",title:"Jump to message",onClick:()=>e.onJump(h.key),children:y.jsx(be,{name:"reply",size:16})})]},`${h.key}-${h.url}-${m}`)),(t==="photo"&&s.length===0||t==="file"&&a.length===0||t==="link"&&c.length===0)&&y.jsxs("div",{className:"markdown-empty",children:["No ",t==="photo"?"photos":`${t}s`," in this chat yet."]})]})})}const QF=Object.freeze(["image/avif","image/bmp","image/heic","image/heif","image/jpeg","image/jpg","image/png","image/webp"]),JF=/\.(avif|bmp|heic|heif|jpe?g|png|webp)$/i;function mS(e,t=""){return QF.includes(String(e??"").toLowerCase())||JF.test(String(t??""))}function ZF(e){return`${(String(e||"photo").trim()||"photo").replace(/\.[^./\\]+$/,"")||"photo"}.jpg`}function ez(e,t,n){const i=Math.max(1,Number(e)||1),s=Math.max(1,Number(t)||1),a=Math.max(1,Number(n)||1),l=Math.min(1,a/Math.max(i,s));return{width:Math.max(1,Math.round(i*l)),height:Math.max(1,Math.round(s*l))}}const tz=2048,nz=640,rz=.82,iz=[.84,.7,.56,.44],oz=.94;function sz(e){return new Promise((t,n)=>{const i=URL.createObjectURL(e),s=new Image,a=()=>URL.revokeObjectURL(i);s.onload=()=>t({image:s,release:a}),s.onerror=()=>{a(),n(new Error("This browser could not decode the selected image."))},s.src=i})}function az(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 lz(e,t){if(!mS(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*oz)),{image:i,release:s}=await sz(e),a=document.createElement("canvas"),l=a.getContext("2d",{alpha:!1});if(!l)throw s(),new Error("Photo optimization is unavailable in this browser.");try{let c=Math.min(tz,Math.max(i.naturalWidth,i.naturalHeight));for(;c>=nz;){const f=ez(i.naturalWidth,i.naturalHeight,c);a.width=f.width,a.height=f.height,l.fillStyle="#fff",l.fillRect(0,0,a.width,a.height),l.drawImage(i,0,0,a.width,a.height);for(const h of iz){const m=await az(a,h);if(m.size<=n)return{filename:ZF(e.name),mime:"image/jpeg",bytes:new Uint8Array(await m.arrayBuffer()),width:a.width,height:a.height,originalSize:e.size}}c=Math.floor(c*rz)}}finally{s(),a.width=1,a.height=1}throw new Error("The photo is still too large after optimization.")}const uz=5e4,cz=new Set(["http:","https:","mailto:"]);function gS(e){if(!(!e||e!==e.trim()||/[\u0000-\u001f\u007f]/u.test(e)))try{const t=new URL(e);return cz.has(t.protocol.toLowerCase())?e:void 0}catch{return}}function yS(e){const t="language-";return e?.startsWith(t)&&e.slice(t.length)||void 0}function Dx(e){return e.split(/(\n[ \t]*\n)/).map(t=>{if(/^\n[ \t]*\n$/.test(t))return t;const n=t.split(`
324
+ `),i=n.filter(l=>l.trim().length>0);if(i.length===0)return t;const s=i.map(l=>l.match(/^[ \t]+/)?.[0]??"");if(s.some(l=>l.length===0))return t;const a=Math.min(...s.map(l=>l.length));return n.map(l=>l.trim().length>0?l.slice(a):l).join(`
325
+ `)}).join("")}function fz(e){const t=[];let n=[],i="";for(const s of e.split(`
326
+ `))if(i){n.push(s);const a=/^ {0,3}(`+|~+)[ \t]*$/.exec(s);a&&a[1][0]===i[0]&&a[1].length>=i.length&&(t.push(n.join(`
327
+ `)),n=[],i="")}else{const a=/^ {0,3}(`{3,}|~{3,})(.*)$/.exec(s);a&&!(a[1][0]==="`"&&a[2].includes("`"))?(n.length&&t.push(Dx(n.join(`
328
+ `))),n=[s],i=a[1]):n.push(s)}return n.length&&t.push(i?n.join(`
329
+ `):Dx(n.join(`
330
+ `))),t.join(`
331
+ `)}function dz({children:e}){const t=k.isValidElement(e)?e:null,n=yS(t?.props.className);return n==="mermaid"?y.jsx(fS,{source:String(t?.props.children??"").replace(/\n$/,"")}):y.jsxs("div",{className:"message-code-block","data-language":n||void 0,children:[n&&y.jsx("div",{className:"message-code-language",children:n}),y.jsx("pre",{children:e})]})}const hz=[hk],pz={a:({node:e,children:t,href:n,...i})=>{const s=gS(n);return s?y.jsx("a",{...i,href:s,target:"_blank",rel:"noopener noreferrer",children:t}):y.jsx("span",{className:"message-link-blocked",children:t})},img:({alt:e})=>y.jsxs("span",{className:"message-image-placeholder",children:["[image: ",e||"remote image blocked","]"]}),pre:dz,code:({node:e,className:t,children:n,...i})=>y.jsx("code",{className:t,"data-language":yS(t),...i,children:n})},Lx=k.memo(function({text:t,className:n="bubble-text message-markdown"}){return t.length>uz?y.jsx("div",{className:`${n} message-markdown-plaintext`,"data-render-mode":"plaintext",children:t}):y.jsx("div",{className:n,"data-render-mode":"markdown",children:y.jsx(dk,{remarkPlugins:hz,components:pz,urlTransform:i=>gS(i)??"",children:fz(t)})})}),mz=new Set(["type","title","description","default","enum","const","minimum","maximum","minLength","maxLength","pattern","properties","required","items","minItems","maxItems","additionalProperties"]),_x=6,Ox=64,Fx=256,zx=256,Vx=12,Bx=2048,$x=64*1024;function vS(e){if(typeof e!="string")return"pattern must be a string";if(e.length>Fx)return`pattern exceeds ${Fx} characters`;if(!e.startsWith("^")||!e.endsWith("$"))return"pattern must be anchored with ^ and $";let t=!1,n=!1;for(let i=0;i<e.length;i++){const s=e[i];if(s==="\\"){if(++i>=e.length)return"pattern has invalid syntax";if(/\d/.test(e[i])||e[i]==="k")return"pattern backreferences are not supported";continue}if(t){s==="]"&&(t=!1);continue}if(s==="["){t=!0;continue}if("()?*+|".includes(s))return"pattern must use only bounded, non-grouped expressions";if(s==="{"){const a=/^\{(\d+)(?:,(\d+))?\}/.exec(e.slice(i));if(!a)return"pattern has an invalid or unbounded repetition";const l=Number(a[1]),c=Number(a[2]??a[1]);if(l>c||c>zx)return`pattern repetition must not exceed ${zx}`;if(l!==c){const f=e.slice(i+a[0].length);if(n||f!==""&&f!=="$")return"a variable pattern repetition is supported only once, at the end";n=!0}i+=a[0].length-1}}if(t)return"pattern has invalid syntax";try{new RegExp(e)}catch{return"pattern has invalid syntax"}return null}function th(e,t=0,n={value:0}){if(t>_x)return`Schema depth exceeds ${_x}`;if(n.value++,n.value>Ox)return`Schema exceeds ${Ox} controls`;const i=Object.keys(e).find(a=>!mz.has(a));if(i)return`Unsupported JSON Schema keyword: ${i}`;if(e.title!==void 0&&typeof e.title!="string")return"title must be a string";if(e.description!==void 0&&typeof e.description!="string")return"description must be a string";if(e.enum!==void 0&&(!Array.isArray(e.enum)||e.enum.length===0))return"enum must be a non-empty array";const s=e.type;if(s===void 0&&e.enum===void 0&&!Object.hasOwn(e,"const"))return"An explicit type, enum, or const is required";if(s!==void 0&&!["object","array","string","number","integer","boolean","null"].includes(String(s)))return`Unsupported JSON Schema type: ${String(s)}`;for(const a of["minimum","maximum"])if(e[a]!==void 0&&(typeof e[a]!="number"||!Number.isFinite(e[a])))return`${a} must be a finite number`;for(const a of["minLength","maxLength","minItems","maxItems"])if(e[a]!==void 0&&(typeof e[a]!="number"||!Number.isInteger(e[a])||e[a]<0))return`${a} must be a non-negative integer`;if((e.minimum!==void 0||e.maximum!==void 0)&&s!=="number"&&s!=="integer")return"minimum/maximum require a numeric type";if((e.minLength!==void 0||e.maxLength!==void 0)&&s!=="string")return"minLength/maxLength require string type";if(e.pattern!==void 0){if(s!=="string")return"pattern requires a string type";const a=vS(e.pattern);if(a)return a}if((e.minItems!==void 0||e.maxItems!==void 0)&&s!=="array")return"minItems/maxItems require array type";if(e.additionalProperties!==void 0){if(s!=="object")return"additionalProperties requires an object type";if(e.additionalProperties===!0)return"additionalProperties: true is not supported";if(e.additionalProperties!==!1)return e.additionalProperties&&typeof e.additionalProperties=="object"&&!Array.isArray(e.additionalProperties)?"Schema-valued additionalProperties is not supported":"additionalProperties must be false"}if(s==="object"){const a=e.properties;if(a!==void 0&&(!a||typeof a!="object"||Array.isArray(a)))return"properties must be an object";if(e.required!==void 0&&(!Array.isArray(e.required)||e.required.some(l=>typeof l!="string")))return"required must be an array of property names";for(const l of Object.values(a??{})){if(!l||typeof l!="object"||Array.isArray(l))return"property schema must be an object";const c=th(l,t+1,n);if(c)return c}}return s==="array"&&e.items!==void 0?!e.items||typeof e.items!="object"||Array.isArray(e.items)?"items must be one schema object":th(e.items,t+1,n):null}function ou(e,t){if(e===t)return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((s,a)=>ou(s,t[a]));const n=Object.keys(e).sort(),i=Object.keys(t).sort();return n.length===i.length&&n.every((s,a)=>s===i[a]&&ou(e[s],t[s]))}function gz(e,t){let n=0;const i=(a,l)=>{if(l>Vx)return`${t} exceeds depth ${Vx}`;if(n++,n>Bx)return`${t} exceeds ${Bx} JSON values`;if(a===null||typeof a!="object")return null;for(const c of Array.isArray(a)?a:Object.values(a)){const f=i(c,l+1);if(f)return f}return null},s=i(e,0);return s||(new TextEncoder().encode(JSON.stringify(e)).byteLength>$x?`${t} exceeds ${$x} UTF-8 bytes`:null)}function nh(e,t,n){if(Object.hasOwn(e,"const")&&!ou(e.const,t))return`${n} must use the fixed value`;if(Array.isArray(e.enum)&&!e.enum.some(i=>ou(i,t)))return`${n} is not an allowed value`;if(e.type==="null")return t===null?null:`${n} must be null`;if(e.type==="boolean")return typeof t=="boolean"?null:`${n} must be boolean`;if(e.type==="string"){if(typeof t!="string")return`${n} must be text`;if(typeof e.minLength=="number"&&t.length<e.minLength)return`${n} is too short`;if(typeof e.maxLength=="number"&&t.length>e.maxLength)return`${n} is too long`;if(e.pattern!==void 0){const i=vS(e.pattern);if(i)return`${n} cannot be validated safely: ${i}`;if(!new RegExp(e.pattern).test(t))return`${n} does not match the required format`}return null}if(e.type==="number"||e.type==="integer")return typeof t!="number"||!Number.isFinite(t)?`${n} must be a finite number`:e.type==="integer"&&!Number.isInteger(t)?`${n} must be an integer`:typeof e.minimum=="number"&&t<e.minimum?`${n} is below the minimum`:typeof e.maximum=="number"&&t>e.maximum?`${n} is above the maximum`:null;if(e.type==="array"){if(!Array.isArray(t))return`${n} must be an array`;if(typeof e.minItems=="number"&&t.length<e.minItems)return`${n} has too few items`;if(typeof e.maxItems=="number"&&t.length>e.maxItems)return`${n} has too many items`;if(e.items&&typeof e.items=="object"&&!Array.isArray(e.items))for(let i=0;i<t.length;i++){const s=nh(e.items,t[i],`${n}[${i}]`);if(s)return s}return null}if(e.type==="object"){if(!t||typeof t!="object"||Array.isArray(t))return`${n} must be an object`;const i=e.properties??{};for(const a of Object.keys(t))if(e.additionalProperties===!1&&!Object.hasOwn(i,a))return`${n}.${a||"(empty key)"} is not declared by the schema`;const s=Array.isArray(e.required)?e.required:[];for(const a of s)if(!Object.hasOwn(t,a))return`${n}.${a||"(empty key)"} is required`;for(const[a,l]of Object.entries(i)){if(!Object.hasOwn(t,a))continue;const c=nh(l,t[a],`${n}.${a||"(empty key)"}`);if(c)return c}}return null}function su(e,t,n="Arguments"){return gz(t,n)??nh(e,t,n)}function bo(e){if(Object.hasOwn(e,"const"))return e.const;if(e.default!==void 0)return e.default;if(Array.isArray(e.enum)&&e.enum.length)return e.enum[0];if(e.type==="object"){const t=Object.create(null),n=new Set(Array.isArray(e.required)?e.required.filter(i=>typeof i=="string"):[]);for(const[i,s]of Object.entries(e.properties??{})){const a=s;(n.has(i)||a.default!==void 0)&&(t[i]=bo(a))}return t}return e.type==="array"?[]:e.type==="boolean"?!1:e.type==="number"||e.type==="integer"?0:e.type==="null"?null:""}function Ux(e,t){return typeof e.title=="string"&&e.title?e.title:t||"(empty key)"}function Wx(e,t,n){const i=Object.create(null);for(const[s,a]of Object.entries(e))i[s]=a;return i[t]=n,i}function yz(e,t){const n=Object.create(null);for(const[i,s]of Object.entries(e))i!==t&&(n[i]=s);return n}function vz(e){const{schema:t,label:n,path:i,value:s,required:a,description:l,onChange:c,onValidityChange:f}=e,h=k.useId().replace(/[^a-zA-Z0-9_-]/g,""),p=`command-array-${i.replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"root"}-${h}-help`,[v,w]=k.useState(()=>JSON.stringify(s,null,2)),[S,C]=k.useState(null),E=k.useRef(JSON.stringify(s));k.useEffect(()=>{const A=JSON.stringify(s);A!==E.current&&(E.current=A,w(JSON.stringify(s,null,2)),C(null),f(i,null))},[f,i,s]),k.useEffect(()=>()=>f(i,null),[f,i]);const P=A=>{w(A);let T;try{T=JSON.parse(A)}catch{const j=`${n} must contain valid JSON`;C(j),f(i,j);return}if(!Array.isArray(T)){const j=`${n} must be a JSON array`;C(j),f(i,j);return}const L=su(t,T,n);C(L),f(i,L),E.current=JSON.stringify(T),c(T)};return y.jsxs("label",{className:"command-field",children:[y.jsxs("span",{children:[n,a?" *":""]}),y.jsx("textarea",{value:v,rows:3,"aria-describedby":p,"aria-invalid":S?"true":void 0,onChange:A=>P(A.target.value)}),y.jsx("small",{id:p,children:l??"JSON array"}),S&&y.jsx("span",{className:"command-field-error",role:"alert",children:S})]})}function xz(e){const{schema:t,label:n,path:i,value:s,required:a,description:l,numeric:c,onChange:f,onValidityChange:h}=e,m=su(t,s,n);return k.useEffect(()=>(h(i,m),()=>h(i,null)),[m,h,i]),y.jsxs("label",{className:"command-field",children:[y.jsxs("span",{children:[n,a?" *":""]}),y.jsx("input",{type:c?"number":"text",value:String(s??""),min:typeof t.minimum=="number"?t.minimum:void 0,max:typeof t.maximum=="number"?t.maximum:void 0,minLength:typeof t.minLength=="number"?t.minLength:void 0,maxLength:typeof t.maxLength=="number"?t.maxLength:void 0,step:t.type==="integer"?1:c?"any":void 0,required:a,"aria-invalid":m?"true":void 0,onChange:p=>f(c?Number(p.target.value):p.target.value)}),l&&y.jsx("small",{children:l}),m&&y.jsx("span",{className:"command-field-error",role:"alert",children:m})]})}function xS(e){const{schema:t,name:n,path:i,value:s,required:a,onChange:l,onValidityChange:c}=e,f=Ux(t,n),h=typeof t.description=="string"?t.description:void 0;if(Object.hasOwn(t,"const"))return y.jsxs("div",{className:"command-field",children:[y.jsxs("span",{children:[f,a?" *":""]}),y.jsxs("small",{children:["Fixed value: ",JSON.stringify(t.const)]})]});if(Array.isArray(t.enum))return y.jsxs("label",{className:"command-field",children:[y.jsxs("span",{children:[f,a?" *":""]}),y.jsx("select",{value:JSON.stringify(s),onChange:p=>l(JSON.parse(p.target.value)),children:t.enum.map((p,v)=>y.jsx("option",{value:JSON.stringify(p),children:String(p)},v))}),h&&y.jsx("small",{children:h})]});if(t.type==="object"){const p=s&&typeof s=="object"&&!Array.isArray(s)?s:{},v=new Set(Array.isArray(t.required)?t.required.filter(w=>typeof w=="string"):[]);return y.jsxs("fieldset",{className:"command-object",children:[y.jsx("legend",{children:f}),h&&y.jsx("p",{children:h}),Object.entries(t.properties??{}).map(([w,S])=>{const C=S,E=Object.hasOwn(p,w),P=Ux(C,w),A=`${i}.${w||"(empty key)"}`;return!E&&!v.has(w)?y.jsxs("button",{type:"button",className:"linkbtn command-property-add",onClick:()=>l(Wx(p,w,bo(C))),children:["Add ",P]},w):y.jsxs("div",{className:"command-property",children:[y.jsx(xS,{schema:C,name:w,path:A,value:E?p[w]:bo(C),required:v.has(w),onValidityChange:c,onChange:T=>l(Wx(p,w,T))}),!v.has(w)&&y.jsx("button",{type:"button",className:"linkbtn command-property-remove","aria-label":`Remove ${P}`,onClick:()=>l(yz(p,w)),children:"Remove"})]},w)})]})}if(t.type==="array")return y.jsx(vz,{schema:t,label:f,path:i,value:s,required:a,description:h,onChange:l,onValidityChange:c});if(t.type==="boolean")return y.jsxs("label",{className:"command-check",children:[y.jsx("input",{type:"checkbox",checked:s===!0,onChange:p=>l(p.target.checked)})," ",f]});if(t.type==="null")return y.jsxs("div",{className:"command-field",children:[y.jsx("span",{children:f}),y.jsx("small",{children:"Null value"})]});const m=t.type==="number"||t.type==="integer";return y.jsx(xz,{schema:t,label:f,path:i,value:s,required:a,description:h,numeric:m,onChange:l,onValidityChange:c})}function wz(e){const t=e.catalog.commands.find(T=>T.name===e.initialCommandName)??e.catalog.commands[0],[n,i]=k.useState(t?.name??""),s=e.catalog.commands.find(T=>T.name===n)??t,a=k.useMemo(()=>s?th(s.input_schema):null,[s]),[l,c]=k.useState(()=>t?bo(t.input_schema):null),[f,h]=k.useState(""),[m,p]=k.useState("idle"),[v,w]=k.useState({}),S=k.useRef(0),C=k.useCallback((T,L)=>{w(j=>{if(L===null){if(!Object.hasOwn(j,T))return j;const I={...j};return delete I[T],I}return j[T]===L?j:{...j,[T]:L}})},[]),E=T=>{const L=e.catalog.commands.find(j=>j.name===T);i(T),c(L?bo(L.input_schema):null),h(""),p("idle"),w({})},P=T=>{if(T.preventDefault(),!s||a||e.busy)return;const j=Object.values(v)[0]??su(s.input_schema,l);if(j){h(`Validation denied: ${j}`),p("error");return}const I=++S.current,K=s,B=l;c(bo(K.input_schema)),w({}),h(`Sending ${K.name}…`),p("pending"),e.onSend(K,B,crypto.randomUUID(),e.catalog.fingerprint).then(_=>{S.current===I&&(_.status==="failed"?(h(`${K.name} was refused before delivery.`),p("error")):_.status==="pending"?(h(`${K.name} delivery is pending.`),p("warning")):_.status==="indeterminate"||!_.wire_id?(h(`${K.name} delivery could not be confirmed.`),p("indeterminate")):(h(`${K.name} sent. Its result will appear in the conversation.`),p("success")))}).catch(()=>{S.current===I&&(h(`${K.name} could not be sent. You can try it again.`),p("error"))})},A=s&&!a?su(s.input_schema,l):null;return y.jsxs("form",{className:"command-panel","aria-label":"Send a typed command",onSubmit:P,onKeyDown:T=>{T.key==="Escape"&&e.onClose()},children:[y.jsxs("div",{className:"command-panel-head",children:[y.jsxs("div",{className:"command-panel-recipient",children:[y.jsxs("strong",{children:["Commands for ",e.recipientName]}),y.jsxs("span",{className:"mono",title:e.catalog.recipient_cid,children:[e.catalog.recipient_cid.slice(0,12),"…"]})]}),y.jsx("button",{type:"button",className:"linkbtn",onClick:e.onRefresh,children:"Refresh"}),y.jsx("button",{type:"button",className:"icon-btn","aria-label":"Close commands",onClick:e.onClose,children:"×"})]}),e.catalog.commands.length===0?y.jsx("p",{role:"status",children:"This recipient does not advertise commands."}):y.jsxs(y.Fragment,{children:[y.jsxs("label",{className:"command-field",children:[y.jsx("span",{children:"Command"}),y.jsx("select",{autoFocus:!0,value:n,onChange:T=>E(T.target.value),children:e.catalog.commands.map(T=>y.jsx("option",{value:T.name,children:T.name},T.name))})]}),s?.description&&y.jsx("p",{children:s.description}),a?y.jsxs("div",{className:"banner error",role:"alert",children:["Cannot render this command safely: ",a]}):s&&y.jsx(xS,{schema:s.input_schema,name:"Arguments",path:"Arguments",value:l,onChange:c,onValidityChange:C}),s&&y.jsx("button",{className:"btn primary",disabled:!!a||e.busy||!!A||Object.keys(v).length>0,children:"Send command"}),y.jsx("div",{className:`command-status ${m}`,"data-state":m,role:"status","aria-live":"polite",children:f})]})]})}const Ts={type:"spring",stiffness:430,damping:38,mass:.72},Hx=10,wS=56,kz=18,Sz=650;function bz(e,t){return Math.abs(e)<Hx&&Math.abs(t)<Hx?"pending":Math.abs(e)>Math.abs(t)&&e>0?"drag":"reject"}function Cz(e){const t=e.at(-1),n=t?e.slice(0,-1).reverse().find(i=>i.x!==t.x&&t.time-i.time<=100):void 0;return n&&t&&t.time>n.time?(t.x-n.x)/(t.time-n.time)*1e3:0}function Ez(e,t){const n=Cz(t);return n>=0&&(e>=wS||e>=kz&&n>=Sz)}const rh="ours.chats.listMode",Ds="recent";function kS(){try{return globalThis.localStorage}catch{return}}function Tz(e=kS()){try{return e?.getItem(rh)==="identity"?"identity":Ds}catch{return Ds}}function Pz(e,t=kS()){const n=e==="identity"?"identity":Ds;try{return t?.setItem(rh,n),t?.getItem(rh)===n?n:Ds}catch{return Ds}}function Hs(e){return typeof e=="string"?e:""}function au(e,t){const n=Hs(e),i=Hs(t),s=n.normalize().toLowerCase(),a=i.normalize().toLowerCase();return s<a?-1:s>a?1:n<i?-1:n>i?1:0}function Rz(e,t){const n=Jl(Hs(t.activityAt))-Jl(Hs(e.activityAt));if(n!==0)return n;const i=au(e.name,t.name);return i!==0?i:au(e.id,t.id)}function ih(e){return[...e].sort(Rz)}function Kx(e){return e.contacts.length>0?Jl(Hs(e.contacts[0].activityAt)):0}function Az(e,t){const n=new Map,i=[];for(const a of e){const l=a.root||(t?.[a.id]?a.id:null);if(!l){i.push(a);continue}const c=t?.[l]||{label:l,note:""};let f=n.get(l);f||(f={id:`root:${l}`,rootId:l,label:c.label,note:c.note,contacts:[]},n.set(l,f)),f.contacts.push(a)}const s=[...n.values()].map(a=>({...a,contacts:ih(a.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:ih(i)}),s.sort((a,l)=>{const c=Kx(l)-Kx(a);if(c!==0)return c;const f=au(a.label,l.label);return f!==0?f:au(a.id,l.id)})}const jz=15e3;function Yf(e){const{c:t,active:n,grouped:i}=e,[s,a]=k.useState(!1),l=async(h,m)=>{if(!(!h||s)){a(!0);try{const p=await h();requestAnimationFrame(()=>{p?document.getElementById("chat-list-title")?.focus():m.focus()})}finally{a(!1)}}},c=y.jsxs(y.Fragment,{children:[y.jsx("span",{className:"contact-avatar","aria-hidden":!0,children:t.initials}),y.jsxs("span",{className:"contact-copy",children:[y.jsxs("span",{className:"contact-row-topline",children:[y.jsx("span",{className:"contact-name",children:t.name}),t.when&&y.jsx("span",{className:"contact-time",children:t.when})]}),y.jsxs("span",{className:"contact-row-bottomline",children:[y.jsx("span",{className:"contact-last",children:t.last}),t.status==="pending"&&y.jsx("span",{className:"chip",children:"pending approval"}),!!t.unread&&y.jsx("span",{className:"contact-unread",children:t.unread})]})]}),t.status==="pending"&&y.jsxs("span",{className:"pending-actions",role:"group","aria-label":`Decide whether to accept ${t.name}`,children:[y.jsx("button",{type:"button",className:"linkbtn",disabled:s,onClick:h=>void l(e.onApprove,h.currentTarget),children:"Approve"}),y.jsx("button",{type:"button",className:"linkbtn quiet",disabled:s,onClick:h=>void l(e.onReject,h.currentTarget),children:"Reject"})]}),n&&y.jsx(ko.span,{className:"contact-active-glow",layoutId:"active-contact",transition:Ts})]}),f="contact-row"+(n?" active":"")+(i?" grouped":"")+(t.status==="pending"?" pending":"");return t.status==="pending"?y.jsx("div",{className:f,children:c}):y.jsx(ko.button,{type:"button",className:f,onClick:e.onClick,children:c})}function Nz(e){const{contacts:t,roots:n,selected:i}=e,[s,a]=k.useState(""),l=k.useRef(null),c=k.useRef(null),[f,h]=k.useState(()=>Tz()),m=_=>_.name.toLowerCase().includes(s.toLowerCase()),p=t.filter(_=>_.status!=="pending"&&m(_)),v=t.filter(_=>_.status==="pending"&&m(_)),w=ih(p),S=Az(p,n),C=p.length===0&&v.length===0,E=_=>{h(Pz(_))},P=[{id:"recent",label:"Recent"},{id:"identity",label:"By identity"}],A=k.useRef(null),T=k.useRef({id:-1,x0:0,y0:0,mode:"idle"}),L=k.useRef(!1),j=(_,N)=>{const $=T.current;if($.id!==_)return;const V=A.current;if(N&&$.mode==="drag"&&V){const he=parseFloat(V.style.getPropertyValue("--mode-drag-x"))||0,J=Math.max(0,(V.clientWidth-8)/2);E(he>=J/2?"identity":"recent"),L.current=!0,window.setTimeout(()=>{L.current=!1},0)}T.current={id:-1,x0:0,y0:0,mode:"idle"},V?.hasPointerCapture?.(_)&&V.releasePointerCapture(_),V?.classList.remove("dragging"),V?.style.removeProperty("--mode-drag-x")},I=_=>{!_.isPrimary||T.current.id!==-1||(T.current={id:_.pointerId,x0:_.clientX,y0:_.clientY,mode:"pending"})},K=_=>{const N=T.current;if(N.id!==_.pointerId||N.mode==="idle")return;const $=_.clientX-N.x0,V=_.clientY-N.y0;if(N.mode==="pending"){if(Math.abs($)<10&&Math.abs(V)<10)return;if(Math.abs(V)>Math.abs($)){j(_.pointerId,!1);return}N.mode="drag",_.currentTarget.setPointerCapture?.(_.pointerId),_.currentTarget.classList.add("dragging")}_.preventDefault();const he=Math.max(0,(_.currentTarget.clientWidth-8)/2),J=f==="identity"?he:0;_.currentTarget.style.setProperty("--mode-drag-x",`${Math.min(he,Math.max(0,J+$))}px`)},B=(_,N)=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(_.key))return;_.preventDefault();const V=_.key==="Home"?"recent":_.key==="End"||N==="recent"?"identity":"recent";E(V),document.getElementById(`conversation-list-${V}`)?.focus()};return k.useLayoutEffect(()=>{const _=l.current,N=c.current;if(!_||!N)return;const $=()=>_.style.setProperty("--list-bottom-chrome-height",`${N.getBoundingClientRect().height}px`);$();const V=new ResizeObserver($);return V.observe(N),()=>{V.disconnect(),_.style.removeProperty("--list-bottom-chrome-height")}},[]),y.jsxs("div",{className:"listcol",ref:l,children:[y.jsxs("div",{className:"listcol-head",children:[y.jsxs("div",{className:"listcol-titlebar",children:[y.jsxs("h2",{id:"chat-list-title",className:"listcol-title messenger-lockup",tabIndex:-1,children:[y.jsx("span",{className:"messenger-brand-ours",children:"Ours"}),y.jsx("span",{className:"messenger-brand-product",children:"messenger"})]}),y.jsxs("div",{className:"listcol-actions",children:[y.jsx("button",{className:"btn icon-btn desktop-invite","aria-label":"Invite",title:"Invite",onClick:e.onInvite,children:y.jsx(be,{name:"invite",size:18})}),y.jsx("button",{className:"icon-btn","aria-label":"Settings",title:"Settings",onClick:e.onSettings,children:y.jsx(be,{name:"settings",size:18})})]})]}),y.jsx("div",{ref:A,className:"conversation-list-modes",role:"tablist","aria-label":"Conversation list layout","data-mode":f,onPointerDown:I,onPointerMove:K,onPointerUp:_=>j(_.pointerId,!0),onPointerCancel:_=>j(_.pointerId,!1),onLostPointerCapture:_=>j(_.pointerId,!1),children:P.map(_=>y.jsx("button",{id:`conversation-list-${_.id}`,type:"button",role:"tab","aria-selected":f===_.id,"aria-controls":"conversation-list-panel",tabIndex:f===_.id?0:-1,className:f===_.id?"active":"",onClick:N=>{if(L.current){N.preventDefault();return}E(_.id)},onKeyDown:N=>B(N,_.id),children:_.label},_.id))})]}),y.jsxs("div",{id:"conversation-list-panel",className:"listcol-scroll",role:"tabpanel","aria-labelledby":`conversation-list-${f}`,children:[f==="recent"&&w.length>0&&y.jsx("div",{className:"conversation-group",children:w.map(_=>y.jsx(Yf,{c:_,active:i===_.id,onClick:()=>e.onSelect(_.id)},_.id))}),f==="identity"&&S.map(_=>y.jsxs("div",{children:[y.jsxs("div",{className:"group-label",title:_.note,children:[_.rootId&&y.jsx(be,{name:"clusters"}),y.jsx("span",{children:_.label}),_.note&&y.jsxs("span",{className:"gl-note",children:["· ",_.note]})]}),y.jsx("div",{className:"conversation-group",children:_.contacts.map(N=>y.jsx(Yf,{c:N,grouped:_.rootId!==null,active:i===N.id,onClick:()=>e.onSelect(N.id)},N.id))})]},_.id)),v.length>0&&y.jsxs("div",{children:[y.jsx("div",{className:"group-label",children:y.jsx("span",{children:"Pending"})}),y.jsx("div",{className:"conversation-group",children:v.map(_=>y.jsx(Yf,{c:_,active:!1,onClick:()=>{},onApprove:()=>e.onApprovePending(_.id.slice(8)),onReject:()=>e.onRejectPending(_.id.slice(8))},_.id))})]}),C&&y.jsx("p",{className:"muted",style:{padding:"14px 10px",fontSize:"0.85rem"},children:"No contacts yet — share an invite to start."})]}),y.jsxs("div",{className:"list-bottom-chrome",ref:c,children:[y.jsxs("div",{className:"search adaptive-search",role:"search",children:[y.jsx("span",{className:"adaptive-search-icon","aria-hidden":!0,children:y.jsx(be,{name:"search"})}),y.jsx("input",{className:"field",placeholder:"Search people, agents, apps…",value:s,onChange:_=>a(_.target.value),onKeyDown:_=>{_.key==="Escape"&&(_.preventDefault(),a(""))}})]}),y.jsx("button",{type:"button",className:"icon-btn list-bottom-invite","aria-label":"Invite",title:"Invite",onClick:e.onInvite,children:y.jsx(be,{name:"invite",size:20})})]})]})}function Mz(e){const[t,n]=k.useState(!1),[i,s]=k.useState(e.contact.name),[a,l]=k.useState(!1),[c,f]=k.useState(null),h=k.useRef(!1);k.useEffect(()=>{const p=v=>{v.key!=="Escape"||a||c||t||(v.preventDefault(),e.onBack())};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[t,c,e.onBack,a]);const m=()=>{if(h.current)return;h.current=!0;const p=i.trim();p&&p!==e.contact.name?e.onRename(p):s(e.contact.name),n(!1)};return y.jsxs("div",{className:"detail contact-screen",children:[y.jsxs("div",{className:"detail-head contact-screen-head",children:[y.jsx("button",{type:"button",className:"icon-btn detail-back contact-back","aria-label":"Back to conversation",onClick:e.onBack,children:y.jsx(be,{name:"back"})}),y.jsx("strong",{children:"Contact"})]}),y.jsxs("div",{className:"contact-screen-scroll",children:[y.jsxs("section",{className:"contact-hero","aria-labelledby":"contact-screen-name",children:[y.jsx("div",{className:"avatar accent contact-avatar-large","aria-hidden":!0,children:e.contact.initials}),t?y.jsx("input",{id:"contact-screen-name",className:"field contact-name-input",value:i,autoFocus:!0,onChange:p=>s(p.target.value),onBlur:m,onKeyDown:p=>{p.key==="Enter"&&m(),p.key==="Escape"&&(h.current=!0,s(e.contact.name),n(!1))}}):y.jsx("h2",{id:"contact-screen-name",children:e.contact.name}),y.jsxs("p",{children:[y.jsx(be,{name:"lock",size:13})," End-to-end encrypted connection"]})]}),y.jsxs("section",{className:"contact-action-group","aria-label":"Contact actions",children:[y.jsxs("button",{type:"button",onClick:()=>l(!0),children:[y.jsxs("span",{children:[y.jsx(be,{name:"paperclip"}),"Shared photos, files, and links"]}),y.jsx(be,{name:"chevron"})]}),y.jsxs("button",{type:"button",onClick:()=>{h.current=!1,s(e.contact.name),n(!0)},children:[y.jsxs("span",{children:[y.jsx(be,{name:"edit"}),"Rename contact"]}),y.jsx(be,{name:"chevron"})]})]}),y.jsxs("section",{className:"contact-identity","aria-labelledby":"contact-identity-title",children:[y.jsx("h3",{id:"contact-identity-title",children:"Verified identity"}),e.contact.roleId&&y.jsxs("p",{children:["Role ",y.jsx("strong",{children:e.contact.roleId})," of ",y.jsx("strong",{children:e.contact.rootName})]}),y.jsx("code",{children:e.contact.id}),y.jsxs("button",{type:"button",className:"btn sm",onClick:()=>void navigator.clipboard.writeText(e.contact.id),children:[y.jsx(be,{name:"copy",size:14}),"Copy identity"]})]}),y.jsxs("button",{type:"button",className:"contact-remove",onClick:e.onRemove,children:[y.jsx(be,{name:"trash"}),"Remove contact"]})]}),a&&y.jsx(GF,{messages:e.messages,indexOffset:e.indexOffset,onClose:()=>l(!1),onJump:e.onOpenMessage,onPreview:p=>{l(!1),f(p)}}),c&&(Zs(c.filename,c.mime)?y.jsx(hS,{rec:c,onClose:()=>f(null)}):y.jsx(dS,{rec:c,onClose:()=>f(null),onSendText:e.onSendText,onSendFile:e.onSendFile}))]})}const Vl=e=>`chat-message-${encodeURIComponent(e)}`,SS=()=>typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Gf(e){const{dir:t,canReply:n,onReply:i}=e,s=k.useRef(null),a=k.useRef(null),l=k.useRef(null),c=k.useRef(i);c.current=i;const f=t==="in"?1:-1,h=wS,m=84,p=()=>({id:-1,x0:0,y0:0,mode:"idle",armed:!1,distance:0,samples:[]}),v=k.useRef(p()),w=A=>{const T=a.current,L=l.current,j=SS();if(T&&(T.style.transform=A&&!j?`translateX(${A}px)`:""),L){const I=Math.min(1,Math.abs(A)/h);L.style.opacity=String(I),L.style.transform=j?"scale(1)":`scale(${.5+.5*I})`}},S=(A,T)=>{const L=v.current;if(L.id!==A)return;const j=T&&L.mode==="drag"&&Ez(L.distance,L.samples);v.current=p(),a.current?.classList.remove("swiping"),l.current?.classList.remove("armed"),w(0);const I=s.current;I?.hasPointerCapture?.(A)&&I.releasePointerCapture(A),j&&c.current()};k.useEffect(()=>{const A=s.current;if(!A)return;const T=L=>S(L.pointerId,!1);return A.addEventListener("lostpointercapture",T),()=>{A.removeEventListener("lostpointercapture",T);const L=v.current.id;L!==-1&&S(L,!1)}},[]);const C=A=>{const T=A.target,L=window.getSelection?.();!n||!A.isPrimary||A.pointerType==="mouse"||A.pointerType==="pen"&&A.button!==0||v.current.id!==-1||L&&!L.isCollapsed||T.closest('a, button, input, textarea, select, [role="button"], audio, video, img, [draggable="true"], .filecard, .filecard-bubble, .image-bubble, .voice-bubble, .ours-message-file, .attachment')||(v.current={id:A.pointerId,x0:A.clientX,y0:A.clientY,mode:"maybe",armed:!1,distance:0,samples:[{x:A.clientX*f,time:A.timeStamp}]},w(0))},E=A=>{const T=v.current;if(T.id!==A.pointerId||T.mode==="idle")return;const L=A.clientX-T.x0,j=A.clientY-T.y0,I=window.getSelection?.();if(I&&!I.isCollapsed){S(A.pointerId,!1);return}if(T.mode==="maybe"){const $=bz(L*f,j);if($==="pending")return;if($==="drag")T.mode="drag",A.currentTarget.setPointerCapture?.(A.pointerId),a.current?.classList.add("swiping");else{T.mode="idle";return}}A.preventDefault();const K=A.timeStamp;T.samples.push({x:A.clientX*f,time:K}),T.samples=T.samples.filter($=>K-$.time<=120);let B=L*f;B<0&&(B=0),B>h&&(B=h+(B-h)*.35),B=Math.min(B,m),T.distance=B;const _=B*f,N=Math.abs(_)>=h;N!==T.armed&&(T.armed=N,l.current?.classList.toggle("armed",N),N&&navigator.vibrate?.(10)),w(_)},P=A=>{const T=v.current;T.id===A.pointerId&&T.mode==="drag"&&(T.samples.push({x:A.clientX*f,time:A.timeStamp}),T.distance=Math.max(0,(A.clientX-T.x0)*f),T.armed=T.distance>=h),S(A.pointerId,!0)};return y.jsxs("div",{ref:s,className:"msg-row "+(e.rowClass??t),style:n?{touchAction:"pan-y"}:void 0,onPointerDown:C,onPointerMove:E,onPointerUp:P,onPointerCancel:A=>S(A.pointerId,!1),onLostPointerCapture:A=>S(A.pointerId,!1),children:[n&&y.jsx("span",{className:"swipe-cue",ref:l,"aria-hidden":!0,children:y.jsx(be,{name:"reply",size:16})}),y.jsx("div",{className:"bubble-wrap",ref:a,children:e.children}),e.after]})}const Iz=k.memo(function(t){const{messages:n,optimisticSend:i,sentKeys:s,hiddenEarlier:a,unreadWireId:l,roomLines:c,contactCid:f,contactName:h,onStartReply:m,onRevealMessage:p,onPreview:v,onFetchFile:w}=t,S=new Map;for(const j of n)j.wireId&&S.set(j.wireId,j);const C=j=>c.get(j)??null,E=j=>{if(j.dir==="out")return"You";const I=C(j);return I&&I.variant==="chat"?I.author:h},P=j=>{if(j.kind==="file")return j.mime?.startsWith("image/")?"Photo":To(j.mime??"",j.filename??"")?"Voice message":j.filename||"File";const I=C(j);return I?I.text||Wj(I):j.text},A=j=>{if(!j.replyTo)return null;const I=S.get(j.replyTo.wireId);return I?{author:E(I),text:P(I)}:{author:"",text:"Original message"}},T=j=>{j.wireId&&m({wireId:j.wireId,author:E(j),text:P(j)})},L=j=>{if(!j)return null;const I=C(j);return I?I.variant==="system"?"room:system":`room:chat:${I.author}${I.role}`:j.dir};return y.jsx(dR,{initial:!1,children:n.map((j,I)=>{const K=j===i?.message?i.key:j.wireId&&s.get(j.wireId)||j.wireId||`${j.date}-${a+I}`,B=Vl(j.wireId||K),_=n[I-1],N=n[I+1],$=C(j),V=L(j),he=!!_&&L(_)===V&&V!=="room:system",J=!!N&&L(N)===V&&V!=="room:system",Z=(j.dir==="out"?"out":"in")+(he?" cont-top":"")+(J?" cont-bot":""),ve=j.wireId?y.jsx("button",{className:"msg-reply",title:"Reply",onClick:()=>T(j),children:y.jsx(be,{name:"reply",size:15})}):null,ke=A(j),Q=ke&&j.replyTo?y.jsxs("button",{type:"button",className:"quote","aria-label":`Show original message${ke.author?` from ${ke.author}`:""}`,onClick:()=>p(j.replyTo.wireId),children:[ke.author&&y.jsx("span",{className:"quote-author",children:ke.author}),y.jsx("span",{className:"quote-text",children:ke.text})]}):null,pe=j.wireId===l?y.jsx("div",{id:`unread-${B}`,className:"unread-divider",role:"separator",children:y.jsx("span",{children:"Unread messages"})}):null;if($&&$.variant==="system"){const R=$.presentation??"system";return y.jsxs(ko.div,{className:"message-motion",id:B,initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0},transition:Ts,children:[pe,y.jsxs("div",{className:`room-system room-${R}-card`,role:"note",children:[Q,$.label&&y.jsx("span",{className:"room-system-label",children:$.label}),$.roomName&&y.jsx("strong",{className:"room-card-name",children:$.roomName}),y.jsx(Lx,{text:$.text,className:"room-system-text message-markdown"}),!!$.details?.length&&y.jsx("ul",{className:"room-card-details","aria-label":"Room event details",children:$.details.map(F=>y.jsx("li",{children:F},F))}),y.jsxs("span",{className:"room-card-provenance",children:[$.authoredBy&&y.jsx("span",{className:"room-card-author",children:$.authoredBy}),y.jsx("span",{className:"room-system-at",children:Mi(j.date)})]})]})]},K)}if(j.kind==="file"){const R=q0(j.wireId)??{id:j.wireId,dir:j.dir,filename:j.filename??"file",mime:j.mime??"application/octet-stream",size:0,date:j.date};return y.jsxs(ko.div,{className:"message-motion",id:B,initial:{opacity:0,y:12,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.98},transition:Ts,children:[pe,y.jsx(Gf,{dir:j.dir==="out"?"out":"in",rowClass:Z,canReply:!!j.wireId,onReply:()=>T(j),after:ve,children:y.jsxs("div",{className:`ours-message ours-message-file ours-message--${j.dir}`,children:[Q,y.jsx(UD,{rec:R,receipt:j.receipt,receiptless:j.receiptless,onPreview:v,onFetch:w})]})})]},K)}if(j.typed){const R=j.typed.kind==="command_result"&&j.replyTo?S.get(j.replyTo.wireId):void 0,F=j.typed.kind==="command_result"&&j.dir==="in"&&j.peerCid===f&&R?.dir==="out"&&R.peerCid===f&&R.typed?.kind==="command",Y=j.typed.kind==="command_result"&&!j.typed.outcome.ok?j.typed.outcome.error.toLowerCase():"",M=j.typed.kind==="command"?j.dir==="out"?"Accepted · pending result":"Received command":j.typed.kind==="unknown"?"Safe failure":j.dir==="out"?"Result sent":F?Y==="validation_denied"||Y==="validation_failed"?"Validation denied":Y==="policy_denied"||Y==="unauthorized"||Y==="forbidden"?"Policy denied":j.typed.outcome.ok?"Completed":"Failed":"Unmatched result · safe failure",se=j.typed.kind==="command"?j.typed.command:j.typed.kind==="command_result"?`Result for ${F&&R?.typed?.kind==="command"?R.typed.command:"unmatched command"}`:`Unsupported ${j.typed.wire_kind}`,ue=j.typed.kind==="command"?j.typed.arguments:j.typed.kind==="command_result"?j.typed.outcome:{safe_failure:j.typed.malformed?"Malformed typed message":"Future typed message preserved"};return y.jsxs(ko.div,{className:"message-motion",id:B,initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0},transition:Ts,children:[pe,y.jsx(Gf,{dir:j.dir,rowClass:Z,canReply:!!j.wireId,onReply:()=>T(j),after:ve,children:y.jsxs("div",{className:`ours-message typed-message ours-message--${j.dir}`,children:[Q,y.jsx("div",{className:"typed-message-kind",children:j.typed.kind==="command"?"Command":j.typed.kind==="command_result"?"Result":"Typed message"}),y.jsx("strong",{children:se}),y.jsx("div",{className:"typed-message-state",role:"status",children:M}),y.jsx("pre",{children:JSON.stringify(ue,null,2)}),y.jsxs("div",{className:"bubble-at",children:[Mi(j.date),j.dir==="out"&&y.jsx(Ad,{receipt:j.receipt,receiptless:j.receiptless})]})]})})]},K)}return y.jsxs(ko.div,{className:"message-motion",id:B,initial:{opacity:0,y:12,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.98},transition:Ts,children:[pe,y.jsx(Gf,{dir:j.dir==="out"?"out":"in",rowClass:Z,canReply:!!j.wireId,onReply:()=>T(j),after:ve,children:y.jsxs("div",{className:`ours-message ours-message--${j.dir}`,children:[Q,$&&!he&&y.jsxs(y.Fragment,{children:[$.roomName&&y.jsx("div",{className:"room-message-room",children:$.roomName}),y.jsxs("div",{className:"room-author",children:[y.jsx("span",{className:"room-author-name",children:$.author}),$.role&&y.jsx("span",{className:"room-author-role",children:$.role})]})]}),y.jsx(Lx,{text:$?$.text:j.text}),y.jsxs("div",{className:"bubble-at",children:[Mi(j.date),j.dir==="out"&&y.jsx(Ad,{receipt:j.receipt,receiptless:j.receiptless})]})]})})]},K)})})});function Dz(e){const{contact:t,messages:n}=e,[i,s]=k.useState(""),[a,l]=k.useState(!1),[c,f]=k.useState(null),[h,m]=k.useState(null),[p,v]=k.useState(null),[w,S]=k.useState(null),[C,E]=k.useState(null),[P,A]=k.useState(!1),[T,L]=k.useState(!1),[j,I]=k.useState(!1),[K,B]=k.useState(null),[_,N]=k.useState(null),[$,V]=k.useState(!1),[he,J]=k.useState(!1),[Z,ve]=k.useState(!1),[ke,Q]=k.useState(!1),[pe,R]=k.useState(!1),[F,Y]=k.useState(null),[M,se]=k.useState(null),ue=k.useRef(null),ae=k.useRef(null),me=k.useRef(null),Se=_?.recipient_cid===t?.id?_:null,Ue=/^\/[^\s/]*$/.test(i)&&Z&&!$&&!ke&&!pe,Fe=Ue&&e.onSendCommand?Se?.commands.filter(X=>X.name.toLowerCase().startsWith(i.slice(1).toLowerCase()))??[]:[],Ke=JSON.stringify([t?.id,Se?.fingerprint,i]),ot=F?.key===Ke?Fe.findIndex(X=>X.name===F.name):-1,st=k.useRef(null),Ft=k.useRef(null),Zt=k.useRef(null),et=k.useRef(null),Wt=k.useRef(null),Tn=k.useRef(null),zt=k.useRef(null),en=k.useRef(!1),bt=k.useRef(null),Jn=k.useRef(!1),[We,Ar]=k.useState(!1),[G,ee]=k.useState(0),Re=k.useRef(null),je=k.useRef(!0),ze=k.useRef(null),at=k.useRef(0),Mt=k.useRef(null),W=k.useRef(new Map),ge=k.useRef(0),ie=k.useRef(null),ye=k.useRef(null),De=k.useRef(0),de=k.useRef(null),qe=k.useRef(null),wt=k.useRef(null),ft=k.useRef(null),[Je,yt]=k.useState(null),[ht,Ht]=k.useState(""),Pt=k.useCallback(()=>{qe.current?.abort(),qe.current=null,ft.current!==null&&clearTimeout(ft.current),ft.current=null,wt.current?.classList.remove("reply-highlight"),wt.current=null,yt(null),Ht("")},[]);k.useLayoutEffect(()=>(Pt(),Pt),[t?.id,Pt]);const ia=k.useCallback(async X=>{Pt();const ne=new AbortController;qe.current=ne;const ce=bt.current;ie.current=null,ye.current=null,je.current=!1,Jn.current=!0,Mt.current=null,ce&&ce.scrollTo({top:ce.scrollTop,behavior:"instant"}),window.location.hash.startsWith("#chat-message-")&&window.history.replaceState(window.history.state,"",window.location.pathname+window.location.search);const Oe=setTimeout(()=>{ne.abort(),Ht("Could not load the original message. Please try again.")},1e4);try{let pt="found";const Rt=document.getElementById(Vl(X));if((!Rt||!ce?.contains(Rt))&&(Ht("Finding original message…"),pt=await e.onRevealMessage?.(X,ne.signal)??"unavailable"),ne.signal.aborted)return;if(pt!=="found"){Ht(pt==="limit"?"Original message is beyond the search limit. Load earlier messages and try again.":"Original message is unavailable.");return}Ht(""),yt({wireId:X,controller:ne})}catch{ne.signal.aborted||Ht("Could not load the original message. Please try again.")}finally{clearTimeout(Oe)}},[Pt,e.onRevealMessage]);k.useLayoutEffect(()=>{if(!Je)return;const X=requestAnimationFrame(()=>{if(Je.controller.signal.aborted)return;const ne=document.getElementById(Vl(Je.wireId)),ce=bt.current;if(!ne||!ce?.contains(ne)){Ht("Original message is unavailable."),yt(null);return}Mt.current=null,je.current=!1;const Oe=ne.getBoundingClientRect(),pt=ce.getBoundingClientRect(),Rt=Math.max(16,(ce.clientHeight-Oe.height)/2);ce.scrollTo({top:ce.scrollTop+Oe.top-pt.top-Rt,behavior:"instant"}),ne.classList.remove("reply-highlight"),ne.offsetWidth,ne.classList.add("reply-highlight"),wt.current=ne,ne.setAttribute("tabindex","-1"),ne.focus({preventScroll:!0}),ft.current=setTimeout(()=>{ne.classList.remove("reply-highlight"),wt.current=null,ft.current=null},1500),yt(null),mr()});return()=>cancelAnimationFrame(X)},[Je]);const Oi=k.useRef("");k.useLayoutEffect(()=>{const X=Wt.current,ne=Tn.current,ce=zt.current;if(!X||!ne||!ce)return;let Oe=-1,pt=-1,Rt=null;const Pn=()=>{const Kt=Math.round(ne.getBoundingClientRect().height),un=Math.round(ce.getBoundingClientRect().height);if(Kt!==Oe&&(Oe=Kt,X.style.setProperty("--conversation-head-height",`${Kt}px`)),un!==pt){const kt=je.current;pt=un,X.style.setProperty("--conversation-compose-height",`${un}px`),kt&&(Rt!==null&&cancelAnimationFrame(Rt),Rt=requestAnimationFrame(()=>{Rt=null;const zn=bt.current;zn&&je.current&&(zn.scrollTop=Math.max(0,zn.scrollHeight-zn.clientHeight))}))}};Pn();const Qe=new ResizeObserver(Pn);return Qe.observe(ne),Qe.observe(ce),()=>{Qe.disconnect(),Rt!==null&&cancelAnimationFrame(Rt),X.style.removeProperty("--conversation-head-height"),X.style.removeProperty("--conversation-compose-height")}},[t?.id]),k.useEffect(()=>{s(""),m(null),v(null),f(null),S(null),E(null),A(!1),L(!1),I(!1),at.current+=1,B(null),st.current?.abort(),N(null),V(!1),J(!1),Y(null),R(!1),Q(!1),W.current.clear(),ie.current=null,ye.current=null},[t?.id]);const ui=async(X=!0,ne=!0)=>{if(!t||!e.onLoadCommands)return;st.current?.abort();const ce=new AbortController;st.current=ce,J(!0),ne&&m(null);try{const Oe=await e.onLoadCommands(t.id,ce.signal);!ce.signal.aborted&&Oe.recipient_cid===t.id?(N(Oe),Oe.commands.length===0?(V(!1),$&&requestAnimationFrame(()=>et.current?.focus({preventScroll:!0}))):X&&V(!0)):ce.signal.aborted||(N(null),V(!1),ne&&m("Command discovery was refused because the authenticated recipient changed."))}catch(Oe){ce.signal.aborted||(N(null),V(!1),ne&&m(Oe instanceof Ql?`Command discovery failed: ${Oe.message}`:"Command discovery failed safely. The recipient may be offline or unsupported."))}finally{st.current===ce&&J(!1)}};k.useEffect(()=>(ui(!1,!1),()=>st.current?.abort()),[t?.id]);const jr=()=>{V(!1),Ft.current?.focus()},Fi=k.useRef(ui);Fi.current=ui,k.useEffect(()=>{if(!Ue||!e.onLoadCommands)return;let X=!1,ne;const ce=async()=>{await Fi.current(!1,!1),X||(ne=setTimeout(ce,2e3))};return ce(),()=>{X=!0,clearTimeout(ne),st.current?.abort()}},[Ue,t?.id]),k.useEffect(()=>{me.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest",behavior:"instant"})},[ot,Ke]);const vn=()=>{ue.current=null,se(null)};k.useLayoutEffect(vn,[Ue,Ke]),k.useLayoutEffect(()=>{ae.current!==null&&(et.current?.setSelectionRange(ae.current,ae.current),ae.current=null)},[i]);const oa=X=>{if(!Ue||!Fe.some(ce=>ce.name===X))return;const ne=`/${X} `;ae.current=ne.length,s(ne),Y(null),R(!0),vn(),et.current?.focus({preventScroll:!0})};k.useEffect(()=>{if(!p)return;const X=p.reply?.wireId;n.some(ce=>ce.kind!=="file"&&ce.dir==="out"&&!!ce.wireId&&!p.wireIds.has(ce.wireId)&&ce.text===p.text&&(ce.replyTo?.wireId??void 0)===X)&&(v(null),m(null),s(ce=>ce===p.draft?"":ce),S(ce=>ce===p.reply?null:ce))},[n,p]);const Zn=!!c?.wireId&&n.some(X=>X.wireId===c.wireId),It=k.useMemo(()=>c&&!Zn?[...n,c.message]:n,[n,c,Zn]);k.useEffect(()=>{Zn&&f(null)},[Zn]),k.useLayoutEffect(()=>{const X=et.current;if(!X)return;i.startsWith(Oi.current)||(X.style.height="0px");const ce=X.scrollHeight,pt=`${Math.max(44,Math.min(ce,132))}px`;X.style.height!==pt&&(X.style.height=pt),X.style.overflowY=ce>132?"auto":"hidden",Oi.current=i},[i,t?.id]);const Nr=X=>{const ne=bt.current;if(!ne)return;const ce=Math.max(0,ne.scrollHeight-ne.clientHeight);if(Math.abs(ne.scrollTop-ce)<1){ie.current=null,ye.current=null;return}const Oe=X&&!SS();ie.current=Oe?ce:null,ye.current=Oe?ne.scrollTop:null,Oe?ne.scrollTo({top:ce,behavior:"smooth"}):ne.scrollTop=ce},mr=()=>{Re.current===null&&(Re.current=requestAnimationFrame(()=>{Re.current=null;const X=bt.current;if(!X)return;const ne=X.scrollHeight-X.clientHeight-X.scrollTop>48;Ar(ne),ne||ee(0)}))};k.useLayoutEffect(()=>{if(!t){ze.current=null,je.current=!0,De.current=0;return}const X=bt.current;if(!X)return;const ne=ze.current!==t.id,ce=De.current,Oe=It.length!==ce,pt=It.at(-1),Rt=pt?pt.wireId||`${pt.date}:${pt.text}`:null,Pn=de.current;if(De.current=It.length,de.current=Rt,!ne&&!Oe&&ie.current===null&&(je.current=X.scrollHeight-X.clientHeight-X.scrollTop<=48),ne||je.current)Nr(Oe&&!ne&&ze.current!==null),je.current=!0;else if(Oe&&It.length>ce&&Rt!==Pn){const Qe=Pn===null?-1:It.findIndex(Kt=>(Kt.wireId||`${Kt.date}:${Kt.text}`)===Pn);ee(Kt=>Kt+Math.max(1,It.length-Math.max(0,Qe+1)))}ze.current=t.id,mr()},[t,It.length]),k.useLayoutEffect(()=>{if(Jn.current||!e.unreadOpen||window.location.hash.startsWith("#chat-message-"))return;const X=bt.current,ne=document.getElementById(`unread-${Vl(e.unreadOpen.wireId)}`);!X||!ne||(X.scrollTop=Math.max(0,ne.offsetTop-16),je.current=!1,Jn.current=!0,mr())},[e.unreadOpen,It.length]),k.useLayoutEffect(()=>{const X=window.location.hash;if(!X.startsWith("#chat-message-"))return;const ne=document.getElementById(X.slice(1));ne&&(ne.scrollIntoView({block:"center"}),je.current=!1)},[t?.id,It.length]),k.useLayoutEffect(()=>{const X=Mt.current,ne=bt.current;if(X===null||!ne)return;const ce=requestAnimationFrame(()=>{Mt.current===X&&(ne.scrollTop=X.top+ne.scrollHeight-X.height,Mt.current=null)});return()=>cancelAnimationFrame(ce)},[It.length]),k.useEffect(()=>{const X=bt.current;if(!X||typeof ResizeObserver>"u")return;const ne=X.firstElementChild;if(!ne)return;const ce=new ResizeObserver(()=>{je.current&&Nr(ie.current!==null),mr()});return ce.observe(ne),ce.observe(X),()=>{ce.disconnect(),Re.current!==null&&cancelAnimationFrame(Re.current)}},[t?.id]);const sa=async X=>{const ne=++at.current;m(null),I(!0);try{if(X.size>Es&&mS(X.type,X.name)){const Oe=await lz(X,Es);if(ne!==at.current)return;E({filename:Oe.filename,mime:Oe.mime,bytes:Oe.bytes,originalSize:Oe.originalSize});return}if(X.size>Es){m(`"${X.name}" is ${oi(X.size)} — files up to ${oi(Es)} can be sent.`);return}const ce=await X.arrayBuffer();if(ne!==at.current)return;E({filename:X.name||"file",mime:X.type||"application/octet-stream",bytes:new Uint8Array(ce)})}catch(ce){ne===at.current&&m(`Photo optimization failed: ${ce instanceof Error?ce.message:String(ce)}`)}finally{ne===at.current&&I(!1)}},Su=()=>{!C||!e.onSendFile||T||(L(!0),e.onSendFile(C,w?.wireId).then(()=>{E(null),S(null)}).catch(X=>m(`File send failed: ${String(X)} — it was not delivered.`)).finally(()=>L(!1)))},_o=e.onDraftChange;k.useEffect(()=>(_o?.(i.trim().length>0||a),()=>_o?.(!1)),[i,a,_o]);const gr=k.useMemo(()=>{const X=new Map;for(const ne of It)X.set(ne,ne.kind==="file"?null:ne.dir==="in"?Oj(t?.announcedName??"",ne.text):null);return X},[It,t?.announcedName]);if(!t)return e.emptyOverride?y.jsx(y.Fragment,{children:e.emptyOverride}):y.jsx("div",{className:"detail",children:y.jsxs("div",{className:"detail-empty",children:[y.jsx(be,{name:"chat"}),y.jsxs("div",{children:[y.jsx("div",{style:{fontWeight:650,color:"var(--text-2)"},children:"Select a conversation"}),y.jsx("div",{style:{fontSize:"0.85rem"},children:"Chat with people, agents and apps across ours."})]})]})});const zi=async()=>{const X=i,ne=X.trim(),ce=!!p&&X===p.draft&&(w?.wireId??void 0)===p.reply?.wireId;if(!ne||en.current||ce)return;p&&v(null),en.current=!0,l(!0),m(null);const Oe=w,pt=Oe?.wireId,Rt=new AbortController;let Pn=!1,Qe=0;s(""),S(null);const Kt=`optimistic-${++ge.current}`;f({key:Kt,wireId:null,message:{dir:"out",text:ne,date:new Date().toISOString(),read:!0,wireId:"",replyTo:pt?{wireId:pt}:null}});try{const un=await Promise.race([e.onSend(ne,pt,Rt.signal),new Promise((kt,zn)=>{Qe=window.setTimeout(()=>{Pn=!0,Rt.abort(),zn(new Error("send timeout"))},jz)})]);un?(W.current.set(un,Kt),f(kt=>kt?.key===Kt?{...kt,wireId:un}:kt)):f(kt=>kt?.key===Kt?null:kt),v(null)}catch(un){f(null),s(kt=>kt===""?X:kt),S(kt=>kt===null?Oe:kt),Pn||!(un instanceof Ql)?(v({draft:X,text:ne,reply:Oe,wireIds:new Set(n.flatMap(kt=>kt.wireId?[kt.wireId]:[]))}),m(`${Pn?"Send timed out":"Send connection was interrupted"} — delivery status is unknown. Check the conversation; edit the draft before sending again.`)):m(`Send failed: ${String(un)} — the message was not delivered.`)}finally{window.clearTimeout(Qe),en.current=!1,l(!1)}},Oo=!!p&&i===p.draft&&(w?.wireId??void 0)===p.reply?.wireId;return y.jsxs("div",{className:"detail detail-chat",ref:Wt,children:[y.jsx("div",{className:"detail-head",ref:Tn,children:y.jsxs("div",{className:"conv-peer",children:[y.jsx("button",{className:"icon-btn detail-back","aria-label":"Back to conversations",onClick:e.onBack,children:y.jsx(be,{name:"back"})}),y.jsxs("div",{className:"conv-peer-status",children:[y.jsx("span",{className:"conv-peer-name",children:t.name}),e.syncing&&y.jsxs("div",{className:"conv-sync",role:"status","aria-live":"polite",children:[y.jsx("span",{className:"conv-sync-dot","aria-hidden":!0}),e.syncing==="connecting"?"Connecting…":"Updating…"]}),!e.syncing&&y.jsxs("span",{className:"conv-contact-status",children:[y.jsx(be,{name:"lock",size:11}),"Encrypted connection"]})]}),y.jsx("button",{type:"button",className:"conv-contact-trigger conv-contact-avatar","data-contact-trigger":!0,onClick:e.onOpenContact,disabled:!e.onOpenContact,"aria-label":`Open contact details for ${t.name}`,children:y.jsx("span",{className:"conv-contact-initials","aria-hidden":!0,children:t.initials})})]})}),y.jsx("div",{className:"messages",ref:bt,tabIndex:-1,"aria-label":"Conversation timeline",onScroll:X=>{const ne=X.currentTarget,ce=ne.scrollHeight-ne.clientHeight-ne.scrollTop;if(ie.current!==null){const Oe=ye.current;if(Oe===null||ne.scrollTop>=Oe-1){ye.current=ne.scrollTop,ce<=4&&(ie.current=null,ye.current=null);return}ie.current=null,ye.current=null}je.current=ce<=48,mr()},onPointerDown:()=>{Pt(),ie.current=null,ye.current=null},onTouchStart:()=>{Pt(),ie.current=null,ye.current=null},onWheel:()=>{Pt(),ie.current=null,ye.current=null},onKeyDown:X=>{["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"," ","Escape"].includes(X.key)&&Pt()},onDragOver:X=>{e.onSendFile&&X.preventDefault()},onDrop:X=>{if(!e.onSendFile)return;X.preventDefault();const ne=X.dataTransfer.files?.[0];ne&&sa(ne)},children:y.jsxs("div",{className:"messages-inner",children:[y.jsxs("div",{className:"e2e-note",children:[y.jsx(be,{name:"lock"}),"End-to-end encrypted · the broker only sees ciphertext"]}),(e.hiddenEarlier??0)>0&&e.onLoadEarlier&&y.jsxs("button",{className:"btn sm chat-load-earlier",onClick:()=>{je.current=!1;const X=bt.current;Mt.current=X?{height:X.scrollHeight,top:X.scrollTop}:null,e.onLoadEarlier?.()},children:["Load earlier messages (",e.hiddenEarlier," remaining)"]}),y.jsx(Iz,{messages:It,optimisticSend:c,sentKeys:W.current,hiddenEarlier:e.hiddenEarlier??0,unreadWireId:e.unreadOpen?.wireId,roomLines:gr,contactCid:t.id,contactName:t.name,onStartReply:S,onRevealMessage:ia,onPreview:B,onFetchFile:e.onFetchFile}),y.jsx("div",{className:"thread-end","aria-hidden":!0})]})},t.id),We&&y.jsxs("button",{type:"button",className:"jump-latest btn sm","aria-label":G?`Jump to latest, ${G} new messages`:"Jump to latest",onClick:X=>{const ne=X.currentTarget===document.activeElement;Pt(),ee(0),Nr(!0),ne&&requestAnimationFrame(()=>bt.current?.focus({preventScroll:!0}))},children:[y.jsx("span",{children:"Jump to latest"}),!!G&&y.jsx("span",{className:"jump-latest-count","aria-live":"polite",children:G})]}),ht&&y.jsx("div",{className:"banner",role:"status",children:ht}),h&&y.jsxs("div",{className:"banner error",role:"alert",children:[h,h.startsWith("Send failed:")&&y.jsx("span",{className:"banner-actions",children:y.jsx("button",{className:"linkbtn",onClick:()=>void zi(),children:"retry"})})]}),y.jsxs("div",{className:"composer-wrap",ref:zt,children:[$&&Se&&e.onSendCommand&&y.jsx(wz,{catalog:Se,recipientName:t.name,busy:he,onRefresh:()=>void ui(!0,!0),onClose:jr,onSend:async(X,ne,ce,Oe)=>{if(!t||t.id!==Se.recipient_cid)throw new Error("Recipient changed; refresh commands");return e.onSendCommand(t.id,X.name,ne,ce,Oe)}},`${Se.recipient_cid}:${Se.fingerprint}`),Fe.length>0&&y.jsx("div",{ref:me,id:"composer-command-suggestions",className:"command-suggestions",role:"listbox","aria-label":"Suggested contact commands",onScroll:vn,children:Fe.map((X,ne)=>y.jsxs("div",{id:`composer-command-option-${ne}`,role:"option","aria-selected":ne===ot,className:"command-suggestion","data-pressed":M?.key===Ke&&M.name===X.name||void 0,onMouseDown:ce=>{ce.button===0&&ce.preventDefault()},onPointerDown:ce=>{!ce.isPrimary||ce.button!==0||(ue.current={key:Ke,name:X.name},se({key:Ke,name:X.name,pointer:ce.pointerId,x:ce.clientX,y:ce.clientY}))},onPointerMove:ce=>{M?.pointer===ce.pointerId&&Math.hypot(ce.clientX-M.x,ce.clientY-M.y)>10&&vn()},onPointerUp:()=>se(null),onPointerCancel:vn,onPointerLeave:ce=>{ce.buttons!==0&&vn()},onClick:ce=>{const Oe=ue.current;vn(),(ce.detail===0||Oe?.key===Ke&&Oe.name===X.name)&&oa(X.name)},children:[y.jsxs("strong",{children:["/",X.name]}),X.description&&y.jsx("span",{children:X.description})]},`${Ke}:${X.name}`))}),w&&y.jsxs("div",{className:"reply-bar",children:[y.jsx("div",{className:"reply-bar-line"}),y.jsxs("div",{className:"reply-bar-body",children:[y.jsxs("div",{className:"reply-bar-author",children:["Replying to ",w.author]}),y.jsx("div",{className:"reply-bar-text",children:w.text})]}),y.jsx("button",{className:"icon-btn",title:"Cancel reply",onClick:()=>S(null),children:y.jsx(be,{name:"close",size:16})})]}),C&&y.jsx(W1,{att:C,sending:T,onSend:Su,onDiscard:()=>E(null)}),j&&y.jsx("div",{className:"attachment-processing",role:"status",children:"Optimizing photo for secure delivery…"}),y.jsxs("div",{className:"composer"+(P?" recording":""),children:[e.onLoadCommands&&Se&&Se.commands.length>0&&y.jsx("button",{ref:Ft,type:"button",className:"icon-btn composer-tool command-trigger",title:"Recipient commands","aria-label":"Recipient commands","aria-expanded":$,disabled:he,onClick:()=>{$?jr():V(!0)},children:y.jsx(be,{name:"menu",size:19})}),e.onSendFile&&y.jsxs(y.Fragment,{children:[y.jsx("input",{ref:Zt,type:"file",style:{display:"none"},onChange:X=>{const ne=X.target.files?.[0];ne&&sa(ne),X.target.value=""}}),y.jsx("button",{className:"icon-btn composer-tool",title:"Attach a file or photo",disabled:T||j||P,onClick:()=>Zt.current?.click(),children:y.jsx(be,{name:"paperclip",size:18})})]}),y.jsx("textarea",{ref:et,className:"field",rows:1,placeholder:(w?"Reply to "+w.author:"Message "+t.name)+"…",value:i,"aria-busy":a,"aria-autocomplete":Fe.length?"list":void 0,"aria-controls":Fe.length?"composer-command-suggestions":void 0,"aria-activedescendant":ot>=0?`composer-command-option-${ot}`:void 0,onFocus:()=>ve(!0),onBlur:()=>{ve(!1),Y(null)},onCompositionStart:()=>{Q(!0),Y(null)},onCompositionEnd:()=>Q(!1),onChange:X=>{s(X.target.value),Y(null),R(!1)},onKeyDown:X=>{if(!(ke||X.nativeEvent.isComposing||X.keyCode===229)){if(Fe.length&&!X.shiftKey&&!X.altKey&&!X.ctrlKey&&!X.metaKey){if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault();const ne=ot<0?X.key==="ArrowDown"?0:Fe.length-1:(ot+(X.key==="ArrowDown"?1:-1)+Fe.length)%Fe.length;Y({key:Ke,name:Fe[ne].name});return}if((X.key==="Enter"||X.key==="Tab")&&ot>=0){X.preventDefault(),oa(Fe[ot].name);return}if(X.key==="Escape"){X.preventDefault(),R(!0),Y(null);return}}X.key==="Enter"?!(window.matchMedia("(pointer: coarse)").matches||window.innerWidth<=860)&&!X.shiftKey&&(X.preventDefault(),zi()):X.key==="Escape"&&S(null)}}}),e.onSendFile&&!i.trim()&&!C&&!j&&!T?y.jsx(H1,{disabled:T||j||!!C,onReady:X=>{A(!1),E(X)},onError:X=>{A(!1),m(X)},onActiveChange:A},t.id):y.jsxs("button",{className:"btn primary","aria-label":"Send",onPointerDown:X=>{X.button===0&&document.activeElement===et.current&&X.preventDefault()},onClick:()=>void zi(),disabled:a||Oo||!i.trim(),title:Oo?"Delivery status unknown — edit before sending again":void 0,children:[y.jsx(be,{name:"send",size:16}),y.jsx("span",{className:"btn-label",children:"Send"})]})]})]}),K&&(Zs(K.filename,K.mime)?y.jsx(hS,{rec:K,onClose:()=>B(null)}):y.jsx(dS,{rec:K,onClose:()=>B(null),onSendText:e.onSend,onSendFile:e.onSendFile}))]})}const bS=3;function Lz(e,t,n=bS){return[t,...e.filter(i=>i.cid!==t.cid)].slice(0,n)}function _z(e,t){return e.filter(n=>n.id!==t)}const Oz=6e3,Fz=Lz,zz=_z;function Vz(){const[e,t]=k.useState([]),n=k.useRef(0),i=k.useCallback((l,c,f)=>{const h=Date.now(),m={id:`${l}:${h}:${n.current++}`,cid:l,name:c,preview:"",at:h};t(p=>Fz(p,m,bS))},[]),s=k.useCallback(l=>t(c=>zz(c,l)),[]),a=k.useCallback(l=>t(c=>c.filter(f=>f.cid!==l)),[]);return{toasts:e,push:i,dismiss:s,clear:a}}function Bz(e){const{item:t,onOpen:n,onDismiss:i}=e,[s,a]=k.useState(!1),[l,c]=k.useState(!1),f=s||l;return k.useEffect(()=>{if(f)return;const h=setTimeout(()=>i(t.id),Oz);return()=>clearTimeout(h)},[t.id,f,i]),y.jsxs("div",{className:"banner msg",role:"status",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>c(!0),onBlur:h=>{h.currentTarget.contains(h.relatedTarget)||c(!1)},children:[y.jsxs("button",{className:"msg-open",title:`Open the conversation with ${t.name}`,onClick:()=>n(t.cid),children:[y.jsx("span",{className:"avatar sm accent","aria-hidden":"true",children:Pd(t.name)}),y.jsxs("span",{className:"msg-text",children:[y.jsx("strong",{className:"msg-name",children:t.name}),y.jsx("span",{className:"msg-preview",children:t.preview||"New message"})]})]}),y.jsx("button",{className:"icon-btn msg-close",title:"Dismiss","aria-label":`Dismiss the notification from ${t.name}`,onClick:()=>i(t.id),children:y.jsx(be,{name:"close",size:15})})]})}function $z(e){return y.jsx(y.Fragment,{children:e.items.map(t=>y.jsx(Bz,{item:t,onOpen:e.onOpen,onDismiss:e.onDismiss},t.id))})}function Uz(e){const t=k.useRef(null),{text:n,size:i=240}=e;return k.useEffect(()=>{if(!t.current||!n)return;const s=t.current;yp(()=>import("./browser-DcF8ESpZ.js").then(a=>a.b),[]).then(a=>{a.toCanvas(s,n,{width:i,margin:2,errorCorrectionLevel:"M",color:{dark:"#000000",light:"#ffffff"}})})},[n,i]),y.jsx("div",{style:{display:"flex",justifyContent:"center",margin:"8px 0"},children:y.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 Wz(e){const t=k.useRef(null),n=k.useRef(null),i=k.useRef(null),s=k.useRef(0),a=k.useRef(!0),[l,c]=k.useState("requesting"),[f,h]=k.useState(""),m=k.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=k.useCallback(w=>{i.current=w;const S=t.current;S.srcObject=w,S.setAttribute("playsinline","true"),S.play();const C=n.current,E=C.getContext("2d"),P=()=>{if(a.current)if(S.readyState>=S.HAVE_ENOUGH_DATA){const A=S.videoWidth||320,T=S.videoHeight||240;C.width=A,C.height=T,E.drawImage(S,0,0,A,T);const L=E.getImageData(0,0,A,T);yp(()=>import("./jsQR-BPP3Ngrl.js").then(j=>j.j),[]).then(j=>{const I=j.default,K=I(L.data,L.width,L.height,{inversionAttempts:"dontInvert"});if(K&&K.data&&a.current){m(),e.onDecode(K.data);return}a.current&&(s.current=requestAnimationFrame(P))})}else s.current=requestAnimationFrame(P)};s.current=requestAnimationFrame(P)},[m,e]);k.useEffect(()=>{if(a.current=!0,!navigator.mediaDevices?.getUserMedia){c("nocamera");return}return navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}}).then(w=>{if(!a.current){w.getTracks().forEach(S=>S.stop());return}c("scanning"),p(w)}).catch(w=>{if(!a.current)return;const S=w.name??"";S==="NotAllowedError"||S==="PermissionDeniedError"?c("denied"):S==="NotFoundError"||S==="DevicesNotFoundError"?c("nocamera"):(c("error"),h(w.message??String(w)))}),()=>{a.current=!1,m()}},[]);const v=()=>{m(),e.onClose()};return y.jsxs("div",{"data-testid":"qr-scanner",style:{display:"flex",flexDirection:"column",gap:12,padding:"12px 0"},children:[(l==="requesting"||l==="scanning")&&y.jsxs(y.Fragment,{children:[y.jsx("p",{className:"muted",style:{margin:0,fontSize:"0.88rem"},children:l==="requesting"?"Requesting camera…":"Point your camera at the QR code."}),y.jsxs("div",{style:{position:"relative",borderRadius:8,overflow:"hidden",background:"#000",minHeight:200},children:[y.jsx("canvas",{ref:n,"data-testid":"scanner-canvas",style:{display:"none"}}),y.jsx("video",{ref:t,"data-testid":"scanner-video",muted:!0,playsInline:!0,style:{width:"100%",display:"block",borderRadius:8}}),l==="scanning"&&y.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:y.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)"}})})]})]}),l==="denied"&&y.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[y.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"var(--text-2)"},children:[y.jsx(be,{name:"shield",size:16}),y.jsx("span",{style:{fontWeight:600,fontSize:"0.9rem"},children:"Camera access denied"})]}),y.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."})]}),l==="nocamera"&&y.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[y.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"var(--text-2)"},children:[y.jsx(be,{name:"close",size:16}),y.jsx("span",{style:{fontWeight:600,fontSize:"0.9rem"},children:"No camera available"})]}),y.jsx("p",{className:"muted",style:{margin:0,fontSize:"0.88rem"},children:"No camera was found on this device. Paste the invite text below instead."})]}),l==="error"&&y.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:y.jsxs("p",{style:{margin:0,fontSize:"0.85rem",color:"var(--danger, #e53)"},children:["Camera error: ",f||"unknown error",". Paste the invite text below instead."]})}),y.jsx("button",{className:"btn",style:{justifyContent:"center"},onClick:v,children:l==="scanning"?y.jsxs(y.Fragment,{children:[y.jsx(be,{name:"close",size:14}),"Cancel scan"]}):y.jsxs(y.Fragment,{children:[y.jsx(be,{name:"close",size:14}),"Close scanner"]})})]})}function Hz(e){const[t,n]=k.useState("generate"),[i,s]=k.useState("one_time"),[a,l]=k.useState(""),[c,f]=k.useState(null),[h,m]=k.useState("one_time"),[p,v]=k.useState(""),[w,S]=k.useState(""),[C,E]=k.useState(!1),[P,A]=k.useState(null),[T,L]=k.useState(null),[j,I]=k.useState(!1),[K,B]=k.useState(null),_=k.useRef(!1),N=async()=>{if(!_.current){_.current=!0,E(!0),L(null),A(null);try{m(i),f(await e.onCreate(i,i==="one_time"&&a.trim()||void 0))}catch(V){L(V instanceof Error?V.message:String(V))}finally{_.current=!1,E(!1)}}},$=y.jsx(pS,{className:"modal-tabs",label:"Invite mode",options:[{id:"generate",label:"Generate invite"},{id:"accept",label:"Accept invite"}],value:t,onChange:n,idPrefix:"invite-tab",panelId:"invite-panel"});return y.jsx(ra,{title:t==="generate"?"Invite a contact":"Accept an invite",onClose:()=>{_.current||e.onClose()},tabs:$,children:y.jsxs("div",{id:"invite-panel",role:"tabpanel","aria-labelledby":`invite-tab-${t}`,children:[t==="generate"&&!c&&y.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:13},children:[y.jsxs("p",{className:"muted","data-testid":"invite-identity",style:{margin:0,fontSize:"0.85rem"},children:["Creating as ",y.jsx("strong",{children:e.identity.name})," · ",y.jsxs("span",{className:"mono",children:["@",H0(e.identity.cid)]})]}),y.jsxs("div",{role:"radiogroup","aria-label":"Invite kind",style:{display:"flex",flexDirection:"column",gap:7},children:[y.jsxs("label",{children:[y.jsx("input",{type:"radio",name:"invite-kind",checked:i==="one_time",onChange:()=>s("one_time")})," One person (one time)"]}),y.jsxs("label",{children:[y.jsx("input",{type:"radio",name:"invite-kind",checked:i==="public",onChange:()=>s("public")})," Reusable public invite"]})]}),i==="one_time"?y.jsxs(y.Fragment,{children:[y.jsx("p",{className:"muted",style:{margin:0,fontSize:"0.9rem"},children:"Optionally name the person or agent this invite is for."}),y.jsx("input",{className:"field",value:a,onChange:V=>l(V.target.value),placeholder:"Their name (optional), e.g. Bob",maxLength:64})]}):y.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."}),y.jsx("button",{className:"btn primary",style:{justifyContent:"center"},disabled:C,onClick:()=>void N(),children:C?"Generating…":i==="public"?"Create public invite":"Generate invite"}),i==="public"&&y.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[y.jsx("h4",{style:{margin:0,fontSize:"0.9rem"},children:"Active reusable invites"}),e.invites.filter(V=>V.mode==="public").length===0&&y.jsx("p",{className:"muted",style:{margin:0},children:"None right now."}),e.invites.filter(V=>V.mode==="public").map(V=>y.jsxs("div",{"data-testid":"public-invite-row",style:{padding:"8px 10px",background:"var(--inset)",borderRadius:7},children:[y.jsx("span",{className:"mono",children:V.invite_id}),y.jsxs("p",{className:"muted",children:["Created ",V.created?Xj(V.created):"unknown"," · Active until revoked · No expiry"]}),K===V.invite_id?y.jsxs("span",{children:[y.jsx("button",{className:"btn sm danger",onClick:()=>void e.onRevoke(V.invite_id).then(()=>(B(null),e.onRefresh())).catch(he=>L(String(he))),children:"Confirm revoke"})," ",y.jsx("button",{className:"btn sm",onClick:()=>B(null),children:"Keep it"})]}):y.jsx("button",{className:"btn sm",onClick:()=>B(V.invite_id),children:"Revoke"})]},V.invite_id))]}),P&&y.jsx("p",{className:"muted",children:P}),T&&y.jsx("p",{className:"onb-error",children:T})]}),t==="generate"&&c&&y.jsxs(y.Fragment,{children:[y.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 ${a.trim()||"your contact"}. It can be redeemed once.`}),y.jsx("textarea",{className:"field mono","data-testid":"invite-result-text",readOnly:!0,rows:5,value:c,onFocus:V=>V.currentTarget.select()}),h==="one_time"&&y.jsx(Uz,{text:c}),y.jsxs("button",{className:"btn primary",onClick:()=>void navigator.clipboard.writeText(c).then(()=>A("Copied to clipboard.")),children:[y.jsx(be,{name:"copy",size:15}),"Copy invite"]}),h==="public"&&y.jsx("button",{className:"btn","data-testid":"done-hide-invite",onClick:()=>{f(null),l(""),e.onRefresh()},children:"Done — hide invite"}),P&&y.jsx("p",{className:"muted",children:P})]}),t==="accept"&&y.jsxs("form",{style:{display:"flex",flexDirection:"column",gap:13},onSubmit:V=>{V.preventDefault(),!(!p.trim()||C)&&(E(!0),L(null),e.onAccept(p.trim(),w.trim()||void 0).then(()=>{A("Invite accepted — the contact will appear once the sender verifies your identity."),v(""),S("")}).catch(he=>L(String(he))).finally(()=>E(!1)))},children:[y.jsx("p",{className:"muted",children:"Paste the invite you received, or scan a QR code."}),j?y.jsx(Wz,{onDecode:V=>{v(V),I(!1)},onClose:()=>I(!1)}):y.jsxs("button",{type:"button",className:"btn",onClick:()=>I(!0),children:[y.jsx(be,{name:"monitor",size:15}),"Scan QR code"]}),y.jsx("textarea",{className:"field mono","aria-label":"Invite",rows:5,value:p,onChange:V=>v(V.target.value),placeholder:"Paste invite text…"}),y.jsx("input",{className:"field",value:w,onChange:V=>S(V.target.value),placeholder:"Rename them (optional)",maxLength:64}),y.jsx("button",{className:"btn primary",type:"submit",disabled:C||!p.trim(),children:C?"Connecting…":"Add contact"}),P&&y.jsx("p",{className:"muted",children:P}),T&&y.jsx("p",{className:"onb-error",children:T})]})]})})}function Kz(e){const[t,n]=k.useState(e.identity.bio??""),[i,s]=k.useState(!1),[a,l]=k.useState(null),[c,f]=k.useState(e.push.preview),h=FA(),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 y.jsxs(ra,{title:"Settings",onClose:e.onClose,wide:!0,children:[y.jsxs("div",{children:[y.jsx("span",{className:"lbl",children:"Display name"}),y.jsx("input",{className:"field",readOnly:!0,value:e.identity.name})]}),y.jsxs("div",{children:[y.jsx("span",{className:"lbl",children:"Your address"}),y.jsx("input",{className:"field mono",readOnly:!0,value:e.identity.cid,onFocus:p=>p.currentTarget.select()}),y.jsx("p",{className:"muted",children:"Your public address on ours. Share an invite to connect more easily."})]}),y.jsxs("div",{children:[y.jsx("span",{className:"lbl",children:"Public bio"}),y.jsx("textarea",{className:"field",rows:3,value:t,onChange:p=>{n(p.target.value),s(!1),l(null)}}),y.jsx("button",{className:"btn sm",onClick:()=>{l(null),e.onSaveBio(t).then(()=>s(!0)).catch(p=>l(String(p)))},children:i?"Saved":"Save bio"}),a&&y.jsx("p",{className:"onb-error",children:a})]}),y.jsxs("label",{style:{display:"flex",gap:9},children:[y.jsx("input",{type:"checkbox",checked:e.dark,onChange:e.onToggleDark})," Dark mode"]}),y.jsxs("div",{style:{borderTop:"1px solid var(--line)",paddingTop:16},children:[y.jsx("h4",{children:"Notifications"}),y.jsx("p",{className:e.push.status==="needs-permission"||e.push.status==="error"?"onb-error":"muted",children:m}),h&&h!==m&&y.jsx("p",{className:"muted","data-testid":"push-platform-guidance",children:h}),y.jsxs("fieldset",{style:{border:0,padding:0,margin:"12px 0"},children:[y.jsx("legend",{className:"lbl",children:"Lock-screen preview"}),y.jsxs("label",{style:{display:"block",marginTop:7},children:[y.jsx("input",{type:"radio",name:"push-preview",checked:c==="full",onChange:()=>f("full")})," Full — sender and message text or filename"]}),y.jsxs("label",{style:{display:"block",marginTop:7},children:[y.jsx("input",{type:"radio",name:"push-preview",checked:c==="private",onChange:()=>f("private")})," Private — generic content only"]})]}),y.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."}),y.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:e.push.status==="on"?y.jsxs(y.Fragment,{children:[y.jsx("button",{className:"btn",disabled:e.busy,onClick:()=>void e.onPushAction("disable",c),children:"Disable notifications"}),y.jsx("button",{className:"btn",disabled:e.busy,onClick:()=>void e.onPushAction("repair",c),children:"Repair"}),c!==e.push.preview&&y.jsx("button",{className:"btn primary",disabled:e.busy,onClick:()=>void e.onPushAction("enable",c),children:"Save preview"})]}):y.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"})})]}),y.jsxs("div",{style:{borderTop:"1px solid var(--line)",paddingTop:16},children:[y.jsx("h4",{children:"App status"}),y.jsx("p",{className:"muted",children:e.offline?"Offline — reconnecting. Message and identity data are never cached.":"Online."}),e.onInstall&&y.jsx("button",{className:"btn",onClick:e.onInstall,children:"Install app"}),e.updateAvailable&&y.jsx("button",{className:"btn primary",onClick:e.onReloadUpdate,children:"Reload to update"})]}),y.jsxs("div",{style:{borderTop:"1px solid var(--line)",paddingTop:16},children:[y.jsx("h4",{children:"Build"}),y.jsx("input",{className:"field mono",readOnly:!0,value:e.build?`${e.build.version} · ${e.build.sha}`:"Loading…"})]})]})}function qz(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 Xz="4147c1312acd159c083bdbc11871c64777d7f915",Yz=15*6e4,Gz=6e4,Qz=qz;async function Jz(){try{const e=await fetch("/version.json",{cache:"no-store"});return e.ok?await e.json():null}catch{return null}}function Zz(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 f=await Jz(),h=Qz(Xz,f,t,Date.now(),Gz);h==="newer-available"?(e.onUpdateAvailable(),navigator.serviceWorker?.getRegistration().then(m=>m?.update())):h==="stuck"&&!i&&(i=!0,e.onStuck(f.sha))},a=setTimeout(()=>void s(),5e3),l=setInterval(()=>void s(),Yz),c=()=>{document.visibilityState==="visible"&&s()};return document.addEventListener("visibilitychange",c),()=>{clearTimeout(a),clearInterval(l),document.removeEventListener("visibilitychange",c),navigator.serviceWorker?.removeEventListener("controllerchange",n)}}async function e4(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 t4(){const e=new URL(location.href);e.searchParams.has("v")&&(e.searchParams.delete("v"),history.replaceState(null,"",e.pathname+e.search+e.hash))}const qx=[0,100,400,1e3,3e3,6e3],Xx=e=>new Promise(t=>setTimeout(t,e)),Yx={delivered:1,read:2},Gx="ours-dark-v3",Qx="#chat-message-",Jx=Jl,n4=e=>e instanceof Error&&e.message?e.message:"The request could not be completed.";function CS(e,t){const n=new Map,i=[];for(const s of e?.messages??[]){const a={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,peerCid:s.peer_cid,receipt:s.receipt??void 0,receiptless:s.dir==="out"&&!s.wire_id,messageKind:s.message_kind,typed:s.typed};s.wire_id?n.set(s.wire_id,a):i.push(a)}for(const s of t){const a=n.get(s.wire_id);n.set(s.wire_id,{dir:s.dir,text:"",date:s.date,read:a?.read??s.dir==="out",wireId:s.wire_id,replyTo:s.reply_to?{wireId:s.reply_to.wire_id}:a?.replyTo??null,kind:"file",filename:s.filename,mime:s.mime,receipt:a?.receipt})}return[...i,...n.values()].sort((s,a)=>{const l=Jx(s.date)-Jx(a.date);return l===0?s.wireId.localeCompare(a.wireId):l})}function r4(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 i4(e,t){return[...e.contacts.contacts.map(i=>{const s=e.contacts.roots?.[i.container_id],a=sr(e,i.container_id),c=CS(a,t[i.container_id]??[]).at(-1),f=eu(i);return{id:i.container_id,name:f,announcedName:i.name,initials:Pd(f),when:c?qj(c.date):"",activityAt:c?.date??"",last:c?.kind==="file"?nN(c.filename,c.mime):a?.preview??c?.text??"",unread:a?.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=eu(i);return{id:`pending:${i.container_id}`,name:s,announcedName:i.name,initials:Pd(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 o4(){return y.jsx(s4,{})}function s4(){const e=k.useRef(MA(Cf(window.location.pathname))).current,[t,n]=k.useReducer(gv,e),[i,s]=k.useState(null),a=k.useRef(0),l=k.useRef(null),c=k.useRef(t),f=k.useRef(new RA),h=k.useRef(null),m=k.useRef(new Map),p=k.useRef(new Map),[v,w]=k.useState({}),S=k.useRef(v),[C,E]=k.useState(null),P=k.useRef(new Set),[A,T]=k.useState(null),L=k.useRef(A),j=k.useRef(!1),[I,K]=k.useState([]),[B,_]=k.useState(null),[N,$]=k.useState(()=>localStorage.getItem(Gx)!=="0"),[V,he]=k.useState(null),[J,Z]=k.useState({supported:!1,offline:!navigator.onLine,updateAvailable:!1,registration:null}),[ve,ke]=k.useState({status:"unsupported",preview:"full"}),[Q,pe]=k.useState(!1),R=k.useRef(!1),[F,Y]=k.useState(()=>window.location.hash.startsWith(Qx)),{toasts:M,push:se,dismiss:ue,clear:ae}=Vz(),me=k.useCallback(W=>{c.current=gv(c.current,W),n(W)},[]),Se=k.useCallback(W=>{j.current=W},[]);k.useEffect(()=>{c.current=t},[t]),L.current=A,S.current=v,k.useMemo(()=>(Pv(Object.values(v).flat()),null),[v]),k.useEffect(()=>(document.documentElement.classList.toggle("theme-dark",N),()=>document.documentElement.classList.remove("theme-dark")),[N]);const xe=k.useCallback(W=>me({type:"error",message:n4(W)}),[me]),Ue=k.useCallback(()=>{const W=c.current;return{visibility:document.visibilityState,appRoute:W.route.name==="chats"?"chats":"other",selectedContactCid:or(W),desktopLayout:h.current?.matches??window.innerWidth>=861,mobileDetailOpen:W.mobileDetailOpen,conversationCoveringDialogOpen:L.current!==null}},[]),Fe=k.useCallback(async(W,ge=!0)=>{try{const ie=await Ye.conversation(W);return me({type:"page",contactCid:W,page:ie}),ie}catch(ie){return ge&&xe(ie),null}},[me,xe]),Ke=k.useCallback(async(W,ge=!0)=>{try{const ie=await Ye.files(W);return Pv(ie.files),w(ye=>({...ye,[W]:ie.files})),ie.files}catch(ie){return ge&&xe(ie),null}},[xe]);k.useEffect(()=>Zz({onUpdateAvailable:()=>Z(W=>({...W,updateAvailable:!0})),onStuck:W=>{e4(W)}}),[]);const ot=k.useCallback(async()=>{const W=await Ye.contacts();return me({type:"contacts",contacts:{...W,pending:W.pending??[]}}),W},[me]),st=k.useCallback(async()=>{try{const[W,ge,ie]=await Promise.all([Ye.identity(),Ye.contacts(),Ye.buildInfo()]),ye={...ge,pending:ge.pending??[]};return c.current.identity&&c.current.identity.cid!==W.cid&&(Zj(),S.current={},w({})),me({type:"snapshot",identity:W,contacts:ye}),_(ie),await Promise.all(ye.contacts.flatMap(De=>[Fe(De.container_id,!1),Ke(De.container_id,!1)])),or(c.current)}catch(W){return xe(W),null}},[me,Ke,Fe,xe]),Ft=k.useCallback(async W=>{await f.current.request(W,async()=>{PA(W,Ue())&&(await Ye.markRead(W),await Promise.all([Fe(W),ot()]))}).catch(xe)},[Ue,ot,Fe,xe]),Zt=k.useCallback(async W=>{const ge=++a.current;l.current?.abort();const ie=new AbortController;l.current=ie,s(null),ae(W),Ke(W,!1);let ye;try{ye=await Ye.conversation(W,void 0,ie.signal)}catch(ht){ie.signal.aborted||xe(ht);return}if(ie.signal.aborted||ge!==a.current)return;me({type:"page",contactCid:W,page:ye});const De=ye.unread;let de=[...ye.messages],qe=ye.nextBefore;const wt=new Set,ft=new Set(de.map(ht=>ht.wire_id).filter(Boolean)),Je=()=>de.filter(ht=>ht.dir==="in"&&!ht.read);for(;Je().length<De&&qe&&!wt.has(qe);){wt.add(qe);let ht;try{ht=await Ye.conversation(W,qe,ie.signal)}catch{break}if(ie.signal.aborted||ge!==a.current)return;const Ht=ht.messages.filter(Pt=>!Pt.wire_id||!ft.has(Pt.wire_id));if(!Ht.length&&ht.nextBefore===qe)break;for(const Pt of Ht)Pt.wire_id&&ft.add(Pt.wire_id);de=[...Ht,...de],me({type:"older_page",contactCid:W,page:ht,newer:ye.messages}),qe=ht.nextBefore}const yt=Je()[0];yt?.wire_id&&ge===a.current&&!ie.signal.aborted&&s({contactCid:W,wireId:yt.wire_id,count:De}),await Ft(W)},[ae,me,Ft,Ke,xe]),et=k.useCallback(async(W,ge,ie="page")=>{const ye=`page:${W}:${ie}`,De=(m.current.get(ye)??0)+1;m.current.set(ye,De);for(const de of qx){if(de&&await Xx(de),m.current.get(ye)!==De)return;const qe=await Fe(W,!1);if(qe&&ge(qe))return}},[Fe]),Wt=k.useCallback(async(W,ge)=>{const ie=`file:${W}`,ye=(m.current.get(ie)??0)+1;m.current.set(ie,ye);for(const De of qx)if(De&&await Xx(De),m.current.get(ie)!==ye||(await Ke(W,!1))?.some(qe=>qe.wire_id===ge))return},[Ke]),Tn=k.useRef(!1);k.useEffect(()=>{if(!F||!t.loaded)return;const W=decodeURIComponent(window.location.hash.slice(Qx.length)),ge=or(c.current);if(!W||!ge){Y(!1);return}if(sr(c.current,ge)?.messages.some(ie=>ie.wire_id===W)){Y(!1);return}Tn.current||(Tn.current=!0,et(ge,ie=>ie.messages.some(ye=>ye.wire_id===W),`anchor:${W}`).catch(()=>{}).finally(()=>Y(!1)))},[F,et,t.loaded,t.pages]),k.useMemo(()=>(Jj({url:W=>Object.values(S.current).flat().find(ie=>ie.wire_id===W)?.available?Ye.mediaUrl(W):null,bytes:async W=>{if(!Object.values(S.current).flat().find(ye=>ye.wire_id===W)?.available)return null;const ie=await fetch(Ye.mediaUrl(W),{cache:"no-store",credentials:"same-origin"});if(!ie.ok)throw new Error(`Media request failed (HTTP ${ie.status})`);return new Uint8Array(await ie.arrayBuffer())},fetch:async W=>{const ge=Object.values(S.current).flat().find(ie=>ie.wire_id===W);if(!ge)throw new Error("Media record is unavailable");await Ye.fetchFiles([W]),await Ke(ge.contact_id)}}),null),[Ke]),k.useEffect(()=>{let W;LA(ie=>{Z(ie),xv(ie.registration).then(ke).catch(()=>ke(ye=>({...ye,status:"error"})))},{shouldDeferReload:()=>j.current||L.current!==null}).then(ie=>{W=ie}).catch(xe);const ge=ie=>{ie.preventDefault(),he(ie)};return window.addEventListener("beforeinstallprompt",ge),()=>{W?.(),window.removeEventListener("beforeinstallprompt",ge)}},[xe]),k.useEffect(()=>UA(),[]),k.useEffect(()=>{if(!(!J.registration||ve.status!=="on"))return TA({registration:J.registration,identity:Ye.identity,onEvent:O0})},[ve.status,ve.bindingId,J.registration]),k.useEffect(()=>{const W=()=>ke(ge=>({...ge,status:"error"}));return window.addEventListener("ours-push-repair-required",W),()=>window.removeEventListener("ours-push-repair-required",W)},[]),k.useEffect(()=>{window.location.pathname==="/"&&window.history.replaceState(null,"",Qr()),h.current=window.matchMedia("(min-width: 861px)");const W=()=>{const de=Cf(window.location.pathname);l.current?.abort(),a.current+=1,s(null),me({type:"route",route:de}),R.current&&de.name==="chats"&&de.contactCid&&(R.current=!1,requestAnimationFrame(()=>document.querySelector("[data-contact-trigger]")?.focus({preventScroll:!0}))),de.name==="chats"&&de.contactCid&&Zt(de.contactCid)},ge=()=>{if(document.visibilityState!=="visible")return;const de=or(c.current);de&&Ft(de),B0(),J.registration&&xv(J.registration).then(ke).catch(()=>ke(qe=>({...qe,status:"error"})))};window.addEventListener("popstate",W),document.addEventListener("visibilitychange",ge);const ie=de=>{const qe=de.type==="sync_required"?`${de.type}:${de.reason}`:de.type==="receipt_received"?`${de.type}:${de.contact_id}:${de.kind}:${de.wire_ids.join(",")}`:`${de.type}:${de.contact_id}:${de.wire_id}`,wt=Date.now(),ft=p.current.get(qe)??0;p.current.set(qe,wt);for(const[Je,yt]of p.current)wt-yt>6e4&&p.current.delete(Je);wt-ft<6e4||(async()=>{if(de.type==="sync_required"){await st();return}if(ot().catch(xe),de.type==="file_received"){await Wt(de.contact_id,de.wire_id);const Je=c.current.contacts.contacts.find(yt=>yt.container_id===de.contact_id);or(c.current)!==de.contact_id&&Je&&se(de.contact_id,eu(Je),"New file");return}if(de.type==="message_received"){const Je=c.current.contacts.contacts.find(yt=>yt.container_id===de.contact_id);await et(de.contact_id,yt=>yt.messages.some(ht=>ht.wire_id===de.wire_id),`message:${de.wire_id}`),or(c.current)===de.contact_id?await Ft(de.contact_id):Je&&se(de.contact_id,eu(Je),"New message");return}me({type:"receipt",contactCid:de.contact_id,kind:de.kind,wireIds:de.wire_ids}),await et(de.contact_id,Je=>de.wire_ids.every(yt=>{const ht=Je.messages.find(Ht=>Ht.wire_id===yt);return!!ht?.receipt&&Yx[ht.receipt]>=Yx[de.kind]}),`receipt:${de.wire_ids.join(",")}`)})().catch(xe)},ye=SA(ie),De=bA(ie,de=>me({type:"connection",connection:de}));return st().then(de=>{de&&Zt(de)}),()=>{De(),ye(),window.removeEventListener("popstate",W),document.removeEventListener("visibilitychange",ge)}},[et,Wt,me,Ft,Zt,se,ot,st,xe,J.registration]);const zt=(W,ge,ie)=>{window.history.pushState({oursMessenger:!0},"",ge),me({type:"route",route:W,mobileDetailOpen:ie})},en=async W=>{zt({name:"chats",contactCid:W},Qr(W),!0),await Zt(W)},bt=async W=>{const ge=sr(c.current,W);if(!(!ge?.nextBefore||P.current.has(W))){P.current.add(W),E(W);try{const ie=await Ye.conversation(W,ge.nextBefore);me({type:"older_page",contactCid:W,page:ie,newer:ge.messages})}catch(ie){xe(ie)}finally{P.current.delete(W),E(null)}}},Jn=k.useCallback(async(W,ge)=>{const ie=c.current,ye=or(ie);if(!ye)return"unavailable";const De=sr(ie,ye);if(!De)return"unavailable";if(De.messages.some(ft=>ft.wire_id===W))return"found";let de=De.nextBefore;const qe=new Set;let wt=[...De.messages];for(let ft=0;de&&!qe.has(de)&&ft<10;ft++){qe.add(de);const Je=await Ye.conversation(ye,de,ge);if(ge.aborted||c.current.identity?.cid!==ie.identity?.cid||or(c.current)!==ye)return"unavailable";if(wt=[...Je.messages,...wt],Je.messages.some(yt=>yt.wire_id===W))return me({type:"older_page",contactCid:ye,page:Je,newer:wt}),"found";de=Je.nextBefore}return de?"limit":"unavailable"},[me]),We=or(t),Ar=t.contacts.contacts.find(W=>W.container_id===We),G=k.useMemo(()=>i4(t,v),[t,v]),ee=G.find(W=>W.id===We)??null,Re=We?CS(sr(t,We),v[We]??[]):[],je=t.identity;k.useEffect(()=>{if(!t.loaded)return;const W=Cf(window.location.pathname),ge=W.name==="chats"||W.name==="contact"?W.contactCid:null;!ge||t.contacts.contacts.some(ie=>ie.container_id===ge)||(window.history.replaceState({oursMessenger:!0},"",Qr()),i?.contactCid===ge&&(l.current?.abort(),a.current+=1,s(null)))},[t.loaded,t.contacts.contacts,i]);const ze=t.loaded?We&&!sr(t,We)||F?"updating":t.connection!=="live"?"connecting":null:"connecting",at=async(W,ge=ve.preview)=>{if(J.registration){pe(!0),ke(ie=>({...ie,status:"repairing",preview:ge}));try{ke(await(W==="enable"?V0(J.registration,{preview:ge}):W==="repair"?BA(J.registration,ge):$A(J.registration,ve)))}catch(ie){ke(ye=>({...ye,status:"error"})),xe(ie)}finally{pe(!1)}}},Mt=()=>{K([]),T("invite"),Ye.invites().then(K).catch(xe)};return t.route.name==="not_found"?y.jsxs("div",{className:"centered-screen",children:[y.jsx("h1",{children:"Page not found"}),y.jsx("button",{className:"btn primary",onClick:()=>zt({name:"chats",contactCid:null},Qr()),children:"Open chats"})]}):je?y.jsx("div",{className:N?"theme-dark":"",style:{height:"100%"},children:y.jsxs("div",{className:"app signal-app",children:[y.jsxs("main",{className:"section signal-stage"+(t.mobileDetailOpen?" show-detail":""),children:[y.jsx(Nz,{contacts:G,roots:r4(t.contacts),selected:We,onSelect:W=>{W.startsWith("pending:")||en(W)},onInvite:Mt,onSettings:()=>T("settings"),onApprovePending:async W=>{try{return await Ye.respondToIntroduction(W,"approve"),await st(),!0}catch(ge){return xe(ge),!1}},onRejectPending:async W=>{try{return await Ye.respondToIntroduction(W,"reject"),await st(),!0}catch(ge){return xe(ge),!1}}}),t.route.name==="contact"&&ee?y.jsx(Mz,{contact:ee,messages:Re,onBack:()=>{R.current=!0,jA(window.history.state)==="back"?window.history.back():(window.history.replaceState({oursMessenger:!0},"",Qr(ee.id)),me({type:"route",route:{name:"chats",contactCid:ee.id},mobileDetailOpen:!0}),requestAnimationFrame(()=>document.querySelector("[data-contact-trigger]")?.focus({preventScroll:!0})),R.current=!1)},onRename:W=>void Ye.renameContact(ee.id,W).then(st).catch(xe),onRemove:()=>{confirm(`Remove “${Ar?.name??"contact"}”?`)&&Ye.removeContact(ee.id).then(()=>(window.history.replaceState({oursMessenger:!0},"",Qr()),me({type:"route",route:{name:"chats",contactCid:null},mobileDetailOpen:!1}),st())).catch(xe)},onOpenMessage:W=>{zt({name:"chats",contactCid:ee.id},Qr(ee.id),!0);let ge=12;const ie=()=>{const ye=document.getElementById(`chat-message-${encodeURIComponent(W)}`),De=ye?.closest(".messages");if((!ye||!De||De.clientHeight<=0)&&ge-- >0){requestAnimationFrame(ie);return}if(!ye||!De)return;const de=ye.getBoundingClientRect(),qe=De.getBoundingClientRect(),wt=De.scrollTop+de.top-qe.top-Math.max(0,(De.clientHeight-de.height)/2),ft=Math.max(0,Math.min(wt,De.scrollHeight-De.clientHeight));De.scrollTo({top:ft,behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"})};requestAnimationFrame(ie)},indexOffset:sr(t,ee.id)?.hasMore?Math.max(1,(sr(t,ee.id)?.total??Re.length)-Re.length):0,onSendText:async(W,ge)=>{const ie=await Ye.send(ee.id,W,ge);return await Fe(ee.id,!1),ie.wire_id??void 0},onSendFile:async(W,ge)=>{await Ye.sendFile(ee.id,new Blob([W.bytes],{type:W.mime}),W.filename,W.mime,ge),await Promise.all([Ke(ee.id),Fe(ee.id,!1)])}}):y.jsx(Dz,{contact:ee,messages:Re,syncing:ze,unreadOpen:i?.contactCid===We?i:null,hiddenEarlier:sr(t,We??"")?.hasMore?Math.max(1,(sr(t,We??"")?.total??Re.length)-Re.length):0,onRevealMessage:Jn,onLoadEarlier:We&&C!==We?()=>void bt(We):void 0,onBack:()=>{l.current?.abort(),a.current+=1,s(null),zt({name:"chats",contactCid:null},Qr(),!1)},onOpenContact:()=>{We&&zt({name:"contact",contactCid:We},AA(We),!0)},onDraftChange:Se,onSend:async(W,ge,ie)=>{if(!We)return;const ye=We,De=await Ye.send(ye,W,ge,ie);return me({type:"sent_message",contactCid:ye,message:{dir:"out",text:W,date:new Date().toISOString(),read:!0,wire_id:De.wire_id??"",receipt:null,reply_to:ge?{wire_id:ge}:null}}),De.wire_id?et(ye,de=>de.messages.some(qe=>qe.wire_id===De.wire_id),`send:${De.wire_id}`):ot().catch(xe),De.wire_id??void 0},onLoadCommands:async(W,ge)=>Ye.commands(W,ge),onSendCommand:async(W,ge,ie,ye,De,de)=>{const qe=await Ye.sendCommand(W,ge,ie,ye,De,de);return Fe(W,!1),qe},onSendFile:async(W,ge)=>{We&&(await Ye.sendFile(We,new Blob([W.bytes],{type:W.mime}),W.filename,W.mime,ge),await Promise.all([Ke(We),Fe(We,!1)]))},onFetchFile:async W=>{await Ye.fetchFiles([W]),We&&await Ke(We)}},We??"no-conversation")]}),y.jsxs("div",{className:"app-banners",children:[J.offline&&y.jsx("div",{className:"banner warn",role:"status","aria-live":"polite",children:"Offline — reconnecting to the network…"}),t.connection!=="live"&&y.jsx("div",{className:"banner warn",role:"status","aria-live":"polite",children:t.connection==="retrying"?"Live updates interrupted — reconnecting…":"Connecting to live updates…"}),J.updateAvailable&&y.jsxs("div",{className:"banner info",children:[y.jsx("span",{role:"status","aria-live":"polite",children:"A new version is available."}),y.jsx("span",{className:"banner-actions",children:y.jsx("button",{className:"linkbtn",onClick:()=>{J.registration&&yv(J.registration)},children:"Restart now"})})]}),y.jsx($z,{items:M,onDismiss:ue,onOpen:W=>void en(W)})]}),A==="invite"&&y.jsx(Hz,{identity:je,invites:I,onRefresh:async()=>K(await Ye.invites()),onCreate:async(W,ge)=>(await Ye.createInvite(W,ge)).blob,onAccept:async(W,ge)=>{await Ye.addContact(W,ge),await st()},onRevoke:async W=>{await Ye.revokeInvite(W)},onClose:()=>{T(null),st()}}),A==="settings"&&y.jsx(Kz,{identity:je,push:ve,workerSupported:J.supported,busy:Q,offline:J.offline,updateAvailable:J.updateAvailable,build:B,dark:N,onToggleDark:()=>$(W=>(localStorage.setItem(Gx,W?"0":"1"),!W)),onSaveBio:async W=>{await Ye.setBio(W),await st()},onPushAction:at,onInstall:V?()=>void V.prompt().then(()=>he(null)):void 0,onReloadUpdate:()=>{J.registration&&yv(J.registration)},onClose:()=>{L.current=null,T(null),We&&Ft(We)}}),t.error&&y.jsxs("div",{className:"banner error",role:"alert","aria-live":"assertive",children:[t.error,y.jsx("button",{className:"linkbtn",onClick:()=>me({type:"error",message:null}),children:"dismiss"})]})]})}):y.jsx("div",{className:N?"theme-dark":"",style:{height:"100%"},children:y.jsx("div",{className:"centered-screen",children:y.jsx("p",{className:"muted",children:"Loading…"})})})}t4();const ES=document.getElementById("root");if(!ES)throw new Error("missing #root");wC.createRoot(ES).render(y.jsx(yR,{reducedMotion:"user",children:y.jsx(o4,{})}));export{yp as _,oh as g};
332
+ //# sourceMappingURL=index-CnTZR2tj.js.map